Skip to content

Instantly share code, notes, and snippets.

@mbostock
Created January 16, 2020 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbostock/7f03057b2b4db398b9d0988bbef2f409 to your computer and use it in GitHub Desktop.
Save mbostock/7f03057b2b4db398b9d0988bbef2f409 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<style>
@import url("https://cdn.jsdelivr.net/npm/leaflet@1.3.0/dist/leaflet.css");
body {
max-width: 800px;
margin: auto;
}
</style>
<body>
<div id="chart"></div>
<div id="map"></div>
<script type="module">
import {Runtime, Inspector, Library} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";
import notebook1 from "https://api.observablehq.com/d/310b9c62aec0e434.js?v=3";
import notebook2 from "https://api.observablehq.com/@d3/bivariate-choropleth.js?v=3";
const runtime = new Runtime;
runtime.module(notebook1, name => {
if (name === "map") {
return new Inspector(document.querySelector(`#${name}`));
}
});
runtime.module(notebook2, name => {
if (name === "chart") {
return new Inspector(document.querySelector(`#${name}`));
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment