iipokypatop/graphviz
Composer 安装命令:
composer require iipokypatop/graphviz
包简介
GraphViz graph drawing for mathematical graph/network
README 文档
README
GraphViz graph drawing for mathematical graph/network
The library supports visualizing graph images, including them into webpages, opening up images from within CLI applications and exporting them as PNG, JPEG or SVG file formats (among many others). Because graph drawing is a complex area on its own, the actual layouting of the graph is left up to the excelent GraphViz "Graph Visualization Software" and we merely provide some convenient APIs to interface with GraphViz.
Note: This project is in beta stage! Feel free to report any issues you encounter.
Quickstart examples
Once installed, let's build and display a sample graph:
$graph = new Fhaculty\Graph\Graph(); $blue = $graph->createVertex('blue'); $blue->setAttribute('graphviz.color', 'blue'); $red = $graph->createVertex('red'); $red->setAttribute('graphviz.color', 'red'); $edge = $blue->createEdgeTo($red); $edge->setAttribute('graphviz.color', 'grey'); $graphviz = new Graphp\GraphViz\GraphViz(); $graphviz->display($graph);
The above code will open your default image viewer with the following image:
Install
The recommended way to install this library is through composer. New to composer?
{
"require": {
"graphp/graphviz": "~0.2.0"
}
}
In order to be able to use the graph drawing feature you'll have to
install GraphViz (dot executable). Users of Debian/Ubuntu-based distributions may simply
invoke sudo apt-get install graphviz, Windows users have to
download GraphViZ for Windows and remaining
users should install from GraphViz homepage.
License
Released under the terms of the permissive MIT license.
统计信息
- 总下载量: 492
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-19
