Public
Edited
Oct 16, 2024
Paused
2 forks
4 stars
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
bottomLeft = [-33.90497219096265 + shuntDown, 151.17050170898438]
Insert cell
topRight = [-33.847179923191746 + shuntDown, 151.25375747680664]
Insert cell
Insert cell
midpoint = [
(bottomLeft[0] + topRight[0]) / 2,
(bottomLeft[1] + topRight[1]) / 2
]
Insert cell
bbox = [...bottomLeft, ...topRight].join(",")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function haversine([lon1, lat1], [lon2, lat2]) {
const from = turf.point([lon1, lat1]);
const to = turf.point([lon2, lat2]);
return turf.distance(from, to, { units: "metres" });
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
scaleMember = (scale) => (value) => {
const color = scale.apply(value);
return html`<span style="border-bottom: solid ${color} 3px">${value}</span>`;
}
Insert cell
telephone = () => scaleMember(distanceMap.scale("color"))("telephone")
Insert cell
panel = () => scaleMember(distanceMap.scale("color"))("panel")
Insert cell
Insert cell
Insert cell
redHighlight = highlight("red")
Insert cell
redHighlight(5)
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