Published unlisted
Edited
Jun 5, 2019
Insert cell
Insert cell
viewof image = imageInput({
crossOrigin: "anonymous",
initialUrl: "http://pic.962.net/up/2018-7/15305889067284834.gif"
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
gifFrames = require("https://unpkg.com/gif-frames@1.0.1/dist/gif-frames.min.js?main=bundled-min")
Insert cell
// // gifFrames({ url: '', frames: 0, outputType: 'canvas' })
// // .then(function (frameData) {
// // });


// gifFrames({ url: image, frames: 'all', outputType: 'canvas' })
// .then(function (frameData) {
// nine_contents.appendChild(frameData[0].getImage());
// // return frameData[0].getImage();
// }).catch(console.error.bind(console));
Insert cell
// {
// try {
// const frameData = await gifFrames({ url: image, frames: '0'});
// return frameData;
// } catch(err) {
// console.error(err);
// }
// }
Insert cell
Insert cell
// gifrender = require('https://raw.githubusercontent.com/matt-way/gifuct-js/master/src/gif.js')
Insert cell
Insert cell
{
const gif = new GIF;
}

Insert cell
html `<canvas id="test"></canvas>`
Insert cell
{
let imgx = new Image();
let load = new Promise((resolve, reject) => {
imgx.onload = resolve;
imgx.onerror = reject;
});
imgx.src = 'http://pic.962.net/up/2018-7/15305889067284834.gif';
imgx.onclick = ()=>{
};
// return imgx;
const ctx = DOM.context2d(imgx.naturalWidth, imgx.naturalHeight);
ctx.drawImage(imgx, 0, 0);
return ctx.canvas;
// let y = ctx.canvas;
// return y;
// load.then(() => {
// const ctx = DOM.context2d(imgx.naturalWidth, imgx.naturalHeight);
// ctx.drawImage(image, 0, 0);
// // return ctx;
// });
// return imgx;
}
Insert cell
imgy = {
let imgy = new Image();
imgy.src = 'http://pic.962.net/up/2018-7/15305889067284834.gif';
return imgy;
}
Insert cell
pausable("http://pic.962.net/up/2018-7/15305889067284834.gif")
Insert cell
{
imgy.addEventListener('click', ()=>{
let block = html`<div style="width=100;height:100"></div>`;
imgy.appendChild(block);
});
}
Insert cell
import {pausable} from "@tmcw/pausable-gif"
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