Public
Edited
Apr 13, 2024
10 forks
15 stars
Insert cell
Insert cell
chart = html`<svg style="width: 100%; height: auto; display: block;" viewBox="0 0 ${n} ${m}">
${Array.from(contours(values), d => svg`<path d="${path(d)}" fill="${color(d.value)}" />`)}
</svg>`
Insert cell
path = d3.geoPath()
Insert cell
contours = d3.contours()
.size([n, m])
.smooth(false)
.thresholds(20)
Insert cell
color = d3.scaleSequential(d3.extent(values), d3.interpolateMagma)
Insert cell
image = tiff.getImage()
Insert cell
values = (await image.readRasters())[0]
Insert cell
n = image.getWidth()
Insert cell
m = image.getHeight()
Insert cell
tiff = FileAttachment("sfctmp.tiff").arrayBuffer()
.then(buffer => GeoTIFF.fromArrayBuffer(buffer))
Insert cell
GeoTIFF = require("geotiff@2")
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