Closed MadaManu closed 3 years ago
You should add the a->HOST and c->HOST links outside of the clusers, the same as in DOT:
Graph g = graph("all")
.graphAttr().with(splines(GraphAttr.SplineMode.POLYLINE))
.with(
graph()
.directed()
.cluster().named("hostname")
.graphAttr().with(Label.of("hostname"))
.with(HOST_NETWORK_NODE)
.with(graph("subGraph1")
.cluster().named("subGraph1")
.graphAttr().with(Rank.dir(LEFT_TO_RIGHT))
.graphAttr().with(Style.FILLED, Color.LIGHTGREY, Label.of("subGraph1"))
.with(node("b"))
.with(node("a"))
)
.with(graph("subGraph2")
.cluster().named("subGraph2")
.graphAttr().with(Rank.dir(LEFT_TO_RIGHT))
.graphAttr().with(Style.FILLED, Color.LIGHTGREY, Label.of("subGraph2"))
.with(node("c"))
.with(node("d"))
)
.with(node("a")
.link(to(HOST_NETWORK_NODE).with(Label.of("link1"))))
.with(node("c")
.link(to(HOST_NETWORK_NODE).with(Label.of("link2"))))
);
Unfortunately, with the JS engines, the resulting layout is not the same as with native dot. I don't know why.
That indeed solved my issue. Thank you @nidi3
Good to hear. @MadaManu So you use native dot engine and don't have an issue with the layout?
No issue with the layout. Works fine using both DOT and FDP engines.
Example:
ERROR in rendering PNG:
Text file generated:
However, the expected generation for the expected outcome I am looking for would be:
GraphvizOnline of expected
Image of expected (note the link between inner nodes of a subgraph to the HOST node.
Same result using both
0.18.0
and0.18.1
.Is there something that I'm missing in my code? How can I achieve the described expected outcome?