Prototype
Line chart race
Paste monthly numbers, play the lines forward, and export a video from this tab. The preview and the file are the same frames: each one is frame(t) for a t between 0 and 1.
Sample
Colors
The first column is the date (YYYY-MM or YYYY-MM-DD). Each other column is a line. The sample is shaped like a lab-mentions promo. The numbers are illustrative, not a measurement. Tip icons are monograms. A series icon can be a base64 data:image URL.
From code
The race is not a chart type in the v1 spec. render() draws one settled frame, and motion only morphs two of those in the DOM. A race needs every intermediate frame, including on a server, so it lives on its own entry and stays out of the line bundle.
import { createLineRace, exportLineRace, mountLineRace, podcastMentionsRace } from "@chartkitdev/core/race";
const race = createLineRace(podcastMentionsRace());
mountLineRace(document.querySelector("#chart"), race).play();
race.frame(0.5); // the same SVG a server would return
const file = await exportLineRace(race); // MP4, or WebM if H.264 is unavailableAn odds replay is the same contract. Each row is a trade. The line holds that price until the next row. scale: "fit" sizes the percent axis to the whole series and keeps it still during the replay. exportLineRace records either chart.
import { createOddsReplay, exportLineRace, matchOddsReplay } from "@chartkitdev/core/race";
const odds = createOddsReplay(matchOddsReplay());
odds.frame(t); // one SVG, the same on a server
await exportLineRace(odds);Export encodes in this browser. Chromium writes an MP4 through WebCodecs. Firefox and older Safari record WebM in real time. Nothing is uploaded.