Public
Edited
Mar 15, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
distanceKM = data.reduce((sum, current, i) => {
if (i===0) return 0;
return sum + haversine({lat: data[i-1][0], lon: data[i-1][1]}, {lat: current[0], lon: current[1]});
}, 0)
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