Pure PureScript implementations of layout algorithms for hierarchies and flow diagrams.
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.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
