@visactor/vrender-core 0.22.12 → 0.22.13
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/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 +8867 -6020
- 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/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 +2 -2
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA+CA,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,kDAAgC;AAChC,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,oDAAkC;AAClC,8CAA4B;AAC5B,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,iDAA+B;AAC/B,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB
|
|
1
|
+
{"version":3,"sources":["../src/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA+CA,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B;AAC5B,4CAA0B;AAC1B,kDAAgC;AAChC,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,4CAA0B;AAC1B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,oDAAkC;AAClC,8CAA4B;AAC5B,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,iDAA+B;AAC/B,2CAAyB;AACzB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB","file":"index.js","sourcesContent":["// export type MaybePromise<T> = T | PromiseLike<T>;\n\n// // 所有的接口都应当继承这个,避免内存没有释放\n// export interface Disposable {\n// dispose: (params?: any) => void;\n// }\n\n// export { INode } from './node-tree';\n// export { IGraphic, IGraphicAttribute, IFillStyle, IStrokeStyle, IStyle, ITransform } from './graphic';\n// export { IArc, IArcAttribute, IArcGraphicAttribute, IArcCache } from './graphic/arc';\n// export { IArea, IAreaAttribute, IAreaGraphicAttribute, IAreaCacheItem, IAreaSegment } from './graphic/area';\n// export { ICircle, ICircleAttribute, ICircleGraphicAttribute } from './graphic/circle';\n// export { IGroup, IGroupAttribute } from './graphic/group';\n// export { IImage, IImageAttribute, IImageGraphicAttribute, IRepeatType } from './graphic/image';\n// export { ILine, ILineAttribute, ILineGraphicAttribute, ISegment } from './graphic/line';\n// export { IPath, IPathAttribute, IPathGraphicAttribute } from './graphic/path';\n// export { IRect, IRectAttribute, IRectGraphicAttribute } from './graphic/rect';\n// export {\n// IRichText,\n// IRichTextAttribute,\n// RichTextCharacter,\n// RichTextFontStyle,\n// RichTextGlobalAlignType,\n// RichTextGlobalBaselineType,\n// RichTextScript,\n// RichTextTextAlign,\n// RichTextTextDecoration,\n// RichTextVerticalDirection,\n// RichTextWordBreak,\n// IRichTextGraphicAttribute\n// } from './graphic/richText';\n// export { ISymbol, ISymbolAttribute, ISymbolGraphicAttribute, SymbolType } from './graphic/symbol';\n// export { IText, ITextAttribute, ITextGraphicAttribute, ITextCache } from './graphic/text';\n// export { ILayer, ILayerDrawParams } from './layer';\n// export { IStage, IStageParams, IExportType } from './stage';\n\n// // export * from './graphic';\n// export { ICanvas, ICanvasLike } from './canvas';\n// export { IContext2d, IContextLike, ICommonStyleParams, IStrokeStyleParams, ITextStyleParams } from './context';\n\n// export { IPath2D, ICustomPath2D, CommandType, ICurvePath, ICurve } from './path';\n\n// export { IColor, IColorStop, IConicalGradient, ILinearGradient, IRadialGradient } from './color';\n\n// export { ICurveType } from './common';\n// // export { IAreaCacheItem } from './graphic';\n\nexport * from './global';\nexport * from './common';\nexport * from './node-tree';\nexport * from './graphic';\nexport * from './graphic/index';\nexport * from './layer';\nexport * from './stage';\nexport * from './canvas';\nexport * from './context';\nexport * from './path';\nexport * from './color';\nexport * from './common';\nexport * from './animate';\nexport * from './camera';\nexport * from './matrix';\nexport * from './light';\nexport * from './curve';\nexport * from './graphic-service';\nexport * from './sync-hook';\nexport * from './allocator';\nexport * from './core';\nexport * from './event';\nexport * from './loader';\nexport * from './contribution';\nexport * from './render';\nexport * from './plugin';\nexport * from './picker';\nexport * from './text';\nexport * from './window';\n"]}
|
|
@@ -25,7 +25,6 @@ export interface IRenderService {
|
|
|
25
25
|
renderTreeRoots: IGraphic[];
|
|
26
26
|
renderLists: IGraphic[];
|
|
27
27
|
drawParams: IRenderServiceDrawParams;
|
|
28
|
-
drawContribution: IDrawContribution;
|
|
29
28
|
prepare: (updateBounds: boolean) => void;
|
|
30
29
|
prepareRenderList: () => void;
|
|
31
30
|
beforeDraw: (params: IRenderServiceDrawParams) => void;
|
|
@@ -45,7 +44,6 @@ export interface IDrawContext extends IRenderServiceDrawParams {
|
|
|
45
44
|
in3dInterceptor?: boolean;
|
|
46
45
|
drawContribution?: IDrawContribution;
|
|
47
46
|
hack_pieFace?: 'inside' | 'bottom' | 'top' | 'outside';
|
|
48
|
-
isGroupScroll?: boolean;
|
|
49
47
|
}
|
|
50
48
|
export interface IDrawContribution {
|
|
51
49
|
hooks?: {
|
|
@@ -70,11 +68,6 @@ export interface IGraphicRenderDrawParams {
|
|
|
70
68
|
drawingCb?: () => void;
|
|
71
69
|
skipDraw?: boolean;
|
|
72
70
|
theme?: IFullThemeSpec;
|
|
73
|
-
renderInGroupParams?: {
|
|
74
|
-
skipSort?: boolean;
|
|
75
|
-
nextM?: IMatrixLike;
|
|
76
|
-
};
|
|
77
|
-
renderInGroup?: (skipSort: boolean, group: IGroup, drawContext: IDrawContext, nextM: IMatrixLike) => void;
|
|
78
71
|
}
|
|
79
72
|
export interface IGraphicRender {
|
|
80
73
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/render.ts"],"names":[],"mappings":"","file":"render.js","sourcesContent":["import type { IAABBBounds, IBounds, IMatrix, IMatrixLike } from '@visactor/vutils';\nimport type { IColor } from './color';\nimport type { IContext2d } from './context';\nimport type { IGraphic, IGraphicAttribute } from './graphic';\nimport type { IMarkAttribute, IThemeAttribute } from './graphic/creator';\nimport type { IFullThemeSpec } from './graphic/theme';\nimport type { ILayer } from './layer';\nimport type { IStage } from './stage';\nimport type { IGroup } from './graphic/group';\nimport type { MaybePromise } from './common';\nimport type { ISyncHook } from './sync-hook';\n\n// 用于绘制的参数,提供context\n// TODO: 考虑是否可以隐藏上下文类型\nexport interface IRenderServiceDrawParams {\n context?: IContext2d;\n\n // 绘制的区域以及是否需要清屏\n clear?: string | IColor | boolean;\n viewBox: IBounds;\n transMatrix?: IMatrixLike;\n stage: IStage;\n layer: ILayer;\n renderService: IRenderService;\n updateBounds: boolean;\n renderStyle?: string;\n}\n\nexport interface IRenderService {\n dirtyBounds: IBounds;\n renderTreeRoots: IGraphic[]; // 此次render的数组\n renderLists: IGraphic[];\n drawParams: IRenderServiceDrawParams;\n
|
|
1
|
+
{"version":3,"sources":["../src/interface/render.ts"],"names":[],"mappings":"","file":"render.js","sourcesContent":["import type { IAABBBounds, IBounds, IMatrix, IMatrixLike } from '@visactor/vutils';\nimport type { IColor } from './color';\nimport type { IContext2d } from './context';\nimport type { IGraphic, IGraphicAttribute } from './graphic';\nimport type { IMarkAttribute, IThemeAttribute } from './graphic/creator';\nimport type { IFullThemeSpec } from './graphic/theme';\nimport type { ILayer } from './layer';\nimport type { IStage } from './stage';\nimport type { IGroup } from './graphic/group';\nimport type { MaybePromise } from './common';\nimport type { ISyncHook } from './sync-hook';\n\n// 用于绘制的参数,提供context\n// TODO: 考虑是否可以隐藏上下文类型\nexport interface IRenderServiceDrawParams {\n context?: IContext2d;\n\n // 绘制的区域以及是否需要清屏\n clear?: string | IColor | boolean;\n viewBox: IBounds;\n transMatrix?: IMatrixLike;\n stage: IStage;\n layer: ILayer;\n renderService: IRenderService;\n updateBounds: boolean;\n renderStyle?: string;\n}\n\nexport interface IRenderService {\n dirtyBounds: IBounds;\n renderTreeRoots: IGraphic[]; // 此次render的数组\n renderLists: IGraphic[];\n drawParams: IRenderServiceDrawParams;\n\n prepare: (updateBounds: boolean) => void;\n prepareRenderList: () => void;\n beforeDraw: (params: IRenderServiceDrawParams) => void;\n draw: (params: IRenderServiceDrawParams) => void;\n afterDraw: (params: IRenderServiceDrawParams) => void;\n render: (groups: IGroup[], params: IRenderServiceDrawParams) => MaybePromise<void>;\n reInit: () => void;\n}\n\nexport interface IDrawContext extends IRenderServiceDrawParams {\n startAtId?: number;\n break?: boolean;\n restartIncremental?: boolean;\n // multi图元开始的位置\n multiGraphicOptions?: {\n startAtIdx: number;\n length: number;\n };\n in3dInterceptor?: boolean;\n drawContribution?: IDrawContribution;\n // hack内容\n hack_pieFace?: 'inside' | 'bottom' | 'top' | 'outside';\n}\n\nexport interface IDrawContribution {\n hooks?: {\n completeDraw: ISyncHook<[]>;\n };\n dirtyBounds?: IAABBBounds;\n backupDirtyBounds?: IAABBBounds;\n rendering?: boolean;\n currentRenderMap: Map<number, IGraphicRender>;\n defaultRenderMap: Map<number, IGraphicRender>;\n styleRenderMap: Map<string, Map<number, IGraphicRender>>;\n draw: (renderService: IRenderService, drawParams: IDrawContext) => MaybePromise<void>;\n afterDraw?: (renderService: IRenderService, drawParams: IDrawContext) => MaybePromise<void>;\n getRenderContribution: (graphic: IGraphic) => IGraphicRender | null;\n renderGroup: (group: IGroup, drawContext: IDrawContext, matrix: IMatrixLike, skipSort?: boolean) => void;\n renderItem: (graphic: IGraphic, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) => void;\n reInit: () => void;\n}\n\nexport interface IGraphicRenderDrawParams {\n beforeDrawCb?: () => void;\n afterDrawCb?: () => void;\n drawingCb?: () => void;\n skipDraw?: boolean;\n theme?: IFullThemeSpec;\n}\n\nexport interface IGraphicRender {\n type: string; // 图元类型\n numberType: number;\n style?: string;\n z?: number;\n draw: (\n graphic: IGraphic,\n renderService: IRenderService,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams\n ) => void;\n drawShape?: (\n graphic: IGraphic,\n ctx: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) => void;\n\n reInit: () => void;\n}\n\nexport interface IBeforeRenderConstribution {\n apply: (renderService: IRenderService) => MaybePromise<void>;\n}\n\nexport interface IRenderSelector {\n selector: (graphic: IGraphic) => IGraphicRender | null;\n}\n\nexport interface IDrawItemInterceptorContribution {\n order: number;\n beforeDrawItem?: (\n graphic: IGraphic,\n renderService: IRenderService,\n drawContext: IDrawContext,\n drawContribution: IDrawContribution,\n params?: IGraphicRenderDrawParams\n ) => boolean;\n afterDrawItem?: (\n graphic: IGraphic,\n renderService: IRenderService,\n drawContext: IDrawContext,\n drawContribution: IDrawContribution,\n params?: IGraphicRenderDrawParams\n ) => boolean;\n}\n"]}
|
package/cjs/interface/stage.d.ts
CHANGED
|
@@ -7,13 +7,12 @@ import type { vec3 } from './matrix';
|
|
|
7
7
|
import type { IDirectionLight } from './light';
|
|
8
8
|
import type { ISyncHook } from './sync-hook';
|
|
9
9
|
import type { IDrawContext, IRenderService } from './render';
|
|
10
|
-
import type { ITicker, ITimeline } from './
|
|
10
|
+
import type { ITicker, ITimeline } from './animate';
|
|
11
11
|
import type { IPickerService, PickResult } from './picker';
|
|
12
12
|
import type { IPlugin, IPluginService } from './plugin';
|
|
13
13
|
import type { IWindow } from './window';
|
|
14
14
|
import type { ILayerService } from './core';
|
|
15
15
|
import type { IFullThemeSpec } from './graphic/theme';
|
|
16
|
-
import type { IGraphicService } from './graphic-service';
|
|
17
16
|
export type IExportType = 'canvas' | 'imageData';
|
|
18
17
|
export type IStageCreateContext = {
|
|
19
18
|
appName?: 'vchart' | 'vgrammar' | 'vtable' | string;
|
|
@@ -47,7 +46,6 @@ export interface IStageParams {
|
|
|
47
46
|
supportsTouchEvents?: boolean;
|
|
48
47
|
supportsPointerEvents?: boolean;
|
|
49
48
|
context?: IStageCreateContext;
|
|
50
|
-
rafId?: number;
|
|
51
49
|
}
|
|
52
50
|
export type EventConfig = {
|
|
53
51
|
autoPreventDefault?: boolean;
|
|
@@ -110,7 +108,6 @@ export interface IStage extends INode {
|
|
|
110
108
|
ticker: ITicker;
|
|
111
109
|
increaseAutoRender: boolean;
|
|
112
110
|
readonly renderService: IRenderService;
|
|
113
|
-
readonly graphicService: IGraphicService;
|
|
114
111
|
getPickerService: () => IPickerService;
|
|
115
112
|
readonly pluginService: IPluginService;
|
|
116
113
|
readonly layerService: ILayerService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/stage.ts"],"names":[],"mappings":"","file":"stage.js","sourcesContent":["import type { INode } from './node-tree';\nimport type { ILayer, LayerMode } from './layer';\nimport type { IColor } from './color';\nimport type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport type { ICamera } from './camera';\nimport type { vec3 } from './matrix';\nimport type { IDirectionLight } from './light';\nimport type { ISyncHook } from './sync-hook';\nimport type { IDrawContext, IRenderService } from './render';\nimport type { ITicker, ITimeline } from './
|
|
1
|
+
{"version":3,"sources":["../src/interface/stage.ts"],"names":[],"mappings":"","file":"stage.js","sourcesContent":["import type { INode } from './node-tree';\nimport type { ILayer, LayerMode } from './layer';\nimport type { IColor } from './color';\nimport type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport type { ICamera } from './camera';\nimport type { vec3 } from './matrix';\nimport type { IDirectionLight } from './light';\nimport type { ISyncHook } from './sync-hook';\nimport type { IDrawContext, IRenderService } from './render';\nimport type { ITicker, ITimeline } from './animate';\nimport type { IPickerService, PickResult } from './picker';\nimport type { IPlugin, IPluginService } from './plugin';\nimport type { IWindow } from './window';\nimport type { ILayerService } from './core';\nimport type { IFullThemeSpec } from './graphic/theme';\n\nexport type IExportType = 'canvas' | 'imageData';\n\nexport type IStageCreateContext = {\n appName?: 'vchart' | 'vgrammar' | 'vtable' | string;\n};\nexport interface IStageParams {\n // x: number;\n // y: number;\n // // 视口的宽高\n // viewWidth: number;\n // viewHeight: number;\n\n // 视口的宽高\n viewBox: IBoundsLike;\n // 总的宽高\n width: number;\n height: number;\n dpr: number;\n // stage的背景\n background: string | IColor;\n // 外部的canvas\n canvas: string | HTMLCanvasElement;\n // canvas的container容器,如果不传入canvas,那就会在容器中创建canvas\n container: string | HTMLElement;\n // 是否是受控制的canvas,如果不是的话,不会进行resize等操作,也不会修改canvas的样式\n canvasControled: boolean;\n title: string;\n // 是否开启自动渲染\n autoRender: boolean;\n // 是否开启自动刷新\n autoRefresh: boolean;\n // 是否开启布局支持\n enableLayout: boolean;\n // 是否关闭脏矩形检测\n disableDirtyBounds: boolean;\n // 是否支持interactiveLayer,默认为true\n interactiveLayer: boolean;\n // 是否支持HTML属性\n enableHtmlAttribute: string | boolean | HTMLElement;\n // 是否支持react-dom(传入ReactDOM)\n ReactDOM: any;\n // 是否支持滚动条\n enableScroll: boolean;\n poptip: boolean;\n // 绘制之前的钩子函数\n beforeRender: (stage: IStage) => void;\n // 绘制之后的钩子函数\n afterRender: (stage: IStage) => void;\n renderStyle?: string;\n ticker?: ITicker;\n pluginList?: string[];\n // 优化配置\n optimize?: IOptimizeType;\n /**\n * 事件系统相关配置\n */\n event?: EventConfig;\n\n /**\n * @since 0.17.15\n * 是否支持touch事件,不支持就不监听touch事件\n */\n supportsTouchEvents?: boolean;\n\n /**\n * @since 0.17.15\n * 是否支持pointer事件,不支持就监听mouse事件\n */\n supportsPointerEvents?: boolean;\n\n context?: IStageCreateContext;\n}\n\nexport type EventConfig = {\n /** 是否自动阻止事件 */\n autoPreventDefault?: boolean;\n /**\n * 多次点击之间的最大时间,默认为 200 ms\n * @default 200\n */\n clickInterval?: number;\n [key: string]: any;\n};\n\nexport type IOptimizeType = {\n // 视口不在可视区,跳过渲染,默认为true\n skipRenderWithOutRange?: boolean;\n // 跳过图元在区间外的判断\n // 不存在dirtyBounds的时候,根据该配置判断是否关闭图元的超出边界判定\n // 如果有dirtyBounds那么该配置不生效\n disableCheckGraphicWidthOutRange?: boolean;\n // tick渲染模式,effect会在tick之后立刻执行render,保证动画效果正常。performance模式中tick和render均是RAF,属性可能会被篡改\n tickRenderMode?: 'effect' | 'performance';\n};\n\nexport interface IOption3D {\n enableView3dTransform?: boolean; // 是否开启view3d自动旋转\n alpha?: number; // x轴的转角\n beta?: number; // y轴的转角\n gama?: number; // z轴的转角\n center?: { x?: number; y?: number; z?: number; dx?: number; dy?: number; dz?: number }; // 中心位置\n fieldRatio?: number; // 透视的视域缩放比例\n fieldDepth?: number;\n light?: {\n dir?: vec3;\n color?: string;\n ambient?: number;\n };\n // 配置相机后,alpha、beta、gamma配置会失效\n camera?: any; // 相机配置\n}\n\n// TODO 命名方式\nexport interface IStage extends INode {\n stage?: IStage;\n parent: IStage | null;\n // rootNode: IStage;\n x: number;\n y: number;\n\n params: Partial<IStageParams>;\n\n window: IWindow;\n\n width: number;\n height: number;\n viewWidth: number;\n viewHeight: number;\n defaultLayer: ILayer;\n dirtyBounds: IBounds | null;\n\n autoRender: boolean;\n renderCount: number;\n\n hooks: {\n beforeRender: ISyncHook<[IStage]>;\n afterRender: ISyncHook<[IStage]>;\n };\n\n option3d?: IOption3D;\n\n set3dOptions: (options: IOption3D) => void;\n light?: IDirectionLight;\n camera?: ICamera;\n\n dpr: number;\n\n viewBox: IBoundsLike;\n background: string | IColor;\n ticker: ITicker;\n increaseAutoRender: boolean;\n readonly renderService: IRenderService;\n getPickerService: () => IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n // 如果传入CanvasId,如果存在相同Id,说明这两个图层使用相同的Canvas绘制\n // 但需要注意的是依然是两个图层(用于解决Table嵌入ChartSpace不影响Table的绘制)\n createLayer: (canvasId?: string, layerMode?: LayerMode) => ILayer;\n getLayer: (name: string) => ILayer;\n sortLayer: (cb: (layer1: ILayer, layer2: ILayer) => number) => void;\n removeLayer: (layerId: number) => ILayer | false;\n\n getTimeline: () => ITimeline;\n\n render: (layers?: ILayer[], params?: Partial<IDrawContext>) => void;\n /**\n * 下一帧渲染\n * @param layers 渲染的图层\n * @param force 是否强行下一帧渲染,不采取优化方案\n * @returns\n */\n renderNextFrame: (layers?: ILayer[], force?: boolean) => void;\n tryInitInteractiveLayer: () => void;\n\n // 画布操作\n resize: (w: number, h: number, rerender?: boolean) => void;\n resizeWindow: (w: number, h: number, rerender?: boolean) => void;\n resizeView: (w: number, h: number, rerender?: boolean) => void;\n setViewBox:\n | ((viewBox: IBoundsLike, rerender: boolean) => void)\n | ((x: number, y: number, w: number, h: number, rerender: boolean) => void)\n | ((x: number | IBoundsLike, y: number | boolean, w?: number, h?: number, rerender?: boolean) => void);\n setDpr: (dpr: number, rerender?: boolean) => void;\n setOrigin: (x: number, y: number) => void;\n export: (type: IExportType) => HTMLCanvasElement | ImageData;\n pick: (x: number, y: number) => PickResult | false;\n\n // 动画相关\n startAnimate: (t: number) => void;\n setToFrame: (t: number) => void;\n dirty: (b: IBounds, matrix?: IMatrix) => void;\n // 考虑操作回放\n\n renderTo: (window: IWindow, params: { x: number; y: number; width: number; height: number }) => void;\n\n renderToNewWindow: (fullImage?: boolean) => IWindow;\n\n toCanvas: (fullImage?: boolean, viewBox?: IAABBBounds) => HTMLCanvasElement | null;\n\n setBeforeRender: (cb: (stage: IStage) => void) => void;\n\n setAfterRender: (cb: (stage: IStage) => void) => void;\n\n afterNextRender: (cb: (stage: IStage) => void) => void;\n enableAutoRender: () => void;\n disableAutoRender: () => void;\n enableIncrementalAutoRender: () => void;\n disableIncrementalAutoRender: () => void;\n enableDirtyBounds: () => void;\n disableDirtyBounds: () => void;\n enableView3dTransform: () => void;\n disableView3dTranform: () => void;\n getPluginsByName: (name: string) => IPlugin[];\n clearViewBox: (color?: string) => void;\n release: () => void;\n setStage: (stage?: IStage) => void;\n\n pauseRender: (sk?: number) => void;\n resumeRender: () => void;\n\n setCursor: (mode?: string) => void;\n\n getTheme: () => IFullThemeSpec;\n eventPointTransform: (e: PointerEvent | WheelEvent | TouchEvent) => { x: number; y: number };\n pauseTriggerEvent: () => void;\n resumeTriggerEvent: () => void;\n}\n\nexport declare function combineStage(srages: IStage[], params: { canvas: string | HTMLCanvasElement }): IStage;\n"]}
|
package/cjs/modules.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IGlobal, IGraphicService
|
|
1
|
+
import type { IGlobal, IGraphicService } from './interface';
|
|
2
2
|
import type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';
|
|
3
3
|
export declare function preLoadAllModule(): void;
|
|
4
4
|
export declare namespace preLoadAllModule {
|
|
@@ -8,5 +8,4 @@ export declare const vglobal: IGlobal;
|
|
|
8
8
|
export declare const graphicUtil: IGraphicUtil;
|
|
9
9
|
export declare const transformUtil: ITransformUtil;
|
|
10
10
|
export declare const graphicService: IGraphicService;
|
|
11
|
-
export declare const renderService: IRenderService;
|
|
12
11
|
export declare const layerService: ILayerService;
|
package/cjs/modules.js
CHANGED
|
@@ -8,9 +8,9 @@ var __importDefault = this && this.__importDefault || function(mod) {
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", {
|
|
10
10
|
value: !0
|
|
11
|
-
}), exports.layerService = exports.
|
|
11
|
+
}), exports.layerService = exports.graphicService = exports.transformUtil = exports.graphicUtil = exports.vglobal = exports.preLoadAllModule = void 0;
|
|
12
12
|
|
|
13
|
-
const core_modules_1 = __importDefault(require("./core/core-modules")), render_modules_1 = __importDefault(require("./render/render-modules")), pick_modules_1 = __importDefault(require("./picker/pick-modules")), graphic_module_1 = __importDefault(require("./graphic/graphic-service/graphic-module")), plugin_modules_1 = __importDefault(require("./plugins/plugin-modules")), modules_1 = __importDefault(require("./core/contributions/modules")), modules_2 = __importDefault(require("./render/contributions/modules")), constants_1 = require("./core/constants"), application_1 = require("./application"), constants_2 = require("./graphic/constants"), constants_3 = require("./core/constants"), container_1 = require("./container"), constants_4 = require("./constants")
|
|
13
|
+
const core_modules_1 = __importDefault(require("./core/core-modules")), render_modules_1 = __importDefault(require("./render/render-modules")), pick_modules_1 = __importDefault(require("./picker/pick-modules")), graphic_module_1 = __importDefault(require("./graphic/graphic-service/graphic-module")), plugin_modules_1 = __importDefault(require("./plugins/plugin-modules")), modules_1 = __importDefault(require("./core/contributions/modules")), modules_2 = __importDefault(require("./render/contributions/modules")), constants_1 = require("./core/constants"), application_1 = require("./application"), constants_2 = require("./graphic/constants"), constants_3 = require("./core/constants"), container_1 = require("./container"), constants_4 = require("./constants");
|
|
14
14
|
|
|
15
15
|
function preLoadAllModule() {
|
|
16
16
|
preLoadAllModule.__loaded || (preLoadAllModule.__loaded = !0, container_1.container.load(core_modules_1.default),
|
|
@@ -24,7 +24,6 @@ exports.vglobal = container_1.container.get(constants_4.VGlobal), application_1.
|
|
|
24
24
|
exports.graphicUtil = container_1.container.get(constants_3.GraphicUtil), application_1.application.graphicUtil = exports.graphicUtil,
|
|
25
25
|
exports.transformUtil = container_1.container.get(constants_3.TransformUtil), application_1.application.transformUtil = exports.transformUtil,
|
|
26
26
|
exports.graphicService = container_1.container.get(constants_2.GraphicService),
|
|
27
|
-
application_1.application.graphicService = exports.graphicService, exports.
|
|
28
|
-
application_1.application.renderService = exports.renderService, exports.layerService = container_1.container.get(constants_1.LayerService),
|
|
27
|
+
application_1.application.graphicService = exports.graphicService, exports.layerService = container_1.container.get(constants_1.LayerService),
|
|
29
28
|
application_1.application.layerService = exports.layerService;
|
|
30
29
|
//# sourceMappingURL=modules.js.map
|
package/cjs/modules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/modules.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA6C;AAC7C,6EAAmD;AACnD,yEAA+C;AAE/C,8FAAqE;AACrE,8EAAoD;AACpD,2EAAoE;AACpE,6EAAqE;AAGrE,gDAAgD;AAIhD,+CAA4C;AAE5C,mDAAqD;AACrD,gDAA8D;AAC9D,2CAAwC;AACxC,2CAAsC;
|
|
1
|
+
{"version":3,"sources":["../src/modules.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA6C;AAC7C,6EAAmD;AACnD,yEAA+C;AAE/C,8FAAqE;AACrE,8EAAoD;AACpD,2EAAoE;AACpE,6EAAqE;AAGrE,gDAAgD;AAIhD,+CAA4C;AAE5C,mDAAqD;AACrD,gDAA8D;AAC9D,2CAAwC;AACxC,2CAAsC;AAEtC,SAAgB,gBAAgB;IAC9B,IAAI,gBAAgB,CAAC,QAAQ,EAAE;QAC7B,OAAO;KACR;IACD,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC;IACjC,qBAAS,CAAC,IAAI,CAAC,sBAAU,CAAC,CAAC;IAC3B,qBAAS,CAAC,IAAI,CAAC,wBAAa,CAAC,CAAC;IAC9B,qBAAS,CAAC,IAAI,CAAC,wBAAY,CAAC,CAAC;IAC7B,qBAAS,CAAC,IAAI,CAAC,sBAAU,CAAC,CAAC;IAE3B,qBAAS,CAAC,IAAI,CAAC,wBAAY,CAAC,CAAC;IAC7B,IAAA,iBAAwB,EAAC,qBAAS,CAAC,CAAC;IACpC,IAAA,iBAAuB,EAAC,qBAAS,CAAC,CAAC;AACrC,CAAC;AAbD,4CAaC;AAED,gBAAgB,CAAC,QAAQ,GAAG,KAAK,CAAC;AAElC,gBAAgB,EAAE,CAAC;AAKN,QAAA,OAAO,GAAG,qBAAS,CAAC,GAAG,CAAU,mBAAO,CAAC,CAAC;AACvD,yBAAW,CAAC,MAAM,GAAG,eAAO,CAAC;AAChB,QAAA,WAAW,GAAG,qBAAS,CAAC,GAAG,CAAe,uBAAW,CAAC,CAAC;AACpE,yBAAW,CAAC,WAAW,GAAG,mBAAW,CAAC;AACzB,QAAA,aAAa,GAAG,qBAAS,CAAC,GAAG,CAAiB,yBAAa,CAAC,CAAC;AAC1E,yBAAW,CAAC,aAAa,GAAG,qBAAa,CAAC;AAC7B,QAAA,cAAc,GAAG,qBAAS,CAAC,GAAG,CAAkB,0BAAc,CAAC,CAAC;AAC7E,yBAAW,CAAC,cAAc,GAAG,sBAAc,CAAC;AAa/B,QAAA,YAAY,GAAG,qBAAS,CAAC,GAAG,CAAgB,wBAAY,CAAC,CAAC;AACvE,yBAAW,CAAC,YAAY,GAAG,oBAAY,CAAC","file":"modules.js","sourcesContent":["import coreModule from './core/core-modules';\nimport renderModule from './render/render-modules';\nimport pickModule from './picker/pick-modules';\n// import allocatorModule from './allocator/allocator-modules';\nimport graphicModule from './graphic/graphic-service/graphic-module';\nimport pluginModule from './plugins/plugin-modules';\nimport loadBuiltinContributions from './core/contributions/modules';\nimport loadRenderContributions from './render/contributions/modules';\n// import loadPickContributions from './picker/contributions/modules';\n// import loadCanvasContributions from './canvas/contributions/modules';\nimport { LayerService } from './core/constants';\n// import { IMat4Allocate, IMatrixAllocate, Mat4Allocate, MatrixAllocate } from './allocator/matrix-allocate';\n// import { GlobalPickerService } from './picker/constants';\nimport type { IGlobal, IGraphicService, IPickerService } from './interface';\nimport { application } from './application';\nimport type { IGraphicUtil, ILayerService, ITransformUtil } from './interface/core';\nimport { GraphicService } from './graphic/constants';\nimport { GraphicUtil, TransformUtil } from './core/constants';\nimport { container } from './container';\nimport { VGlobal } from './constants';\n\nexport function preLoadAllModule() {\n if (preLoadAllModule.__loaded) {\n return;\n }\n preLoadAllModule.__loaded = true;\n container.load(coreModule);\n container.load(graphicModule);\n container.load(renderModule);\n container.load(pickModule);\n // container.load(allocatorModule);\n container.load(pluginModule);\n loadBuiltinContributions(container);\n loadRenderContributions(container);\n}\n\npreLoadAllModule.__loaded = false;\n\npreLoadAllModule();\n// loadPickContributions(container);\n// loadCanvasContributions(container);\n\n// 全局变量\nexport const vglobal = container.get<IGlobal>(VGlobal);\napplication.global = vglobal;\nexport const graphicUtil = container.get<IGraphicUtil>(GraphicUtil);\napplication.graphicUtil = graphicUtil;\nexport const transformUtil = container.get<ITransformUtil>(TransformUtil);\napplication.transformUtil = transformUtil;\nexport const graphicService = container.get<IGraphicService>(GraphicService);\napplication.graphicService = graphicService;\n// export const matrixAllocate = container.get<IMatrixAllocate>(MatrixAllocate);\n// export const mat4Allocate = container.get<IMat4Allocate>(Mat4Allocate);\n// export const canvasAllocate = container.get<ICanvasAllocate>(CanvasAllocate);\n// export const arcAllocate = container.get<IArcAllocate>(ArcAllocate);\n// export const areaAllocate = container.get<IAreaAllocate>(AreaAllocate);\n// export const circleAllocate = container.get<ICircleAllocate>(CircleAllocate);\n// export const lineAllocate = container.get<ILineAllocate>(LineAllocate);\n// export const pathAllocate = container.get<IPathAllocate>(PathAllocate);\n// export const rectAllocate = container.get<IRectAllocate>(RectAllocate);\n// export const symbolAllocate = container.get<ISymbolAllocate>(SymbolAllocate);\n// export const textAllocate = container.get<ITextAllocate>(TextAllocate);\n// export const pickerService = container.get<IPickerService>(GlobalPickerService);\nexport const layerService = container.get<ILayerService>(LayerService);\napplication.layerService = layerService;\n"]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.AutoRenderPlugin = void 0;
|
|
6
6
|
|
|
7
|
-
const generator_1 = require("../../common/generator");
|
|
7
|
+
const generator_1 = require("../../common/generator"), application_1 = require("../../application");
|
|
8
8
|
|
|
9
9
|
class AutoRenderPlugin {
|
|
10
10
|
constructor() {
|
|
@@ -14,16 +14,15 @@ class AutoRenderPlugin {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
activate(context) {
|
|
17
|
-
this.pluginService = context
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
stage.graphicService.hooks.onSetStage.tap(this.key, this.handleChange), stage.graphicService.hooks.onRemove.tap(this.key, this.handleChange));
|
|
17
|
+
this.pluginService = context, application_1.application.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handleChange),
|
|
18
|
+
application_1.application.graphicService.hooks.onSetStage.tap(this.key, this.handleChange),
|
|
19
|
+
application_1.application.graphicService.hooks.onRemove.tap(this.key, this.handleChange);
|
|
21
20
|
}
|
|
22
21
|
deactivate(context) {
|
|
23
|
-
const filterByName = taps => taps.filter((item => item.name !== this.key))
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const filterByName = taps => taps.filter((item => item.name !== this.key));
|
|
23
|
+
application_1.application.graphicService.hooks.onAttributeUpdate.taps = filterByName(application_1.application.graphicService.hooks.onAttributeUpdate.taps),
|
|
24
|
+
application_1.application.graphicService.hooks.onSetStage.taps = filterByName(application_1.application.graphicService.hooks.onSetStage.taps),
|
|
25
|
+
application_1.application.graphicService.hooks.onRemove.taps = filterByName(application_1.application.graphicService.hooks.onRemove.taps);
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/builtin-plugin/auto-render-plugin.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;
|
|
1
|
+
{"version":3,"sources":["../src/plugins/builtin-plugin/auto-render-plugin.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AACnD,mDAAgD;AAGhD,MAAa,gBAAgB;IAA7B;QACE,SAAI,GAAuB,kBAAkB,CAAC;QAC9C,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,qBAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEpC,iBAAY,GAAG,CAAC,OAAiB,EAAE,EAAE;YACnC,IAAI,OAAO,CAAC,SAAS,EAAE;gBACrB,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;aAC7B;YACD,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE;gBACvE,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;aACjC;QACH,CAAC,CAAC;IAqBJ,CAAC;IAnBC,QAAQ,CAAC,OAAuB;QAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACpF,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC7E,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7E,CAAC;IACD,UAAU,CAAC,OAAuB;QAChC,MAAM,YAAY,GAAG,CAAC,IAAe,EAAE,EAAE;YACvC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBACxB,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;YAChC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,GAAG,YAAY,CACpE,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CACxD,CAAC;QACF,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,YAAY,CAAC,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAClH,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC,yBAAW,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChH,CAAC;CACF;AAnCD,4CAmCC","file":"auto-render-plugin.js","sourcesContent":["import { Generator } from '../../common/generator';\nimport { application } from '../../application';\nimport type { FullTap, IGraphic, IPlugin, IPluginService } from '../../interface';\n\nexport class AutoRenderPlugin implements IPlugin {\n name: 'AutoRenderPlugin' = 'AutoRenderPlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n\n handleChange = (graphic: IGraphic) => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (graphic.stage === this.pluginService.stage && graphic.stage != null) {\n graphic.stage.renderNextFrame();\n }\n };\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n application.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handleChange);\n application.graphicService.hooks.onSetStage.tap(this.key, this.handleChange);\n application.graphicService.hooks.onRemove.tap(this.key, this.handleChange);\n }\n deactivate(context: IPluginService): void {\n const filterByName = (taps: FullTap[]) => {\n return taps.filter(item => {\n return item.name !== this.key;\n });\n };\n\n application.graphicService.hooks.onAttributeUpdate.taps = filterByName(\n application.graphicService.hooks.onAttributeUpdate.taps\n );\n application.graphicService.hooks.onSetStage.taps = filterByName(application.graphicService.hooks.onSetStage.taps);\n application.graphicService.hooks.onRemove.taps = filterByName(application.graphicService.hooks.onRemove.taps);\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.DirtyBoundsPlugin = void 0;
|
|
6
6
|
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), generator_1 = require("../../common/generator"), globalBounds = new vutils_1.AABBBounds;
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), generator_1 = require("../../common/generator"), application_1 = require("../../application"), globalBounds = new vutils_1.AABBBounds;
|
|
8
8
|
|
|
9
9
|
class DirtyBoundsPlugin {
|
|
10
10
|
constructor() {
|
|
@@ -14,27 +14,24 @@ class DirtyBoundsPlugin {
|
|
|
14
14
|
activate(context) {
|
|
15
15
|
this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, (stage => {
|
|
16
16
|
stage && stage === this.pluginService.stage && stage.dirtyBounds.clear();
|
|
17
|
-
}))
|
|
18
|
-
const stage = this.pluginService.stage;
|
|
19
|
-
stage && (stage.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, ((graphic, stage, willUpdate, bounds) => {
|
|
17
|
+
})), application_1.application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, ((graphic, stage, willUpdate, bounds) => {
|
|
20
18
|
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && stage.renderCount && (graphic.isContainer && !graphic.shouldSelfChangeUpdateAABBBounds() || willUpdate && (globalBounds.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2),
|
|
21
19
|
stage.dirty(globalBounds, graphic.parent && graphic.parent.globalTransMatrix)));
|
|
22
|
-
})),
|
|
20
|
+
})), application_1.application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, ((graphic, stage, bounds, params, selfChange) => {
|
|
23
21
|
stage && stage === this.pluginService.stage && stage.renderCount && (graphic.isContainer && !selfChange || stage.dirty(params.globalAABBBounds));
|
|
24
|
-
})),
|
|
22
|
+
})), application_1.application.graphicService.hooks.clearAABBBounds.tap(this.key, ((graphic, stage, bounds) => {
|
|
25
23
|
stage && stage === this.pluginService.stage && stage.renderCount && stage && stage.dirty(bounds);
|
|
26
|
-
})),
|
|
24
|
+
})), application_1.application.graphicService.hooks.onRemove.tap(this.key, (graphic => {
|
|
27
25
|
const stage = graphic.stage;
|
|
28
26
|
stage && stage === this.pluginService.stage && stage.renderCount && stage && stage.dirty(graphic.globalAABBBounds);
|
|
29
|
-
}))
|
|
27
|
+
}));
|
|
30
28
|
}
|
|
31
29
|
deactivate(context) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
stage.
|
|
36
|
-
|
|
37
|
-
stage.graphicService.hooks.onRemove.taps = stage.graphicService.hooks.onRemove.taps.filter((item => item.name !== this.key)));
|
|
30
|
+
application_1.application.graphicService.hooks.beforeUpdateAABBBounds.taps = application_1.application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((item => item.name !== this.key)),
|
|
31
|
+
application_1.application.graphicService.hooks.afterUpdateAABBBounds.taps = application_1.application.graphicService.hooks.afterUpdateAABBBounds.taps.filter((item => item.name !== this.key)),
|
|
32
|
+
application_1.application.graphicService.hooks.clearAABBBounds.taps = application_1.application.graphicService.hooks.clearAABBBounds.taps.filter((item => item.name !== this.key)),
|
|
33
|
+
context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter((item => item.name !== this.key)),
|
|
34
|
+
application_1.application.graphicService.hooks.onRemove.taps = application_1.application.graphicService.hooks.onRemove.taps.filter((item => item.name !== this.key));
|
|
38
35
|
}
|
|
39
36
|
}
|
|
40
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/builtin-plugin/dirty-bounds-plugin.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AAC9C,sDAAmD;
|
|
1
|
+
{"version":3,"sources":["../src/plugins/builtin-plugin/dirty-bounds-plugin.ts"],"names":[],"mappings":"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","file":"dirty-bounds-plugin.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { AABBBounds } from '@visactor/vutils';\nimport { Generator } from '../../common/generator';\nimport type { IGraphic, IStage, IPlugin, IPluginService } from '../../interface';\nimport { application } from '../../application';\n\nconst globalBounds = new AABBBounds();\n\nexport class DirtyBoundsPlugin implements IPlugin {\n name: 'DirtyBoundsPlugin' = 'DirtyBoundsPlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n context.stage.hooks.afterRender.tap(this.key, stage => {\n if (!(stage && stage === this.pluginService.stage)) {\n return;\n }\n stage.dirtyBounds.clear();\n });\n application.graphicService.hooks.beforeUpdateAABBBounds.tap(\n this.key,\n (graphic: IGraphic, stage: IStage, willUpdate: boolean, bounds: IAABBBounds) => {\n if (graphic.glyphHost) {\n graphic = graphic.glyphHost;\n }\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n // group的子元素导致的bounds更新不用做dirtyBounds\n if (graphic.isContainer && !graphic.shouldSelfChangeUpdateAABBBounds()) {\n return;\n }\n if (willUpdate) {\n globalBounds.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2);\n stage.dirty(globalBounds, graphic.parent && graphic.parent.globalTransMatrix);\n }\n }\n );\n application.graphicService.hooks.afterUpdateAABBBounds.tap(\n this.key,\n (\n graphic: IGraphic,\n stage: IStage,\n bounds: IAABBBounds,\n params: { globalAABBBounds: IAABBBounds },\n selfChange: boolean\n ) => {\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n // group的子元素导致的bounds更新不用做dirtyBounds\n if (graphic.isContainer && !selfChange) {\n return;\n }\n stage.dirty(params.globalAABBBounds);\n }\n );\n application.graphicService.hooks.clearAABBBounds.tap(\n this.key,\n (graphic: IGraphic, stage: IStage, bounds: IAABBBounds) => {\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n if (stage) {\n stage.dirty(bounds);\n }\n }\n );\n application.graphicService.hooks.onRemove.tap(this.key, (graphic: IGraphic) => {\n const stage = graphic.stage;\n if (!(stage && stage === this.pluginService.stage && stage.renderCount)) {\n return;\n }\n if (stage) {\n stage.dirty(graphic.globalAABBBounds);\n }\n });\n }\n deactivate(context: IPluginService): void {\n application.graphicService.hooks.beforeUpdateAABBBounds.taps =\n application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n application.graphicService.hooks.afterUpdateAABBBounds.taps =\n application.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n application.graphicService.hooks.clearAABBBounds.taps =\n application.graphicService.hooks.clearAABBBounds.taps.filter(item => {\n return item.name !== this.key;\n });\n context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => {\n return item.name !== this.key;\n });\n application.graphicService.hooks.onRemove.taps = application.graphicService.hooks.onRemove.taps.filter(item => {\n return item.name !== this.key;\n });\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.registerFlexLayoutPlugin = exports.FlexLayoutPlugin = void 0;
|
|
6
6
|
|
|
7
|
-
const theme_1 = require("../../graphic/theme"), generator_1 = require("../../common/generator"), vutils_1 = require("@visactor/vutils"), factory_1 = require("../../factory"), _tempBounds = new vutils_1.AABBBounds;
|
|
7
|
+
const theme_1 = require("../../graphic/theme"), generator_1 = require("../../common/generator"), vutils_1 = require("@visactor/vutils"), application_1 = require("../../application"), factory_1 = require("../../factory"), _tempBounds = new vutils_1.AABBBounds;
|
|
8
8
|
|
|
9
9
|
class FlexLayoutPlugin {
|
|
10
10
|
constructor() {
|
|
@@ -226,24 +226,21 @@ class FlexLayoutPlugin {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
activate(context) {
|
|
229
|
-
this.pluginService = context
|
|
230
|
-
const stage = this.pluginService.stage;
|
|
231
|
-
stage && (stage.graphicService.hooks.onAttributeUpdate.tap(this.key, (graphic => {
|
|
229
|
+
this.pluginService = context, application_1.application.graphicService.hooks.onAttributeUpdate.tap(this.key, (graphic => {
|
|
232
230
|
graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage && graphic.stage === this.pluginService.stage && this.tryLayout(graphic, !1);
|
|
233
|
-
})),
|
|
231
|
+
})), application_1.application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, ((graphic, stage, willUpdate, bounds) => {
|
|
234
232
|
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && _tempBounds.copy(bounds);
|
|
235
|
-
})),
|
|
233
|
+
})), application_1.application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, ((graphic, stage, bounds, params, selfChange) => {
|
|
236
234
|
stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && (_tempBounds.equals(bounds) || this.tryLayout(graphic, !1));
|
|
237
|
-
})),
|
|
235
|
+
})), application_1.application.graphicService.hooks.onSetStage.tap(this.key, (graphic => {
|
|
238
236
|
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic, !1);
|
|
239
|
-
}))
|
|
237
|
+
}));
|
|
240
238
|
}
|
|
241
239
|
deactivate(context) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
stage.graphicService.hooks.onSetStage.taps = stage.graphicService.hooks.onSetStage.taps.filter((item => item.name !== this.key)));
|
|
240
|
+
application_1.application.graphicService.hooks.onAttributeUpdate.taps = application_1.application.graphicService.hooks.onAttributeUpdate.taps.filter((item => item.name !== this.key)),
|
|
241
|
+
application_1.application.graphicService.hooks.beforeUpdateAABBBounds.taps = application_1.application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((item => item.name !== this.key)),
|
|
242
|
+
application_1.application.graphicService.hooks.afterUpdateAABBBounds.taps = application_1.application.graphicService.hooks.afterUpdateAABBBounds.taps.filter((item => item.name !== this.key)),
|
|
243
|
+
application_1.application.graphicService.hooks.onSetStage.taps = application_1.application.graphicService.hooks.onSetStage.taps.filter((item => item.name !== this.key));
|
|
247
244
|
}
|
|
248
245
|
}
|
|
249
246
|
|