MAIDR JavaScript API
    Preparing search index...

    Type Alias NavigateCallback

    NavigateCallback: (
        info:
            | {
                layerId: string;
                row: number;
                col: number;
                pointIndices?: readonly number[];
            }
            | null,
    ) => void

    Callback invoked when the active data point changes during navigation. Used by canvas-based charting libraries (e.g., Chart.js) for visual highlighting.

    null means no data point is active — the cursor has left a subplot for the figure lobby of a multi-panel chart. A consumer drawing an overlay must clear it, since there is no other signal that the selection ended: without one, the last point's highlight stays on screen and follows the user to another panel, pointing at a chart it does not belong to.

    Type Declaration

      • (
            info:
                | {
                    layerId: string;
                    row: number;
                    col: number;
                    pointIndices?: readonly number[];
                }
                | null,
        ): void
      • Parameters

        • info:
              | {
                  layerId: string;
                  row: number;
                  col: number;
                  pointIndices?: readonly number[];
              }
              | null

          The current navigation position, or null when nothing is selected

          • { layerId: string; row: number; col: number; pointIndices?: readonly number[] }
            • layerId: string

              The ID of the active layer/trace

            • row: number

              The current row index (e.g., dataset index)

            • col: number

              The current column index (e.g., data point index)

            • OptionalpointIndices?: readonly number[]

              Present only for a point cloud (scatter, volcano, manhattan), whose selection is a set of points rather than a cell of a grid: the indices into that layer's data array — as the producer supplied it — of every point the highlight covers. When it is present row and col are both -1, because no row/column pair can name the selection, and a consumer that bounds-checks them (as it must) then clears the overlay rather than outlining an arbitrary mark.

          • null

        Returns void