Published
Edited
Oct 17, 2021
1 fork
2 stars
Insert cell
Insert cell
html`<svg viewBox="0 0 ${width} ${height}">
<path d="${path(nz_geojson )}" fill="none" stroke="black"></path>
</svg>`
Insert cell
projection = d3.geoIdentity()
.reflectY(true)
.fitWidth(width, nz_geojson )

Insert cell
path = d3.geoPath(projection)

Insert cell
width = 954
Insert cell
height = Math.ceil(path.bounds(nz_geojson )[1][1])
Insert cell
zip = require(await FileAttachment("node-zip-1.1.1").url())
Insert cell
files = zip(await FileAttachment("regional-council-2020-clipped-generalised geojson trimmed.zip").arrayBuffer(), {
base64: false,
checkCRC32: true
}).files
Insert cell
nz_geojson = JSON.parse(files['regional-council-2020-clipped-generalised geojson trimmed.json'].asText())
Insert cell
d3 = require('d3')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more