Generating Documentation

For generating the state diagram we add some more options to the generate function:

generateGraphLight :: Effect Unit
generateGraphLight = do
  let
    graph :: GraphvizGraph
    graph = TransitGraphviz.generate bridgesTransit _
      { theme = themeHarmonyLight
      , undirectedEdges = true
      , fontSize = 15.0
      }
  FS.writeTextFile UTF8 "renders/bridges-koenigsberg_graph-light.dot" (Graphviz.toDotStr graph)

🗎 test/Examples/BridgesKoenigsberg.purs L124-L133

Generated Output: This produces the graph visualization we examined earlier in this example.
🔗 View diagram on GraphvizOnline

The transition table is generated the same way as before, but we also add the undirectedEdges option to the options:

generateTable :: Effect Unit
generateTable = do
  let
    table :: Table
    table = TransitTable.generate bridgesTransit _
      { undirectedEdges = true
      }
  FS.writeTextFile UTF8 "renders/bridges-koenigsberg_table.md" (Table.toMarkdown table)

🗎 test/Examples/BridgesKoenigsberg.purs L146-L153

Generated Output: This creates the transition table in the undirected format, showing all possible bridge crossings between the land areas.

↑ Back to top