@mbostock I used to be able to specify specific cells with Runtime.load which would in turn load the specified cells’ dependencies. I think this functionality may have broken at some point.
Which version of the Runtime are you using? I don’t see any errors on the Breakout! link, but it is using 1.0.1 of the runtime, whereas the latest version 3.0.5 features a new API and uses a different module format.
But it is failing with version 3. I’ll re-read the documentation – perhaps I missed a usage change. The current error I’m getting is: viewof person_list = RuntimeError: select is not defined where person_list is the thing I want to render and select is the typical import from import {select, date, button} from "@jashkenas/inputs" which person_list depends on.
Making progress. I think at least one issue may have been that that forgot to add viewof in front of the variable name when referencing it in my embedded version. I’m no longer getting the is not defined error message. Thanks for your help.
The v3 API deprecated the Runtime.load method (and perhaps should have removed it entirely); you should only use that if you’re using v1 of the Runtime. As shown in the README, the new API looks like this:
import {Runtime, Inspector} from "https://unpkg.com/@observablehq/runtime@3/dist/runtime.js";
import define from "https://api.observablehq.com/@tmcw/hello-world.js?v=3";
const runtime = new Runtime();
const main = runtime.module(define, name => {
if (name === "hello") {
return new Inspector(document.querySelector("#hello"));
}
});
In other words, replace Runtime.load with runtime.module, and replace the variable.name with name.
A quick update: the v=3 API is now the default (linked from the Download code and Download tarball actions in the notebook menu), and the API now supports v=3 tarballs.
You can find the repos and API references here (under new names):
We’re working on updates to the documentation that will give more guidance on how to use the v=3 API. Please let me know if you have any questions!