MAIDR JavaScript API
    Preparing search index...

    Maps a region of a chart, in viewport pixels, onto a tactile display's dot grid, with a zoom level and a pan position.

    Zoom exists because the dot grid is small enough that a whole chart scaled into it loses the detail that distinguishes neighbouring marks. Zooming in spends the same pins on a smaller slice of the chart, which is the only way to resolve marks that would otherwise share a pin — at the cost of having to pan to reach the rest.

    Index

    Constructors

    Accessors

    • get isWholePlotVisible(): boolean

      True when the whole plot is visible, so panning would do nothing.

      Returns boolean

    Methods

    • Replaces the chart region, keeping the zoom and pan position. Called when the chart resizes or a different subplot takes focus.

      Parameters

      • source: ClientRect

        The new chart region, in viewport pixels

      Returns void

    • Resets to the whole plot, centred.

      Returns boolean

      True when the view was not already there

    • Moves the window one step in a direction.

      Parameters

      • direction: PanDirection

        Which way to move the window over the plot

      Returns boolean

      True when the window actually moved, false when already at that edge

    • Converts a viewport-pixel point to dot coordinates. The result may fall outside the dot grid, which means the point is outside the visible window.

      Parameters

      • clientX: number

        Horizontal position in viewport pixels

      • clientY: number

        Vertical position in viewport pixels

      Returns DotPoint

    • Reports whether a viewport-pixel rectangle is entirely inside the visible window.

      Parameters

      • rect: ClientRect

        The rectangle to test, in viewport pixels

      Returns boolean

    • Centres the window on a viewport-pixel rectangle.

      Used to follow the focused mark when navigation takes it off the visible window. Following only on exit — rather than recentring on every move — leaves a manually chosen pan position alone for as long as it still shows what the reader is pointing at.

      Parameters

      • rect: ClientRect

        The rectangle to centre on, in viewport pixels

      Returns void

    • Describes the current zoom and pan for announcement to the reader.

      A zoomed view shows a slice of the chart with no visible frame to say which slice, so the position has to be spoken.

      Returns string