UNPKG

nuke-biz-custom-chart

Version:

custom-chart

28 lines (24 loc) 695 B
// import GCanvas from '../gcanvas/gcanvas'; // import GCanvas from '../gcanvas-copy'; import GCanvas from 'weex-gcanvas'; // import GCanvas from '@weex-module/gcanvas'; export function disable() { GCanvas.disable(); } export function init(element) { return new Promise((resolve) => { const gcanvas = GCanvas.start(element); const ctx = gcanvas.getContext('2d'); resolve(ctx); }); // return new Promise((resolve) => { // GCanvas.start(element.ref, () => { // GCanvas.setDevicePixelRatio(); // const ctx = GCanvas.getContext('2d'); // // GCanvas.startLoop(); // GCanvas.render(() => { // resolve(ctx); // }); // }); // }); }