Closed lucaspcamargo closed 4 years ago
You mean graph().with(node("A").link(to(node("B")).with(Label.of("Edge"))))
?
That would be for Immutable graphs, no?
I tried to add a Label
attribute to the Link returned by node.linkTo(dstnode)
, to no effect.
The problem with your code is you're creating a link with val link = node.linkTo(dstNode)
but it's not added to the node. Adding node.addLink(link)
should help.
But mutGraph().add(mutNode("A").addLink(to(mutNode("B")).with(Label.of("Edge"))));
is still nicer in my opinion.
Oh, I see. The factory APIs makes sense to me now. And your solution is much more elegant. Thank you so much!
Hello. I am trying to get my head around the API but can't figure out how to add an edge between two nodes, with a label for the edge. I would appreciate a nudge in the right direction. I must be missing something.
Edit: what I am doing currently (in Scala):