MAIDR JavaScript API
    Preparing search index...

    Manages the DOM shapes drawn on top of a Chart.js canvas to provide MAIDR-style highlight feedback for keyboard navigation.

    Index

    Constructors

    • Parameters

      • host: HTMLElement

        Positioned wrapper element that contains the canvas.

      • canvas: HTMLCanvasElement

        The Chart.js canvas the overlay aligns to.

      • OptionalhighlightColor: string

        Optional outline color override.

      • Optionalrepaint: () => void

        Redraws the chart, so a copy for a reader of the pixels who has just arrived is taken now rather than on the chart's next frame.

      Returns HighlightOverlay

    Methods

    • Records where the plot area is and what Chart.js has painted over it, for readers of the canvas's pixels; see @util/overlayRegions.

      Parameters

      • plotArea: PixelRect | null

        chart.chartArea, in canvas CSS pixels

      • exclude: readonly (PixelRect | null)[] = []

        Areas painted over the data, such as the tooltip

      Returns void

    • Copies the chart as it stands before Chart.js paints its tooltip, for readers of the pixels; see @util/overlayRegions.

      The tooltip sits over the data at the focused point, so a reader of the visible canvas found it among the marks -- and masking it out hid the tops of the bars it covered. This copy has everything but the tooltip.

      Returns void