Published
Edited
Mar 16, 2021
1 star
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
delays = {
settings;

let lastDelay = easing(0);
let normalizationFactor = 1;

const delays = [lastDelay];
for (let i = delays.length; i < items.length; i++) {
const delay = easing(i);
if ((delay - lastDelay) * maxAnimationDelay < minPerceivableDuration) {
normalizationFactor = 1 / delay;
break;
}
lastDelay = delay;
delays.push(delay);
}

return delays.map(delay => normalizationFactor * delay);
}
Insert cell
Insert cell
Insert cell
Insert cell
function getDelay(i) {
return delays[i] ?? 1;
}
Insert cell
settings = ({
minPerceivableDuration,
animationDuration,
itemCount,
maxAnimationDelay,
rateScaleFactor,
easing: easing.name
})
Insert cell
Insert cell
Insert cell
easingIndex
Insert cell
Insert cell
Insert cell
Insert cell
import { pbcopy } from "@mbostock/pbcopy"
Insert cell
import { Range, Radio, Button } from "@observablehq/inputs"
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