Pure PureScript implementations of layout algorithms for hierarchies and flow diagrams.
Live interactive demo can be seen as part of the suite of Hylograph library demos. Click the screenshot below for the Layout Gallery.
Layout algorithms for hierarchical and graph data, implemented in pure PureScript. Many of these layouts are familiar to users of D3 but here they are implemented without FFI dependencies using FP implementations in 100% PureScript. The hierarchical ones work with the rose-tree data structure from purescript-tree-rose.
spago install hylograph-layout- Tree - Tidy tree layout (Reingold-Tilford algorithm)
- Pack - Circle packing for hierarchical data
- Partition - Sunburst/icicle partition layout
- Treemap - Multiple tiling algorithms: squarify (default), slice, dice, sliceDice, binary
- Cluster - Dendrogram layout
- Sankey - Flow diagram layout for directed acyclic graphs (uses
hylograph-graphfor DAG operations) - EdgeBundle - Hierarchical edge bundling
- Chord - Chord diagram layout
- Adjacency - Adjacency matrix layout
import DataViz.Layout.Hierarchy.Tree (tree, defaultTreeConfig)
import Data.Tree (mkTree)
myTree = mkTree "root" [mkTree "a" [], mkTree "b" []]
config = defaultTreeConfig { size = { width: 400.0, height: 300.0 } }
positioned = tree config myTree
-- Each node now has x, y coordinatesDataViz.Layout.Hierarchy.Tree- Tree layoutDataViz.Layout.Hierarchy.Pack- Circle packingDataViz.Layout.Hierarchy.Partition- Partition/sunburstDataViz.Layout.Hierarchy.Treemap- TreemapDataViz.Layout.Hierarchy.Cluster- DendrogramDataViz.Layout.Hierarchy.EdgeBundle- Edge bundlingDataViz.Layout.Sankey.Compute- Sankey diagramsDataViz.Layout.Sankey.Lanes- lanes for links that span more than one columnDataViz.Layout.Sankey.BackEdge- the links that close a cycle (a link from a node to itself among them): which they are, where they stand on their nodes, a route under the chartDataViz.Layout.Sankey.Whole- the chart with its back-edges routed and the nodes no link mentions on a shelf; optionally at a fixed scaleDataViz.Layout.Chord- Chord diagramsDataViz.Layout.Adjacency- Adjacency matrix
- hylograph-layout - Layout algorithms (this package)
- hylograph-graph - Graph algorithms and DAG support
- hylograph-selection - D3 selection library
- hylograph-simulation - Force simulation
Uses tree-rose for rose tree data structures.
MIT