Published
Edited
Aug 31, 2021
3 stars
Also listed in…
Geo
Tricontours
Insert cell
Insert cell
Insert cell
Insert cell
blur = (d, i) =>
d3.median([i, ...triangulation.neighbors(i)], j => points[j][2])
Insert cell
points = d3.json(
"https://gist.githubusercontent.com/Fil/6bc12c535edc3602813a6ef2d1c73891/raw/3ae88bf307e740ddc020303ea95d7d2ecdec0d19/points.json"
)
Insert cell
triangulation = {
const c = d3.geoContour();
c.contour(points, 0); // compute a single contour to force the computation of the triangulation
return c._triangulation();
}
Insert cell
contour = d3
.geoContour()
.thresholds(100)
.value(!plain ? blur : d => d[2])
Insert cell
contours = ({
type: "FeatureCollection",
features: [{ type: "Sphere", value: -50 }, ...contour(points)]
})
Insert cell
color = d3.scaleSequential(d3.interpolateRdBu).domain([40, -20])
Insert cell
projection = d3
.geoArmadillo()
.fitExtent([[0, 0], [width, height]], { type: "Sphere" })
Insert cell
land = d3.json(
"https://unpkg.com/visionscarto-world-atlas/world/110m_land.geojson"
)
Insert cell
Insert cell
d3 = require("d3@7", "d3-geo-voronoi@2", "d3-geo-projection@3")
Insert cell
height = ((width * 2) / 3) | 0
Insert cell
import {checkbox} from "@jashkenas/inputs"
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