Public
Edited
Apr 19, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {get_journeys} from "529140a6d468cf32"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
isochrone_color = d3
.scaleLinear()
.domain([0, max_duration])
.range(["white", "royalblue"])
Insert cell
Insert cell
Insert cell
Insert cell
function predecessor(i) {
const duration = +data[i].duration;
// which is the nearest among points that are bigger than me
return d3.scan(
data.map((d, j) =>
+d.duration < duration
? d3.geoDistance(points[i], points[j]) *
Math.sqrt(duration / +d.duration)
: Infinity
)
);
}
Insert cell
// How many seconds walking, per pixel?
walkingtime = {
// At the equator 40000km ~= 960px * projection.scale() / d3.geoMercator().scale()
// multiply by cos(latitude)
const scale =
walkingspeed /
(((40000 * Math.cos(projection.center()[1] * radians)) /
960 /
projection.scale()) *
d3.geoMercator().scale() *
3600);
return function(T) {
return T * scale;
};
}
Insert cell
Insert cell
Insert cell
Insert cell
path = d3.geoPath().projection(projection)
Insert cell
rawpath = d3.geoPath()
Insert cell
Insert cell
Insert cell
import {tile, nextzenapikey} with {largeprojection as projection} from "17564db3a49dd521"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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