Module

DataViz.Layout.BlockCutTree

Package
purescript-hylograph-layout
Repository
afcondon/purescript-hylograph-layout

Block-Cut Tree Layout

Positions nodes of a graph based on its biconnected component decomposition. Biconnected components (blocks) are arranged in BFS layers from the largest block outward; nodes within each block are arranged in a circle around the block center. Isolated nodes (no edges) are placed along the bottom.

This layout is useful for visualizing the structural decomposition of code modules, social networks, or any graph where cluster structure matters.

#BlockCutLayout Source

type BlockCutLayout node = { blocks :: Map Int BlockLayout, height :: Number, nodes :: Map node NodeLayout, width :: Number }

Complete layout result

#BlockCutConfig Source

type BlockCutConfig = { blockRadiusScale :: Number, height :: Number, isolatedGap :: Number, isolatedSpacing :: Number, layerGap :: Number, margin :: Number, maxBlockRadius :: Number, minBlockRadius :: Number, minHeight :: Number, width :: Number }

Configuration for the layout algorithm

#NodeLayout Source

type NodeLayout = { block :: Int, isArticulationPoint :: Boolean, isIsolated :: Boolean, x :: Number, y :: Number }

Per-node layout result

#BlockLayout Source

type BlockLayout = { depth :: Int, isBridge :: Boolean, nodeCount :: Int, radius :: Number, x :: Number, y :: Number }

Per-block layout result

#defaultConfig Source

defaultConfig :: BlockCutConfig

Sensible defaults

#layout Source

layout :: forall node. Ord node => BlockCutConfig -> SimpleGraph node -> BlockCutLayout node

Compute positions for all nodes in a graph based on its block-cut tree decomposition.