Closed ghost closed 3 years ago
Each Node needs to have its own node id, but you can give different nodes the same display name / label. Example N1 and N2 are different nodes, but each of them can have the label “+“ for display. See the Graphviz documentation, it‘s all there.
Each Node needs to have its own node id, but you can give different nodes the same display name / label. Example N1 and N2 are different nodes, but each of them can have the label “+“ for display. See the Graphviz documentation, it‘s all there.
I am aware of your point. The implementation of the library however assigns each node's id with its label and there does not seem to be a solution for this problem. That is the whole point of my issue.
I found a hack around this problem by assigning each node's label with random unique ID and regex the SVG output of the library with original label. Not a really nice solution, but it works for my purpose.
Could you provide an example? The dot file? Cause I use it a lot and I never ever had this problem.
I'm not sure, but do you miss the label
attribute?
node("id 3").with(Label.of("+"))
I want to visualize an AST for the following expression:
1 + 2 + 3 == 6
I would expect something like this to happen:
Notice that I have to pad the label of each node with
ID - *
. If I do not add the padding, the tree would look like followingNotices the operator
+
appears twice but will be treated as only one node and so references itself.How can I bypass this problem?