@visactor/vstory 0.0.4-alpha.1 → 0.0.4
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/cjs/animate/typewirter.d.ts +3 -4
- package/cjs/animate/typewirter.js +44 -30
- package/cjs/animate/typewirter.js.map +1 -1
- package/cjs/constants/action.d.ts +9 -0
- package/cjs/constants/action.js +10 -2
- package/cjs/constants/action.js.map +1 -1
- package/cjs/constants/character.d.ts +0 -1
- package/cjs/constants/character.js +1 -2
- package/cjs/constants/character.js.map +1 -1
- package/cjs/dsl/constant/index.d.ts +13 -0
- package/cjs/dsl/constant/index.js +6 -1
- package/cjs/dsl/constant/index.js.map +1 -1
- package/cjs/dsl/story-chart/area.d.ts +2 -0
- package/cjs/dsl/story-chart/area.js +5 -1
- package/cjs/dsl/story-chart/area.js.map +1 -1
- package/cjs/dsl/story-chart/bar.d.ts +2 -0
- package/cjs/dsl/story-chart/bar.js +1 -1
- package/cjs/dsl/story-chart/bar.js.map +1 -1
- package/cjs/dsl/story-chart/chart.js +1 -2
- package/cjs/dsl/story-chart/line.d.ts +2 -0
- package/cjs/dsl/story-chart/line.js +1 -1
- package/cjs/dsl/story-chart/line.js.map +1 -1
- package/cjs/dsl/story-chart/pie.d.ts +2 -0
- package/cjs/dsl/story-chart/pie.js +3 -0
- package/cjs/dsl/story-chart/pie.js.map +1 -1
- package/cjs/dsl/story-processor/graphic/appear.js.map +1 -1
- package/cjs/dsl/story-processor/graphic/effect/appear.js +2 -7
- package/cjs/dsl/story-processor/graphic/effect/appear.js.map +1 -1
- package/cjs/dsl/story-processor/graphic/effect/typewriter.js +1 -1
- package/cjs/dsl/story-processor/graphic/effect/typewriter.js.map +1 -1
- package/cjs/dsl/story-processor/processor.js +1 -1
- package/cjs/dsl/types/Datum.js +2 -1
- package/cjs/dsl/types/index.js +1 -1
- package/cjs/dsl/utils/datum.js +1 -1
- package/cjs/dsl/utils/flicker.js +1 -1
- package/cjs/edit/edit-component/image-selection.js +1 -1
- package/cjs/edit/edit-component/index.js +1 -1
- package/cjs/edit/edit-component/layer-edit.js +0 -2
- package/cjs/edit/edit-component/rect-selection.js +1 -1
- package/cjs/edit/edit-component/richtext-selection.js +1 -1
- package/cjs/edit/edit-component/text-selection.js +1 -1
- package/cjs/index.d.ts +0 -1
- package/cjs/index.js +1 -2
- package/cjs/index.js.map +1 -1
- package/cjs/interface/type.js +1 -2
- package/cjs/player/interface/player.d.ts +5 -2
- package/cjs/player/interface/player.js.map +1 -1
- package/cjs/player/interface/scheduler.d.ts +1 -1
- package/cjs/player/interface/scheduler.js.map +1 -1
- package/cjs/player/player.d.ts +7 -2
- package/cjs/player/player.js +25 -19
- package/cjs/player/player.js.map +1 -1
- package/cjs/player/processor/chart/common/chartAppear.d.ts +5 -0
- package/cjs/player/processor/chart/common/chartAppear.js +11 -0
- package/cjs/player/processor/chart/common/chartAppear.js.map +1 -0
- package/cjs/player/processor/chart/common/commonAppear.d.ts +8 -0
- package/cjs/player/processor/chart/common/commonAppear.js +46 -0
- package/cjs/player/processor/chart/common/commonAppear.js.map +1 -0
- package/cjs/player/processor/chart/component/axisAppear.d.ts +2 -2
- package/cjs/player/processor/chart/component/axisAppear.js +2 -2
- package/cjs/player/processor/chart/component/axisAppear.js.map +1 -1
- package/cjs/player/processor/chart/component/commonAppear.d.ts +3 -3
- package/cjs/player/processor/chart/component/commonAppear.js +5 -17
- package/cjs/player/processor/chart/component/commonAppear.js.map +1 -1
- package/cjs/player/processor/chart/component/labelAppear.d.ts +2 -2
- package/cjs/player/processor/chart/component/labelAppear.js +1 -1
- package/cjs/player/processor/chart/component/labelAppear.js.map +1 -1
- package/cjs/player/processor/chart/component/legendsAppear.d.ts +4 -3
- package/cjs/player/processor/chart/component/legendsAppear.js +2 -3
- package/cjs/player/processor/chart/component/legendsAppear.js.map +1 -1
- package/cjs/player/processor/chart/component/titleAppear.d.ts +4 -3
- package/cjs/player/processor/chart/component/titleAppear.js +2 -3
- package/cjs/player/processor/chart/component/titleAppear.js.map +1 -1
- package/cjs/player/processor/chart/seriesmark/commonTransformMarkAppear.d.ts +3 -3
- package/cjs/player/processor/chart/seriesmark/commonTransformMarkAppear.js.map +1 -1
- package/cjs/player/processor/chart/seriesmark/{transformArcAppear.d.ts → transformArcVisibility.d.ts} +2 -2
- package/cjs/player/processor/chart/seriesmark/{transformArcAppear.js → transformArcVisibility.js} +5 -6
- package/cjs/player/processor/chart/seriesmark/transformArcVisibility.js.map +1 -0
- package/cjs/player/processor/chart/seriesmark/{transformRectAppear.d.ts → transformLineVisibility.d.ts} +2 -2
- package/cjs/player/processor/chart/seriesmark/transformLineVisibility.js +12 -0
- package/cjs/player/processor/chart/seriesmark/transformLineVisibility.js.map +1 -0
- package/cjs/player/processor/chart/seriesmark/{transformLineAppear.d.ts → transformRectVisibility.d.ts} +2 -2
- package/cjs/player/processor/chart/seriesmark/{transformRectAppear.js → transformRectVisibility.js} +6 -7
- package/cjs/player/processor/chart/seriesmark/transformRectVisibility.js.map +1 -0
- package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.d.ts +12 -0
- package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.js +12 -0
- package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.js.map +1 -0
- package/cjs/player/processor/chart/seriesmark/transformTextVisibility.d.ts +12 -0
- package/cjs/player/processor/chart/seriesmark/transformTextVisibility.js +12 -0
- package/cjs/player/processor/chart/seriesmark/transformTextVisibility.js.map +1 -0
- package/cjs/player/processor/chart/transformMap.d.ts +24 -18
- package/cjs/player/processor/chart/transformMap.js +8 -7
- package/cjs/player/processor/chart/transformMap.js.map +1 -1
- package/cjs/player/processor/chart/vchart.d.ts +62 -15
- package/cjs/player/processor/chart/vchart.js +98 -11
- package/cjs/player/processor/chart/vchart.js.map +1 -1
- package/cjs/player/processor/common/bounce-processor.d.ts +3 -0
- package/cjs/player/processor/common/bounce-processor.js +24 -0
- package/cjs/player/processor/common/bounce-processor.js.map +1 -0
- package/cjs/player/processor/common/common.d.ts +5 -0
- package/cjs/player/processor/common/common.js +20 -0
- package/cjs/player/processor/common/common.js.map +1 -0
- package/cjs/player/processor/common/fade-processor.d.ts +4 -0
- package/cjs/player/processor/common/fade-processor.js +36 -0
- package/cjs/player/processor/common/fade-processor.js.map +1 -0
- package/cjs/player/processor/common/move-processor.d.ts +8 -0
- package/cjs/player/processor/common/move-processor.js +155 -0
- package/cjs/player/processor/common/move-processor.js.map +1 -0
- package/cjs/player/processor/common/scale-processor.d.ts +8 -0
- package/cjs/player/processor/common/scale-processor.js +49 -0
- package/cjs/player/processor/common/scale-processor.js.map +1 -0
- package/cjs/player/processor/common/wipe-processor.d.ts +4 -0
- package/cjs/player/processor/common/wipe-processor.js +40 -0
- package/cjs/player/processor/common/wipe-processor.js.map +1 -0
- package/cjs/player/processor/common-processor.js +3 -0
- package/cjs/player/processor/common-processor.js.map +1 -0
- package/cjs/player/processor/component/common-component.d.ts +45 -9
- package/cjs/player/processor/component/common-component.js +98 -77
- package/cjs/player/processor/component/common-component.js.map +1 -1
- package/cjs/player/processor/component/image/image-visibility.d.ts +5 -0
- package/cjs/player/processor/component/image/image-visibility.js +16 -0
- package/cjs/player/processor/component/image/image-visibility.js.map +1 -0
- package/cjs/player/processor/component/line/line-visibility.d.ts +5 -0
- package/cjs/player/processor/component/line/line-visibility.js +16 -0
- package/cjs/player/processor/component/line/line-visibility.js.map +1 -0
- package/cjs/player/processor/component/rect/rect-visibility.d.ts +5 -0
- package/cjs/player/processor/component/rect/rect-visibility.js +16 -0
- package/cjs/player/processor/component/rect/rect-visibility.js.map +1 -0
- package/cjs/player/processor/component/shape/shape-visibility.d.ts +5 -0
- package/cjs/player/processor/component/shape/shape-visibility.js +16 -0
- package/cjs/player/processor/component/shape/shape-visibility.js.map +1 -0
- package/cjs/player/processor/component/text/text-visibility.d.ts +6 -0
- package/cjs/player/processor/component/text/text-visibility.js +41 -0
- package/cjs/player/processor/component/text/text-visibility.js.map +1 -0
- package/cjs/player/processor/component/timeline/timeline-visibility.d.ts +15 -0
- package/cjs/player/processor/component/timeline/timeline-visibility.js +79 -0
- package/cjs/player/processor/component/timeline/timeline-visibility.js.map +1 -0
- package/cjs/player/processor/component/utils.d.ts +3 -1
- package/cjs/player/processor/component/utils.js +16 -1
- package/cjs/player/processor/component/utils.js.map +1 -1
- package/cjs/player/processor/interface/action-processor.d.ts +6 -6
- package/cjs/player/processor/interface/action-processor.js.map +1 -1
- package/cjs/player/processor/interface/appear-action.d.ts +30 -18
- package/cjs/player/processor/interface/appear-action.js.map +1 -1
- package/cjs/player/processor/interface/common-action.d.ts +14 -0
- package/cjs/player/processor/interface/common-action.js +6 -0
- package/cjs/player/processor/interface/common-action.js.map +1 -0
- package/cjs/player/processor/interface/style-action.d.ts +34 -0
- package/cjs/player/processor/interface/style-action.js +6 -0
- package/cjs/player/processor/interface/style-action.js.map +1 -0
- package/cjs/player/processor/processor-item.d.ts +5 -5
- package/cjs/player/processor/processor-item.js.map +1 -1
- package/cjs/player/processor/processor.d.ts +3 -3
- package/cjs/player/processor/processor.js +2 -2
- package/cjs/player/processor/processor.js.map +1 -1
- package/cjs/player/processor/processorMap.d.ts +22 -21
- package/cjs/player/processor/processorMap.js +42 -8
- package/cjs/player/processor/processorMap.js.map +1 -1
- package/cjs/player/scheduler.d.ts +4 -3
- package/cjs/player/scheduler.js +7 -5
- package/cjs/player/scheduler.js.map +1 -1
- package/cjs/scene/action.js +0 -2
- package/cjs/story/canvas/canvas.js +1 -1
- package/cjs/story/character/base/base.d.ts +3 -4
- package/cjs/story/character/base/base.js +6 -3
- package/cjs/story/character/base/base.js.map +1 -1
- package/cjs/story/character/chart/character.d.ts +1 -0
- package/cjs/story/character/chart/character.js +3 -0
- package/cjs/story/character/chart/character.js.map +1 -1
- package/cjs/story/character/chart/graphic/vchart-graphic-render.js +3 -3
- package/cjs/story/character/chart/graphic/vchart-graphic-render.js.map +1 -1
- package/cjs/story/character/chart/graphic/vchart-graphic.d.ts +1 -0
- package/cjs/story/character/chart/graphic/vchart-graphic.js +5 -1
- package/cjs/story/character/chart/graphic/vchart-graphic.js.map +1 -1
- package/cjs/story/character/component/character-group/component-group-graphic.d.ts +1 -0
- package/cjs/story/character/component/character-group/component-group-graphic.js +8 -2
- package/cjs/story/character/component/character-group/component-group-graphic.js.map +1 -1
- package/cjs/story/character/component/character.d.ts +4 -3
- package/cjs/story/character/component/character.js +8 -5
- package/cjs/story/character/component/character.js.map +1 -1
- package/cjs/story/character/component/characters/character-richtext.d.ts +1 -6
- package/cjs/story/character/component/characters/character-richtext.js +0 -16
- package/cjs/story/character/component/characters/character-richtext.js.map +1 -1
- package/cjs/story/character/component/characters/character-text.js +1 -1
- package/cjs/story/character/component/characters/character-text.js.map +1 -1
- package/cjs/story/character/component/graphic/graphic-base-text.d.ts +23 -0
- package/cjs/story/character/component/graphic/{graphic-text.js → graphic-base-text.js} +38 -22
- package/cjs/story/character/component/graphic/graphic-base-text.js.map +1 -0
- package/cjs/story/character/component/graphic/graphic.d.ts +1 -1
- package/cjs/story/character/component/graphic/graphic.js.map +1 -1
- package/cjs/story/character/component/graphic/richtext.d.ts +1 -9
- package/cjs/story/character/component/graphic/richtext.js +0 -45
- package/cjs/story/character/component/graphic/richtext.js.map +1 -1
- package/cjs/story/character/component/graphic/text.d.ts +4 -3
- package/cjs/story/character/component/graphic/text.js +21 -6
- package/cjs/story/character/component/graphic/text.js.map +1 -1
- package/cjs/story/character/component/graphic/timeline.d.ts +6 -0
- package/cjs/story/character/component/graphic/timeline.js +7 -1
- package/cjs/story/character/component/graphic/timeline.js.map +1 -1
- package/cjs/story/character/dsl-interface.d.ts +2 -2
- package/cjs/story/character/dsl-interface.js.map +1 -1
- package/cjs/story/character/runtime-interface.d.ts +1 -0
- package/cjs/story/character/runtime-interface.js.map +1 -1
- package/cjs/story/character/visactor/character.d.ts +2 -3
- package/cjs/story/character/visactor/character.js.map +1 -1
- package/cjs/story/character/visactor/interface.d.ts +1 -0
- package/cjs/story/character/visactor/interface.js.map +1 -1
- package/cjs/story/character-tree/character-tree.d.ts +1 -0
- package/cjs/story/character-tree/character-tree.js +6 -0
- package/cjs/story/character-tree/character-tree.js.map +1 -1
- package/cjs/story/index.js +1 -2
- package/cjs/story/index.js.map +1 -1
- package/cjs/story/interface/dsl-interface.d.ts +5 -8
- package/cjs/story/interface/dsl-interface.js.map +1 -1
- package/cjs/story/interface/player.d.ts +1 -13
- package/cjs/story/interface/player.js +1 -4
- package/cjs/story/interface/player.js.map +1 -1
- package/cjs/story/interface/runtime-interface.d.ts +2 -0
- package/cjs/story/interface/runtime-interface.js.map +1 -1
- package/cjs/story/story.d.ts +2 -1
- package/cjs/story/story.js +7 -5
- package/cjs/story/story.js.map +1 -1
- package/cjs/util/space.js +1 -2
- package/cjs/util/vrender-api.js +2 -1
- package/dist/index.js +6584 -14631
- package/dist/index.min.js +20 -1
- package/es/animate/typewirter.d.ts +3 -4
- package/es/animate/typewirter.js +46 -30
- package/es/animate/typewirter.js.map +1 -1
- package/es/constants/action.d.ts +9 -0
- package/es/constants/action.js +11 -1
- package/es/constants/action.js.map +1 -1
- package/es/constants/character.d.ts +0 -1
- package/es/constants/character.js +1 -2
- package/es/constants/character.js.map +1 -1
- package/es/dsl/constant/index.d.ts +13 -0
- package/es/dsl/constant/index.js +6 -1
- package/es/dsl/constant/index.js.map +1 -1
- package/es/dsl/story-chart/area.d.ts +2 -0
- package/es/dsl/story-chart/area.js +5 -1
- package/es/dsl/story-chart/area.js.map +1 -1
- package/es/dsl/story-chart/bar.d.ts +2 -0
- package/es/dsl/story-chart/bar.js +1 -1
- package/es/dsl/story-chart/bar.js.map +1 -1
- package/es/dsl/story-chart/chart.js +1 -2
- package/es/dsl/story-chart/line.d.ts +2 -0
- package/es/dsl/story-chart/line.js +1 -1
- package/es/dsl/story-chart/line.js.map +1 -1
- package/es/dsl/story-chart/pie.d.ts +2 -0
- package/es/dsl/story-chart/pie.js +3 -0
- package/es/dsl/story-chart/pie.js.map +1 -1
- package/es/dsl/story-processor/graphic/appear.js.map +1 -1
- package/es/dsl/story-processor/graphic/effect/appear.js +1 -8
- package/es/dsl/story-processor/graphic/effect/appear.js.map +1 -1
- package/es/dsl/story-processor/graphic/effect/typewriter.js +1 -1
- package/es/dsl/story-processor/graphic/effect/typewriter.js.map +1 -1
- package/es/dsl/story-processor/processor.js +1 -1
- package/es/dsl/types/Datum.js +2 -1
- package/es/dsl/types/index.js +1 -1
- package/es/dsl/utils/datum.js +1 -1
- package/es/dsl/utils/flicker.js +1 -1
- package/es/edit/edit-component/image-selection.js +1 -1
- package/es/edit/edit-component/index.js +1 -1
- package/es/edit/edit-component/layer-edit.js +0 -2
- package/es/edit/edit-component/rect-selection.js +1 -1
- package/es/edit/edit-component/richtext-selection.js +1 -1
- package/es/edit/edit-component/text-selection.js +1 -1
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -3
- package/es/index.js.map +1 -1
- package/es/interface/type.js +1 -2
- package/es/player/interface/player.d.ts +5 -2
- package/es/player/interface/player.js.map +1 -1
- package/es/player/interface/scheduler.d.ts +1 -1
- package/es/player/interface/scheduler.js.map +1 -1
- package/es/player/player.d.ts +7 -2
- package/es/player/player.js +27 -18
- package/es/player/player.js.map +1 -1
- package/es/player/processor/chart/common/chartAppear.d.ts +5 -0
- package/es/player/processor/chart/common/chartAppear.js +4 -0
- package/es/player/processor/chart/common/chartAppear.js.map +1 -0
- package/es/player/processor/chart/common/commonAppear.d.ts +8 -0
- package/es/player/processor/chart/common/commonAppear.js +36 -0
- package/es/player/processor/chart/common/commonAppear.js.map +1 -0
- package/es/player/processor/chart/component/axisAppear.d.ts +2 -2
- package/es/player/processor/chart/component/axisAppear.js +3 -1
- package/es/player/processor/chart/component/axisAppear.js.map +1 -1
- package/es/player/processor/chart/component/commonAppear.d.ts +3 -3
- package/es/player/processor/chart/component/commonAppear.js +3 -14
- package/es/player/processor/chart/component/commonAppear.js.map +1 -1
- package/es/player/processor/chart/component/labelAppear.d.ts +2 -2
- package/es/player/processor/chart/component/labelAppear.js +1 -1
- package/es/player/processor/chart/component/labelAppear.js.map +1 -1
- package/es/player/processor/chart/component/legendsAppear.d.ts +4 -3
- package/es/player/processor/chart/component/legendsAppear.js +2 -2
- package/es/player/processor/chart/component/legendsAppear.js.map +1 -1
- package/es/player/processor/chart/component/titleAppear.d.ts +4 -3
- package/es/player/processor/chart/component/titleAppear.js +2 -2
- package/es/player/processor/chart/component/titleAppear.js.map +1 -1
- package/es/player/processor/chart/seriesmark/commonTransformMarkAppear.d.ts +3 -3
- package/es/player/processor/chart/seriesmark/commonTransformMarkAppear.js.map +1 -1
- package/{cjs/player/processor/chart/seriesmark/transformSymbolAppear.d.ts → es/player/processor/chart/seriesmark/transformArcVisibility.d.ts} +3 -3
- package/es/player/processor/chart/seriesmark/{transformArcAppear.js → transformArcVisibility.js} +3 -4
- package/es/player/processor/chart/seriesmark/transformArcVisibility.js.map +1 -0
- package/es/player/processor/chart/seriesmark/transformLineVisibility.d.ts +12 -0
- package/es/player/processor/chart/seriesmark/transformLineVisibility.js +4 -0
- package/es/player/processor/chart/seriesmark/transformLineVisibility.js.map +1 -0
- package/es/player/processor/chart/seriesmark/transformRectVisibility.d.ts +12 -0
- package/es/player/processor/chart/seriesmark/{transformRectAppear.js → transformRectVisibility.js} +4 -5
- package/es/player/processor/chart/seriesmark/transformRectVisibility.js.map +1 -0
- package/es/player/processor/chart/seriesmark/transformSymbolVisibility.d.ts +12 -0
- package/es/player/processor/chart/seriesmark/transformSymbolVisibility.js +4 -0
- package/es/player/processor/chart/seriesmark/transformSymbolVisibility.js.map +1 -0
- package/es/player/processor/chart/seriesmark/transformTextVisibility.d.ts +12 -0
- package/es/player/processor/chart/seriesmark/transformTextVisibility.js +4 -0
- package/es/player/processor/chart/seriesmark/transformTextVisibility.js.map +1 -0
- package/es/player/processor/chart/transformMap.d.ts +24 -18
- package/es/player/processor/chart/transformMap.js +14 -11
- package/es/player/processor/chart/transformMap.js.map +1 -1
- package/es/player/processor/chart/vchart.d.ts +62 -15
- package/es/player/processor/chart/vchart.js +92 -9
- package/es/player/processor/chart/vchart.js.map +1 -1
- package/es/player/processor/common/bounce-processor.d.ts +3 -0
- package/es/player/processor/common/bounce-processor.js +20 -0
- package/es/player/processor/common/bounce-processor.js.map +1 -0
- package/es/player/processor/common/common.d.ts +5 -0
- package/es/player/processor/common/common.js +12 -0
- package/es/player/processor/common/common.js.map +1 -0
- package/es/player/processor/common/fade-processor.d.ts +4 -0
- package/es/player/processor/common/fade-processor.js +30 -0
- package/es/player/processor/common/fade-processor.js.map +1 -0
- package/es/player/processor/common/move-processor.d.ts +8 -0
- package/es/player/processor/common/move-processor.js +148 -0
- package/es/player/processor/common/move-processor.js.map +1 -0
- package/es/player/processor/common/scale-processor.d.ts +8 -0
- package/es/player/processor/common/scale-processor.js +43 -0
- package/es/player/processor/common/scale-processor.js.map +1 -0
- package/es/player/processor/common/wipe-processor.d.ts +4 -0
- package/es/player/processor/common/wipe-processor.js +36 -0
- package/es/player/processor/common/wipe-processor.js.map +1 -0
- package/es/player/processor/common-processor.js +3 -0
- package/es/player/processor/common-processor.js.map +1 -0
- package/es/player/processor/component/common-component.d.ts +45 -9
- package/es/player/processor/component/common-component.js +97 -73
- package/es/player/processor/component/common-component.js.map +1 -1
- package/es/player/processor/component/image/image-visibility.d.ts +5 -0
- package/es/player/processor/component/image/image-visibility.js +8 -0
- package/es/player/processor/component/image/image-visibility.js.map +1 -0
- package/es/player/processor/component/line/line-visibility.d.ts +5 -0
- package/es/player/processor/component/line/line-visibility.js +8 -0
- package/es/player/processor/component/line/line-visibility.js.map +1 -0
- package/es/player/processor/component/rect/rect-visibility.d.ts +5 -0
- package/es/player/processor/component/rect/rect-visibility.js +8 -0
- package/es/player/processor/component/rect/rect-visibility.js.map +1 -0
- package/es/player/processor/component/shape/shape-visibility.d.ts +5 -0
- package/es/player/processor/component/shape/shape-visibility.js +8 -0
- package/es/player/processor/component/shape/shape-visibility.js.map +1 -0
- package/es/player/processor/component/text/text-visibility.d.ts +6 -0
- package/es/player/processor/component/text/text-visibility.js +39 -0
- package/es/player/processor/component/text/text-visibility.js.map +1 -0
- package/es/player/processor/component/timeline/timeline-visibility.d.ts +15 -0
- package/es/player/processor/component/timeline/timeline-visibility.js +71 -0
- package/es/player/processor/component/timeline/timeline-visibility.js.map +1 -0
- package/es/player/processor/component/utils.d.ts +3 -1
- package/es/player/processor/component/utils.js +13 -0
- package/es/player/processor/component/utils.js.map +1 -1
- package/es/player/processor/interface/action-processor.d.ts +6 -6
- package/es/player/processor/interface/action-processor.js.map +1 -1
- package/es/player/processor/interface/appear-action.d.ts +30 -18
- package/es/player/processor/interface/appear-action.js.map +1 -1
- package/es/player/processor/interface/common-action.d.ts +14 -0
- package/es/player/processor/interface/common-action.js +2 -0
- package/es/player/processor/interface/common-action.js.map +1 -0
- package/es/player/processor/interface/style-action.d.ts +34 -0
- package/es/player/processor/interface/style-action.js +2 -0
- package/es/player/processor/interface/style-action.js.map +1 -0
- package/es/player/processor/processor-item.d.ts +5 -5
- package/es/player/processor/processor-item.js.map +1 -1
- package/es/player/processor/processor.d.ts +3 -3
- package/es/player/processor/processor.js +2 -2
- package/es/player/processor/processor.js.map +1 -1
- package/es/player/processor/processorMap.d.ts +22 -21
- package/es/player/processor/processorMap.js +51 -15
- package/es/player/processor/processorMap.js.map +1 -1
- package/es/player/scheduler.d.ts +4 -3
- package/es/player/scheduler.js +7 -5
- package/es/player/scheduler.js.map +1 -1
- package/es/scene/action.js +0 -2
- package/es/story/canvas/canvas.js +1 -1
- package/es/story/character/base/base.d.ts +3 -4
- package/es/story/character/base/base.js +6 -3
- package/es/story/character/base/base.js.map +1 -1
- package/es/story/character/chart/character.d.ts +1 -0
- package/es/story/character/chart/character.js +3 -0
- package/es/story/character/chart/character.js.map +1 -1
- package/es/story/character/chart/graphic/vchart-graphic-render.js +3 -3
- package/es/story/character/chart/graphic/vchart-graphic-render.js.map +1 -1
- package/es/story/character/chart/graphic/vchart-graphic.d.ts +1 -0
- package/es/story/character/chart/graphic/vchart-graphic.js +5 -1
- package/es/story/character/chart/graphic/vchart-graphic.js.map +1 -1
- package/es/story/character/component/character-group/component-group-graphic.d.ts +1 -0
- package/es/story/character/component/character-group/component-group-graphic.js +8 -2
- package/es/story/character/component/character-group/component-group-graphic.js.map +1 -1
- package/es/story/character/component/character.d.ts +4 -3
- package/es/story/character/component/character.js +8 -4
- package/es/story/character/component/character.js.map +1 -1
- package/es/story/character/component/characters/character-richtext.d.ts +1 -6
- package/es/story/character/component/characters/character-richtext.js +0 -12
- package/es/story/character/component/characters/character-richtext.js.map +1 -1
- package/es/story/character/component/characters/character-text.js +2 -2
- package/es/story/character/component/characters/character-text.js.map +1 -1
- package/es/story/character/component/graphic/graphic-base-text.d.ts +23 -0
- package/es/story/character/component/graphic/{graphic-text.js → graphic-base-text.js} +37 -21
- package/es/story/character/component/graphic/graphic-base-text.js.map +1 -0
- package/es/story/character/component/graphic/graphic.d.ts +1 -1
- package/es/story/character/component/graphic/graphic.js.map +1 -1
- package/es/story/character/component/graphic/richtext.d.ts +1 -9
- package/es/story/character/component/graphic/richtext.js +0 -41
- package/es/story/character/component/graphic/richtext.js.map +1 -1
- package/es/story/character/component/graphic/text.d.ts +4 -3
- package/es/story/character/component/graphic/text.js +21 -4
- package/es/story/character/component/graphic/text.js.map +1 -1
- package/es/story/character/component/graphic/timeline.d.ts +6 -0
- package/es/story/character/component/graphic/timeline.js +7 -1
- package/es/story/character/component/graphic/timeline.js.map +1 -1
- package/es/story/character/dsl-interface.d.ts +2 -2
- package/es/story/character/dsl-interface.js.map +1 -1
- package/es/story/character/runtime-interface.d.ts +1 -0
- package/es/story/character/runtime-interface.js.map +1 -1
- package/es/story/character/visactor/character.d.ts +2 -3
- package/es/story/character/visactor/character.js.map +1 -1
- package/es/story/character/visactor/interface.d.ts +1 -0
- package/es/story/character/visactor/interface.js.map +1 -1
- package/es/story/character-tree/character-tree.d.ts +1 -0
- package/es/story/character-tree/character-tree.js +6 -0
- package/es/story/character-tree/character-tree.js.map +1 -1
- package/es/story/index.js +0 -3
- package/es/story/index.js.map +1 -1
- package/es/story/interface/dsl-interface.d.ts +5 -8
- package/es/story/interface/dsl-interface.js.map +1 -1
- package/es/story/interface/player.d.ts +1 -13
- package/es/story/interface/player.js +2 -1
- package/es/story/interface/player.js.map +1 -1
- package/es/story/interface/runtime-interface.d.ts +2 -0
- package/es/story/interface/runtime-interface.js.map +1 -1
- package/es/story/story.d.ts +2 -1
- package/es/story/story.js +7 -5
- package/es/story/story.js.map +1 -1
- package/es/util/space.js +1 -2
- package/es/util/vrender-api.js +2 -1
- package/package.json +7 -7
- package/cjs/player/processor/chart/seriesmark/transformArcAppear.js.map +0 -1
- package/cjs/player/processor/chart/seriesmark/transformLineAppear.js +0 -14
- package/cjs/player/processor/chart/seriesmark/transformLineAppear.js.map +0 -1
- package/cjs/player/processor/chart/seriesmark/transformRectAppear.js.map +0 -1
- package/cjs/player/processor/chart/seriesmark/transformSymbolAppear.js +0 -14
- package/cjs/player/processor/chart/seriesmark/transformSymbolAppear.js.map +0 -1
- package/cjs/player/processor/chart/seriesmark/transformTextAppear.d.ts +0 -12
- package/cjs/player/processor/chart/seriesmark/transformTextAppear.js +0 -14
- package/cjs/player/processor/chart/seriesmark/transformTextAppear.js.map +0 -1
- package/cjs/player/processor/component/image/image-appear.d.ts +0 -5
- package/cjs/player/processor/component/image/image-appear.js +0 -16
- package/cjs/player/processor/component/image/image-appear.js.map +0 -1
- package/cjs/player/processor/component/line/line-appear.d.ts +0 -5
- package/cjs/player/processor/component/line/line-appear.js +0 -16
- package/cjs/player/processor/component/line/line-appear.js.map +0 -1
- package/cjs/player/processor/component/rect/rect-appear.d.ts +0 -5
- package/cjs/player/processor/component/rect/rect-appear.js +0 -16
- package/cjs/player/processor/component/rect/rect-appear.js.map +0 -1
- package/cjs/player/processor/component/shape/shape-appear.d.ts +0 -5
- package/cjs/player/processor/component/shape/shape-appear.js +0 -16
- package/cjs/player/processor/component/shape/shape-appear.js.map +0 -1
- package/cjs/player/processor/component/text/text-appear.d.ts +0 -7
- package/cjs/player/processor/component/text/text-appear.js +0 -34
- package/cjs/player/processor/component/text/text-appear.js.map +0 -1
- package/cjs/player/processor/component/timeline/timeline-appear.d.ts +0 -7
- package/cjs/player/processor/component/timeline/timeline-appear.js +0 -33
- package/cjs/player/processor/component/timeline/timeline-appear.js.map +0 -1
- package/cjs/story/character/component/graphic/graphic-text.d.ts +0 -18
- package/cjs/story/character/component/graphic/graphic-text.js.map +0 -1
- package/cjs/story/player/encode.js +0 -3
- package/cjs/story/player/encode.js.map +0 -1
- package/cjs/story/player/index.js +0 -3
- package/cjs/story/player/index.js.map +0 -1
- package/cjs/story/player/ticker.d.ts +0 -1
- package/cjs/story/player/ticker.js +0 -3
- package/cjs/story/player/ticker.js.map +0 -1
- package/es/player/processor/chart/seriesmark/transformArcAppear.d.ts +0 -12
- package/es/player/processor/chart/seriesmark/transformArcAppear.js.map +0 -1
- package/es/player/processor/chart/seriesmark/transformLineAppear.d.ts +0 -12
- package/es/player/processor/chart/seriesmark/transformLineAppear.js +0 -7
- package/es/player/processor/chart/seriesmark/transformLineAppear.js.map +0 -1
- package/es/player/processor/chart/seriesmark/transformRectAppear.d.ts +0 -12
- package/es/player/processor/chart/seriesmark/transformRectAppear.js.map +0 -1
- package/es/player/processor/chart/seriesmark/transformSymbolAppear.d.ts +0 -12
- package/es/player/processor/chart/seriesmark/transformSymbolAppear.js +0 -7
- package/es/player/processor/chart/seriesmark/transformSymbolAppear.js.map +0 -1
- package/es/player/processor/chart/seriesmark/transformTextAppear.d.ts +0 -12
- package/es/player/processor/chart/seriesmark/transformTextAppear.js +0 -7
- package/es/player/processor/chart/seriesmark/transformTextAppear.js.map +0 -1
- package/es/player/processor/component/image/image-appear.d.ts +0 -5
- package/es/player/processor/component/image/image-appear.js +0 -8
- package/es/player/processor/component/image/image-appear.js.map +0 -1
- package/es/player/processor/component/line/line-appear.d.ts +0 -5
- package/es/player/processor/component/line/line-appear.js +0 -8
- package/es/player/processor/component/line/line-appear.js.map +0 -1
- package/es/player/processor/component/rect/rect-appear.d.ts +0 -5
- package/es/player/processor/component/rect/rect-appear.js +0 -8
- package/es/player/processor/component/rect/rect-appear.js.map +0 -1
- package/es/player/processor/component/shape/shape-appear.d.ts +0 -5
- package/es/player/processor/component/shape/shape-appear.js +0 -8
- package/es/player/processor/component/shape/shape-appear.js.map +0 -1
- package/es/player/processor/component/text/text-appear.d.ts +0 -7
- package/es/player/processor/component/text/text-appear.js +0 -32
- package/es/player/processor/component/text/text-appear.js.map +0 -1
- package/es/player/processor/component/timeline/timeline-appear.d.ts +0 -7
- package/es/player/processor/component/timeline/timeline-appear.js +0 -27
- package/es/player/processor/component/timeline/timeline-appear.js.map +0 -1
- package/es/story/character/component/graphic/graphic-text.d.ts +0 -18
- package/es/story/character/component/graphic/graphic-text.js.map +0 -1
- package/es/story/player/encode.d.ts +0 -1
- package/es/story/player/encode.js +0 -3
- package/es/story/player/encode.js.map +0 -1
- package/es/story/player/index.d.ts +0 -1
- package/es/story/player/index.js +0 -3
- package/es/story/player/index.js.map +0 -1
- package/es/story/player/ticker.d.ts +0 -1
- package/es/story/player/ticker.js +0 -3
- package/es/story/player/ticker.js.map +0 -1
- /package/cjs/{story/player/encode.d.ts → player/processor/common-processor.d.ts} +0 -0
- /package/{cjs/story/player/index.d.ts → es/player/processor/common-processor.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/vchart.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9C,MAAM,OAAO,+BAAgC,SAAQ,mBAAmB;IAGtE;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,uBAAuB,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;AAEM,2CAAW,GAAG,CAAC,UAAkB,EAAE,EAAE;IAC1C,OAAO;QACL,SAAS,EAAE;YACT,MAAM,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM;YACxD,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,UAAU;YAClB,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,KAAK;SACZ;KACF,CAAC;AACJ,CAAC,CAAC;AAEK,8CAAc,GAAkC;IACrD,SAAS,EAAE;QACT,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,UAAU;QAClB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,KAAK;KACZ;CACF,CAAC;AAEK,0CAAU,GAAkC;IACjD,SAAS,EAAE;QACT,MAAM,EAAE,WAAW;QACnB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,UAAU;QAClB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,KAAK;KACZ;CACF,CAAC;AAEK,2CAAW,GAAkC,+BAA+B,CAAC,cAAc,CAAC;AAC5F,6CAAa,GAAkC,+BAA+B,CAAC,cAAc,CAAC;AAC9F,2CAAW,GAAkC,+BAA+B,CAAC,cAAc,CAAC","file":"vchart.js","sourcesContent":["import type { IComponent, ISeries, IVChart } from '@visactor/vchart';\nimport { isFunction, isNumberClose, merge } from '@visactor/vutils';\nimport type { ICharacter } from '../../../story/character';\nimport type { IAction } from '../../../story/interface';\nimport { ActionProcessorItem } from '../processor-item';\nimport { transformMap } from './transformMap';\nimport type { IChartAppearAction } from '../interface/appear-action';\nimport type { AxisBaseAttributes } from '@visactor/vrender-components';\nimport type { IGroup } from '@visactor/vrender-core';\n\nexport class VChartVisibilityActionProcessor extends ActionProcessorItem {\n name: 'appearOrDisAppear';\n\n constructor() {\n super();\n }\n\n getStartTimeAndDuration(action: IAction): { startTime: number; duration: number } {\n const { startTime: globalStartTime = 0, duration: globalDuration } = action;\n const { startTime = 0, duration = 0 } = action.payload?.animation ?? ({} as any);\n\n const st = globalStartTime + startTime;\n const d = globalDuration ?? duration;\n return {\n startTime: st,\n duration: d\n };\n }\n\n run(character: ICharacter, actionSpec: IAction): void {\n return;\n // const vchart = character.graphic._vchart as IVChart;\n // // series & mark\n // const seriesList = vchart.getChart().getAllSeries();\n // seriesList.forEach(series => {\n // this.commonSeriesAppear(vchart, series, actionSpec);\n // });\n // // component\n // const components = vchart.getChart().getAllComponents();\n // components.forEach(component => {\n // this.componentAppear(vchart, component, actionSpec);\n // });\n }\n\n protected componentAppear(vchart: IVChart, component: IComponent, actionSpec: IAction) {\n if (component.specKey === 'label') {\n this.labelComponentAppear(vchart, component, actionSpec);\n } else if (component.specKey === 'legends') {\n this.legendsComponentAppear(vchart, component, actionSpec);\n } else if (component.specKey === 'axes') {\n this.axisComponentAppear(vchart, component, actionSpec);\n } else if (component.specKey === 'title') {\n this.titleComponentAppear(vchart, component, actionSpec);\n }\n }\n\n protected labelComponentAppear(vchart: IVChart, component: IComponent, actionSpec: IAction) {\n const vrenderComponents = component.getVRenderComponents();\n const appearTransformFunc = (transformMap.appear as any).label;\n const defaultPayload = VChartVisibilityActionProcessor.defaultPayload;\n vrenderComponents.forEach(group => {\n this.runTransformFunc(group as any, appearTransformFunc, actionSpec, defaultPayload);\n });\n }\n\n protected legendsComponentAppear(vchart: IVChart, component: IComponent, actionSpec: IAction) {\n const vrenderComponents = component.getVRenderComponents();\n const appearTransformFunc = (transformMap.appear as any).legends;\n const defaultPayload = VChartVisibilityActionProcessor.defaultPayload;\n vrenderComponents.forEach(group => {\n this.runTransformFunc(group as any, appearTransformFunc, actionSpec, defaultPayload);\n });\n }\n\n protected axisComponentAppear(vchart: IVChart, component: IComponent, actionSpec: IAction) {\n const vrenderComponents = component.getVRenderComponents();\n const axis = vrenderComponents[0];\n const axisGrid = vrenderComponents[1];\n const axisOrient = (axis.attribute as AxisBaseAttributes).orient;\n const axisItems = (axis.attribute as AxisBaseAttributes).items ?? [[]];\n const orient = axisOrient === 'left' || axisOrient === 'right' ? 'height' : 'width';\n const gridOrient = axisOrient === 'left' || axisOrient === 'right' ? 'width' : 'height';\n const direction = isNumberClose(axisItems[0][0].value, 1) ? 'positive' : 'negative';\n const appearTransformFunc = (transformMap.appear as any).axis;\n const defaultPayload = (VChartVisibilityActionProcessor as any).defaultPayload;\n\n if (axis) {\n this.runTransformFunc(axis as any, appearTransformFunc, actionSpec, defaultPayload, { orient, direction });\n }\n if (axisGrid) {\n this.runTransformFunc(axisGrid as any, appearTransformFunc, actionSpec, defaultPayload, {\n orient: gridOrient,\n direction\n });\n }\n }\n\n protected titleComponentAppear(vchart: IVChart, component: IComponent, actionSpec: IAction) {\n const vrenderComponents = component.getVRenderComponents();\n const appearTransformFunc = (transformMap.appear as any).title;\n const defaultPayload = VChartVisibilityActionProcessor.defaultPayload;\n vrenderComponents.forEach(group => {\n this.runTransformFunc(group as any, appearTransformFunc, actionSpec, defaultPayload);\n });\n }\n\n private runTransformFunc(\n instance: IGroup,\n appearTransformFunc: any,\n actionSpec: IAction,\n defaultPayload: IAction['payload'] = {},\n actionOption: Record<string, any> = {}\n ) {\n if (appearTransformFunc) {\n const { payload } = actionSpec;\n const mergePayload = merge({}, defaultPayload, payload) as IChartAppearAction['payload'];\n appearTransformFunc(instance, mergePayload.animation, {\n disappear: actionSpec.action === 'disappear',\n ...actionOption\n });\n }\n }\n\n protected commonSeriesAppear(vchart: IVChart, series: ISeries, actionSpec: IAction) {\n const marks = series.getMarksWithoutRoot();\n if (!marks.length) {\n return;\n }\n const { payload } = actionSpec;\n marks.forEach((mark, markIndex) => {\n const defaultMarkPayload = (VChartVisibilityActionProcessor as any)[`${mark.type}Payload`];\n const mergePayload = merge(\n {},\n isFunction(defaultMarkPayload) ? defaultMarkPayload(series.type) : defaultMarkPayload || {},\n payload\n ) as IChartAppearAction['payload'];\n const product = mark.getProduct();\n const appearTransform = (transformMap.appear as any)[mark.type];\n const config =\n appearTransform &&\n appearTransform(vchart as any, mergePayload.animation, {\n index: markIndex,\n disappear: actionSpec.action === 'disappear'\n });\n // @ts-ignore\n product && config && product.animate.run(config || {});\n });\n }\n\n static rectPayload = (seriesType: string) => {\n return {\n animation: {\n effect: seriesType === 'treemap' ? 'centerGrow' : 'grow',\n duration: 2000,\n easing: 'cubicOut',\n oneByOne: false,\n loop: false\n }\n };\n };\n\n static defaultPayload: IChartAppearAction['payload'] = {\n animation: {\n effect: 'grow',\n duration: 2000,\n easing: 'cubicOut',\n oneByOne: false,\n loop: false\n }\n };\n\n static arcPayload: IChartAppearAction['payload'] = {\n animation: {\n effect: 'growAngle',\n duration: 2000,\n easing: 'cubicOut',\n oneByOne: false,\n loop: false\n }\n };\n\n static linePayload: IChartAppearAction['payload'] = VChartVisibilityActionProcessor.defaultPayload;\n static symbolPayload: IChartAppearAction['payload'] = VChartVisibilityActionProcessor.defaultPayload;\n static textPayload: IChartAppearAction['payload'] = VChartVisibilityActionProcessor.defaultPayload;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/vchart.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAiB,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9C,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI9D,MAAM,OAAO,+BAAgC,SAAQ,mBAAmB;IAGtE;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,uBAAuB,CAAC,MAAmB;;QACzC,MAAM,EAAE,SAAS,EAAE,eAAe,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC;QAClD,MAAM,EAAE,SAAS,GAAG,CAAC,EAAE,QAAQ,GAAG,CAAC,EAAE,GAAG,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,SAA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CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QAEtB,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;CACF","file":"vchart.js","sourcesContent":["import type { IComponent, ISeries, IVChart } from '@visactor/vchart';\nimport { cloneDeep, isArray, isFunction, isNumberClose, merge } from '@visactor/vutils';\nimport type { ICharacter } from '../../../story/character';\nimport type { IActionSpec } from '../../../story/interface';\nimport { ActionProcessorItem } from '../processor-item';\nimport { transformMap } from './transformMap';\nimport type { IChartVisibilityAction } from '../interface/appear-action';\nimport type { AxisBaseAttributes } from '@visactor/vrender-components';\nimport type { IGraphic, IGroup } from '@visactor/vrender-core';\nimport type { IAction, IActionPayload } from '../interface/common-action';\nimport { checkArrayOrder, isMatch } from '../component/utils';\n\nexport type Datum = Record<string, any>;\n\nexport class VChartVisibilityActionProcessor extends ActionProcessorItem {\n name: 'appearOrDisAppear';\n\n constructor() {\n super();\n }\n\n getStartTimeAndDuration(action: IActionSpec): { startTime: number; duration: number } {\n const { startTime: globalStartTime = 0 } = action;\n const { startTime = 0, duration = 0 } = action.payload?.animation ?? ({} as any);\n\n const st = globalStartTime + startTime;\n const d = duration;\n return {\n startTime: st,\n duration: d\n };\n }\n\n run(character: ICharacter, actionSpec: IChartVisibilityAction): void {\n const vchart = (character.graphic as any)._vchart as IVChart;\n // chart & panel\n this.chartVisibility(character.graphic as any, actionSpec);\n // series & mark\n const seriesList = vchart.getChart().getAllSeries();\n seriesList.forEach(series => {\n this.commonSeriesAppear(vchart, series, actionSpec);\n });\n // component\n const components = vchart.getChart().getAllComponents();\n components.forEach(component => {\n this.componentAppear(vchart, component, actionSpec);\n });\n }\n\n protected chartVisibility(chartGraphic: IGraphic, actionSpec: IActionSpec) {\n const appearTransformFunc = (transformMap.appear as any).chart;\n const defaultPayload = VChartVisibilityActionProcessor.fadePayload;\n this.runTransformFunc(chartGraphic as any, appearTransformFunc, actionSpec, defaultPayload);\n }\n\n protected componentAppear(vchart: IVChart, component: IComponent, actionSpec: IActionSpec) {\n if (component.specKey === 'label') {\n this.labelComponentAppear(vchart, component, actionSpec);\n } else if (component.specKey === 'legends') {\n this.legendsComponentAppear(vchart, component, actionSpec);\n } else if (component.specKey === 'axes') {\n this.axisComponentAppear(vchart, component, actionSpec);\n } else if (component.specKey === 'title') {\n this.titleComponentAppear(vchart, component, actionSpec);\n }\n }\n\n protected labelComponentAppear(vchart: IVChart, component: IComponent, actionSpec: IActionSpec) {\n const vrenderComponents = component.getVRenderComponents();\n const appearTransformFunc = (transformMap.appear as any).label;\n const defaultPayload = VChartVisibilityActionProcessor.defaultPayload;\n vrenderComponents.forEach(group => {\n this.runTransformFunc(group as any, appearTransformFunc, actionSpec, defaultPayload);\n });\n }\n\n protected legendsComponentAppear(vchart: IVChart, component: IComponent, actionSpec: IActionSpec) {\n const vrenderComponents = component.getVRenderComponents();\n const appearTransformFunc = (transformMap.appear as any).legends;\n const defaultPayload = VChartVisibilityActionProcessor.fadePayload;\n vrenderComponents.forEach(group => {\n this.runTransformFunc(group as any, appearTransformFunc, actionSpec, defaultPayload);\n });\n }\n\n protected axisComponentAppear(vchart: IVChart, component: IComponent, actionSpec: IActionSpec) {\n const vrenderComponents = component.getVRenderComponents();\n const axis = vrenderComponents[0];\n if (!axis) {\n return;\n }\n const axisGrid = vrenderComponents[1];\n const axisOrient = (axis.attribute as AxisBaseAttributes)?.orient;\n if (axisOrient === 'angle' || axisOrient === 'radius') {\n this.polarAxisAppear(axis, axisGrid, actionSpec);\n } else {\n this.cartesianAxisAppear(axis, axisGrid, actionSpec);\n }\n }\n\n protected cartesianAxisAppear(axis: any, axisGrid: any, actionSpec: IActionSpec) {\n const axisOrient = (axis.attribute as AxisBaseAttributes)?.orient;\n const axisItems = (axis.attribute as AxisBaseAttributes)?.items ?? [[]];\n const orient = axisOrient === 'left' || axisOrient === 'right' ? 'height' : 'width';\n const gridOrient = axisOrient === 'left' || axisOrient === 'right' ? 'width' : 'height';\n // 有点 hack。从 vrender component 拿不到轴 inverse 配置。\n const direction = checkArrayOrder(axisItems[0], 'value') < 0 ? 'positive' : 'negative';\n const appearTransformFunc = (transformMap.appear as any).axis;\n const defaultPayload = VChartVisibilityActionProcessor.defaultPayload;\n if (axis) {\n this.runTransformFunc(axis as any, appearTransformFunc, actionSpec, defaultPayload, { orient, direction });\n }\n if (axisGrid) {\n this.runTransformFunc(axisGrid as any, appearTransformFunc, actionSpec, defaultPayload, {\n orient: gridOrient,\n direction\n });\n }\n }\n\n protected polarAxisAppear(axis: any, axisGrid: any, actionSpec: IActionSpec) {\n const axisItems = (axis.attribute as AxisBaseAttributes)?.items ?? [[]];\n const appearTransformFunc = (transformMap.appear as any).axis;\n const defaultPayload = VChartVisibilityActionProcessor.fadePayload;\n if (axis) {\n this.runTransformFunc(axis as any, appearTransformFunc, actionSpec, defaultPayload);\n }\n if (axisGrid) {\n this.runTransformFunc(axisGrid as any, appearTransformFunc, actionSpec, defaultPayload, {});\n }\n }\n\n protected titleComponentAppear(vchart: IVChart, component: IComponent, actionSpec: IActionSpec) {\n const vrenderComponents = component.getVRenderComponents();\n const appearTransformFunc = (transformMap.appear as any).title;\n const defaultPayload = VChartVisibilityActionProcessor.fadePayload;\n vrenderComponents.forEach(group => {\n this.runTransformFunc(group as any, appearTransformFunc, actionSpec, defaultPayload);\n });\n }\n\n private runTransformFunc(\n instance: IGroup,\n appearTransformFunc: any,\n actionSpec: IActionSpec,\n defaultPayload: IActionSpec['payload'] = {} as any,\n actionOption: Record<string, any> = {}\n ) {\n if (instance && appearTransformFunc) {\n const { payload } = actionSpec;\n const mergePayload = merge({}, defaultPayload, payload) as IChartVisibilityAction['payload'];\n appearTransformFunc(instance, mergePayload.animation, {\n disappear: actionSpec.action === 'disappear',\n ...actionOption\n });\n }\n }\n\n protected commonSeriesAppear(vchart: IVChart, series: ISeries, actionSpec: IActionSpec) {\n const marks = series.getMarksWithoutRoot();\n if (!marks.length) {\n return;\n }\n const { payload } = actionSpec;\n marks.forEach((mark, markIndex) => {\n const defaultMarkPayload = (VChartVisibilityActionProcessor as any)[`${mark.type}Payload`];\n const mergePayload = merge(\n {},\n isFunction(defaultMarkPayload) ? defaultMarkPayload(series.type) : defaultMarkPayload || {},\n payload\n ) as IChartVisibilityAction['payload'];\n const product = mark.getProduct();\n const appearTransform = (transformMap.appear as any)[mark.type];\n const config =\n appearTransform &&\n appearTransform(vchart as any, mergePayload.animation, {\n index: markIndex,\n disappear: actionSpec.action === 'disappear'\n });\n // @ts-ignore\n product && product.animate.run(config || {});\n });\n }\n\n static rectPayload = (seriesType: string) => {\n return {\n animation: {\n effect: seriesType === 'treemap' ? 'centerGrow' : 'grow',\n duration: 2000,\n easing: 'cubicOut',\n oneByOne: false,\n loop: false\n }\n };\n };\n\n static defaultPayload: IChartVisibilityAction['payload'] = {\n animation: {\n effect: 'grow',\n duration: 2000,\n easing: 'cubicOut',\n oneByOne: false,\n loop: false\n }\n };\n\n static fadePayload: IChartVisibilityAction['payload'] = {\n animation: {\n effect: 'fade',\n duration: 2000,\n easing: 'cubicOut',\n oneByOne: false,\n loop: false\n }\n };\n\n static arcPayload: IChartVisibilityAction['payload'] = {\n animation: {\n effect: 'growAngle',\n duration: 2000,\n easing: 'cubicOut',\n oneByOne: false,\n loop: false\n }\n };\n\n static linePayload: IChartVisibilityAction['payload'] = VChartVisibilityActionProcessor.defaultPayload;\n static symbolPayload: IChartVisibilityAction['payload'] = VChartVisibilityActionProcessor.defaultPayload;\n static textPayload: IChartVisibilityAction['payload'] = VChartVisibilityActionProcessor.defaultPayload;\n}\n\nexport interface IChartUpdatePayload extends IActionPayload {\n // 批量更新数据\n values: Array<Datum>;\n\n // 将sourceValue替换为targetValue\n data: Array<{\n sourceValue: Datum;\n targetValue: Datum;\n }>;\n\n id: string | number;\n}\n\nexport interface IChartUpdateAction extends IAction<IChartUpdatePayload> {\n action: 'update';\n}\n\nexport class VChartUpdateActionProcessor extends ActionProcessorItem {\n name: 'update';\n\n constructor() {\n super();\n }\n\n getStartTimeAndDuration(action: IActionSpec): { startTime: number; duration: number } {\n const { startTime: globalStartTime = 0 } = action;\n const { startTime = 0, duration = 0 } = action.payload?.animation ?? ({} as any);\n\n const st = globalStartTime + startTime;\n const d = duration;\n return {\n startTime: st,\n duration: d\n };\n }\n\n run(character: ICharacter, actionSpec: IChartUpdateAction): void {\n const instance = (character.graphic as any)._vchart as IVChart;\n if (!instance) {\n return;\n }\n\n const { payload } = actionSpec;\n const { id: dataId, data, values } = payload;\n\n if (values) {\n instance.updateDataSync(dataId, values);\n } else {\n const rowData = cloneDeep((instance as any)._dataSet.getDataView(dataId).rawData);\n\n const items = isArray(data) ? data : [data];\n\n items.forEach(item => {\n const { sourceValue, targetValue } = item;\n const dataIndex = rowData.findIndex((v: any) => isMatch(v, sourceValue));\n if (dataIndex !== -1) {\n rowData.splice(dataIndex, 1, targetValue);\n }\n });\n\n instance.updateDataSync(dataId, rowData);\n }\n }\n}\n\nexport interface IChartAddPayload extends IActionPayload {\n id: string | number;\n values: Datum | Datum[];\n style?: {\n [key: string]: number | string;\n };\n}\n\nexport interface IChartAddAction extends IAction<IChartAddPayload> {\n action: 'add';\n payload: IChartAddPayload;\n}\n\nexport class VChartAddActionProcessor extends ActionProcessorItem {\n name: 'add';\n\n constructor() {\n super();\n }\n\n getStartTimeAndDuration(action: IActionSpec): { startTime: number; duration: number } {\n const { startTime: globalStartTime = 0 } = action;\n const { startTime = 0, duration = 0 } = action.payload?.animation ?? ({} as any);\n\n const st = globalStartTime + startTime;\n const d = duration;\n return {\n startTime: st,\n duration: d\n };\n }\n\n run(character: ICharacter, actionSpec: IChartAddAction): void {\n const instance = (character.graphic as any)._vchart as IVChart;\n if (!instance) {\n return;\n }\n\n const { payload } = actionSpec as IChartAddAction;\n const { id: dataId, values } = payload;\n const rowData = cloneDeep((instance as any)._dataSet.getDataView(dataId).rawData);\n\n const data = isArray(values) ? values : [values];\n rowData.push(...data);\n\n instance.updateDataSync(dataId, rowData);\n }\n}\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ICharacter } from '../../../story/character';
|
|
2
|
+
import type { IComponentBouncePayLoad } from '../interface/style-action';
|
|
3
|
+
export declare function bounce(character: ICharacter, animation: IComponentBouncePayLoad['animation'], params: IComponentBouncePayLoad): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getCharacterParentGraphic } from "./common";
|
|
2
|
+
|
|
3
|
+
import { CustomEase } from "../../../animate/util/util";
|
|
4
|
+
|
|
5
|
+
import { Bounce } from "../../../animate/bounce";
|
|
6
|
+
|
|
7
|
+
export function bounce(character, animation, params) {
|
|
8
|
+
const graphic = getCharacterParentGraphic(character);
|
|
9
|
+
if (graphic) {
|
|
10
|
+
const {duration: duration, easing: easing} = animation, {dy: dy} = params;
|
|
11
|
+
let {customEase: customEase} = params;
|
|
12
|
+
const {y1: y1, y2: y2} = graphic.AABBBounds, height = Math.abs(y1 - y2);
|
|
13
|
+
customEase || (customEase = CustomEase.create("bounce", "M0,0 C0,0 0.058,1 0.2,1 0.346,1 0.41,0 0.53,0 0.559,0 0.681,-0.002 0.702,0.011 0.788,0.065 0.774,0.212 0.853,0.212 0.928,0.212 1,0 1,0 ", {})),
|
|
14
|
+
graphic.animate().play(new Bounce({}, {}, duration, easing, {
|
|
15
|
+
dy: null != dy ? dy : .2 * height,
|
|
16
|
+
customEase: customEase
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=bounce-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/common/bounce-processor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,UAAU,MAAM,CACpB,SAAqB,EACrB,SAA+C,EAC/C,MAA+B;IAE/B,MAAM,OAAO,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;IACrD,IAAI,OAAO,EAAE;QACX,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QACvC,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC5B,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,EAAE;YACf,UAAU,GAAG,UAAU,CAAC,MAAM,CAC5B,QAAQ,EACR,yIAAyI,EACzI,EAAE,CACH,CAAC;SACH;QACD,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,MAAM,GAAG,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;KACtG;AACH,CAAC","file":"bounce-processor.js","sourcesContent":["import type { ICharacter } from '../../../story/character';\nimport { getCharacterParentGraphic } from './common';\nimport type { IComponentBouncePayLoad } from '../interface/style-action';\nimport { CustomEase } from '../../../animate/util/util';\nimport { Bounce } from '../../../animate/bounce';\n\nexport function bounce(\n character: ICharacter,\n animation: IComponentBouncePayLoad['animation'],\n params: IComponentBouncePayLoad\n) {\n const graphic = getCharacterParentGraphic(character);\n if (graphic) {\n const { duration, easing } = animation;\n const { dy } = params;\n let { customEase } = params;\n const { y1, y2 } = graphic.AABBBounds;\n const height = Math.abs(y1 - y2);\n if (!customEase) {\n customEase = CustomEase.create(\n 'bounce',\n 'M0,0 C0,0 0.058,1 0.2,1 0.346,1 0.41,0 0.53,0 0.559,0 0.681,-0.002 0.702,0.011 0.788,0.065 0.774,0.212 0.853,0.212 0.928,0.212 1,0 1,0 ',\n {}\n );\n }\n graphic.animate().play(new Bounce({}, {}, duration, easing, { dy: dy ?? height * 0.2, customEase }));\n }\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IGraphic } from '@visactor/vrender-core';
|
|
2
|
+
import type { ICharacter } from '../../../story/character';
|
|
3
|
+
export declare function getCharacterParentGraphic(character: ICharacter): import("@visactor/vrender-core").IGroup;
|
|
4
|
+
export declare function getCharacterGraphic(character: ICharacter): IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>[];
|
|
5
|
+
export declare function getCharacterByEffect(character: ICharacter, effect: 'move' | string): IGraphic<Partial<import("@visactor/vrender-core").IGraphicAttribute>>[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function getCharacterParentGraphic(character) {
|
|
2
|
+
return character.getGraphicParent();
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function getCharacterGraphic(character) {
|
|
6
|
+
return character.getGraphicParent().getChildren();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function getCharacterByEffect(character, effect) {
|
|
10
|
+
return "chart" === character._graphic.type || "move" === effect ? [ getCharacterParentGraphic(character) ] : getCharacterGraphic(character);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/common/common.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,yBAAyB,CAAC,SAAqB;IAC7D,OAAO,SAAS,CAAC,gBAAgB,EAAE,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,SAAqB;IACvD,OAAO,SAAS,CAAC,gBAAgB,EAAE,CAAC,WAAW,EAAgB,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,SAAqB,EAAE,MAAuB;IAGjF,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;QACvC,OAAO,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC,CAAC;KAC/C;IAED,OAAO,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;AACrG,CAAC","file":"common.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender-core';\nimport type { ICharacter } from '../../../story/character';\n\nexport function getCharacterParentGraphic(character: ICharacter) {\n return character.getGraphicParent();\n}\n\nexport function getCharacterGraphic(character: ICharacter) {\n return character.getGraphicParent().getChildren() as IGraphic[];\n}\n\nexport function getCharacterByEffect(character: ICharacter, effect: 'move' | string) {\n // 图表仅操作父节点.\n // @ts-ignore\n if (character._graphic.type === 'chart') {\n return [getCharacterParentGraphic(character)];\n }\n // move效果, 一定是对parent的操作\n return effect === 'move' ? [getCharacterParentGraphic(character)] : getCharacterGraphic(character);\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ICharacter } from '../../../story/character';
|
|
2
|
+
import type { IFadeInParams } from '../interface/appear-action';
|
|
3
|
+
export declare function fadeIn(character: ICharacter, animation: IFadeInParams, effect: string): void;
|
|
4
|
+
export declare function fadeOut(character: ICharacter, animation: IFadeInParams, effect: string): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getCharacterParentGraphic } from "./common";
|
|
2
|
+
|
|
3
|
+
import { canDoGraphicAnimation } from "../component/utils";
|
|
4
|
+
|
|
5
|
+
export function fadeIn(character, animation, effect) {
|
|
6
|
+
_fade(getCharacterParentGraphic(character), animation, !0);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function fadeOut(character, animation, effect) {
|
|
10
|
+
_fade(getCharacterParentGraphic(character), animation, !1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function _fade(graphic, params, appear) {
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
|
+
if (!canDoGraphicAnimation(graphic, params)) return !1;
|
|
16
|
+
const {fade: fade = {}} = params, duration = (_b = null !== (_a = fade.opacity) && void 0 !== _a ? _a : params.opacity,
|
|
17
|
+
null !== (_c = fade.duration) && void 0 !== _c ? _c : params.duration), easing = null !== (_d = fade.easing) && void 0 !== _d ? _d : params.easing, currOpacity = graphic.attribute.baseOpacity, opacityMap = appear ? {
|
|
18
|
+
from: 0,
|
|
19
|
+
to: null != currOpacity ? currOpacity : 1
|
|
20
|
+
} : {
|
|
21
|
+
from: null != currOpacity ? currOpacity : 1,
|
|
22
|
+
to: 0
|
|
23
|
+
};
|
|
24
|
+
return graphic.setAttributes({
|
|
25
|
+
baseOpacity: opacityMap.from
|
|
26
|
+
}), graphic.animate().to({
|
|
27
|
+
baseOpacity: opacityMap.to
|
|
28
|
+
}, duration, easing), !0;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=fade-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/common/fade-processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,UAAU,MAAM,CAAC,SAAqB,EAAE,SAAwB,EAAE,MAAc;IACpF,MAAM,OAAO,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;IACrD,KAAK,CAAC,OAAO,EAAE,SAAgB,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AACD,MAAM,UAAU,OAAO,CAAC,SAAqB,EAAE,SAAwB,EAAE,MAAc;IACrF,MAAM,OAAO,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;IACrD,KAAK,CAAC,OAAO,EAAE,SAAgB,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,KAAK,CAAC,OAAiB,EAAE,MAAqB,EAAE,MAAe;;IACtE,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;QAC3C,OAAO,KAAK,CAAC;KACd;IACD,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,OAAO,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,mCAAI,MAAM,CAAC,OAAO,mCAAI,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,MAAM,CAAC,QAAQ,CAAC;IAClD,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,MAAM,CAAC,MAAM,CAAC;IAC5C,MAAM,WAAW,GAAI,OAAO,CAAC,SAAiB,CAAC,WAAW,CAAC;IAE3D,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;IAElG,OAAO,CAAC,aAAa,CAAC;QACpB,WAAW,EAAE,UAAU,CAAC,IAAI;KACtB,CAAC,CAAC;IAEV,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAoB,CAAC,CAAC;IAErF,OAAO,IAAI,CAAC;AACd,CAAC","file":"fade-processor.js","sourcesContent":["import type { EasingType, IGraphic } from '@visactor/vrender-core';\nimport type { ICharacter } from '../../../story/character';\nimport { getCharacterParentGraphic } from './common';\nimport { canDoGraphicAnimation } from '../component/utils';\nimport type { IFadeInParams } from '../interface/appear-action';\n\nexport function fadeIn(character: ICharacter, animation: IFadeInParams, effect: string) {\n const graphic = getCharacterParentGraphic(character);\n _fade(graphic, animation as any, true);\n}\nexport function fadeOut(character: ICharacter, animation: IFadeInParams, effect: string) {\n const graphic = getCharacterParentGraphic(character);\n _fade(graphic, animation as any, false);\n}\n\nfunction _fade(graphic: IGraphic, params: IFadeInParams, appear: boolean): boolean {\n if (!canDoGraphicAnimation(graphic, params)) {\n return false;\n }\n const { fade = {} } = params;\n const opacity = fade.opacity ?? params.opacity ?? 1;\n const duration = fade.duration ?? params.duration;\n const easing = fade.easing ?? params.easing;\n const currOpacity = (graphic.attribute as any).baseOpacity;\n\n const opacityMap = appear ? { from: 0, to: currOpacity ?? 1 } : { from: currOpacity ?? 1, to: 0 };\n\n graphic.setAttributes({\n baseOpacity: opacityMap.from\n } as any);\n\n graphic.animate().to({ baseOpacity: opacityMap.to }, duration, easing as EasingType);\n\n return true;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IGraphic } from '@visactor/vrender-core';
|
|
2
|
+
import type { IPointLike } from '@visactor/vutils';
|
|
3
|
+
import type { ICharacter } from '../../../story/character';
|
|
4
|
+
import type { IMoveParams, IMoveToParams } from '../interface/appear-action';
|
|
5
|
+
export declare function moveTo(character: ICharacter, animation: IMoveToParams, destination: IPointLike): void;
|
|
6
|
+
export declare function moveOut(character: ICharacter, animation: IMoveParams, effect: string): void;
|
|
7
|
+
export declare function _moveOut(graphic: IGraphic, params: IMoveParams): boolean;
|
|
8
|
+
export declare function moveIn(character: ICharacter, animation: IMoveParams, effect: string): void;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { getCharacterParentGraphic } from "./common";
|
|
2
|
+
|
|
3
|
+
import { canDoGraphicAnimation } from "../component/utils";
|
|
4
|
+
|
|
5
|
+
export function moveTo(character, animation, destination) {
|
|
6
|
+
const graphic = getCharacterParentGraphic(character);
|
|
7
|
+
if (graphic) {
|
|
8
|
+
const {duration: duration, easing: easing} = animation;
|
|
9
|
+
destination && graphic.animate().to(destination, duration, easing);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function moveOut(character, animation, effect) {
|
|
14
|
+
_moveOut(getCharacterParentGraphic(character), animation);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function _moveOut(graphic, params) {
|
|
18
|
+
var _a, _b, _c, _d;
|
|
19
|
+
if (!canDoGraphicAnimation(graphic, params)) return !1;
|
|
20
|
+
const {move: move = {}} = params, to = null !== (_a = move.pos) && void 0 !== _a ? _a : params.pos, duration = null !== (_b = move.duration) && void 0 !== _b ? _b : params.duration, easing = null !== (_c = move.easing) && void 0 !== _c ? _c : params.easing, isVariableSpeed = null === (_d = move.isVariableSpeed) || void 0 === _d || _d;
|
|
21
|
+
let toX = graphic.attribute.x, toY = graphic.attribute.y;
|
|
22
|
+
const width = Math.abs(graphic.AABBBounds.x2 - graphic.AABBBounds.x1), height = Math.abs(graphic.AABBBounds.y2 - graphic.AABBBounds.y1);
|
|
23
|
+
if (isVariableSpeed) switch (to) {
|
|
24
|
+
case "right":
|
|
25
|
+
toX = graphic.parent.width;
|
|
26
|
+
break;
|
|
27
|
+
|
|
28
|
+
case "left":
|
|
29
|
+
toX = -width;
|
|
30
|
+
break;
|
|
31
|
+
|
|
32
|
+
case "bottom":
|
|
33
|
+
toY = graphic.parent.height + height;
|
|
34
|
+
break;
|
|
35
|
+
|
|
36
|
+
case "top":
|
|
37
|
+
toY = -height;
|
|
38
|
+
} else {
|
|
39
|
+
const distance = Math.max(graphic.parent.width, graphic.parent.height);
|
|
40
|
+
switch (to) {
|
|
41
|
+
case "right":
|
|
42
|
+
toX += distance;
|
|
43
|
+
break;
|
|
44
|
+
|
|
45
|
+
case "left":
|
|
46
|
+
toX += -distance;
|
|
47
|
+
break;
|
|
48
|
+
|
|
49
|
+
case "bottom":
|
|
50
|
+
toY += distance;
|
|
51
|
+
break;
|
|
52
|
+
|
|
53
|
+
case "top":
|
|
54
|
+
toY += -distance;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return graphic.animate().to({
|
|
58
|
+
x: toX,
|
|
59
|
+
y: toY
|
|
60
|
+
}, duration, easing).onEnd((() => {
|
|
61
|
+
graphic.setAttributes({
|
|
62
|
+
visible: !1,
|
|
63
|
+
visibleAll: !1
|
|
64
|
+
});
|
|
65
|
+
})), !0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function moveIn(character, animation, effect) {
|
|
69
|
+
_moveIn(getCharacterParentGraphic(character), animation);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function _moveIn(graphic, params) {
|
|
73
|
+
var _a, _b, _c, _d, _e;
|
|
74
|
+
if (!canDoGraphicAnimation(graphic, params)) return !1;
|
|
75
|
+
const {move: move = {}} = params, from = null !== (_b = null !== (_a = move.pos) && void 0 !== _a ? _a : params.pos) && void 0 !== _b ? _b : 1, duration = null !== (_c = move.duration) && void 0 !== _c ? _c : params.duration, easing = null !== (_d = move.easing) && void 0 !== _d ? _d : params.easing, isVariableSpeed = null === (_e = move.isVariableSpeed) || void 0 === _e || _e, width = Math.abs(graphic.AABBBounds.x2 - graphic.AABBBounds.x1), height = Math.abs(graphic.AABBBounds.y2 - graphic.AABBBounds.y1);
|
|
76
|
+
let fromX = graphic.attribute.x, fromY = graphic.attribute.y;
|
|
77
|
+
if (isVariableSpeed) switch (from) {
|
|
78
|
+
case "right":
|
|
79
|
+
fromX = graphic.parent.width;
|
|
80
|
+
break;
|
|
81
|
+
|
|
82
|
+
case "left":
|
|
83
|
+
fromX = -width;
|
|
84
|
+
break;
|
|
85
|
+
|
|
86
|
+
case "bottom":
|
|
87
|
+
fromY = graphic.parent.height + height;
|
|
88
|
+
break;
|
|
89
|
+
|
|
90
|
+
case "top":
|
|
91
|
+
fromY = -height;
|
|
92
|
+
break;
|
|
93
|
+
|
|
94
|
+
case "top-right":
|
|
95
|
+
fromY = -height, fromX = graphic.parent.width;
|
|
96
|
+
break;
|
|
97
|
+
|
|
98
|
+
case "top-left":
|
|
99
|
+
fromY = -height, fromX = -width;
|
|
100
|
+
break;
|
|
101
|
+
|
|
102
|
+
case "bottom-left":
|
|
103
|
+
fromY = graphic.parent.height + height, fromX = -width;
|
|
104
|
+
break;
|
|
105
|
+
|
|
106
|
+
case "bottom-right":
|
|
107
|
+
fromY = graphic.parent.height + height, fromX = graphic.parent.width;
|
|
108
|
+
} else {
|
|
109
|
+
const distance = Math.max(graphic.parent.width, graphic.parent.height);
|
|
110
|
+
switch (from) {
|
|
111
|
+
case "right":
|
|
112
|
+
fromX += distance;
|
|
113
|
+
break;
|
|
114
|
+
|
|
115
|
+
case "left":
|
|
116
|
+
fromX += -distance;
|
|
117
|
+
break;
|
|
118
|
+
|
|
119
|
+
case "bottom":
|
|
120
|
+
fromY += distance;
|
|
121
|
+
break;
|
|
122
|
+
|
|
123
|
+
case "top":
|
|
124
|
+
fromY += -distance;
|
|
125
|
+
break;
|
|
126
|
+
|
|
127
|
+
case "top-right":
|
|
128
|
+
fromX += distance, fromY += -distance;
|
|
129
|
+
break;
|
|
130
|
+
|
|
131
|
+
case "top-left":
|
|
132
|
+
fromX += -distance, fromY += -distance;
|
|
133
|
+
break;
|
|
134
|
+
|
|
135
|
+
case "bottom-left":
|
|
136
|
+
fromY += distance, fromX += -distance;
|
|
137
|
+
break;
|
|
138
|
+
|
|
139
|
+
case "bottom-right":
|
|
140
|
+
fromX += distance, fromY += distance;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return graphic.animate().from({
|
|
144
|
+
x: fromX,
|
|
145
|
+
y: fromY
|
|
146
|
+
}, duration, easing), !0;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=move-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/common/move-processor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,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QAAQ,CAAC;gBACnB,MAAM;YACR,KAAK,WAAW;gBAEd,KAAK,IAAI,QAAQ,CAAC;gBAClB,KAAK,IAAI,CAAC,QAAQ,CAAC;gBACnB,MAAM;YACR,KAAK,UAAU;gBAEb,KAAK,IAAI,CAAC,QAAQ,CAAC;gBACnB,KAAK,IAAI,CAAC,QAAQ,CAAC;gBACnB,MAAM;YACR,KAAK,aAAa;gBAEhB,KAAK,IAAI,QAAQ,CAAC;gBAClB,KAAK,IAAI,CAAC,QAAQ,CAAC;gBACnB,MAAM;YACR,KAAK,cAAc;gBAEjB,KAAK,IAAI,QAAQ,CAAC;gBAClB,KAAK,IAAI,QAAQ,CAAC;gBAClB,MAAM;SACT;KACF;IAED,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAoB,CAAC,CAAC;IAC/E,OAAO,IAAI,CAAC;AACd,CAAC","file":"move-processor.js","sourcesContent":["import type { EasingType, IGraphic } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport { isObject } from '@visactor/vutils';\nimport type { ICharacter } from '../../../story/character';\nimport type { IMoveParams, IMoveToParams } from '../interface/appear-action';\nimport { getCharacterParentGraphic } from './common';\nimport { canDoGraphicAnimation } from '../component/utils';\n\nexport function moveTo(character: ICharacter, animation: IMoveToParams, destination: IPointLike) {\n const graphic = getCharacterParentGraphic(character);\n if (graphic) {\n const { duration, easing } = animation;\n if (destination) {\n graphic.animate().to(destination, duration, easing as EasingType);\n }\n }\n}\n\nexport function moveOut(character: ICharacter, animation: IMoveParams, effect: string) {\n const graphic = getCharacterParentGraphic(character);\n _moveOut(graphic, animation as any);\n}\nexport function _moveOut(graphic: IGraphic, params: IMoveParams) {\n if (!canDoGraphicAnimation(graphic, params)) {\n return false;\n }\n const { move = {} } = params;\n const to = move.pos ?? params.pos;\n const duration = move.duration ?? params.duration;\n const easing = move.easing ?? params.easing;\n const isVariableSpeed = move.isVariableSpeed ?? true;\n\n let toX = graphic.attribute.x;\n let toY = graphic.attribute.y;\n\n // 图形宽高\n const width = Math.abs(graphic.AABBBounds.x2 - graphic.AABBBounds.x1);\n const height = Math.abs(graphic.AABBBounds.y2 - graphic.AABBBounds.y1);\n\n if (isVariableSpeed) {\n // 同时抵达边缘, 速度不同.\n switch (to) {\n case 'right':\n // 画布容器宽度\n toX = graphic.parent.width;\n break;\n case 'left':\n // 负的图形宽度\n toX = -width;\n break;\n case 'bottom':\n // 容器高度 + 图形高度\n toY = graphic.parent.height + height;\n break;\n case 'top':\n // 负的图形高度\n toY = -height;\n break;\n }\n } else {\n // 速度相同, 相对位置不变.\n const distance = Math.max(graphic.parent.width, graphic.parent.height);\n switch (to) {\n case 'right':\n toX += distance;\n break;\n case 'left':\n toX += -distance;\n break;\n case 'bottom':\n toY += distance;\n break;\n case 'top':\n toY += -distance;\n break;\n }\n }\n graphic\n .animate()\n .to({ x: toX, y: toY }, duration, easing as EasingType)\n // 最终不显示\n .onEnd(() => {\n graphic.setAttributes({ visible: false, visibleAll: false } as any);\n });\n return true;\n}\n\nexport function moveIn(character: ICharacter, animation: IMoveParams, effect: string) {\n const graphic = getCharacterParentGraphic(character);\n _moveIn(graphic, animation as any);\n}\n\nfunction _moveIn(graphic: IGraphic, params: IMoveParams) {\n if (!canDoGraphicAnimation(graphic, params)) {\n return false;\n }\n\n const { move = {} } = params;\n const from = move.pos ?? params.pos ?? 1;\n const duration = move.duration ?? params.duration;\n const easing = move.easing ?? params.easing;\n const isVariableSpeed = move.isVariableSpeed ?? true;\n\n // 图形宽高\n const width = Math.abs(graphic.AABBBounds.x2 - graphic.AABBBounds.x1);\n const height = Math.abs(graphic.AABBBounds.y2 - graphic.AABBBounds.y1);\n\n let fromX = graphic.attribute.x;\n let fromY = graphic.attribute.y;\n if (isVariableSpeed) {\n // 同时从边缘进入, 速度不同, 同时抵达目标.\n switch (from) {\n case 'right':\n // 图形左边缘为起点\n fromX = graphic.parent.width;\n break;\n case 'left':\n // 图形右边缘为起点\n fromX = -width;\n break;\n case 'bottom':\n // 从下往上进入\n fromY = graphic.parent.height + height;\n break;\n case 'top':\n // 从上往下进入\n fromY = -height;\n break;\n case 'top-right':\n // 从右上进入 ↗️\n fromY = -height;\n fromX = graphic.parent.width;\n break;\n case 'top-left':\n // 从左上进入 ↖️\n fromY = -height;\n fromX = -width;\n break;\n case 'bottom-left':\n // 从左下进入 ↙️\n fromY = graphic.parent.height + height;\n fromX = -width;\n break;\n case 'bottom-right':\n // 从右下进入 ↘️\n fromY = graphic.parent.height + height;\n fromX = graphic.parent.width;\n break;\n }\n } else {\n // 速度相同, 相对位置不变, 但不同时出现.\n const distance = Math.max(graphic.parent.width, graphic.parent.height);\n switch (from) {\n case 'right':\n // 从右往左进入\n fromX += distance;\n break;\n case 'left':\n // 从左往右进入\n fromX += -distance;\n break;\n case 'bottom':\n // 从下往上进入\n fromY += distance;\n break;\n case 'top':\n // 从上往下进入\n fromY += -distance;\n break;\n case 'top-right':\n // 从右上进入 ↗️\n fromX += distance;\n fromY += -distance;\n break;\n case 'top-left':\n // 从左上进入 ↖️\n fromX += -distance;\n fromY += -distance;\n break;\n case 'bottom-left':\n // 从左下进入 ↙️\n fromY += distance;\n fromX += -distance;\n break;\n case 'bottom-right':\n // 从右下进入 ↘️\n fromX += distance;\n fromY += distance;\n break;\n }\n }\n\n graphic.animate().from({ x: fromX, y: fromY }, duration, easing as EasingType);\n return true;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ICharacter } from '../../../story/character';
|
|
2
|
+
import type { IFadeInParams, IScaleToParams } from '../interface/appear-action';
|
|
3
|
+
export declare function scaleTo(character: ICharacter, animation: IScaleToParams, scaleTo: {
|
|
4
|
+
scaleX: number;
|
|
5
|
+
scaleY: number;
|
|
6
|
+
}): void;
|
|
7
|
+
export declare function scaleIn(character: ICharacter, animation: IFadeInParams, effect: string): void;
|
|
8
|
+
export declare function scaleOut(character: ICharacter, animation: IFadeInParams, effect: string): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getCharacterByEffect, getCharacterParentGraphic } from "./common";
|
|
2
|
+
|
|
3
|
+
import { canDoGraphicAnimation } from "../component/utils";
|
|
4
|
+
|
|
5
|
+
export function scaleTo(character, animation, scaleTo) {
|
|
6
|
+
const graphic = getCharacterParentGraphic(character);
|
|
7
|
+
if (graphic) {
|
|
8
|
+
const {duration: duration, easing: easing} = animation;
|
|
9
|
+
scaleTo && graphic.animate().to(scaleTo, duration, easing);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function scaleIn(character, animation, effect) {
|
|
14
|
+
getCharacterByEffect(character, effect).forEach((graphic => _scale(graphic, animation, !0)));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function scaleOut(character, animation, effect) {
|
|
18
|
+
getCharacterByEffect(character, effect).forEach((graphic => _scale(graphic, animation, !1)));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function _scale(graphic, params, appear) {
|
|
22
|
+
var _a, _b, _c, _d;
|
|
23
|
+
if (!canDoGraphicAnimation(graphic, params)) return !1;
|
|
24
|
+
const {scale: scale = {}} = params, ratio = null !== (_b = null !== (_a = scale.ratio) && void 0 !== _a ? _a : params.ratio) && void 0 !== _b ? _b : 1, duration = null !== (_c = scale.duration) && void 0 !== _c ? _c : params.duration, easing = null !== (_d = scale.easing) && void 0 !== _d ? _d : params.easing, currScaleX = graphic.attribute.scaleX, currScaleY = graphic.attribute.scaleY, opacityMap = appear ? {
|
|
25
|
+
fromX: 0,
|
|
26
|
+
fromY: 0,
|
|
27
|
+
toX: null != currScaleX ? currScaleX : ratio,
|
|
28
|
+
toY: null != currScaleY ? currScaleY : ratio
|
|
29
|
+
} : {
|
|
30
|
+
fromX: null != currScaleX ? currScaleX : ratio,
|
|
31
|
+
fromY: null != currScaleY ? currScaleY : ratio,
|
|
32
|
+
toX: 0,
|
|
33
|
+
toY: 0
|
|
34
|
+
};
|
|
35
|
+
return graphic.setAttributes({
|
|
36
|
+
scaleX: opacityMap.fromX,
|
|
37
|
+
scaleY: opacityMap.fromY
|
|
38
|
+
}), graphic.animate().to({
|
|
39
|
+
scaleX: opacityMap.toX,
|
|
40
|
+
scaleY: opacityMap.toY
|
|
41
|
+
}, duration, easing), !0;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=scale-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/common/scale-processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,UAAU,OAAO,CAAC,SAAqB,EAAE,SAAyB,EAAE,OAA2C;IACnH,MAAM,OAAO,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;IACrD,IAAI,OAAO,EAAE;QACX,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QACvC,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAoB,CAAC,CAAC;SAC/D;KACF;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,SAAqB,EAAE,SAAwB,EAAE,MAAc;IACrF,MAAM,QAAQ,GAAG,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAe,CAAC;IACvE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,SAAgB,EAAE,IAAI,CAAC,CAAC,CAAC;AACvE,CAAC;AACD,MAAM,UAAU,QAAQ,CAAC,SAAqB,EAAE,SAAwB,EAAE,MAAc;IACtF,MAAM,QAAQ,GAAG,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAe,CAAC;IAC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AU,CAAC,KAAK,EAAE,CAAC,CAAC;IAC9E,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE3F,OAAO,IAAI,CAAC;AACd,CAAC","file":"scale-processor.js","sourcesContent":["import type { EasingType, IGraphic } from '@visactor/vrender-core';\nimport type { ICharacter } from '../../../story/character';\nimport { getCharacterByEffect, getCharacterParentGraphic } from './common';\nimport { canDoGraphicAnimation } from '../component/utils';\nimport type { IFadeInParams, IScaleInParams, IScaleToParams } from '../interface/appear-action';\n\nexport function scaleTo(character: ICharacter, animation: IScaleToParams, scaleTo: { scaleX: number; scaleY: number }) {\n const graphic = getCharacterParentGraphic(character);\n if (graphic) {\n const { duration, easing } = animation;\n if (scaleTo) {\n graphic.animate().to(scaleTo, duration, easing as EasingType);\n }\n }\n}\n\nexport function scaleIn(character: ICharacter, animation: IFadeInParams, effect: string) {\n const graphics = getCharacterByEffect(character, effect) as IGraphic[];\n graphics.forEach(graphic => _scale(graphic, animation as any, true));\n}\nexport function scaleOut(character: ICharacter, animation: IFadeInParams, effect: string) {\n const graphics = getCharacterByEffect(character, effect) as IGraphic[];\n graphics.forEach(graphic => _scale(graphic, animation as any, false));\n}\n\nfunction _scale(graphic: IGraphic, params: IScaleInParams, appear: boolean): boolean {\n if (!canDoGraphicAnimation(graphic, params)) {\n return false;\n }\n const { scale = {} } = params;\n const ratio = scale.ratio ?? params.ratio ?? 1;\n const duration = scale.duration ?? params.duration;\n const easing = scale.easing ?? params.easing;\n\n const currScaleX = graphic.attribute.scaleX;\n const currScaleY = graphic.attribute.scaleY;\n const opacityMap = appear\n ? { fromX: 0, fromY: 0, toX: currScaleX ?? ratio, toY: currScaleY ?? ratio }\n : { fromX: currScaleX ?? ratio, fromY: currScaleY ?? ratio, toX: 0, toY: 0 };\n\n graphic.setAttributes({ scaleX: opacityMap.fromX, scaleY: opacityMap.fromY });\n graphic.animate().to({ scaleX: opacityMap.toX, scaleY: opacityMap.toY }, duration, easing);\n\n return true;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ICharacter } from '../../../story/character';
|
|
2
|
+
import type { IFadeInParams } from '../interface/appear-action';
|
|
3
|
+
export declare function wipeIn(character: ICharacter, animation: IFadeInParams, effect: string): void;
|
|
4
|
+
export declare function wipeOut(character: ICharacter, animation: IFadeInParams, effect: string): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getCharacterParentGraphic } from "./common";
|
|
2
|
+
|
|
3
|
+
import { canDoGraphicAnimation } from "../component/utils";
|
|
4
|
+
|
|
5
|
+
const Direction = {
|
|
6
|
+
right: 0,
|
|
7
|
+
left: 1,
|
|
8
|
+
top: 2,
|
|
9
|
+
bottom: 3
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function wipeIn(character, animation, effect) {
|
|
13
|
+
_wipe(getCharacterParentGraphic(character), animation, !0);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function wipeOut(character, animation, effect) {
|
|
17
|
+
_wipe(getCharacterParentGraphic(character), animation, !1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function _wipe(graphic, params, appear) {
|
|
21
|
+
var _a, _b, _c, _d;
|
|
22
|
+
if (!canDoGraphicAnimation(graphic, params)) return !1;
|
|
23
|
+
const {wipe: wipe = {}} = params, from = null !== (_b = null !== (_a = wipe.from) && void 0 !== _a ? _a : params.from) && void 0 !== _b ? _b : "right", duration = null !== (_c = wipe.duration) && void 0 !== _c ? _c : params.duration, easing = null !== (_d = wipe.easing) && void 0 !== _d ? _d : params.easing;
|
|
24
|
+
let fromRatio = 0, toRatio = 1;
|
|
25
|
+
return appear || ([fromRatio, toRatio] = [ toRatio, fromRatio ]), graphic.setAttributes({
|
|
26
|
+
wipeDirection: Direction[from],
|
|
27
|
+
wipeRatio: fromRatio
|
|
28
|
+
}), graphic.animate().to({
|
|
29
|
+
wipeRatio: toRatio
|
|
30
|
+
}, duration, easing).onEnd((() => {
|
|
31
|
+
graphic.setAttributes({
|
|
32
|
+
wipeRatio: toRatio
|
|
33
|
+
});
|
|
34
|
+
})), !0;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=wipe-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/common/wipe-processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,MAAM,SAAS,GAAQ;IACrB,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,GAAG,EAAE,CAAC;IACN,MAAM,EAAE,CAAC;CACV,CAAC;AAEF,MAAM,UAAU,MAAM,CAAC,SAAqB,EAAE,SAAwB,EAAE,MAAc;IACpF,MAAM,OAAO,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;IACrD,KAAK,CAAC,OAAO,EAAE,SAAgB,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AACD,MAAM,UAAU,OAAO,CAAC,SAAqB,EAAE,SAAwB,EAAE,MAAc;IACrF,MAAM,OAAO,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;IACrD,KAAK,CAAC,OAAO,EAAE,SAAgB,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC;AACD,SAAS,KAAK,CAAC,OAAiB,EAAE,MAAqB,EAAE,MAAe;;IACtE,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;QAC3C,OAAO,KAAK,CAAC;KACd;IAED,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,IAAI,GAAG,MAAA,MAAA,IAAI,CAAC,IAAI,mCAAI,MAAM,CAAC,IAAI,mCAAI,OAAO,CAAC;IACjD,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,MAAM,CAAC,QAAQ,CAAC;IAClD,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,MAAM,CAAC,MAAM,CAAC;IAE5C,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,CAAC,MAAM,EAAE;QACX,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;KAC7C;IAED,OAAO,CAAC,aAAa,CAAC;QACpB,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC;QAC9B,SAAS,EAAE,SAAS;KACd,CAAC,CAAC;IACV,OAAO;SACJ,OAAO,EAAE;SACT,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC;SAC5C,KAAK,CAAC,GAAG,EAAE;QACV,OAAO,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,OAAO,EAAS,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IACL,OAAO,IAAI,CAAC;AACd,CAAC","file":"wipe-processor.js","sourcesContent":["import type { IGraphic } from '@visactor/vrender-core';\nimport type { ICharacter } from '../../../story/character';\nimport { getCharacterParentGraphic } from './common';\nimport { canDoGraphicAnimation } from '../component/utils';\nimport type { IFadeInParams, IWipeInParams } from '../interface/appear-action';\nimport { IScaleInParams } from '../interface/appear-action';\n\nconst Direction: any = {\n right: 0,\n left: 1,\n top: 2,\n bottom: 3\n};\n\nexport function wipeIn(character: ICharacter, animation: IFadeInParams, effect: string) {\n const graphic = getCharacterParentGraphic(character);\n _wipe(graphic, animation as any, true);\n}\nexport function wipeOut(character: ICharacter, animation: IFadeInParams, effect: string) {\n const graphic = getCharacterParentGraphic(character);\n _wipe(graphic, animation as any, false);\n}\nfunction _wipe(graphic: IGraphic, params: IWipeInParams, appear: boolean) {\n if (!canDoGraphicAnimation(graphic, params)) {\n return false;\n }\n\n const { wipe = {} } = params;\n const from = wipe.from ?? params.from ?? 'right';\n const duration = wipe.duration ?? params.duration;\n const easing = wipe.easing ?? params.easing;\n\n let fromRatio = 0;\n let toRatio = 1;\n if (!appear) {\n [fromRatio, toRatio] = [toRatio, fromRatio];\n }\n\n graphic.setAttributes({\n wipeDirection: Direction[from],\n wipeRatio: fromRatio\n } as any);\n graphic\n .animate()\n .to({ wipeRatio: toRatio }, duration, easing)\n .onEnd(() => {\n graphic.setAttributes({ wipeRatio: toRatio } as any);\n });\n return true;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/common-processor.ts"],"names":[],"mappings":"","file":"common-processor.js","sourcesContent":[""]}
|
|
@@ -1,16 +1,52 @@
|
|
|
1
1
|
import type { ICharacter } from '../../../story/character';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IActionSpec } from '../../../story/interface';
|
|
3
3
|
import { ActionProcessorItem } from '../processor-item';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import type { IComponentBounceAction, IComponentMoveToAction, IComponentScaleToAction, IComponentStyleAction } from '../interface/style-action';
|
|
5
|
+
import { scaleIn } from '../common/scale-processor';
|
|
6
|
+
import { moveIn } from '../common/move-processor';
|
|
7
|
+
export declare class CommonVisibilityActionProcessor extends ActionProcessorItem {
|
|
8
|
+
name: string;
|
|
8
9
|
constructor();
|
|
9
|
-
getStartTimeAndDuration(action:
|
|
10
|
+
getStartTimeAndDuration(action: IActionSpec): {
|
|
10
11
|
startTime: number;
|
|
11
12
|
duration: number;
|
|
12
13
|
};
|
|
13
|
-
run(character: ICharacter, actionSpec:
|
|
14
|
-
getEffectFunc(effect: string): typeof scaleIn;
|
|
14
|
+
run(character: ICharacter, actionSpec: IActionSpec): void;
|
|
15
|
+
getEffectFunc(effect: string, appear: boolean): typeof scaleIn | typeof moveIn;
|
|
16
|
+
}
|
|
17
|
+
export declare class CommonStyleActionProcessor extends ActionProcessorItem {
|
|
18
|
+
name: 'style';
|
|
19
|
+
constructor();
|
|
20
|
+
getStartTimeAndDuration(action: IActionSpec): {
|
|
21
|
+
startTime: number;
|
|
22
|
+
duration: number;
|
|
23
|
+
};
|
|
24
|
+
run(character: ICharacter, actionSpec: IComponentStyleAction): void;
|
|
25
|
+
}
|
|
26
|
+
export declare class CommonMoveToActionProcessor extends ActionProcessorItem {
|
|
27
|
+
name: 'moveTo';
|
|
28
|
+
constructor();
|
|
29
|
+
getStartTimeAndDuration(action: IActionSpec): {
|
|
30
|
+
startTime: number;
|
|
31
|
+
duration: number;
|
|
32
|
+
};
|
|
33
|
+
run(character: ICharacter, actionSpec: IComponentMoveToAction): void;
|
|
34
|
+
}
|
|
35
|
+
export declare class CommonScaleToActionProcessor extends ActionProcessorItem {
|
|
36
|
+
name: 'scaleTo';
|
|
37
|
+
constructor();
|
|
38
|
+
getStartTimeAndDuration(action: IActionSpec): {
|
|
39
|
+
startTime: number;
|
|
40
|
+
duration: number;
|
|
41
|
+
};
|
|
42
|
+
run(character: ICharacter, actionSpec: IComponentScaleToAction): void;
|
|
43
|
+
}
|
|
44
|
+
export declare class CommonBounceActionProcessor extends ActionProcessorItem {
|
|
45
|
+
name: 'bounce';
|
|
46
|
+
constructor();
|
|
47
|
+
getStartTimeAndDuration(action: IActionSpec): {
|
|
48
|
+
startTime: number;
|
|
49
|
+
duration: number;
|
|
50
|
+
};
|
|
51
|
+
run(character: ICharacter, actionSpec: IComponentBounceAction): void;
|
|
15
52
|
}
|
|
16
|
-
export {};
|