DataViz.Layout.StateMachine.Tree
- Package
- purescript-hylograph-layout
- Repository
- afcondon/purescript-hylograph-layout
DataViz.Layout.StateMachine.Tree
Position states as the tree a user experiences, not as a ring.
This is a join rather than a build: Data.Graph.Layout.treeLayout in
hylograph-graph already knows how to lay out a rooted tree tidily and had no
state machine to lay out, while this library already knew how to draw a state
machine and shipped only circularLayout and gridLayout.
layoutWithConfig takes the positioning pass as an argument, which is
exactly the extension point needed — so this is a third strategy rather than
a fork of anything.
The rooted tree comes from Data.Graph.InducedTree.induce: a designer's
ring shows every transition as equally near to hand, and a user's experience
is the shortest-path tree from the initial state. Drawing the ring shows the
designer something other than what the user receives.
Unreachable states are parked in a band below the tree instead of being dropped. A state the root cannot reach is a finding, and a layout that silently omitted it would be hiding the most useful thing on the page.
Extracted from the Glassbox state-machine demo, which built it locally.
#treeStrategy Source
treeStrategy :: forall extra. Induced String -> LayoutConfig -> Array (State extra) -> Array (LayoutState extra)A positioning pass for layoutWithConfig, driven by an induced tree.
The tree is keyed by state id, because that is what State carries and what
the caller will have built the graph from.
- Modules
- DataViz.
Layout. Adjacency - DataViz.
Layout. Adjacency. Layout - DataViz.
Layout. Adjacency. Types - DataViz.
Layout. BlockCutTree - DataViz.
Layout. Chord - DataViz.
Layout. Chord. Layout - DataViz.
Layout. Chord. Types - DataViz.
Layout. Hierarchy. Cluster - DataViz.
Layout. Hierarchy. Core - DataViz.
Layout. Hierarchy. EdgeBundle - DataViz.
Layout. Hierarchy. EdgeBundle. Bilink - DataViz.
Layout. Hierarchy. EdgeBundle. BundleCurve - DataViz.
Layout. Hierarchy. EdgeBundle. Hierarchy - DataViz.
Layout. Hierarchy. EdgeBundle. RadialCluster - DataViz.
Layout. Hierarchy. EdgeBundle. Types - DataViz.
Layout. Hierarchy. Link - DataViz.
Layout. Hierarchy. Pack - DataViz.
Layout. Hierarchy. Partition - DataViz.
Layout. Hierarchy. Tree - DataViz.
Layout. Hierarchy. TreeStyle - DataViz.
Layout. Hierarchy. Treemap - DataViz.
Layout. Hierarchy. Types - DataViz.
Layout. Pattern - DataViz.
Layout. Pattern. Adapters - DataViz.
Layout. Pattern. Types - DataViz.
Layout. Sankey. CSV - DataViz.
Layout. Sankey. Compute - DataViz.
Layout. Sankey. ComputeWithSteps - DataViz.
Layout. Sankey. Lanes - DataViz.
Layout. Sankey. Path - DataViz.
Layout. Sankey. Types - DataViz.
Layout. StateMachine - DataViz.
Layout. StateMachine. Layout - DataViz.
Layout. StateMachine. Path - DataViz.
Layout. StateMachine. Tree - DataViz.
Layout. StateMachine. Types - DataViz.
Layout. TidyDag