Graph layouting via Graphviz
Problem:
You want to display a Graph.
Solution:
Create a simple text file describing your graph and save it with a .dot file extension:
example.dot
graph {
node1 -- node2;
node2 -- node3;
node3 -- node4;
node4 -- node1;
}Afterwards you can use a program of the graphviz package (sudo apt-get install graphviz) in order to visualize the graph. This package contains different layouting programs like dot, neato, fdp (all from the GraphViz project) etc. Simply call one of these programs in order to visualize the graph:
neato_command.sh
neato -Tsvg yourFile.dot -o outputFile.svgOutput from this command:
Check out similar posts by category:
Allgemein
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow