This library provides a WebGL-based treemap visualization stack with three core layers:
- configuration-driven data model
- layout/geometry generation
- interactive rendering pipeline
- Programmatic API: import
Visualization,Renderer, andConfigurationfrom the package entry. - Direct config assembly: build
Configurationsections (topology,buffers,bufferViews,colors,layout,geometry,labels) and assign tovisualization.configuration. - JSON interchange: use
Configuration.toJSON()and parse JSON config objects for save/load flows. - CSV frontends in examples: parse tabular data and generate config automatically (explicit-ID mode, implicit-ID mode, path-based mode, grouped-node mode, and file-based mode).
- Initialization helper: call
initialize(canvasOrId)to create the webgl-operate canvas and defaults for antialiasing, clear color, event blocker, and controller defaults. - 2D/3D dual rendering mode: instantiate
Visualization(VisualizationType.VISUALIZATION_2D)or default 3D mode.
- Topology ingestion
- Topology sources are supplied as tree edges in interleaved or tupled arrays.
- Topology semantics support parent-id-id and parent-index-id interpretation.
- Hierarchy construction accepts single-root trees and supports explicit inner-node and leaf-node ordering.
- Sorting strategies are supported as part of layout preprocessing.
- Layout algorithms:
- Strip layout
- Snake layout
- Hilbert layout
- Moore layout
- Code City layout
- Weight-based layout weighting (
layout.weightbuffer reference). - Sibling margin controls with absolute and relative modes.
- Parent padding controls with absolute, relative, and mixed modes.
- Accessory padding controls with absolute/relative mode, direction, area threshold, and target aspect ratio.
- Optional aspect ratio setting for root canvas-space target.
- Node sorting in preprocessing:
- Keep order
- Ascending/descending by weight
- Ascending/descending by node identifier
- Ascending/descending by external sort buffer
- Raw buffer definitions support numeric and typed array inputs.
- Supported typed sources include native buffers for
uint8,int8,uint16,int16,uint32,int32,float32,float64, and number arrays. - Source buffers use linearization metadata (topology order and explicit id/index mappings).
- Buffer views support transformation chains:
- normalization (
zero-to-max,min-to-max,sign-agnostic-max,diverging) - propagation (
sum,average,min,max,median,closest-to-zero,closest-to-infinity) - value transforms (
fill-invalid,mask,clamp,threshold,compare) - generic transform operations (
add,subtract,multiply,divide,pow,sqrt,abs,callback, etc.) - callback iteration modes:
- top-down, depth-first, leaf-only, bottom-up
range-transform,normalize, and derived view output caching through normalization mapping.
- Parent-layer rendering with color map and root visibility control.
- Leaf-layer rendering with:
- external height input
- optional area scaling
- external color values
- leaf color mapping and optional
colorsNormalizedflag. - Emphasis system with outline and highlight node sets plus outline width.
- Height mapping with either explicit numeric scale or approach-driven estimator.
- Color system supports:
- explicit color triples/quads/hex values
- color arrays and preset color sets from integrated palettes.
- Label system supports:
- explicit name maps
- optional additional label sets
- top-k filters for inner nodes and per-metric ranking
- adaptive label placement and automatic overlap handling.
- Navigation and camera controls support rotate, pan, and zoom (mouse/touch mappings implemented for pan/hover/select behaviors).
- Exposed camera mutators for scripted camera updates.
- Event stream hooks for node enter, move, leave, and select.
- Node picking by screen coordinates and world coordinate lookup.
- Multi-pass renderer chain with:
- inner node quad pass
- leaf cuboid pass
- leaf/inner label passes
- label background and point passes
- optional readback and accumulation passes.
- Anti-aliasing via multi-frame accumulation and adjustable sampling scale.
- Direct config editing example: paste full JSON, live-apply and serialize using
toJSON(). - CSV-driven examples:
- explicit-id datasets (ids + parents columns),
- implicit path/file-path datasets,
- grouped-node mode,
- nominal/diverging value variants,
- local file-backed CSV flows.
- Typical use cases:
- hierarchical KPI or metric exploration,
- software/package or file-system layout inspection,
- research prototyping of layout and mapping variants,
- comparative visual analytics scenarios.
- Topology and data are validated through schema validation and explicit reference checks.
- Reference integrity requires consistent
buffer:andcolor:references across sections. - Render-updates are lazy and delta-driven using alteration tracking on configuration and geometry.
- Geometry is the single payload passed from visualization logic into renderer; renderer operates on generated geometry buffers.
- Changes to config should remain incremental and reset alteration state after processing.