Published
Edited
Jul 27, 2021
Importers
8 stars
Insert cell
Insert cell
Insert cell
{
const context = DOM.context2d(400, 225, 2);
context.putImageData(frames[i].data, 0, 0);
return context.canvas;
}
Insert cell
// https://www.flickr.com/photos/r8r/3444024147
frames = giframes("https://live.staticflickr.com/3348/3444024147_bde1c1e888_o.gif")
Insert cell
giframes = (url) => {
const gif = new Image();
gif.src = url;
return new Promise((resolve) => {
const g = new G({ gif });
g.load(() => resolve(g.get_frames()));
});
}
Insert cell
G = require("libgif@0.0.3")
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