Animation
On or off
ts
createChart(host, spec); // animated
createChart(host, spec, { animation: false }); // drawn at oncePeople who ask their system for less motion get no animation, whatever you write.
When
ts
createChart(host, spec, { animation: { start: 'load' } }); // at once, the default
createChart(host, spec, { animation: { start: 'visible' } }); // when the reader scrolls to it
const chart = createChart(host, spec, { animation: { start: 'manual' } });
button.onclick = () => chart.play(); // when you decide, as often as you wantThe room of the chart is kept while it waits, so nothing on the page jumps.
How
| Option | Does |
|---|---|
speed | 2 is twice as fast |
duration | milliseconds for each mark, instead of the timing of the chart |
delay | milliseconds before the first mark |
stagger | false moves every mark together |
easing | any CSS easing, such as cubic-bezier(.34,1.56,.64,1) for a bounce |
effect | fade replaces movement by a fade |
Charts use the Web Animations API of the browser: no timer runs once they are drawn. Only liquid and pipeline with flow move without end.
chart.update(spec) plays again; chart.refresh(spec) does not, for live data.