Public
Edited
Feb 12, 2023
1 fork
1 star
Insert cell
Insert cell
progress = async max => {
const element = html`<progress value=0 width=${width}>`
let count = 0
const counter = setInterval(() => {
if (count === max) {
return clearInterval(count)
}
++count
element.value = count/max
element.dispatchEvent(new CustomEvent('input'))
}, 300)
return element
}
Insert cell
viewof x = progress(10)
Insert cell
// {
// viewof x.value = 0
// viewof x.dispatchEvent(new CustomEvent('input'))
// }
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