I’m trying to understand the Observable runtime a bit better. I understand that I can use this code to embed a cell in an element on any page:
<div id="embedded-nb">
<div class="embedded-chart"></div>
</div>
<script type="module">
import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";
import define from "https://api.observablehq.com/path/to/notebook?v=3"
(new Runtime).module(define, name => {
if (name === 'cellName') return Inspector.into("#embedded-nb .embedded-chart")()
});
</script>
Is there a way to inject dependencies while doing this on an arbitrary HTML page? Similar to how I can do:
import { cellName } with { injectedValue as cellDependency } from "path/to/notebook"
inside of a notebook.