fsteeg.com
| notes
| tags
∞ /notes/a-graphviz-compatible-animation-dsl-for-zest | 2009-07-12 | graphviz programming eclipse soc zest
Cross-posted to: https://fsteeg.wordpress.com/2009/07/12/a-graphviz-compatible-animation-dsl-for-zest/
For the fifth milestone of my Google Summer of Code project at Eclipse, I've added support for animated Zest visualizations, representing the animation steps as subgraphs in the DOT input. With this, the DOT input effectively becomes a Graphviz-compatible animation DSL for Zest. To explain what I mean with representing animation steps as subgraphs, let's assume we have a directed DOT graph with global attributes and some nodes:node[label="Node"]; edge[label="Edge" style=dotted]; 1;2;3;4;5We then define a subgraph:
subgraph cluster_0{ 1 -> 2 [label="Dashed" style=dashed] }Now in the resulting Zest visualization, hitting the animation button once results in the structure described by the subgraph:
subgraph cluster_1{ 1 -> 3 }
subgraph cluster_2_end{ 3 -> 4; 3 -> 5 } // "end" for the final stepEach click alters the graph by applying the next subgraph, resulting in the final Zest visualization:
digraph SampleAnimation { node[label="Node"]; edge[label="Edge" style=dotted] //optional 1;2;3;4;5 subgraph cluster_0{ 1 -> 2 [label="Dashed" style=dashed]} subgraph cluster_1{ 1 -> 3 } subgraph cluster_2_end{ 3 -> 4; 3 -> 5} }The same DOT input can still be rendered with Graphviz, providing a static representation of the animation, with the individual steps as subgraphs: