Tears down the MAIDR instance mounted on a plot element.
The re-init path above handles a chart whose data changed, because the same
element is bound again. A chart the host page discarded never comes back,
so nothing triggers that path: the React root stays mounted on a detached
container, its effects never clean up, and whatever they registered — a live
data entry, hotkeys, an audio context — is retained for the life of the page.
That is the ordinary case for a reactive document rather than an unusual one.
An Observable JS cell re-runs whenever an input it depends on changes, and
the runtime replaces the cell's output node each time, so a reader dragging a
slider discards one chart per frame.
Idempotent, and safe to call for an element that was never bound.
Tears down the MAIDR instance mounted on a plot element.
The re-init path above handles a chart whose data changed, because the same element is bound again. A chart the host page discarded never comes back, so nothing triggers that path: the React root stays mounted on a detached container, its effects never clean up, and whatever they registered — a live data entry, hotkeys, an audio context — is retained for the life of the page.
That is the ordinary case for a reactive document rather than an unusual one. An Observable JS cell re-runs whenever an input it depends on changes, and the runtime replaces the cell's output node each time, so a reader dragging a slider discards one chart per frame.
Idempotent, and safe to call for an element that was never bound.