Published
Edited
Apr 13, 2021
Insert cell
Insert cell
Insert cell
map = html`<svg viewBox="0 0 ${width} ${height}"style= "background-color: lightblue">
<path d="${path(data)}" fill="none" stroke="gray"></path>
</svg>`;
Insert cell
paintbg()
Insert cell
function paintbg(){
return (d3.select("svg")
.call(zoomExtent.on("zoom", zoom))
)
}
Insert cell
zoomExtent = d3.zoom().scaleExtent([1, 20]);
Insert cell
g = d3.select("path").append("g")
.attr("class", "pippo")
.attr("transform",`translate(8,${margin.top})`)
Insert cell
function zoom() {
g.attr("transform", d3.event.transform)
}
Insert cell
projection = d3.geoIdentity()
.reflectY(true)
.fitWidth(width, data)
Insert cell
margin = ({top: 0, bottom: 0, left: 0, right: 0})
Insert cell
Insert cell
width = 954
Insert cell
height = Math.ceil(path.bounds(data)[1][1])
Insert cell
d3 = require("d3-geo@1", "d3@5")
Insert cell
import {jsonInput} from "@mbostock/file-input"

Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more