MAIDR Documentation - v3.73.0
    Preparing search index...

    Manages the virtual candlestick delta layer: discovers reference lines in the active subplot, remembers the user's chosen reference line, builds the CandlestickDeltaTrace on demand, swaps it in/out of the navigation context, and announces activation and exit.

    Interaction model:

    • Ctrl+Shift+L opens the reference picker; confirming a line remembers it as the reference and activates the comparison.
    • Alt+L toggles the comparison on/off using the remembered reference. The very first Alt+L with no reference chosen yet warns and opens the picker.

    Implements

    Index

    Constructors

    Accessors

    • get selectedReference(): string | null

      The remembered reference line id, or null when none has been chosen.

      Returns string | null

    Methods

    • Injects the observer wiring used for runtime-created traces. The Controller owns the services that must observe a trace (audio, braille, text, review, highlight), so it supplies this hook after construction.

      Parameters

      • wireTrace: (trace: Trace) => void

        Callback registering all trace observers

      Returns void

    • Remembers a reference line as the active comparison target. Persists across on/off toggles until the user picks a different one.

      Parameters

      • referenceId: string

        Id of the reference series (from getReferences)

      Returns void

    • Builds and activates the virtual delta layer for the remembered (or given) reference line, comparing every OHLC field. Replaces an already-active delta layer in place when the user reconfigures via the reference picker.

      Parameters

      • referenceId: string | null = ...

        Reference series id; defaults to the remembered one

      Returns boolean

      True when the layer was activated

    • Deactivates the virtual delta layer and restores the real chart layer. The remembered reference is kept so a later Alt+L can re-enable it.

      Parameters

      • options: { silent?: boolean } = {}

        Deactivation options

        • Optionalsilent?: boolean

          Skip announcements and position sync (used when another navigation action is about to announce anyway)

      Returns boolean

      True when an active layer was deactivated

    • Deactivates without announcements if the delta layer is active. Used by layer-switching commands so PageUp/PageDown from a nested mode cannot strand the virtual trace on the navigation stack.

      Returns void

    • Discards the virtual layer's internal state and resets the rotor WITHOUT touching the plot context stack or display focus. Used by callers that manage the navigation stack and keyboard scope themselves while tearing the delta layer down — e.g. the braille-Escape command on a multi-panel figure, which pops the delta trace via exitSubplot() and re-focuses the plot on its own. Using deactivate there would double-manage the stack and fire a competing focus change.

      Returns void