Public
Edited
Jul 26, 2022
Fork of Scrubber
3 forks
Importers
33 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
numbers = Array.from({length: 256}, (_, i) => i)
Insert cell
dates = Array.from({ length: 365 }, (_, i) => {
const date = new Date(2019, 0, 1);
date.setDate(i + 1);
return date;
})
Insert cell
letters = 'abcdefghijklmnopqrstuvwxyz'.split('')
Insert cell
Insert cell
viewof a = Player(dates, {
autoplay: true,
initial: 100,
format: (date) =>
date.toLocaleString("en", { month: "long", day: "numeric" }),
debug: true
})
Insert cell
Insert cell
Insert cell
viewof b = Player(letters, { index: true, delay: 1000 })
Insert cell
Insert cell
Insert cell
viewof c = Player(numbers, { delay: 250 })
Insert cell
Insert cell
Insert cell
viewof d = Player(numbers, { loop: true, alternate: true })
Insert cell
Insert cell
Insert cell
viewof e = Player(numbers, {
width: 450,
time: true,
loop: true
})
Insert cell
Insert cell
Insert cell
viewof f = Player(letters, {
delay: 250,
loop: true,
show: { play: true, stop: true }
})
Insert cell
Insert cell
viewof g = Player(letters, {
delay: 350,
loop: true,
show: { stepLeft: false, stepRight: false, alternate: false }
})
Insert cell
Insert cell
Insert cell
{
const text = 'update player g';
const btn = html`<button>${text}`;
btn.onclick = () => {
const v = Math.floor(Math.random() * letters.length);
viewof g.update(v);
btn.innerHTML = `${text} (latest jump to ${v})`;
};
return btn;
}
Insert cell
{
const text = 'toggle player g play/pause';
const btn = html`<button>${text}`;
btn.onclick = () => {
viewof g.remoteClickPlayPause();
};
return btn;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more