@visactor/vrender-core 0.19.19 → 0.20.0-alpha.1
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/allocator/bounds-allocate.js.map +1 -1
- package/cjs/allocator/matrix-allocate.d.ts +1 -1
- package/cjs/allocator/matrix-allocate.js +2 -4
- package/cjs/allocator/matrix-allocate.js.map +1 -1
- package/cjs/animate/config.js +2 -1
- package/cjs/animate/custom-animate.d.ts +0 -14
- package/cjs/animate/custom-animate.js +2 -61
- package/cjs/animate/custom-animate.js.map +1 -1
- 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 +1 -0
- package/cjs/animate/index.js +2 -1
- package/cjs/animate/index.js.map +1 -1
- package/cjs/canvas/util.d.ts +0 -1
- package/cjs/canvas/util.js +7 -17
- package/cjs/canvas/util.js.map +1 -1
- package/cjs/common/3d-interceptor.d.ts +3 -0
- package/cjs/common/3d-interceptor.js +51 -0
- package/cjs/common/3d-interceptor.js.map +1 -0
- package/cjs/common/Reflect-metadata.js +2 -1
- package/cjs/common/bounds-context.js +1 -2
- package/cjs/common/canvas-utils.d.ts +1 -1
- package/cjs/common/canvas-utils.js +15 -30
- package/cjs/common/canvas-utils.js.map +1 -1
- package/cjs/common/matrix.d.ts +11 -3
- package/cjs/common/matrix.js +97 -19
- package/cjs/common/matrix.js.map +1 -1
- package/cjs/common/morphing-utils.js +1 -1
- package/cjs/common/path-svg.js +1 -1
- package/cjs/common/polygon.js +2 -2
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +1 -1
- package/cjs/common/render-curve.js +24 -33
- package/cjs/common/render-curve.js.map +1 -1
- package/cjs/common/render-utils.js +1 -1
- package/cjs/common/seg-context.js +1 -1
- package/cjs/common/seg-context.js.map +1 -1
- package/cjs/common/segment/index.d.ts +2 -4
- package/cjs/common/segment/index.js.map +1 -1
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +16 -13
- package/cjs/common/sort.js.map +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/store.js +1 -1
- package/cjs/common/text.d.ts +0 -2
- package/cjs/common/text.js +4 -11
- package/cjs/common/text.js.map +1 -1
- package/cjs/core/application.js +1 -2
- package/cjs/core/camera.d.ts +1 -0
- package/cjs/core/camera.js +11 -5
- package/cjs/core/camera.js.map +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global-module.js +0 -2
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -1
- package/cjs/core/graphic-utils.js.map +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +1 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.d.ts +1 -0
- package/cjs/core/light.js +9 -3
- package/cjs/core/light.js.map +1 -1
- package/cjs/core/stage.d.ts +1 -1
- package/cjs/core/stage.js +17 -8
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/factory.d.ts +5 -0
- package/cjs/factory.js +17 -0
- package/cjs/factory.js.map +1 -0
- package/cjs/graphic/arc.d.ts +1 -2
- package/cjs/graphic/arc.js +0 -3
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/area.d.ts +1 -2
- package/cjs/graphic/area.js +0 -3
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/builtin-symbol/utils.js +1 -5
- package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
- package/cjs/graphic/circle.d.ts +1 -2
- package/cjs/graphic/circle.js +0 -3
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/glyph.d.ts +1 -2
- package/cjs/graphic/glyph.js +0 -3
- package/cjs/graphic/glyph.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-service.d.ts +2 -8
- package/cjs/graphic/graphic-service/graphic-service.js +11 -101
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +1 -4
- package/cjs/graphic/graphic.js +0 -3
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +1 -2
- package/cjs/graphic/group.js +0 -3
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/image.d.ts +1 -2
- package/cjs/graphic/image.js +0 -3
- package/cjs/graphic/image.js.map +1 -1
- package/cjs/graphic/index.js.map +1 -1
- package/cjs/graphic/line.d.ts +1 -2
- package/cjs/graphic/line.js +0 -3
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/path.d.ts +1 -2
- package/cjs/graphic/path.js +0 -3
- package/cjs/graphic/path.js.map +1 -1
- package/cjs/graphic/polygon.d.ts +1 -2
- package/cjs/graphic/polygon.js +0 -3
- package/cjs/graphic/polygon.js.map +1 -1
- package/cjs/graphic/rect.d.ts +1 -2
- package/cjs/graphic/rect.js +0 -3
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/richtext/utils.js +12 -21
- package/cjs/graphic/richtext/utils.js.map +1 -1
- package/cjs/graphic/richtext.d.ts +1 -2
- package/cjs/graphic/richtext.js +0 -3
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/symbol.d.ts +0 -2
- package/cjs/graphic/symbol.js +0 -3
- package/cjs/graphic/symbol.js.map +1 -1
- package/cjs/graphic/text.d.ts +1 -2
- package/cjs/graphic/text.js +1 -4
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/index.d.ts +4 -1
- package/cjs/index.js +16 -15
- package/cjs/index.js.map +1 -1
- package/cjs/interface/graphic.d.ts +1 -2
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/picker/pick-interceptor.d.ts +1 -1
- package/cjs/picker/pick-interceptor.js +2 -42
- package/cjs/picker/pick-interceptor.js.map +1 -1
- package/cjs/picker/picker-service.js +7 -7
- package/cjs/picker/picker-service.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +2 -2
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.d.ts +1 -0
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +11 -5
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.d.ts +1 -0
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.js +8 -2
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
- package/cjs/render/contributions/render/arc-render.js +1 -4
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +4 -32
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/base-3d-render.d.ts +10 -0
- package/cjs/render/contributions/render/base-3d-render.js +63 -0
- package/cjs/render/contributions/render/base-3d-render.js.map +1 -0
- package/cjs/render/contributions/render/base-render.js +5 -5
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js +14 -30
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/base-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/circle-contribution-render.js +11 -22
- package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js +11 -24
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +10 -21
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/text-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.js +4 -4
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/draw-interceptor.js +7 -51
- package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
- package/cjs/render/contributions/render/group-render.js +6 -6
- package/cjs/render/contributions/render/group-render.js.map +1 -1
- package/cjs/render/contributions/render/incremental-draw-contribution.js +4 -4
- package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/line-render.js.map +1 -1
- package/cjs/render/contributions/render/pyramid3d-render.d.ts +3 -5
- package/cjs/render/contributions/render/pyramid3d-render.js +4 -54
- package/cjs/render/contributions/render/pyramid3d-render.js.map +1 -1
- package/cjs/render/contributions/render/rect3d-render.d.ts +3 -5
- package/cjs/render/contributions/render/rect3d-render.js +4 -53
- package/cjs/render/contributions/render/rect3d-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-render.js +9 -18
- package/cjs/render/contributions/render/symbol-render.js.map +1 -1
- package/cjs/render/contributions/render/text-render.d.ts +3 -2
- package/cjs/render/contributions/render/text-render.js +13 -32
- package/cjs/render/contributions/render/text-render.js.map +1 -1
- package/cjs/render/contributions/render/utils.js +2 -5
- package/cjs/render/contributions/render/utils.js.map +1 -1
- package/dist/index.es.js +11316 -11831
- package/es/allocator/bounds-allocate.js.map +1 -1
- package/es/allocator/matrix-allocate.d.ts +1 -1
- package/es/allocator/matrix-allocate.js +3 -3
- package/es/allocator/matrix-allocate.js.map +1 -1
- package/es/animate/config.js +2 -1
- package/es/animate/custom-animate.d.ts +0 -14
- package/es/animate/custom-animate.js +1 -56
- package/es/animate/custom-animate.js.map +1 -1
- 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 +1 -0
- package/es/animate/index.js +2 -0
- package/es/animate/index.js.map +1 -1
- package/es/canvas/util.d.ts +0 -1
- package/es/canvas/util.js +7 -17
- package/es/canvas/util.js.map +1 -1
- package/es/common/3d-interceptor.d.ts +3 -0
- package/es/common/3d-interceptor.js +47 -0
- package/es/common/3d-interceptor.js.map +1 -0
- package/es/common/Reflect-metadata.js +2 -1
- package/es/common/bounds-context.js +1 -2
- package/es/common/canvas-utils.d.ts +1 -1
- package/es/common/canvas-utils.js +15 -30
- package/es/common/canvas-utils.js.map +1 -1
- package/es/common/matrix.d.ts +11 -3
- package/es/common/matrix.js +90 -17
- package/es/common/matrix.js.map +1 -1
- package/es/common/morphing-utils.js +1 -1
- package/es/common/path-svg.js +1 -1
- package/es/common/polygon.js +1 -1
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +1 -1
- package/es/common/render-curve.js +24 -33
- package/es/common/render-curve.js.map +1 -1
- package/es/common/render-utils.js +1 -1
- package/es/common/seg-context.js +1 -1
- package/es/common/seg-context.js.map +1 -1
- package/es/common/segment/index.d.ts +2 -4
- package/es/common/segment/index.js.map +1 -1
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +16 -13
- package/es/common/sort.js.map +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/store.js +1 -1
- package/es/common/text.d.ts +0 -2
- package/es/common/text.js +1 -7
- package/es/common/text.js.map +1 -1
- package/es/core/application.js +1 -2
- package/es/core/camera.d.ts +1 -0
- package/es/core/camera.js +12 -4
- package/es/core/camera.js.map +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global-module.js +0 -2
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -1
- package/es/core/graphic-utils.js.map +1 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +1 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.d.ts +1 -0
- package/es/core/light.js +7 -1
- package/es/core/light.js.map +1 -1
- package/es/core/stage.d.ts +1 -1
- package/es/core/stage.js +18 -13
- package/es/core/stage.js.map +1 -1
- package/es/core/window.js +1 -1
- package/es/factory.d.ts +5 -0
- package/es/factory.js +11 -0
- package/es/factory.js.map +1 -0
- package/es/graphic/arc.d.ts +1 -2
- package/es/graphic/arc.js +0 -3
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/area.d.ts +1 -2
- package/es/graphic/area.js +0 -3
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/builtin-symbol/utils.js +1 -4
- package/es/graphic/builtin-symbol/utils.js.map +1 -1
- package/es/graphic/circle.d.ts +1 -2
- package/es/graphic/circle.js +0 -3
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/glyph.d.ts +1 -2
- package/es/graphic/glyph.js +0 -3
- package/es/graphic/glyph.js.map +1 -1
- package/es/graphic/graphic-service/graphic-service.d.ts +2 -8
- package/es/graphic/graphic-service/graphic-service.js +3 -91
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +1 -4
- package/es/graphic/graphic.js +0 -3
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +1 -2
- package/es/graphic/group.js +0 -3
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/image.d.ts +1 -2
- package/es/graphic/image.js +0 -3
- package/es/graphic/image.js.map +1 -1
- package/es/graphic/index.js.map +1 -1
- package/es/graphic/line.d.ts +1 -2
- package/es/graphic/line.js +0 -3
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/path.d.ts +1 -2
- package/es/graphic/path.js +0 -3
- package/es/graphic/path.js.map +1 -1
- package/es/graphic/polygon.d.ts +1 -2
- package/es/graphic/polygon.js +0 -3
- package/es/graphic/polygon.js.map +1 -1
- package/es/graphic/rect.d.ts +1 -2
- package/es/graphic/rect.js +0 -3
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/richtext/utils.js +9 -20
- package/es/graphic/richtext/utils.js.map +1 -1
- package/es/graphic/richtext.d.ts +1 -2
- package/es/graphic/richtext.js +0 -3
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/symbol.d.ts +0 -2
- package/es/graphic/symbol.js +0 -3
- package/es/graphic/symbol.js.map +1 -1
- package/es/graphic/text.d.ts +1 -2
- package/es/graphic/text.js +2 -5
- package/es/graphic/text.js.map +1 -1
- package/es/index.d.ts +4 -1
- package/es/index.js +8 -2
- package/es/index.js.map +1 -1
- package/es/interface/graphic.d.ts +1 -2
- package/es/interface/graphic.js.map +1 -1
- package/es/picker/pick-interceptor.d.ts +1 -1
- package/es/picker/pick-interceptor.js +4 -44
- package/es/picker/pick-interceptor.js.map +1 -1
- package/es/picker/picker-service.js +5 -1
- package/es/picker/picker-service.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.d.ts +1 -0
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +9 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/react-attribute-plugin.d.ts +1 -0
- package/es/plugins/builtin-plugin/react-attribute-plugin.js +6 -0
- package/es/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
- package/es/render/contributions/render/arc-render.js +1 -4
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/area-render.js +1 -30
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/base-3d-render.d.ts +10 -0
- package/es/render/contributions/render/base-3d-render.js +57 -0
- package/es/render/contributions/render/base-3d-render.js.map +1 -0
- package/es/render/contributions/render/base-render.js +3 -1
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/es/render/contributions/render/contributions/arc-contribution-render.js +13 -28
- package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/base-contribution-render.js +1 -1
- package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/circle-contribution-render.js +10 -20
- package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.js +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.js +10 -20
- package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/symbol-contribution-render.js +9 -19
- package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/text-contribution-render.js +1 -1
- package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.js +1 -1
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/draw-interceptor.js +7 -49
- package/es/render/contributions/render/draw-interceptor.js.map +1 -1
- package/es/render/contributions/render/group-render.js +5 -1
- package/es/render/contributions/render/group-render.js.map +1 -1
- package/es/render/contributions/render/incremental-draw-contribution.js +1 -1
- package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
- package/es/render/contributions/render/line-render.js.map +1 -1
- package/es/render/contributions/render/pyramid3d-render.d.ts +3 -5
- package/es/render/contributions/render/pyramid3d-render.js +4 -56
- package/es/render/contributions/render/pyramid3d-render.js.map +1 -1
- package/es/render/contributions/render/rect3d-render.d.ts +3 -5
- package/es/render/contributions/render/rect3d-render.js +4 -55
- package/es/render/contributions/render/rect3d-render.js.map +1 -1
- package/es/render/contributions/render/symbol-render.js +9 -18
- package/es/render/contributions/render/symbol-render.js.map +1 -1
- package/es/render/contributions/render/text-render.d.ts +3 -2
- package/es/render/contributions/render/text-render.js +11 -30
- package/es/render/contributions/render/text-render.js.map +1 -1
- package/es/render/contributions/render/utils.js +2 -5
- package/es/render/contributions/render/utils.js.map +1 -1
- package/package.json +4 -4
- package/cjs/allocator/allocator-modules.d.ts +0 -1
- package/cjs/allocator/allocator-modules.js +0 -1
- package/cjs/allocator/allocator-modules.js.map +0 -1
- package/cjs/allocator/point-allocate.d.ts +0 -1
- package/cjs/allocator/point-allocate.js +0 -1
- package/cjs/allocator/point-allocate.js.map +0 -1
- package/cjs/graphic/graphic-service/arc-contribution.d.ts +0 -1
- package/cjs/graphic/graphic-service/arc-contribution.js +0 -3
- package/cjs/graphic/graphic-service/arc-contribution.js.map +0 -1
- package/cjs/graphic/graphic-service/area-contribution.d.ts +0 -1
- package/cjs/graphic/graphic-service/area-contribution.js +0 -3
- package/cjs/graphic/graphic-service/area-contribution.js.map +0 -1
- package/cjs/graphic/graphic-service/circle-contribution.d.ts +0 -1
- package/cjs/graphic/graphic-service/circle-contribution.js +0 -3
- package/cjs/graphic/graphic-service/circle-contribution.js.map +0 -1
- package/cjs/graphic/graphic-service/default-theme.d.ts +0 -1
- package/cjs/graphic/graphic-service/default-theme.js +0 -3
- package/cjs/graphic/graphic-service/default-theme.js.map +0 -1
- package/cjs/graphic/graphic-service/path-contribution.d.ts +0 -1
- package/cjs/graphic/graphic-service/path-contribution.js +0 -3
- package/cjs/graphic/graphic-service/path-contribution.js.map +0 -1
- package/cjs/graphic/graphic-service/rect-contribution.d.ts +0 -1
- package/cjs/graphic/graphic-service/rect-contribution.js +0 -3
- package/cjs/graphic/graphic-service/rect-contribution.js.map +0 -1
- package/cjs/interface/util.d.ts +0 -1
- package/cjs/interface/util.js +0 -3
- package/cjs/interface/util.js.map +0 -1
- package/es/allocator/allocator-modules.d.ts +0 -1
- package/es/allocator/allocator-modules.js +0 -1
- package/es/allocator/allocator-modules.js.map +0 -1
- package/es/allocator/point-allocate.d.ts +0 -1
- package/es/allocator/point-allocate.js +0 -1
- package/es/allocator/point-allocate.js.map +0 -1
- package/es/graphic/graphic-service/arc-contribution.d.ts +0 -1
- package/es/graphic/graphic-service/arc-contribution.js +0 -3
- package/es/graphic/graphic-service/arc-contribution.js.map +0 -1
- package/es/graphic/graphic-service/area-contribution.d.ts +0 -1
- package/es/graphic/graphic-service/area-contribution.js +0 -3
- package/es/graphic/graphic-service/area-contribution.js.map +0 -1
- package/es/graphic/graphic-service/circle-contribution.d.ts +0 -1
- package/es/graphic/graphic-service/circle-contribution.js +0 -3
- package/es/graphic/graphic-service/circle-contribution.js.map +0 -1
- package/es/graphic/graphic-service/default-theme.d.ts +0 -1
- package/es/graphic/graphic-service/default-theme.js +0 -3
- package/es/graphic/graphic-service/default-theme.js.map +0 -1
- package/es/graphic/graphic-service/path-contribution.d.ts +0 -1
- package/es/graphic/graphic-service/path-contribution.js +0 -3
- package/es/graphic/graphic-service/path-contribution.js.map +0 -1
- package/es/graphic/graphic-service/rect-contribution.d.ts +0 -1
- package/es/graphic/graphic-service/rect-contribution.js +0 -3
- package/es/graphic/graphic-service/rect-contribution.js.map +0 -1
- package/es/interface/util.d.ts +0 -1
- package/es/interface/util.js +0 -3
- package/es/interface/util.js.map +0 -1
|
@@ -17,10 +17,7 @@ export class CustomSymbolClass {
|
|
|
17
17
|
!1);
|
|
18
18
|
}
|
|
19
19
|
draw(ctx, size, x, y, z, cb) {
|
|
20
|
-
return this.
|
|
21
|
-
ctx.beginPath(), renderCommandList(item.path.commandList, ctx, x, y, size, size),
|
|
22
|
-
cb && cb(item.path, item.attribute);
|
|
23
|
-
})), !1) : (renderCommandList(this.path.commandList, ctx, x, y, size, size), !1);
|
|
20
|
+
return this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
24
21
|
}
|
|
25
22
|
bounds(size, bounds) {
|
|
26
23
|
if (this.isSvg) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/builtin-symbol/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAGrE,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;AACpC,MAAM,OAAO,iBAAiB;IAO5B,YACE,IAAY,EACZ,IAAsF,EACtF,QAAiB,KAAK;QAPxB,YAAO,GAA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IACzC,CAAC;CACF","file":"utils.js","sourcesContent":["import { isArray, type IBounds, AABBBounds } from '@visactor/vutils';\nimport { renderCommandList } from '../../common/render-command-list';\nimport type { IContext2d, ICustomPath2D, IGraphicAttribute, ISymbolClass } from '../../interface';\n\nconst tempBounds = new AABBBounds();\nexport class CustomSymbolClass implements ISymbolClass {\n type: string;\n path: ICustomPath2D;\n pathStr: string = '';\n isSvg: boolean;\n svgCache?: { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[];\n\n constructor(\n type: string,\n path: ICustomPath2D | { path: ICustomPath2D; attribute: Partial<IGraphicAttribute> }[],\n isSvg: boolean = false\n ) {\n this.type = type;\n if (isArray(path)) {\n this.svgCache = path;\n } else {\n this.path = path;\n }\n this.isSvg = isSvg;\n }\n\n drawOffset(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n offset: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n if (this.isSvg) {\n if (!this.svgCache) {\n return false;\n }\n this.svgCache.forEach(item => {\n ctx.beginPath();\n renderCommandList(item.path.commandList, ctx, x, y, size, size);\n cb && cb(item.path, item.attribute);\n });\n return false;\n }\n renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n draw(\n ctx: IContext2d,\n size: number,\n x: number,\n y: number,\n z?: number,\n cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void\n ) {\n return this.drawOffset(ctx, size, x, y, 0, z, cb);\n }\n\n bounds(size: number, bounds: IBounds) {\n if (this.isSvg) {\n if (!this.svgCache) {\n return;\n }\n bounds.clear();\n this.svgCache.forEach(({ path }) => {\n tempBounds.x1 = path.bounds.x1 * size;\n tempBounds.y1 = path.bounds.y1 * size;\n tempBounds.x2 = path.bounds.x2 * size;\n tempBounds.y2 = path.bounds.y2 * size;\n bounds.union(tempBounds);\n });\n return;\n }\n if (!this.path.bounds) {\n return;\n }\n bounds.x1 = this.path.bounds.x1 * size;\n bounds.y1 = this.path.bounds.y1 * size;\n bounds.x2 = this.path.bounds.x2 * size;\n bounds.y2 = this.path.bounds.y2 * size;\n }\n}\n\n// export function CustomSymbol(): ISymbolClass {\n\n// }\n"]}
|
package/es/graphic/circle.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AABBBounds
|
|
1
|
+
import type { AABBBounds } from '@visactor/vutils';
|
|
2
2
|
import type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle';
|
|
3
3
|
import { Graphic } from './graphic';
|
|
4
4
|
import { CustomPath2D } from '../common/custom-path2d';
|
|
@@ -38,7 +38,6 @@ export declare class Circle extends Graphic<ICircleGraphicAttribute> implements
|
|
|
38
38
|
isValid(): boolean;
|
|
39
39
|
private _isValid;
|
|
40
40
|
protected doUpdateAABBBounds(full?: boolean): AABBBounds;
|
|
41
|
-
protected tryUpdateOBBBounds(): OBBBounds;
|
|
42
41
|
getDefaultAttribute(name: string): any;
|
|
43
42
|
protected needUpdateTags(keys: string[]): boolean;
|
|
44
43
|
protected needUpdateTag(key: string): boolean;
|
package/es/graphic/circle.js
CHANGED
|
@@ -32,9 +32,6 @@ export class Circle extends Graphic {
|
|
|
32
32
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(),
|
|
33
33
|
bounds;
|
|
34
34
|
}
|
|
35
|
-
tryUpdateOBBBounds() {
|
|
36
|
-
throw new Error("暂不支持");
|
|
37
|
-
}
|
|
38
35
|
getDefaultAttribute(name) {
|
|
39
36
|
return getTheme(this).circle[name];
|
|
40
37
|
}
|
package/es/graphic/circle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,y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C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO,IAAI,MAAM,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AAvEM,0BAAmB,GAAG,mBAAmB,CAAC;AA0EnD,MAAM,UAAU,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC","file":"circle.js","sourcesContent":["import type { AABBBounds } from '@visactor/vutils';\nimport type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { parsePadding } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { CIRCLE_NUMBER_TYPE } from './constants';\n\nconst CIRCLE_UPDATE_TAG_KEY = ['radius', 'startAngle', 'endAngle', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Circle extends Graphic<ICircleGraphicAttribute> implements ICircle {\n type: 'circle' = 'circle';\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: ICircleGraphicAttribute = { radius: 1 }) {\n super(params);\n this.numberType = CIRCLE_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, radius } = this.attribute;\n return this._validNumber(startAngle) && this._validNumber(endAngle) && this._validNumber(radius);\n }\n\n protected doUpdateAABBBounds(full?: boolean): AABBBounds {\n const circleTheme = getTheme(this).circle;\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = application.graphicService.updateCircleAABBBounds(\n attribute,\n getTheme(this).circle,\n this._AABBBounds,\n full,\n this\n );\n\n const { boundsPadding = circleTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n (bounds as AABBBounds).expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds as AABBBounds;\n }\n\n getDefaultAttribute(name: string) {\n const circleTheme = getTheme(this).circle;\n return circleTheme[name];\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, CIRCLE_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, CIRCLE_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const radius = attribute.radius ?? this.getDefaultAttribute('radius');\n const startAngle = attribute.startAngle ?? this.getDefaultAttribute('startAngle');\n const endAngle = attribute.endAngle ?? this.getDefaultAttribute('endAngle');\n\n const path = new CustomPath2D();\n\n path.arc(x, y, radius, startAngle, endAngle);\n\n return path;\n }\n\n clone() {\n return new Circle({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Circle.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createCircle(attributes: ICircleGraphicAttribute): ICircle {\n return new Circle(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
|
package/es/graphic/glyph.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AABBBounds, IPointLike
|
|
1
|
+
import type { AABBBounds, IPointLike } from '@visactor/vutils';
|
|
2
2
|
import { Graphic } from './graphic';
|
|
3
3
|
import type { GraphicType, IGraphic, IGlyph, IGlyphGraphicAttribute, IGraphicAttribute, ISetAttributeContext } from '../interface';
|
|
4
4
|
export declare class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {
|
|
@@ -60,7 +60,6 @@ export declare class Glyph extends Graphic<IGlyphGraphicAttribute> implements IG
|
|
|
60
60
|
rotate(angle: number): this;
|
|
61
61
|
rotateTo(angle: number): this;
|
|
62
62
|
protected doUpdateAABBBounds(): AABBBounds;
|
|
63
|
-
protected tryUpdateOBBBounds(): OBBBounds;
|
|
64
63
|
protected needUpdateTags(keys: string[]): boolean;
|
|
65
64
|
protected needUpdateTag(key: string): boolean;
|
|
66
65
|
useStates(states: string[], hasAnimation?: boolean): void;
|
package/es/graphic/glyph.js
CHANGED
|
@@ -78,9 +78,6 @@ export class Glyph extends Graphic {
|
|
|
78
78
|
const bounds = application.graphicService.updateGlyphAABBBounds(this.attribute, getTheme(this).glyph, this._AABBBounds, this);
|
|
79
79
|
return this.clearUpdateBoundTag(), bounds;
|
|
80
80
|
}
|
|
81
|
-
tryUpdateOBBBounds() {
|
|
82
|
-
throw new Error("暂不支持");
|
|
83
|
-
}
|
|
84
81
|
needUpdateTags(keys) {
|
|
85
82
|
return !1;
|
|
86
83
|
}
|
package/es/graphic/glyph.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/glyph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AASzD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,OAAO,KAAM,SAAQ,OAA+B;IAsBxD,YAAY,MAAuC;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QAtBhB,SAAI,GAAgB,OAAO,CAAC;QAuB1B,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;IAED,aAAa,CAAC,UAAsB;QAClC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C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,oBAAoB;QAClB,OAAO,KAAK,CAAC,mBAAmB,CAAC;IACnC,CAAC;;AAnNM,yBAAmB,GAAG,mBAAmB,CAAC;AAsNnD,MAAM,UAAU,WAAW,CAAC,UAAkC;IAC5D,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC","file":"glyph.js","sourcesContent":["import type { AABBBounds, IPointLike, OBBBounds } from '@visactor/vutils';\nimport { Graphic, NOWORK_ANIMATE_ATTR } from './graphic';\nimport type {\n GraphicType,\n IGraphic,\n IGlyph,\n IGlyphGraphicAttribute,\n IGraphicAttribute,\n ISetAttributeContext\n} from '../interface';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { GLYPH_NUMBER_TYPE } from './constants';\n\nexport class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {\n type: GraphicType = 'glyph';\n declare _onInit: (g: IGlyph) => void;\n declare _onUpdate: (g: IGlyph) => void;\n declare glyphStates?: Record<\n string,\n {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n }\n >;\n declare glyphStateProxy?: (\n stateName: string,\n targetStates?: string[]\n ) => {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n };\n protected declare subGraphic: IGraphic[];\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: Partial<IGlyphGraphicAttribute>) {\n super(params);\n this.numberType = GLYPH_NUMBER_TYPE;\n this.subGraphic = [];\n this._onInit && this._onInit(this);\n this.valid = this.isValid();\n }\n\n setSubGraphic(subGraphic: IGraphic[]) {\n this.detachSubGraphic();\n this.subGraphic = subGraphic;\n subGraphic.forEach(g => {\n g.glyphHost = this;\n Object.setPrototypeOf(g.attribute, this.attribute);\n });\n this.valid = this.isValid();\n this.addUpdateBoundTag();\n }\n\n protected detachSubGraphic() {\n this.subGraphic.forEach(g => {\n g.glyphHost = null;\n Object.setPrototypeOf(g.attribute, {});\n });\n }\n\n getSubGraphic() {\n return this.subGraphic;\n }\n\n onInit(cb: (g: this) => void): void {\n this._onInit = cb;\n }\n\n onUpdate(cb: (g: this) => void): void {\n this._onUpdate = cb;\n }\n\n isValid(): boolean {\n return true;\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n super.setAttribute(key, value, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n setAttributes(\n params: Partial<IGlyphGraphicAttribute>,\n forceUpdateTag: boolean = false,\n context?: ISetAttributeContext\n ) {\n super.setAttributes(params, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n translate(x: number, y: number) {\n super.translate(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n translateTo(x: number, y: number) {\n super.translateTo(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n super.scale(scaleX, scaleY, scaleCenter);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n super.scaleTo(scaleX, scaleY);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotate(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotateTo(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n protected doUpdateAABBBounds(): AABBBounds {\n this._AABBBounds.clear();\n const bounds = application.graphicService.updateGlyphAABBBounds(\n this.attribute,\n getTheme(this).glyph,\n this._AABBBounds,\n this\n ) as AABBBounds;\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): OBBBounds {\n throw new Error('暂不支持');\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return false;\n }\n protected needUpdateTag(key: string): boolean {\n return false;\n }\n\n useStates(states: string[], hasAnimation?: boolean): void {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const isChange =\n this.currentStates?.length !== states.length ||\n states.some((stateName, index) => this.currentStates[index] !== stateName);\n if (!isChange) {\n return;\n }\n\n this.stopStateAnimates();\n\n const stateAttrs = {};\n const subAttrs = this.subGraphic.map(() => ({}));\n states.forEach(stateName => {\n const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];\n\n if (attrs) {\n Object.assign(stateAttrs, attrs.attributes);\n\n if (attrs.subAttributes?.length) {\n subAttrs.forEach((subAttrs, index) => {\n Object.assign(subAttrs, attrs.subAttributes[index]);\n });\n }\n }\n });\n\n this.subGraphic.forEach((graphic, index) => {\n graphic.updateNormalAttrs(subAttrs[index]);\n graphic.applyStateAttrs(subAttrs[index], states, hasAnimation);\n });\n\n this.updateNormalAttrs(stateAttrs);\n this.currentStates = states;\n this.applyStateAttrs(stateAttrs, states, hasAnimation);\n }\n\n clearStates(hasAnimation?: boolean) {\n this.stopStateAnimates();\n if (this.hasState() && this.normalAttrs) {\n this.currentStates = [];\n this.subGraphic.forEach(graphic => {\n graphic.applyStateAttrs(graphic.normalAttrs, this.currentStates, hasAnimation, true);\n graphic.normalAttrs = null;\n });\n this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);\n } else {\n this.currentStates = [];\n }\n this.normalAttrs = null;\n }\n\n clone(): Graphic<Partial<IGlyphGraphicAttribute>> {\n const glyph = new Glyph({ ...this.attribute });\n glyph.setSubGraphic(this.subGraphic.map(g => g.clone()));\n return glyph;\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Glyph.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createGlyph(attributes: IGlyphGraphicAttribute): IGlyph {\n return new Glyph(attributes);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/glyph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AASzD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,OAAO,KAAM,SAAQ,OAA+B;IAsBxD,YAAY,MAAuC;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QAtBhB,SAAI,GAAgB,OAAO,CAAC;QAuB1B,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;IAED,aAAa,CAAC,UAAsB;QAClC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACrB,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;YACnB,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,GAAG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ANIMATE_ATTR } from './graphic';\nimport type {\n GraphicType,\n IGraphic,\n IGlyph,\n IGlyphGraphicAttribute,\n IGraphicAttribute,\n ISetAttributeContext\n} from '../interface';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { GLYPH_NUMBER_TYPE } from './constants';\n\nexport class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {\n type: GraphicType = 'glyph';\n declare _onInit: (g: IGlyph) => void;\n declare _onUpdate: (g: IGlyph) => void;\n declare glyphStates?: Record<\n string,\n {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n }\n >;\n declare glyphStateProxy?: (\n stateName: string,\n targetStates?: string[]\n ) => {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n };\n protected declare subGraphic: IGraphic[];\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: Partial<IGlyphGraphicAttribute>) {\n super(params);\n this.numberType = GLYPH_NUMBER_TYPE;\n this.subGraphic = [];\n this._onInit && this._onInit(this);\n this.valid = this.isValid();\n }\n\n setSubGraphic(subGraphic: IGraphic[]) {\n this.detachSubGraphic();\n this.subGraphic = subGraphic;\n subGraphic.forEach(g => {\n g.glyphHost = this;\n Object.setPrototypeOf(g.attribute, this.attribute);\n });\n this.valid = this.isValid();\n this.addUpdateBoundTag();\n }\n\n protected detachSubGraphic() {\n this.subGraphic.forEach(g => {\n g.glyphHost = null;\n Object.setPrototypeOf(g.attribute, {});\n });\n }\n\n getSubGraphic() {\n return this.subGraphic;\n }\n\n onInit(cb: (g: this) => void): void {\n this._onInit = cb;\n }\n\n onUpdate(cb: (g: this) => void): void {\n this._onUpdate = cb;\n }\n\n isValid(): boolean {\n return true;\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n super.setAttribute(key, value, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n setAttributes(\n params: Partial<IGlyphGraphicAttribute>,\n forceUpdateTag: boolean = false,\n context?: ISetAttributeContext\n ) {\n super.setAttributes(params, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n translate(x: number, y: number) {\n super.translate(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n translateTo(x: number, y: number) {\n super.translateTo(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n super.scale(scaleX, scaleY, scaleCenter);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n super.scaleTo(scaleX, scaleY);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotate(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotateTo(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n protected doUpdateAABBBounds(): AABBBounds {\n this._AABBBounds.clear();\n const bounds = application.graphicService.updateGlyphAABBBounds(\n this.attribute,\n getTheme(this).glyph,\n this._AABBBounds,\n this\n ) as AABBBounds;\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return false;\n }\n protected needUpdateTag(key: string): boolean {\n return false;\n }\n\n useStates(states: string[], hasAnimation?: boolean): void {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const isChange =\n this.currentStates?.length !== states.length ||\n states.some((stateName, index) => this.currentStates[index] !== stateName);\n if (!isChange) {\n return;\n }\n\n this.stopStateAnimates();\n\n const stateAttrs = {};\n const subAttrs = this.subGraphic.map(() => ({}));\n states.forEach(stateName => {\n const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];\n\n if (attrs) {\n Object.assign(stateAttrs, attrs.attributes);\n\n if (attrs.subAttributes?.length) {\n subAttrs.forEach((subAttrs, index) => {\n Object.assign(subAttrs, attrs.subAttributes[index]);\n });\n }\n }\n });\n\n this.subGraphic.forEach((graphic, index) => {\n graphic.updateNormalAttrs(subAttrs[index]);\n graphic.applyStateAttrs(subAttrs[index], states, hasAnimation);\n });\n\n this.updateNormalAttrs(stateAttrs);\n this.currentStates = states;\n this.applyStateAttrs(stateAttrs, states, hasAnimation);\n }\n\n clearStates(hasAnimation?: boolean) {\n this.stopStateAnimates();\n if (this.hasState() && this.normalAttrs) {\n this.currentStates = [];\n this.subGraphic.forEach(graphic => {\n graphic.applyStateAttrs(graphic.normalAttrs, this.currentStates, hasAnimation, true);\n graphic.normalAttrs = null;\n });\n this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);\n } else {\n this.currentStates = [];\n }\n this.normalAttrs = null;\n }\n\n clone(): Graphic<Partial<IGlyphGraphicAttribute>> {\n const glyph = new Glyph({ ...this.attribute });\n glyph.setSubGraphic(this.subGraphic.map(g => g.clone()));\n return glyph;\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Glyph.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createGlyph(attributes: IGlyphGraphicAttribute): IGlyph {\n return new Glyph(attributes);\n}\n"]}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type { IAABBBounds, IBounds
|
|
1
|
+
import type { IAABBBounds, IBounds } from '@visactor/vutils';
|
|
2
2
|
import { AABBBounds } from '@visactor/vutils';
|
|
3
|
-
import type { mat4,
|
|
4
|
-
export declare function rotateX(out: mat4, a: mat4, rad: number): mat4;
|
|
5
|
-
export declare function rotateY(out: mat4, a: mat4, rad: number): mat4;
|
|
6
|
-
export declare function translate(out: mat4, a: mat4, v: vec3): mat4;
|
|
7
|
-
export declare function mat3Tomat4(out: mat4, b: IMatrix): void;
|
|
8
|
-
export declare function multiplyMat4Mat3(out: mat4, a: mat4, b: IMatrix): mat4;
|
|
9
|
-
export declare function multiplyMat4Mat4(out: mat4, a: mat4, b: mat4): mat4;
|
|
3
|
+
import type { mat4, IArc, IArcGraphicAttribute, IArea, IAreaGraphicAttribute, IGraphicAttribute, ICircle, ICircleGraphicAttribute, IGraphic, IGroup, IGroupGraphicAttribute, ILine, ILineGraphicAttribute, IPath, IPathGraphicAttribute, IPolygon, IPolygonGraphicAttribute, IRectGraphicAttribute, IStage, ISymbol, ISymbolGraphicAttribute, IText, ITextGraphicAttribute, IGlyph, IGlyphGraphicAttribute, IRichTextGraphicAttribute, IRichText, IPyramid3dGraphicAttribute, IPyramid3d, IArc3dGraphicAttribute, IArc3d, IImageGraphicAttribute, ITransform, IGraphicService, IGraphicCreator, ISyncHook, IRectBoundsContribution, ISymbolBoundsContribution, ICircleBoundsContribution, IArcBoundsContribution, IPathBoundsContribution, IImageBoundsContribution } from '../../interface';
|
|
10
4
|
export declare function getExtraModelMatrix(dx: number, dy: number, graphic: IGraphic): mat4 | null;
|
|
11
5
|
export declare function getModelMatrix(out: mat4, graphic: IGraphic, theme: ITransform): void;
|
|
12
6
|
export declare function shouldUseMat4(graphic: IGraphic): number;
|
|
@@ -34,95 +34,7 @@ import { GraphicCreator } from "../constants";
|
|
|
34
34
|
|
|
35
35
|
import { DefaultOuterBorderBoundsContribution } from "./common-contribution";
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
return out[0] = 1, out[1] = 0, out[2] = 0, out[3] = 0, out[4] = 0, out[5] = 1, out[6] = 0,
|
|
39
|
-
out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = 0, out[13] = 0,
|
|
40
|
-
out[14] = 0, out[15] = 1, out;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function rotateX(out, a, rad) {
|
|
44
|
-
const s = Math.sin(rad), c = Math.cos(rad), a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
|
|
45
|
-
return a !== out && (out[0] = a[0], out[1] = a[1], out[2] = a[2], out[3] = a[3],
|
|
46
|
-
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[4] = a10 * c + a20 * s,
|
|
47
|
-
out[5] = a11 * c + a21 * s, out[6] = a12 * c + a22 * s, out[7] = a13 * c + a23 * s,
|
|
48
|
-
out[8] = a20 * c - a10 * s, out[9] = a21 * c - a11 * s, out[10] = a22 * c - a12 * s,
|
|
49
|
-
out[11] = a23 * c - a13 * s, out;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function rotateY(out, a, rad) {
|
|
53
|
-
const s = Math.sin(rad), c = Math.cos(rad), a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
|
|
54
|
-
return a !== out && (out[4] = a[4], out[5] = a[5], out[6] = a[6], out[7] = a[7],
|
|
55
|
-
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[0] = a00 * c - a20 * s,
|
|
56
|
-
out[1] = a01 * c - a21 * s, out[2] = a02 * c - a22 * s, out[3] = a03 * c - a23 * s,
|
|
57
|
-
out[8] = a00 * s + a20 * c, out[9] = a01 * s + a21 * c, out[10] = a02 * s + a22 * c,
|
|
58
|
-
out[11] = a03 * s + a23 * c, out;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function rotateZ(out, a, rad) {
|
|
62
|
-
const s = Math.sin(rad), c = Math.cos(rad), a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];
|
|
63
|
-
return a !== out && (out[8] = a[8], out[9] = a[9], out[10] = a[10], out[11] = a[11],
|
|
64
|
-
out[12] = a[12], out[13] = a[13], out[14] = a[14], out[15] = a[15]), out[0] = a00 * c + a10 * s,
|
|
65
|
-
out[1] = a01 * c + a11 * s, out[2] = a02 * c + a12 * s, out[3] = a03 * c + a13 * s,
|
|
66
|
-
out[4] = a10 * c - a00 * s, out[5] = a11 * c - a01 * s, out[6] = a12 * c - a02 * s,
|
|
67
|
-
out[7] = a13 * c - a03 * s, out;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function translate(out, a, v) {
|
|
71
|
-
const x = v[0], y = v[1], z = v[2];
|
|
72
|
-
let a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23;
|
|
73
|
-
return a === out ? (out[12] = a[0] * x + a[4] * y + a[8] * z + a[12], out[13] = a[1] * x + a[5] * y + a[9] * z + a[13],
|
|
74
|
-
out[14] = a[2] * x + a[6] * y + a[10] * z + a[14], out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]) : (a00 = a[0],
|
|
75
|
-
a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],
|
|
76
|
-
a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], out[0] = a00, out[1] = a01, out[2] = a02,
|
|
77
|
-
out[3] = a03, out[4] = a10, out[5] = a11, out[6] = a12, out[7] = a13, out[8] = a20,
|
|
78
|
-
out[9] = a21, out[10] = a22, out[11] = a23, out[12] = a00 * x + a10 * y + a20 * z + a[12],
|
|
79
|
-
out[13] = a01 * x + a11 * y + a21 * z + a[13], out[14] = a02 * x + a12 * y + a22 * z + a[14],
|
|
80
|
-
out[15] = a03 * x + a13 * y + a23 * z + a[15]), out;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function mat3Tomat4(out, b) {
|
|
84
|
-
out[0] = b.a, out[1] = b.b, out[2] = 0, out[3] = 0, out[4] = b.c, out[5] = b.d,
|
|
85
|
-
out[6] = 0, out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = b.e,
|
|
86
|
-
out[13] = b.f, out[14] = 0, out[15] = 1;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export function multiplyMat4Mat3(out, a, b) {
|
|
90
|
-
const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
|
|
91
|
-
let b0 = b.a, b1 = b.b, b2 = 0, b3 = 0;
|
|
92
|
-
return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
93
|
-
out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
94
|
-
b0 = b.c, b1 = b.d, b2 = 0, b3 = 0, out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
95
|
-
out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
96
|
-
out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = 0, b1 = 0, b2 = 1, b3 = 0,
|
|
97
|
-
out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
98
|
-
out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
99
|
-
b0 = b.e, b1 = b.f, b2 = 0, b3 = 1, out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
100
|
-
out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
101
|
-
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function scale(out, a, v) {
|
|
105
|
-
const x = v[0], y = v[1], z = v[2];
|
|
106
|
-
return out[0] = a[0] * x, out[1] = a[1] * x, out[2] = a[2] * x, out[3] = a[3] * x,
|
|
107
|
-
out[4] = a[4] * y, out[5] = a[5] * y, out[6] = a[6] * y, out[7] = a[7] * y, out[8] = a[8] * z,
|
|
108
|
-
out[9] = a[9] * z, out[10] = a[10] * z, out[11] = a[11] * z, out[12] = a[12], out[13] = a[13],
|
|
109
|
-
out[14] = a[14], out[15] = a[15], out;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function multiplyMat4Mat4(out, a, b) {
|
|
113
|
-
const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7], a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
|
|
114
|
-
let b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
|
|
115
|
-
return out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
116
|
-
out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
117
|
-
b0 = b[4], b1 = b[5], b2 = b[6], b3 = b[7], out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
118
|
-
out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
119
|
-
out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, b0 = b[8], b1 = b[9], b2 = b[10],
|
|
120
|
-
b3 = b[11], out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30, out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31,
|
|
121
|
-
out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32, out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33,
|
|
122
|
-
b0 = b[12], b1 = b[13], b2 = b[14], b3 = b[15], out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30,
|
|
123
|
-
out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31, out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32,
|
|
124
|
-
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33, out;
|
|
125
|
-
}
|
|
37
|
+
import { identityMat4, multiplyMat4Mat4, rotateX, rotateY, rotateZ, scaleMat4, translate } from "../../common/matrix";
|
|
126
38
|
|
|
127
39
|
export function getExtraModelMatrix(dx, dy, graphic) {
|
|
128
40
|
const {alpha: alpha, beta: beta} = graphic.attribute;
|
|
@@ -163,9 +75,9 @@ export function getModelMatrix(out, graphic, theme) {
|
|
|
163
75
|
} else _anchor[1] = anchor3d[1];
|
|
164
76
|
_anchor[2] = null !== (_a = anchor3d[2]) && void 0 !== _a ? _a : 0;
|
|
165
77
|
}
|
|
166
|
-
if (
|
|
78
|
+
if (identityMat4(out), translate(out, out, [ x + dx, y + dy, z + dz ]), translate(out, out, [ _anchor[0], _anchor[1], _anchor[2] ]),
|
|
167
79
|
rotateX(out, out, beta), rotateY(out, out, alpha), translate(out, out, [ -_anchor[0], -_anchor[1], _anchor[2] ]),
|
|
168
|
-
|
|
80
|
+
scaleMat4(out, out, [ scaleX, scaleY, scaleZ ]), angle) {
|
|
169
81
|
const m = mat4Allocate.allocate(), _anchor = [ 0, 0 ];
|
|
170
82
|
if (anchor) {
|
|
171
83
|
if ("string" == typeof anchor3d[0]) {
|