MAIDR Documentation - v3.69.0
    Preparing search index...

    Interface MaidrLiveApi

    Public realtime/streaming API for script-tag consumers, exposed as window.maidrLive by the script bundle. Exported here so TypeScript consumers can type the global without importing the script-tag entry.

    // Replace all data for the chart with id 'stock-chart'.
    window.maidrLive.setData(updatedMaidrJson);

    // Stream a new point into the first (or only) chart.
    window.maidrLive.appendData({ x: 42, y: 3.14 });

    // Stream into a specific chart, layer, and series.
    window.maidrLive.appendData(
    { x: 42, y: 3.14 },
    { id: 'stock-chart', layerId: 'prices', groupIndex: 1 },
    );
    interface MaidrLiveApi {
        setData: (maidr: Maidr) => boolean;
        appendData: (
            point: LiveDataPoint,
            options?: AppendDataOptions & { id?: string },
        ) => boolean;
    }
    Index

    Properties

    Properties

    setData: (maidr: Maidr) => boolean

    Replaces all data for the chart identified by maidr.id. MAIDR keeps a reference to the passed object — do not mutate it after calling; pass a fresh object (or a structuredClone) for each update.

    appendData: (
        point: LiveDataPoint,
        options?: AppendDataOptions & { id?: string },
    ) => boolean

    Appends a single data point to a chart layer (streaming). Each append rebuilds the chart model from the full data; set Maidr.maxWidth to bound per-update cost on high-frequency streams.