Last active
December 4, 2023 20:37
-
-
Save mbostock/b198922e4837fa3d96af13fb27d5c723 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<p id="greeting"></p> | |
<script type="module"> | |
import {Runtime, Inspector, Library} from "https://unpkg.com/@observablehq/notebook-runtime?module"; | |
import notebook from "https://api.observablehq.com/d/6c9b7fd62ca784c0.js"; | |
// Rewrite the notebook to redefine the “subject” cell in the main module. | |
const override = { | |
id: notebook.id, | |
modules: notebook.modules.map(module => { | |
if (module.id !== notebook.id) return module; | |
return { | |
id: module.id, | |
variables: module.variables.map(variable => { | |
if (variable.name !== "subject") return variable; | |
return { | |
name: variable.name, | |
inputs: [], | |
value: () => "Fred" | |
}; | |
}) | |
}; | |
}) | |
}; | |
Runtime.load(override, new Library, cell => { | |
if (cell.name === "greeting") { | |
return new Inspector(document.querySelector("#greeting")); | |
} | |
}); | |
</script> |
Hi Mike,
I sent you an email. Need you help.
Best Regards
Roberto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Mike,
I sent you an email. Need you help.
Best Regards
Roberto