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

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