Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Format to represent a tree or node graph

I had build a tree to represent multiple connections between pages and links. And now i want to print the tree to a document.I can do it to a txt file with some sort of format but Is there any good formats to represent trees or node graphs ? And any good Java framework or library to do it?

like image 573
tt0686 Avatar asked Nov 20 '25 10:11

tt0686


1 Answers

Check out Graphviz and more specifically the dot command. This command takes a text file and renders it as a graph. So, you could write out your data as a text file in the dot format and then could later use that with the dot command to visualize it if you wanted.

A simple example of the dot format given in the PDF link above is below.

digraph G {
  main -> parse -> execute;
  main -> init;
  main -> cleanup;
  execute -> make_string;
  execute -> printf
  init -> make_string;
  main -> printf;
  execute -> compare;
}
like image 67
Nerdtron Avatar answered Nov 21 '25 22:11

Nerdtron



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!