Published
Edited
Jun 20, 2018
Insert cell
Insert cell
Insert cell
positions = [[0,0], [5, 10], [10, 20], [30, 40], [40, 50], [50, 60]]
Insert cell
Insert cell
function* time(index) {
const inter = d3.interpolate(positions[index], positions[index+1])
for(let i = 0; i < 60; i++) {
yield inter(i/(60-1));
}
}
Insert cell
Insert cell
time(3)
Insert cell
Insert cell
loopThrough(positions)
Insert cell
Insert cell
function* loopThrough(array){
for (let i = 0; i < array.length-1; i++) {
yield* time(i);
}
}
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