Package

purescript-hylograph-layout

Repository
afcondon/purescript-hylograph-layout
License
MIT
Uploaded by
pacchettibotti
Published on
2026-02-04T18:20:34Z

Layout Gallery Demo

Pure PureScript implementations of layout algorithms for hierarchies and flow diagrams.

Overview

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.

Installation

spago install hylograph-layout

Available Layouts

Hierarchical Layouts

  • 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

Graph Layouts

  • Sankey - Flow diagram layout for directed acyclic graphs (uses hylograph-graph for DAG operations)
  • EdgeBundle - Hierarchical edge bundling
  • Chord - Chord diagram layout
  • Adjacency - Adjacency matrix layout

Example

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 coordinates

Modules

  • DataViz.Layout.Hierarchy.Tree - Tree layout
  • DataViz.Layout.Hierarchy.Pack - Circle packing
  • DataViz.Layout.Hierarchy.Partition - Partition/sunburst
  • DataViz.Layout.Hierarchy.Treemap - Treemap
  • DataViz.Layout.Hierarchy.Cluster - Dendrogram
  • DataViz.Layout.Hierarchy.EdgeBundle - Edge bundling
  • DataViz.Layout.Sankey.Compute - Sankey diagrams
  • DataViz.Layout.Chord - Chord diagrams
  • DataViz.Layout.Adjacency - Adjacency matrix

Part of Hylograph

  • 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.

License

MIT

Modules
DataViz.Layout.Adjacency
DataViz.Layout.Adjacency.Layout
DataViz.Layout.Adjacency.Types
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.Types
DataViz.Layout.Sankey.CSV
DataViz.Layout.Sankey.Compute
DataViz.Layout.Sankey.ComputeWithSteps
DataViz.Layout.Sankey.Path
DataViz.Layout.Sankey.Types
DataViz.Layout.StateMachine
DataViz.Layout.StateMachine.Layout
DataViz.Layout.StateMachine.Path
DataViz.Layout.StateMachine.Types
Dependencies