graph rendering in python (flowchart visualization) -
to visualize sequence of nodes connected edges encoded in python.
looking python library visualize such graph data.
either library written in python or python bindings, ok
(i aware of visustin, looking alternatives)
graphviz best option in opinion.
graphviz premiere graph rendering/layout library; it's mature, stable, open-source, , free of charge. not dedicated flowchart or diagramming package, it's core use case--i.e., efficient , aesthetic rendering of objects comprised of nodes , edges, subsumes flowchart drawing--particularly because api allows user set various constraints on layout encourage rendering in various formats--eg, can require nodes of same level (same number of parents root) rendered in single center-aligned row.
graphviz not python library (it's written in c); there high quality python bindings available.
the python-graphviz library familar pygraphviz, excellent.
the other 2 pydot , yapgvb. have used both of these @ least few times. each smaller pygraphviz (which might advantage depending on use case); in addition neither documented pygraphviz.
fortunately, 3 of these python libraries thin wrappers on graphviz, none conceal lightweight, elegant graphviz syntax (the dot language).
here's code (in graphviz' dot langauge) used create small "flowchart" below:
digraph { node [ fill=cornflowerblue, fontcolor=white, shape=diamond, style=filled]; step1 [ color=darkgoldenrod2, fontcolor=navy, label=start, shape=box]; step2; step3a [ style=filled, fillcolor=grey80, color=grey80, shape=circle, fontcolor=navy]; step1 -> step2; step1 -> step2a; step2a -> step3a; step3; step3a -> step3; step3a -> step2b; step2 -> step2b; step2b -> step3; end [ shape=rectangle, color=darkgoldenrod2, fontcolor=navy]; step3 -> end [label=193]; }
Comments
Post a Comment