MAIDR JavaScript API
    Preparing search index...

    Service for managing the chart description modal. Retrieves objective description data from the active trace on demand.

    Implements

    Index

    Constructors

    Methods

    • Switches the reader to another layer of the current subplot and hands back that layer's description.

      The switch is real -- it moves the model's active trace, carrying the reader's position across the way a PageUp step does -- so leaving the dialog lands them on the layer they were last reading about rather than the one they opened it from. It is also silent: the trace's own "Layer 2 of 3" announcement would talk over the dialog, so it is deferred to announcePendingLayerSwitch, which the close path calls.

      The description is read after the switch, not before, and that ordering is load-bearing rather than incidental: a step plot's summary reads the run its cursor is standing in, so a layer's description is only correct once that layer has been positioned. Fetching every layer's description up front -- the obvious optimisation for a dialog that shows one at a time -- would read each of them at whatever position it was last left at.

      Parameters

      • index: number

        Zero-based layer index within the active subplot

      Returns DisplayDescriptionState | null

      The newly active layer's description, or null when the index named the active layer, was out of range, or there is nothing to describe once the switch has been made.

    • Speaks the layer a selectLayer call switched to, if any, and forgets it.

      Called as the dialog closes, so the reader hears which layer they have been returned to exactly once -- not once per tab they browsed through. A no-op when no layer was selected, which is every ordinary open-and-close of the dialog.

      DescriptionViewModel.toggle is the only caller, and every way out of the dialog reaches it: Escape (which MUI's modal handles and routes to onClose, rather than through the scope's own esc binding), the Close button, and a click on the backdrop. A dismissal path added later that bypassed it would leave the reader silently relocated in the chart.

      Returns void

    • Drops the deferred layer-switch announcement.

      announcePendingLayerSwitch is reached from exactly one place -- DescriptionViewModel.toggle's close branch -- so any teardown that does not go through it would leave the flag raised and have the next dialog announce a switch that never happened.

      Returns void