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

    Class LiveDataManager

    Global registry that routes realtime data updates to mounted chart instances.

    Each <Maidr> instance registers itself by chart id. External producers (script-tag consumers via window.maidrLive, or React consumers via the data prop) push updates through setData / appendData; the manager merges them and notifies the owning instance, which refreshes its model in place.

    Index

    Constructors

    Methods

    • Registers a chart instance for live updates.

      Parameters

      • initial: Maidr

        The chart's current Maidr config (keyed by initial.id)

      • listener: LiveDataListener

        Invoked whenever the chart's data changes

      Returns Disposable

      A disposable that unregisters the instance

    • Replaces all data for a registered chart and notifies it.

      The manager stores the passed reference without cloning; callers must not mutate the object after handing it over. (Consumers clone before giving it to the model layer, which does take ownership.)

      Parameters

      • maidr: Maidr

        The full replacement config; the target chart is maidr.id

      Returns boolean

      True when a registered chart was updated

    • Replaces the stored data for a chart without notifying it. Used to keep the registry in sync with externally-driven updates (e.g. React prop changes on non-live charts).

      Like setData, the reference is stored without cloning; callers must not mutate the object after handing it over.

      Parameters

      • maidr: Maidr

        The replacement config

      Returns void

    • Appends a single data point to a registered chart and notifies it.

      Parameters

      • point: LiveDataPoint

        The data point to append

      • options: AppendDataOptions & { id?: string } = {}

        Target chart (id) and layer/group; id may be omitted when exactly one chart is registered

      Returns boolean

      True when the point was merged and the chart notified

    • Returns the current data for a registered chart.

      Parameters

      • id: string

        The chart id

      Returns Maidr | undefined

      The stored Maidr config, or undefined when not registered