How to use special characters in dot file node_id?

I look forward to writing a script that will automatically accept input from a file and declare nodes and edges and create a graph that can be visualized in any visualization software.

I tried point language and graphViz. This language uses a grammar that clearly declares nodes of the graph as follows: node1; , node2; and does not allow any special character other than _ .

Works well in all cases, but when I want to declare a node named java.lang.object , it shows a grammatical error due to availability . , and I can’t change her grammar.

Can someone help me by suggesting another language that can accept input from a text file and can draw a graph for any visualization software.

+4
source share
1 answer

This is pretty easy to do in Graphviz, just put some quotes around the node names. Or you can first define your node with a simple identifier and a label attribute.

Both methods are demonstrated here:

 digraph g { "java.lang.object" -> "my.class"; "my.class" -> "special < chars >"; n1 [label="more.strange<node>names"]; "special < chars >" -> n1; } 
+6
source

Source: https://habr.com/ru/post/1498955/


All Articles