Actions and Trace Trees

Every chart-authoring method is an action. Calling a high-level action records that action and any wrapped actions it invokes as children.

createAxes
├─ createXAxis
│  ├─ createXAxisLine
│  ├─ createXAxisTicksAndLabels
│  └─ createXAxisTitle
└─ createYAxis
   ├─ createYAxisLine
   ├─ createYAxisTicksAndLabels
   └─ createYAxisTitle

The trace is available as program.trace. Its root is the virtual program node, and program.trace.children contains the top-level authored actions. Every node contains:

{
  id,
  op,
  description,
  args,
  children
}

Arguments are summarized so large datasets and materialized arrays are not duplicated in the trace. For example, dataset values are represented by a count.

Trace state is immutable and does not affect rendering. It can be traversed as a normal tree for inspection, explanation, provenance, or recommendation.

Developers can define new wrapped actions with the extension API.