@visactor/vrender-core 0.22.15-alpha.1 → 0.22.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/animate/Ticker/default-ticker.d.ts +40 -0
- package/cjs/animate/Ticker/default-ticker.js +140 -0
- package/cjs/animate/Ticker/default-ticker.js.map +1 -0
- package/cjs/animate/Ticker/index.d.ts +5 -0
- package/cjs/{interface/animation → animate/Ticker}/index.js +3 -3
- package/cjs/animate/Ticker/index.js.map +1 -0
- package/cjs/animate/Ticker/manual-ticker-handler.d.ts +15 -0
- package/cjs/animate/Ticker/manual-ticker-handler.js +36 -0
- package/cjs/animate/Ticker/manual-ticker-handler.js.map +1 -0
- package/cjs/animate/Ticker/manual-ticker.d.ts +19 -0
- package/cjs/animate/Ticker/manual-ticker.js +37 -0
- package/cjs/animate/Ticker/manual-ticker.js.map +1 -0
- package/cjs/animate/Ticker/raf-tick-handler.d.ts +9 -0
- package/cjs/animate/Ticker/raf-tick-handler.js +30 -0
- package/cjs/animate/Ticker/raf-tick-handler.js.map +1 -0
- package/cjs/animate/Ticker/timeout-tick-handler.d.ts +9 -0
- package/cjs/animate/Ticker/timeout-tick-handler.js +28 -0
- package/cjs/animate/Ticker/timeout-tick-handler.js.map +1 -0
- package/cjs/animate/Ticker/type.d.ts +6 -0
- package/cjs/{interface/animation/ticker.js → animate/Ticker/type.js} +1 -1
- package/cjs/animate/Ticker/type.js.map +1 -0
- package/cjs/animate/animate.d.ts +147 -0
- package/cjs/animate/animate.js +403 -0
- package/cjs/animate/animate.js.map +1 -0
- package/cjs/animate/config.d.ts +2 -1
- package/cjs/animate/config.js +5 -1
- package/cjs/animate/config.js.map +1 -1
- package/cjs/animate/custom-animate.d.ts +236 -0
- package/cjs/animate/custom-animate.js +726 -0
- package/cjs/animate/custom-animate.js.map +1 -0
- package/cjs/animate/default-ticker.d.ts +2 -0
- package/cjs/animate/default-ticker.js +14 -0
- package/cjs/animate/default-ticker.js.map +1 -0
- package/cjs/animate/easing-func.d.ts +1 -0
- package/cjs/animate/easing-func.js +16 -0
- package/cjs/animate/easing-func.js.map +1 -0
- package/cjs/animate/easing.d.ts +49 -0
- package/cjs/animate/easing.js +141 -0
- package/cjs/animate/easing.js.map +1 -0
- package/cjs/animate/group-fade.d.ts +16 -0
- package/cjs/animate/group-fade.js +66 -0
- package/cjs/animate/group-fade.js.map +1 -0
- package/cjs/animate/index.d.ts +8 -0
- package/cjs/animate/index.js +24 -0
- package/cjs/animate/index.js.map +1 -0
- package/cjs/animate/morphing.d.ts +52 -0
- package/cjs/animate/morphing.js +292 -0
- package/cjs/animate/morphing.js.map +1 -0
- package/cjs/animate/timeline.d.ts +17 -0
- package/cjs/animate/timeline.js +46 -0
- package/cjs/animate/timeline.js.map +1 -0
- package/cjs/application.d.ts +1 -2
- package/cjs/application.js.map +1 -1
- package/cjs/canvas/constants.js +2 -1
- package/cjs/canvas/empty-context.d.ts +0 -1
- package/cjs/canvas/empty-context.js +0 -4
- package/cjs/canvas/empty-context.js.map +1 -1
- package/cjs/color-string/interpolate.d.ts +0 -1
- package/cjs/color-string/interpolate.js +4 -12
- package/cjs/color-string/interpolate.js.map +1 -1
- package/cjs/color-string/store.js +1 -2
- package/cjs/common/custom-path2d.js +2 -2
- package/cjs/common/custom-path2d.js.map +1 -1
- package/cjs/common/enums.d.ts +16 -0
- package/cjs/common/enums.js +11 -2
- package/cjs/common/enums.js.map +1 -1
- package/cjs/common/morphing-utils.js +124 -32
- package/cjs/common/morphing-utils.js.map +1 -1
- package/cjs/common/polygon.js +2 -5
- package/cjs/common/polygon.js.map +1 -1
- package/cjs/common/segment/curve/cubic-bezier.d.ts +2 -1
- package/cjs/common/segment/curve/cubic-bezier.js +8 -3
- package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
- package/cjs/common/segment/curve/quadratic-bezier.d.ts +0 -1
- package/cjs/common/segment/curve/quadratic-bezier.js +3 -10
- package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
- package/cjs/common/segment/index.d.ts +0 -1
- package/cjs/common/segment/index.js +1 -1
- package/cjs/common/segment/index.js.map +1 -1
- package/cjs/common/shape/arc.d.ts +1 -1
- package/cjs/common/shape/arc.js +3 -7
- package/cjs/common/shape/arc.js.map +1 -1
- package/cjs/common/simplify.js +2 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +2 -2
- package/cjs/common/split-path.js.map +1 -1
- package/cjs/common/store.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/common/utils.d.ts +2 -0
- package/cjs/common/utils.js +9 -5
- package/cjs/common/utils.js.map +1 -1
- package/cjs/core/application.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/global.d.ts +0 -3
- package/cjs/core/global.js +3 -14
- package/cjs/core/global.js.map +1 -1
- package/cjs/core/stage.d.ts +3 -8
- package/cjs/core/stage.js +20 -34
- package/cjs/core/stage.js.map +1 -1
- package/cjs/graphic/arc.d.ts +2 -1
- package/cjs/graphic/arc.js +2 -3
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/area.d.ts +2 -1
- package/cjs/graphic/area.js +1 -4
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/circle.d.ts +2 -1
- package/cjs/graphic/circle.js +2 -5
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.js +1 -2
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-module.js +2 -1
- package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-service.js +3 -2
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +12 -9
- package/cjs/graphic/graphic.js +105 -48
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.js +8 -8
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/line.d.ts +2 -1
- package/cjs/graphic/line.js +1 -5
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/rect.js +2 -5
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/richtext/icon.d.ts +1 -1
- package/cjs/graphic/richtext/icon.js.map +1 -1
- package/cjs/graphic/richtext/paragraph.js +2 -2
- package/cjs/graphic/richtext/paragraph.js.map +1 -1
- package/cjs/graphic/star.d.ts +2 -1
- package/cjs/graphic/star.js +2 -4
- package/cjs/graphic/star.js.map +1 -1
- package/cjs/index.d.ts +3 -2
- package/cjs/index.js +16 -14
- package/cjs/index.js.map +1 -1
- package/cjs/interface/animate.d.ts +160 -1
- package/cjs/interface/animate.js +4 -1
- package/cjs/interface/animate.js.map +1 -1
- package/cjs/interface/context.d.ts +0 -1
- package/cjs/interface/context.js.map +1 -1
- package/cjs/interface/global.d.ts +0 -2
- package/cjs/interface/global.js.map +1 -1
- package/cjs/interface/graphic.d.ts +3 -11
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/index.d.ts +1 -1
- package/cjs/interface/index.js +9 -9
- package/cjs/interface/index.js.map +1 -1
- package/cjs/interface/render.d.ts +0 -7
- package/cjs/interface/render.js.map +1 -1
- package/cjs/interface/stage.d.ts +1 -4
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/modules.d.ts +1 -2
- package/cjs/modules.js +3 -4
- package/cjs/modules.js.map +1 -1
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js +8 -9
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +11 -14
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/edit-module.js +4 -4
- package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +10 -13
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -0
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +5 -8
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +5 -6
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
- package/cjs/render/contributions/render/arc-render.d.ts +2 -4
- package/cjs/render/contributions/render/arc-render.js +17 -19
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +2 -2
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/base-render.d.ts +2 -2
- package/cjs/render/contributions/render/base-render.js +2 -2
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.d.ts +0 -1
- package/cjs/render/contributions/render/draw-contribution.js +19 -23
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/draw-interceptor.js +1 -2
- package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
- package/cjs/render/contributions/render/group-render.d.ts +2 -2
- package/cjs/render/contributions/render/group-render.js +11 -15
- package/cjs/render/contributions/render/group-render.js.map +1 -1
- package/cjs/render/contributions/render/line-render.js +1 -1
- package/cjs/render/contributions/render/line-render.js.map +1 -1
- package/cjs/render/contributions/render/rect-render.d.ts +1 -3
- package/cjs/render/contributions/render/rect-render.js +15 -17
- package/cjs/render/contributions/render/rect-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-render.d.ts +2 -4
- package/cjs/render/contributions/render/symbol-render.js +11 -16
- package/cjs/render/contributions/render/symbol-render.js.map +1 -1
- package/cjs/render/render-service.d.ts +1 -1
- package/cjs/render/render-service.js.map +1 -1
- package/dist/index.es.js +8868 -6022
- package/es/animate/Ticker/default-ticker.d.ts +40 -0
- package/es/animate/Ticker/default-ticker.js +138 -0
- package/es/animate/Ticker/default-ticker.js.map +1 -0
- package/es/animate/Ticker/index.d.ts +5 -0
- package/es/animate/Ticker/index.js +10 -0
- package/es/animate/Ticker/index.js.map +1 -0
- package/es/animate/Ticker/manual-ticker-handler.d.ts +15 -0
- package/es/animate/Ticker/manual-ticker-handler.js +28 -0
- package/es/animate/Ticker/manual-ticker-handler.js.map +1 -0
- package/es/animate/Ticker/manual-ticker.d.ts +19 -0
- package/es/animate/Ticker/manual-ticker.js +31 -0
- package/es/animate/Ticker/manual-ticker.js.map +1 -0
- package/es/animate/Ticker/raf-tick-handler.d.ts +9 -0
- package/es/animate/Ticker/raf-tick-handler.js +22 -0
- package/es/animate/Ticker/raf-tick-handler.js.map +1 -0
- package/es/animate/Ticker/timeout-tick-handler.d.ts +9 -0
- package/es/animate/Ticker/timeout-tick-handler.js +20 -0
- package/es/animate/Ticker/timeout-tick-handler.js.map +1 -0
- package/es/animate/Ticker/type.d.ts +6 -0
- package/es/{interface/animation/ticker.js → animate/Ticker/type.js} +1 -1
- package/es/animate/Ticker/type.js.map +1 -0
- package/es/animate/animate.d.ts +147 -0
- package/es/animate/animate.js +398 -0
- package/es/animate/animate.js.map +1 -0
- package/es/animate/config.d.ts +2 -1
- package/es/animate/config.js +5 -0
- package/es/animate/config.js.map +1 -1
- package/es/animate/custom-animate.d.ts +236 -0
- package/es/animate/custom-animate.js +703 -0
- package/es/animate/custom-animate.js.map +1 -0
- package/es/animate/default-ticker.d.ts +2 -0
- package/es/animate/default-ticker.js +12 -0
- package/es/animate/default-ticker.js.map +1 -0
- package/es/animate/easing-func.d.ts +1 -0
- package/es/animate/easing-func.js +10 -0
- package/es/animate/easing-func.js.map +1 -0
- package/es/animate/easing.d.ts +49 -0
- package/es/animate/easing.js +134 -0
- package/es/animate/easing.js.map +1 -0
- package/es/animate/group-fade.d.ts +16 -0
- package/es/animate/group-fade.js +56 -0
- package/es/animate/group-fade.js.map +1 -0
- package/es/animate/index.d.ts +8 -0
- package/es/animate/index.js +16 -0
- package/es/animate/index.js.map +1 -0
- package/es/animate/morphing.d.ts +52 -0
- package/es/animate/morphing.js +295 -0
- package/es/animate/morphing.js.map +1 -0
- package/es/animate/timeline.d.ts +17 -0
- package/es/animate/timeline.js +42 -0
- package/es/animate/timeline.js.map +1 -0
- package/es/application.d.ts +1 -2
- package/es/application.js.map +1 -1
- package/es/canvas/constants.js +2 -1
- package/es/canvas/empty-context.d.ts +0 -1
- package/es/canvas/empty-context.js +0 -4
- package/es/canvas/empty-context.js.map +1 -1
- package/es/color-string/interpolate.d.ts +0 -1
- package/es/color-string/interpolate.js +1 -8
- package/es/color-string/interpolate.js.map +1 -1
- package/es/color-string/store.js +1 -2
- package/es/common/custom-path2d.js +2 -2
- package/es/common/custom-path2d.js.map +1 -1
- package/es/common/enums.d.ts +16 -0
- package/es/common/enums.js +20 -0
- package/es/common/enums.js.map +1 -1
- package/es/common/morphing-utils.js +124 -29
- package/es/common/morphing-utils.js.map +1 -1
- package/es/common/polygon.js +3 -6
- package/es/common/polygon.js.map +1 -1
- package/es/common/segment/curve/cubic-bezier.d.ts +2 -1
- package/es/common/segment/curve/cubic-bezier.js +8 -1
- package/es/common/segment/curve/cubic-bezier.js.map +1 -1
- package/es/common/segment/curve/quadratic-bezier.d.ts +0 -1
- package/es/common/segment/curve/quadratic-bezier.js +2 -5
- package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
- package/es/common/segment/index.d.ts +0 -1
- package/es/common/segment/index.js +0 -2
- package/es/common/segment/index.js.map +1 -1
- package/es/common/shape/arc.d.ts +1 -1
- package/es/common/shape/arc.js +3 -7
- package/es/common/shape/arc.js.map +1 -1
- package/es/common/simplify.js +2 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +2 -2
- package/es/common/split-path.js.map +1 -1
- package/es/common/store.js +1 -1
- package/es/common/text.js +1 -1
- package/es/common/utils.d.ts +2 -0
- package/es/common/utils.js +5 -1
- package/es/common/utils.js.map +1 -1
- package/es/core/application.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/global.d.ts +0 -3
- package/es/core/global.js +2 -15
- package/es/core/global.js.map +1 -1
- package/es/core/stage.d.ts +3 -8
- package/es/core/stage.js +22 -35
- package/es/core/stage.js.map +1 -1
- package/es/graphic/arc.d.ts +2 -1
- package/es/graphic/arc.js +2 -3
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/area.d.ts +2 -1
- package/es/graphic/area.js +1 -4
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/circle.d.ts +2 -1
- package/es/graphic/circle.js +2 -4
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.js +1 -2
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/graphic-service/graphic-module.js +1 -1
- package/es/graphic/graphic-service/graphic-module.js.map +1 -1
- package/es/graphic/graphic-service/graphic-service.js +4 -1
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +12 -9
- package/es/graphic/graphic.js +109 -52
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.js +7 -7
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/line.d.ts +2 -1
- package/es/graphic/line.js +1 -5
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/rect.js +2 -5
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/richtext/icon.d.ts +1 -1
- package/es/graphic/richtext/icon.js.map +1 -1
- package/es/graphic/richtext/paragraph.js +2 -2
- package/es/graphic/richtext/paragraph.js.map +1 -1
- package/es/graphic/star.d.ts +2 -1
- package/es/graphic/star.js +2 -4
- package/es/graphic/star.js.map +1 -1
- package/es/index.d.ts +3 -2
- package/es/index.js +6 -4
- package/es/index.js.map +1 -1
- package/es/interface/animate.d.ts +160 -1
- package/es/interface/animate.js +1 -2
- package/es/interface/animate.js.map +1 -1
- package/es/interface/context.d.ts +0 -1
- package/es/interface/context.js.map +1 -1
- package/es/interface/global.d.ts +0 -2
- package/es/interface/global.js.map +1 -1
- package/es/interface/graphic.d.ts +3 -11
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/index.d.ts +1 -1
- package/es/interface/index.js +2 -2
- package/es/interface/index.js.map +1 -1
- package/es/interface/render.d.ts +0 -7
- package/es/interface/render.js.map +1 -1
- package/es/interface/stage.d.ts +1 -4
- package/es/interface/stage.js.map +1 -1
- package/es/modules.d.ts +1 -2
- package/es/modules.js +0 -6
- package/es/modules.js.map +1 -1
- package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
- package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +12 -13
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/edit-module.js +4 -4
- package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +11 -12
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -0
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +5 -8
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
- package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
- package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
- package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js +5 -4
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
- package/es/render/contributions/render/arc-render.d.ts +2 -4
- package/es/render/contributions/render/arc-render.js +17 -19
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/area-render.js +2 -2
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/base-render.d.ts +2 -2
- package/es/render/contributions/render/base-render.js +2 -2
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.d.ts +0 -1
- package/es/render/contributions/render/draw-contribution.js +19 -23
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/draw-interceptor.js +1 -2
- package/es/render/contributions/render/draw-interceptor.js.map +1 -1
- package/es/render/contributions/render/group-render.d.ts +2 -2
- package/es/render/contributions/render/group-render.js +11 -15
- package/es/render/contributions/render/group-render.js.map +1 -1
- package/es/render/contributions/render/line-render.js +1 -1
- package/es/render/contributions/render/line-render.js.map +1 -1
- package/es/render/contributions/render/rect-render.d.ts +1 -3
- package/es/render/contributions/render/rect-render.js +14 -17
- package/es/render/contributions/render/rect-render.js.map +1 -1
- package/es/render/contributions/render/symbol-render.d.ts +2 -4
- package/es/render/contributions/render/symbol-render.js +11 -16
- package/es/render/contributions/render/symbol-render.js.map +1 -1
- package/es/render/render-service.d.ts +1 -1
- package/es/render/render-service.js.map +1 -1
- package/package.json +4 -4
- package/cjs/common/diff.d.ts +0 -1
- package/cjs/common/diff.js +0 -19
- package/cjs/common/diff.js.map +0 -1
- package/cjs/common/performance-raf.d.ts +0 -8
- package/cjs/common/performance-raf.js +0 -32
- package/cjs/common/performance-raf.js.map +0 -1
- package/cjs/interface/animation/animate.d.ts +0 -117
- package/cjs/interface/animation/animate.js +0 -10
- package/cjs/interface/animation/animate.js.map +0 -1
- package/cjs/interface/animation/easing.d.ts +0 -3
- package/cjs/interface/animation/easing.js +0 -6
- package/cjs/interface/animation/easing.js.map +0 -1
- package/cjs/interface/animation/index.d.ts +0 -5
- package/cjs/interface/animation/index.js.map +0 -1
- package/cjs/interface/animation/ticker.d.ts +0 -39
- package/cjs/interface/animation/ticker.js.map +0 -1
- package/cjs/interface/animation/timeline.d.ts +0 -17
- package/cjs/interface/animation/timeline.js +0 -6
- package/cjs/interface/animation/timeline.js.map +0 -1
- package/cjs/interface/animation/type.d.ts +0 -13
- package/cjs/interface/animation/type.js +0 -15
- package/cjs/interface/animation/type.js.map +0 -1
- package/es/common/diff.d.ts +0 -1
- package/es/common/diff.js +0 -11
- package/es/common/diff.js.map +0 -1
- package/es/common/performance-raf.d.ts +0 -8
- package/es/common/performance-raf.js +0 -24
- package/es/common/performance-raf.js.map +0 -1
- package/es/interface/animation/animate.d.ts +0 -117
- package/es/interface/animation/animate.js +0 -6
- package/es/interface/animation/animate.js.map +0 -1
- package/es/interface/animation/easing.d.ts +0 -3
- package/es/interface/animation/easing.js +0 -2
- package/es/interface/animation/easing.js.map +0 -1
- package/es/interface/animation/index.d.ts +0 -5
- package/es/interface/animation/index.js +0 -10
- package/es/interface/animation/index.js.map +0 -1
- package/es/interface/animation/ticker.d.ts +0 -39
- package/es/interface/animation/ticker.js.map +0 -1
- package/es/interface/animation/timeline.d.ts +0 -17
- package/es/interface/animation/timeline.js +0 -2
- package/es/interface/animation/timeline.js.map +0 -1
- package/es/interface/animation/type.d.ts +0 -13
- package/es/interface/animation/type.js +0 -14
- package/es/interface/animation/type.js.map +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { IGraphic, MorphingAnimateConfig, EasingType, MultiMorphingAnimateConfig, IGraphicAttribute } from './../interface';
|
|
2
|
+
import { CustomPath2D } from '../common/custom-path2d';
|
|
3
|
+
import { ACustomAnimate } from './animate';
|
|
4
|
+
import type { IMatrix } from '@visactor/vutils';
|
|
5
|
+
interface MorphingDataItem {
|
|
6
|
+
from: number[];
|
|
7
|
+
to: number[];
|
|
8
|
+
fromCp: number[];
|
|
9
|
+
toCp: number[];
|
|
10
|
+
rotation: number;
|
|
11
|
+
}
|
|
12
|
+
interface OtherAttrItem {
|
|
13
|
+
from: any;
|
|
14
|
+
to: any;
|
|
15
|
+
key: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class MorphingPath extends ACustomAnimate<number> {
|
|
18
|
+
path: CustomPath2D;
|
|
19
|
+
saveOnEnd?: boolean;
|
|
20
|
+
otherAttrs?: OtherAttrItem[];
|
|
21
|
+
constructor(config: {
|
|
22
|
+
morphingData: MorphingDataItem[];
|
|
23
|
+
otherAttrs?: OtherAttrItem[];
|
|
24
|
+
saveOnEnd?: boolean;
|
|
25
|
+
}, duration: number, easing: EasingType);
|
|
26
|
+
private morphingData?;
|
|
27
|
+
getEndProps(): Record<string, any>;
|
|
28
|
+
onBind(): void;
|
|
29
|
+
onEnd(): void;
|
|
30
|
+
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
31
|
+
}
|
|
32
|
+
export declare const morphPath: (fromGraphic: IGraphic | null, toGraphic: IGraphic, animationConfig?: MorphingAnimateConfig, fromGraphicTransform?: IMatrix) => import("./../interface").IAnimate;
|
|
33
|
+
export declare const oneToMultiMorph: (fromGraphic: IGraphic, toGraphics: IGraphic[], animationConfig?: MultiMorphingAnimateConfig) => void;
|
|
34
|
+
export declare class MultiToOneMorphingPath extends ACustomAnimate<number> {
|
|
35
|
+
path: CustomPath2D;
|
|
36
|
+
otherAttrs?: OtherAttrItem[][];
|
|
37
|
+
constructor(config: {
|
|
38
|
+
morphingData: MorphingDataItem[][];
|
|
39
|
+
otherAttrs?: OtherAttrItem[][];
|
|
40
|
+
}, duration: number, easing: EasingType);
|
|
41
|
+
private morphingData?;
|
|
42
|
+
getEndProps(): Record<string, any>;
|
|
43
|
+
onBind(): void;
|
|
44
|
+
private addPathProxy;
|
|
45
|
+
private clearPathProxy;
|
|
46
|
+
onEnd(): void;
|
|
47
|
+
onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
|
|
48
|
+
}
|
|
49
|
+
export declare const cloneGraphic: (graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic<Partial<IGraphicAttribute>>[];
|
|
50
|
+
export declare const splitGraphic: (graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic<Partial<IGraphicAttribute>>[];
|
|
51
|
+
export declare const multiToOneMorph: (fromGraphics: IGraphic[], toGraphic: IGraphic, animationConfig?: MultiMorphingAnimateConfig) => void;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.multiToOneMorph = exports.splitGraphic = exports.cloneGraphic = exports.MultiToOneMorphingPath = exports.oneToMultiMorph = exports.morphPath = exports.MorphingPath = void 0;
|
|
6
|
+
|
|
7
|
+
const split_path_1 = require("./../common/split-path"), custom_path2d_1 = require("../common/custom-path2d"), animate_1 = require("./animate"), morphing_utils_1 = require("../common/morphing-utils"), application_1 = require("../application"), vutils_1 = require("@visactor/vutils"), interpolate_1 = require("../color-string/interpolate"), color_string_1 = require("../color-string"), config_1 = require("./config"), utils_1 = require("../common/utils"), enums_1 = require("../common/enums"), interpolateOtherAttrs = (attrs, out, ratio) => {
|
|
8
|
+
attrs.forEach((entry => {
|
|
9
|
+
if (Number.isFinite(entry.to)) out[entry.key] = entry.from + (entry.to - entry.from) * ratio; else if ("fill" === entry.key || "stroke" === entry.key) {
|
|
10
|
+
const color = (0, interpolate_1.interpolateColor)(entry.from, entry.to, ratio, !1);
|
|
11
|
+
color && (out[entry.key] = color);
|
|
12
|
+
}
|
|
13
|
+
}));
|
|
14
|
+
}, interpolateMorphingData = (morphingData, path, ratio) => {
|
|
15
|
+
const tmpArr = [], newCp = [];
|
|
16
|
+
path.clear();
|
|
17
|
+
for (let i = 0; i < morphingData.length; i++) {
|
|
18
|
+
const item = morphingData[i], from = item.from, to = item.to, angle = item.rotation * ratio, fromCp = item.fromCp, toCp = item.toCp, sa = Math.sin(angle), ca = Math.cos(angle);
|
|
19
|
+
newCp[0] = fromCp[0] + (toCp[0] - fromCp[0]) * ratio, newCp[1] = fromCp[1] + (toCp[1] - fromCp[1]) * ratio;
|
|
20
|
+
for (let m = 0; m < from.length; m += 2) {
|
|
21
|
+
const x0 = from[m], y0 = from[m + 1], x = x0 * (1 - ratio) + to[m] * ratio, y = y0 * (1 - ratio) + to[m + 1] * ratio;
|
|
22
|
+
tmpArr[m] = x * ca - y * sa + newCp[0], tmpArr[m + 1] = x * sa + y * ca + newCp[1];
|
|
23
|
+
}
|
|
24
|
+
let x0 = tmpArr[0], y0 = tmpArr[1];
|
|
25
|
+
path.moveTo(x0, y0);
|
|
26
|
+
for (let m = 2; m < from.length; m += 6) {
|
|
27
|
+
const x1 = tmpArr[m], y1 = tmpArr[m + 1], x2 = tmpArr[m + 2], y2 = tmpArr[m + 3], x3 = tmpArr[m + 4], y3 = tmpArr[m + 5];
|
|
28
|
+
x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3 ? path.lineTo(x3, y3) : path.bezierCurveTo(x1, y1, x2, y2, x3, y3),
|
|
29
|
+
x0 = x3, y0 = y3;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}, parseMorphingData = (fromPath, toPath, config) => {
|
|
33
|
+
const fromBezier = fromPath ? (0, morphing_utils_1.pathToBezierCurves)(fromPath) : [], toBezier = (0,
|
|
34
|
+
morphing_utils_1.pathToBezierCurves)(toPath);
|
|
35
|
+
config && fromBezier && (config.fromTransform && (0, morphing_utils_1.applyTransformOnBezierCurves)(fromBezier, config.fromTransform.clone().getInverse()),
|
|
36
|
+
(0, morphing_utils_1.applyTransformOnBezierCurves)(fromBezier, config.toTransfrom));
|
|
37
|
+
const [fromBezierCurves, toBezierCurves] = (0, morphing_utils_1.alignBezierCurves)(fromBezier, toBezier);
|
|
38
|
+
return fromPath ? (0, morphing_utils_1.findBestMorphingRotation)(fromBezierCurves, toBezierCurves, 10, Math.PI) : toBezierCurves.map(((to, index) => ({
|
|
39
|
+
from: fromBezierCurves[index],
|
|
40
|
+
to: to,
|
|
41
|
+
fromCp: [ 0, 0 ],
|
|
42
|
+
toCp: [ 0, 0 ],
|
|
43
|
+
rotation: 0
|
|
44
|
+
})));
|
|
45
|
+
}, validateOtherAttrs = [ "fill", "fillOpacity", "shadowBlur", "shadowColor", "shadowOffsetX", "shadowOffsetY", "stroke", "strokeOpacity", "lineDashOffset" ], parseOtherAnimateAttrs = (fromAttrs, toAttrs) => {
|
|
46
|
+
if (!fromAttrs || !toAttrs) return null;
|
|
47
|
+
const res = [];
|
|
48
|
+
let hasAttr = !1;
|
|
49
|
+
return Object.keys(fromAttrs).forEach((fromKey => {
|
|
50
|
+
if (!validateOtherAttrs.includes(fromKey)) return;
|
|
51
|
+
const toValue = toAttrs[fromKey];
|
|
52
|
+
(0, vutils_1.isNil)(toValue) || (0, vutils_1.isNil)(fromAttrs[fromKey]) || toValue === fromAttrs[fromKey] || ("fill" === fromKey || "stroke" === fromKey ? res.push({
|
|
53
|
+
from: "string" == typeof fromAttrs[fromKey] ? color_string_1.ColorStore.Get(fromAttrs[fromKey], color_string_1.ColorType.Color255) : fromAttrs[fromKey],
|
|
54
|
+
to: "string" == typeof toValue ? color_string_1.ColorStore.Get(toValue, color_string_1.ColorType.Color255) : toValue,
|
|
55
|
+
key: fromKey
|
|
56
|
+
}) : res.push({
|
|
57
|
+
from: fromAttrs[fromKey],
|
|
58
|
+
to: toValue,
|
|
59
|
+
key: fromKey
|
|
60
|
+
}), hasAttr = !0);
|
|
61
|
+
})), hasAttr ? res : null;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
class MorphingPath extends animate_1.ACustomAnimate {
|
|
65
|
+
constructor(config, duration, easing) {
|
|
66
|
+
super(0, 1, duration, easing), this.morphingData = config.morphingData, this.otherAttrs = config.otherAttrs,
|
|
67
|
+
this.saveOnEnd = config.saveOnEnd;
|
|
68
|
+
}
|
|
69
|
+
getEndProps() {
|
|
70
|
+
return {};
|
|
71
|
+
}
|
|
72
|
+
onBind() {
|
|
73
|
+
this.target.createPathProxy(), this.onUpdate(!1, 0, this.target.attribute);
|
|
74
|
+
}
|
|
75
|
+
onEnd() {}
|
|
76
|
+
onUpdate(end, ratio, out) {
|
|
77
|
+
const target = this.target, pathProxy = "function" == typeof target.pathProxy ? target.pathProxy(target.attribute) : target.pathProxy;
|
|
78
|
+
interpolateMorphingData(this.morphingData, pathProxy, ratio), this.otherAttrs && this.otherAttrs.length && interpolateOtherAttrs(this.otherAttrs, out, ratio),
|
|
79
|
+
end && !this.saveOnEnd && (this.target.pathProxy = null);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
exports.MorphingPath = MorphingPath;
|
|
84
|
+
|
|
85
|
+
const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
|
|
86
|
+
var _a, _b, _c;
|
|
87
|
+
if (fromGraphic && (!fromGraphic.valid || !fromGraphic.toCustomPath)) return __DEV__ && console.error(fromGraphic, " is not validate"),
|
|
88
|
+
null;
|
|
89
|
+
if (!toGraphic.valid || !toGraphic.toCustomPath) return __DEV__ && console.error(toGraphic, " is not validate"),
|
|
90
|
+
null;
|
|
91
|
+
let fromTransform = null == fromGraphic ? void 0 : fromGraphic.globalTransMatrix;
|
|
92
|
+
fromGraphicTransform && fromTransform && (fromTransform = fromGraphicTransform.clone().multiply(fromTransform.a, fromTransform.b, fromTransform.c, fromTransform.d, fromTransform.e, fromTransform.f));
|
|
93
|
+
const morphingData = parseMorphingData(null === (_a = null == fromGraphic ? void 0 : fromGraphic.toCustomPath) || void 0 === _a ? void 0 : _a.call(fromGraphic), toGraphic.toCustomPath(), {
|
|
94
|
+
fromTransform: fromTransform,
|
|
95
|
+
toTransfrom: toGraphic.globalTransMatrix
|
|
96
|
+
}), attrs = parseOtherAnimateAttrs(null == fromGraphic ? void 0 : fromGraphic.attribute, toGraphic.attribute), animate = toGraphic.animate(animationConfig);
|
|
97
|
+
return (null == animationConfig ? void 0 : animationConfig.delay) && animate.wait(animationConfig.delay),
|
|
98
|
+
animate.play(new MorphingPath({
|
|
99
|
+
morphingData: morphingData,
|
|
100
|
+
otherAttrs: attrs
|
|
101
|
+
}, null !== (_b = null == animationConfig ? void 0 : animationConfig.duration) && void 0 !== _b ? _b : config_1.DefaultMorphingAnimateConfig.duration, null !== (_c = null == animationConfig ? void 0 : animationConfig.easing) && void 0 !== _c ? _c : config_1.DefaultMorphingAnimateConfig.easing)),
|
|
102
|
+
animate;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
exports.morphPath = morphPath;
|
|
106
|
+
|
|
107
|
+
const oneToMultiMorph = (fromGraphic, toGraphics, animationConfig) => {
|
|
108
|
+
var _a;
|
|
109
|
+
const validateToGraphics = toGraphics.filter((graphic => graphic && graphic.toCustomPath && graphic.valid));
|
|
110
|
+
validateToGraphics.length || __DEV__ && console.error(validateToGraphics, " is not validate"),
|
|
111
|
+
fromGraphic.valid && fromGraphic.toCustomPath || __DEV__ && console.error(fromGraphic, " is not validate");
|
|
112
|
+
const childGraphics = ("clone" === (null == animationConfig ? void 0 : animationConfig.splitPath) ? exports.cloneGraphic : null !== (_a = null == animationConfig ? void 0 : animationConfig.splitPath) && void 0 !== _a ? _a : exports.splitGraphic)(fromGraphic, validateToGraphics.length, !1), oldOnEnd = null == animationConfig ? void 0 : animationConfig.onEnd;
|
|
113
|
+
let count = validateToGraphics.length;
|
|
114
|
+
const onEachEnd = () => {
|
|
115
|
+
count--, 0 === count && oldOnEnd && oldOnEnd();
|
|
116
|
+
};
|
|
117
|
+
validateToGraphics.forEach(((toChild, index) => {
|
|
118
|
+
var _a;
|
|
119
|
+
const fromChild = childGraphics[index], delay = (null !== (_a = null == animationConfig ? void 0 : animationConfig.delay) && void 0 !== _a ? _a : 0) + ((null == animationConfig ? void 0 : animationConfig.individualDelay) ? animationConfig.individualDelay(index, validateToGraphics.length, fromChild, toChild) : 0);
|
|
120
|
+
(0, exports.morphPath)(fromChild, toChild, Object.assign({}, animationConfig, {
|
|
121
|
+
onEnd: onEachEnd,
|
|
122
|
+
delay: delay
|
|
123
|
+
}), fromGraphic.globalTransMatrix);
|
|
124
|
+
}));
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
exports.oneToMultiMorph = oneToMultiMorph;
|
|
128
|
+
|
|
129
|
+
class MultiToOneMorphingPath extends animate_1.ACustomAnimate {
|
|
130
|
+
constructor(config, duration, easing) {
|
|
131
|
+
super(0, 1, duration, easing), this.morphingData = config.morphingData, this.otherAttrs = config.otherAttrs;
|
|
132
|
+
}
|
|
133
|
+
getEndProps() {
|
|
134
|
+
return {};
|
|
135
|
+
}
|
|
136
|
+
onBind() {
|
|
137
|
+
this.addPathProxy();
|
|
138
|
+
}
|
|
139
|
+
addPathProxy() {
|
|
140
|
+
this.target.shadowRoot.forEachChildren((child => {
|
|
141
|
+
child.createPathProxy();
|
|
142
|
+
})), this.onUpdate(!1, 0, this.target.attribute);
|
|
143
|
+
}
|
|
144
|
+
clearPathProxy() {
|
|
145
|
+
this.target.shadowRoot.forEachChildren((child => {
|
|
146
|
+
child.pathProxy = null;
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
onEnd() {}
|
|
150
|
+
onUpdate(end, ratio, out) {
|
|
151
|
+
this.target.shadowRoot.forEachChildren(((child, index) => {
|
|
152
|
+
var _a;
|
|
153
|
+
interpolateMorphingData(this.morphingData[index], "function" == typeof child.pathProxy ? child.pathProxy(child.attribute) : child.pathProxy, ratio),
|
|
154
|
+
(null === (_a = this.otherAttrs) || void 0 === _a ? void 0 : _a[index]) && this.otherAttrs[index].length && interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio);
|
|
155
|
+
})), end && (this.clearPathProxy(), this.morphingData = null);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
exports.MultiToOneMorphingPath = MultiToOneMorphingPath;
|
|
160
|
+
|
|
161
|
+
const parseShadowChildAttrs = graphicAttrs => {
|
|
162
|
+
const attrs = {};
|
|
163
|
+
return Object.keys(graphicAttrs).forEach((key => {
|
|
164
|
+
(0, utils_1.isTransformKey)(key) || (attrs[key] = graphicAttrs[key]);
|
|
165
|
+
})), attrs;
|
|
166
|
+
}, appendShadowChildrenToGraphic = (graphic, children, count) => {
|
|
167
|
+
const childAttrs = parseShadowChildAttrs(graphic.attribute), shadowRoot = graphic.attachShadow();
|
|
168
|
+
if (children.length) shadowRoot.setTheme({
|
|
169
|
+
[children[0].type]: childAttrs
|
|
170
|
+
}), children.forEach((element => {
|
|
171
|
+
element.setAttributes({
|
|
172
|
+
pickable: !1
|
|
173
|
+
}), shadowRoot.appendChild(element);
|
|
174
|
+
})); else {
|
|
175
|
+
const box = graphic.AABBBounds, width = box.width(), height = box.height();
|
|
176
|
+
shadowRoot.setTheme({
|
|
177
|
+
rect: childAttrs
|
|
178
|
+
}), new Array(count).fill(0).forEach((el => {
|
|
179
|
+
const child = application_1.application.graphicService.creator.rect({
|
|
180
|
+
x: 0,
|
|
181
|
+
y: 0,
|
|
182
|
+
width: width,
|
|
183
|
+
height: height,
|
|
184
|
+
pickable: !1
|
|
185
|
+
});
|
|
186
|
+
shadowRoot.appendChild(child), children.push(child);
|
|
187
|
+
}));
|
|
188
|
+
}
|
|
189
|
+
}, cloneGraphic = (graphic, count, needAppend) => {
|
|
190
|
+
const children = [], childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute), path = graphic.toCustomPath();
|
|
191
|
+
for (let i = 0; i < count; i++) {
|
|
192
|
+
const element = {
|
|
193
|
+
path: (new custom_path2d_1.CustomPath2D).fromCustomPath2D(path)
|
|
194
|
+
};
|
|
195
|
+
children.push(application_1.application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element)));
|
|
196
|
+
}
|
|
197
|
+
return needAppend && appendShadowChildrenToGraphic(graphic, children, count), children;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
exports.cloneGraphic = cloneGraphic;
|
|
201
|
+
|
|
202
|
+
const splitGraphic = (graphic, count, needAppend) => {
|
|
203
|
+
const children = [], childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);
|
|
204
|
+
if ("rect" === graphic.type) {
|
|
205
|
+
(0, split_path_1.splitRect)(graphic, count).forEach((element => {
|
|
206
|
+
children.push(application_1.application.graphicService.creator.rect(needAppend ? element : Object.assign({}, childAttrs, element)));
|
|
207
|
+
}));
|
|
208
|
+
} else if ("arc" === graphic.type) {
|
|
209
|
+
(0, split_path_1.splitArc)(graphic, count).forEach((element => {
|
|
210
|
+
children.push(application_1.application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element)));
|
|
211
|
+
}));
|
|
212
|
+
} else if ("circle" === graphic.type) {
|
|
213
|
+
(0, split_path_1.splitCircle)(graphic, count).forEach((element => {
|
|
214
|
+
children.push(application_1.application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element)));
|
|
215
|
+
}));
|
|
216
|
+
} else if ("line" === graphic.type) {
|
|
217
|
+
const childrenAttrs = (0, split_path_1.splitLine)(graphic, count), defaultSymbol = {
|
|
218
|
+
size: 10,
|
|
219
|
+
symbolType: "circle"
|
|
220
|
+
};
|
|
221
|
+
childrenAttrs.forEach((element => {
|
|
222
|
+
children.push(application_1.application.graphicService.creator.symbol(needAppend ? Object.assign({}, element, defaultSymbol) : Object.assign({}, childAttrs, element, defaultSymbol)));
|
|
223
|
+
}));
|
|
224
|
+
} else if ("polygon" === graphic.type) {
|
|
225
|
+
(0, split_path_1.splitPolygon)(graphic, count).forEach((element => {
|
|
226
|
+
children.push(application_1.application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
|
|
227
|
+
}));
|
|
228
|
+
} else if ("area" === graphic.type) {
|
|
229
|
+
(0, split_path_1.splitArea)(graphic, count).forEach((element => {
|
|
230
|
+
children.push(application_1.application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
|
|
231
|
+
}));
|
|
232
|
+
} else if ("path" === graphic.type) {
|
|
233
|
+
(0, split_path_1.splitPath)(graphic, count).forEach((element => {
|
|
234
|
+
"path" in element ? children.push(application_1.application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))) : children.push(application_1.application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
return needAppend && appendShadowChildrenToGraphic(graphic, children, count), children;
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
exports.splitGraphic = splitGraphic;
|
|
241
|
+
|
|
242
|
+
const multiToOneMorph = (fromGraphics, toGraphic, animationConfig) => {
|
|
243
|
+
var _a, _b, _c;
|
|
244
|
+
const validateFromGraphics = fromGraphics.filter((graphic => graphic.toCustomPath && graphic.valid));
|
|
245
|
+
validateFromGraphics.length || __DEV__ && console.error(fromGraphics, " is not validate"),
|
|
246
|
+
toGraphic.valid && toGraphic.toCustomPath || __DEV__ && console.error(toGraphic, " is not validate");
|
|
247
|
+
const childGraphics = ("clone" === (null == animationConfig ? void 0 : animationConfig.splitPath) ? exports.cloneGraphic : null !== (_a = null == animationConfig ? void 0 : animationConfig.splitPath) && void 0 !== _a ? _a : exports.splitGraphic)(toGraphic, validateFromGraphics.length, !0), toAttrs = toGraphic.attribute;
|
|
248
|
+
toGraphic.setAttribute("visible", !1);
|
|
249
|
+
const morphingData = validateFromGraphics.map(((graphic, index) => parseMorphingData(graphic.toCustomPath(), childGraphics[index].toCustomPath(), {
|
|
250
|
+
fromTransform: graphic.globalTransMatrix,
|
|
251
|
+
toTransfrom: childGraphics[index].globalTransMatrix
|
|
252
|
+
}))), otherAttrs = validateFromGraphics.map(((graphic, index) => parseOtherAnimateAttrs(graphic.attribute, toAttrs)));
|
|
253
|
+
if (null == animationConfig ? void 0 : animationConfig.individualDelay) {
|
|
254
|
+
const oldOnEnd = animationConfig.onEnd;
|
|
255
|
+
let count = validateFromGraphics.length;
|
|
256
|
+
const onEachEnd = () => {
|
|
257
|
+
count--, 0 === count && (toGraphic.setAttributes({
|
|
258
|
+
visible: !0,
|
|
259
|
+
ratio: null
|
|
260
|
+
}, !1, {
|
|
261
|
+
type: enums_1.AttributeUpdateType.ANIMATE_END
|
|
262
|
+
}), toGraphic.detachShadow(), oldOnEnd && oldOnEnd());
|
|
263
|
+
};
|
|
264
|
+
childGraphics.forEach(((to, index) => {
|
|
265
|
+
var _a, _b, _c;
|
|
266
|
+
const delay = (null !== (_a = animationConfig.delay) && void 0 !== _a ? _a : 0) + animationConfig.individualDelay(index, validateFromGraphics.length, fromGraphics[index], to), animate = to.animate(Object.assign({}, animationConfig, {
|
|
267
|
+
onEnd: onEachEnd
|
|
268
|
+
}));
|
|
269
|
+
animate.wait(delay), animate.play(new MorphingPath({
|
|
270
|
+
morphingData: morphingData[index],
|
|
271
|
+
saveOnEnd: !0,
|
|
272
|
+
otherAttrs: otherAttrs[index]
|
|
273
|
+
}, null !== (_b = animationConfig.duration) && void 0 !== _b ? _b : config_1.DefaultMorphingAnimateConfig.duration, null !== (_c = animationConfig.easing) && void 0 !== _c ? _c : config_1.DefaultMorphingAnimateConfig.easing));
|
|
274
|
+
}));
|
|
275
|
+
} else {
|
|
276
|
+
const oldOnEnd = null == animationConfig ? void 0 : animationConfig.onEnd, config = animationConfig ? Object.assign({}, animationConfig) : {};
|
|
277
|
+
config.onEnd = () => {
|
|
278
|
+
toGraphic.setAttribute("visible", !0, !1, {
|
|
279
|
+
type: enums_1.AttributeUpdateType.ANIMATE_END
|
|
280
|
+
}), toGraphic.detachShadow(), oldOnEnd && oldOnEnd();
|
|
281
|
+
};
|
|
282
|
+
const animate = toGraphic.animate(config);
|
|
283
|
+
(null == animationConfig ? void 0 : animationConfig.delay) && animate.wait(animationConfig.delay),
|
|
284
|
+
animate.play(new MultiToOneMorphingPath({
|
|
285
|
+
morphingData: morphingData,
|
|
286
|
+
otherAttrs: otherAttrs
|
|
287
|
+
}, null !== (_b = null == animationConfig ? void 0 : animationConfig.duration) && void 0 !== _b ? _b : config_1.DefaultMorphingAnimateConfig.duration, null !== (_c = null == animationConfig ? void 0 : animationConfig.easing) && void 0 !== _c ? _c : config_1.DefaultMorphingAnimateConfig.easing));
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
exports.multiToOneMorph = multiToOneMorph;
|
|
292
|
+
//# sourceMappingURL=morphing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/animate/morphing.ts"],"names":[],"mappings":";;;AAAA,uDAQgC;AAgBhC,2DAAuD;AACvD,uCAA2C;AAC3C,6DAKkC;AAClC,gDAA6C;AAE7C,6CAAyC;AACzC,6DAA+D;AAC/D,kDAAwD;AACxD,qCAAwD;AACxD,2CAAiD;AACjD,2CAAsD;AAkBtD,MAAM,qBAAqB,GAAG,CAAC,KAAsB,EAAE,GAAQ,EAAE,KAAa,EAAE,EAAE;IAChF,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACpB,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;YAC7B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;SAC/D;aAAM,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE;YAEzD,MAAM,KAAK,GAAG,IAAA,8BAAgB,EAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YACnE,IAAI,KAAK,EAAE;gBACT,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aACxB;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAUF,MAAM,uBAAuB,GAAG,CAAC,YAAgC,EAAE,IAAmB,EAAE,KAAa,EAAE,EAAE;IACvG,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,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EAAE,CAAC;aACZ;QACH,CAAC,CAAC;QAEF,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAE1C,IAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,EAAE;YAC1B,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;SACrC;QAED,OAAO,CAAC,IAAI,CACV,IAAI,sBAAsB,CACxB,EAAE,YAAY,EAAE,UAAU,EAAE,EAC5B,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,QAAQ,mCAAI,qCAA4B,CAAC,QAAQ,EAClE,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,mCAAI,qCAA4B,CAAC,MAAM,CAC/D,CACF,CAAC;KACH;AACH,CAAC,CAAC;AAhGW,QAAA,eAAe,mBAgG1B","file":"morphing.js","sourcesContent":["import {\n splitArc,\n splitCircle,\n splitLine,\n splitRect,\n splitPolygon,\n splitArea,\n splitPath\n} from './../common/split-path';\nimport type {\n ICustomPath2D,\n IGraphic,\n MorphingAnimateConfig,\n IRect,\n EasingType,\n MultiMorphingAnimateConfig,\n IArc,\n ICircle,\n IGraphicAttribute,\n ILine,\n IPolygon,\n IArea,\n IPath\n} from './../interface';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { ACustomAnimate } from './animate';\nimport {\n alignBezierCurves,\n applyTransformOnBezierCurves,\n findBestMorphingRotation,\n pathToBezierCurves\n} from '../common/morphing-utils';\nimport { application } from '../application';\nimport type { IMatrix } from '@visactor/vutils';\nimport { isNil } from '@visactor/vutils';\nimport { interpolateColor } from '../color-string/interpolate';\nimport { ColorStore, ColorType } from '../color-string';\nimport { DefaultMorphingAnimateConfig } from './config';\nimport { isTransformKey } from '../common/utils';\nimport { AttributeUpdateType } from '../common/enums';\n\ndeclare const __DEV__: boolean;\n\ninterface MorphingDataItem {\n from: number[];\n to: number[];\n fromCp: number[];\n toCp: number[];\n rotation: number;\n}\n\ninterface OtherAttrItem {\n from: any;\n to: any;\n key: string;\n}\n\nconst interpolateOtherAttrs = (attrs: OtherAttrItem[], out: any, ratio: number) => {\n attrs.forEach(entry => {\n if (Number.isFinite(entry.to)) {\n out[entry.key] = entry.from + (entry.to - entry.from) * ratio;\n } else if (entry.key === 'fill' || entry.key === 'stroke') {\n // 保存解析的结果到step\n const color = interpolateColor(entry.from, entry.to, ratio, false);\n if (color) {\n out[entry.key] = color;\n }\n }\n });\n};\n\n/* Adapted from zrender by ecomfe\n * https://github.com/ecomfe/zrender\n * Licensed under the BSD-3-Clause\n\n * url: https://github.com/ecomfe/zrender/blob/master/src/tool/morphPath.ts\n * License: https://github.com/ecomfe/zrender/blob/master/LICENSE\n * @license\n */\nconst interpolateMorphingData = (morphingData: MorphingDataItem[], path: ICustomPath2D, ratio: number) => {\n const tmpArr: number[] = [];\n const newCp: number[] = [];\n path.clear();\n\n for (let i = 0; i < morphingData.length; i++) {\n const item = morphingData[i];\n const from = item.from;\n const to = item.to;\n const angle = item.rotation * ratio;\n const fromCp = item.fromCp;\n const toCp = item.toCp;\n const sa = Math.sin(angle);\n const ca = Math.cos(angle);\n\n newCp[0] = fromCp[0] + (toCp[0] - fromCp[0]) * ratio;\n newCp[1] = fromCp[1] + (toCp[1] - fromCp[1]) * ratio;\n\n for (let m = 0; m < from.length; m += 2) {\n const x0 = from[m];\n const y0 = from[m + 1];\n const x1 = to[m];\n const y1 = to[m + 1];\n\n const x = x0 * (1 - ratio) + x1 * ratio;\n const y = y0 * (1 - ratio) + y1 * ratio;\n\n tmpArr[m] = x * ca - y * sa + newCp[0];\n tmpArr[m + 1] = x * sa + y * ca + newCp[1];\n }\n\n let x0 = tmpArr[0];\n let y0 = tmpArr[1];\n\n path.moveTo(x0, y0);\n\n for (let m = 2; m < from.length; m += 6) {\n const x1 = tmpArr[m];\n const y1 = tmpArr[m + 1];\n const x2 = tmpArr[m + 2];\n const y2 = tmpArr[m + 3];\n const x3 = tmpArr[m + 4];\n const y3 = tmpArr[m + 5];\n\n // Is a line.\n if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) {\n path.lineTo(x3, y3);\n } else {\n path.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n x0 = x3;\n y0 = y3;\n }\n }\n};\n\nconst parseMorphingData = (\n fromPath: ICustomPath2D | null,\n toPath: ICustomPath2D,\n config?: {\n fromTransform?: IMatrix;\n toTransfrom: IMatrix;\n }\n) => {\n const fromBezier = fromPath ? pathToBezierCurves(fromPath) : [];\n const toBezier = pathToBezierCurves(toPath);\n\n if (config && fromBezier) {\n config.fromTransform && applyTransformOnBezierCurves(fromBezier, config.fromTransform.clone().getInverse());\n applyTransformOnBezierCurves(fromBezier, config.toTransfrom);\n // applyTransformOnBezierCurves(toBezier, config.toTransfrom.clone().getInverse());\n }\n\n const [fromBezierCurves, toBezierCurves] = alignBezierCurves(fromBezier, toBezier);\n\n return fromPath\n ? findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI)\n : toBezierCurves.map((to, index) => {\n return {\n from: fromBezierCurves[index],\n to,\n fromCp: [0, 0],\n toCp: [0, 0],\n rotation: 0\n };\n });\n};\n\nconst validateOtherAttrs = [\n 'fill',\n 'fillOpacity',\n 'shadowBlur',\n 'shadowColor',\n 'shadowOffsetX',\n 'shadowOffsetY',\n 'stroke',\n 'strokeOpacity',\n 'lineDashOffset'\n // 'lineWidth'\n];\n\nconst parseOtherAnimateAttrs = (\n fromAttrs: Partial<IGraphicAttribute> | null,\n toAttrs: Partial<IGraphicAttribute> | null\n) => {\n if (!fromAttrs || !toAttrs) {\n return null;\n }\n const res: OtherAttrItem[] = [];\n let hasAttr = false;\n\n Object.keys(fromAttrs).forEach(fromKey => {\n if (!validateOtherAttrs.includes(fromKey)) {\n return;\n }\n\n const toValue = toAttrs[fromKey];\n if (!isNil(toValue) && !isNil(fromAttrs[fromKey]) && toValue !== fromAttrs[fromKey]) {\n if (fromKey === 'fill' || fromKey === 'stroke') {\n res.push({\n from:\n typeof fromAttrs[fromKey] === 'string'\n ? ColorStore.Get(fromAttrs[fromKey] as unknown as string, ColorType.Color255)\n : fromAttrs[fromKey],\n to: typeof toValue === 'string' ? ColorStore.Get(toValue as string, ColorType.Color255) : toValue,\n key: fromKey\n });\n } else {\n res.push({ from: fromAttrs[fromKey], to: toValue, key: fromKey });\n }\n\n hasAttr = true;\n }\n });\n\n return hasAttr ? res : null;\n};\n\nexport class MorphingPath extends ACustomAnimate<number> {\n declare path: CustomPath2D;\n\n saveOnEnd?: boolean;\n otherAttrs?: OtherAttrItem[];\n\n constructor(\n config: { morphingData: MorphingDataItem[]; otherAttrs?: OtherAttrItem[]; saveOnEnd?: boolean },\n duration: number,\n easing: EasingType\n ) {\n super(0, 1, duration, easing);\n this.morphingData = config.morphingData;\n this.otherAttrs = config.otherAttrs;\n this.saveOnEnd = config.saveOnEnd;\n }\n\n private morphingData?: MorphingDataItem[];\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n (this.target as IGraphic).createPathProxy();\n this.onUpdate(false, 0, (this.target as IGraphic).attribute);\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const target = this.target as IGraphic;\n const pathProxy = typeof target.pathProxy === 'function' ? target.pathProxy(target.attribute) : target.pathProxy;\n interpolateMorphingData(this.morphingData, pathProxy, ratio);\n if (this.otherAttrs && this.otherAttrs.length) {\n interpolateOtherAttrs(this.otherAttrs, out, ratio);\n }\n // 计算位置\n if (end && !this.saveOnEnd) {\n (this.target as IGraphic).pathProxy = null;\n }\n }\n}\n\nexport const morphPath = (\n fromGraphic: IGraphic | null,\n toGraphic: IGraphic,\n animationConfig?: MorphingAnimateConfig,\n fromGraphicTransform?: IMatrix\n) => {\n if (fromGraphic && (!fromGraphic.valid || !fromGraphic.toCustomPath)) {\n if (__DEV__) {\n console.error(fromGraphic, ' is not validate');\n }\n return null;\n }\n\n if (!toGraphic.valid || !toGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(toGraphic, ' is not validate');\n }\n return null;\n }\n\n let fromTransform = fromGraphic?.globalTransMatrix;\n\n if (fromGraphicTransform && fromTransform) {\n fromTransform = fromGraphicTransform\n .clone()\n .multiply(fromTransform.a, fromTransform.b, fromTransform.c, fromTransform.d, fromTransform.e, fromTransform.f);\n }\n const morphingData = parseMorphingData(fromGraphic?.toCustomPath?.(), toGraphic.toCustomPath(), {\n fromTransform,\n toTransfrom: toGraphic.globalTransMatrix\n });\n\n const attrs = parseOtherAnimateAttrs(fromGraphic?.attribute, toGraphic.attribute);\n const animate = toGraphic.animate(animationConfig);\n\n if (animationConfig?.delay) {\n animate.wait(animationConfig.delay);\n }\n\n animate.play(\n new MorphingPath(\n { morphingData, otherAttrs: attrs },\n animationConfig?.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig?.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n\n return animate;\n};\n\nexport const oneToMultiMorph = (\n fromGraphic: IGraphic,\n toGraphics: IGraphic[],\n animationConfig?: MultiMorphingAnimateConfig\n) => {\n const validateToGraphics = toGraphics.filter(graphic => graphic && graphic.toCustomPath && graphic.valid);\n if (!validateToGraphics.length) {\n if (__DEV__) {\n console.error(validateToGraphics, ' is not validate');\n }\n }\n\n if (!fromGraphic.valid || !fromGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(fromGraphic, ' is not validate');\n }\n }\n\n const childGraphics: IGraphic[] = (\n animationConfig?.splitPath === 'clone' ? cloneGraphic : animationConfig?.splitPath ?? splitGraphic\n )(fromGraphic, validateToGraphics.length, false);\n\n const oldOnEnd = animationConfig?.onEnd;\n let count = validateToGraphics.length;\n const onEachEnd = () => {\n count--;\n if (count === 0 && oldOnEnd) {\n oldOnEnd();\n }\n };\n\n validateToGraphics.forEach((toChild, index) => {\n const fromChild = childGraphics[index];\n const delay =\n (animationConfig?.delay ?? 0) +\n (animationConfig?.individualDelay\n ? animationConfig.individualDelay(index, validateToGraphics.length, fromChild, toChild)\n : 0);\n morphPath(\n fromChild,\n toChild,\n Object.assign({}, animationConfig, { onEnd: onEachEnd, delay }),\n fromGraphic.globalTransMatrix\n );\n });\n};\n\nexport class MultiToOneMorphingPath extends ACustomAnimate<number> {\n declare path: CustomPath2D;\n\n otherAttrs?: OtherAttrItem[][];\n\n constructor(\n config: { morphingData: MorphingDataItem[][]; otherAttrs?: OtherAttrItem[][] },\n duration: number,\n easing: EasingType\n ) {\n super(0, 1, duration, easing);\n this.morphingData = config.morphingData;\n this.otherAttrs = config.otherAttrs;\n }\n\n private morphingData?: MorphingDataItem[][];\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.addPathProxy();\n }\n\n private addPathProxy() {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren(child => {\n (child as IGraphic).createPathProxy();\n });\n\n this.onUpdate(false, 0, (this.target as IGraphic).attribute);\n }\n\n private clearPathProxy() {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren(child => {\n (child as IGraphic).pathProxy = null;\n });\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren((child: IGraphic, index) => {\n interpolateMorphingData(\n this.morphingData[index],\n typeof child.pathProxy === 'function' ? child.pathProxy(child.attribute) : child.pathProxy,\n ratio\n );\n\n if (this.otherAttrs?.[index] && this.otherAttrs[index].length) {\n interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio);\n }\n });\n\n // 计算位置\n if (end) {\n this.clearPathProxy();\n this.morphingData = null;\n }\n }\n}\n\nconst parseShadowChildAttrs = (graphicAttrs: Partial<IGraphicAttribute>) => {\n const attrs: Partial<IGraphicAttribute> = {};\n\n Object.keys(graphicAttrs).forEach(key => {\n if (!isTransformKey(key)) {\n attrs[key] = graphicAttrs[key];\n }\n });\n\n // if (attrs.fill == null) {\n // attrs.fill = !!attrs.fillColor;\n // }\n // if (attrs.stroke == null) {\n // attrs.stroke = !!attrs.strokeColor;\n // }\n\n return attrs;\n};\n\nconst appendShadowChildrenToGraphic = (graphic: IGraphic, children: IGraphic[], count: number) => {\n const childAttrs = parseShadowChildAttrs(graphic.attribute);\n const shadowRoot = graphic.attachShadow();\n\n if (children.length) {\n shadowRoot.setTheme({\n [children[0].type]: childAttrs\n });\n children.forEach(element => {\n element.setAttributes({ pickable: false });\n shadowRoot.appendChild(element);\n });\n } else {\n const box = graphic.AABBBounds;\n const width = box.width();\n const height = box.height();\n\n shadowRoot.setTheme({\n rect: childAttrs\n });\n new Array(count).fill(0).forEach(el => {\n const child = application.graphicService.creator.rect({\n x: 0,\n y: 0,\n width,\n height: height,\n pickable: false\n });\n shadowRoot.appendChild(child);\n children.push(child);\n });\n }\n};\n\nexport const cloneGraphic = (graphic: IGraphic, count: number, needAppend?: boolean) => {\n const children: IGraphic[] = [];\n const childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);\n const path = graphic.toCustomPath();\n\n for (let i = 0; i < count; i++) {\n const element = {\n path: new CustomPath2D().fromCustomPath2D(path)\n };\n\n children.push(\n application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n }\n\n if (needAppend) {\n appendShadowChildrenToGraphic(graphic, children, count);\n }\n\n return children;\n};\n\nexport const splitGraphic = (graphic: IGraphic, count: number, needAppend?: boolean) => {\n const children: IGraphic[] = [];\n const childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);\n\n if (graphic.type === 'rect') {\n const childrenAttrs = splitRect(graphic as IRect, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.rect(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'arc') {\n const childrenAttrs = splitArc(graphic as IArc, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'circle') {\n const childrenAttrs = splitCircle(graphic as ICircle, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'line') {\n const childrenAttrs = splitLine(graphic as ILine, count);\n const defaultSymbol = { size: 10, symbolType: 'circle' };\n\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.symbol(\n needAppend ? Object.assign({}, element, defaultSymbol) : Object.assign({}, childAttrs, element, defaultSymbol)\n )\n );\n });\n } else if (graphic.type === 'polygon') {\n const childrenAttrs = splitPolygon(graphic as IPolygon, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'area') {\n const childrenAttrs = splitArea(graphic as IArea, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'path') {\n const childrenAttrs = splitPath(graphic as IPath, count);\n childrenAttrs.forEach(element => {\n if ('path' in element) {\n children.push(\n application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n } else {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n }\n });\n }\n\n if (needAppend) {\n appendShadowChildrenToGraphic(graphic, children, count);\n }\n\n return children;\n};\n\n/**\n * 多对一动画\n * @param fromGraphics\n * @param toGraphic\n * @param animationConfig\n */\nexport const multiToOneMorph = (\n fromGraphics: IGraphic[],\n toGraphic: IGraphic,\n animationConfig?: MultiMorphingAnimateConfig\n) => {\n const validateFromGraphics = fromGraphics.filter(graphic => graphic.toCustomPath && graphic.valid);\n if (!validateFromGraphics.length) {\n if (__DEV__) {\n console.error(fromGraphics, ' is not validate');\n }\n }\n\n if (!toGraphic.valid || !toGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(toGraphic, ' is not validate');\n }\n }\n\n const childGraphics: IGraphic[] = (\n animationConfig?.splitPath === 'clone' ? cloneGraphic : animationConfig?.splitPath ?? splitGraphic\n )(toGraphic, validateFromGraphics.length, true);\n\n const toAttrs = toGraphic.attribute;\n toGraphic.setAttribute('visible', false);\n\n const morphingData = validateFromGraphics.map((graphic, index) => {\n return parseMorphingData(graphic.toCustomPath(), childGraphics[index].toCustomPath(), {\n fromTransform: graphic.globalTransMatrix,\n toTransfrom: childGraphics[index].globalTransMatrix\n });\n });\n const otherAttrs = validateFromGraphics.map((graphic, index) => {\n return parseOtherAnimateAttrs(graphic.attribute, toAttrs);\n });\n\n if (animationConfig?.individualDelay) {\n const oldOnEnd = animationConfig.onEnd;\n let count = validateFromGraphics.length;\n const onEachEnd = () => {\n count--;\n if (count === 0) {\n toGraphic.setAttributes({ visible: true, ratio: null } as any, false, {\n type: AttributeUpdateType.ANIMATE_END\n });\n toGraphic.detachShadow();\n if (oldOnEnd) {\n oldOnEnd();\n }\n }\n };\n childGraphics.forEach((to, index) => {\n const delay =\n (animationConfig.delay ?? 0) +\n animationConfig.individualDelay(index, validateFromGraphics.length, fromGraphics[index], to);\n const animate = to.animate(Object.assign({}, animationConfig, { onEnd: onEachEnd }));\n animate.wait(delay);\n\n animate.play(\n new MorphingPath(\n {\n morphingData: morphingData[index],\n saveOnEnd: true,\n otherAttrs: otherAttrs[index]\n },\n animationConfig.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n });\n } else {\n const oldOnEnd = animationConfig?.onEnd;\n const config = animationConfig ? Object.assign({}, animationConfig) : {};\n\n config.onEnd = () => {\n toGraphic.setAttribute('visible', true, false, { type: AttributeUpdateType.ANIMATE_END });\n toGraphic.detachShadow();\n\n if (oldOnEnd) {\n oldOnEnd();\n }\n };\n\n const animate = toGraphic.animate(config);\n\n if (animationConfig?.delay) {\n animate.wait(animationConfig.delay);\n }\n\n animate.play(\n new MultiToOneMorphingPath(\n { morphingData, otherAttrs },\n animationConfig?.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig?.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n }\n};\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IAnimate, ITimeline } from '../interface';
|
|
2
|
+
export declare class DefaultTimeline implements ITimeline {
|
|
3
|
+
id: number;
|
|
4
|
+
protected animateHead: IAnimate | null;
|
|
5
|
+
protected animateTail: IAnimate | null;
|
|
6
|
+
protected ticker: any;
|
|
7
|
+
animateCount: number;
|
|
8
|
+
protected paused: boolean;
|
|
9
|
+
constructor();
|
|
10
|
+
addAnimate(animate: IAnimate): void;
|
|
11
|
+
pause(): void;
|
|
12
|
+
resume(): void;
|
|
13
|
+
tick(delta: number): void;
|
|
14
|
+
clear(): void;
|
|
15
|
+
removeAnimate(animate: IAnimate, release?: boolean): void;
|
|
16
|
+
}
|
|
17
|
+
export declare const defaultTimeline: DefaultTimeline;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.defaultTimeline = exports.DefaultTimeline = void 0;
|
|
6
|
+
|
|
7
|
+
const enums_1 = require("../common/enums"), generator_1 = require("../common/generator");
|
|
8
|
+
|
|
9
|
+
class DefaultTimeline {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.id = generator_1.Generator.GenAutoIncrementId(), this.animateHead = null, this.animateTail = null,
|
|
12
|
+
this.animateCount = 0, this.paused = !1;
|
|
13
|
+
}
|
|
14
|
+
addAnimate(animate) {
|
|
15
|
+
this.animateTail ? (this.animateTail.nextAnimate = animate, animate.prevAnimate = this.animateTail,
|
|
16
|
+
this.animateTail = animate, animate.nextAnimate = null) : (this.animateHead = animate,
|
|
17
|
+
this.animateTail = animate), this.animateCount++;
|
|
18
|
+
}
|
|
19
|
+
pause() {
|
|
20
|
+
this.paused = !0;
|
|
21
|
+
}
|
|
22
|
+
resume() {
|
|
23
|
+
this.paused = !1;
|
|
24
|
+
}
|
|
25
|
+
tick(delta) {
|
|
26
|
+
if (this.paused) return;
|
|
27
|
+
let animate = this.animateHead;
|
|
28
|
+
for (this.animateCount = 0; animate; ) animate.status === enums_1.AnimateStatus.END ? this.removeAnimate(animate) : animate.status === enums_1.AnimateStatus.RUNNING || animate.status === enums_1.AnimateStatus.INITIAL ? (this.animateCount++,
|
|
29
|
+
animate.advance(delta)) : animate.status === enums_1.AnimateStatus.PAUSED && this.animateCount++,
|
|
30
|
+
animate = animate.nextAnimate;
|
|
31
|
+
}
|
|
32
|
+
clear() {
|
|
33
|
+
let animate = this.animateHead;
|
|
34
|
+
for (;animate; ) animate.release(), animate = animate.nextAnimate;
|
|
35
|
+
this.animateHead = null, this.animateTail = null, this.animateCount = 0;
|
|
36
|
+
}
|
|
37
|
+
removeAnimate(animate, release = !0) {
|
|
38
|
+
animate._onRemove && animate._onRemove.forEach((cb => cb())), animate === this.animateHead ? (this.animateHead = animate.nextAnimate,
|
|
39
|
+
animate === this.animateTail ? this.animateTail = null : this.animateHead.prevAnimate = null) : animate === this.animateTail ? (this.animateTail = animate.prevAnimate,
|
|
40
|
+
this.animateTail.nextAnimate = null) : (animate.prevAnimate.nextAnimate = animate.nextAnimate,
|
|
41
|
+
animate.nextAnimate.prevAnimate = animate.prevAnimate), release && animate.release();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
exports.DefaultTimeline = DefaultTimeline, exports.defaultTimeline = new DefaultTimeline;
|
|
46
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/animate/timeline.ts"],"names":[],"mappings":";;;AAAA,2CAAgD;AAChD,mDAAgD;AAIhD,MAAa,eAAe;IAQ1B;QACE,IAAI,CAAC,EAAE,GAAG,qBAAS,CAAC,kBAAkB,EAAE,CAAC;QACzC,IA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OAAO,EAAE,CAAC;QAE7B,OAAO;IACT,CAAC;CACF;AA9FD,0CA8FC;AAEY,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","file":"timeline.js","sourcesContent":["import { AnimateStatus } from '../common/enums';\nimport { Generator } from '../common/generator';\nimport type { IAnimate, ITimeline } from '../interface';\n\n// 管理一组动画\nexport class DefaultTimeline implements ITimeline {\n declare id: number;\n protected declare animateHead: IAnimate | null;\n protected declare animateTail: IAnimate | null;\n protected declare ticker: any;\n declare animateCount: number;\n protected declare paused: boolean;\n\n constructor() {\n this.id = Generator.GenAutoIncrementId();\n this.animateHead = null;\n this.animateTail = null;\n this.animateCount = 0;\n this.paused = false;\n }\n\n addAnimate(animate: IAnimate) {\n if (!this.animateTail) {\n this.animateHead = animate;\n this.animateTail = animate;\n } else {\n this.animateTail.nextAnimate = animate;\n animate.prevAnimate = this.animateTail;\n this.animateTail = animate;\n animate.nextAnimate = null;\n }\n this.animateCount++;\n }\n\n pause() {\n this.paused = true;\n }\n resume() {\n this.paused = false;\n }\n\n tick(delta: number) {\n if (this.paused) {\n return;\n }\n let animate = this.animateHead;\n this.animateCount = 0;\n while (animate) {\n if (animate.status === AnimateStatus.END) {\n this.removeAnimate(animate);\n } else if (animate.status === AnimateStatus.RUNNING || animate.status === AnimateStatus.INITIAL) {\n this.animateCount++;\n animate.advance(delta);\n } else if (animate.status === AnimateStatus.PAUSED) {\n // 暂停\n this.animateCount++;\n }\n animate = animate.nextAnimate;\n }\n }\n\n clear() {\n let animate = this.animateHead;\n while (animate) {\n animate.release();\n animate = animate.nextAnimate;\n }\n this.animateHead = null;\n this.animateTail = null;\n this.animateCount = 0;\n }\n\n removeAnimate(animate: IAnimate, release: boolean = true) {\n animate._onRemove && animate._onRemove.forEach(cb => cb());\n if (animate === this.animateHead) {\n this.animateHead = animate.nextAnimate;\n if (animate === this.animateTail) {\n // 只有一个元素\n this.animateTail = null;\n } else {\n // 有多个元素\n this.animateHead.prevAnimate = null;\n }\n } else if (animate === this.animateTail) {\n // 有多个元素\n this.animateTail = animate.prevAnimate;\n this.animateTail.nextAnimate = null;\n // animate.prevAnimate = null;\n } else {\n animate.prevAnimate.nextAnimate = animate.nextAnimate;\n animate.nextAnimate.prevAnimate = animate.prevAnimate;\n // animate不支持二次复用,不需要重置\n // animate.prevAnimate = null;\n // animate.nextAnimate = null;\n }\n release && animate.release();\n\n return;\n }\n}\n\nexport const defaultTimeline = new DefaultTimeline();\n"]}
|
package/cjs/application.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { ILayerService } from './interface/core';
|
|
2
2
|
import type { IGraphicUtil, ITransformUtil } from './interface/core';
|
|
3
|
-
import type { IGlobal, IGraphicService
|
|
3
|
+
import type { IGlobal, IGraphicService } from './interface';
|
|
4
4
|
export declare class Application {
|
|
5
5
|
global: IGlobal;
|
|
6
6
|
graphicUtil: IGraphicUtil;
|
|
7
7
|
graphicService: IGraphicService;
|
|
8
|
-
renderService: IRenderService;
|
|
9
8
|
transformUtil: ITransformUtil;
|
|
10
9
|
layerService: ILayerService;
|
|
11
10
|
}
|
package/cjs/application.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/application.ts"],"names":[],"mappings":";;;AAIA,MAAa,WAAW;
|
|
1
|
+
{"version":3,"sources":["../src/application.ts"],"names":[],"mappings":";;;AAIA,MAAa,WAAW;CAMvB;AAND,kCAMC;AAEY,QAAA,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","file":"application.js","sourcesContent":["import type { ILayerService } from './interface/core';\nimport type { IGraphicUtil, ITransformUtil } from './interface/core';\nimport type { IGlobal, IGraphicService } from './interface';\n\nexport class Application {\n global: IGlobal;\n graphicUtil: IGraphicUtil;\n graphicService: IGraphicService;\n transformUtil: ITransformUtil;\n layerService: ILayerService;\n}\n\nexport const application = new Application();\n"]}
|
package/cjs/canvas/constants.js
CHANGED
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Context2dFactory = exports.CanvasFactory = void 0, exports.CanvasFactory = Symbol.for("CanvasFactory"),
|
|
6
|
-
exports.Context2dFactory = Symbol.for("Context2dFactory");
|
|
6
|
+
exports.Context2dFactory = Symbol.for("Context2dFactory");
|
|
7
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -33,7 +33,6 @@ export declare class EmptyContext2d implements IContext2d {
|
|
|
33
33
|
get currentMatrix(): Matrix;
|
|
34
34
|
cloneMatrix(m: Matrix): IMatrix;
|
|
35
35
|
clear(): void;
|
|
36
|
-
reset(): void;
|
|
37
36
|
restore(): void;
|
|
38
37
|
highPerformanceRestore(): void;
|
|
39
38
|
rotate(rad: number, setTransform?: boolean): void;
|
|
@@ -44,10 +44,6 @@ let EmptyContext2d = class {
|
|
|
44
44
|
clear() {
|
|
45
45
|
this.save(), this.resetTransform(), this.restore();
|
|
46
46
|
}
|
|
47
|
-
reset() {
|
|
48
|
-
this.matrix.setValue(1, 0, 0, 1, 0, 0), this.applyedMatrix = new vutils_1.Matrix(1, 0, 0, 1, 0, 0),
|
|
49
|
-
this.stack.length = 0;
|
|
50
|
-
}
|
|
51
47
|
restore() {
|
|
52
48
|
this.stack.length > 0 && (matrix_allocate_1.matrixAllocate.free(this.matrix), this.matrix = this.stack.pop(),
|
|
53
49
|
this.setTransformForCurrent());
|