UNPKG

@visactor/vchart

Version:

charts lib based @visactor/VGrammar

25 lines (21 loc) 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.CallbackDisappearAnimate = void 0; const vrender_animate_1 = require("@visactor/vrender-animate"); class CallbackDisappearAnimate extends vrender_animate_1.AStageAnimate { constructor(from, to, duration, easing, params) { super(from, to, duration, easing, params), this.currentAnimationRatio = 0, this.animationTime = 0; } onUpdate(end, ratio, out) { super.onUpdate(end, ratio, out), this.currentAnimationRatio = ratio, this.animationTime = ratio * Math.PI * 2; } getAnimationTime() { return this.currentAnimationRatio > 0 ? this.animationTime : Date.now() / 1e3; } afterStageRender(stage, canvas) { var _a, _b; return null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.callBack) || void 0 === _b ? void 0 : _b.call(_a, stage, canvas, this.currentAnimationRatio, this.animationTime); } } exports.CallbackDisappearAnimate = CallbackDisappearAnimate;