Public
Edited
Sep 22, 2024
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
data
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
mutable currentValue = 2; // current val for the slider as mutuable state
Insert cell
mutable animationRunning = false; //animation currently running?
Insert cell
{
mutable animationRunning = !mutable animationRunning; // Toggle running state on button click
if (startAnimation) {
let start = 0.02;
let end = 4.0;
let step = 0.005;
let delay = 1; // milliseconds

for (let value = start; value <= end; value += step) {
if (!mutable animationRunning) break; // Check if animation should stop
yield Promises.tick(delay);
mutable currentValue = value;
}
}
}
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