MAIDR JavaScript API
    Preparing search index...

    Class BrailleService

    Service responsible for managing braille display generation and navigation.

    Implements

    Index

    Constructors

    Properties

    onChange: Event<BrailleChangedEvent>
    onToggle: Event<BrailleToggledEvent>

    Accessors

    • get isEnabled(): boolean

      Returns whether braille mode is currently enabled.

      Returns boolean

    Methods

    • Refreshes the braille display with the given trace state. Called explicitly when entering a new subplot with braille enabled, because the model's notifyStateUpdate is not invoked on entry (doing so would fan out to all observers, including AudioService, causing an unwanted tone).

      Parameters

      Returns void

    • Moves the navigation cursor to a specific braille index position.

      Parameters

      • index: number

        Target index in the braille display

      Returns void

    • Turns braille off without asking whether this layer could have turned it on.

      toggle refuses on a layer with no braille table, which is right for a press that means "open this" and wrong for one that means "close it": Page Up can move a reader from a bar layer onto a scatter layer in the same subplot, and from there the panel they opened could never be shut. Every press answered "Braille is not supported for plot type: point" while the panel stayed open.

      Does nothing when braille is already off, so it is safe to call on the way past.

      Parameters

      • state: TraceState

        Current trace state, passed on to whatever follows the change

      Returns void