Published
Edited
Apr 12, 2021
1 star
Insert cell
Insert cell
Insert cell
gs = require('https://bundle.run/gsap@3.6.1')
Insert cell
gsap = gs.gsap
Insert cell
Insert cell
drag = import("https://cdn.jsdelivr.net/npm/gsap@3.6.1/Draggable.js")
Insert cell
Draggable = drag.Draggable
Insert cell
Insert cell
gs.gsap.registerPlugin(drag);
Insert cell
Insert cell
draggable_box = {
const elem = document.createElement("div");
elem.style.width = "100px";
elem.style.height = "100px";
elem.style.backgroundColor = "blue";
elem.id = "elem";
return elem
}
Insert cell
{
draggable_box; // if draggable_box is reloaded, we reattach the Draggable behavior
Draggable.create("#elem");
}
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