@visactor/vseed 0.4.27 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/column.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/line.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/animation/animation.d.ts +15 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/animation.js +94 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/animation.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/bar.d.ts +77 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/bar.js +88 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/bar.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/index.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/index.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/lineOrArea.d.ts +254 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/lineOrArea.js +138 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/lineOrArea.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/pie.d.ts +71 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/pie.js +176 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/pie.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/radar.d.ts +131 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/radar.js +46 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/radar.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/scatter.d.ts +102 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/scatter.js +57 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/scatter.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/types.d.ts +130 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/types.js +19 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/types.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/bar.d.ts +11 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/bar.js +13 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/bar.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barColor.d.ts +52 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barColor.js +51 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barColor.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barGroup.d.ts +102 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barGroup.js +84 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barGroup.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barMotion.d.ts +66 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barMotion.js +72 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barMotion.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/index.d.ts +86 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/index.js +60 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/index.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/lineOrArea.d.ts +29 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/lineOrArea.js +20 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/lineOrArea.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/pie.d.ts +14 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/pie.js +9 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/pie.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/scatter.d.ts +69 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/scatter.js +59 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/scatter.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js +63 -10
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.js +8 -3
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js +3 -3
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/index.js +1 -0
- package/dist/esm/types/chartType/area/area.d.ts +6 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +42 -0
- package/dist/esm/types/chartType/area/zArea.js +2 -1
- package/dist/esm/types/chartType/area/zArea.js.map +1 -1
- package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +6 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +42 -0
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js +2 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js.map +1 -1
- package/dist/esm/types/chartType/bar/bar.d.ts +6 -1
- package/dist/esm/types/chartType/bar/zBar.d.ts +42 -0
- package/dist/esm/types/chartType/bar/zBar.js +2 -1
- package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
- package/dist/esm/types/chartType/barParallel/barParallel.d.ts +6 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +42 -0
- package/dist/esm/types/chartType/barParallel/zBarParallel.js +2 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
- package/dist/esm/types/chartType/barPercent/barPercent.d.ts +6 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +42 -0
- package/dist/esm/types/chartType/barPercent/zBarPercent.js +2 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.js.map +1 -1
- package/dist/esm/types/chartType/boxPlot/zBoxPlot.d.ts +2 -0
- package/dist/esm/types/chartType/column/column.d.ts +6 -1
- package/dist/esm/types/chartType/column/zColumn.d.ts +42 -0
- package/dist/esm/types/chartType/column/zColumn.js +2 -1
- package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
- package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +6 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +42 -0
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js +2 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
- package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +6 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +42 -0
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js +2 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js.map +1 -1
- package/dist/esm/types/chartType/donut/donut.d.ts +6 -1
- package/dist/esm/types/chartType/donut/zDonut.d.ts +40 -0
- package/dist/esm/types/chartType/donut/zDonut.js +2 -1
- package/dist/esm/types/chartType/donut/zDonut.js.map +1 -1
- package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +2 -0
- package/dist/esm/types/chartType/histogram/zHistogram.d.ts +2 -0
- package/dist/esm/types/chartType/line/line.d.ts +6 -1
- package/dist/esm/types/chartType/line/zLine.d.ts +42 -0
- package/dist/esm/types/chartType/line/zLine.js +2 -1
- package/dist/esm/types/chartType/line/zLine.js.map +1 -1
- package/dist/esm/types/chartType/pie/pie.d.ts +6 -1
- package/dist/esm/types/chartType/pie/zPie.d.ts +40 -0
- package/dist/esm/types/chartType/pie/zPie.js +2 -1
- package/dist/esm/types/chartType/pie/zPie.js.map +1 -1
- package/dist/esm/types/chartType/raceBar/zRaceBar.d.ts +2 -0
- package/dist/esm/types/chartType/raceColumn/zRaceColumn.d.ts +2 -0
- package/dist/esm/types/chartType/raceLine/zRaceLine.d.ts +2 -0
- package/dist/esm/types/chartType/raceScatter/zRaceScatter.d.ts +2 -0
- package/dist/esm/types/chartType/radar/radar.d.ts +6 -1
- package/dist/esm/types/chartType/radar/zRadar.d.ts +40 -0
- package/dist/esm/types/chartType/radar/zRadar.js +2 -1
- package/dist/esm/types/chartType/radar/zRadar.js.map +1 -1
- package/dist/esm/types/chartType/rose/rose.d.ts +6 -1
- package/dist/esm/types/chartType/rose/zRose.d.ts +40 -0
- package/dist/esm/types/chartType/rose/zRose.js +2 -1
- package/dist/esm/types/chartType/rose/zRose.js.map +1 -1
- package/dist/esm/types/chartType/roseParallel/roseParallel.d.ts +6 -1
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +40 -0
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.js +2 -1
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.js.map +1 -1
- package/dist/esm/types/chartType/scatter/scatter.d.ts +6 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +42 -0
- package/dist/esm/types/chartType/scatter/zScatter.js +2 -1
- package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
- package/dist/esm/types/properties/annotation/annotation.d.ts +2 -0
- package/dist/esm/types/properties/annotation/annotationPoint.d.ts +4 -0
- package/dist/esm/types/properties/annotation/zAnnotationPoint.d.ts +1 -0
- package/dist/esm/types/properties/annotation/zAnnotationPoint.js +1 -0
- package/dist/esm/types/properties/annotation/zAnnotationPoint.js.map +1 -1
- package/dist/esm/types/properties/config/animation/animation.d.ts +72 -0
- package/dist/esm/types/properties/config/animation/animation.js +0 -0
- package/dist/esm/types/properties/config/animation/animationAtmosphere.d.ts +15 -0
- package/dist/esm/types/properties/config/animation/animationAtmosphere.js +0 -0
- package/dist/esm/types/properties/config/animation/animationConfig.d.ts +2 -0
- package/dist/esm/types/properties/config/animation/animationConfig.js +0 -0
- package/dist/esm/types/properties/config/animation/animationEffect.d.ts +72 -0
- package/dist/esm/types/properties/config/animation/animationEffect.js +0 -0
- package/dist/esm/types/properties/config/animation/animationLoop.d.ts +49 -0
- package/dist/esm/types/properties/config/animation/animationLoop.js +0 -0
- package/dist/esm/types/properties/config/animation/index.d.ts +6 -0
- package/dist/esm/types/properties/config/animation/index.js +1 -0
- package/dist/esm/types/properties/config/animation/zAnimation.d.ts +201 -0
- package/dist/esm/types/properties/config/animation/zAnimation.js +114 -0
- package/dist/esm/types/properties/config/animation/zAnimation.js.map +1 -0
- package/dist/esm/types/properties/config/annotation/zAnnotation.js +1 -0
- package/dist/esm/types/properties/config/annotation/zAnnotation.js.map +1 -1
- package/dist/esm/types/properties/config/area.d.ts +80 -0
- package/dist/esm/types/properties/config/area.js +3 -1
- package/dist/esm/types/properties/config/area.js.map +1 -1
- package/dist/esm/types/properties/config/bar.d.ts +120 -0
- package/dist/esm/types/properties/config/bar.js +3 -1
- package/dist/esm/types/properties/config/bar.js.map +1 -1
- package/dist/esm/types/properties/config/column.d.ts +120 -0
- package/dist/esm/types/properties/config/column.js +3 -1
- package/dist/esm/types/properties/config/column.js.map +1 -1
- package/dist/esm/types/properties/config/config.d.ts +840 -0
- package/dist/esm/types/properties/config/index.d.ts +1 -0
- package/dist/esm/types/properties/config/index.js +1 -0
- package/dist/esm/types/properties/config/line.d.ts +40 -0
- package/dist/esm/types/properties/config/line.js +3 -1
- package/dist/esm/types/properties/config/line.js.map +1 -1
- package/dist/esm/types/properties/config/pie.d.ts +120 -0
- package/dist/esm/types/properties/config/pie.js +6 -2
- package/dist/esm/types/properties/config/pie.js.map +1 -1
- package/dist/esm/types/properties/config/race.d.ts +240 -0
- package/dist/esm/types/properties/config/rose.d.ts +80 -0
- package/dist/esm/types/properties/config/rose.js +3 -1
- package/dist/esm/types/properties/config/rose.js.map +1 -1
- package/dist/esm/types/properties/config/scatter.d.ts +40 -0
- package/dist/esm/types/properties/config/scatter.js +3 -1
- package/dist/esm/types/properties/config/scatter.js.map +1 -1
- package/dist/esm/types/properties/theme/customTheme.d.ts +1680 -0
- package/dist/umd/index.js +5040 -641
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/animation/pie.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/animation/pie.ts"],"sourcesContent":["import { ChartTypeEnum } from 'src/pipeline/utils'\nimport {\n VScreenAnimationType,\n type PieLikeAppearConfig,\n type PieLikeLoopConfig,\n type PieLikeUpdateConfig,\n} from './types'\nimport { allowAnimation, getPrimaryEffect } from './utils'\nimport { radialPie, scalePie } from './utils/pie'\n\n/**\n * 饼图/环图/玫瑰图 入场动画\n * 动画类型:\n * 1. radial: 角度展开动画\n * 效果:pie/rose 按扇区角度展开。\n * 编排逻辑:pie/rose 同步使用 growAngleIn, rose 额外补 preset = growAngle。\n * 2. scale: 半径展开动画\n * 效果:pie/rose 按半径从内向外展开。\n * 编排逻辑:pie/rose 同步使用 growRadiusIn, 共用 appear 的 easing 和 duration。\n */\nexport const pieAppear = (config: PieLikeAppearConfig | undefined, chartType: string) => {\n if (!config || !allowAnimation(config)) {\n return false\n }\n\n const { effects, ease, duration } = config\n const effect = effects?.[0]\n const durationMs = (duration ?? 1) * 1000\n\n let configByType = {}\n if (effect === VScreenAnimationType.radial) {\n configByType = radialPie()\n } else if (effect === VScreenAnimationType.scale) {\n configByType = scalePie()\n }\n\n const result = {\n pie: {\n ...configByType,\n easing: ease,\n duration: durationMs,\n },\n rose: {\n ...configByType,\n easing: ease,\n duration: durationMs,\n },\n } as any\n\n if (chartType === ChartTypeEnum.Rose && effect === VScreenAnimationType.radial) {\n result.preset = 'growAngle'\n }\n return result\n}\n\n/**\n * 饼图/环图/玫瑰图 更新动画\n * 动画类型:\n * 1. default: 默认更新动画\n * 效果:pie/rose 使用 VChart 默认补间。\n * 编排逻辑:不指定角度或半径动画, 避免和 normal 阶段的通道动画冲突。\n */\nexport const pieUpdate = (config: PieLikeUpdateConfig | undefined) => {\n if (!config || !allowAnimation(config)) {\n return false\n }\n\n const { ease, duration } = config\n const durationMs = (duration ?? 1) * 1000\n\n // 用默认的补间效果即可\n return {\n pie: {\n easing: ease,\n duration: durationMs,\n },\n rose: {\n easing: ease,\n duration: durationMs,\n },\n }\n}\n\n/**\n * 饼图/环图/玫瑰图 新数据进入动画\n * 动画类型:\n * 1. default: 默认 enter 动画\n * 效果:新数据使用 VChart 默认 enter 补间。\n * 编排逻辑:pie/rose 共用 update 的 easing 和 duration。\n * 2. enlarge + rose: 淡入 enter 动画\n * 效果:rose 新数据使用 fadeIn。\n * 编排逻辑:当 normal 的 loop 效果为 enlarge 时启用, 避免 enter 和 enlarge 同时争用 outerRadius 通道。\n */\nexport const pieEnter = (config: PieLikeUpdateConfig | undefined, atmosphereConfig: PieLikeLoopConfig | undefined) => {\n if (!config || !allowAnimation(config)) {\n return false\n }\n const { ease, duration } = config\n const durationMs = (duration ?? 1) * 1000\n // 当normal动画存在且为radius时:\n // 玫瑰图enter不能用默认, 这样会和normal动画的radius视觉通道冲突\n let configByType = {}\n if (atmosphereConfig?.enable && getPrimaryEffect(atmosphereConfig.loop) === VScreenAnimationType.enlarge) {\n configByType = {\n type: 'fadeIn', // 具体类型可以根据视觉效果自定\n }\n }\n return {\n pie: {\n easing: ease,\n duration: durationMs,\n },\n rose: {\n ...configByType,\n easing: ease,\n duration: durationMs,\n },\n }\n}\n\n/**\n * 饼图/环图/玫瑰图 循环动画\n * 动画类型:\n * 1. enlarge: 半径放大动画\n * 效果:扇区 outerRadius 放大 10px 后恢复。\n * 编排逻辑:startTime = appear 存在 ? interval : 0, 前半段放大, 后半段恢复, oneByOne 错峰执行。\n * 2. relocate: 扇区偏移动画\n * 效果:扇区沿中心角方向向外偏移后恢复。\n * 编排逻辑:前半段计算 x/y 偏移, 后半段回到原始 x/y, 一轮结束后等待 interval。\n */\nexport const pieLoop = (config: PieLikeLoopConfig | undefined, ignoreFirstNormal: boolean) => {\n if (!config?.enable) {\n return false\n }\n const { loop, interval = 0 } = config\n let loopResult = {}\n\n // 轮播动画\n // const startTime = 0\n const startTime = ignoreFirstNormal ? interval * 1000 : 0\n const { effects: loopEffects = [], ease: loopEase } = loop ?? {}\n const loopDuration = 1\n const loopEffect = loopEffects[0]\n if (loopEffect === VScreenAnimationType.enlarge) {\n loopResult = [\n {\n channel: {\n outerRadius: {\n from: (...p: any[]) => {\n return p[1].attribute.outerRadius\n },\n to: (...p: any[]) => {\n return p[1].attribute.outerRadius + 10\n },\n },\n },\n startTime,\n oneByOne: loopDuration * 1000, // true -> loopDuration * 1000, 原理有待考究\n duration: (loopDuration / 2) * 1000,\n loop: true,\n easing: loopEase,\n delayAfter: (loopDuration / 2) * 1000 + interval * 1000,\n controlOptions: {\n immediatelyApply: false,\n },\n },\n {\n channel: {\n outerRadius: {\n from: (...p: any[]) => {\n return p[1].attribute.outerRadius + 10\n },\n to: (...p: any[]) => {\n return p[1].attribute.outerRadius\n },\n },\n },\n startTime,\n oneByOne: loopDuration * 1000, // true -> loopDuration * 1000, 原理有待考究\n duration: (loopDuration / 2) * 1000,\n easing: loopEase,\n delay: (loopDuration / 2) * 1000,\n delayAfter: interval * 1000,\n loop: true,\n controlOptions: {\n immediatelyApply: false,\n },\n },\n ]\n } else if (loopEffect === VScreenAnimationType.relocate) {\n const offset = 10\n loopResult = [\n {\n channel: {\n x: {\n from: (...p: any[]) => {\n return p[1].attribute.x\n },\n to: (...p: any[]) => {\n const angle = (p[1].attribute.startAngle + p[1].attribute.endAngle) / 2\n return p[1].attribute.x + offset * Math.cos(angle)\n },\n },\n y: {\n from: (...p: any[]) => {\n return p[1].attribute.y\n },\n to: (...p: any[]) => {\n const angle = (p[1].attribute.startAngle + p[1].attribute.endAngle) / 2\n return p[1].attribute.y + offset * Math.sin(angle)\n },\n },\n },\n startTime,\n oneByOne: loopDuration * 1000, // true -> loopDuration * 1000, 原理有待考究\n duration: (loopDuration / 2) * 1000,\n loop: true,\n easing: loopEase,\n delayAfter: (loopDuration / 2) * 1000 + interval * 1000,\n controlOptions: {\n immediatelyApply: false,\n },\n },\n {\n channel: {\n x: {\n from: (...p: any[]) => {\n const angle = (p[1].attribute.startAngle + p[1].attribute.endAngle) / 2\n return p[1].attribute.x + offset * Math.cos(angle)\n },\n to: (...p: any[]) => {\n return p[1].attribute.x\n },\n },\n y: {\n from: (...p: any[]) => {\n const angle = (p[1].attribute.startAngle + p[1].attribute.endAngle) / 2\n return p[1].attribute.y + offset * Math.sin(angle)\n },\n to: (...p: any[]) => {\n return p[1].attribute.y\n },\n },\n },\n startTime,\n oneByOne: loopDuration * 1000, // true -> loopDuration * 1000, 原理有待考究\n duration: (loopDuration / 2) * 1000,\n easing: loopEase,\n delay: (loopDuration / 2) * 1000,\n delayAfter: interval * 1000,\n loop: true,\n controlOptions: {\n immediatelyApply: false,\n },\n },\n ]\n }\n\n return {\n pie: loopResult,\n rose: loopResult,\n }\n}\n\n/**\n * 饼图/环图/玫瑰图 离场动画\n * 动画类型:\n * 1. none: 无离场动画\n * 效果:不配置自定义 exit。\n * 编排逻辑:返回 false, 关闭该阶段动画配置。\n */\nexport const pieExit = () => {\n return false\n}\n"],"names":["pieAppear","config","chartType","allowAnimation","effects","ease","duration","effect","durationMs","configByType","VScreenAnimationType","radialPie","scalePie","result","ChartTypeEnum","pieUpdate","pieEnter","atmosphereConfig","getPrimaryEffect","pieLoop","ignoreFirstNormal","loop","interval","loopResult","startTime","loopEffects","loopEase","loopDuration","loopEffect","p","offset","angle","Math","pieExit"],"mappings":"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"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { RadarAppearConfig, RadarLoopConfig, RadarUpdateConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 雷达图 入场动画
|
|
4
|
+
* 动画类型:
|
|
5
|
+
* 1. radial: 径向裁剪动画
|
|
6
|
+
* 效果:雷达区域按裁剪方式展开。
|
|
7
|
+
* 编排逻辑:使用 clipIn preset, duration 和 easing 由 appear 配置控制。
|
|
8
|
+
* 2. 其他: 生长动画
|
|
9
|
+
* 效果:雷达整体形状从中心增长。
|
|
10
|
+
* 编排逻辑:使用 grow preset, duration 和 easing 由 appear 配置控制。
|
|
11
|
+
*/
|
|
12
|
+
export declare const radarAppear: (config: RadarAppearConfig | undefined) => false | {
|
|
13
|
+
preset: string;
|
|
14
|
+
duration: number;
|
|
15
|
+
easing: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 雷达图 循环动画
|
|
19
|
+
* 动画类型:
|
|
20
|
+
* 1. atmosphere: 点氛围动画
|
|
21
|
+
* 效果:point 执行 breath/reveal/ripple 等氛围效果。
|
|
22
|
+
* 编排逻辑:startTime = appear 存在 ? interval : 0, 持续 1s, 一轮结束后等待 interval。
|
|
23
|
+
* 2. none: 无循环动画
|
|
24
|
+
* 效果:不配置 normal 动画。
|
|
25
|
+
* 编排逻辑:当 atmosphere.effect 为 none 时返回 false。
|
|
26
|
+
*/
|
|
27
|
+
export declare const radarLoop: (config: RadarLoopConfig | undefined, ignoreFirstNormal: boolean) => false | {
|
|
28
|
+
point: {
|
|
29
|
+
controlOptions: {
|
|
30
|
+
immediatelyApply: boolean;
|
|
31
|
+
};
|
|
32
|
+
channel?: undefined;
|
|
33
|
+
loop: boolean;
|
|
34
|
+
startTime: number;
|
|
35
|
+
delayAfter: number;
|
|
36
|
+
duration: number;
|
|
37
|
+
easing: string | undefined;
|
|
38
|
+
} | {
|
|
39
|
+
controlOptions: {
|
|
40
|
+
immediatelyApply: boolean;
|
|
41
|
+
};
|
|
42
|
+
channel: {
|
|
43
|
+
scaleX: {
|
|
44
|
+
from: number;
|
|
45
|
+
to: number;
|
|
46
|
+
};
|
|
47
|
+
scaleY: {
|
|
48
|
+
from: number;
|
|
49
|
+
to: number;
|
|
50
|
+
};
|
|
51
|
+
fillOpacity?: undefined;
|
|
52
|
+
strokeOpacity?: undefined;
|
|
53
|
+
outerBorder?: undefined;
|
|
54
|
+
};
|
|
55
|
+
loop: boolean;
|
|
56
|
+
startTime: number;
|
|
57
|
+
delayAfter: number;
|
|
58
|
+
duration: number;
|
|
59
|
+
easing: string | undefined;
|
|
60
|
+
} | {
|
|
61
|
+
controlOptions: {
|
|
62
|
+
immediatelyApply: boolean;
|
|
63
|
+
};
|
|
64
|
+
channel: {
|
|
65
|
+
fillOpacity: {
|
|
66
|
+
from: number;
|
|
67
|
+
to: number;
|
|
68
|
+
};
|
|
69
|
+
strokeOpacity: {
|
|
70
|
+
from: number;
|
|
71
|
+
to: number;
|
|
72
|
+
};
|
|
73
|
+
scaleX?: undefined;
|
|
74
|
+
scaleY?: undefined;
|
|
75
|
+
outerBorder?: undefined;
|
|
76
|
+
};
|
|
77
|
+
loop: boolean;
|
|
78
|
+
startTime: number;
|
|
79
|
+
delayAfter: number;
|
|
80
|
+
duration: number;
|
|
81
|
+
easing: string | undefined;
|
|
82
|
+
} | {
|
|
83
|
+
controlOptions: {
|
|
84
|
+
immediatelyApply: boolean;
|
|
85
|
+
};
|
|
86
|
+
channel: {
|
|
87
|
+
outerBorder: {
|
|
88
|
+
from: {
|
|
89
|
+
distance: number;
|
|
90
|
+
strokeOpacity: number;
|
|
91
|
+
};
|
|
92
|
+
to: (...args: any[]) => {
|
|
93
|
+
distance: number;
|
|
94
|
+
strokeOpacity: number;
|
|
95
|
+
stroke: any;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
scaleX?: undefined;
|
|
99
|
+
scaleY?: undefined;
|
|
100
|
+
fillOpacity?: undefined;
|
|
101
|
+
strokeOpacity?: undefined;
|
|
102
|
+
};
|
|
103
|
+
loop: boolean;
|
|
104
|
+
startTime: number;
|
|
105
|
+
delayAfter: number;
|
|
106
|
+
duration: number;
|
|
107
|
+
easing: string | undefined;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* 雷达图 更新动画
|
|
112
|
+
* 动画类型:
|
|
113
|
+
* 1. default: 默认更新动画
|
|
114
|
+
* 效果:雷达图使用 VChart 默认补间。
|
|
115
|
+
* 编排逻辑:只保留 update 的 duration 和 easing。
|
|
116
|
+
*/
|
|
117
|
+
export declare const radarUpdate: (config: RadarUpdateConfig | undefined) => false | {
|
|
118
|
+
duration: number;
|
|
119
|
+
easing: string | undefined;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* 雷达图 离场动画
|
|
123
|
+
* 动画类型:
|
|
124
|
+
* 1. default: 默认离场动画
|
|
125
|
+
* 效果:雷达图使用 VChart 默认补间完成离场。
|
|
126
|
+
* 编排逻辑:共用 exit 的 duration 和 easing, 保持离场节奏和 update 阶段一致。
|
|
127
|
+
*/
|
|
128
|
+
export declare const radarExit: (config: RadarUpdateConfig | undefined) => false | {
|
|
129
|
+
duration: number;
|
|
130
|
+
easing: string | undefined;
|
|
131
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { EFFECT_NONE, allowAnimation, atmospherePoint, getPrimaryEffect, toMs } from "./utils/index.js";
|
|
2
|
+
const radarAppear = (config)=>{
|
|
3
|
+
if (!allowAnimation(config)) return false;
|
|
4
|
+
const effect = getPrimaryEffect(config);
|
|
5
|
+
return {
|
|
6
|
+
preset: 'radial' === effect ? 'clipIn' : 'grow',
|
|
7
|
+
duration: toMs(config?.duration),
|
|
8
|
+
easing: config?.ease
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
const radarLoop = (config, ignoreFirstNormal)=>{
|
|
12
|
+
if (!config?.enable) return false;
|
|
13
|
+
const interval = config.interval ?? 0;
|
|
14
|
+
const startTime = ignoreFirstNormal ? toMs(interval) : 0;
|
|
15
|
+
if ((config.atmosphere?.effect ?? EFFECT_NONE) === EFFECT_NONE) return false;
|
|
16
|
+
return {
|
|
17
|
+
point: {
|
|
18
|
+
loop: true,
|
|
19
|
+
startTime,
|
|
20
|
+
delayAfter: toMs(interval),
|
|
21
|
+
duration: 1000,
|
|
22
|
+
easing: config.atmosphere?.ease,
|
|
23
|
+
...atmospherePoint(config.atmosphere?.effect),
|
|
24
|
+
controlOptions: {
|
|
25
|
+
immediatelyApply: false
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const radarUpdate = (config)=>{
|
|
31
|
+
if (!allowAnimation(config)) return false;
|
|
32
|
+
return {
|
|
33
|
+
duration: toMs(config?.duration),
|
|
34
|
+
easing: config?.ease
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const radarExit = (config)=>{
|
|
38
|
+
if (!allowAnimation(config)) return false;
|
|
39
|
+
return {
|
|
40
|
+
duration: toMs(config?.duration),
|
|
41
|
+
easing: config?.ease
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export { radarAppear, radarExit, radarLoop, radarUpdate };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=radar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/animation/radar.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/animation/radar.ts"],"sourcesContent":["import type { RadarAppearConfig, RadarLoopConfig, RadarUpdateConfig } from './types'\nimport { allowAnimation, EFFECT_NONE, getPrimaryEffect, toMs, atmospherePoint } from './utils'\n\n/**\n * 雷达图 入场动画\n * 动画类型:\n * 1. radial: 径向裁剪动画\n * 效果:雷达区域按裁剪方式展开。\n * 编排逻辑:使用 clipIn preset, duration 和 easing 由 appear 配置控制。\n * 2. 其他: 生长动画\n * 效果:雷达整体形状从中心增长。\n * 编排逻辑:使用 grow preset, duration 和 easing 由 appear 配置控制。\n */\nexport const radarAppear = (config: RadarAppearConfig | undefined) => {\n if (!allowAnimation(config)) {\n return false\n }\n const effect = getPrimaryEffect(config)\n return {\n preset: effect === 'radial' ? 'clipIn' : 'grow',\n duration: toMs(config?.duration),\n easing: config?.ease,\n }\n}\n\n/**\n * 雷达图 循环动画\n * 动画类型:\n * 1. atmosphere: 点氛围动画\n * 效果:point 执行 breath/reveal/ripple 等氛围效果。\n * 编排逻辑:startTime = appear 存在 ? interval : 0, 持续 1s, 一轮结束后等待 interval。\n * 2. none: 无循环动画\n * 效果:不配置 normal 动画。\n * 编排逻辑:当 atmosphere.effect 为 none 时返回 false。\n */\nexport const radarLoop = (config: RadarLoopConfig | undefined, ignoreFirstNormal: boolean) => {\n if (!config?.enable) {\n return false\n }\n const interval = config.interval ?? 0\n const startTime = ignoreFirstNormal ? toMs(interval) : 0\n if ((config.atmosphere?.effect ?? EFFECT_NONE) === EFFECT_NONE) {\n return false\n }\n\n return {\n point: {\n loop: true,\n startTime,\n delayAfter: toMs(interval),\n duration: 1000,\n easing: config.atmosphere?.ease,\n ...atmospherePoint(config.atmosphere?.effect),\n controlOptions: { immediatelyApply: false },\n },\n }\n}\n\n/**\n * 雷达图 更新动画\n * 动画类型:\n * 1. default: 默认更新动画\n * 效果:雷达图使用 VChart 默认补间。\n * 编排逻辑:只保留 update 的 duration 和 easing。\n */\nexport const radarUpdate = (config: RadarUpdateConfig | undefined) => {\n if (!allowAnimation(config)) {\n return false\n }\n return { duration: toMs(config?.duration), easing: config?.ease }\n}\n\n/**\n * 雷达图 离场动画\n * 动画类型:\n * 1. default: 默认离场动画\n * 效果:雷达图使用 VChart 默认补间完成离场。\n * 编排逻辑:共用 exit 的 duration 和 easing, 保持离场节奏和 update 阶段一致。\n */\nexport const radarExit = (config: RadarUpdateConfig | undefined) => {\n if (!allowAnimation(config)) {\n return false\n }\n return { duration: toMs(config?.duration), easing: config?.ease }\n}\n"],"names":["radarAppear","config","allowAnimation","effect","getPrimaryEffect","toMs","radarLoop","ignoreFirstNormal","interval","startTime","EFFECT_NONE","atmospherePoint","radarUpdate","radarExit"],"mappings":";AAaO,MAAMA,cAAc,CAACC;IAC1B,IAAI,CAACC,eAAeD,SAClB,OAAO;IAET,MAAME,SAASC,iBAAiBH;IAChC,OAAO;QACL,QAAQE,AAAW,aAAXA,SAAsB,WAAW;QACzC,UAAUE,KAAKJ,QAAQ;QACvB,QAAQA,QAAQ;IAClB;AACF;AAYO,MAAMK,YAAY,CAACL,QAAqCM;IAC7D,IAAI,CAACN,QAAQ,QACX,OAAO;IAET,MAAMO,WAAWP,OAAO,QAAQ,IAAI;IACpC,MAAMQ,YAAYF,oBAAoBF,KAAKG,YAAY;IACvD,IAAKP,AAAAA,CAAAA,OAAO,UAAU,EAAE,UAAUS,WAAU,MAAOA,aACjD,OAAO;IAGT,OAAO;QACL,OAAO;YACL,MAAM;YACND;YACA,YAAYJ,KAAKG;YACjB,UAAU;YACV,QAAQP,OAAO,UAAU,EAAE;YAC3B,GAAGU,gBAAgBV,OAAO,UAAU,EAAE,OAAO;YAC7C,gBAAgB;gBAAE,kBAAkB;YAAM;QAC5C;IACF;AACF;AASO,MAAMW,cAAc,CAACX;IAC1B,IAAI,CAACC,eAAeD,SAClB,OAAO;IAET,OAAO;QAAE,UAAUI,KAAKJ,QAAQ;QAAW,QAAQA,QAAQ;IAAK;AAClE;AASO,MAAMY,YAAY,CAACZ;IACxB,IAAI,CAACC,eAAeD,SAClB,OAAO;IAET,OAAO;QAAE,UAAUI,KAAKJ,QAAQ;QAAW,QAAQA,QAAQ;IAAK;AAClE"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { ScatterAppearConfig, ScatterLoopConfig, ScatterUpdateConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 散点图 入场动画
|
|
4
|
+
* 动画类型:
|
|
5
|
+
* 1. growth: 飞入动画
|
|
6
|
+
* 效果:点从上方移入, 同时恢复透明度和尺寸。
|
|
7
|
+
* 编排逻辑:只作用于 point mark, 使用 appear 的 easing 和 duration。
|
|
8
|
+
* 2. scale: 缩放动画
|
|
9
|
+
* 效果:点中心保持不变, size 从 0 过渡到最终尺寸。
|
|
10
|
+
* 编排逻辑:只作用于 point mark, 使用 appear 的 easing 和 duration。
|
|
11
|
+
*/
|
|
12
|
+
export declare const scatterAppear: (config: ScatterAppearConfig | undefined) => false | {
|
|
13
|
+
point: ({
|
|
14
|
+
loop: boolean;
|
|
15
|
+
startTime: number;
|
|
16
|
+
duration: number;
|
|
17
|
+
easing: string | undefined;
|
|
18
|
+
type: string;
|
|
19
|
+
delayAfter: number;
|
|
20
|
+
options: {
|
|
21
|
+
direction: string;
|
|
22
|
+
orient: string;
|
|
23
|
+
};
|
|
24
|
+
controlOptions: {
|
|
25
|
+
immediatelyApply: boolean;
|
|
26
|
+
};
|
|
27
|
+
channel?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
loop: boolean;
|
|
30
|
+
startTime: number;
|
|
31
|
+
duration: number;
|
|
32
|
+
easing: string | undefined;
|
|
33
|
+
delayAfter: number;
|
|
34
|
+
channel: {
|
|
35
|
+
fillOpacity: {
|
|
36
|
+
from: number;
|
|
37
|
+
};
|
|
38
|
+
size: {
|
|
39
|
+
from: (...args: any[]) => any;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
controlOptions: {
|
|
43
|
+
immediatelyApply: boolean;
|
|
44
|
+
};
|
|
45
|
+
type?: undefined;
|
|
46
|
+
options?: undefined;
|
|
47
|
+
})[] | {
|
|
48
|
+
loop: boolean;
|
|
49
|
+
startTime: number;
|
|
50
|
+
duration: number;
|
|
51
|
+
easing: string | undefined;
|
|
52
|
+
delayAfter: number;
|
|
53
|
+
channel: {
|
|
54
|
+
size: {
|
|
55
|
+
from: number;
|
|
56
|
+
to: (...args: any[]) => any;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
controlOptions: {
|
|
60
|
+
immediatelyApply: boolean;
|
|
61
|
+
};
|
|
62
|
+
}[];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* 散点图 循环动画
|
|
66
|
+
* 动画类型:
|
|
67
|
+
* 1. growth/scale: 点循环动画
|
|
68
|
+
* 效果:复用飞入或缩放动画形成循环。
|
|
69
|
+
* 编排逻辑:startTime = appear 存在 ? interval : 0, 有 loop 时 loopDuration = 1s, 执行后等待 interval + 1s。
|
|
70
|
+
* 2. atmosphere: 点氛围动画
|
|
71
|
+
* 效果:point 执行 breath/reveal/ripple 等氛围效果。
|
|
72
|
+
* 编排逻辑:有 loop 时持续 1s, 无 loop 时持续 2s, 一轮结束后等待 interval。
|
|
73
|
+
*/
|
|
74
|
+
export declare const scatterLoop: (config: ScatterLoopConfig | undefined, ignoreFirstNormal: boolean) => false | {
|
|
75
|
+
point: any[];
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* 散点图 更新动画
|
|
79
|
+
* 动画类型:
|
|
80
|
+
* 1. default: 默认更新动画
|
|
81
|
+
* 效果:point 使用 VChart 默认补间。
|
|
82
|
+
* 编排逻辑:只保留 update 的 easing 和 duration。
|
|
83
|
+
*/
|
|
84
|
+
export declare const scatterUpdate: (config: ScatterUpdateConfig | undefined) => false | {
|
|
85
|
+
point: {
|
|
86
|
+
duration: number;
|
|
87
|
+
easing: string | undefined;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* 散点图 离场动画
|
|
92
|
+
* 动画类型:
|
|
93
|
+
* 1. default: 默认离场动画
|
|
94
|
+
* 效果:point 使用 VChart 默认补间完成离场。
|
|
95
|
+
* 编排逻辑:共用 exit 的 easing 和 duration, 保持离场节奏和 update 阶段一致。
|
|
96
|
+
*/
|
|
97
|
+
export declare const scatterExit: (config: ScatterUpdateConfig | undefined) => false | {
|
|
98
|
+
point: {
|
|
99
|
+
duration: number;
|
|
100
|
+
easing: string | undefined;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { EFFECT_NONE, allowAnimation, atmospherePoint, getPrimaryEffect, toMs } from "./utils/index.js";
|
|
2
|
+
import { flyInScatter, scaleInScatter } from "./utils/scatter.js";
|
|
3
|
+
const scatterAppear = (config)=>{
|
|
4
|
+
if (!allowAnimation(config)) return false;
|
|
5
|
+
const effect = getPrimaryEffect(config);
|
|
6
|
+
const duration = toMs(config?.duration);
|
|
7
|
+
const result = 'growth' === effect ? flyInScatter(duration, config?.ease) : 'scale' === effect ? scaleInScatter(duration, config?.ease) : [];
|
|
8
|
+
return {
|
|
9
|
+
point: result
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
const scatterLoop = (config, ignoreFirstNormal)=>{
|
|
13
|
+
if (!config?.enable) return false;
|
|
14
|
+
const interval = config.interval ?? 0;
|
|
15
|
+
const startTime = ignoreFirstNormal ? toMs(interval) : 0;
|
|
16
|
+
const effect = getPrimaryEffect(config.loop);
|
|
17
|
+
const loopDuration = effect === EFFECT_NONE ? 0 : 1000;
|
|
18
|
+
const atmosphereDuration = effect === EFFECT_NONE ? 2000 : 1000;
|
|
19
|
+
const result = [];
|
|
20
|
+
if ('growth' === effect) result.push(...flyInScatter(loopDuration, config.loop?.ease, true, startTime, toMs(interval + 1)));
|
|
21
|
+
else if ('scale' === effect) result.push(...scaleInScatter(loopDuration, config.loop?.ease, true, startTime, toMs(interval + 1)));
|
|
22
|
+
if ((config.atmosphere?.effect ?? EFFECT_NONE) !== EFFECT_NONE) result.push({
|
|
23
|
+
loop: true,
|
|
24
|
+
startTime,
|
|
25
|
+
delayAfter: toMs(interval),
|
|
26
|
+
duration: atmosphereDuration,
|
|
27
|
+
easing: config.atmosphere?.ease,
|
|
28
|
+
...atmospherePoint(config.atmosphere?.effect),
|
|
29
|
+
controlOptions: {
|
|
30
|
+
immediatelyApply: false
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
point: result
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const scatterUpdate = (config)=>{
|
|
38
|
+
if (!allowAnimation(config)) return false;
|
|
39
|
+
return {
|
|
40
|
+
point: {
|
|
41
|
+
duration: toMs(config?.duration),
|
|
42
|
+
easing: config?.ease
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const scatterExit = (config)=>{
|
|
47
|
+
if (!allowAnimation(config)) return false;
|
|
48
|
+
return {
|
|
49
|
+
point: {
|
|
50
|
+
duration: toMs(config?.duration),
|
|
51
|
+
easing: config?.ease
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export { scatterAppear, scatterExit, scatterLoop, scatterUpdate };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=scatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/animation/scatter.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/animation/scatter.ts"],"sourcesContent":["import type { ScatterAppearConfig, ScatterLoopConfig, ScatterUpdateConfig } from './types'\nimport { allowAnimation, EFFECT_NONE, getPrimaryEffect, toMs, atmospherePoint } from './utils'\nimport { flyInScatter, scaleInScatter } from './utils/scatter'\n\n/**\n * 散点图 入场动画\n * 动画类型:\n * 1. growth: 飞入动画\n * 效果:点从上方移入, 同时恢复透明度和尺寸。\n * 编排逻辑:只作用于 point mark, 使用 appear 的 easing 和 duration。\n * 2. scale: 缩放动画\n * 效果:点中心保持不变, size 从 0 过渡到最终尺寸。\n * 编排逻辑:只作用于 point mark, 使用 appear 的 easing 和 duration。\n */\nexport const scatterAppear = (config: ScatterAppearConfig | undefined) => {\n if (!allowAnimation(config)) {\n return false\n }\n const effect = getPrimaryEffect(config)\n const duration = toMs(config?.duration)\n const result =\n effect === 'growth'\n ? flyInScatter(duration, config?.ease)\n : effect === 'scale'\n ? scaleInScatter(duration, config?.ease)\n : []\n return { point: result }\n}\n\n/**\n * 散点图 循环动画\n * 动画类型:\n * 1. growth/scale: 点循环动画\n * 效果:复用飞入或缩放动画形成循环。\n * 编排逻辑:startTime = appear 存在 ? interval : 0, 有 loop 时 loopDuration = 1s, 执行后等待 interval + 1s。\n * 2. atmosphere: 点氛围动画\n * 效果:point 执行 breath/reveal/ripple 等氛围效果。\n * 编排逻辑:有 loop 时持续 1s, 无 loop 时持续 2s, 一轮结束后等待 interval。\n */\nexport const scatterLoop = (config: ScatterLoopConfig | undefined, ignoreFirstNormal: boolean) => {\n if (!config?.enable) {\n return false\n }\n const interval = config.interval ?? 0\n const startTime = ignoreFirstNormal ? toMs(interval) : 0\n const effect = getPrimaryEffect(config.loop)\n const loopDuration = effect === EFFECT_NONE ? 0 : 1000\n const atmosphereDuration = effect === EFFECT_NONE ? 2000 : 1000\n const result: any[] = []\n\n if (effect === 'growth') {\n result.push(...flyInScatter(loopDuration, config.loop?.ease, true, startTime, toMs(interval + 1)))\n } else if (effect === 'scale') {\n result.push(...scaleInScatter(loopDuration, config.loop?.ease, true, startTime, toMs(interval + 1)))\n }\n\n if ((config.atmosphere?.effect ?? EFFECT_NONE) !== EFFECT_NONE) {\n result.push({\n loop: true,\n startTime,\n delayAfter: toMs(interval),\n duration: atmosphereDuration,\n easing: config.atmosphere?.ease,\n ...atmospherePoint(config.atmosphere?.effect),\n controlOptions: { immediatelyApply: false },\n })\n }\n\n return { point: result }\n}\n\n/**\n * 散点图 更新动画\n * 动画类型:\n * 1. default: 默认更新动画\n * 效果:point 使用 VChart 默认补间。\n * 编排逻辑:只保留 update 的 easing 和 duration。\n */\nexport const scatterUpdate = (config: ScatterUpdateConfig | undefined) => {\n if (!allowAnimation(config)) {\n return false\n }\n return { point: { duration: toMs(config?.duration), easing: config?.ease } }\n}\n\n/**\n * 散点图 离场动画\n * 动画类型:\n * 1. default: 默认离场动画\n * 效果:point 使用 VChart 默认补间完成离场。\n * 编排逻辑:共用 exit 的 easing 和 duration, 保持离场节奏和 update 阶段一致。\n */\nexport const scatterExit = (config: ScatterUpdateConfig | undefined) => {\n if (!allowAnimation(config)) {\n return false\n }\n return { point: { duration: toMs(config?.duration), easing: config?.ease } }\n}\n"],"names":["scatterAppear","config","allowAnimation","effect","getPrimaryEffect","duration","toMs","result","flyInScatter","scaleInScatter","scatterLoop","ignoreFirstNormal","interval","startTime","loopDuration","EFFECT_NONE","atmosphereDuration","atmospherePoint","scatterUpdate","scatterExit"],"mappings":";;AAcO,MAAMA,gBAAgB,CAACC;IAC5B,IAAI,CAACC,eAAeD,SAClB,OAAO;IAET,MAAME,SAASC,iBAAiBH;IAChC,MAAMI,WAAWC,KAAKL,QAAQ;IAC9B,MAAMM,SACJJ,AAAW,aAAXA,SACIK,aAAaH,UAAUJ,QAAQ,QAC/BE,AAAW,YAAXA,SACEM,eAAeJ,UAAUJ,QAAQ,QACjC,EAAE;IACV,OAAO;QAAE,OAAOM;IAAO;AACzB;AAYO,MAAMG,cAAc,CAACT,QAAuCU;IACjE,IAAI,CAACV,QAAQ,QACX,OAAO;IAET,MAAMW,WAAWX,OAAO,QAAQ,IAAI;IACpC,MAAMY,YAAYF,oBAAoBL,KAAKM,YAAY;IACvD,MAAMT,SAASC,iBAAiBH,OAAO,IAAI;IAC3C,MAAMa,eAAeX,WAAWY,cAAc,IAAI;IAClD,MAAMC,qBAAqBb,WAAWY,cAAc,OAAO;IAC3D,MAAMR,SAAgB,EAAE;IAExB,IAAIJ,AAAW,aAAXA,QACFI,OAAO,IAAI,IAAIC,aAAaM,cAAcb,OAAO,IAAI,EAAE,MAAM,MAAMY,WAAWP,KAAKM,WAAW;SACzF,IAAIT,AAAW,YAAXA,QACTI,OAAO,IAAI,IAAIE,eAAeK,cAAcb,OAAO,IAAI,EAAE,MAAM,MAAMY,WAAWP,KAAKM,WAAW;IAGlG,IAAKX,AAAAA,CAAAA,OAAO,UAAU,EAAE,UAAUc,WAAU,MAAOA,aACjDR,OAAO,IAAI,CAAC;QACV,MAAM;QACNM;QACA,YAAYP,KAAKM;QACjB,UAAUI;QACV,QAAQf,OAAO,UAAU,EAAE;QAC3B,GAAGgB,gBAAgBhB,OAAO,UAAU,EAAE,OAAO;QAC7C,gBAAgB;YAAE,kBAAkB;QAAM;IAC5C;IAGF,OAAO;QAAE,OAAOM;IAAO;AACzB;AASO,MAAMW,gBAAgB,CAACjB;IAC5B,IAAI,CAACC,eAAeD,SAClB,OAAO;IAET,OAAO;QAAE,OAAO;YAAE,UAAUK,KAAKL,QAAQ;YAAW,QAAQA,QAAQ;QAAK;IAAE;AAC7E;AASO,MAAMkB,cAAc,CAAClB;IAC1B,IAAI,CAACC,eAAeD,SAClB,OAAO;IAET,OAAO;QAAE,OAAO;YAAE,UAAUK,KAAKL,QAAQ;YAAW,QAAQA,QAAQ;QAAK;IAAE;AAC7E"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export declare const VScreenAnimationType: {
|
|
2
|
+
readonly growth: "growth";
|
|
3
|
+
readonly load: "load";
|
|
4
|
+
readonly moveIn: "moveIn";
|
|
5
|
+
readonly highLight: "highLight";
|
|
6
|
+
readonly none: "none";
|
|
7
|
+
readonly ripple: "ripple";
|
|
8
|
+
readonly breath: "breath";
|
|
9
|
+
readonly reveal: "reveal";
|
|
10
|
+
readonly scale: "scale";
|
|
11
|
+
readonly radial: "radial";
|
|
12
|
+
readonly enlarge: "enlarge";
|
|
13
|
+
readonly relocate: "relocate";
|
|
14
|
+
readonly wave: "wave";
|
|
15
|
+
readonly waveGrowth: "waveGrowth";
|
|
16
|
+
};
|
|
17
|
+
export type AnimationEffect = (typeof VScreenAnimationType)[keyof typeof VScreenAnimationType];
|
|
18
|
+
export type EffectConfig<E extends AnimationEffect> = {
|
|
19
|
+
enable?: boolean;
|
|
20
|
+
effects?: E[];
|
|
21
|
+
ease?: string;
|
|
22
|
+
duration?: number;
|
|
23
|
+
color?: string;
|
|
24
|
+
};
|
|
25
|
+
export type AnimationEffectConfig = EffectConfig<AnimationEffect>;
|
|
26
|
+
export type AtmosphereConfig<E extends AnimationEffect = never> = {
|
|
27
|
+
effect?: E;
|
|
28
|
+
ease?: string;
|
|
29
|
+
color?: string;
|
|
30
|
+
};
|
|
31
|
+
export type LoopConfig<LE extends AnimationEffect, AE extends AnimationEffect = never> = {
|
|
32
|
+
enable?: boolean;
|
|
33
|
+
interval?: number;
|
|
34
|
+
loop?: EffectConfig<LE>;
|
|
35
|
+
atmosphere?: AtmosphereConfig<AE>;
|
|
36
|
+
};
|
|
37
|
+
export type AnimationLoopConfig = LoopConfig<AnimationEffect, AnimationEffect>;
|
|
38
|
+
type AnimationParams<A, U, L> = {
|
|
39
|
+
appear?: A;
|
|
40
|
+
update?: U;
|
|
41
|
+
loop?: L;
|
|
42
|
+
};
|
|
43
|
+
export type BarLikeAppearConfig = EffectConfig<'growth'>;
|
|
44
|
+
export type BarLikeUpdateConfig = EffectConfig<'growth' | 'moveIn'>;
|
|
45
|
+
export type BarLikeLoopConfig = LoopConfig<'highLight' | 'growth' | 'moveIn' | 'none', 'ripple' | 'reveal' | 'breath'>;
|
|
46
|
+
export type LineAreaAppearConfig = EffectConfig<'load' | 'growth'>;
|
|
47
|
+
export type LineAreaUpdateConfig = EffectConfig<'growth'>;
|
|
48
|
+
export type LineAreaLoopConfig = LoopConfig<'load' | 'growth' | 'none', 'ripple' | 'reveal' | 'breath'>;
|
|
49
|
+
export type ScatterAppearConfig = EffectConfig<'growth' | 'scale'>;
|
|
50
|
+
export type ScatterUpdateConfig = EffectConfig<'growth'>;
|
|
51
|
+
export type ScatterLoopConfig = LoopConfig<'growth' | 'scale' | 'none', 'ripple' | 'reveal' | 'breath'>;
|
|
52
|
+
export type PieLikeAppearConfig = EffectConfig<'radial' | 'scale'>;
|
|
53
|
+
export type PieLikeUpdateConfig = EffectConfig<'radial'>;
|
|
54
|
+
export type PieLikeLoopConfig = LoopConfig<'enlarge' | 'relocate'>;
|
|
55
|
+
export type RadarAppearConfig = EffectConfig<'radial' | 'scale'>;
|
|
56
|
+
export type RadarUpdateConfig = EffectConfig<'growth'>;
|
|
57
|
+
export type RadarLoopConfig = {
|
|
58
|
+
enable?: boolean;
|
|
59
|
+
interval?: number;
|
|
60
|
+
atmosphere?: AtmosphereConfig<'ripple' | 'reveal' | 'breath'>;
|
|
61
|
+
};
|
|
62
|
+
export type BarLikeAnimation = {
|
|
63
|
+
enable?: boolean;
|
|
64
|
+
params?: AnimationParams<BarLikeAppearConfig, BarLikeUpdateConfig, BarLikeLoopConfig>;
|
|
65
|
+
};
|
|
66
|
+
export type LineAreaAnimation = {
|
|
67
|
+
enable?: boolean;
|
|
68
|
+
params?: AnimationParams<LineAreaAppearConfig, LineAreaUpdateConfig, LineAreaLoopConfig>;
|
|
69
|
+
};
|
|
70
|
+
export type ScatterAnimation = {
|
|
71
|
+
enable?: boolean;
|
|
72
|
+
params?: AnimationParams<ScatterAppearConfig, ScatterUpdateConfig, ScatterLoopConfig>;
|
|
73
|
+
};
|
|
74
|
+
export type PieLikeAnimation = {
|
|
75
|
+
enable?: boolean;
|
|
76
|
+
params?: AnimationParams<PieLikeAppearConfig, PieLikeUpdateConfig, PieLikeLoopConfig>;
|
|
77
|
+
};
|
|
78
|
+
export type RadarAnimation = {
|
|
79
|
+
enable?: boolean;
|
|
80
|
+
params?: AnimationParams<RadarAppearConfig, RadarUpdateConfig, RadarLoopConfig>;
|
|
81
|
+
};
|
|
82
|
+
export type BarLikeChartType = 'bar' | 'barPercent' | 'barParallel' | 'column' | 'columnPercent' | 'columnParallel';
|
|
83
|
+
export type LineAreaChartType = 'line' | 'area' | 'areaPercent';
|
|
84
|
+
export type PieLikeChartType = 'pie' | 'donut' | 'rose' | 'roseParallel';
|
|
85
|
+
export type SupportedAnimationChartType = BarLikeChartType | LineAreaChartType | PieLikeChartType | 'scatter' | 'radar';
|
|
86
|
+
export type ChartAnimationByChartType<T extends SupportedAnimationChartType> = T extends BarLikeChartType ? BarLikeAnimation : T extends LineAreaChartType ? LineAreaAnimation : T extends PieLikeChartType ? PieLikeAnimation : T extends 'scatter' ? ScatterAnimation : RadarAnimation;
|
|
87
|
+
export type ChartAnimation = BarLikeAnimation | LineAreaAnimation | ScatterAnimation | PieLikeAnimation | RadarAnimation;
|
|
88
|
+
export type ChartAppearConfigByChartType<T extends SupportedAnimationChartType> = NonNullable<NonNullable<ChartAnimationByChartType<T>['params']>['appear']>;
|
|
89
|
+
export type ChartUpdateConfigByChartType<T extends SupportedAnimationChartType> = NonNullable<NonNullable<ChartAnimationByChartType<T>['params']>['update']>;
|
|
90
|
+
export type ChartLoopConfigByChartType<T extends SupportedAnimationChartType> = NonNullable<NonNullable<ChartAnimationByChartType<T>['params']>['loop']>;
|
|
91
|
+
export type BarAppearConfig = ChartAppearConfigByChartType<'bar'>;
|
|
92
|
+
export type BarUpdateConfig = ChartUpdateConfigByChartType<'bar'>;
|
|
93
|
+
export type BarLoopConfig = ChartLoopConfigByChartType<'bar'>;
|
|
94
|
+
export type BarPercentAppearConfig = ChartAppearConfigByChartType<'barPercent'>;
|
|
95
|
+
export type BarPercentUpdateConfig = ChartUpdateConfigByChartType<'barPercent'>;
|
|
96
|
+
export type BarPercentLoopConfig = ChartLoopConfigByChartType<'barPercent'>;
|
|
97
|
+
export type BarParallelAppearConfig = ChartAppearConfigByChartType<'barParallel'>;
|
|
98
|
+
export type BarParallelUpdateConfig = ChartUpdateConfigByChartType<'barParallel'>;
|
|
99
|
+
export type BarParallelLoopConfig = ChartLoopConfigByChartType<'barParallel'>;
|
|
100
|
+
export type ColumnAppearConfig = ChartAppearConfigByChartType<'column'>;
|
|
101
|
+
export type ColumnUpdateConfig = ChartUpdateConfigByChartType<'column'>;
|
|
102
|
+
export type ColumnLoopConfig = ChartLoopConfigByChartType<'column'>;
|
|
103
|
+
export type ColumnPercentAppearConfig = ChartAppearConfigByChartType<'columnPercent'>;
|
|
104
|
+
export type ColumnPercentUpdateConfig = ChartUpdateConfigByChartType<'columnPercent'>;
|
|
105
|
+
export type ColumnPercentLoopConfig = ChartLoopConfigByChartType<'columnPercent'>;
|
|
106
|
+
export type ColumnParallelAppearConfig = ChartAppearConfigByChartType<'columnParallel'>;
|
|
107
|
+
export type ColumnParallelUpdateConfig = ChartUpdateConfigByChartType<'columnParallel'>;
|
|
108
|
+
export type ColumnParallelLoopConfig = ChartLoopConfigByChartType<'columnParallel'>;
|
|
109
|
+
export type LineAppearConfig = ChartAppearConfigByChartType<'line'>;
|
|
110
|
+
export type LineUpdateConfig = ChartUpdateConfigByChartType<'line'>;
|
|
111
|
+
export type LineLoopConfig = ChartLoopConfigByChartType<'line'>;
|
|
112
|
+
export type AreaAppearConfig = ChartAppearConfigByChartType<'area'>;
|
|
113
|
+
export type AreaUpdateConfig = ChartUpdateConfigByChartType<'area'>;
|
|
114
|
+
export type AreaLoopConfig = ChartLoopConfigByChartType<'area'>;
|
|
115
|
+
export type AreaPercentAppearConfig = ChartAppearConfigByChartType<'areaPercent'>;
|
|
116
|
+
export type AreaPercentUpdateConfig = ChartUpdateConfigByChartType<'areaPercent'>;
|
|
117
|
+
export type AreaPercentLoopConfig = ChartLoopConfigByChartType<'areaPercent'>;
|
|
118
|
+
export type PieAppearConfig = ChartAppearConfigByChartType<'pie'>;
|
|
119
|
+
export type PieUpdateConfig = ChartUpdateConfigByChartType<'pie'>;
|
|
120
|
+
export type PieLoopConfig = ChartLoopConfigByChartType<'pie'>;
|
|
121
|
+
export type DonutAppearConfig = ChartAppearConfigByChartType<'donut'>;
|
|
122
|
+
export type DonutUpdateConfig = ChartUpdateConfigByChartType<'donut'>;
|
|
123
|
+
export type DonutLoopConfig = ChartLoopConfigByChartType<'donut'>;
|
|
124
|
+
export type RoseAppearConfig = ChartAppearConfigByChartType<'rose'>;
|
|
125
|
+
export type RoseUpdateConfig = ChartUpdateConfigByChartType<'rose'>;
|
|
126
|
+
export type RoseLoopConfig = ChartLoopConfigByChartType<'rose'>;
|
|
127
|
+
export type RoseParallelAppearConfig = ChartAppearConfigByChartType<'roseParallel'>;
|
|
128
|
+
export type RoseParallelUpdateConfig = ChartUpdateConfigByChartType<'roseParallel'>;
|
|
129
|
+
export type RoseParallelLoopConfig = ChartLoopConfigByChartType<'roseParallel'>;
|
|
130
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const VScreenAnimationType = {
|
|
2
|
+
growth: 'growth',
|
|
3
|
+
load: 'load',
|
|
4
|
+
moveIn: 'moveIn',
|
|
5
|
+
highLight: 'highLight',
|
|
6
|
+
none: 'none',
|
|
7
|
+
ripple: 'ripple',
|
|
8
|
+
breath: 'breath',
|
|
9
|
+
reveal: 'reveal',
|
|
10
|
+
scale: 'scale',
|
|
11
|
+
radial: 'radial',
|
|
12
|
+
enlarge: 'enlarge',
|
|
13
|
+
relocate: 'relocate',
|
|
14
|
+
wave: 'wave',
|
|
15
|
+
waveGrowth: 'waveGrowth'
|
|
16
|
+
};
|
|
17
|
+
export { VScreenAnimationType };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/animation/types.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/animation/types.ts"],"sourcesContent":["export const VScreenAnimationType = {\n growth: 'growth', // 生长\n load: 'load', // 加载\n moveIn: 'moveIn', // 移入\n highLight: 'highLight', // 分组高亮\n none: 'none', // 无动画\n ripple: 'ripple', // 涟漪\n breath: 'breath', // 呼吸\n reveal: 'reveal', // 显隐\n scale: 'scale', // 缩放\n radial: 'radial', // 径向\n enlarge: 'enlarge', // 改变尺寸\n relocate: 'relocate', // 改变中心\n wave: 'wave', // 波浪\n waveGrowth: 'waveGrowth', // 波浪生长\n} as const\n\nexport type AnimationEffect = (typeof VScreenAnimationType)[keyof typeof VScreenAnimationType]\n\nexport type EffectConfig<E extends AnimationEffect> = {\n enable?: boolean\n effects?: E[]\n ease?: string\n duration?: number\n color?: string\n}\n\nexport type AnimationEffectConfig = EffectConfig<AnimationEffect>\nexport type AtmosphereConfig<E extends AnimationEffect = never> = { effect?: E; ease?: string; color?: string }\nexport type LoopConfig<LE extends AnimationEffect, AE extends AnimationEffect = never> = {\n enable?: boolean\n interval?: number\n loop?: EffectConfig<LE>\n atmosphere?: AtmosphereConfig<AE>\n}\nexport type AnimationLoopConfig = LoopConfig<AnimationEffect, AnimationEffect>\n\ntype AnimationParams<A, U, L> = {\n appear?: A\n update?: U\n loop?: L\n}\n\nexport type BarLikeAppearConfig = EffectConfig<'growth'>\nexport type BarLikeUpdateConfig = EffectConfig<'growth' | 'moveIn'>\nexport type BarLikeLoopConfig = LoopConfig<'highLight' | 'growth' | 'moveIn' | 'none', 'ripple' | 'reveal' | 'breath'>\n\nexport type LineAreaAppearConfig = EffectConfig<'load' | 'growth'>\nexport type LineAreaUpdateConfig = EffectConfig<'growth'>\nexport type LineAreaLoopConfig = LoopConfig<'load' | 'growth' | 'none', 'ripple' | 'reveal' | 'breath'>\n\nexport type ScatterAppearConfig = EffectConfig<'growth' | 'scale'>\nexport type ScatterUpdateConfig = EffectConfig<'growth'>\nexport type ScatterLoopConfig = LoopConfig<'growth' | 'scale' | 'none', 'ripple' | 'reveal' | 'breath'>\n\nexport type PieLikeAppearConfig = EffectConfig<'radial' | 'scale'>\nexport type PieLikeUpdateConfig = EffectConfig<'radial'>\nexport type PieLikeLoopConfig = LoopConfig<'enlarge' | 'relocate'>\n\nexport type RadarAppearConfig = EffectConfig<'radial' | 'scale'>\nexport type RadarUpdateConfig = EffectConfig<'growth'>\nexport type RadarLoopConfig = {\n enable?: boolean\n interval?: number\n atmosphere?: AtmosphereConfig<'ripple' | 'reveal' | 'breath'>\n}\n\n// 堆叠/百分比/并列条、柱图\nexport type BarLikeAnimation = {\n enable?: boolean\n params?: AnimationParams<BarLikeAppearConfig, BarLikeUpdateConfig, BarLikeLoopConfig>\n}\n\n// 折线、面积、百分比面积\nexport type LineAreaAnimation = {\n enable?: boolean\n params?: AnimationParams<LineAreaAppearConfig, LineAreaUpdateConfig, LineAreaLoopConfig>\n}\n\n// 散点\nexport type ScatterAnimation = {\n enable?: boolean\n params?: AnimationParams<ScatterAppearConfig, ScatterUpdateConfig, ScatterLoopConfig>\n}\n\n// 饼、环、玫瑰\nexport type PieLikeAnimation = {\n enable?: boolean\n params?: AnimationParams<PieLikeAppearConfig, PieLikeUpdateConfig, PieLikeLoopConfig>\n}\n\n// 雷达\nexport type RadarAnimation = {\n enable?: boolean\n params?: AnimationParams<RadarAppearConfig, RadarUpdateConfig, RadarLoopConfig>\n}\n\nexport type BarLikeChartType = 'bar' | 'barPercent' | 'barParallel' | 'column' | 'columnPercent' | 'columnParallel'\nexport type LineAreaChartType = 'line' | 'area' | 'areaPercent'\nexport type PieLikeChartType = 'pie' | 'donut' | 'rose' | 'roseParallel'\nexport type SupportedAnimationChartType = BarLikeChartType | LineAreaChartType | PieLikeChartType | 'scatter' | 'radar'\n\nexport type ChartAnimationByChartType<T extends SupportedAnimationChartType> = T extends BarLikeChartType\n ? BarLikeAnimation\n : T extends LineAreaChartType\n ? LineAreaAnimation\n : T extends PieLikeChartType\n ? PieLikeAnimation\n : T extends 'scatter'\n ? ScatterAnimation\n : RadarAnimation\n\nexport type ChartAnimation = BarLikeAnimation | LineAreaAnimation | ScatterAnimation | PieLikeAnimation | RadarAnimation\n\nexport type ChartAppearConfigByChartType<T extends SupportedAnimationChartType> = NonNullable<\n NonNullable<ChartAnimationByChartType<T>['params']>['appear']\n>\nexport type ChartUpdateConfigByChartType<T extends SupportedAnimationChartType> = NonNullable<\n NonNullable<ChartAnimationByChartType<T>['params']>['update']\n>\nexport type ChartLoopConfigByChartType<T extends SupportedAnimationChartType> = NonNullable<\n NonNullable<ChartAnimationByChartType<T>['params']>['loop']\n>\n\nexport type BarAppearConfig = ChartAppearConfigByChartType<'bar'>\nexport type BarUpdateConfig = ChartUpdateConfigByChartType<'bar'>\nexport type BarLoopConfig = ChartLoopConfigByChartType<'bar'>\nexport type BarPercentAppearConfig = ChartAppearConfigByChartType<'barPercent'>\nexport type BarPercentUpdateConfig = ChartUpdateConfigByChartType<'barPercent'>\nexport type BarPercentLoopConfig = ChartLoopConfigByChartType<'barPercent'>\nexport type BarParallelAppearConfig = ChartAppearConfigByChartType<'barParallel'>\nexport type BarParallelUpdateConfig = ChartUpdateConfigByChartType<'barParallel'>\nexport type BarParallelLoopConfig = ChartLoopConfigByChartType<'barParallel'>\nexport type ColumnAppearConfig = ChartAppearConfigByChartType<'column'>\nexport type ColumnUpdateConfig = ChartUpdateConfigByChartType<'column'>\nexport type ColumnLoopConfig = ChartLoopConfigByChartType<'column'>\nexport type ColumnPercentAppearConfig = ChartAppearConfigByChartType<'columnPercent'>\nexport type ColumnPercentUpdateConfig = ChartUpdateConfigByChartType<'columnPercent'>\nexport type ColumnPercentLoopConfig = ChartLoopConfigByChartType<'columnPercent'>\nexport type ColumnParallelAppearConfig = ChartAppearConfigByChartType<'columnParallel'>\nexport type ColumnParallelUpdateConfig = ChartUpdateConfigByChartType<'columnParallel'>\nexport type ColumnParallelLoopConfig = ChartLoopConfigByChartType<'columnParallel'>\nexport type LineAppearConfig = ChartAppearConfigByChartType<'line'>\nexport type LineUpdateConfig = ChartUpdateConfigByChartType<'line'>\nexport type LineLoopConfig = ChartLoopConfigByChartType<'line'>\nexport type AreaAppearConfig = ChartAppearConfigByChartType<'area'>\nexport type AreaUpdateConfig = ChartUpdateConfigByChartType<'area'>\nexport type AreaLoopConfig = ChartLoopConfigByChartType<'area'>\nexport type AreaPercentAppearConfig = ChartAppearConfigByChartType<'areaPercent'>\nexport type AreaPercentUpdateConfig = ChartUpdateConfigByChartType<'areaPercent'>\nexport type AreaPercentLoopConfig = ChartLoopConfigByChartType<'areaPercent'>\nexport type PieAppearConfig = ChartAppearConfigByChartType<'pie'>\nexport type PieUpdateConfig = ChartUpdateConfigByChartType<'pie'>\nexport type PieLoopConfig = ChartLoopConfigByChartType<'pie'>\nexport type DonutAppearConfig = ChartAppearConfigByChartType<'donut'>\nexport type DonutUpdateConfig = ChartUpdateConfigByChartType<'donut'>\nexport type DonutLoopConfig = ChartLoopConfigByChartType<'donut'>\nexport type RoseAppearConfig = ChartAppearConfigByChartType<'rose'>\nexport type RoseUpdateConfig = ChartUpdateConfigByChartType<'rose'>\nexport type RoseLoopConfig = ChartLoopConfigByChartType<'rose'>\nexport type RoseParallelAppearConfig = ChartAppearConfigByChartType<'roseParallel'>\nexport type RoseParallelUpdateConfig = ChartUpdateConfigByChartType<'roseParallel'>\nexport type RoseParallelLoopConfig = ChartLoopConfigByChartType<'roseParallel'>\n"],"names":["VScreenAnimationType"],"mappings":"AAAO,MAAMA,uBAAuB;IAClC,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,WAAW;IACX,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,SAAS;IACT,UAAU;IACV,MAAM;IACN,YAAY;AACd"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { atmosphereColorToFill, atmosphereColorToStroke, transform2VChartColor } from './barColor';
|
|
2
|
+
export { getGroupCountFromSpec, groupHighLightBar } from './barGroup';
|
|
3
|
+
export { fadeInBar, growBar, isHorizontalBar, moveInBar, moveOutBar } from './barMotion';
|
|
4
|
+
/**
|
|
5
|
+
* @description 根据循环动画效果类型生成柱图 normal 阶段动画配置。
|
|
6
|
+
* @param effect 循环动画效果类型。
|
|
7
|
+
* @param chartType 图表类型。
|
|
8
|
+
* @param spec 当前 VChart spec。
|
|
9
|
+
* @returns 柱图 normal 阶段动画配置。
|
|
10
|
+
*/
|
|
11
|
+
export declare const getLoopResult: (effect: string, chartType: string, spec: any) => {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VScreenAnimationType } from "../types.js";
|
|
2
|
+
import { fadeInBar, growBar, isHorizontalBar, moveInBar, moveOutBar } from "./barMotion.js";
|
|
3
|
+
const getLoopResult = (effect, chartType, spec)=>{
|
|
4
|
+
if (effect === VScreenAnimationType.growth) return growBar(chartType);
|
|
5
|
+
if (effect === VScreenAnimationType.moveIn) return moveInBar(chartType, spec);
|
|
6
|
+
if (effect === VScreenAnimationType.load) return fadeInBar();
|
|
7
|
+
return {};
|
|
8
|
+
};
|
|
9
|
+
export { atmosphereColorToFill, atmosphereColorToStroke, transform2VChartColor } from "./barColor.js";
|
|
10
|
+
export { getGroupCountFromSpec, groupHighLightBar } from "./barGroup.js";
|
|
11
|
+
export { fadeInBar, getLoopResult, growBar, isHorizontalBar, moveInBar, moveOutBar };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/animation/utils/bar.js","sources":["../../../../../../../../src/pipeline/spec/chart/pipes/animation/utils/bar.ts"],"sourcesContent":["import { VScreenAnimationType } from '../types'\nimport { fadeInBar, growBar, moveInBar } from './barMotion'\n\nexport { atmosphereColorToFill, atmosphereColorToStroke, transform2VChartColor } from './barColor'\nexport { getGroupCountFromSpec, groupHighLightBar } from './barGroup'\nexport { fadeInBar, growBar, isHorizontalBar, moveInBar, moveOutBar } from './barMotion'\n\n/**\n * @description 根据循环动画效果类型生成柱图 normal 阶段动画配置。\n * @param effect 循环动画效果类型。\n * @param chartType 图表类型。\n * @param spec 当前 VChart spec。\n * @returns 柱图 normal 阶段动画配置。\n */\nexport const getLoopResult = (effect: string, chartType: string, spec: any) => {\n if (effect === VScreenAnimationType.growth) return growBar(chartType)\n if (effect === VScreenAnimationType.moveIn) return moveInBar(chartType, spec)\n if (effect === VScreenAnimationType.load) return fadeInBar()\n return {}\n}\n"],"names":["getLoopResult","effect","chartType","spec","VScreenAnimationType","growBar","moveInBar","fadeInBar"],"mappings":";;AAcO,MAAMA,gBAAgB,CAACC,QAAgBC,WAAmBC;IAC/D,IAAIF,WAAWG,qBAAqB,MAAM,EAAE,OAAOC,QAAQH;IAC3D,IAAID,WAAWG,qBAAqB,MAAM,EAAE,OAAOE,UAAUJ,WAAWC;IACxE,IAAIF,WAAWG,qBAAqB,IAAI,EAAE,OAAOG;IACjD,OAAO,CAAC;AACV"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 将普通色值或 DSL 渐变色统一转换为 VChart 可消费的颜色配置。
|
|
3
|
+
* @param colorStr 普通色值或 DSL 渐变色。
|
|
4
|
+
* @returns VChart 可消费的颜色配置。
|
|
5
|
+
*/
|
|
6
|
+
export declare const transform2VChartColor: (colorStr?: string) => string | {
|
|
7
|
+
gradient: string;
|
|
8
|
+
x0: number;
|
|
9
|
+
x1: number;
|
|
10
|
+
y1: number;
|
|
11
|
+
y0: number;
|
|
12
|
+
stops: {
|
|
13
|
+
offset: number;
|
|
14
|
+
color: string;
|
|
15
|
+
}[];
|
|
16
|
+
} | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* @description 生成柱图氛围高亮的填充色;渐变柱图会补齐透明度渐变。
|
|
19
|
+
* @param color 高亮色。
|
|
20
|
+
* @param isGradientChart 当前图表是否使用渐变填充。
|
|
21
|
+
* @param isHorizontal 是否为横向柱图。
|
|
22
|
+
* @returns 柱图氛围高亮填充色。
|
|
23
|
+
*/
|
|
24
|
+
export declare const atmosphereColorToFill: (color: string, isGradientChart: boolean, isHorizontal: boolean) => string | {
|
|
25
|
+
gradient: string;
|
|
26
|
+
x0: number;
|
|
27
|
+
x1: number;
|
|
28
|
+
y1: number;
|
|
29
|
+
y0: number;
|
|
30
|
+
stops: {
|
|
31
|
+
offset: number;
|
|
32
|
+
color: string;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* @description 生成柱图氛围高亮的描边色;渐变柱图会补齐透明度渐变。
|
|
37
|
+
* @param color 高亮色。
|
|
38
|
+
* @param isGradientChart 当前图表是否使用渐变填充。
|
|
39
|
+
* @param isHorizontal 是否为横向柱图。
|
|
40
|
+
* @returns 柱图氛围高亮描边色。
|
|
41
|
+
*/
|
|
42
|
+
export declare const atmosphereColorToStroke: (color: string, isGradientChart: boolean, isHorizontal: boolean) => string | {
|
|
43
|
+
gradient: string;
|
|
44
|
+
x0: number;
|
|
45
|
+
x1: number;
|
|
46
|
+
y1: number;
|
|
47
|
+
y0: number;
|
|
48
|
+
stops: {
|
|
49
|
+
offset: number;
|
|
50
|
+
color: string;
|
|
51
|
+
}[];
|
|
52
|
+
};
|