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

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