Open
Description
Assuming this example:
Node a1 = node("A1");
Node b1 = node("B1");
Node c1 = node("C1");
Node c2 = node("C2");
List<LinkSource> linkSourcesB = new ArrayList<>();
linkSourcesB.add(a1);
linkSourcesB.add(b1);
linkSourcesB.add(c1);
linkSourcesB.add(c2);
linkSourcesB.add(
graph().graphAttr()
.with(Rank.inSubgraph(Rank.RankType.SAME), Rank.dir(TOP_TO_BOTTOM))
.with(a1, b1, c1)
);
linkSourcesB.add(
graph().graphAttr()
.with(Rank.inSubgraph(Rank.RankType.SAME), Rank.dir(LEFT_TO_RIGHT))
.with(c1, c2)
);
linkSourcesB.add(a1.link(b1));
linkSourcesB.add(b1.link(c1));
linkSourcesB.add(c1.link(c2));
Graph g = graph("broker2concentrator").directed()
.graphAttr().with(Rank.dir(LEFT_TO_RIGHT))
.nodeAttr().with(Font.name("arial"))
.with(linkSourcesB);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Graphviz
.fromGraph(g)
.render(Format.PNG)
.toOutputStream(outputStream);
return outputStream.toByteArray();
Is the wanted example possible and how?
Metadata
Metadata
Assignees
Labels
No labels