Closed thombergs closed 4 years ago
I have found a solution to add a link to the main graph by doing this:
mainGraph.add(node("A")
.link("B"))
However, this way, I cannot add attributes (like a label) to the link, because link()
returns a Node
and not a Link
.
How can I add a link between two nodes to the main graph and manipulate the attributes of the link?
Hi, sorry for the late answer. You can do
mainGraph.add(node("A").link(to(node("B")).with(Style.DOTTED)
Hi,
I want to do something like this (click for preview):
But I can't figure out how to add the link (A->B) to the parent graph. When I call
node.addLink()
the link always appears within one of the subgraphs, resulting in this:The link is within the second
subgraph
, causing the arrow not to show the arrowhead.I tried adding the link directly to the parent graph using
graph.addLink()
, but this will always assume that the graph itself is the source of the link, which is not what I want.Is there a way to add a link to the main graph to get the result in the first code snippet above?