MAIDR JavaScript API
    Preparing search index...

    Class TactileService

    Draws the focused chart onto a connected tactile display, and puts the focused point's description on its braille text line.

    The display mirrors braille mode: it comes up when the reader turns braille on and goes down when they turn it off, so there is one mental switch for "show me this by touch" rather than two.

    The chart is drawn by scaling its own SVG geometry down onto the pin grid — marks outlined, the focused mark filled. At the sizes involved a whole chart often collapses into a few pins, which is why the view zooms: each zoom step spends the same pins on a smaller slice of the chart, and panning reaches the rest.

    Implements

    Index

    Constructors

    Accessors

    • get isActive(): boolean

      True when the display should currently be showing something: braille is on and a device is connected.

      Returns boolean

    • get canShow(): boolean

      Whether a display is there to be shown anything.

      The key handler asks before taking b over from braille: with no device connected there is nothing to offer, and the reader is better served by braille's own account of why it cannot open.

      Returns boolean

    Methods

    • Points the service at a new figure after a live-data swap.

      Parameters

      • figure: Figure

        The replacement figure

      Returns void

    • Turns the display on or off at the reader's request.

      b is the one switch for "show me this by touch", and braille normally carries the display with it. But braille has to encode the data, and there are places it cannot: the multi-panel lobby, where no series is selected yet, and the plot types with no braille table -- scatter, manhattan, volcano. Gating the pins on that made the display unreachable in exactly those places, and a scatter is the chart a pin grid draws best of all: a cloud of points is what the grid natively is.

      So this exists to be called where braille declines, and the display comes up on the chart's own geometry, which never needed a braille table.

      Returns void

    • Receives every navigation move.

      Parameters

      • state: TactileStateUnion

        The new figure, subplot or trace state

      Returns void

    • Redraws from the last known state, for changes that did not come from a navigation move — a zoom step, a pan, or the device connecting.

      Returns void

    • Returns the tactile view to the whole plot.

      Stepping back out works, but the steps are multiplicative and there are eight of them: from the closest zoom that is seven presses, each redrawing a frame the reader does not want and waiting on the device to take it. One key is the difference between recovering a view you have lost and picking your way back to it.

      Returns void

    • Moves along the braille text line by one window.

      The device reports its keys but never scrolls its own buffer, so each window is re-sent from the first cell of the line.

      Parameters

      • step: number

        Windows to move; negative moves back toward the start

      Returns void

    • Releases this chart's subscriptions.

      Deliberately does NOT disconnect a device the reader connected here themselves. This runs on every focus-out and tab switch, and reconnecting one needs a user gesture that cannot be asked for mid-session — dropping that connection here would make the display unusable in ordinary use.

      What it does do is leave the display the way turning braille off leaves it. Nothing else closes the display on the way out: braille's own dispose() does not fire its toggle, so setShowing never runs, and the controller that replaces this one starts with the display off. Pins left up then point the reader at a chart they have left while every other channel says nothing is there. An adopted device is handed back for the same reason: it is checked out to this frame and only this frame can return it, so keeping it past focus-out is what makes the next chart's b fail on a device another frame still holds — and re-adopting needs no gesture, which is the whole point of adoption.

      Returns void