graphviz-java
graphviz-java copied to clipboard
Question: Possibility to visualize the graph directly with java? With tooltips?
The documentation shows how to create (.png)files of the final graph - is there also the possibility to show the graph directly with Java (Swing/AWT)? Of course I can show the png, but I make excessive use of tooltips inside my dot files - it would be great If they will appear!
You can do Graphviz.fromGraph(g).render(Format.PNG).toImage();
to get a BufferedImage directly.
Tooltips are not supported, what exactly would you expect? (Which DOT attribute should result in what thing in the output?)
I use the dot tooltip attribute:
digraph{
A[tooltip="Tooltip for node A"]
B[tooltip="Tooltip for node B"]
A->B
}
See the rendered graph with tooltip at http://magjac.com/graphviz-visual-editor
I see, and you would expect a (J)Panel or similar with the graph and tooltips
Yes, exactly :) I make graph traversal recommendations on top of rdf graphs and visualize the results (i.e. the result explanations) in a generic way as dot representations. There exists so much metadata on a node or an edge that the graph is not readable anymore if I show all this information as labels. Thus, I use the tooltips to show the metadata on demand on top of nicely rendered graphs. Currently I give the dot representation as file and someone can look at it on its own, e.g. with magjac.com/graphviz-visual-editor. But it would be much nicer if I could just show the graph directly inside my application.