export default class WxCanvas { constructor(ctx, canvasId, isNew, canvasNode) { this.ctx = ctx; this.canvasId = canvasId; this.chart = null; this.isNew = isNew if (isNew) { this.canvasNode = canvasNode; } else { this._initStyle(ctx); } // this._initCanvas(zrender, ctx); this._initEvent(); } getContext(contextType) { if (contextType === '2d') { return this.ctx; } } // canvasToTempFilePath(opt) { // if (!opt.canvasId) { // opt.canvasId = this.canvasId; // } // return wx.canvasToTempFilePath(opt, this); // } setChart(chart) { this.chart = chart; } attachEvent() { // noop } detachEvent() { // noop } _initCanvas(zrender, ctx) { zrender.util.getContext = function () { return ctx; }; zrender.util.$override('measureText', function (text, font) { ctx.font = font || '12px sans-serif'; return ctx.measureText(text); }); } _initStyle(ctx) { ctx.createRadialGradient = () => { return ctx.createCircularGradient(arguments); }; } _initEvent() { this.event = {}; const eventNames = [{ wxName: 'touchStart', ecName: 'mousedown' }, { wxName: 'touchMove', ecName: 'mousemove' }, { wxName: 'touchEnd', ecName: 'mouseup' }, { wxName: 'touchEnd', ecName: 'click' }]; eventNames.forEach(name => { this.event[name.wxName] = e => { const touch = e.touches[0]; this.chart.getZr().handler.dispatch(name.ecName, { zrX: name.wxName === 'tap' ? touch.clientX : touch.x, zrY: name.wxName === 'tap' ? touch.clientY : touch.y }); }; }); } set width(w) { if (this.canvasNode) this.canvasNode.width = w } set height(h) { if (this.canvasNode) this.canvasNode.height = h } get width() { if (this.canvasNode) return this.canvasNode.width return 0 } get height() { if (this.canvasNode) return this.canvasNode.height return 0 } }
session(release): write data/sessions/d/8/d88785e0b4ff9b18: no space left on device
/root/go/pkg/mod/github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8bc0f8) /root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/context.go:81 (0x83623b) /root/go/pkg/mod/github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80b5f4) /root/go/pkg/mod/github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80b51c) /root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/context.go:125 (0x8363b2) /root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/context.go:115 (0x8473a6) /root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/recovery.go:161 (0x84739d) /root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/logger.go:40 (0x839a24) /root/go/pkg/mod/github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80b5f4) /root/go/pkg/mod/github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80b51c) /root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/context.go:125 (0x8363b2) /root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/router.go:187 (0x8412dd) /root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/router.go:304 (0x8423ec) /root/go/pkg/mod/gopkg.in/macaron.v1@v1.5.0/macaron.go:218 (0x83adde) /usr/local/btgo/src/net/http/server.go:2936 (0x7b23b5) serverHandler.ServeHTTP: handler.ServeHTTP(rw, req) /usr/local/btgo/src/net/http/server.go:1995 (0x7add91) (*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req) /usr/local/btgo/src/runtime/asm_amd64.s:1598 (0x47e160) goexit: BYTE $0x90 // NOP