@visactor/vstory 0.0.5 → 0.0.6
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/README.md +13 -0
- package/cjs/constants/character.d.ts +2 -1
- package/cjs/constants/character.js +1 -1
- package/cjs/constants/character.js.map +1 -1
- package/cjs/dsl/types/index.d.ts +1 -0
- package/cjs/dsl/types/index.js.map +1 -1
- package/cjs/dsl/utils/datum.js +2 -1
- package/cjs/dsl/utils/flicker.js +1 -2
- package/cjs/edit/const.d.ts +1 -3
- package/cjs/edit/const.js +1 -0
- package/cjs/edit/const.js.map +1 -1
- package/cjs/edit/edit-action.d.ts +9 -0
- package/cjs/edit/edit-action.js +61 -5
- package/cjs/edit/edit-action.js.map +1 -1
- package/cjs/edit/edit-component/base-selection.d.ts +8 -3
- package/cjs/edit/edit-component/base-selection.js +31 -5
- package/cjs/edit/edit-component/base-selection.js.map +1 -1
- package/cjs/edit/edit-component/box-selection.js +1 -1
- package/cjs/edit/edit-component/chart-selection.d.ts +15 -0
- package/cjs/edit/edit-component/chart-selection.js +39 -0
- package/cjs/edit/edit-component/chart-selection.js.map +1 -0
- package/cjs/edit/edit-component/common.d.ts +1 -11
- package/cjs/edit/edit-component/common.js +1 -30
- package/cjs/edit/edit-component/common.js.map +1 -1
- package/cjs/edit/edit-component/edit-control/richtext-control.d.ts +19 -0
- package/cjs/edit/edit-component/edit-control/richtext-control.js +34 -0
- package/cjs/edit/edit-component/edit-control/richtext-control.js.map +1 -0
- package/cjs/edit/edit-component/edit-control/richtext-transform-control.d.ts +2 -3
- package/cjs/edit/edit-component/edit-control/richtext-transform-control.js +30 -32
- package/cjs/edit/edit-component/edit-control/richtext-transform-control.js.map +1 -1
- package/cjs/edit/edit-component/edit-control/transform-control.d.ts +4 -2
- package/cjs/edit/edit-component/edit-control/transform-control.js +10 -6
- package/cjs/edit/edit-component/edit-control/transform-control.js.map +1 -1
- package/cjs/edit/edit-component/edit-control/transform-drag.d.ts +1 -0
- package/cjs/edit/edit-component/edit-control/transform-drag.js +4 -2
- package/cjs/edit/edit-component/edit-control/transform-drag.js.map +1 -1
- package/cjs/edit/edit-component/image-selection.d.ts +1 -2
- package/cjs/edit/edit-component/image-selection.js +3 -6
- package/cjs/edit/edit-component/image-selection.js.map +1 -1
- package/cjs/edit/edit-component/index.js +4 -5
- package/cjs/edit/edit-component/index.js.map +1 -1
- package/cjs/edit/edit-component/mixin/richtext.d.ts +21 -0
- package/cjs/edit/edit-component/mixin/richtext.js +26 -0
- package/cjs/edit/edit-component/mixin/richtext.js.map +1 -0
- package/cjs/edit/edit-component/rect-selection.d.ts +8 -12
- package/cjs/edit/edit-component/rect-selection.js +12 -17
- package/cjs/edit/edit-component/rect-selection.js.map +1 -1
- package/cjs/edit/edit-component/richtext-selection-common.d.ts +19 -0
- package/cjs/edit/edit-component/richtext-selection-common.js +35 -0
- package/cjs/edit/edit-component/richtext-selection-common.js.map +1 -0
- package/cjs/edit/edit-component/richtext-selection.d.ts +0 -2
- package/cjs/edit/edit-component/richtext-selection.js +0 -6
- package/cjs/edit/edit-component/richtext-selection.js.map +1 -1
- package/cjs/edit/edit-component/shape-selection.d.ts +11 -0
- package/cjs/edit/edit-component/shape-selection.js +36 -0
- package/cjs/edit/edit-component/shape-selection.js.map +1 -0
- package/cjs/edit/edit-component/text-selection.d.ts +0 -3
- package/cjs/edit/edit-component/text-selection.js +2 -9
- package/cjs/edit/edit-component/text-selection.js.map +1 -1
- package/cjs/edit/edit.d.ts +5 -2
- package/cjs/edit/edit.js +20 -5
- package/cjs/edit/edit.js.map +1 -1
- package/cjs/edit/interface.d.ts +6 -1
- package/cjs/edit/interface.js +3 -1
- package/cjs/edit/interface.js.map +1 -1
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +3 -1
- package/cjs/index.js.map +1 -1
- package/cjs/player/interface/player.js +1 -1
- package/cjs/player/interface/scheduler.js +1 -1
- package/cjs/player/player.js +6 -2
- package/cjs/player/player.js.map +1 -1
- package/cjs/player/processor/chart/common/chartAppear.d.ts +2 -2
- package/cjs/player/processor/chart/common/chartAppear.js.map +1 -1
- package/cjs/player/processor/chart/common/commonAppear.d.ts +3 -3
- package/cjs/player/processor/chart/common/commonAppear.js.map +1 -1
- package/cjs/player/processor/chart/component/axisAppear.d.ts +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.map +1 -1
- package/cjs/player/processor/chart/component/labelAppear.d.ts +2 -2
- package/cjs/player/processor/chart/component/labelAppear.js.map +1 -1
- package/cjs/player/processor/chart/rankingBar/rankingBar.d.ts +29 -0
- package/cjs/player/processor/chart/rankingBar/rankingBar.js +54 -0
- package/cjs/player/processor/chart/rankingBar/rankingBar.js.map +1 -0
- 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/transformArcVisibility.d.ts +2 -2
- package/cjs/player/processor/chart/seriesmark/transformArcVisibility.js.map +1 -1
- package/cjs/player/processor/chart/seriesmark/transformLineVisibility.d.ts +2 -2
- package/cjs/player/processor/chart/seriesmark/transformLineVisibility.js.map +1 -1
- package/cjs/player/processor/chart/seriesmark/transformRectVisibility.d.ts +2 -2
- package/cjs/player/processor/chart/seriesmark/transformRectVisibility.js.map +1 -1
- package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.d.ts +2 -2
- package/cjs/player/processor/chart/seriesmark/transformSymbolVisibility.js.map +1 -1
- package/cjs/player/processor/chart/seriesmark/transformTextVisibility.d.ts +2 -2
- package/cjs/player/processor/chart/seriesmark/transformTextVisibility.js.map +1 -1
- package/cjs/player/processor/chart/vchart.d.ts +35 -24
- package/cjs/player/processor/chart/vchart.js +88 -60
- package/cjs/player/processor/chart/vchart.js.map +1 -1
- package/cjs/player/processor/common/bounce-processor.js +2 -3
- package/cjs/player/processor/common/bounce-processor.js.map +1 -1
- package/cjs/player/processor/common-processor.js +0 -2
- package/cjs/player/processor/component/common-component.js +21 -21
- package/cjs/player/processor/component/common-component.js.map +1 -1
- package/cjs/player/processor/interface/action-processor.d.ts +1 -1
- package/cjs/player/processor/interface/action-processor.js.map +1 -1
- package/cjs/player/processor/interface/common-action.d.ts +3 -2
- package/cjs/player/processor/interface/common-action.js.map +1 -1
- package/cjs/player/processor/interface/style-action.d.ts +4 -5
- package/cjs/player/processor/interface/style-action.js.map +1 -1
- package/cjs/player/processor/processor-item.js +1 -1
- package/cjs/player/processor/processor.js +1 -1
- package/cjs/player/processor/processor.js.map +1 -1
- package/cjs/player/processor/processorMap.d.ts +9 -0
- package/cjs/player/processor/processorMap.js +7 -1
- package/cjs/player/processor/processorMap.js.map +1 -1
- package/cjs/player/scheduler.js +12 -8
- package/cjs/player/scheduler.js.map +1 -1
- package/cjs/story/canvas/canvas.js +3 -4
- package/cjs/story/canvas/canvas.js.map +1 -1
- package/cjs/story/character/base/base.d.ts +4 -0
- package/cjs/story/character/base/base.js +1 -1
- package/cjs/story/character/base/base.js.map +1 -1
- package/cjs/story/character/chart/character.d.ts +15 -0
- package/cjs/story/character/chart/character.js +55 -19
- package/cjs/story/character/chart/character.js.map +1 -1
- package/cjs/story/character/chart/characters/rankingBar.d.ts +4 -0
- package/cjs/story/character/chart/characters/rankingBar.js +15 -0
- package/cjs/story/character/chart/characters/rankingBar.js.map +1 -0
- package/cjs/story/character/chart/graphic/vchart-graphic-picker.js +6 -8
- package/cjs/story/character/chart/graphic/vchart-graphic-picker.js.map +1 -1
- package/cjs/story/character/chart/graphic/vchart-graphic-render.js +6 -6
- package/cjs/story/character/chart/graphic/vchart-graphic-render.js.map +1 -1
- package/cjs/story/character/chart/graphic/vchart-graphic.d.ts +12 -2
- package/cjs/story/character/chart/graphic/vchart-graphic.js +77 -13
- package/cjs/story/character/chart/graphic/vchart-graphic.js.map +1 -1
- package/cjs/story/character/chart/runtime/common-spec.d.ts +2 -4
- package/cjs/story/character/chart/runtime/common-spec.js +0 -2
- package/cjs/story/character/chart/runtime/common-spec.js.map +1 -1
- package/cjs/story/character/chart/runtime/component-spec.d.ts +4 -3
- package/cjs/story/character/chart/runtime/component-spec.js +7 -5
- package/cjs/story/character/chart/runtime/component-spec.js.map +1 -1
- package/cjs/story/character/chart/temp/constant.d.ts +1 -0
- package/cjs/story/character/chart/temp/constant.js +2 -1
- package/cjs/story/character/chart/temp/constant.js.map +1 -1
- package/cjs/story/character/chart/temp/templates/bar.d.ts +20 -0
- package/cjs/story/character/chart/temp/templates/bar.js +31 -0
- package/cjs/story/character/chart/temp/templates/bar.js.map +1 -0
- package/cjs/story/character/chart/temp/templates/base-temp.d.ts +6 -4
- package/cjs/story/character/chart/temp/templates/base-temp.js +1 -1
- package/cjs/story/character/chart/temp/templates/base-temp.js.map +1 -1
- package/cjs/story/character/chart/temp/templates/ranking-bar-temp.d.ts +8 -0
- package/cjs/story/character/chart/temp/templates/ranking-bar-temp.js +22 -0
- package/cjs/story/character/chart/temp/templates/ranking-bar-temp.js.map +1 -0
- package/cjs/story/character/component/character-group/component-group-graphic-render.d.ts +2 -2
- package/cjs/story/character/component/character-group/component-group-graphic-render.js +3 -3
- package/cjs/story/character/component/character-group/component-group-graphic-render.js.map +1 -1
- package/cjs/story/character/component/character-group/component-group-graphic.d.ts +1 -1
- package/cjs/story/character/component/character-group/component-group-graphic.js +6 -4
- package/cjs/story/character/component/character-group/component-group-graphic.js.map +1 -1
- package/cjs/story/character/component/character.d.ts +5 -1
- package/cjs/story/character/component/character.js +18 -1
- package/cjs/story/character/component/character.js.map +1 -1
- package/cjs/story/character/component/characters/character-image.d.ts +3 -0
- package/cjs/story/character/component/characters/character-image.js +4 -0
- package/cjs/story/character/component/characters/character-image.js.map +1 -1
- package/cjs/story/character/component/characters/character-rect.d.ts +3 -0
- package/cjs/story/character/component/characters/character-rect.js +4 -0
- package/cjs/story/character/component/characters/character-rect.js.map +1 -1
- package/cjs/story/character/component/characters/character-shape.d.ts +4 -0
- package/cjs/story/character/component/characters/character-shape.js +15 -0
- package/cjs/story/character/component/characters/character-shape.js.map +1 -1
- package/cjs/story/character/component/graphic/graphic-base-text.d.ts +2 -1
- package/cjs/story/character/component/graphic/graphic-base-text.js +7 -2
- package/cjs/story/character/component/graphic/graphic-base-text.js.map +1 -1
- package/cjs/story/character/component/graphic/symbol.d.ts +3 -0
- package/cjs/story/character/component/graphic/symbol.js +17 -3
- package/cjs/story/character/component/graphic/symbol.js.map +1 -1
- package/cjs/story/character/dsl-interface.d.ts +2 -0
- package/cjs/story/character/dsl-interface.js.map +1 -1
- package/cjs/story/character/runtime-interface.d.ts +9 -4
- package/cjs/story/character/runtime-interface.js.map +1 -1
- package/cjs/story/character/visactor/character.d.ts +15 -0
- package/cjs/story/character/visactor/character.js +17 -1
- package/cjs/story/character/visactor/character.js.map +1 -1
- package/cjs/story/character/visactor/interface.js.map +1 -1
- package/cjs/story/index.js +5 -2
- package/cjs/story/index.js.map +1 -1
- package/cjs/story/interface/dsl-interface.d.ts +3 -2
- package/cjs/story/interface/dsl-interface.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.js +3 -2
- package/cjs/story/story.js.map +1 -1
- package/cjs/story/utils/layout.d.ts +2 -1
- package/cjs/story/utils/layout.js +2 -2
- package/cjs/story/utils/layout.js.map +1 -1
- package/cjs/story/utils/vchart-pick.d.ts +115 -0
- package/cjs/story/utils/vchart-pick.js +109 -0
- package/cjs/story/utils/vchart-pick.js.map +1 -0
- package/dist/index.js +27003 -87350
- package/dist/index.min.js +3 -3
- package/es/constants/character.d.ts +2 -1
- package/es/constants/character.js +1 -1
- package/es/constants/character.js.map +1 -1
- package/es/dsl/types/index.d.ts +1 -0
- package/es/dsl/types/index.js.map +1 -1
- package/es/dsl/utils/datum.js +2 -1
- package/es/dsl/utils/flicker.js +1 -2
- package/es/edit/const.d.ts +1 -3
- package/es/edit/const.js +1 -0
- package/es/edit/const.js.map +1 -1
- package/es/edit/edit-action.d.ts +9 -0
- package/es/edit/edit-action.js +63 -5
- package/es/edit/edit-action.js.map +1 -1
- package/es/edit/edit-component/base-selection.d.ts +8 -3
- package/es/edit/edit-component/base-selection.js +32 -4
- package/es/edit/edit-component/base-selection.js.map +1 -1
- package/es/edit/edit-component/box-selection.js +1 -1
- package/es/edit/edit-component/chart-selection.d.ts +15 -0
- package/es/edit/edit-component/chart-selection.js +31 -0
- package/es/edit/edit-component/chart-selection.js.map +1 -0
- package/es/edit/edit-component/common.d.ts +1 -11
- package/es/edit/edit-component/common.js +1 -24
- package/es/edit/edit-component/common.js.map +1 -1
- package/es/edit/edit-component/edit-control/richtext-control.d.ts +19 -0
- package/es/edit/edit-component/edit-control/richtext-control.js +28 -0
- package/es/edit/edit-component/edit-control/richtext-control.js.map +1 -0
- package/es/edit/edit-component/edit-control/richtext-transform-control.d.ts +2 -3
- package/es/edit/edit-component/edit-control/richtext-transform-control.js +29 -34
- package/es/edit/edit-component/edit-control/richtext-transform-control.js.map +1 -1
- package/es/edit/edit-component/edit-control/transform-control.d.ts +4 -2
- package/es/edit/edit-component/edit-control/transform-control.js +10 -6
- package/es/edit/edit-component/edit-control/transform-control.js.map +1 -1
- package/es/edit/edit-component/edit-control/transform-drag.d.ts +1 -0
- package/es/edit/edit-component/edit-control/transform-drag.js +4 -2
- package/es/edit/edit-component/edit-control/transform-drag.js.map +1 -1
- package/es/edit/edit-component/image-selection.d.ts +1 -2
- package/es/edit/edit-component/image-selection.js +3 -6
- package/es/edit/edit-component/image-selection.js.map +1 -1
- package/es/edit/edit-component/index.js +7 -9
- package/es/edit/edit-component/index.js.map +1 -1
- package/es/edit/edit-component/mixin/richtext.d.ts +21 -0
- package/es/edit/edit-component/mixin/richtext.js +18 -0
- package/es/edit/edit-component/mixin/richtext.js.map +1 -0
- package/es/edit/edit-component/rect-selection.d.ts +8 -12
- package/es/edit/edit-component/rect-selection.js +13 -20
- package/es/edit/edit-component/rect-selection.js.map +1 -1
- package/es/edit/edit-component/richtext-selection-common.d.ts +19 -0
- package/es/edit/edit-component/richtext-selection-common.js +33 -0
- package/es/edit/edit-component/richtext-selection-common.js.map +1 -0
- package/es/edit/edit-component/richtext-selection.d.ts +0 -2
- package/es/edit/edit-component/richtext-selection.js +0 -6
- package/es/edit/edit-component/richtext-selection.js.map +1 -1
- package/es/edit/edit-component/shape-selection.d.ts +11 -0
- package/es/edit/edit-component/shape-selection.js +30 -0
- package/es/edit/edit-component/shape-selection.js.map +1 -0
- package/es/edit/edit-component/text-selection.d.ts +0 -3
- package/es/edit/edit-component/text-selection.js +1 -10
- package/es/edit/edit-component/text-selection.js.map +1 -1
- package/es/edit/edit.d.ts +5 -2
- package/es/edit/edit.js +21 -4
- package/es/edit/edit.js.map +1 -1
- package/es/edit/interface.d.ts +6 -1
- package/es/edit/interface.js +3 -1
- package/es/edit/interface.js.map +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +7 -1
- package/es/index.js.map +1 -1
- package/es/player/interface/player.js +1 -1
- package/es/player/interface/scheduler.js +1 -1
- package/es/player/player.js +6 -2
- package/es/player/player.js.map +1 -1
- package/es/player/processor/chart/common/chartAppear.d.ts +2 -2
- package/es/player/processor/chart/common/chartAppear.js.map +1 -1
- package/es/player/processor/chart/common/commonAppear.d.ts +3 -3
- package/es/player/processor/chart/common/commonAppear.js.map +1 -1
- package/es/player/processor/chart/component/axisAppear.d.ts +2 -2
- 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.map +1 -1
- package/es/player/processor/chart/component/labelAppear.d.ts +2 -2
- package/es/player/processor/chart/component/labelAppear.js.map +1 -1
- package/es/player/processor/chart/rankingBar/rankingBar.d.ts +29 -0
- package/es/player/processor/chart/rankingBar/rankingBar.js +50 -0
- package/es/player/processor/chart/rankingBar/rankingBar.js.map +1 -0
- package/es/player/processor/chart/seriesmark/commonTransformMarkAppear.d.ts +3 -3
- package/es/player/processor/chart/seriesmark/commonTransformMarkAppear.js.map +1 -1
- package/es/player/processor/chart/seriesmark/transformArcVisibility.d.ts +2 -2
- package/es/player/processor/chart/seriesmark/transformArcVisibility.js.map +1 -1
- package/es/player/processor/chart/seriesmark/transformLineVisibility.d.ts +2 -2
- package/es/player/processor/chart/seriesmark/transformLineVisibility.js.map +1 -1
- package/es/player/processor/chart/seriesmark/transformRectVisibility.d.ts +2 -2
- package/es/player/processor/chart/seriesmark/transformRectVisibility.js.map +1 -1
- package/es/player/processor/chart/seriesmark/transformSymbolVisibility.d.ts +2 -2
- package/es/player/processor/chart/seriesmark/transformSymbolVisibility.js.map +1 -1
- package/es/player/processor/chart/seriesmark/transformTextVisibility.d.ts +2 -2
- package/es/player/processor/chart/seriesmark/transformTextVisibility.js.map +1 -1
- package/es/player/processor/chart/vchart.d.ts +35 -24
- package/es/player/processor/chart/vchart.js +89 -61
- package/es/player/processor/chart/vchart.js.map +1 -1
- package/es/player/processor/common/bounce-processor.js +2 -3
- package/es/player/processor/common/bounce-processor.js.map +1 -1
- package/es/player/processor/common-processor.js +0 -2
- package/es/player/processor/component/common-component.js +21 -21
- package/es/player/processor/component/common-component.js.map +1 -1
- package/es/player/processor/interface/action-processor.d.ts +1 -1
- package/es/player/processor/interface/action-processor.js.map +1 -1
- package/es/player/processor/interface/common-action.d.ts +3 -2
- package/es/player/processor/interface/common-action.js.map +1 -1
- package/es/player/processor/interface/style-action.d.ts +4 -5
- package/es/player/processor/interface/style-action.js.map +1 -1
- package/es/player/processor/processor-item.js +1 -1
- package/es/player/processor/processor.js +1 -1
- package/es/player/processor/processor.js.map +1 -1
- package/es/player/processor/processorMap.d.ts +9 -0
- package/es/player/processor/processorMap.js +8 -0
- package/es/player/processor/processorMap.js.map +1 -1
- package/es/player/scheduler.js +12 -8
- package/es/player/scheduler.js.map +1 -1
- package/es/story/canvas/canvas.js +3 -4
- package/es/story/canvas/canvas.js.map +1 -1
- package/es/story/character/base/base.d.ts +4 -0
- package/es/story/character/base/base.js +1 -1
- package/es/story/character/base/base.js.map +1 -1
- package/es/story/character/chart/character.d.ts +15 -0
- package/es/story/character/chart/character.js +58 -15
- package/es/story/character/chart/character.js.map +1 -1
- package/es/story/character/chart/characters/rankingBar.d.ts +4 -0
- package/es/story/character/chart/characters/rankingBar.js +14 -0
- package/es/story/character/chart/characters/rankingBar.js.map +1 -0
- package/es/story/character/chart/graphic/vchart-graphic-picker.js +6 -8
- package/es/story/character/chart/graphic/vchart-graphic-picker.js.map +1 -1
- package/es/story/character/chart/graphic/vchart-graphic-render.js +7 -7
- package/es/story/character/chart/graphic/vchart-graphic-render.js.map +1 -1
- package/es/story/character/chart/graphic/vchart-graphic.d.ts +12 -2
- package/es/story/character/chart/graphic/vchart-graphic.js +80 -12
- package/es/story/character/chart/graphic/vchart-graphic.js.map +1 -1
- package/es/story/character/chart/runtime/common-spec.d.ts +2 -4
- package/es/story/character/chart/runtime/common-spec.js +0 -2
- package/es/story/character/chart/runtime/common-spec.js.map +1 -1
- package/es/story/character/chart/runtime/component-spec.d.ts +4 -3
- package/es/story/character/chart/runtime/component-spec.js +7 -5
- package/es/story/character/chart/runtime/component-spec.js.map +1 -1
- package/es/story/character/chart/temp/constant.d.ts +1 -0
- package/es/story/character/chart/temp/constant.js +2 -1
- package/es/story/character/chart/temp/constant.js.map +1 -1
- package/es/story/character/chart/temp/templates/bar.d.ts +20 -0
- package/es/story/character/chart/temp/templates/bar.js +27 -0
- package/es/story/character/chart/temp/templates/bar.js.map +1 -0
- package/es/story/character/chart/temp/templates/base-temp.d.ts +6 -4
- package/es/story/character/chart/temp/templates/base-temp.js +1 -1
- package/es/story/character/chart/temp/templates/base-temp.js.map +1 -1
- package/es/story/character/chart/temp/templates/ranking-bar-temp.d.ts +8 -0
- package/es/story/character/chart/temp/templates/ranking-bar-temp.js +18 -0
- package/es/story/character/chart/temp/templates/ranking-bar-temp.js.map +1 -0
- package/es/story/character/component/character-group/component-group-graphic-render.d.ts +2 -2
- package/es/story/character/component/character-group/component-group-graphic-render.js +4 -4
- package/es/story/character/component/character-group/component-group-graphic-render.js.map +1 -1
- package/es/story/character/component/character-group/component-group-graphic.d.ts +1 -1
- package/es/story/character/component/character-group/component-group-graphic.js +5 -3
- package/es/story/character/component/character-group/component-group-graphic.js.map +1 -1
- package/es/story/character/component/character.d.ts +5 -1
- package/es/story/character/component/character.js +18 -1
- package/es/story/character/component/character.js.map +1 -1
- package/es/story/character/component/characters/character-image.d.ts +3 -0
- package/es/story/character/component/characters/character-image.js +4 -0
- package/es/story/character/component/characters/character-image.js.map +1 -1
- package/es/story/character/component/characters/character-rect.d.ts +3 -0
- package/es/story/character/component/characters/character-rect.js +4 -0
- package/es/story/character/component/characters/character-rect.js.map +1 -1
- package/es/story/character/component/characters/character-shape.d.ts +4 -0
- package/es/story/character/component/characters/character-shape.js +15 -0
- package/es/story/character/component/characters/character-shape.js.map +1 -1
- package/es/story/character/component/graphic/graphic-base-text.d.ts +2 -1
- package/es/story/character/component/graphic/graphic-base-text.js +7 -2
- package/es/story/character/component/graphic/graphic-base-text.js.map +1 -1
- package/es/story/character/component/graphic/symbol.d.ts +3 -0
- package/es/story/character/component/graphic/symbol.js +17 -2
- package/es/story/character/component/graphic/symbol.js.map +1 -1
- package/es/story/character/dsl-interface.d.ts +2 -0
- package/es/story/character/dsl-interface.js.map +1 -1
- package/es/story/character/runtime-interface.d.ts +9 -4
- package/es/story/character/runtime-interface.js.map +1 -1
- package/es/story/character/visactor/character.d.ts +15 -0
- package/es/story/character/visactor/character.js +18 -0
- package/es/story/character/visactor/character.js.map +1 -1
- package/es/story/character/visactor/interface.js.map +1 -1
- package/es/story/index.js +7 -3
- package/es/story/index.js.map +1 -1
- package/es/story/interface/dsl-interface.d.ts +3 -2
- package/es/story/interface/dsl-interface.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.js +3 -2
- package/es/story/story.js.map +1 -1
- package/es/story/utils/layout.d.ts +2 -1
- package/es/story/utils/layout.js +2 -2
- package/es/story/utils/layout.js.map +1 -1
- package/es/story/utils/vchart-pick.d.ts +115 -0
- package/es/story/utils/vchart-pick.js +115 -0
- package/es/story/utils/vchart-pick.js.map +1 -0
- package/package.json +11 -10
package/es/player/player.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/player.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/player/player.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,MAAM,OAAO,MAAM;IAAnB;QAEE,WAAM,GAAG,CAAC,CAAC;QAEX,UAAK,GAAW,CAAC,CAAC;QAQlB,UAAK,GAAG,CAAC,EAAU,EAAE,EAAE;YACrB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;gBACjB,OAAO;aACR;YACD,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,GAAG,qBAAqB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1D,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC,CA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iBAAM;gBACL,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACpB;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAEK,aAAa,CAAC,UAAkB,EAAE,GAAW;;YA0BjD,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAED,KAAK;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IAED,OAAO;QACL,OAAO;IACT,CAAC;CACF","file":"player.js","sourcesContent":["import type { IActSpec, IStory } from '../story/interface';\nimport type { ICharacter } from '../story/character';\nimport type { IPlayer } from './interface/player';\nimport type { IActionProcessor } from './processor/interface/action-processor';\nimport { ActionProcessor } from './processor/processor';\nimport { processorMap } from './processor/processorMap';\nimport type { IScheduler } from './interface/scheduler';\nimport { Scheduler } from './scheduler';\nimport { EventEmitter } from '@visactor/vutils';\nimport { createRect } from '@visactor/vrender-core';\n\nexport class Ticker {\n cb?: (delta: number) => void;\n rafIdx = 0;\n running: boolean;\n speed: number = 1;\n start(cb: (t: number) => void) {\n this.stop();\n this.cb = cb;\n this.running = true;\n this._tick(0);\n }\n\n _tick = (lt: number) => {\n if (!this.running) {\n return;\n }\n const ct = Date.now();\n this.rafIdx = requestAnimationFrame(() => this._tick(ct));\n this.cb && this.cb((lt === 0 ? 0 : ct - lt) * this.speed);\n };\n\n stop() {\n this.rafIdx && cancelAnimationFrame(this.rafIdx);\n this.rafIdx = 0;\n this.running = false;\n }\n}\n\nexport class Player extends EventEmitter implements IPlayer {\n protected _story: IStory;\n protected _ticker: Ticker;\n protected _currTime: number;\n // protected _encoder: Encoder;\n protected _actionProcessor: IActionProcessor;\n protected _scheduler: IScheduler;\n\n set speed(speed: number) {\n if (this._scheduler) {\n this._ticker.speed = speed;\n }\n }\n\n get speed(): number {\n return this._ticker ? this._ticker.speed : 1;\n }\n\n constructor(story: IStory, options?: { scaleX?: number; scaleY?: number }) {\n super();\n this._story = story;\n this._ticker = new Ticker();\n this._currTime = 0;\n const stage = this._story.canvas.getStage();\n const scaleX = options?.scaleX ?? 1;\n const scaleY = options?.scaleY ?? 1;\n\n stage.window.setViewBoxTransform(scaleX, 0, 0, scaleY, 0, 0);\n\n // stage.defaultLayer.setAttributes({\n // scaleX,\n // scaleY\n // });\n // const b = stage.defaultLayer.AABBBounds;\n // const width = b.width() * scaleX;\n // const height = b.height() * scaleY;\n // (stage as any).setViewBox({ x1: 0, x2: width, y1: 0, y2: height }, false);\n // const b = this._story.canvas.getStage().defaultLayer.AABBBounds;\n // this._encoder = new Encoder();\n this._actionProcessor = new ActionProcessor(story, processorMap);\n this._scheduler = new Scheduler(this._actionProcessor);\n }\n\n initActs(acts: IActSpec[]) {\n this._scheduler.init(acts);\n }\n\n // 清除当前状态,一般用于回放操作\n reset() {\n this._scheduler.clearState();\n this._story.canvas.getStage().getTimeline().clear();\n this._currTime = 0;\n return;\n }\n\n tickTo(t: number) {\n // console.log(t);\n const lastTime = this._currTime;\n // 如果时间倒退,那就重置,从头开始(需要上层场景树也重置)\n if (lastTime > t) {\n this.reset();\n // this._currTime = 0;\n // this.tickTo(0);\n }\n\n const actions = this._scheduler.getActionsInRange(lastTime, t);\n const characterSet = new Set<ICharacter>();\n actions.forEach(action => {\n const character = this._story.getCharactersById(action.characterId);\n characterSet.add(character);\n this._actionProcessor.doAction(character.spec.type, action.actionSpec.action, character, action.actionSpec);\n });\n\n // 将character show出来\n // TODO 后续放在appear处理,因为现在创建之后就会展示,所以只能先visible为false\n characterSet.forEach(character => {\n character.show();\n });\n\n this._currTime = t;\n\n const stage = this._story.canvas.getStage();\n stage.ticker.tickAt(t);\n stage.render();\n }\n\n play(): void {\n this._ticker.stop();\n this._currTime = 0;\n this.reset();\n const stage = this._story.canvas.getStage();\n // 开启ticker\n stage.ticker.start(true);\n stage.getTimeline().resume();\n\n this._ticker.start(t => {\n let nextT = this._currTime + t;\n const totalTime = this._scheduler.getTotalTime();\n // 时间超过总时长之后,停止ticker执行\n if (nextT >= totalTime) {\n nextT = totalTime;\n this.tickTo(nextT);\n this._ticker.stop();\n this.emit('onstop');\n } else {\n this.tickTo(nextT);\n }\n });\n }\n\n async encodeToVideo(millsecond: number, fps: number): Promise<any> {\n // // if (!this._currChapter) {\n // // return;\n // // }\n // const frameNum = (millsecond / 1000) * fps;\n // const deltaT = 1000 / fps;\n // this.tickTo(0);\n // const objUrl = await this._encoder.exportVideo(frameNum, fps, async i => {\n // const t = deltaT * i;\n // this.tickTo(t);\n // return new Promise((resolve, reject) => {\n // this._canvas\n // .getStage()\n // .window.getContext()\n // .canvas.nativeCanvas.toBlob((blob: any) => {\n // if (blob) {\n // resolve(blob);\n // } else {\n // // console.log('no blob');\n // reject('no blob');\n // }\n // }, `image/png`);\n // });\n // });\n\n // return objUrl;\n return null;\n }\n\n pause(): void {\n this._ticker.stop();\n }\n\n resume(): void {\n this._ticker._tick(this._currTime);\n }\n\n release(): void {\n return;\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
2
2
|
import type { IGroup } from '@visactor/vrender-core';
|
|
3
|
-
export declare const runChartAppear: (instance: IGroup, animation:
|
|
3
|
+
export declare const runChartAppear: (instance: IGroup, animation: IChartVisibilityPayload['animation'], option: {
|
|
4
4
|
disappear: boolean;
|
|
5
5
|
}) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/common/chartAppear.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/common/chartAppear.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,QAAgB,EAChB,SAA+C,EAC/C,MAA8B,EAC9B,EAAE;IACF,QAAQ,SAAS,CAAC,MAAM,EAAE;QACxB,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD;QACD,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD;QACD,OAAO,CAAC,CAAC;YACP,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD;KACF;AACH,CAAC,CAAC","file":"chartAppear.js","sourcesContent":["import type { IChartVisibilityPayload } from '../../interface/appear-action';\nimport type { IGroup } from '@visactor/vrender-core';\nimport { commonFade, commonGrow } from './commonAppear';\n\n// TODO: 区分直角坐标系和极坐标系\nexport const runChartAppear = (\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean }\n) => {\n switch (animation.effect) {\n case 'grow': {\n return commonGrow(instance, animation, option);\n }\n case 'fade': {\n return commonFade(instance, animation, option);\n }\n default: {\n return commonFade(instance, animation, option);\n }\n }\n};\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IGroup } from '@visactor/vrender-core';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const commonFade: (instance: IGroup, animation:
|
|
2
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
3
|
+
export declare const commonFade: (instance: IGroup, animation: IChartVisibilityPayload['animation'], option: {
|
|
4
4
|
disappear: boolean;
|
|
5
5
|
}) => void;
|
|
6
|
-
export declare const commonGrow: (instance: IGroup, animation:
|
|
6
|
+
export declare const commonGrow: (instance: IGroup, animation: IChartVisibilityPayload['animation'], option: {
|
|
7
7
|
disappear: boolean;
|
|
8
8
|
}) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/common/commonAppear.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/common/commonAppear.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAgB,EAChB,SAA+C,EAC/C,MAA8B,EAC9B,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACvC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC;IACnD,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,CAAC,EAAE,CAAC;IAErG,QAAQ,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IACzD,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC1E,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAgB,EAChB,SAA+C,EAC/C,MAA8B,EAC9B,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACvC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC;IAC7C,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC;IAC7C,MAAM,UAAU,GAAG,SAAS;QAC1B,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,CAAC,EAAE,KAAK,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;QACpE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,CAAC,EAAE,GAAG,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,CAAC,EAAE,CAAC;IAEvE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;IAC/E,QAAQ,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;AAC9F,CAAC,CAAC","file":"commonAppear.js","sourcesContent":["import type { IGroup } from '@visactor/vrender-core';\nimport type { IChartVisibilityPayload } from '../../interface/appear-action';\n\nexport const commonFade = (\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean }\n) => {\n const { duration, easing } = animation;\n const { disappear } = option;\n const currOpacity = instance.attribute.baseOpacity;\n const opacityMap = disappear ? { from: currOpacity ?? 1, to: 0 } : { from: 0, to: currOpacity ?? 1 };\n\n instance.setAttributes({ baseOpacity: opacityMap.from });\n instance.animate().to({ baseOpacity: opacityMap.to }, duration, easing);\n};\nexport const commonGrow = (\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean }\n) => {\n const { duration, easing } = animation;\n const { disappear } = option;\n const currScaleX = instance.attribute.scaleX;\n const currScaleY = instance.attribute.scaleY;\n const opacityMap = disappear\n ? { fromX: currScaleX ?? 1, fromY: currScaleY ?? 1, toX: 0, toY: 0 }\n : { fromX: 0, fromY: 0, toX: currScaleX ?? 1, toY: currScaleY ?? 1 };\n\n instance.setAttributes({ scaleX: opacityMap.fromX, scaleY: opacityMap.fromY });\n instance.animate().to({ scaleX: opacityMap.toX, scaleY: opacityMap.toY }, duration, easing);\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
2
2
|
import type { IGroup } from '@visactor/vrender-core';
|
|
3
|
-
export declare const runAxisAppear: (instance: IGroup, animation:
|
|
3
|
+
export declare const runAxisAppear: (instance: IGroup, animation: IChartVisibilityPayload['animation'], option: {
|
|
4
4
|
disappear: boolean;
|
|
5
5
|
}) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/component/axisAppear.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/component/axisAppear.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,QAAgB,EAChB,SAA+C,EAC/C,MAA8B,EAC9B,EAAE;IACF,QAAQ,SAAS,CAAC,MAAM,EAAE;QACxB,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,C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,CAAC,GAAG,EAAE;gBACV,IAAI,aAAa,EAAE;oBACjB,IAAI,CAAC,OAAO,EAAE,CAAC;iBAChB;YACH,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAED,SAAS,QAAQ,CACf,QAAgB,EAChB,SAA+C,EAC/C,MAAgG;IAEhG,IAAI,QAAQ,EAAE;QACZ,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;KACzC;AACH,CAAC","file":"axisAppear.js","sourcesContent":["import type { IChartVisibilityPayload } from '../../interface/appear-action';\nimport { commonFade } from '../common/commonAppear';\nimport { commonGrow } from './commonAppear';\nimport type { IGroup, ILine, IText } from '@visactor/vrender-core';\n\n// TODO: 区分直角坐标系和极坐标系\nexport const runAxisAppear = (\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean }\n) => {\n switch (animation.effect) {\n case 'grow': {\n return axisGrow(instance, animation, option);\n }\n case 'fade': {\n return commonFade(instance, animation, option);\n }\n default: {\n return commonFade(instance, animation, option);\n }\n }\n};\n\nfunction axisGrow(\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean; orient?: 'width' | 'height'; direction?: 'negative' | 'positive' }\n) {\n const isGrid = instance.name?.includes('grid');\n if (isGrid) {\n gridGrow(instance, animation, option);\n } else {\n mainAxisGrow(instance, animation, option);\n }\n}\n\nfunction mainAxisGrow(\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean; orient?: 'width' | 'height'; direction?: 'negative' | 'positive' }\n) {\n const { duration, easing } = animation;\n const { disappear, direction = 'positive', orient } = option;\n const axisLine = instance.getElementsByName('axis-line')[0] as unknown as IGroup;\n const axisTicks = instance.getElementsByName('axis-tick-container')[0] as unknown as IGroup;\n const axisLabel = instance.getElementsByName('axis-label-container')[0] as unknown as IGroup;\n\n if (axisLine && axisLine.childrenCount > 0) {\n const shouldReverse =\n orient === 'height'\n ? direction === 'positive' || disappear //\n : false;\n\n const line = axisLine.getElementsByType('line')[0] as unknown as ILine;\n if (line) {\n if (shouldReverse) {\n line.setAttributes({ points: line.attribute.points.reverse() });\n }\n const attributeMap = disappear\n ? { from: { clipRange: 1 }, to: { clipRange: 0 } }\n : { from: { clipRange: 0 }, to: { clipRange: 1 } };\n\n line.setAttributes(attributeMap.from);\n line\n .animate()\n .to(attributeMap.to, duration, easing)\n .onEnd(() => {\n if (shouldReverse) {\n line.setAttributes({ points: line.attribute.points.reverse() });\n }\n });\n }\n }\n\n const opacityMap = disappear\n ? { from: { opacity: 1 }, to: { opacity: 0 } }\n : { from: { opacity: 0 }, to: { opacity: 1 } };\n\n if (axisTicks && axisTicks.childrenCount > 0) {\n const shouldReverse = disappear;\n const ticks = axisTicks.getElementsByType('line');\n if (shouldReverse) {\n ticks.reverse();\n }\n ticks.forEach((tick: IText, i: number) => {\n tick.setAttributes(opacityMap.from);\n tick\n .animate()\n .wait((duration / ticks.length) * i)\n .to(opacityMap.to, duration / ticks.length, easing)\n .onEnd(() => {\n if (shouldReverse) {\n ticks.reverse();\n }\n });\n });\n }\n\n if (axisLabel && axisLabel.childrenCount > 0) {\n const shouldReverse = disappear;\n const text = axisLabel.getElementsByType('text');\n if (shouldReverse) {\n text.reverse();\n }\n text.forEach((t: IText, i: number) => {\n t.setAttributes(opacityMap.from);\n t.animate()\n .wait((duration / text.length) * i)\n .to(opacityMap.to, duration / text.length, easing)\n .onEnd(() => {\n if (shouldReverse) {\n text.reverse();\n }\n });\n });\n }\n}\n\nfunction gridGrow(\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean; orient?: 'width' | 'height'; direction?: 'negative' | 'positive' }\n) {\n if (instance) {\n commonGrow(instance, animation, option);\n }\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { IGroup } from '@visactor/vrender-core';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const commonGrow: (instance: IGroup, animation:
|
|
2
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
3
|
+
export declare const commonGrow: (instance: IGroup, animation: IChartVisibilityPayload['animation'], option: {
|
|
4
4
|
disappear: boolean;
|
|
5
5
|
orient?: 'width' | 'height';
|
|
6
6
|
}) => void;
|
|
7
|
-
export declare const runAppearOrDisAppear: (instance: IGroup, animation:
|
|
7
|
+
export declare const runAppearOrDisAppear: (instance: IGroup, animation: IChartVisibilityPayload['animation'], option: {
|
|
8
8
|
disappear: boolean;
|
|
9
9
|
}) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/component/commonAppear.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/component/commonAppear.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAgB,EAChB,SAA+C,EAC/C,MAA2D,EAC3D,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACvC,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC;IAE/C,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAW,CAAC;IAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;IAC5C,IAAI,MAAM,KAAK,OAAO,EAAE;QACtB,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,E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AAC,CAAC","file":"commonAppear.js","sourcesContent":["import type { IGroup } from '@visactor/vrender-core';\nimport type { IChartVisibilityPayload } from '../../interface/appear-action';\nimport { commonFade } from '../common/commonAppear';\n\nexport const commonGrow = (\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean; orient?: 'width' | 'height' }\n) => {\n const { duration, easing } = animation;\n const { disappear, orient = 'width' } = option;\n\n instance = instance.getChildAt(0) as IGroup;\n const width = instance.AABBBounds.width();\n const height = instance.AABBBounds.height();\n if (orient === 'width') {\n const opacityMap = disappear ? { from: width, to: 0 } : { from: 0, to: width };\n instance.setAttributes({\n width: opacityMap.from,\n height,\n clip: true\n });\n instance.animate().to({ width: opacityMap.to }, duration, easing);\n } else {\n const opacityMap = disappear ? { from: height, to: 0 } : { from: 0, to: height };\n // TODO: 轴 bounds 不准确\n instance.setAttributes({\n width: width * 2,\n height: opacityMap.from,\n clip: true\n });\n instance.animate().to({ height: opacityMap.to }, duration, easing);\n }\n};\n\nexport const runAppearOrDisAppear = (\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean }\n) => {\n switch (animation.effect) {\n case 'grow': {\n return commonGrow(instance, animation, option);\n }\n case 'fade': {\n return commonFade(instance, animation, option);\n }\n default: {\n return commonFade(instance, animation, option);\n }\n }\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
2
2
|
import type { IGroup } from '@visactor/vrender-core';
|
|
3
|
-
export declare const runLabelAppear: (instance: IGroup, animation:
|
|
3
|
+
export declare const runLabelAppear: (instance: IGroup, animation: IChartVisibilityPayload['animation'], option: {
|
|
4
4
|
disappear: boolean;
|
|
5
5
|
}) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/component/labelAppear.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,cAAc,GAAG,CAC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EAAE,MAAM,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,IAAc,EAAE,EAAE;QAChE,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,QAAgB,EAChB,SAA+C,EAC/C,MAA8B,EAC9B,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACvC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;IACvE,QAAQ,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IACzD,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC1E,CAAC,CAAC","file":"labelAppear.js","sourcesContent":["import type { IChartVisibilityPayload } from '../../interface/appear-action';\nimport type { IGraphic, IGroup } from '@visactor/vrender-core';\n\nexport const runLabelAppear = (\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean }\n) => {\n switch (animation.effect) {\n case 'grow': {\n return labelGrow(instance, animation, option);\n }\n case 'followGraphic': {\n return labelFollowGraphic(instance, animation, option);\n }\n case 'fade': {\n return labelFade(instance, animation, option);\n }\n default: {\n return labelFade(instance, animation, option);\n }\n }\n};\n\nconst labelGrow = (\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean }\n) => {\n const { duration, easing } = animation;\n const { disappear } = option;\n const sizeMap = disappear ? { from: 1, to: 0 } : { from: 0, to: 1 };\n\n instance.getElementsByType('text').forEach((text: IGraphic) => {\n text.setAttributes({ scaleX: sizeMap.from, scaleY: sizeMap.from });\n text.animate().to({ scaleX: sizeMap.to, scaleY: sizeMap.to }, duration, easing);\n });\n\n instance.getElementsByType('richtext').forEach((text: IGraphic) => {\n text.setAttributes({ scaleX: sizeMap.from, scaleY: sizeMap.from });\n text.animate().to({ scaleX: sizeMap.to, scaleY: sizeMap.to }, duration, easing);\n });\n};\n\nconst labelFade = (\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean }\n) => {\n const { duration, easing } = animation;\n const { disappear } = option;\n const opacityMap = disappear ? { from: 1, to: 0 } : { from: 0, to: 1 };\n instance.getElementsByType('text').forEach((text: IGraphic) => {\n text.setAttributes({ opacity: opacityMap.from });\n text.animate().to({ opacity: opacityMap.to }, duration, easing);\n });\n\n instance.getElementsByType('richtext').forEach((text: IGraphic) => {\n text.setAttributes({ opacity: opacityMap.from });\n text.animate().to({ opacity: opacityMap.to }, duration, easing);\n });\n};\n\nconst labelFollowGraphic = (\n instance: IGroup,\n animation: IChartVisibilityPayload['animation'],\n option: { disappear: boolean }\n) => {\n const { duration, easing } = animation;\n const { disappear } = option;\n const opacityMap = disappear ? { from: 1, to: 0 } : { from: 1, to: 1 };\n instance.setAttributes({ baseOpacity: opacityMap.from });\n instance.animate().to({ baseOpacity: opacityMap.to }, duration, easing);\n};\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Player } from '@visactor/vchart';
|
|
2
|
+
import type { ICharacter } from '../../../../story/character';
|
|
3
|
+
import type { IActionSpec } from '../../../../story/interface';
|
|
4
|
+
import type { BasePlayer } from '@visactor/vrender-components';
|
|
5
|
+
import { ActionProcessorItem } from '../../processor-item';
|
|
6
|
+
import type { IAction, IActionPayload } from '../../interface/common-action';
|
|
7
|
+
export type IRankingBarPlayPayload = IActionPayload;
|
|
8
|
+
export interface IRankingBarPlayAction extends IAction<IRankingBarPlayPayload> {
|
|
9
|
+
action: 'play';
|
|
10
|
+
}
|
|
11
|
+
export declare class RankingBarPlayActionProcessor extends ActionProcessorItem {
|
|
12
|
+
name: 'rankingBar-play';
|
|
13
|
+
rafId: any;
|
|
14
|
+
duration: number;
|
|
15
|
+
interval: number;
|
|
16
|
+
count: number;
|
|
17
|
+
start: number;
|
|
18
|
+
prevIndex: number;
|
|
19
|
+
done: boolean;
|
|
20
|
+
vchartPlayer: Player;
|
|
21
|
+
vrenderPlayer: BasePlayer<any>;
|
|
22
|
+
constructor();
|
|
23
|
+
getStartTimeAndDuration(action: IActionSpec, character?: ICharacter): {
|
|
24
|
+
startTime: number;
|
|
25
|
+
duration: number;
|
|
26
|
+
};
|
|
27
|
+
run(character: ICharacter, actionSpec: any): void;
|
|
28
|
+
forward: (timestamp: number) => void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ActionProcessorItem } from "../../processor-item";
|
|
2
|
+
|
|
3
|
+
import { vglobal } from "@visactor/vrender";
|
|
4
|
+
|
|
5
|
+
import { isValid } from "@visactor/vutils";
|
|
6
|
+
|
|
7
|
+
function _forward(vchartPlayer, vrenderPlayer, params) {
|
|
8
|
+
if (!vrenderPlayer) return !1;
|
|
9
|
+
const {index: index} = params;
|
|
10
|
+
return !(!isValid(index) || index === vrenderPlayer.getMaxIndex()) && (vchartPlayer.changePlayerIndex(vrenderPlayer.getDataIndex()),
|
|
11
|
+
!0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class RankingBarPlayActionProcessor extends ActionProcessorItem {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(), this.duration = 0, this.interval = 0, this.count = 0, this.done = !1, this.forward = timestamp => {
|
|
17
|
+
isValid(this.start) || (this.start = timestamp, this.vrenderPlayer.play());
|
|
18
|
+
const progress = (timestamp - this.start) / this.duration, curIndex = Math.floor(Math.min(progress * this.count, this.count));
|
|
19
|
+
if (!(curIndex < this.count - 1)) return this.start = void 0, this.prevIndex = void 0,
|
|
20
|
+
void vglobal.getCancelAnimationFrame()(this.rafId);
|
|
21
|
+
if (this.prevIndex !== curIndex) {
|
|
22
|
+
_forward(this.vchartPlayer, this.vrenderPlayer, {
|
|
23
|
+
index: curIndex,
|
|
24
|
+
progress: progress
|
|
25
|
+
}) && (this.prevIndex = curIndex);
|
|
26
|
+
} else _forward(this.vchartPlayer, this.vrenderPlayer, {
|
|
27
|
+
progress: progress
|
|
28
|
+
});
|
|
29
|
+
this.rafId = vglobal.getRequestAnimationFrame()(this.forward.bind(this));
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
getStartTimeAndDuration(action, character) {
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
34
|
+
const {startTime: globalStartTime = 0} = action, {startTime: startTime = 0} = null !== (_b = null === (_a = action.payload) || void 0 === _a ? void 0 : _a.animation) && void 0 !== _b ? _b : {}, instance = character.graphic._vchart, interval = null !== (_d = null === (_c = null == instance ? void 0 : instance.getSpec()) || void 0 === _c ? void 0 : _c.interval) && void 0 !== _d ? _d : 0, count = null !== (_h = null === (_g = null === (_f = null === (_e = null == instance ? void 0 : instance.getSpec()) || void 0 === _e ? void 0 : _e.player) || void 0 === _f ? void 0 : _f.specs) || void 0 === _g ? void 0 : _g.length) && void 0 !== _h ? _h : 0, duration = interval * count, st = globalStartTime + startTime;
|
|
35
|
+
return this.duration = duration, this.interval = interval, this.count = count, {
|
|
36
|
+
startTime: st,
|
|
37
|
+
duration: duration
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
run(character, actionSpec) {
|
|
41
|
+
const instance = character.graphic._vchart;
|
|
42
|
+
if (!instance) return;
|
|
43
|
+
const vchartPlayer = instance.getComponents().find((cmp => "player" === cmp.type));
|
|
44
|
+
if (!vchartPlayer) return;
|
|
45
|
+
const vrenderPlayer = vchartPlayer.getVRenderComponents()[0];
|
|
46
|
+
vrenderPlayer && (this.vchartPlayer = vchartPlayer, this.vrenderPlayer = vrenderPlayer,
|
|
47
|
+
this.rafId = vglobal.getRequestAnimationFrame()(this.forward.bind(this)));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=rankingBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/rankingBar/rankingBar.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAW3C,SAAS,QAAQ,CACf,YAAoB,EACpB,aAA8B,EAC9B,MAGC;IAED,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,KAAK,CAAC;KACd;IACD,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IACzB,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,aAAa,CAAC,WAAW,EAAE,EAAE;QAC3D,YAAY,CAAC,iBAAiB,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,OAAO,6BAA8B,SAAQ,mBAAmB;IAepE;QACE,KAAK,EAAE,CAAC;QAZV,aAAQ,GAAG,CAAC,CAAC;QACb,aAAQ,GAAG,CAAC,CAAC;QACb,UAAK,GAAG,CAAC,CAAC;QAIV,SAAI,GAAG,KAAK,CAAC;QA+Cb,YAAO,GAAG,CAAC,SAAiB,EAAE,EAAE;Y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oBAAoB,EAAE,CAAC,CAAC,CAAoB,CAAC;QAChF,IAAI,CAAC,aAAa,EAAE;YAClB,OAAO;SACR;QACD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QAEnC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3E,CAAC;CA6BF","file":"rankingBar.js","sourcesContent":["import type { IVChart, Player } from '@visactor/vchart';\nimport type { ICharacter } from '../../../../story/character';\nimport type { IActionSpec } from '../../../../story/interface';\nimport type { BasePlayer } from '@visactor/vrender-components';\nimport { ActionProcessorItem } from '../../processor-item';\nimport { vglobal } from '@visactor/vrender';\nimport { isValid } from '@visactor/vutils';\nimport type { IAction, IActionPayload } from '../../interface/common-action';\n\n// TODO: move to interface folder\n// export type IRankingBarPlayPayload = Omit<IActionPayload, 'animation'>;\nexport type IRankingBarPlayPayload = IActionPayload;\n\nexport interface IRankingBarPlayAction extends IAction<IRankingBarPlayPayload> {\n action: 'play';\n}\n\nfunction _forward(\n vchartPlayer: Player,\n vrenderPlayer: BasePlayer<any>,\n params: {\n progress: number;\n index?: number;\n }\n): boolean {\n if (!vrenderPlayer) {\n return false;\n }\n const { index } = params;\n if (isValid(index) && index !== vrenderPlayer.getMaxIndex()) {\n vchartPlayer.changePlayerIndex(vrenderPlayer.getDataIndex());\n return true;\n }\n return false;\n}\n\nexport class RankingBarPlayActionProcessor extends ActionProcessorItem {\n name: 'rankingBar-play';\n rafId: any;\n\n duration = 0;\n interval = 0;\n count = 0;\n\n start: number;\n prevIndex: number;\n done = false;\n\n vchartPlayer: Player;\n vrenderPlayer: BasePlayer<any>;\n\n constructor() {\n super();\n }\n\n getStartTimeAndDuration(action: IActionSpec, character?: ICharacter): { startTime: number; duration: number } {\n const { startTime: globalStartTime = 0 } = action;\n // @ts-ignore\n const { startTime = 0 } = action.payload?.animation ?? ({} as any);\n const instance = (character.graphic as any)._vchart as IVChart;\n const interval = instance?.getSpec()?.interval ?? 0;\n const count = instance?.getSpec()?.player?.specs?.length ?? 0;\n const duration = interval * count;\n const st = globalStartTime + startTime;\n this.duration = duration;\n this.interval = interval;\n this.count = count;\n return {\n startTime: st,\n duration\n };\n }\n\n run(character: ICharacter, actionSpec: any): void {\n const instance = (character.graphic as any)._vchart as IVChart;\n if (!instance) {\n return;\n }\n\n const vchartPlayer = instance.getComponents().find(cmp => cmp.type === 'player') as Player;\n if (!vchartPlayer) {\n return;\n }\n const vrenderPlayer = vchartPlayer.getVRenderComponents()[0] as BasePlayer<any>;\n if (!vrenderPlayer) {\n return;\n }\n this.vchartPlayer = vchartPlayer;\n this.vrenderPlayer = vrenderPlayer;\n\n this.rafId = vglobal.getRequestAnimationFrame()(this.forward.bind(this));\n }\n\n forward = (timestamp: number) => {\n if (!isValid(this.start)) {\n this.start = timestamp;\n this.vrenderPlayer.play();\n }\n const elapsed = timestamp - this.start;\n const progress = elapsed / this.duration;\n const curIndex = Math.floor(Math.min(progress * this.count, this.count));\n\n if (curIndex < this.count - 1) {\n if (this.prevIndex !== curIndex) {\n const result = _forward(this.vchartPlayer, this.vrenderPlayer, { index: curIndex, progress });\n if (result) {\n this.prevIndex = curIndex;\n }\n } else {\n _forward(this.vchartPlayer, this.vrenderPlayer, { progress });\n }\n\n this.rafId = vglobal.getRequestAnimationFrame()(this.forward.bind(this));\n } else {\n this.start = undefined;\n this.prevIndex = undefined;\n vglobal.getCancelAnimationFrame()(this.rafId);\n return;\n }\n };\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type VChart from '@visactor/vchart';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const commonGrow: (instance: VChart, animation:
|
|
2
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
3
|
+
export declare const commonGrow: (instance: VChart, animation: IChartVisibilityPayload['animation'], typeList: string[], option: {
|
|
4
4
|
markIndex: number;
|
|
5
5
|
disappear: boolean;
|
|
6
6
|
}) => {
|
|
@@ -10,7 +10,7 @@ export declare const commonGrow: (instance: VChart, animation: IChartVisibilityA
|
|
|
10
10
|
oneByOne: boolean;
|
|
11
11
|
easing: import("@visactor/vrender-core").EasingType;
|
|
12
12
|
};
|
|
13
|
-
export declare const commonFade: (instance: VChart, animation:
|
|
13
|
+
export declare const commonFade: (instance: VChart, animation: IChartVisibilityPayload['animation'], option: {
|
|
14
14
|
markIndex: number;
|
|
15
15
|
disappear: boolean;
|
|
16
16
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/seriesmark/commonTransformMarkAppear.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/seriesmark/commonTransformMarkAppear.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAgB,EAChB,SAA+C,EAC/C,QAAkB,EAClB,MAAiD,EACjD,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAE7B,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEnD,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,IAAI;QACJ,QAAQ;QACR,MAAM;KACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAgB,EAChB,SAA+C,EAC/C,MAAiD,EACjD,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IAE9C,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,IAAI;QACJ,QAAQ;QACR,MAAM;KACP,CAAC;AACJ,CAAC,CAAC","file":"commonTransformMarkAppear.js","sourcesContent":["import type VChart from '@visactor/vchart';\nimport type { IChartVisibilityPayload } from '../../interface/appear-action';\n\nexport const commonGrow = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n typeList: string[],\n option: { markIndex: number; disappear: boolean }\n) => {\n const { duration, loop, oneByOne, easing } = animation;\n const { disappear } = option;\n\n const type = disappear ? typeList[1] : typeList[0];\n\n return {\n type,\n duration,\n loop,\n oneByOne,\n easing\n };\n};\n\nexport const commonFade = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n option: { markIndex: number; disappear: boolean }\n) => {\n const { duration, loop, oneByOne, easing } = animation;\n const { disappear } = option;\n const type = disappear ? 'fadeOut' : 'fadeIn';\n\n return {\n type,\n duration,\n loop,\n oneByOne,\n easing\n };\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type VChart from '@visactor/vchart';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const transformArcVisibility: (instance: VChart, animation:
|
|
2
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
3
|
+
export declare const transformArcVisibility: (instance: VChart, animation: IChartVisibilityPayload['animation'], option: {
|
|
4
4
|
disappear: boolean;
|
|
5
5
|
markIndex: number;
|
|
6
6
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/seriesmark/transformArcVisibility.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/seri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S,CAAC;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAExD,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,IAAI;QACJ,QAAQ;QACR,MAAM;QACN,OAAO,EAAE;YACP,OAAO,EAAE,IAAI;SACd;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CACd,QAAgB,EAChB,SAA+C,EAC/C,MAGC,EACD,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IAE9C,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,IAAI;QACJ,QAAQ;QACR,MAAM;KACP,CAAC;AACJ,CAAC,CAAC","file":"transformArcVisibility.js","sourcesContent":["import type VChart from '@visactor/vchart';\nimport type { IChartVisibilityPayload } from '../../interface/appear-action';\n\n// 将payload转换为chart内置的动画type\nexport const transformArcVisibility = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n option: {\n disappear: boolean;\n markIndex: number;\n }\n) => {\n switch (animation.effect) {\n case 'grow': {\n return arcGrowRadius(instance, animation, option);\n }\n case 'growRadius': {\n return arcGrowRadius(instance, animation, option);\n }\n case 'growAngle': {\n return arcGrowAngle(instance, animation, option);\n }\n case 'fade': {\n return arcFade(instance, animation, option);\n }\n default: {\n return arcFade(instance, animation, option);\n }\n }\n};\n\nconst arcGrowRadius = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n option: {\n disappear: boolean;\n markIndex: number;\n }\n) => {\n const { duration, loop, oneByOne, easing } = animation;\n const { disappear } = option;\n const type = disappear ? 'growRadiusOut' : 'growRadiusIn';\n\n return {\n type,\n duration,\n loop,\n oneByOne,\n easing\n };\n};\n\nconst arcGrowAngle = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n option: {\n disappear: boolean;\n markIndex: number;\n }\n) => {\n const { duration, loop, oneByOne, easing } = animation;\n const { disappear } = option;\n const type = disappear ? 'growAngleOut' : 'growAngleIn';\n\n return {\n type,\n duration,\n loop,\n oneByOne,\n easing,\n options: {\n overall: true\n }\n };\n};\n\nconst arcFade = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n option: {\n disappear: boolean;\n markIndex: number;\n }\n) => {\n const { duration, loop, oneByOne, easing } = animation;\n const { disappear } = option;\n const type = disappear ? 'fadeOut' : 'fadeIn';\n\n return {\n type,\n duration,\n loop,\n oneByOne,\n easing\n };\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type VChart from '@visactor/vchart';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const transformLineVisibility: (instance: VChart, animation:
|
|
2
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
3
|
+
export declare const transformLineVisibility: (instance: VChart, animation: IChartVisibilityPayload['animation'], option: {
|
|
4
4
|
markIndex: number;
|
|
5
5
|
disappear: boolean;
|
|
6
6
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/seriesmark/transformLineVisibility.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/seriesmark/transformLineVisibility.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,QAAgB,EAChB,SAA+C,EAC/C,MAAiD,EACjD,EAAE;IACF,QAAQ,SAAS,CAAC,MAAM,EAAE;QACxB,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;SACvE;QACD,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD;QACD,OAAO,CAAC,CAAC;YACP,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD;KACF;AACH,CAAC,CAAC","file":"transformLineVisibility.js","sourcesContent":["import type VChart from '@visactor/vchart';\nimport type { IChartVisibilityPayload } from '../../interface/appear-action';\nimport { commonFade, commonGrow } from './commonTransformMarkAppear';\n\nexport const transformLineVisibility = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n option: { markIndex: number; disappear: boolean }\n) => {\n switch (animation.effect) {\n case 'grow': {\n return commonGrow(instance, animation, ['clipIn', 'clipOut'], option);\n }\n case 'fade': {\n return commonFade(instance, animation, option);\n }\n default: {\n return commonFade(instance, animation, option);\n }\n }\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type VChart from '@visactor/vchart';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const transformRectVisibility: (instance: VChart, animation:
|
|
2
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
3
|
+
export declare const transformRectVisibility: (instance: VChart, animation: IChartVisibilityPayload['animation'], option: {
|
|
4
4
|
markIndex: number;
|
|
5
5
|
disappear: boolean;
|
|
6
6
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/seriesmark/transformRectVisibility.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGzD,MAAM,CAAC,MAAM,uB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AAED,SAAS,OAAO,CAAC,MAAmB;IAClC,OAAO,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,OAAO,CAAC;AACjD,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAE,EAAE;IACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC7B,MAAM,MAAM,GAAI,IAAY,CAAC,SAAS,EAAE,CAAC;QACzC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;YACnB,OAAO,IAAI,CAAC;SACb;IACH,CAAC,CAAQ,CAAC;IACV,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC7B,MAAM,MAAM,GAAI,IAAY,CAAC,SAAS,EAAE,CAAC;QACzC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;YACnB,OAAO,IAAI,CAAC;SACb;IACH,CAAC,CAAQ,CAAC;IAEV,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxB,CAAC,CAAC","file":"transformRectVisibility.js","sourcesContent":["import type VChart from '@visactor/vchart';\n// import type { IChartVisibilityAction } from '../../../../types/chart/appear';\nimport type { IOrientType } from '@visactor/vrender-components';\nimport type { IChartVisibilityPayload } from '../../interface/appear-action';\nimport { commonFade } from './commonTransformMarkAppear';\n\n// 将payload转换为chart内置的动画type\nexport const transformRectVisibility = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n option: { markIndex: number; disappear: boolean }\n) => {\n switch (animation.effect) {\n case 'grow': {\n return rectGrow(instance, animation, {\n ...option,\n center: false\n });\n }\n case 'centerGrow': {\n return rectGrow(instance, animation, {\n ...option,\n center: true\n });\n }\n case 'fade':\n default: {\n return commonFade(instance, animation, {\n ...option\n });\n }\n }\n};\n\nconst rectGrow = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n option = { center: false, disappear: false }\n) => {\n const { duration, loop, oneByOne, easing } = animation;\n const { center, disappear } = option;\n const direction = instance.getChart().getSpec().direction ?? 'vertical';\n const xField = instance.getChart().getSpec().xField;\n const yField = instance.getChart().getSpec().yField;\n const [xAxis, yAxis] = getXYAxis(instance);\n\n const type = disappear ? (center ? 'growCenterOut' : 'growHeightOut') : center ? 'growCenterIn' : 'growHeightIn';\n\n return {\n type: type,\n duration,\n loop,\n oneByOne,\n easing,\n options: (datum: any, element: any, params: any) => {\n const field = direction === 'vertical' ? yField : xField;\n const data = datum?.[field];\n\n if (direction === 'vertical') {\n return {\n overall: yAxis?.getScale(0).scale(0),\n orient: data > 0 ? 'negative' : 'positive'\n };\n }\n return {\n overall: xAxis?.getScale(0).scale(0),\n orient: data > 0 ? 'negative' : 'positive'\n };\n }\n };\n};\n\nfunction isXAxis(orient: IOrientType) {\n return orient === 'bottom' || orient === 'top';\n}\n\nfunction isYAxis(orient: IOrientType) {\n return orient === 'left' || orient === 'right';\n}\n\nconst getXYAxis = (instance: VChart) => {\n const axes = instance.getChart().getComponentsByKey('axes');\n const xAxis = axes.find(axis => {\n const orient = (axis as any).getOrient();\n if (isXAxis(orient)) {\n return true;\n }\n }) as any;\n const yAxis = axes.find(axis => {\n const orient = (axis as any).getOrient();\n if (isYAxis(orient)) {\n return true;\n }\n }) as any;\n\n return [xAxis, yAxis];\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type VChart from '@visactor/vchart';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const transformSymbolVisibility: (instance: VChart, animation:
|
|
2
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
3
|
+
export declare const transformSymbolVisibility: (instance: VChart, animation: IChartVisibilityPayload['animation'], option: {
|
|
4
4
|
markIndex: number;
|
|
5
5
|
disappear: boolean;
|
|
6
6
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/seriesmark/transformSymbolVisibility.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/seriesmark/transformSymbolVisibility.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,QAAgB,EAChB,SAA+C,EAC/C,MAAiD,EACjD,EAAE;IACF,QAAQ,SAAS,CAAC,MAAM,EAAE;QACxB,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;SACzE;QACD,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD;QACD,OAAO,CAAC,CAAC;YACP,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD;KACF;AACH,CAAC,CAAC","file":"transformSymbolVisibility.js","sourcesContent":["import type VChart from '@visactor/vchart';\nimport type { IChartVisibilityPayload } from '../../interface/appear-action';\nimport { commonFade, commonGrow } from './commonTransformMarkAppear';\n\nexport const transformSymbolVisibility = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n option: { markIndex: number; disappear: boolean }\n) => {\n switch (animation.effect) {\n case 'grow': {\n return commonGrow(instance, animation, ['scaleIn', 'scaleOut'], option);\n }\n case 'fade': {\n return commonFade(instance, animation, option);\n }\n default: {\n return commonFade(instance, animation, option);\n }\n }\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type VChart from '@visactor/vchart';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const transformTextVisibility: (instance: VChart, animation:
|
|
2
|
+
import type { IChartVisibilityPayload } from '../../interface/appear-action';
|
|
3
|
+
export declare const transformTextVisibility: (instance: VChart, animation: IChartVisibilityPayload['animation'], option: {
|
|
4
4
|
disappear: boolean;
|
|
5
5
|
markIndex: number;
|
|
6
6
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/player/processor/chart/seriesmark/transformTextVisibility.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGrE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"sources":["../src/player/processor/chart/seriesmark/transformTextVisibility.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGrE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,QAAgB,EAChB,SAA+C,EAC/C,MAGC,EACD,EAAE;IACF,QAAQ,SAAS,CAAC,MAAM,EAAE;QACxB,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;SACzE;QACD,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD;QACD,OAAO,CAAC,CAAC;YACP,OAAO,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;SAChD;KACF;AACH,CAAC,CAAC","file":"transformTextVisibility.js","sourcesContent":["import type VChart from '@visactor/vchart';\nimport type { IChartVisibilityPayload } from '../../interface/appear-action';\nimport { commonFade, commonGrow } from './commonTransformMarkAppear';\n\n// 将payload转换为chart内置的动画type\nexport const transformTextVisibility = (\n instance: VChart,\n animation: IChartVisibilityPayload['animation'],\n option: {\n disappear: boolean;\n markIndex: number;\n }\n) => {\n switch (animation.effect) {\n case 'grow': {\n return commonGrow(instance, animation, ['scaleIn', 'scaleOut'], option);\n }\n case 'fade': {\n return commonFade(instance, animation, option);\n }\n default: {\n return commonFade(instance, animation, option);\n }\n }\n};\n"]}
|
|
@@ -2,28 +2,47 @@ import type { IComponent, ISeries, IVChart } from '@visactor/vchart';
|
|
|
2
2
|
import type { ICharacter } from '../../../story/character';
|
|
3
3
|
import type { IActionSpec } from '../../../story/interface';
|
|
4
4
|
import { ActionProcessorItem } from '../processor-item';
|
|
5
|
-
import type { IChartVisibilityAction } from '../interface/appear-action';
|
|
5
|
+
import type { IChartVisibilityAction, IChartVisibilityPayload } from '../interface/appear-action';
|
|
6
6
|
import type { IGraphic } from '@visactor/vrender-core';
|
|
7
7
|
import type { IAction, IActionPayload } from '../interface/common-action';
|
|
8
8
|
export type Datum = Record<string, any>;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
declare class VChartBaseActionProcessor extends ActionProcessorItem {
|
|
10
|
+
selectBySelector(selector: string, vchart: IVChart): {
|
|
11
|
+
chart: boolean;
|
|
12
|
+
seriesList: ISeries[];
|
|
13
|
+
componentsList: IComponent[];
|
|
14
|
+
};
|
|
15
|
+
protected selectByNameOrType(seriesList: ISeries[], componentsList: IComponent[], select: string, match?: boolean): {
|
|
16
|
+
seriesList: ISeries[];
|
|
17
|
+
componentsList: IComponent[];
|
|
18
|
+
};
|
|
19
|
+
protected selectByName(seriesList: ISeries[], componentsList: IComponent[], select: string, match?: boolean): {
|
|
20
|
+
seriesList: ISeries[];
|
|
21
|
+
componentsList: IComponent[];
|
|
22
|
+
};
|
|
23
|
+
protected selectByType(seriesList: ISeries[], componentsList: IComponent[], name: string, match?: boolean): {
|
|
24
|
+
seriesList: ISeries[];
|
|
25
|
+
componentsList: IComponent[];
|
|
26
|
+
};
|
|
12
27
|
getStartTimeAndDuration(action: IActionSpec): {
|
|
13
28
|
startTime: number;
|
|
14
29
|
duration: number;
|
|
15
30
|
};
|
|
31
|
+
}
|
|
32
|
+
export declare class VChartVisibilityActionProcessor extends VChartBaseActionProcessor {
|
|
33
|
+
name: 'appearOrDisAppear';
|
|
34
|
+
constructor();
|
|
16
35
|
run(character: ICharacter, actionSpec: IChartVisibilityAction): void;
|
|
17
|
-
protected chartVisibility(chartGraphic: IGraphic,
|
|
18
|
-
protected componentAppear(vchart: IVChart, component: IComponent,
|
|
19
|
-
protected labelComponentAppear(vchart: IVChart, component: IComponent,
|
|
20
|
-
protected legendsComponentAppear(vchart: IVChart, component: IComponent,
|
|
21
|
-
protected axisComponentAppear(vchart: IVChart, component: IComponent,
|
|
22
|
-
protected cartesianAxisAppear(axis: any, axisGrid: any,
|
|
23
|
-
protected polarAxisAppear(axis: any, axisGrid: any,
|
|
24
|
-
protected titleComponentAppear(vchart: IVChart, component: IComponent,
|
|
36
|
+
protected chartVisibility(chartGraphic: IGraphic, action: 'appear' | 'disappear', payload: IChartVisibilityPayload): void;
|
|
37
|
+
protected componentAppear(vchart: IVChart, component: IComponent, action: 'appear' | 'disappear', payload: IChartVisibilityPayload): void;
|
|
38
|
+
protected labelComponentAppear(vchart: IVChart, component: IComponent, action: 'appear' | 'disappear', payload: IChartVisibilityPayload): void;
|
|
39
|
+
protected legendsComponentAppear(vchart: IVChart, component: IComponent, action: 'appear' | 'disappear', payload: IChartVisibilityPayload): void;
|
|
40
|
+
protected axisComponentAppear(vchart: IVChart, component: IComponent, action: 'appear' | 'disappear', payload: IChartVisibilityPayload): void;
|
|
41
|
+
protected cartesianAxisAppear(axis: any, axisGrid: any, action: 'appear' | 'disappear', payload: IChartVisibilityPayload): void;
|
|
42
|
+
protected polarAxisAppear(axis: any, axisGrid: any, action: 'appear' | 'disappear', payload: IChartVisibilityPayload): void;
|
|
43
|
+
protected titleComponentAppear(vchart: IVChart, component: IComponent, action: 'appear' | 'disappear', payload: IChartVisibilityPayload): void;
|
|
25
44
|
private runTransformFunc;
|
|
26
|
-
protected commonSeriesAppear(vchart: IVChart, series: ISeries,
|
|
45
|
+
protected commonSeriesAppear(vchart: IVChart, series: ISeries, action: 'appear' | 'disappear', payload: IChartVisibilityPayload): void;
|
|
27
46
|
static rectPayload: (seriesType: string) => {
|
|
28
47
|
animation: {
|
|
29
48
|
effect: string;
|
|
@@ -51,13 +70,9 @@ export interface IChartUpdatePayload extends IActionPayload {
|
|
|
51
70
|
export interface IChartUpdateAction extends IAction<IChartUpdatePayload> {
|
|
52
71
|
action: 'update';
|
|
53
72
|
}
|
|
54
|
-
export declare class VChartUpdateActionProcessor extends
|
|
73
|
+
export declare class VChartUpdateActionProcessor extends VChartBaseActionProcessor {
|
|
55
74
|
name: 'update';
|
|
56
75
|
constructor();
|
|
57
|
-
getStartTimeAndDuration(action: IActionSpec): {
|
|
58
|
-
startTime: number;
|
|
59
|
-
duration: number;
|
|
60
|
-
};
|
|
61
76
|
run(character: ICharacter, actionSpec: IChartUpdateAction): void;
|
|
62
77
|
}
|
|
63
78
|
export interface IChartAddPayload extends IActionPayload {
|
|
@@ -69,14 +84,10 @@ export interface IChartAddPayload extends IActionPayload {
|
|
|
69
84
|
}
|
|
70
85
|
export interface IChartAddAction extends IAction<IChartAddPayload> {
|
|
71
86
|
action: 'add';
|
|
72
|
-
payload: IChartAddPayload;
|
|
73
87
|
}
|
|
74
|
-
export declare class VChartAddActionProcessor extends
|
|
88
|
+
export declare class VChartAddActionProcessor extends VChartBaseActionProcessor {
|
|
75
89
|
name: 'add';
|
|
76
90
|
constructor();
|
|
77
|
-
getStartTimeAndDuration(action: IActionSpec): {
|
|
78
|
-
startTime: number;
|
|
79
|
-
duration: number;
|
|
80
|
-
};
|
|
81
91
|
run(character: ICharacter, actionSpec: IChartAddAction): void;
|
|
82
92
|
}
|
|
93
|
+
export {};
|