@visactor/vstory 0.0.4 → 0.0.5-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/story-chart/chart.js +2 -1
- package/cjs/dsl/story-chart/line.js +1 -1
- package/cjs/dsl/story-chart/pie.js +1 -1
- package/cjs/dsl/story-processor/index.js +1 -1
- package/cjs/dsl/types/index.d.ts +1 -0
- package/cjs/dsl/types/index.js.map +1 -1
- 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 +30 -4
- package/cjs/edit/edit-component/base-selection.js.map +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 -32
- 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 +2 -5
- 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 +3 -11
- 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/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/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.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/scene/scene.js +2 -0
- 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 +54 -12
- 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 +18 -3
- 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/cjs/util/space.js +2 -1
- package/dist/index.js +23405 -26034
- 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/story-chart/chart.js +2 -1
- package/es/dsl/story-chart/line.js +1 -1
- package/es/dsl/story-chart/pie.js +1 -1
- package/es/dsl/story-processor/index.js +1 -1
- package/es/dsl/types/index.d.ts +1 -0
- package/es/dsl/types/index.js.map +1 -1
- 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 +31 -3
- package/es/edit/edit-component/base-selection.js.map +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 -26
- 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 +2 -5
- 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 +2 -12
- 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/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/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.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/scene/scene.js +2 -0
- 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 +57 -14
- 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 +18 -3
- 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/es/util/space.js +2 -1
- package/package.json +8 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/story/character/component/graphic/symbol.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AAEjD,uCAAoC;AAEpC,MAAa,aAAc,SAAQ,iBAAO;IAGxC,oBAAoB;QAClB,OAAO;YACL,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;YAChB,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,SAAS;YACjB,WAAW,EAAE,EAAkB;YAC/B,UAAU,EAAE,QAAQ;SACrB,CAAC;IACJ,CAAC;IAED,IAAI;;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,
|
|
1
|
+
{"version":3,"sources":["../src/story/character/component/graphic/symbol.ts"],"names":[],"mappings":";;;AACA,+CAAiD;AAEjD,uCAAoC;AAEpC,kDAA4D;AAE5D,MAAa,aAAc,SAAQ,iBAAO;IAGxC,oBAAoB;QAClB,OAAO;YACL,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;YAChB,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,SAAS;YACjB,WAAW,EAAE,EAAkB;YAC/B,UAAU,EAAE,QAAQ;SACrB,CAAC;IACJ,CAAC;IAED,IAAI;;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACl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{ IPointLike } from '@visactor/vutils';\nimport { Graphic } from './graphic';\nimport type { IWidgetData } from '../../dsl-interface';\nimport { getLayoutFromWidget } from '../../../utils/layout';\n\nexport class GraphicSymbol extends Graphic {\n protected _graphic: ISymbol;\n\n getInitialAttributes() {\n return {\n x: 0,\n y: 0,\n width: 120,\n height: 80,\n angle: 0,\n anchor: [60, 40],\n lineWidth: 2,\n stroke: '#000000',\n shapePoints: [] as IPointLike[],\n symbolType: 'circle'\n };\n }\n\n init() {\n if (!this._graphic) {\n const attributes = this._transformAttributes({\n ...this.getInitialAttributes(),\n ...(this._character.spec.options?.graphic ?? {})\n });\n this._graphic = createSymbol(attributes);\n this._graphic.name = `graphic-symbol-${this._character.id}`;\n this._character.getGraphicParent().add(this._graphic);\n }\n }\n\n applyLayoutData(layoutData: Partial<IWidgetData>): void {\n const attributes = this._transformAttributes({\n ...getLayoutFromWidget(layoutData),\n shapePoints: this._character.spec.options.shapePoints\n });\n attributes.size = Math.min(attributes.width, attributes.height);\n\n this._graphic.setAttributes(attributes);\n }\n\n protected _transformAttributes(attributes: any): any {\n const data = super._transformAttributes(attributes);\n const { width, height } = attributes;\n data.x = width / 2;\n data.y = height / 2;\n return data;\n }\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IInitOption } from '@visactor/vchart';
|
|
1
2
|
import type { IRichTextGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender';
|
|
2
3
|
import type { DirectionType } from './chart/const';
|
|
3
4
|
export type IPercent = `${number}%`;
|
|
@@ -44,6 +45,7 @@ export interface IComponentSpec {
|
|
|
44
45
|
export interface IChartCharacterSpec extends ICharacterSpecBase {
|
|
45
46
|
options: {
|
|
46
47
|
spec?: any;
|
|
48
|
+
initOption?: IInitOption;
|
|
47
49
|
panel?: any;
|
|
48
50
|
theme?: any;
|
|
49
51
|
data?: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/story/character/dsl-interface.ts"],"names":[],"mappings":"","file":"dsl-interface.js","sourcesContent":["import type { IRichTextGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender';\nimport type { DirectionType } from './chart/const';\n\nexport type IPercent = `${number}%`;\nexport type WidgetNumber = number; // | IPercent;\n\nexport type IWidgetData = {\n left: WidgetNumber;\n top: WidgetNumber;\n} & (\n | {\n bottom: WidgetNumber;\n right: WidgetNumber;\n }\n | {\n width: WidgetNumber;\n height: WidgetNumber;\n }\n);\n\nexport interface ICharacterSpecBase {\n id: string;\n type: string; // 类型\n position: IWidgetData; // 定位描述\n zIndex: number;\n}\n\nexport type IEditorTextGraphicAttribute = {\n graphicAlign?: 'left' | 'center' | 'right';\n graphicBaseline?: 'top' | 'middle' | 'bottom';\n} & Partial<ITextGraphicAttribute & IRichTextGraphicAttribute>;\n\nexport interface IComponentCharacterSpec extends ICharacterSpecBase {\n options: {\n graphic: any;\n text?: IEditorTextGraphicAttribute;\n isResized?: boolean;\n angle?: number;\n shapePoints?: any;\n };\n}\n\nexport interface IComponentMatch {\n usrId?: string;\n specIndex?: number | 'all'; // all 表示所有\n [key: string]: any;\n}\n\nexport interface IComponentSpec {\n specKey: string;\n matchInfo: IComponentMatch;\n spec: any;\n}\n\nexport interface IChartCharacterSpec extends ICharacterSpecBase {\n options: {\n // 图表spec\n spec?: any;\n panel?: any;\n // 各种图表配置属性\n theme?: any;\n // 数据源\n data?: any;\n // 内部模块布局信息\n padding?: any;\n // 标题\n title?: any;\n layout?: any;\n // 色板\n color?: string[];\n // 标注\n marker?: any;\n // mark单元素样式配置\n markStyle?: any[];\n // 组样式\n dataGroupSpec?: {\n [key: string]: any;\n };\n // 方向\n direction?: DirectionType;\n // 系列配置\n seriesSpec?: {\n matchInfo: IComponentMatch;\n spec: any;\n }[];\n // 模块 spec\n componentSpec?: IComponentSpec[];\n };\n}\n\nexport type ICharacterSpec = IChartCharacterSpec | IComponentCharacterSpec;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/story/character/dsl-interface.ts"],"names":[],"mappings":"","file":"dsl-interface.js","sourcesContent":["import type { IInitOption } from '@visactor/vchart';\nimport type { IRichTextGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender';\nimport type { DirectionType } from './chart/const';\n\nexport type IPercent = `${number}%`;\nexport type WidgetNumber = number; // | IPercent;\n\nexport type IWidgetData = {\n left: WidgetNumber;\n top: WidgetNumber;\n} & (\n | {\n bottom: WidgetNumber;\n right: WidgetNumber;\n }\n | {\n width: WidgetNumber;\n height: WidgetNumber;\n }\n);\n\nexport interface ICharacterSpecBase {\n id: string;\n type: string; // 类型\n position: IWidgetData; // 定位描述\n zIndex: number;\n}\n\nexport type IEditorTextGraphicAttribute = {\n graphicAlign?: 'left' | 'center' | 'right';\n graphicBaseline?: 'top' | 'middle' | 'bottom';\n} & Partial<ITextGraphicAttribute & IRichTextGraphicAttribute>;\n\nexport interface IComponentCharacterSpec extends ICharacterSpecBase {\n options: {\n graphic: any;\n text?: IEditorTextGraphicAttribute;\n isResized?: boolean;\n angle?: number;\n shapePoints?: any;\n };\n}\n\nexport interface IComponentMatch {\n usrId?: string;\n specIndex?: number | 'all'; // all 表示所有\n [key: string]: any;\n}\n\nexport interface IComponentSpec {\n specKey: string;\n matchInfo: IComponentMatch;\n spec: any;\n}\n\nexport interface IChartCharacterSpec extends ICharacterSpecBase {\n options: {\n // 图表spec\n spec?: any;\n // 初始化参数\n initOption?: IInitOption;\n panel?: any;\n // 各种图表配置属性\n theme?: any;\n // 数据源\n data?: any;\n // 内部模块布局信息\n padding?: any;\n // 标题\n title?: any;\n layout?: any;\n // 色板\n color?: string[];\n // 标注\n marker?: any;\n // mark单元素样式配置\n markStyle?: any[];\n // 组样式\n dataGroupSpec?: {\n [key: string]: any;\n };\n // 方向\n direction?: DirectionType;\n // 系列配置\n seriesSpec?: {\n matchInfo: IComponentMatch;\n spec: any;\n }[];\n // 模块 spec\n componentSpec?: IComponentSpec[];\n };\n}\n\nexport type ICharacterSpec = IChartCharacterSpec | IComponentCharacterSpec;\n"]}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import type { IGroup } from '@visactor/vrender';
|
|
2
|
-
import type { IPointLike } from '@visactor/vutils';
|
|
1
|
+
import type { IGroup, IGraphic } from '@visactor/vrender';
|
|
2
|
+
import type { IBoundsLike, IPointLike } from '@visactor/vutils';
|
|
3
3
|
import type { IStory, IStoryCanvas, StoryEvent } from '../interface/runtime-interface';
|
|
4
4
|
import type { ICharacterSpec } from './dsl-interface';
|
|
5
5
|
import type { Graphic } from './component/graphic/graphic';
|
|
6
6
|
export interface ICharacterPickInfo {
|
|
7
7
|
part: string;
|
|
8
|
-
|
|
8
|
+
graphic?: IGraphic;
|
|
9
|
+
graphicType?: string;
|
|
10
|
+
modelInfo?: any;
|
|
9
11
|
}
|
|
10
12
|
export interface ICharacter {
|
|
11
13
|
id: string;
|
|
14
|
+
type: string;
|
|
15
|
+
visActorType: string;
|
|
12
16
|
spec: ICharacterSpec;
|
|
17
|
+
graphic: Graphic | IGroup;
|
|
13
18
|
init: () => void;
|
|
14
19
|
reset: () => void;
|
|
15
20
|
show: () => void;
|
|
16
21
|
hide: () => void;
|
|
17
22
|
getGraphicParent: () => IGroup;
|
|
18
|
-
|
|
23
|
+
getLayoutBounds: () => IBoundsLike;
|
|
19
24
|
tickTo: (t: number) => void;
|
|
20
25
|
checkEvent: (event: StoryEvent) => false | (ICharacterPickInfo & any);
|
|
21
26
|
updateSpec: (spec: Omit<Partial<ICharacterSpec>, 'id' | 'type'>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/story/character/runtime-interface.ts"],"names":[],"mappings":"","file":"runtime-interface.js","sourcesContent":["import type { IGroup } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport type {
|
|
1
|
+
{"version":3,"sources":["../src/story/character/runtime-interface.ts"],"names":[],"mappings":"","file":"runtime-interface.js","sourcesContent":["import type { IGroup, IGraphic } from '@visactor/vrender';\nimport type { IBoundsLike, IPointLike } from '@visactor/vutils';\nimport type { IStory, IStoryCanvas, StoryEvent } from '../interface/runtime-interface';\nimport type { ICharacterSpec } from './dsl-interface';\nimport type { Graphic } from './component/graphic/graphic';\n\nexport interface ICharacterPickInfo {\n part: string;\n graphic?: IGraphic;\n graphicType?: string;\n modelInfo?: any;\n}\nexport interface ICharacter {\n id: string;\n type: string;\n visActorType: string;\n spec: ICharacterSpec;\n graphic: Graphic | IGroup;\n\n init: () => void;\n reset: () => void;\n show: () => void;\n hide: () => void;\n getGraphicParent: () => IGroup;\n getLayoutBounds: () => IBoundsLike;\n tickTo: (t: number) => void;\n\n checkEvent: (event: StoryEvent) => false | (ICharacterPickInfo & any);\n\n updateSpec: (spec: Omit<Partial<ICharacterSpec>, 'id' | 'type'>) => void;\n\n setAttributes: (attr: Record<string, any>) => void;\n release: () => void;\n}\n\nexport interface ICharacterInitOption {\n story: IStory;\n canvas: IStoryCanvas;\n graphicParent: IGroup;\n}\n\nexport interface ICharacterConstructor {\n new (spec: ICharacterSpec, option: ICharacterInitOption): ICharacter;\n}\n\nexport interface ILayoutAttribute {\n x: number;\n y: number;\n width: number;\n height: number;\n angle: number;\n anchor?: [number | string, number | string];\n dx?: number;\n dy?: number;\n shapePoints?: IPointLike[];\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ICharacterSpec } from 'src/story/character/dsl-interface';
|
|
1
|
+
import type { ICharacterSpec } from 'src/story/character/dsl-interface';
|
|
2
2
|
import { CharacterBase } from '../base/base';
|
|
3
3
|
import type { ISpecProcess, ICharacterVisactor } from './interface';
|
|
4
|
-
import { ICharacterInitOption } from '../runtime-interface';
|
|
5
|
-
import { IChartCharacterRuntime } from '../chart/runtime/interface';
|
|
4
|
+
import type { ICharacterInitOption } from '../runtime-interface';
|
|
5
|
+
import type { IChartCharacterRuntime } from '../chart/runtime/interface';
|
|
6
6
|
export declare abstract class CharacterVisactor extends CharacterBase implements ICharacterVisactor {
|
|
7
7
|
protected _specProcess: ISpecProcess;
|
|
8
8
|
get specProcess(): ISpecProcess;
|
|
@@ -24,6 +24,21 @@ export declare abstract class CharacterVisactor extends CharacterBase implements
|
|
|
24
24
|
show(): void;
|
|
25
25
|
hide(): void;
|
|
26
26
|
getGraphicParent(): any;
|
|
27
|
+
getViewBoxFromSpec(): {
|
|
28
|
+
layout: Partial<import("../runtime-interface").ILayoutAttribute>;
|
|
29
|
+
viewBox: {
|
|
30
|
+
x1: number;
|
|
31
|
+
x2: number;
|
|
32
|
+
y1: number;
|
|
33
|
+
y2: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
getLayoutBounds(): {
|
|
37
|
+
x1: number;
|
|
38
|
+
x2: number;
|
|
39
|
+
y1: number;
|
|
40
|
+
y2: number;
|
|
41
|
+
};
|
|
27
42
|
tickTo(t: number): void;
|
|
28
43
|
release(): void;
|
|
29
44
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.CharacterVisactor = void 0;
|
|
6
6
|
|
|
7
|
-
const base_1 = require("../base/base");
|
|
7
|
+
const base_1 = require("../base/base"), layout_1 = require("../../utils/layout");
|
|
8
8
|
|
|
9
9
|
class CharacterVisactor extends base_1.CharacterBase {
|
|
10
10
|
get specProcess() {
|
|
@@ -43,6 +43,22 @@ class CharacterVisactor extends base_1.CharacterBase {
|
|
|
43
43
|
getGraphicParent() {
|
|
44
44
|
return this._graphic;
|
|
45
45
|
}
|
|
46
|
+
getViewBoxFromSpec() {
|
|
47
|
+
const layout = (0, layout_1.getLayoutFromWidget)(this._spec.position);
|
|
48
|
+
return {
|
|
49
|
+
layout: layout,
|
|
50
|
+
viewBox: {
|
|
51
|
+
x1: layout.x,
|
|
52
|
+
x2: layout.x + layout.width,
|
|
53
|
+
y1: layout.y,
|
|
54
|
+
y2: layout.y + layout.height
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
getLayoutBounds() {
|
|
59
|
+
const {viewBox: viewBox} = this.getViewBoxFromSpec();
|
|
60
|
+
return viewBox;
|
|
61
|
+
}
|
|
46
62
|
tickTo(t) {}
|
|
47
63
|
release() {
|
|
48
64
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/story/character/visactor/character.ts"],"names":[],"mappings":";;;AAEA,uCAA6C;
|
|
1
|
+
{"version":3,"sources":["../src/story/character/visactor/character.ts"],"names":[],"mappings":";;;AAEA,uCAA6C;AAI7C,+CAAyD;AAEzD,MAAsB,iBAAkB,SAAQ,oBAAa;IAE3D,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IACD,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC;IAC7C,CAAC;IAED,IAAI,SAAS;;QACX,OAAO,MAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,QAAQ,0CAAE,YAAY,EAAE,CAAC;IACtE,CAAC;IAED,IAAI,QAAQ;;QACV,OAAO,MAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,QAAQ,0CAAE,IAAI,CAAC;IAC5D,CAAC;IAID,YAAY,IAAoB,EAAE,MAA4B;QAC5D,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAHZ,aAAQ,GAA6B,EAAE,CAAC;QAiBlD,gBAAW,GAAG,GAAG,EAAE;;YACjB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,WAAW,iDAAI,CAAA,EAAA,CAAC,CAAC;YAC9C,MAAA,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,QAAQ,0CAAE,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE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,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC3C,CAAC;CACF;AAlFD,8CAkFC","file":"character.js","sourcesContent":["/* eslint-disable no-console */\nimport type { ICharacterSpec } from 'src/story/character/dsl-interface';\nimport { CharacterBase } from '../base/base';\nimport type { ISpecProcess, ICharacterVisactor } from './interface';\nimport type { ICharacterInitOption } from '../runtime-interface';\nimport type { IChartCharacterRuntime } from '../chart/runtime/interface';\nimport { getLayoutFromWidget } from '../../utils/layout';\n\nexport abstract class CharacterVisactor extends CharacterBase implements ICharacterVisactor {\n protected declare _specProcess: ISpecProcess;\n get specProcess() {\n return this._specProcess;\n }\n get dataTempTransform() {\n return this._specProcess.dataTempTransform;\n }\n\n get chartType() {\n return this._specProcess.dataTempTransform.specTemp?.getChartType();\n }\n\n get tempType() {\n return this._specProcess.dataTempTransform.specTemp?.type;\n }\n\n protected _runtime: IChartCharacterRuntime[] = [];\n\n constructor(spec: ICharacterSpec, option: ICharacterInitOption) {\n super(spec, option);\n this._initSpecProcess();\n }\n\n protected _initRuntime(): void {\n return;\n }\n\n clearConfig(opt: { clearCurrent: false | { [key: string]: any } }) {\n // do nothing\n }\n\n protected abstract _initSpecProcess(): void;\n\n onSpecReady = () => {\n console.log('onSpecReady !');\n this._runtime.forEach(r => r.onSpecReady?.());\n this._specProcess.dataTempTransform.specTemp?.standardizedSpec(this._specProcess.getVisSpec(), { character: this });\n this._updateVisactorSpec();\n this._afterRender();\n };\n\n protected abstract _afterRender(): void;\n\n protected abstract _updateVisactorSpec(): void;\n\n show(): void {\n this._graphic.setAttribute('visibleAll', true);\n }\n hide(): void {\n this._graphic.setAttribute('visibleAll', false);\n }\n\n getGraphicParent() {\n return this._graphic;\n }\n\n getViewBoxFromSpec() {\n const layout = getLayoutFromWidget(this._spec.position);\n const viewBox = {\n x1: layout.x,\n x2: layout.x + layout.width,\n y1: layout.y,\n y2: layout.y + layout.height\n };\n return { layout, viewBox };\n }\n\n getLayoutBounds() {\n const { viewBox } = this.getViewBoxFromSpec();\n return viewBox;\n }\n\n tickTo(t: number): void {\n return;\n }\n\n release() {\n this._specProcess.release();\n this._graphic?.parent?.removeChild(this._graphic);\n this._specProcess = this._graphic = null;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/story/character/visactor/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IChartCharacterSpec } from '../dsl-interface';\nimport type { EventEmitter } from '@visactor/vutils';\nimport type { ICharacter } from '../runtime-interface';\nimport type { ISpec, IVChart } from '@visactor/vchart';\nimport type { IGroup } from '@visactor/vrender';\n\nexport type StandardData = IDataValue | IDataValue[];\nexport type IParserValue = any;\nexport type DataUpdateCall = (data: StandardData) => void;\nexport type DataErrorCall = (msg: { type: string; info: string }, opt?: any) => void;\n\n// visactor 元素的内部结构\n// 数据部分 start\n// DataParser:数据处理。负责解析数据,得到模版可用数据,处理数据上的特性内容。\n// VisactorTemp:模版处理。负责结合数据,生成对应类型的基础 spec。不同类型图表的特殊逻辑,在 temp 中处理\n// DataTempTransform:数据与模版更新管理,当数据/模版更新时,通过这个模块判定更新是否成功,成功后抛出更新成功消息。包含 VisactorTemp 与 DataParser\n// SpecProcess:编辑配置管理器,编辑属性更新的处理,对外输出合并了编辑信息的 spec 。包含一个 dataTempTransform\n// 数据部分 end\n\n// graphic 部分 start\n// IVisactorGraphic:包含一个 vchart|vtbale 。visactor 的自定义图元封装。处理图元是否重绘,viewBox的图元属性逻辑\n// IVisactorGraphic-render:实际的 draw 入口,处理绘图过程,主要是处理变换矩阵。\n// graphic 部分 end\n\n// Visactor-role:编辑元素,包含一个 specProcess、IVisactorGraphic\n\nexport interface IDataTempTransform {\n readonly specTemp: IVisactorTemp;\n\n readonly nextTemp: IVisactorTemp;\n emitter: EventEmitter;\n\n updateChartTemp: (temp?: string) => void;\n\n // 得到没有经过编辑器配置加工过的基础spec\n getBaseSpec: () => any;\n\n // 释放\n release: () => void;\n\n dataParser?: IDataParser;\n}\n\nexport interface IDataTempTransformConstructor {\n new ({ specProcess, character }: { character: ICharacterVisactor; specProcess: ISpecProcess }): IDataTempTransform;\n}\n\nexport interface ISpecProcess {\n dataTempTransform: IDataTempTransform;\n emitter: EventEmitter;\n\n // 得到visactor元素的spec\n getVisSpec: () => ISpec;\n // 得到角色的spec\n getCharacterSpec: () => IChartCharacterSpec;\n\n // temp\n getCharacterType: () => string;\n\n release: () => void;\n}\n\nexport type IDataType = any;\n\nexport interface IDataValue {\n id: string;\n sourceKey: string;\n values: IDataType[];\n}\n\nexport type DataInfo = {\n [key: string]: {\n type: 'ordinal' | 'linear';\n };\n};\n\nexport type DataSave = {\n type: string;\n value: any;\n};\n\nexport interface IDataParser {\n type: string;\n getData: () => StandardData;\n getDataValue: () => IParserValue;\n getDataInfo?: () => DataInfo;\n getSpecOption?: () => any;\n getSave: () => DataSave;\n updateValue: (value: IParserValue) => void;\n setDataUpdateHandler: (call: DataUpdateCall) => void;\n setDataErrorHandler: (call: DataErrorCall) => void;\n clear: () => void;\n}\n\nexport interface IDataParserConstructor {\n type: string;\n new (\n value: any,\n option: {\n updateCall: DataUpdateCall;\n errorCall: DataErrorCall;\n currentData?: IDataParser;\n emitter: EventEmitter;\n }\n ): IDataParser;\n}\n\n// chart & table 都是用这个模版接口\nexport interface IVisactorTemp {\n type: string;\n getSpec: (data: StandardData, ctx: any, opt?: any) => ISpec | null;\n standardizedSpec: (spec: any, ctx: any, opt?: any) => void;\n getChartType: () => string;\n checkDataEnable: (data: StandardData, opt?: any) => boolean;\n getTempInfo?: () => any;\n clear: () => void;\n}\n\nexport interface IVisactorTempConstructor {\n new (): IVisactorTemp;\n}\n\n// 绘图元素\nexport interface IVisactorGraphic extends IGroup {\n readonly vProduct: IVChart;\n\n updateSpec: (spec: any) => void;\n release: () => void;\n}\n\n// 编辑元素\nexport interface ICharacterVisactor extends ICharacter {\n // 清除编辑数据\n clearConfig: (opt: { clearCurrent: false | { [key: string]: any } }) => void;\n getGraphicParent: () => IVisactorGraphic;\n}\n\nexport interface IUpdateAttributeOption {\n triggerHistory?: boolean;\n saveData?: boolean;\n actionType?: 'data-add' | 'data-change' | 'data-replace' | string;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/story/character/visactor/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IChartCharacterSpec } from '../dsl-interface';\nimport type { EventEmitter, IBoundsLike } from '@visactor/vutils';\nimport type { ICharacter } from '../runtime-interface';\nimport type { ISpec, IVChart } from '@visactor/vchart';\nimport type { IGroup } from '@visactor/vrender';\n\nexport type StandardData = IDataValue | IDataValue[];\nexport type IParserValue = any;\nexport type DataUpdateCall = (data: StandardData) => void;\nexport type DataErrorCall = (msg: { type: string; info: string }, opt?: any) => void;\n\n// visactor 元素的内部结构\n// 数据部分 start\n// DataParser:数据处理。负责解析数据,得到模版可用数据,处理数据上的特性内容。\n// VisactorTemp:模版处理。负责结合数据,生成对应类型的基础 spec。不同类型图表的特殊逻辑,在 temp 中处理\n// DataTempTransform:数据与模版更新管理,当数据/模版更新时,通过这个模块判定更新是否成功,成功后抛出更新成功消息。包含 VisactorTemp 与 DataParser\n// SpecProcess:编辑配置管理器,编辑属性更新的处理,对外输出合并了编辑信息的 spec 。包含一个 dataTempTransform\n// 数据部分 end\n\n// graphic 部分 start\n// IVisactorGraphic:包含一个 vchart|vtbale 。visactor 的自定义图元封装。处理图元是否重绘,viewBox的图元属性逻辑\n// IVisactorGraphic-render:实际的 draw 入口,处理绘图过程,主要是处理变换矩阵。\n// graphic 部分 end\n\n// Visactor-role:编辑元素,包含一个 specProcess、IVisactorGraphic\n\nexport interface IDataTempTransform {\n readonly specTemp: IVisactorTemp;\n\n readonly nextTemp: IVisactorTemp;\n emitter: EventEmitter;\n\n updateChartTemp: (temp?: string) => void;\n\n // 得到没有经过编辑器配置加工过的基础spec\n getBaseSpec: () => any;\n\n // 释放\n release: () => void;\n\n dataParser?: IDataParser;\n}\n\nexport interface IDataTempTransformConstructor {\n new ({ specProcess, character }: { character: ICharacterVisactor; specProcess: ISpecProcess }): IDataTempTransform;\n}\n\nexport interface ISpecProcess {\n dataTempTransform: IDataTempTransform;\n emitter: EventEmitter;\n\n // 得到visactor元素的spec\n getVisSpec: () => ISpec;\n // 得到角色的spec\n getCharacterSpec: () => IChartCharacterSpec;\n\n // temp\n getCharacterType: () => string;\n\n release: () => void;\n}\n\nexport type IDataType = any;\n\nexport interface IDataValue {\n id: string;\n sourceKey: string;\n values: IDataType[];\n}\n\nexport type DataInfo = {\n [key: string]: {\n type: 'ordinal' | 'linear';\n };\n};\n\nexport type DataSave = {\n type: string;\n value: any;\n};\n\nexport interface IDataParser {\n type: string;\n getData: () => StandardData;\n getDataValue: () => IParserValue;\n getDataInfo?: () => DataInfo;\n getSpecOption?: () => any;\n getSave: () => DataSave;\n updateValue: (value: IParserValue) => void;\n setDataUpdateHandler: (call: DataUpdateCall) => void;\n setDataErrorHandler: (call: DataErrorCall) => void;\n clear: () => void;\n}\n\nexport interface IDataParserConstructor {\n type: string;\n new (\n value: any,\n option: {\n updateCall: DataUpdateCall;\n errorCall: DataErrorCall;\n currentData?: IDataParser;\n emitter: EventEmitter;\n }\n ): IDataParser;\n}\n\n// chart & table 都是用这个模版接口\nexport interface IVisactorTemp {\n type: string;\n getSpec: (data: StandardData, ctx: any, opt?: any) => ISpec | null;\n standardizedSpec: (spec: any, ctx: any, opt?: any) => void;\n getChartType: () => string;\n checkDataEnable: (data: StandardData, opt?: any) => boolean;\n getTempInfo?: () => any;\n clear: () => void;\n}\n\nexport interface IVisactorTempConstructor {\n new (): IVisactorTemp;\n}\n\n// 绘图元素\nexport interface IVisactorGraphic extends IGroup {\n readonly vProduct: IVChart;\n\n updateSpec: (spec: any) => void;\n release: () => void;\n}\n\n// 编辑元素\nexport interface ICharacterVisactor extends ICharacter {\n // 清除编辑数据\n clearConfig: (opt: { clearCurrent: false | { [key: string]: any } }) => void;\n getGraphicParent: () => IVisactorGraphic;\n}\n\nexport interface IUpdateAttributeOption {\n triggerHistory?: boolean;\n saveData?: boolean;\n actionType?: 'data-add' | 'data-change' | 'data-replace' | string;\n}\n"]}
|
package/cjs/story/index.js
CHANGED
|
@@ -19,18 +19,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
19
19
|
value: !0
|
|
20
20
|
}), exports.registerCharacter = void 0;
|
|
21
21
|
|
|
22
|
-
const character_qipao_1 = require("./character/component/characters/character-qipao"), character_rect_1 = require("./character/component/characters/character-rect"), factory_1 = require("./factory/factory"), vrender_1 = require("@visactor/vrender"), vrender_2 = require("@visactor/vrender"), vchart_graphic_render_1 = require("./character/chart/graphic/vchart-graphic-render"), character_text_1 = require("./character/component/characters/character-text"), vchart_graphic_picker_1 = require("./character/chart/graphic/vchart-graphic-picker"), character_1 = require("../constants/character"), character_line_1 = require("./character/component/characters/character-line"), character_image_1 = require("./character/component/characters/character-image"), character_shape_1 = require("./character/component/characters/character-shape"), vchart_1 = require("./character/chart/characters/vchart"), component_group_graphic_render_1 = require("./character/component/character-group/component-group-graphic-render"), character_timeline_1 = require("./character/component/characters/character-timeline"), splitModule = new vrender_1.ContainerModule((bind => {
|
|
22
|
+
const character_qipao_1 = require("./character/component/characters/character-qipao"), character_rect_1 = require("./character/component/characters/character-rect"), factory_1 = require("./factory/factory"), vrender_1 = require("@visactor/vrender"), vrender_2 = require("@visactor/vrender"), vchart_graphic_render_1 = require("./character/chart/graphic/vchart-graphic-render"), character_text_1 = require("./character/component/characters/character-text"), vchart_graphic_picker_1 = require("./character/chart/graphic/vchart-graphic-picker"), character_1 = require("../constants/character"), character_line_1 = require("./character/component/characters/character-line"), character_image_1 = require("./character/component/characters/character-image"), character_shape_1 = require("./character/component/characters/character-shape"), vchart_1 = require("./character/chart/characters/vchart"), component_group_graphic_render_1 = require("./character/component/character-group/component-group-graphic-render"), character_timeline_1 = require("./character/component/characters/character-timeline"), rankingBar_1 = require("./character/chart/characters/rankingBar"), splitModule = new vrender_1.ContainerModule((bind => {
|
|
23
23
|
bind(vchart_graphic_render_1.VChartRender).toSelf().inSingletonScope(), bind(vchart_graphic_render_1.ChartRender).toService(vchart_graphic_render_1.VChartRender),
|
|
24
24
|
bind(vrender_1.GraphicRender).toService(vchart_graphic_render_1.ChartRender), bind(vchart_graphic_picker_1.VChartPicker).to(vchart_graphic_picker_1.VChartPicker).inSingletonScope(),
|
|
25
25
|
bind(vrender_2.CanvasPickerContribution).toService(vchart_graphic_picker_1.VChartPicker),
|
|
26
26
|
bind(component_group_graphic_render_1.ComponentGroupRender).toSelf().inSingletonScope(),
|
|
27
27
|
bind(vrender_1.GraphicRender).toService(component_group_graphic_render_1.ComponentGroupRender);
|
|
28
|
+
})), editPlugin = new vrender_1.ContainerModule((bind => {
|
|
29
|
+
bind(vrender_1.RichTextEditPlugin).toSelf(), bind(vrender_1.AutoEnablePlugins).toService(vrender_1.RichTextEditPlugin);
|
|
28
30
|
}));
|
|
29
31
|
|
|
30
32
|
let _register = !1;
|
|
31
33
|
|
|
32
34
|
function registerCharacter() {
|
|
33
35
|
_register || (_register = !0, factory_1.StoryFactory.registerCharacter(vchart_1.VChartCharacter.type, vchart_1.VChartCharacter),
|
|
36
|
+
factory_1.StoryFactory.registerCharacter(rankingBar_1.RankingBarCharacter.type, rankingBar_1.RankingBarCharacter),
|
|
34
37
|
factory_1.StoryFactory.registerCharacter(character_1.StoryComponentType.RECT, character_rect_1.CharacterComponentRect),
|
|
35
38
|
factory_1.StoryFactory.registerCharacter(character_1.StoryComponentType.TEXT, character_text_1.CharacterComponentText),
|
|
36
39
|
factory_1.StoryFactory.registerCharacter(character_1.StoryComponentType.QIPAO, character_qipao_1.CharacterComponentQipao),
|
|
@@ -38,7 +41,7 @@ function registerCharacter() {
|
|
|
38
41
|
factory_1.StoryFactory.registerCharacter(character_1.StoryComponentType.IMAGE, character_image_1.CharacterComponentImage),
|
|
39
42
|
factory_1.StoryFactory.registerCharacter(character_1.StoryComponentType.SHAPE, character_shape_1.CharacterComponentShape),
|
|
40
43
|
factory_1.StoryFactory.registerCharacter(character_1.StoryComponentType.TIMELINE, character_timeline_1.CharacterComponentTimeline),
|
|
41
|
-
vrender_1.container.load(splitModule));
|
|
44
|
+
vrender_1.container.load(splitModule), vrender_1.container.load(editPlugin));
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
exports.registerCharacter = registerCharacter, registerCharacter(), __exportStar(require("./story"), exports);
|
package/cjs/story/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/story/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sFAA2F;AAC3F,oFAAyF;AACzF,+CAAiD;AACjD,+
|
|
1
|
+
{"version":3,"sources":["../src/story/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sFAA2F;AAC3F,oFAAyF;AACzF,+CAAiD;AACjD,+CAAqH;AACrH,+CAA6D;AAC7D,2FAA4F;AAC5F,oFAAyF;AAEzF,2FAA+E;AAC/E,sDAA4D;AAC5D,oFAAyF;AACzF,sFAA2F;AAC3F,sFAA2F;AAC3F,gEAAsE;AACtE,yHAA4G;AAC5G,4FAAiG;AACjG,wEAA8E;AAE9E,MAAM,WAAW,GAAG,IAAI,yBAAe,CAAC,IAAI,CAAC,EAAE;IAE7C,IAAI,CAAC,oCAAY,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC/C,IAAI,CAAC,mCAAW,CAAC,CAAC,SAAS,CAAC,oCAAY,CAAC,CAAC;IAC1C,IAAI,CAAC,uBAAa,CAAC,CAAC,SAAS,CAAC,mCAAW,CAAC,CAAC;IAC3C,IAAI,CAAC,oCAAY,CAAC,CAAC,EAAE,CAAC,oCAAY,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACvD,IAAI,CAAC,kCAAwB,CAAC,CAAC,SAAS,CAAC,oCAAY,CAAC,CAAC;IAGvD,IAAI,CAAC,qDAAoB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC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,IAAI,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC;AAtBD,8CAsBC;AAED,iBAAiB,EAAE,CAAC;AAEpB,0CAAwB","file":"index.js","sourcesContent":["import { CharacterComponentQipao } from './character/component/characters/character-qipao';\nimport { CharacterComponentRect } from './character/component/characters/character-rect';\nimport { StoryFactory } from './factory/factory';\nimport { AutoEnablePlugins, ContainerModule, GraphicRender, RichTextEditPlugin, container } from '@visactor/vrender';\nimport { CanvasPickerContribution } from '@visactor/vrender';\nimport { ChartRender, VChartRender } from './character/chart/graphic/vchart-graphic-render';\nimport { CharacterComponentText } from './character/component/characters/character-text';\n// import { CharacterComponentRichText } from './character/component/characters/character-richtext';\nimport { VChartPicker } from './character/chart/graphic/vchart-graphic-picker';\nimport { StoryComponentType } from '../constants/character';\nimport { CharacterComponentLine } from './character/component/characters/character-line';\nimport { CharacterComponentImage } from './character/component/characters/character-image';\nimport { CharacterComponentShape } from './character/component/characters/character-shape';\nimport { VChartCharacter } from './character/chart/characters/vchart';\nimport { ComponentGroupRender } from './character/component/character-group/component-group-graphic-render';\nimport { CharacterComponentTimeline } from './character/component/characters/character-timeline';\nimport { RankingBarCharacter } from './character/chart/characters/rankingBar';\n\nconst splitModule = new ContainerModule(bind => {\n // chart渲染器注入\n bind(VChartRender).toSelf().inSingletonScope();\n bind(ChartRender).toService(VChartRender);\n bind(GraphicRender).toService(ChartRender);\n bind(VChartPicker).to(VChartPicker).inSingletonScope();\n bind(CanvasPickerContribution).toService(VChartPicker);\n\n // component渲染器注入\n bind(ComponentGroupRender).toSelf().inSingletonScope();\n bind(GraphicRender).toService(ComponentGroupRender);\n});\n\nconst editPlugin = new ContainerModule(bind => {\n bind(RichTextEditPlugin).toSelf();\n bind(AutoEnablePlugins).toService(RichTextEditPlugin);\n});\n\nlet _register = false;\nexport function registerCharacter() {\n if (_register) {\n return;\n }\n _register = true;\n StoryFactory.registerCharacter(VChartCharacter.type, VChartCharacter);\n StoryFactory.registerCharacter(RankingBarCharacter.type, RankingBarCharacter);\n\n // StoryFactory.registerCharacter('BarChart', CharacterChart);\n // StoryFactory.registerCharacter('CharacterChart', CharacterChart);\n // StoryFactory.registerCharacter('LineChart', CharacterChart);\n StoryFactory.registerCharacter(StoryComponentType.RECT, CharacterComponentRect);\n StoryFactory.registerCharacter(StoryComponentType.TEXT, CharacterComponentText);\n // StoryFactory.registerCharacter(StoryComponentType.RICH_TEXT, CharacterComponentRichText);\n StoryFactory.registerCharacter(StoryComponentType.QIPAO, CharacterComponentQipao);\n StoryFactory.registerCharacter(StoryComponentType.LINE, CharacterComponentLine);\n StoryFactory.registerCharacter(StoryComponentType.IMAGE, CharacterComponentImage);\n StoryFactory.registerCharacter(StoryComponentType.SHAPE, CharacterComponentShape);\n StoryFactory.registerCharacter(StoryComponentType.TIMELINE, CharacterComponentTimeline);\n\n container.load(splitModule);\n container.load(editPlugin);\n}\n\nregisterCharacter();\n\nexport * from './story';\n"]}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type { IRankingBarPlayAction } from './../../player/processor/chart/rankingBar/rankingBar';
|
|
1
2
|
import type { IChartAddAction, IChartUpdateAction } from '../../player/processor/chart/vchart';
|
|
2
3
|
import type { IChartVisibilityAction, IComponentVisibilityAction } from '../../player/processor/interface/appear-action';
|
|
3
4
|
import type { IComponentBounceAction, IComponentMoveToAction, IComponentScaleToAction, IComponentStyleAction } from '../../player/processor/interface/style-action';
|
|
4
5
|
import type { ICharacterSpec } from '../character';
|
|
5
|
-
export type IActionSpec = IComponentStyleAction | IComponentVisibilityAction | IComponentMoveToAction | IComponentScaleToAction | IComponentBounceAction | IChartVisibilityAction | IChartUpdateAction | IChartAddAction;
|
|
6
|
+
export type IActionSpec = IComponentStyleAction | IComponentVisibilityAction | IComponentMoveToAction | IComponentScaleToAction | IComponentBounceAction | IChartVisibilityAction | IChartUpdateAction | IChartAddAction | IRankingBarPlayAction;
|
|
6
7
|
export interface IStorySpec {
|
|
7
8
|
acts: IActSpec[];
|
|
8
9
|
characters: ICharacterSpec[];
|
|
9
10
|
}
|
|
10
11
|
export interface IActionsLink {
|
|
11
|
-
characterId: string;
|
|
12
|
+
characterId: string | string[];
|
|
12
13
|
characterActions: IActionSpec[];
|
|
13
14
|
}
|
|
14
15
|
export type ISceneSpec = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/story/interface/dsl-interface.ts"],"names":[],"mappings":"","file":"dsl-interface.js","sourcesContent":["import type { IChartAddAction, IChartUpdateAction } from '../../player/processor/chart/vchart';\nimport type {\n IChartVisibilityAction,\n IComponentVisibilityAction\n
|
|
1
|
+
{"version":3,"sources":["../src/story/interface/dsl-interface.ts"],"names":[],"mappings":"","file":"dsl-interface.js","sourcesContent":["import type { IRankingBarPlayAction } from './../../player/processor/chart/rankingBar/rankingBar';\nimport type { IChartAddAction, IChartUpdateAction } from '../../player/processor/chart/vchart';\nimport type {\n IChartVisibilityAction,\n IComponentVisibilityAction\n} from '../../player/processor/interface/appear-action';\nimport type {\n IComponentBounceAction,\n IComponentMoveToAction,\n IComponentScaleToAction,\n IComponentStyleAction\n} from '../../player/processor/interface/style-action';\nimport type { ICharacterSpec } from '../character';\n\nexport type IActionSpec =\n | IComponentStyleAction\n | IComponentVisibilityAction\n | IComponentMoveToAction\n | IComponentScaleToAction\n | IComponentBounceAction\n | IChartVisibilityAction\n | IChartUpdateAction\n | IChartAddAction\n | IRankingBarPlayAction;\n\nexport interface IStorySpec {\n acts: IActSpec[]; // 作品的章节\n characters: ICharacterSpec[]; // 作品中的元素\n}\n\nexport interface IActionsLink {\n characterId: string | string[];\n characterActions: IActionSpec[];\n}\n\nexport type ISceneSpec = {\n id: string;\n delay?: number; // 入场延迟,可以是正数或者负数\n actions: IActionsLink[];\n};\n\nexport interface IActSpec {\n id: string;\n scenes: ISceneSpec[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/story/interface/runtime-interface.ts"],"names":[],"mappings":"","file":"runtime-interface.js","sourcesContent":["import type { IGraphic, IStage } from '@visactor/vrender';\nimport type { ICharacter, ICharacterSpec } from '../character';\nimport type { IPlayer } from '../../player/interface/player';\n\nexport interface IStoryInitOption {\n dom: string | HTMLDivElement; // dom id\n playerOption?: {\n scaleX?: number;\n scaleY?: number;\n };\n}\n\nexport interface IStoryCanvas {\n getStage: () => IStage;\n getCanvas: () => HTMLCanvasElement;\n getEventDetail: (event: StoryEvent) => {\n character: ICharacter;\n characterInfo: undefined;\n };\n release: () => void;\n}\n\nexport interface IStory {\n readonly id: string;\n readonly player: IPlayer;\n canvas: IStoryCanvas;\n getCharacters: () => { [key: string]: ICharacter };\n getCharactersById: (key: string) => ICharacter | null;\n}\nexport interface ICharacterTree {\n getCharacters: () => { [key: string]: ICharacter };\n getCharactersById: (key: string) => ICharacter | null;\n addCharacter: (spec: ICharacterSpec) => ICharacter;\n initCharacters: (spec: ICharacterSpec[]) => void;\n}\n\nexport type StoryEvent = Event & {\n detailPath: IGraphic[];\n path: IGraphic[];\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/story/interface/runtime-interface.ts"],"names":[],"mappings":"","file":"runtime-interface.js","sourcesContent":["import type { IGraphic, IStage } from '@visactor/vrender';\nimport type { ICharacter, ICharacterSpec } from '../character';\nimport type { IPlayer } from '../../player/interface/player';\n\nexport interface IStoryInitOption {\n dom: string | HTMLDivElement; // dom id\n playerOption?: {\n scaleX?: number;\n scaleY?: number;\n };\n}\n\nexport interface IStoryCanvas {\n getStage: () => IStage;\n getCanvas: () => HTMLCanvasElement;\n getEventDetail: (event: StoryEvent) => {\n character: ICharacter;\n characterInfo: undefined;\n };\n release: () => void;\n}\n\nexport interface IStory {\n readonly id: string;\n readonly player: IPlayer;\n canvas: IStoryCanvas;\n getCharacters: () => { [key: string]: ICharacter };\n getCharactersById: (key: string) => ICharacter | null;\n}\nexport interface ICharacterTree {\n getCharacters: () => { [key: string]: ICharacter };\n getCharactersById: (key: string) => ICharacter | null;\n addCharacter: (spec: ICharacterSpec) => ICharacter;\n initCharacters: (spec: ICharacterSpec[]) => void;\n}\n\nexport type StoryEvent = Event & {\n detailPath: IGraphic[];\n path: IGraphic[];\n canvasX?: number;\n canvasY?: number;\n};\n"]}
|
package/cjs/story/story.js
CHANGED
|
@@ -45,10 +45,11 @@ class Story {
|
|
|
45
45
|
this.id = "test-mvp_" + Story._id_++, this._canvas = new canvas_1.StoryCanvas(this, (0,
|
|
46
46
|
vutils_1.isString)(option.dom) ? document.getElementById(option.dom) : option.dom),
|
|
47
47
|
this._player = new player_1.Player(this, option.playerOption), this._characterTree = new character_tree_1.CharacterTree(this),
|
|
48
|
-
|
|
48
|
+
spec && this.load(spec);
|
|
49
49
|
}
|
|
50
50
|
load(spec) {
|
|
51
|
-
this._characterTree.initCharacters(spec.characters),
|
|
51
|
+
this._spec = spec, spec && (this._characterTree.initCharacters(spec.characters),
|
|
52
|
+
this._player.initActs(spec.acts));
|
|
52
53
|
}
|
|
53
54
|
getCharacters() {
|
|
54
55
|
return this._characterTree.getCharacters();
|
package/cjs/story/story.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/story/story.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,6CAA4C;AAG5C,4CAA8C;AAG9C,+CAAmE;AACnE,oEAAgE;AAEhE,6CAA0C;AAG1C,uBAAa,CAAC,WAAW,CAAC,yBAAe,CAAC,CAAC;AAE3C,MAAa,KAAK;IAahB,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,YAAY,IAAgB,EAAE,MAAwB;QACpD,IAAI,CAAC,EAAE,GAAG,WAAW,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,IAAI,oBAAW,CAC5B,IAAI,EACJ,IAAA,iBAAQ,EAAC,MAAM,CAAC,GAAG,C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type { ICharacterSpec } from './character/dsl-interface';\nimport { isString } from '@visactor/vutils';\nimport type { ICharacterTree, IStory, IStoryCanvas, IStoryInitOption } from './interface/runtime-interface';\nimport type { ICharacter } from './character/runtime-interface';\nimport { StoryCanvas } from './canvas/canvas';\nimport type { IStorySpec, IActSpec } from './interface';\nimport { StoryFactory } from './factory/factory';\nimport { defaultTicker, defaultTimeline } from '@visactor/vrender';\nimport { CharacterTree } from './character-tree/character-tree';\nimport type { IPlayer } from '../player/interface/player';\nimport { Player } from '../player/player';\nimport { logger } from '../util/output';\n\ndefaultTicker.remTimeline(defaultTimeline);\n\nexport class Story implements IStory {\n static _id_ = 0;\n\n protected _player: IPlayer;\n\n readonly id: string;\n\n protected _canvas: IStoryCanvas;\n\n protected _characterTree: ICharacterTree;\n\n protected _spec: IStorySpec;\n\n get canvas() {\n return this._canvas;\n }\n\n get player(): IPlayer {\n return this._player;\n }\n\n constructor(spec: IStorySpec, option: IStoryInitOption) {\n this.id = 'test-mvp_' + Story._id_++;\n this._canvas = new StoryCanvas(\n this,\n isString(option.dom) ? (document.getElementById(option.dom) as HTMLDivElement) : option.dom\n );\n this._player = new Player(this, option.playerOption);\n\n this._characterTree = new CharacterTree(this);\n spec && this.load(spec);\n }\n\n load(spec: IStorySpec) {\n this._spec = spec;\n if (!spec) {\n return;\n }\n this._characterTree.initCharacters(spec.characters);\n this._player.initActs(spec.acts);\n }\n\n getCharacters(): { [key: string]: ICharacter } {\n return this._characterTree.getCharacters();\n }\n\n getCharactersById(key: string) {\n return this._characterTree.getCharactersById(key);\n }\n\n // private _createAct(spec: IActSpec) {\n // this._player.addAct(spec, this._characters);\n // }\n\n play(loop: boolean = true) {\n // player 开始播放\n this._spec && this.load(this._spec);\n this._player.play();\n if (loop) {\n this._player.once('onstop', () => {\n this.play(loop);\n });\n }\n }\n\n pause() {\n this._player.pause();\n return;\n }\n\n async encodeToVideo(actIndexOrId: number, millsecond: number, fps: number) {\n return this._player.encodeToVideo(millsecond, fps);\n }\n\n getPlayer() {\n return this._player;\n }\n\n release() {\n this._player.release();\n this._canvas.release();\n }\n}\n"]}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { IRect } from '../../type/space';
|
|
1
2
|
import type { ILayoutAttribute, IWidgetData } from '../character';
|
|
2
|
-
export declare function getLayoutFromWidget(w: Partial<IWidgetData>): Partial<ILayoutAttribute>;
|
|
3
|
+
export declare function getLayoutFromWidget(w: Partial<IWidgetData> | IRect): Partial<ILayoutAttribute>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/story/utils/layout.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"sources":["../src/story/utils/layout.ts"],"names":[],"mappings":";;;AAGA,SAAgB,mBAAmB,CAAC,CAA+B;IACjE,OAAO;QACL,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1B,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACzB,KAAK,EAAE,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAU,CAAS,CAAC,KAAK,GAAW,CAAC,CAAC,IAAI;QACzE,MAAM,EAAE,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAU,CAAS,CAAC,MAAM,GAAW,CAAC,CAAC,GAAG;KAC7E,CAAC;AACJ,CAAC;AAPD,kDAOC","file":"layout.js","sourcesContent":["import type { IRect } from '../../type/space';\nimport type { ILayoutAttribute, IWidgetData } from '../character';\n\nexport function getLayoutFromWidget(w: Partial<IWidgetData> | IRect): Partial<ILayoutAttribute> {\n return {\n x: 'x' in w ? w.x : w.left,\n y: 'y' in w ? w.y : w.top,\n width: 'width' in w ? w.width : <number>(w as any).right - <number>w.left,\n height: 'height' in w ? w.height : <number>(w as any).bottom - <number>w.top\n };\n}\n"]}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { IGraphic } from '@visactor/vrender';
|
|
2
|
+
import type { IVChart } from '@visactor/vchart';
|
|
3
|
+
import type { StoryEvent } from '../interface/runtime-interface';
|
|
4
|
+
export interface IPickModelInfo {
|
|
5
|
+
type: string;
|
|
6
|
+
model: any;
|
|
7
|
+
specKey: string;
|
|
8
|
+
specIndex: number;
|
|
9
|
+
datum?: any;
|
|
10
|
+
mark?: any;
|
|
11
|
+
}
|
|
12
|
+
export declare const seriesMarkPick: {
|
|
13
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
14
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number) => {
|
|
15
|
+
type: string;
|
|
16
|
+
model: import("@visactor/vchart").ISeries;
|
|
17
|
+
mark: import("@visactor/vchart/esm/mark/interface").IMark;
|
|
18
|
+
specKey: string;
|
|
19
|
+
specIndex: number;
|
|
20
|
+
datum: any;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare const axisMarkPick: {
|
|
24
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
25
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number) => {
|
|
26
|
+
type: any;
|
|
27
|
+
model: any;
|
|
28
|
+
specKey: any;
|
|
29
|
+
specIndex: any;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const markerMarkPick: {
|
|
33
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
34
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[]) => {
|
|
35
|
+
type: any;
|
|
36
|
+
model: any;
|
|
37
|
+
specKey: any;
|
|
38
|
+
specIndex: any;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare const labelMarkPick: {
|
|
42
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
43
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number) => {
|
|
44
|
+
datum: any;
|
|
45
|
+
type: any;
|
|
46
|
+
model: any;
|
|
47
|
+
specKey: any;
|
|
48
|
+
specIndex: any;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare const discreteLegendMarkPick: {
|
|
52
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
53
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number) => {
|
|
54
|
+
type: any;
|
|
55
|
+
model: any;
|
|
56
|
+
specKey: any;
|
|
57
|
+
specIndex: any;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare const colorLegendMarkPick: {
|
|
61
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
62
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number) => {
|
|
63
|
+
type: any;
|
|
64
|
+
model: any;
|
|
65
|
+
specKey: any;
|
|
66
|
+
specIndex: any;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export declare const sizeLegendMarkPick: {
|
|
70
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
71
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number) => {
|
|
72
|
+
type: any;
|
|
73
|
+
model: any;
|
|
74
|
+
specKey: any;
|
|
75
|
+
specIndex: any;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare const scrollBarMarkPick: {
|
|
79
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
80
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number) => {
|
|
81
|
+
type: any;
|
|
82
|
+
model: any;
|
|
83
|
+
specKey: any;
|
|
84
|
+
specIndex: any;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
export declare const titleBarMarkPick: {
|
|
88
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
89
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number) => {
|
|
90
|
+
type: any;
|
|
91
|
+
model: any;
|
|
92
|
+
specKey: any;
|
|
93
|
+
specIndex: any;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export declare const continuousPlayerMarkPick: {
|
|
97
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
98
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number) => {
|
|
99
|
+
type: any;
|
|
100
|
+
model: any;
|
|
101
|
+
specKey: any;
|
|
102
|
+
specIndex: any;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export declare const discretePlayerMarkPick: {
|
|
106
|
+
check: (graphic: IGraphic, graphicPath: IGraphic[]) => boolean;
|
|
107
|
+
modelInfo: (chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number) => {
|
|
108
|
+
type: any;
|
|
109
|
+
model: any;
|
|
110
|
+
specKey: any;
|
|
111
|
+
specIndex: any;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export declare function getChartModelWithEvent(chart: IVChart, event: StoryEvent): IPickModelInfo;
|
|
115
|
+
export declare function getGraphicModelMark(chart: IVChart, graphic: IGraphic, graphicPath: IGraphic[], index: number): IPickModelInfo;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function commonModelInfo(model) {
|
|
4
|
+
return {
|
|
5
|
+
type: model.type,
|
|
6
|
+
model: model,
|
|
7
|
+
specKey: model.specKey,
|
|
8
|
+
specIndex: model.getSpecIndex()
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(exports, "__esModule", {
|
|
13
|
+
value: !0
|
|
14
|
+
}), exports.getGraphicModelMark = exports.getChartModelWithEvent = exports.discretePlayerMarkPick = exports.continuousPlayerMarkPick = exports.titleBarMarkPick = exports.scrollBarMarkPick = exports.sizeLegendMarkPick = exports.colorLegendMarkPick = exports.discreteLegendMarkPick = exports.labelMarkPick = exports.markerMarkPick = exports.axisMarkPick = exports.seriesMarkPick = void 0,
|
|
15
|
+
exports.seriesMarkPick = {
|
|
16
|
+
check: (graphic, graphicPath) => {
|
|
17
|
+
var _a;
|
|
18
|
+
return null === (_a = graphic.name) || void 0 === _a ? void 0 : _a.startsWith("seriesGroup_");
|
|
19
|
+
},
|
|
20
|
+
modelInfo: (chart, graphic, graphicPath, index) => {
|
|
21
|
+
const seriesId = +graphic.name.split("_")[2], markId = +graphicPath[index + 1].name.split("_")[1], series = chart.getChart().getSeriesInIds([ seriesId ])[0], datum = graphicPath[graphicPath.length - 1].__vgrammar_scene_item__.data;
|
|
22
|
+
return {
|
|
23
|
+
type: "seriesMark",
|
|
24
|
+
model: series,
|
|
25
|
+
mark: series.getMarkInId(markId),
|
|
26
|
+
specKey: series.specKey,
|
|
27
|
+
specIndex: series.getSpecIndex(),
|
|
28
|
+
datum: datum
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}, exports.axisMarkPick = {
|
|
32
|
+
check: (graphic, graphicPath) => "axis" === graphic.name || "axis-grid" === graphic.name,
|
|
33
|
+
modelInfo: (chart, graphic, graphicPath, index) => {
|
|
34
|
+
const axisModel = chart.getChart().getAllComponents().filter((c => "axes" === c.specKey));
|
|
35
|
+
let axisGraphic = graphicPath.find((g => "axis" === g.name));
|
|
36
|
+
if (axisGraphic) {
|
|
37
|
+
return commonModelInfo(axisModel.find((a => a._axisMark.getProduct().graphicItem === axisGraphic.parent)));
|
|
38
|
+
}
|
|
39
|
+
if (axisGraphic = graphicPath.find((g => "axis-grid" === g.name)), axisGraphic) {
|
|
40
|
+
return commonModelInfo(axisModel.find((a => a._gridMark.getProduct().graphicItem === axisGraphic.parent)));
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const MarkerClassName = {
|
|
47
|
+
MarkLine: !0,
|
|
48
|
+
MarkArea: !0,
|
|
49
|
+
MarkPoint: !0,
|
|
50
|
+
MarkArcLine: !0,
|
|
51
|
+
MarkArcArea: !0
|
|
52
|
+
}, MarkerIdPrefix = {
|
|
53
|
+
markPoint: !0,
|
|
54
|
+
markLine: !0,
|
|
55
|
+
markArea: !0
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
function commonModePick(vrenderGraphicClassName, modelName) {
|
|
59
|
+
return {
|
|
60
|
+
check: (graphic, graphicPath) => graphic.constructor.name === vrenderGraphicClassName,
|
|
61
|
+
modelInfo: (chart, graphic, graphicPath, index) => commonModelInfo(chart.getChart().getAllComponents().find((c => c.type === modelName)))
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
exports.markerMarkPick = {
|
|
66
|
+
check: (graphic, graphicPath) => !!MarkerClassName[graphic.constructor.name],
|
|
67
|
+
modelInfo: (chart, graphic, graphicPath) => {
|
|
68
|
+
const idPrefix = graphic.id.split("-")[0];
|
|
69
|
+
let model;
|
|
70
|
+
if (MarkerIdPrefix[idPrefix]) {
|
|
71
|
+
const markerId = +graphic.id.split("-")[1];
|
|
72
|
+
model = chart.getChart().getAllComponents().find((c => c.id === markerId));
|
|
73
|
+
} else {
|
|
74
|
+
const markerUserId = graphic.id;
|
|
75
|
+
model = chart.getChart().getAllComponents().find((c => c.userId === markerUserId));
|
|
76
|
+
}
|
|
77
|
+
return commonModelInfo(model);
|
|
78
|
+
}
|
|
79
|
+
}, exports.labelMarkPick = {
|
|
80
|
+
check: (graphic, graphicPath) => "data-label" === graphic.name,
|
|
81
|
+
modelInfo: (chart, graphic, graphicPath, index) => {
|
|
82
|
+
const id = +graphicPath[index - 1].name.split("_")[1], model = chart.getChart().getAllComponents().find((c => ("label" === c.type || "totalLabel" === c.type) && c.getMarks().some((m => m.id === id))));
|
|
83
|
+
return Object.assign(Object.assign({}, commonModelInfo(model)), {
|
|
84
|
+
datum: graphicPath[graphicPath.length - 1].attribute.data
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}, exports.discreteLegendMarkPick = commonModePick("DiscreteLegend", "discreteLegend"),
|
|
88
|
+
exports.colorLegendMarkPick = commonModePick("ColorContinuousLegend", "colorLegend"),
|
|
89
|
+
exports.sizeLegendMarkPick = commonModePick("SizeContinuousLegend", "sizeLegend"),
|
|
90
|
+
exports.scrollBarMarkPick = commonModePick("ScrollBar", "scrollBar"), exports.titleBarMarkPick = commonModePick("Title", "title"),
|
|
91
|
+
exports.continuousPlayerMarkPick = commonModePick("ContinuousPlayer", "player"),
|
|
92
|
+
exports.discretePlayerMarkPick = commonModePick("DiscretePlayer", "player");
|
|
93
|
+
|
|
94
|
+
const modelCheck = [ exports.seriesMarkPick, exports.axisMarkPick, exports.discreteLegendMarkPick, exports.colorLegendMarkPick, exports.sizeLegendMarkPick, exports.markerMarkPick, exports.scrollBarMarkPick, exports.labelMarkPick, exports.titleBarMarkPick, exports.continuousPlayerMarkPick, exports.discretePlayerMarkPick ];
|
|
95
|
+
|
|
96
|
+
function getChartModelWithEvent(chart, event) {
|
|
97
|
+
const graphicPath = event.detailPath[event.detailPath.length - 1];
|
|
98
|
+
if (!graphicPath) return null;
|
|
99
|
+
const pickGraphic = null == graphicPath ? void 0 : graphicPath[graphicPath.length - 1];
|
|
100
|
+
return pickGraphic ? getGraphicModelMark(chart, pickGraphic, graphicPath, 0) : null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function getGraphicModelMark(chart, graphic, graphicPath, index) {
|
|
104
|
+
const modelPick = modelCheck.find((mc => mc.check(graphic, graphicPath)));
|
|
105
|
+
return modelPick ? modelPick.modelInfo(chart, graphic, graphicPath, index) : index >= graphicPath.length - 1 ? null : getGraphicModelMark(chart, graphicPath[index + 1], graphicPath, index + 1);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
exports.getChartModelWithEvent = getChartModelWithEvent, exports.getGraphicModelMark = getGraphicModelMark;
|
|
109
|
+
//# sourceMappingURL=vchart-pick.js.map
|