Public
Edited
Dec 14, 2022
1 fork
7 stars
Insert cell
Insert cell
map = mapfillContours(
(d) => temperature(d, sources),
d3.geoOrthographic().rotate([0, -35, -20]),
{
N: 10000,
color,
thresholds: 100,
graticule: d3.geoGraticule()()
}
)
Insert cell
color = d3.scaleSequential(d3.interpolatePlasma).domain([0, 1.5])
Insert cell
function temperature(p, sources) {
return sources.map(q => kernel(p, q)).reduce((a, b) => a + b);
}
Insert cell
sigma = 0.2
Insert cell
function kernel(p, q) {
return Math.exp(-Math.pow(d3.geoDistance(p, q) / sigma, 2));
}
Insert cell
sources = Array.from({ length: 100 }, () => [
360 * (Math.random() - 0.5),
90 * (Math.random() - Math.random())
])
Insert cell
import {mapfillContours} from "@fil/mapfill"
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