alexandresalome / graphviz Goto Github PK
View Code? Open in Web Editor NEWPHP Graphviz library
Home Page: https://alexandresalome.github.io/graphviz/
License: MIT License
PHP Graphviz library
Home Page: https://alexandresalome.github.io/graphviz/
License: MIT License
Creating a graph with nesting of more than two levels causes an infinite loop.
Create nested graph structure like so.
$graph = new Digraph('G');
$graph->node('A')->edge(['A', 'B']);
$sub1 = $graph
->subgraph('cluster_1')
->node('B')
->edge(['B', 'C']);
$sub2 = $sub1->subgraph('cluster_2')
->node('C')
->edge(['C', 'D']);
$sub3 = $sub2->subgraph('cluster_3')
->node('D');
The final call to Subgraph::createEdge() will create an infinite loop as it is unable to resolve the top level graph.
When creating a node which uses a reserved keyword for its name (eg. graph
, node
, edge
)
The name should be escaped with quotation marks, the current implementation works if your node names are all lower case, however the test does not consider names like Node
etc..
Hi,
Could you tag a stable version 1.0.0? It would let Composer users to use your lib without lowering the minimum-stability of their project. You only have to add a tag in your github repository, see http://getcomposer.org/doc/02-libraries.md#tags
How to do that with your lib
$graph
->set('rankdir', 'LR')
->subgraph('cluster_0')
->set('style', 'filled')
->set('color', 'lightgrey')
->attr('node', array('style' => 'filled', 'color' => 'white'))
->edge(array('a0', 'a1', 'a2', 'a3'))
->set('label', 'process #1')
->end()
->subgraph('cluster_1')
->attr('node', array('style' => 'filled'))
->edge(array('b0', 'b1', 'b2', 'b3'))
->set('color', 'blue')
->end()
->edge(array('start', 'a0'))
->edge(array('start', 'b0'))
->edge(array('a1', 'b3'))
->edge(array('b2', 'a3'))
->edge(array('a3', 'a0'))
->edge(array('a3', 'end'))
->edge(array('b3', 'end'))
->node('AAA', array('label'=> "<<table><tr><td>xfghxhfg</td></tr></table>>"))
;
$dot = $graph->render();
It display html instead take in consideration so it add a " between = and <.
how can I add attributes on a subgraph ?
ex. label on subgraph
Heya ๐
I'm trying to bring up to speed an old project and it has a dependency on an old fork of this repository.
It's been a while since it's been forked and I was wondering if carriege returns are supported in labels. If not, are there plans to add support for them?
Here's the full diff the fork of the library has:
According to https://graphviz.org/doc/info/lang.html the keywords that need to be escaped are node, edge, graph, digraph, subgraph, and strict. At the moment only node
, edge
and graph
are included in the to escape list.
Nice work!
But I have a requirement to read the generated .dot, modify the nodes/edges of the .dot file, and then generate a new .dot
It seems like a new parsing function needs to be added.
Looking forward to your reply.
Best wishes,
Porlockzzz
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.