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 = 14.0
      }
  FS.writeTextFile UTF8 "renders/bridges-koenigsberg_graph-light.dot" (Graphviz.toDotStr graph)

πŸ—Ž test/Examples/BridgesKoenigsberg.purs (lines 124-133)

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 (lines 146-153)

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

↑ Back to top