December 2009
Intermediate to advanced
380 pages
9h 2m
English
There are many cases where we have an internal data structure, such as a tree or network graph, that we’d like to visualize for documentation or debugging purposes. This is a perfect opportunity to flex our code generation muscles. We can generate graphical descriptions using the DOT DSL of Graphviz, an open source graph visualization tool.
As an example application, let’s visualize the link interconnections between web pages. It’ll teach us the basics of creating output templates from an input model. From a list of Link objects, we’ll generate a series of from->to edge definitions in a DOT file surrounded by some bookkeeping definitions.
| | digraph testgraph { |
| | node [shape=plaintext, fontsize=12, ... |