nidi3 / graphviz-java

Use graphviz with pure java
Apache License 2.0
934 stars 107 forks source link

Question about links label #229

Closed cappadavide closed 2 years ago

cappadavide commented 2 years ago

Hi! First of all, thanks for your work, this library is very useful. However I'm having some issues when I try to add link to a node. I would like to add a label to the link when I'm going to create it but addLink method don't let me do this because it returns a MutableNode object. The only way I found it works is to iterate over Source Node's links ( links() ) and adding the attribute Label.of(...) to the link I'm interested of.

Example:

MutableNode newElem = mutNode(z.getIRI().toString());
node.addLink(newElem);
node.links().get(0).add(Label.of("it works"));
node.linkTo().with(Label.of("doesn't work"));

graphexample