Graphviz Double quotes and Parentheses in nodes
Asked Answered
P

1

6

I want to show Double quotes and Parentheses in nodes.

Without using A[label="Rahul(A)"]. I want to show during Rahul(A) -> B

Parlor answered 12/10, 2011 at 15:42 Comment(0)
T
12

The only way I know to do that (without label) is by enclosing the node name between double quotes, and escaping double quotes which are part of the node name:

This works:

"Rahul(A)" -> "Rahul \"B\"";

graphviz output

Trawler answered 12/10, 2011 at 16:26 Comment(2)
In java it is not coming like that. This is what i am doing :- Graphviz gv = new Graphviz(); gv.addln(gv.start_graph()); gv.addln("A(SS) -> B;"); gv.addln("D -> C \"YY\";"); I dont know y it is not workingParlor
If you use a special implementation/library, you should mention that in your question. Otherwise it's assumed you use the original graphviz implementation available on graphviz.org. This being said, you'd of course have to escape special characters one more time for java: gv.addln("\"A(SS)\" -> B;") for example.Trawler

© 2022 - 2024 — McMap. All rights reserved.