-
-
Save mbostock/7f03057b2b4db398b9d0988bbef2f409 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> | |
<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