Documentation

API overview

Entry points, what each exports, and where each part of the API is documented.

VisDelta's API has three parts: builders that create immutable chart states, delta() to inspect what changed, and transition() and sequence() to render a seekable path.

Preparing transition
0.00
1const base = bar(rows)
2  .x("category")
3  .y("sales");
4
5const profit = base.y("profit");
6
7const change = await transition(base, profit, {
8  target: "#chart"
9});
10
11change.progress(0.42);
12change.play({ from: 1, to: 0 });

The workbench above is a real controller. Seek in either direction, then switch the inspector to Delta for change.delta or Spec for the resolved endpoints.

import { bar } from 'visdelta/bar';                         // builders
import { delta } from 'visdelta/core';                       // inspection
import { transition, sequence } from 'visdelta/transition';  // rendering
import 'visdelta/style.css';

JSON transport uses parseSpec and stringifySpec from visdelta/core or visdelta. See JSON specs for validation boundaries and using the same ViewSpec with builders, playback and React.

Reference pages

Entry points

EntryMain exports
visdeltaEvery builder, delta, transition, sequence, visualizationWarnings, smallMultiples, chart styles, defineChartType, registerChartModule and the core helpers
visdelta/barbar, BarState, barModule, createBarGrainDeclarationOperationCodec
visdelta/lineline, LineState, lineModule, D3_CURVE_NAMES
visdelta/areaarea, AreaState, areaModule, D3_AREA_CURVE_NAMES
visdelta/pointpoint, PointState, pointModule
visdelta/unitunit, UnitState, unitModule, UNIT_LAYOUTS
visdelta/piepie, PieState, pieModule
visdelta/transitiontransition, sequence
visdelta/reactOptional React Chart, ChartProps and ChartController
visdelta/coredelta, visualizationSpec, declaration edits and planning, identity, lineage and camera helpers
visdelta/facetsmallMultiples
visdelta/chart-styledefineChartStyle, d3ChartStyle, paperChartStyle, darkChartStyle, editorialChartStyle, chartStylePresets
visdelta/pluginsdefineChartType, defineChartModule, ChartState, registerChartModule, motion, directionalEase and SDK types
visdelta/toolkitOptional scale, timing, geometry, topology, matching and policy helpers for plugins
visdelta/browserThe browser-global adapter used by the VisDelta global bundle
visdelta/style.cssThe required base stylesheet
visdelta/themes/*.cssdefault.css, dark.css and paper.css token themes

Importing an entry never registers chart types globally. A builder carries its own lazily loaded module; registration is needed only for plain JSON specs.

TypeScript

Declarations ship with the package. Commonly used types:

import type { Visualization, VisualizationTransition, VisualizationSequence, TransitionOptions, PlayOptions } from 'visdelta/transition';
import type { DeltaResult, StateChange, StateChangeCategory } from 'visdelta/core';
import type { VisualizationWarning } from 'visdelta';
import type { ChartStyleModule } from 'visdelta/chart-style';

Current boundaries

  • Endpoint chart types must match; Bar-to-Line is rejected.
  • VisDelta depends on the d3-* modules it renders with; they are not injected or configurable.
  • Declared transforms execute within VisDelta; data cleaning stays outside it.
  • Controls call progress() from outside the library.

Persistent views

Use render(target, spec, options) from visdelta to mount JSON strings, plain specs or builders. The returned view provides update, render, transition, snapshot, resize and destroy. Updates use a latest-pending policy by default. See JSON specs for scheduling, lifecycle and scoped module examples.

view.edit(message, options?) accepts a fluent JSON batch with requestId, baseRevision and edits: [{ method, args }]. It returns the same completion result as update(). The Bar adapter supports a conservative method subset; see small agent edits for supported methods, conflict handling and retry limits.

On this page