So I was trying to use some of the code found in this question, but it does not work.
The Runtime.
statement is slightly different from yours, but I am not sure how to modify it. What documentation should I be looking at to understand how Runtime
works / what it expects?
<html>
<body>
<div class="wrapper">
<div id="chart"></div>
<div id="ageGroup"></div>
<div id="classification"></div>
<div id="colorScheme"></div>
</div>
</body>
<script type="module">
// Load the Observable runtime and inspector
import {Inspector, Runtime} from "https://unpkg.com/@observablehq/notebook-runtime@2?module";
// Load your notebook, compiled as an ES module.
import notebook from "https://api.observablehq.com/@bjl2n/bmi-classification-prevalence-mapping.js?v=3";
const renders = {"chart": "#chart",
"viewof ageGroup": "#ageGroup",
"viewof classification": "#classification",
"viewof colorScheme": "#colorScheme"};
for (let i in renders)
renders[i] = document.querySelector(renders[i]);
Runtime.load(notebook, (variable) => {
if (renders[variable.name])
return new Inspector(renders[variable.name]);
});
</script>
</html>