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

58 lines (55 loc) 1.8 kB
import { DEFAULT_PIE_VIDEO_LENGTH } from "../constants"; import { onlyUnique } from "./common"; export const animationPie = context => { var _a; const {spec: spec} = context, totalTime = null !== (_a = context.totalTime) && void 0 !== _a ? _a : DEFAULT_PIE_VIDEO_LENGTH, groupKey = context.cell.color, groupNum = spec.data.values.map((d => d[groupKey])).filter(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 }; }; //# sourceMappingURL=polar.js.map