Published
Edited
Jun 24, 2022
1 star
Also listed in…
Tips and Utilities
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof button = Inputs.button("Click me",{
reduce: ()=> {
console.log("clicked")
out.dispatchEvent(myEvent)
}
})
Insert cell
{
out.addEventListener("confettipop", (event) => {
console.log("I'm listening on a custom event");

myConfetti({
particleCount: 100,
spread: 160
// any other options from the global
// confetti function
});
});

var myConfetti = confetti.create(out, {
resize: true,
useWorker: true
});


}
Insert cell
myEvent = new CustomEvent("confettipop", {
detail: {},
bubbles: true,
cancelable: true,
composed: false,
});
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