Skip to main content

绘制图表。

项目描述

应用图

原始存储库(github)。派皮

app-graphs使用ogdf-python,后者又使用OGDF。app-graphs 根据 .xlsx 格式的数据绘制图表。节点是从给定的应用程序和组件以及接口生成的,其中接口表示节点和连接到它的两条边和源/目标节点。在应用程序及其组件之间以及从提供的有向边生成边。

安装

首先我们需要安装OGDF。这是通过下载 OGDF、解压缩并在 bash 中调用以下命令来完成的:

foo@bar:~ogdf$ mkdir ogdf-debug ogdf-release
foo@bar:~ogdf$ cd ogdf-debug
foo@bar:~ogdf/ogdf-debug$ cmake ..
foo@bar:~ogdf/ogdf-debug$ ccmake ..

调用最后一行时配置 BUILD_SHARED_LIB=ON 和 CMAKE_BUILD_TYPE=Debug。

foo@bar:~ogdf/ogdf-debug$ make

重复上述发布(调试 <-> 发布)。最后一步将 ogdf 添加到路径中。

foo@bar:~ogdf$ export OGDF_BUILD_DIR=~/ogdf/ogdf-debug

作为最后一步安装应用程序图。

pip install app-graphs

用法

from app_graphs import graph

# Define graph instance
my_graph = graph()

# Read data from filename_aplikacije and vmesniki_sheet_name
my_graph.read(filename_apps = r'example.xlsx',              # name of file containing information about apps and components
            apps_sheet_name = 'Aplication list',            # name of sheet in above file
            filename_interfaces = r'example.xlsx',          # name of file containing information about interfaces
            interfaces_sheet_name = 'Integration list',     # name of sheet in above file
            apps = 'Aplications',                           # name of apps names column
            components = 'Components',                      # name of components names column
            source = 'Source',                              # name of interface's source app/component column
            target = 'Target',                              # name of interface's target app/component column
            interface_direction = 'Direction',              # name of interface direction column
            technologies = 'Technology',                    # name of technologies names column
            colors = 'Colors'                               # name of colors column
            )

# Uses ogdf-python to generate graph
my_graph.draw()

# Saves genereted graph in desired format
my_graph.save_svg('test-graph')

例子

下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

app-graphs-0.0.2.tar.gz (16.9 kB 查看哈希

已上传 source

内置分布

app_graphs-0.0.2-py3-none-any.whl (16.6 kB 查看哈希

已上传 py3