MAIDR Documentation - v4.4.0
    Preparing search index...
    • Converts a rendered Observable Plot chart and hands it to MAIDR.

      Writes the schema to the chart's <svg> as a maidr-data attribute and fires maidr:bindchart, which is how MAIDR's runtime picks up a chart bound after its initial scan. Call it after Plot.plot() has returned — the element has to be in the document, and drawn, before it can be read.

      Parameters

      • element: Element

        The element Plot.plot() returned, or any element of it.

      • options: ObservablePlotOptions = {}

        Overrides for what the rendered chart cannot say.

      Returns ObservablePlotResult | null

      The schema and the element it was written to, or null when the chart holds no mark this adapter reads.

      const chart = Plot.plot({ marks: [Plot.barY(data, { x: 'day', y: 'count' })] });
      document.querySelector('#chart').append(chart);
      maidrObservable.bindObservablePlot(chart);