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

    Module vegalite-entry

    Vega-Lite adapter entry point for MAIDR.

    This module re-exports the Vega-Lite adapter API and exposes it globally for script-tag (UMD) usage. The primary consumer-facing API is bindVegaLite, which converts a Vega-Lite spec to MAIDR and mounts the accessible UI on the rendered SVG.

    Vega-Lite renders asynchronously via vegaEmbed(). The adapter must be called after vegaEmbed() resolves so that the SVG and the compiled Vega view are both available.

    <script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
    <script src="https://cdn.jsdelivr.net/npm/vega-lite@5"></script>
    <script src="https://cdn.jsdelivr.net/npm/vega-embed@6"></script>
    <script src="maidr.js"></script>
    <script src="maidr/dist/vegalite.js"></script>
    <script>
    const spec = {
    data: { values: [{ a: 'A', b: 28 }, { a: 'B', b: 55 }] },
    mark: 'bar',
    encoding: {
    x: { field: 'a', type: 'nominal' },
    y: { field: 'b', type: 'quantitative' },
    },
    };
    vegaEmbed('#chart', spec).then((result) => {
    maidrVegaLite.bindVegaLite(result.view, spec);
    });
    </script>

    Interfaces

    VegaLiteEmbedOptions
    VegaLiteEmbedResult

    Functions

    bindVegaLite
    embed
    setDebug

    References

    vegaLiteToMaidr → vegaLiteToMaidr
    VegaLiteChannelDef → VegaLiteChannelDef
    VegaLiteEncoding → VegaLiteEncoding
    VegaLiteSpec → VegaLiteSpec
    VegaLiteToMaidrOptions → VegaLiteToMaidrOptions
    VegaView → VegaView
    MaidrData → Maidr
    MaidrLayer → MaidrLayer
    MaidrSubplot → MaidrSubplot
    Orientation → Orientation
    TraceType → TraceType