Skip to content

API Reference

This section contains the auto-generated API reference for d3-blueprint, plus this hand-written overview.

Core Classes

D3Blueprint

The base class for all charts. Subclass it, define layers in initialize(), and call draw(data) to render. Provides lifecycle hooks (transform, preDraw, postDraw, postTransition), config management, event dispatch, and attachment composition.

Layer

Manages a single D3 data-join lifecycle. Created via chart.layer(name, selection, options). Handles data binding, element insertion, and ordered lifecycle events (enter, update, merge, exit) with transition support.

ConfigManager

Manages named configuration properties with optional getter/setter transforms. Used internally by D3Blueprint, but you typically interact with it through chart.config() and chart.configDefine().

Key Types

TypeDescription
D3SelectionGeneric D3 selection type
D3TransitionGeneric D3 transition type
LayerOptionsOptions for creating a layer (dataBind, insert, events)
LayerEventMapMap of lifecycle event keys to handler functions
LifecycleHandlerHandler for non-transition lifecycle phases
TransitionHandlerHandler for :transition lifecycle phases
ConfigDefineOptionsOptions for configDefine() (defaultValue, getter, setter)

Constants and Utilities

ExportDescription
LIFECYCLE_EVENT_NAMES['update', 'enter', 'merge', 'exit']
isValidLifecycleEventType guard for lifecycle event keys
assertLifecycleEventAssertion for lifecycle event keys