docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Render an interactive, dual-series time-series visualization that stays readable as users explore, zoom, and export the view.
timestamp, actual, and optional forecast, draws two distinct lines that share a time axis, label axes, surface an options.title heading when provided, and annotate the latest point for each series. @testinitialRangeHours is provided, the chart opens zoomed to the most recent window of that duration (based on ascending timestamps) while retaining full-history data for manual zooming back out. @testkW suffix, and—when both series exist for the same timestamp—the difference between actual and forecast rounded to one decimal place. @testexport type Reading = {
timestamp: string; // ISO 8601
actual: number;
forecast?: number;
};
export type ChartOptions = {
initialRangeHours?: number;
title?: string;
};
export async function renderInteractiveChart(
container: HTMLElement,
readings: Reading[],
options?: ChartOptions
): Promise<void>;Provides interactive plotting primitives for rendering, updating, and exporting the chart.