Binding and Quarto auto-detection for the Observable Plot adapter.
A Quarto document's charts are drawn by the OJS runtime, from code cells the
author wrote for a browser and not for this adapter. Nothing calls a binder,
because there is nothing in an {ojs} cell to call it from — the cell's
value is the chart, and Quarto inserts it into the page for you.
So the adapter watches instead. initObservablePlots observes the
document, recognises an Observable Plot chart when one appears, converts it,
and hands the schema to MAIDR's runtime. An author adds the script and their
existing plots become navigable; nothing in the cell changes.
Watching also handles the part of OJS that a one-shot scan could not:
reactivity. A cell that depends on a viewof input re-runs on every change
and replaces its output node wholesale, so charts appear long after load,
repeatedly, and the observer catches each new one.
Binding and Quarto auto-detection for the Observable Plot adapter.
A Quarto document's charts are drawn by the OJS runtime, from code cells the author wrote for a browser and not for this adapter. Nothing calls a binder, because there is nothing in an
{ojs}cell to call it from — the cell's value is the chart, and Quarto inserts it into the page for you.So the adapter watches instead. initObservablePlots observes the document, recognises an Observable Plot chart when one appears, converts it, and hands the schema to MAIDR's runtime. An author adds the script and their existing plots become navigable; nothing in the cell changes.
Watching also handles the part of OJS that a one-shot scan could not: reactivity. A cell that depends on a
viewofinput re-runs on every change and replaces its output node wholesale, so charts appear long after load, repeatedly, and the observer catches each new one.