Skip to main content

FlowChart

The following classes can be useful when creating flowcharts:

  • siren
  • flowchart
  • direction
  • flowchartConfig

With Title

siren.flowchart(direction.lr, [
flowchart.node("id1", "This is the text in the box")
])
|> siren.withTitle("Node with text")
|> siren.write

Different Lengths

siren.flowchart(direction.td, [
flowchart.node(a, "Start")
flowchart.nodeRhombus(b, "Is it?")
flowchart.node(c, "OK")
flowchart.node(d, "Rethink")
flowchart.node(e, "End")
flowchart.linkArrow(a, b)
flowchart.linkArrow(b, c, "Yes")
flowchart.linkArrow(c, d)
flowchart.linkArrow(d, b)
flowchart.linkArrow(b, e, "No", 3)
]).write()

Subgraphs

siren.flowchart(direction.tb, [
flowchart.linkArrow(c1, a2)
flowchart.subgraph("one", [
flowchart.linkArrow(a1,a2)
])
flowchart.subgraph("two", [
flowchart.linkArrow(b1,b2)
])
flowchart.subgraph("three", [
flowchart.linkArrow(c1,c2)
])
]).write()

Subgraph direction

siren.flowchart(direction.lr, [
flowchart.subgraph("subgraph1", [
flowchart.directionTB
flowchart.node(top1)
flowchart.node(bot1)
flowchart.linkArrow(top1, bot1)
])
flowchart.subgraph("subgraph2", [
flowchart.directionTB
flowchart.node(top2)
flowchart.node(bot2)
flowchart.linkArrow(top2, bot2)
])
flowchart.linkArrow(outside, "subgraph1")
flowchart.linkArrow(outside, top2, addedLength = 2)
]).write()

Markdown strings

siren.flowchart(direction.lr, [
flowchart.subgraph("One", [
flowchart.nodeRound("a", formatting.markdown(@"The **cat**
in the hat")
)
flowchart.nodeRhombus("b", formatting.markdown(@"The **dog** in the hog"))
flowchart.linkArrow("a","b", formatting.markdown("Bold **edge label**"))
])
]).write()

To the Moon

siren.flowchart(direction.bt, [
flowchart.subgraph("space", [
flowchart.directionBT
flowchart.linkDottedArrow("earth", "moon", formatting.unicode("🚀"), 6)
flowchart.nodeRound("moon")
flowchart.subgraph("atmosphere",[
flowchart.nodeCircle("earth")
])
])
])
|> siren.write