Documentation

Types

The public types you are most likely to read or annotate, generated from the library's TypeScript source.

The tables on this page are generated at build time from the TypeScript source, so they always match the published declarations.

StateChange

delta().stateChanges is a StateChange[]. It is a discriminated union on category:

type StateChange =
  | { category: 'data'; action: 'add' | 'remove' | 'update' }
  | {
      category: 'grain';
      action: 'split' | 'merge' | 'reaggregate' | 'change-reducer';
      previous: GrainDescription;
      next: GrainDescription;
    }
  | { category: 'encoding'; action: 'bind' | 'unbind' | 'remap'; channel: string }
  | { category: 'coordinate'; action: 'rescale' | 'reorient'; channel?: 'x' | 'y' }
  | { category: 'layout'; action: 'reorder' | 'rearrange' | 'reconnect' }
  | { category: 'attention'; action: 'enter' | 'exit' | 'shift'; target: 'focus' | 'highlight' }
  | { category: 'appearance'; action: 'restyle' | 'reshape'; property: string };

Narrow on category to read the extra fields:

for (const change of delta(from, to).stateChanges) {
  if (change.category === 'encoding') console.log(change.channel);
  if (change.category === 'grain') console.log(change.previous.groupby, '→', change.next.groupby);
}

GrainDescription

Prop

Type

GrainMeasure

Prop

Type

VisualizationWarning

Returned by visualizationWarnings() and dispatched in visdelta:warnings events. See Visualization warnings.

Prop

Type

ChannelSpec

The options accepted by .x(), .y(), .color(), .size() and .channel().

Prop

Type

FacetLayout

Options for .repeat() and smallMultiples(). See Small multiples.

Prop

Type

ChartStyleDefinition

The input to defineChartStyle(). See Styling and themes.

Prop

Type

DeclarationPlanOptions

Prop

Type

On this page