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

    Function applyMaidrData

    • Applies the generated MAIDR schema to the SVG as a maidr-data attribute, unless opted out via autoApply: false. This removes the boilerplate svg.setAttribute('maidr-data', JSON.stringify(result.maidr)) call for vanilla-JS users, while staying out of the way of the React adapter (which passes autoApply: false and hands the schema straight to <Maidr> / <MaidrD3>).

      Parameters

      • svg: Element

        The target SVG element (or container).

      • maidr: Maidr

        The MAIDR schema produced by a binder.

      • autoApply: boolean | undefined

        When false, no attribute is set. When undefined or any other value, the attribute is set.

      Returns void