Generating Documentation
For generating the state diagram, we now add some more options to the
generate function:
entryPoints: The state machine will start in theDoorOpenstate.layout: The state diagram will be displayed in landscape mode.
generateGraphLight :: Effect Unit
generateGraphLight = do
let
graph :: GraphvizGraph
graph = TransitGraphviz.generate doorPinTransit \cfg -> cfg
{ theme = themeHarmonyLight
, entryPoints = [ "DoorOpen" ]
, layout = Landscape
}
FS.writeTextFile UTF8 "renders/door-pin_graph-light.dot" (Graphviz.toDotStr graph)🗎 test/Examples/DoorPin.purs L103-L113
Generated Output: This creates the state diagram we saw earlier in this example.
🔗 View diagram on GraphvizOnline
The generation of the transition table works exactly the same as in the previous example.