!7 !include once #1013695 // GraphViz import guru.nidi.graphviz.attribute.*; import static guru.nidi.graphviz.attribute.Records.*; import static guru.nidi.graphviz.model.Compass.*; import guru.nidi.graphviz.model.Node; import java.awt.Color; p { File img = img = programFile("graph.png"); Node node0 = node("node0").with(Records.of(rec("f0", ""), rec("f1", ""), rec("f2", ""), rec("f3", ""), rec("f4", ""))), node1 = node("node1").with(Records.of(turn(rec("n4"), rec("v", "719"), rec("")))), node2 = node("node2").with(Records.of(turn(rec("a1"), rec("805"), rec("p", "")))), node3 = node("node3").with(Records.of(turn(rec("i9"), rec("718"), rec("")))), node4 = node("node4").with(Records.of(turn(rec("e5"), rec("989"), rec("p", "")))), node5 = node("node5").with(Records.of(turn(rec("t2"), rec("v", "959"), rec("")))), node6 = node("node6").with(Records.of(turn(rec("o1"), rec("794"), rec("")))), node7 = node("node7").with(Records.of(turn(rec("s7"), rec("659"), rec("")))); Graph g = graph("example3").directed() .generalAttr().with(RankDir.LEFT_TO_RIGHT) .with( node0.link( between(loc("f0"), node1.loc("v", SOUTH)), between(loc("f1"), node2.loc(WEST)), between(loc("f2"), node3.loc(WEST)), between(loc("f3"), node4.loc(WEST)), between(loc("f4"), node5.loc("v", NORTH))), node2.link(between(loc("p"), node6.loc(NORTH_WEST))), node4.link(between(loc("p"), node7.loc(SOUTH_WEST)))); Graphviz.fromGraph(g).width(900).render(Format.PNG).toFile(img); showImage(img); }