What is AJaPaD?
AJaPaD stands for Another Java Parser for DOT. It provides programmers with an ANTLR-based DOT parser and a Java API for creating, manipulating and serializing GraphViz/DOT graphs.
AJaPaD is used in a new experimental pipeline for displaying DOT graphs in ZGRViewer. This pipeline no longer relies on SVG output, but on the enriched DOT output. The advantage of this pipeline is that it preserves all information about the graph's logical structure, something that the SVG pipeline does not (SVG documents only contain graphical entities, but no logical information about the structure of what is being displayed). This knowledge will eventually be exploited to enhance the HCI features provided by ZGRViewer (navigation, search, etc.).
AJaPaD is a work in progress, and does not yet support the whole DOT syntax. It is currently in alpha status. See the to do list.
Download
AJaPaD ships with the latest version of ZGRViewer for now. It is however fully independent of ZGRViewer and ZVTM, and will eventually be released on its own.
How to use AJaPaD?
All AJaPaD classes belong to package net.claribole.zgrviewer.dot.
Parsing DOT files
Parsing a DOT file is achieved by instantiating the ANTLR-based DOT lexer and parser and feeding the lexer an input stream. The resultign AST (abstract syntax tree) can then be transformed into a Graph data structure using a tree walker.
Serializing the data structure
Serializing a graph is simply achieved by calling method toString() on the corresponding Graph object.
Manipulating the data structure
A new graph is created by instantiating Graph and assigning a unique ID to it. Graph attributes can be changed by directly assigning them values.
Nodes, edges, subgraphs, etc. can be added by instantiating them and adding them to the graph. An edge can only be created after the nodes it links have been instantiated.
More information about the AJaPaD API is available in Javadoc format.
To Do List
- A few attributes are not yet managed by the data structure (more specifically attributes that only exist for some GraphViz layout programs).
- Others to be added later...
Credits
- Eric Mounhem (design, implementation) - INRIA project In Situ
- Emmanuel Pietriga (design) - INRIA project In Situ