CSC212 Lab 10 2014

From dftwiki3
Revision as of 21:52, 28 October 2014 by Thiebaut (talk | contribs) (Created page with "--~~~~ ---- <br /> __TOC__ <br /> =Generating Graphic Representation of Trees= <br /> [http://www.graphviz.org/ Graphviz] is a simple engine for generating very polished image...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

--D. Thiebaut (talk) 22:52, 28 October 2014 (EDT)




Generating Graphic Representation of Trees


Graphviz is a simple engine for generating very polished images of trees or graphs. Graphviz takes the definition of a tree, or of a graph, written in a specific language called DOT and produces images of the tree. Graphviz is sometimes installed on Linux systems, and can be installed as well on Windows and Mac computers (see Graphviz's Download page.)
Let's generate a simple Tree.


digraph "Lab10" {
   8 -> 3;
   3 -> 4;
   3 -> 10;
   3 -> 7;
   8 -> 12;
}


  • As you type, you should see a graph appearing in the right window.

Graphviz tree1.png


GraphvizOnLine.png


  • Right-click on the image and save it as a .png file. You can now use the image in your application.


GraphvizOnLine TreeImage.png


Dot Language


  • If you are interested in learning more about the Dot language for generating trees or graphs with graphviz, you may want to read this Wikipedia page on the Dot Language.