UNPKG

@visactor/vmind

Version:

<div align="center"> <a href="https://github.com/VisActor#gh-light-mode-only" target="_blank"> <img alt="VisActor Logo" width="200" src="https://github.com/VisActor/.github/blob/main/profile/logo_500_200_light.svg"/> </a> <a href="https://githu

62 lines (58 loc) 1.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.animationPie = void 0; const constants_1 = require("../constants"), common_1 = require("./common"), animationPie = context => { var _a; const {spec: spec} = context, totalTime = null !== (_a = context.totalTime) && void 0 !== _a ? _a : constants_1.DEFAULT_PIE_VIDEO_LENGTH, groupKey = context.cell.color, groupNum = spec.data.values.map((d => d[groupKey])).filter(common_1.onlyUnique).length, loopTime = 100 + 100 * groupNum + 400; return 500 * groupNum + loopTime < totalTime ? (spec.animationAppear = { oneByOne: Number.MIN_VALUE, duration: (totalTime - loopTime) / groupNum, options: { overall: !1 } }, spec.animationNormal = { pie: [ { startTime: 100, oneByOne: 100, timeSlices: [ { delay: 0, effects: { channel: { scaleX: { to: 1.2 }, scaleY: { to: 1.2 } }, easing: "linear" }, duration: 200 }, { effects: { channel: { scaleX: { to: 1 }, scaleY: { to: 1 } }, easing: "linear" }, duration: 200 } ] } ] }) : spec.animationAppear = { oneByOne: Number.MIN_VALUE, duration: totalTime / groupNum, options: { overall: !1 } }, { spec: spec }; }; exports.animationPie = animationPie; //# sourceMappingURL=polar.js.map