@visactor/vrender-core 0.20.0-alpha.1 → 0.20.0-alpha.3
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 +2 -53
- package/cjs/animate/Ticker/default-ticker.js +17 -130
- package/cjs/animate/Ticker/default-ticker.js.map +1 -1
- package/cjs/animate/Ticker/index.d.ts +4 -0
- package/cjs/animate/Ticker/index.js +3 -1
- package/cjs/animate/Ticker/index.js.map +1 -1
- 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/animate/Ticker/type.js +11 -0
- package/cjs/animate/Ticker/type.js.map +1 -0
- package/cjs/canvas/conical-gradient.js.map +1 -1
- package/cjs/canvas/contributions/base-canvas.js +4 -13
- package/cjs/canvas/contributions/base-canvas.js.map +1 -1
- package/cjs/common/3d-interceptor.js +1 -2
- package/cjs/common/bounds-context.js +2 -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 -2
- package/cjs/common/render-curve.js +1 -1
- package/cjs/common/render-utils.js +1 -1
- package/cjs/common/seg-context.js +1 -1
- package/cjs/common/segment/catmull-rom-close.d.ts +41 -0
- package/cjs/common/segment/catmull-rom-close.js +81 -0
- package/cjs/common/segment/catmull-rom-close.js.map +1 -0
- package/cjs/common/segment/catmull-rom.d.ts +38 -0
- package/cjs/common/segment/catmull-rom.js +97 -0
- package/cjs/common/segment/catmull-rom.js.map +1 -0
- package/cjs/common/segment/index.d.ts +5 -2
- package/cjs/common/segment/index.js +8 -1
- package/cjs/common/segment/index.js.map +1 -1
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/store.js +1 -1
- package/cjs/common/text.js +4 -3
- package/cjs/common/text.js.map +1 -1
- package/cjs/core/application.js +2 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/contributions/layerHandler/modules.js +2 -5
- package/cjs/core/contributions/layerHandler/modules.js.map +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global-module.js +2 -0
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +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.js +1 -1
- package/cjs/core/stage.d.ts +2 -2
- package/cjs/core/stage.js +10 -4
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/event/federated-event/base-event.js +12 -2
- package/cjs/event/federated-event/base-event.js.map +1 -1
- package/cjs/graphic/arc.d.ts +6 -4
- package/cjs/graphic/arc.js +46 -17
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/arc3d.d.ts +2 -2
- package/cjs/graphic/arc3d.js +8 -9
- package/cjs/graphic/arc3d.js.map +1 -1
- package/cjs/graphic/area.d.ts +5 -3
- package/cjs/graphic/area.js +27 -12
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/builtin-symbol/index.d.ts +1 -1
- package/cjs/graphic/builtin-symbol/thin-triangle.d.ts +2 -2
- package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -2
- package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-down.d.ts +1 -2
- package/cjs/graphic/builtin-symbol/triangle-down.js +4 -9
- package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-left.d.ts +0 -1
- package/cjs/graphic/builtin-symbol/triangle-left.js +3 -8
- package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-right.d.ts +1 -2
- package/cjs/graphic/builtin-symbol/triangle-right.js +4 -9
- package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-up.d.ts +1 -2
- package/cjs/graphic/builtin-symbol/triangle-up.js +4 -9
- package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle.d.ts +1 -2
- package/cjs/graphic/builtin-symbol/triangle.js +1 -3
- package/cjs/graphic/builtin-symbol/triangle.js.map +1 -1
- package/cjs/graphic/circle.d.ts +5 -3
- package/cjs/graphic/circle.js +20 -12
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.js +6 -3
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/glyph.d.ts +4 -2
- package/cjs/graphic/glyph.js +9 -2
- package/cjs/graphic/glyph.js.map +1 -1
- package/cjs/graphic/graphic-creator.js.map +1 -1
- package/cjs/graphic/graphic-service/common-outer-boder-bounds.d.ts +3 -0
- package/cjs/graphic/graphic-service/common-outer-boder-bounds.js +17 -0
- package/cjs/graphic/graphic-service/common-outer-boder-bounds.js.map +1 -0
- package/cjs/graphic/graphic-service/graphic-service.d.ts +7 -36
- package/cjs/graphic/graphic-service/graphic-service.js +11 -296
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic-service/symbol-outer-border-bounds.d.ts +3 -0
- package/cjs/graphic/graphic-service/symbol-outer-border-bounds.js +17 -0
- package/cjs/graphic/graphic-service/symbol-outer-border-bounds.js.map +1 -0
- package/cjs/graphic/graphic.d.ts +12 -9
- package/cjs/graphic/graphic.js +17 -2
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +7 -3
- package/cjs/graphic/group.js +34 -22
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/image.d.ts +3 -2
- package/cjs/graphic/image.js +14 -9
- package/cjs/graphic/image.js.map +1 -1
- package/cjs/graphic/line.d.ts +5 -3
- package/cjs/graphic/line.js +24 -11
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/node-tree.js.map +1 -1
- package/cjs/graphic/path.d.ts +3 -3
- package/cjs/graphic/path.js +17 -13
- package/cjs/graphic/path.js.map +1 -1
- package/cjs/graphic/polygon.d.ts +4 -3
- package/cjs/graphic/polygon.js +16 -11
- package/cjs/graphic/polygon.js.map +1 -1
- package/cjs/graphic/pyramid3d.d.ts +2 -2
- package/cjs/graphic/pyramid3d.js +10 -9
- package/cjs/graphic/pyramid3d.js.map +1 -1
- package/cjs/graphic/rect.d.ts +3 -3
- package/cjs/graphic/rect.js +16 -12
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/rect3d.js +2 -2
- package/cjs/graphic/rect3d.js.map +1 -1
- package/cjs/graphic/richtext/icon.d.ts +2 -2
- package/cjs/graphic/richtext/icon.js.map +1 -1
- package/cjs/graphic/richtext.d.ts +3 -3
- package/cjs/graphic/richtext.js +44 -12
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/shadow-root.d.ts +2 -2
- package/cjs/graphic/shadow-root.js.map +1 -1
- package/cjs/graphic/symbol.d.ts +5 -3
- package/cjs/graphic/symbol.js +25 -12
- package/cjs/graphic/symbol.js.map +1 -1
- package/cjs/graphic/text.d.ts +10 -10
- package/cjs/graphic/text.js +26 -20
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/theme.js.map +1 -1
- package/cjs/graphic/wrap-text.d.ts +1 -1
- package/cjs/graphic/wrap-text.js +2 -2
- package/cjs/graphic/wrap-text.js.map +1 -1
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +3 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interface/graphic/arc.d.ts +2 -2
- package/cjs/interface/graphic/arc.js.map +1 -1
- package/cjs/interface/graphic/arc3d.d.ts +1 -1
- package/cjs/interface/graphic/arc3d.js.map +1 -1
- package/cjs/interface/graphic/area.d.ts +1 -0
- package/cjs/interface/graphic/area.js.map +1 -1
- package/cjs/interface/graphic/line.d.ts +1 -0
- package/cjs/interface/graphic/line.js.map +1 -1
- package/cjs/interface/graphic-service.d.ts +10 -17
- package/cjs/interface/graphic-service.js.map +1 -1
- package/cjs/interface/graphic.d.ts +2 -0
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/picker/pick-interceptor.js +5 -3
- package/cjs/picker/pick-interceptor.js.map +1 -1
- package/cjs/plugins/builtin-plugin/3dview-transform-plugin.d.ts +1 -0
- package/cjs/plugins/builtin-plugin/3dview-transform-plugin.js +8 -2
- package/cjs/plugins/builtin-plugin/3dview-transform-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/auto-render-plugin.d.ts +2 -1
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js +10 -8
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.d.ts +1 -0
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +8 -2
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/render/contributions/render/arc-render.js +15 -28
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +11 -6
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/base-render.d.ts +1 -1
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/cjs/render/contributions/render/index.d.ts +1 -0
- package/cjs/render/contributions/render/index.js +3 -3
- package/cjs/render/contributions/render/index.js.map +1 -1
- package/cjs/render/contributions/render/line-render.js +6 -3
- package/cjs/render/contributions/render/line-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-render.js +1 -1
- package/cjs/render/contributions/render/symbol-render.js.map +1 -1
- package/cjs/render/contributions/render/utils.d.ts +24 -0
- package/cjs/render/contributions/render/utils.js +56 -23
- package/cjs/render/contributions/render/utils.js.map +1 -1
- package/dist/index.es.js +6911 -7082
- package/es/animate/Ticker/default-ticker.d.ts +2 -53
- package/es/animate/Ticker/default-ticker.js +3 -106
- package/es/animate/Ticker/default-ticker.js.map +1 -1
- package/es/animate/Ticker/index.d.ts +4 -0
- package/es/animate/Ticker/index.js +8 -0
- package/es/animate/Ticker/index.js.map +1 -1
- 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/animate/Ticker/type.js +7 -0
- package/es/animate/Ticker/type.js.map +1 -0
- package/es/canvas/conical-gradient.js.map +1 -1
- package/es/canvas/contributions/base-canvas.js +3 -15
- package/es/canvas/contributions/base-canvas.js.map +1 -1
- package/es/common/3d-interceptor.js +1 -2
- package/es/common/bounds-context.js +2 -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 -2
- package/es/common/render-curve.js +1 -1
- package/es/common/render-utils.js +1 -1
- package/es/common/seg-context.js +1 -1
- package/es/common/segment/catmull-rom-close.d.ts +41 -0
- package/es/common/segment/catmull-rom-close.js +74 -0
- package/es/common/segment/catmull-rom-close.js.map +1 -0
- package/es/common/segment/catmull-rom.d.ts +38 -0
- package/es/common/segment/catmull-rom.js +92 -0
- package/es/common/segment/catmull-rom.js.map +1 -0
- package/es/common/segment/index.d.ts +5 -2
- package/es/common/segment/index.js +11 -0
- package/es/common/segment/index.js.map +1 -1
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/store.js +1 -1
- package/es/common/text.js +5 -4
- package/es/common/text.js.map +1 -1
- package/es/core/application.js +2 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/contributions/layerHandler/modules.js +2 -9
- package/es/core/contributions/layerHandler/modules.js.map +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global-module.js +2 -0
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +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.js +1 -1
- package/es/core/stage.d.ts +2 -2
- package/es/core/stage.js +9 -7
- package/es/core/stage.js.map +1 -1
- package/es/core/window.js +1 -1
- package/es/event/federated-event/base-event.js +12 -2
- package/es/event/federated-event/base-event.js.map +1 -1
- package/es/graphic/arc.d.ts +6 -4
- package/es/graphic/arc.js +47 -16
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/arc3d.d.ts +2 -2
- package/es/graphic/arc3d.js +7 -10
- package/es/graphic/arc3d.js.map +1 -1
- package/es/graphic/area.d.ts +5 -3
- package/es/graphic/area.js +28 -11
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/builtin-symbol/index.d.ts +1 -1
- package/es/graphic/builtin-symbol/thin-triangle.d.ts +2 -2
- package/es/graphic/builtin-symbol/thin-triangle.js +2 -2
- package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-down.d.ts +1 -2
- package/es/graphic/builtin-symbol/triangle-down.js +2 -7
- package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-left.d.ts +0 -1
- package/es/graphic/builtin-symbol/triangle-left.js +1 -6
- package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-right.d.ts +1 -2
- package/es/graphic/builtin-symbol/triangle-right.js +2 -7
- package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-up.d.ts +1 -2
- package/es/graphic/builtin-symbol/triangle-up.js +2 -7
- package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle.d.ts +1 -2
- package/es/graphic/builtin-symbol/triangle.js +1 -3
- package/es/graphic/builtin-symbol/triangle.js.map +1 -1
- package/es/graphic/circle.d.ts +5 -3
- package/es/graphic/circle.js +23 -9
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.js +6 -3
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/glyph.d.ts +4 -2
- package/es/graphic/glyph.js +9 -1
- package/es/graphic/glyph.js.map +1 -1
- package/es/graphic/graphic-creator.js.map +1 -1
- package/es/graphic/graphic-service/common-outer-boder-bounds.d.ts +3 -0
- package/es/graphic/graphic-service/common-outer-boder-bounds.js +9 -0
- package/es/graphic/graphic-service/common-outer-boder-bounds.js.map +1 -0
- package/es/graphic/graphic-service/graphic-service.d.ts +7 -36
- package/es/graphic/graphic-service/graphic-service.js +11 -297
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic-service/symbol-outer-border-bounds.d.ts +3 -0
- package/es/graphic/graphic-service/symbol-outer-border-bounds.js +11 -0
- package/es/graphic/graphic-service/symbol-outer-border-bounds.js.map +1 -0
- package/es/graphic/graphic.d.ts +12 -9
- package/es/graphic/graphic.js +20 -3
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +7 -3
- package/es/graphic/group.js +32 -22
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/image.d.ts +3 -2
- package/es/graphic/image.js +15 -8
- package/es/graphic/image.js.map +1 -1
- package/es/graphic/line.d.ts +5 -3
- package/es/graphic/line.js +25 -10
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/node-tree.js.map +1 -1
- package/es/graphic/path.d.ts +3 -3
- package/es/graphic/path.js +18 -12
- package/es/graphic/path.js.map +1 -1
- package/es/graphic/polygon.d.ts +4 -3
- package/es/graphic/polygon.js +17 -10
- package/es/graphic/polygon.js.map +1 -1
- package/es/graphic/pyramid3d.d.ts +2 -2
- package/es/graphic/pyramid3d.js +8 -10
- package/es/graphic/pyramid3d.js.map +1 -1
- package/es/graphic/rect.d.ts +3 -3
- package/es/graphic/rect.js +16 -10
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/rect3d.js +1 -3
- package/es/graphic/rect3d.js.map +1 -1
- package/es/graphic/richtext/icon.d.ts +2 -2
- package/es/graphic/richtext/icon.js.map +1 -1
- package/es/graphic/richtext.d.ts +3 -3
- package/es/graphic/richtext.js +43 -11
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/shadow-root.d.ts +2 -2
- package/es/graphic/shadow-root.js.map +1 -1
- package/es/graphic/symbol.d.ts +5 -3
- package/es/graphic/symbol.js +26 -11
- package/es/graphic/symbol.js.map +1 -1
- package/es/graphic/text.d.ts +10 -10
- package/es/graphic/text.js +27 -22
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/theme.js.map +1 -1
- package/es/graphic/wrap-text.d.ts +1 -1
- package/es/graphic/wrap-text.js +1 -3
- package/es/graphic/wrap-text.js.map +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -0
- package/es/index.js.map +1 -1
- package/es/interface/graphic/arc.d.ts +2 -2
- package/es/interface/graphic/arc.js.map +1 -1
- package/es/interface/graphic/arc3d.d.ts +1 -1
- package/es/interface/graphic/arc3d.js.map +1 -1
- package/es/interface/graphic/area.d.ts +1 -0
- package/es/interface/graphic/area.js.map +1 -1
- package/es/interface/graphic/line.d.ts +1 -0
- package/es/interface/graphic/line.js.map +1 -1
- package/es/interface/graphic-service.d.ts +10 -17
- package/es/interface/graphic-service.js.map +1 -1
- package/es/interface/graphic.d.ts +2 -0
- package/es/interface/graphic.js.map +1 -1
- package/es/picker/pick-interceptor.js +6 -2
- package/es/picker/pick-interceptor.js.map +1 -1
- package/es/plugins/builtin-plugin/3dview-transform-plugin.d.ts +1 -0
- package/es/plugins/builtin-plugin/3dview-transform-plugin.js +6 -0
- package/es/plugins/builtin-plugin/3dview-transform-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/auto-render-plugin.d.ts +2 -1
- package/es/plugins/builtin-plugin/auto-render-plugin.js +9 -8
- package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.d.ts +1 -0
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +6 -0
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/render/contributions/render/arc-render.js +10 -16
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/area-render.js +11 -5
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/base-render.d.ts +1 -1
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/es/render/contributions/render/index.d.ts +1 -0
- package/es/render/contributions/render/index.js +2 -0
- package/es/render/contributions/render/index.js.map +1 -1
- package/es/render/contributions/render/line-render.js +6 -3
- package/es/render/contributions/render/line-render.js.map +1 -1
- package/es/render/contributions/render/symbol-render.js +1 -1
- package/es/render/contributions/render/symbol-render.js.map +1 -1
- package/es/render/contributions/render/utils.d.ts +24 -0
- package/es/render/contributions/render/utils.js +46 -15
- package/es/render/contributions/render/utils.js.map +1 -1
- package/package.json +2 -2
- package/cjs/graphic/graphic-service/common-contribution.d.ts +0 -5
- package/cjs/graphic/graphic-service/common-contribution.js +0 -19
- package/cjs/graphic/graphic-service/common-contribution.js.map +0 -1
- package/cjs/graphic/graphic-service/symbol-contribution.d.ts +0 -6
- package/cjs/graphic/graphic-service/symbol-contribution.js +0 -21
- package/cjs/graphic/graphic-service/symbol-contribution.js.map +0 -1
- package/es/graphic/graphic-service/common-contribution.d.ts +0 -5
- package/es/graphic/graphic-service/common-contribution.js +0 -11
- package/es/graphic/graphic-service/common-contribution.js.map +0 -1
- package/es/graphic/graphic-service/symbol-contribution.d.ts +0 -6
- package/es/graphic/graphic-service/symbol-contribution.js +0 -15
- package/es/graphic/graphic-service/symbol-contribution.js.map +0 -1
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,CAAC;AAEnB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,2CAA2C,CAAC;AAC1D,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9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AAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gDAAgD,CAAC;AAE/D,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAG7C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iDAAiD,CAAC","file":"index.js","sourcesContent":["// import 'core-js/proposals/reflect-metadata';\nimport './modules';\n\nexport * from './container';\nexport * from './core/global';\nexport * from './graphic';\nexport * from './modules';\nexport * from './create';\nexport * from './event';\nexport * from './interface';\nexport * from './render';\nexport * from './render/contributions/render/base-render';\nexport * from './canvas';\nexport * from './core';\nexport * from './core/light';\nexport * from './core/camera';\nexport * from './picker';\nexport * from './animate';\nexport * from './resource-loader/loader';\nexport * from './color-string';\nexport * from './factory';\n\n/* export common */\nexport * from './common/text';\nexport * from './common/bezier-utils';\nexport * from './common/bounds-context';\nexport * from './common/seg-context';\nexport * from './common/custom-path2d';\nexport * from './common/segment';\nexport * from './common/canvas-utils';\nexport * from './common/contribution-provider';\nexport * from './common/generator';\nexport * from './common/utils';\nexport * from './common/shape/arc';\nexport * from './common/shape/rect';\nexport * from './common/matrix';\nexport * from './common/simplify';\n\nexport * from './common/path-svg';\nexport * from './common/render-curve';\nexport * from './common/render-area';\nexport * from './common/render-command-list';\nexport * from './common/sort';\nexport * from './common/morphing-utils';\nexport * from './common/split-path';\nexport * from './common/enums';\nexport * from './common/generator';\nexport * from './plugins/constants';\nexport * from './plugins/builtin-plugin/richtext-edit-plugin';\nexport * from './allocator/matrix-allocate';\nexport * from './allocator/canvas-allocate';\nexport * from './allocator/graphic-allocate';\n\nexport * from './animate/default-ticker';\nexport { wrapCanvas, wrapContext } from './canvas/util';\nexport * from './common/xml';\nexport * from './common/inversify-lite';\nexport * from './constants';\nexport * from './application';\nexport * from './env-check';\n\nexport * from './render/contributions/render/arc-module';\nexport * from './render/contributions/render/rect-module';\nexport * from './render/contributions/render/line-module';\nexport * from './render/contributions/render/area-module';\nexport * from './render/contributions/render/symbol-module';\nexport * from './render/contributions/render/circle-module';\nexport * from './render/contributions/render/text-module';\nexport * from './render/contributions/render/path-module';\nexport * from './render/contributions/render/polygon-module';\nexport * from './render/contributions/render/glyph-module';\nexport * from './render/contributions/render/richtext-module';\nexport * from './render/contributions/render/image-module';\nexport * from './render/contributions/render/rect3d-module';\nexport * from './render/contributions/render/arc3d-module';\nexport * from './render/contributions/render/pyramid3d-module';\n\nexport * from './register/register-arc';\nexport * from './register/register-arc3d';\nexport * from './register/register-area';\nexport * from './register/register-circle';\nexport * from './register/register-glyph';\nexport * from './register/register-group';\nexport * from './register/register-image';\nexport * from './register/register-line';\nexport * from './register/register-path';\nexport * from './register/register-polygon';\nexport * from './register/register-pyramid3d';\nexport * from './register/register-rect';\nexport * from './register/register-rect3d';\nexport * from './register/register-richtext';\nexport * from './register/register-symbol';\nexport * from './register/register-text';\nexport * from './register/register-shadowRoot';\nexport * from './register/register-wraptext';\n\n// plugin\nexport * from './plugins/builtin-plugin/html-attribute-plugin';\nexport * from './plugins/builtin-plugin/react-attribute-plugin';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,CAAC;AAEnB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,2CAA2C,CAAC;AAC1D,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAG1B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAElC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,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Ac,gDAAgD,CAAC;AAC/D,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,6CAA6C,CAAC","file":"index.js","sourcesContent":["// import 'core-js/proposals/reflect-metadata';\nimport './modules';\n\nexport * from './container';\nexport * from './core/global';\nexport * from './graphic';\nexport * from './modules';\nexport * from './create';\nexport * from './event';\nexport * from './interface';\nexport * from './render';\nexport * from './render/contributions/render/base-render';\nexport * from './canvas';\nexport * from './core';\nexport * from './core/light';\nexport * from './core/camera';\nexport * from './picker';\nexport * from './animate';\nexport * from './resource-loader/loader';\nexport * from './color-string';\nexport * from './factory';\n\n/* export common */\nexport * from './common/text';\nexport * from './common/bezier-utils';\nexport * from './common/bounds-context';\nexport * from './common/seg-context';\nexport * from './common/custom-path2d';\nexport * from './common/segment';\nexport * from './common/canvas-utils';\nexport * from './common/contribution-provider';\nexport * from './common/generator';\nexport * from './common/utils';\nexport * from './common/shape/arc';\nexport * from './common/shape/rect';\nexport * from './common/matrix';\nexport * from './common/simplify';\n\nexport * from './common/path-svg';\nexport * from './common/render-curve';\nexport * from './common/render-area';\nexport * from './common/render-command-list';\nexport * from './common/sort';\nexport * from './common/morphing-utils';\nexport * from './common/split-path';\nexport * from './common/enums';\nexport * from './common/generator';\nexport * from './plugins/constants';\nexport * from './plugins/builtin-plugin/richtext-edit-plugin';\nexport * from './allocator/matrix-allocate';\nexport * from './allocator/canvas-allocate';\nexport * from './allocator/graphic-allocate';\n\nexport * from './animate/default-ticker';\nexport { wrapCanvas, wrapContext } from './canvas/util';\nexport * from './common/xml';\nexport * from './common/inversify-lite';\nexport * from './constants';\nexport * from './application';\nexport * from './env-check';\n\nexport * from './render/contributions/render/arc-module';\nexport * from './render/contributions/render/rect-module';\nexport * from './render/contributions/render/line-module';\nexport * from './render/contributions/render/area-module';\nexport * from './render/contributions/render/symbol-module';\nexport * from './render/contributions/render/circle-module';\nexport * from './render/contributions/render/text-module';\nexport * from './render/contributions/render/path-module';\nexport * from './render/contributions/render/polygon-module';\nexport * from './render/contributions/render/glyph-module';\nexport * from './render/contributions/render/richtext-module';\nexport * from './render/contributions/render/image-module';\nexport * from './render/contributions/render/rect3d-module';\nexport * from './render/contributions/render/arc3d-module';\nexport * from './render/contributions/render/pyramid3d-module';\n\nexport * from './register/register-arc';\nexport * from './register/register-arc3d';\nexport * from './register/register-area';\nexport * from './register/register-circle';\nexport * from './register/register-glyph';\nexport * from './register/register-group';\nexport * from './register/register-image';\nexport * from './register/register-line';\nexport * from './register/register-path';\nexport * from './register/register-polygon';\nexport * from './register/register-pyramid3d';\nexport * from './register/register-rect';\nexport * from './register/register-rect3d';\nexport * from './register/register-richtext';\nexport * from './register/register-symbol';\nexport * from './register/register-text';\nexport * from './register/register-shadowRoot';\nexport * from './register/register-wraptext';\n\n// plugin\nexport * from './plugins/builtin-plugin/html-attribute-plugin';\nexport * from './plugins/builtin-plugin/react-attribute-plugin';\nexport * from './plugins/builtin-plugin/3dview-transform-plugin';\nexport * from './plugins/builtin-plugin/flex-layout-plugin';\n"]}
|
|
@@ -7,7 +7,7 @@ export type IArcAttribute = {
|
|
|
7
7
|
outerPadding: number;
|
|
8
8
|
startAngle: number;
|
|
9
9
|
endAngle: number;
|
|
10
|
-
cornerRadius: number | string
|
|
10
|
+
cornerRadius: number | string | Array<number | string>;
|
|
11
11
|
padAngle: number;
|
|
12
12
|
padRadius: number;
|
|
13
13
|
cap: boolean | [boolean, boolean];
|
|
@@ -21,7 +21,7 @@ export type IArcCache = {
|
|
|
21
21
|
export type IArcGraphicAttribute = Partial<IGraphicAttribute> & Partial<IArcAttribute>;
|
|
22
22
|
export interface IArc extends IGraphic<IArcGraphicAttribute> {
|
|
23
23
|
cache?: ICustomPath2D;
|
|
24
|
-
getParsedCornerRadius: () => number;
|
|
24
|
+
getParsedCornerRadius: () => number | number[];
|
|
25
25
|
getParsedAngle: () => {
|
|
26
26
|
startAngle: number;
|
|
27
27
|
endAngle: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/graphic/arc.ts"],"names":[],"mappings":"","file":"arc.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D } from '../path';\n\n/**\n * 扇区属性\n */\nexport type IArcAttribute = {\n /** 内半径 */\n innerRadius: number;\n /** 外半径 */\n outerRadius: number;\n /* 内边距 */\n innerPadding: number;\n /* 外边距 */\n outerPadding: number;\n /**\n * 起始角度;\n * 以弧度的形式指定,0 表示 12 点钟方向并且顺时针方向为正。\n * 如果 |endAngle - startAngle| ≥ τ 则会绘制一个完整的扇形或圆环\n */\n startAngle: number;\n /**\n * 终止角度;\n * 以弧度的形式指定,0 表示 12 点钟方向并且顺时针方向为正。\n * 如果 |endAngle - startAngle| ≥ τ 则会绘制一个完整的扇形或圆环\n */\n endAngle: number;\n /**\n * 用于指定扇形区块的内外圆角半径,支持设置固定数值 或者 相对于扇形区块的半径差(| outerRadius - innerRadius |)的百分比值\n * 支持分别配置从外到内顺时针方向四个角的圆角半径,百分比值为相对于内外扇形的半径差。\n * 其中\n *\n * cornerRadius: 10:表示内圆角半径和外圆角半径都是 10px。\n * cornerRadius: '20%':表示内圆角半径和外圆角半径都是扇形区块半径的 20%。\n * cornerRadius: [10, 20]:表示为环形图时,外圆角半径是 10px、内圆角半径是 20px。\n * cornerRadius: ['20%', '50%']:表示为环形图时,外圆角半径是内外圆半径差的 20%、内圆角半径是内外圆半径差的 50%。\n * cornerRadius: [5, 10, 15, 20]:表示外圆角半径分别为 5px 和 10px,内圆角半径分别为 15px 和 20px。\n *\n * 也支持如下形式的配置:\n * cornerRadius: [5, '10%', '20%', 10]\n * TODO: 暂不支持\n */\n cornerRadius: number | string
|
|
1
|
+
{"version":3,"sources":["../src/interface/graphic/arc.ts"],"names":[],"mappings":"","file":"arc.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D } from '../path';\n\n/**\n * 扇区属性\n */\nexport type IArcAttribute = {\n /** 内半径 */\n innerRadius: number;\n /** 外半径 */\n outerRadius: number;\n /* 内边距 */\n innerPadding: number;\n /* 外边距 */\n outerPadding: number;\n /**\n * 起始角度;\n * 以弧度的形式指定,0 表示 12 点钟方向并且顺时针方向为正。\n * 如果 |endAngle - startAngle| ≥ τ 则会绘制一个完整的扇形或圆环\n */\n startAngle: number;\n /**\n * 终止角度;\n * 以弧度的形式指定,0 表示 12 点钟方向并且顺时针方向为正。\n * 如果 |endAngle - startAngle| ≥ τ 则会绘制一个完整的扇形或圆环\n */\n endAngle: number;\n /**\n * 用于指定扇形区块的内外圆角半径,支持设置固定数值 或者 相对于扇形区块的半径差(| outerRadius - innerRadius |)的百分比值\n * 支持分别配置从外到内顺时针方向四个角的圆角半径,百分比值为相对于内外扇形的半径差。\n * 其中\n *\n * cornerRadius: 10:表示内圆角半径和外圆角半径都是 10px。\n * cornerRadius: '20%':表示内圆角半径和外圆角半径都是扇形区块半径的 20%。\n * cornerRadius: [10, 20]:表示为环形图时,外圆角半径是 10px、内圆角半径是 20px。\n * cornerRadius: ['20%', '50%']:表示为环形图时,外圆角半径是内外圆半径差的 20%、内圆角半径是内外圆半径差的 50%。\n * cornerRadius: [5, 10, 15, 20]:表示外圆角半径分别为 5px 和 10px,内圆角半径分别为 15px 和 20px。\n *\n * 也支持如下形式的配置:\n * cornerRadius: [5, '10%', '20%', 10]\n * TODO: 暂不支持\n */\n cornerRadius: number | string | Array<number | string>;\n /**\n * 间隙角度;间隔角度会转换为一个在两个相邻的弧之间的确定的线性距离,定义为 padRadius * | padAngle |\n * 这个距离在弧的开始和结束处都是相等的;\n * 间隔角度通常只应用于环形扇区(即当内半径大于 0)\n */\n padAngle: number;\n padRadius: number;\n\n /**\n * 对应了线段的 lineCap 属性,lineCap 表示的是线段末端如何绘制\n * cap: true 表示在弧线的起始位置都增加一个角度,角度是 | outerRadius - innerRadius | / outerRadius\n */\n cap: boolean | [boolean, boolean];\n /**\n * 当cap = true 并且 使用了渐变填充的时候,自动实现conical渐变,也就是环形的渐变\n */\n forceShowCap: boolean;\n};\n/**\n * 内部缓存,用于存储一些内部变量\n */\nexport type IArcCache = {\n /** 解析后的圆角配置 */\n cornerRadius?: [number, number, number, number];\n startAngle?: number;\n endAngle?: number;\n};\n\nexport type IArcGraphicAttribute = Partial<IGraphicAttribute> & Partial<IArcAttribute>;\n\nexport interface IArc extends IGraphic<IArcGraphicAttribute> {\n cache?: ICustomPath2D;\n\n getParsedCornerRadius: () => number | number[];\n getParsedAngle: () => { startAngle: number; endAngle: number; sc?: number; ec?: number };\n getParsePadAngle: (\n startAngle: number,\n endAngle: number\n ) => {\n outerStartAngle: number;\n outerEndAngle: number;\n innerStartAngle: number;\n innerEndAngle: number;\n\n outerDeltaAngle: number;\n innerDeltaAngle: number;\n };\n}\n"]}
|
|
@@ -6,7 +6,7 @@ export type IArc3dGraphicAttribute = Partial<IArcGraphicAttribute> & {
|
|
|
6
6
|
};
|
|
7
7
|
export interface IArc3d extends IGraphic<IArc3dGraphicAttribute> {
|
|
8
8
|
cache?: ICustomPath2D;
|
|
9
|
-
getParsedCornerRadius: () => number;
|
|
9
|
+
getParsedCornerRadius: () => number | number[];
|
|
10
10
|
getParsedAngle: () => {
|
|
11
11
|
startAngle: number;
|
|
12
12
|
endAngle: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/graphic/arc3d.ts"],"names":[],"mappings":"","file":"arc3d.js","sourcesContent":["import type { IGraphic } from '../graphic';\nimport type { ICustomPath2D } from '../path';\nimport type { IArcGraphicAttribute } from './arc';\n\nexport type IArc3dGraphicAttribute = Partial<IArcGraphicAttribute> & {\n height?: number; // 长度\n};\n\nexport interface IArc3d extends IGraphic<IArc3dGraphicAttribute> {\n cache?: ICustomPath2D;\n\n getParsedCornerRadius: () => number;\n getParsedAngle: () => { startAngle: number; endAngle: number };\n getParsePadAngle: (\n startAngle: number,\n endAngle: number\n ) => {\n outerStartAngle: number;\n outerEndAngle: number;\n innerStartAngle: number;\n innerEndAngle: number;\n\n outerDeltaAngle: number;\n innerDeltaAngle: number;\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/interface/graphic/arc3d.ts"],"names":[],"mappings":"","file":"arc3d.js","sourcesContent":["import type { IGraphic } from '../graphic';\nimport type { ICustomPath2D } from '../path';\nimport type { IArcGraphicAttribute } from './arc';\n\nexport type IArc3dGraphicAttribute = Partial<IArcGraphicAttribute> & {\n height?: number; // 长度\n};\n\nexport interface IArc3d extends IGraphic<IArc3dGraphicAttribute> {\n cache?: ICustomPath2D;\n\n getParsedCornerRadius: () => number | number[];\n getParsedAngle: () => { startAngle: number; endAngle: number };\n getParsePadAngle: (\n startAngle: number,\n endAngle: number\n ) => {\n outerStartAngle: number;\n outerEndAngle: number;\n innerStartAngle: number;\n innerEndAngle: number;\n\n outerDeltaAngle: number;\n innerDeltaAngle: number;\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/graphic/area.ts"],"names":[],"mappings":"","file":"area.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { ISegPath2D } from '../curve';\nimport type { IConnectedStyle, IGraphic, IGraphicAttribute } from '../graphic';\nimport type { ICurveType } from '../common';\n\nexport type IAreaAttribute = {\n segments: IAreaSegment[]; // 分段设置point和样式\n points: IPointLike[];\n curveType: ICurveType;\n clipRange: number;\n closePath: boolean;\n};\n\nexport type IAreaCacheItem = {\n top: ISegPath2D;\n bottom: ISegPath2D;\n};\n\nexport type IAreaGraphicAttribute = Partial<IGraphicAttribute> & Partial<IAreaAttribute> & Partial<IConnectedStyle>;\n\nexport interface IArea extends IGraphic<IAreaGraphicAttribute> {\n cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n}\n\ntype ISegmentStyle = Pick<\n IGraphicAttribute,\n 'fill' | 'fillOpacity' | 'background' | 'texture' | 'textureColor' | 'textureSize' | 'texturePadding'\n>;\n\nexport interface IAreaSegment extends Partial<ISegmentStyle>, Partial<IConnectedStyle> {\n points: IPointLike[];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/interface/graphic/area.ts"],"names":[],"mappings":"","file":"area.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { ISegPath2D } from '../curve';\nimport type { IConnectedStyle, IGraphic, IGraphicAttribute } from '../graphic';\nimport type { ICurveType } from '../common';\n\nexport type IAreaAttribute = {\n segments: IAreaSegment[]; // 分段设置point和样式\n points: IPointLike[];\n curveType: ICurveType;\n clipRange: number;\n closePath: boolean;\n curveTension: number;\n};\n\nexport type IAreaCacheItem = {\n top: ISegPath2D;\n bottom: ISegPath2D;\n};\n\nexport type IAreaGraphicAttribute = Partial<IGraphicAttribute> & Partial<IAreaAttribute> & Partial<IConnectedStyle>;\n\nexport interface IArea extends IGraphic<IAreaGraphicAttribute> {\n cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n}\n\ntype ISegmentStyle = Pick<\n IGraphicAttribute,\n 'fill' | 'fillOpacity' | 'background' | 'texture' | 'textureColor' | 'textureSize' | 'texturePadding'\n>;\n\nexport interface IAreaSegment extends Partial<ISegmentStyle>, Partial<IConnectedStyle> {\n points: IPointLike[];\n}\n"]}
|
|
@@ -10,6 +10,7 @@ export type ILineAttribute = {
|
|
|
10
10
|
clipRange: number;
|
|
11
11
|
clipRangeByDimension: IClipRangeByDimensionType;
|
|
12
12
|
closePath: boolean;
|
|
13
|
+
curveTension: number;
|
|
13
14
|
};
|
|
14
15
|
export type ILineGraphicAttribute = Partial<IGraphicAttribute> & Partial<ILineAttribute> & Partial<IConnectedStyle>;
|
|
15
16
|
export interface ILine extends IGraphic<ILineGraphicAttribute> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/graphic/line.ts"],"names":[],"mappings":"","file":"line.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic, IConnectedStyle } from '../graphic';\nimport type { ICurveType } from '../common';\nimport type { ISegPath2D } from '../curve';\n\n// 依据x纬度做clipRange\n// 依据y纬度做clipRange\n// 依据线段自动匹配纬度做clipRange\n// 依据线长纬度做clipRange\nexport type IClipRangeByDimensionType = 'x' | 'y' | 'auto' | 'default';\n\nexport type ILineAttribute = {\n segments: ISegment[]; // 分段设置point和样式\n points: IPointLike[]; // segments points 二选一\n curveType: ICurveType;\n clipRange: number;\n clipRangeByDimension: IClipRangeByDimensionType;\n closePath: boolean; // 是否封闭路径\n};\n\nexport type ILineGraphicAttribute = Partial<IGraphicAttribute> & Partial<ILineAttribute> & Partial<IConnectedStyle>;\n\nexport interface ILine extends IGraphic<ILineGraphicAttribute> {\n cache?: ISegPath2D | ISegPath2D[];\n}\n\ntype ISegmentStyle = Pick<\n IGraphicAttribute,\n 'stroke' | 'strokeOpacity' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'lineWidth' | 'miterLimit'\n>;\n\nexport interface ISegment extends Partial<ISegmentStyle>, Partial<IConnectedStyle> {\n points: IPointLike[];\n simplify?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/interface/graphic/line.ts"],"names":[],"mappings":"","file":"line.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic, IConnectedStyle } from '../graphic';\nimport type { ICurveType } from '../common';\nimport type { ISegPath2D } from '../curve';\n\n// 依据x纬度做clipRange\n// 依据y纬度做clipRange\n// 依据线段自动匹配纬度做clipRange\n// 依据线长纬度做clipRange\nexport type IClipRangeByDimensionType = 'x' | 'y' | 'auto' | 'default';\n\nexport type ILineAttribute = {\n segments: ISegment[]; // 分段设置point和样式\n points: IPointLike[]; // segments points 二选一\n curveType: ICurveType;\n clipRange: number;\n clipRangeByDimension: IClipRangeByDimensionType;\n closePath: boolean; // 是否封闭路径\n curveTension: number;\n};\n\nexport type ILineGraphicAttribute = Partial<IGraphicAttribute> & Partial<ILineAttribute> & Partial<IConnectedStyle>;\n\nexport interface ILine extends IGraphic<ILineGraphicAttribute> {\n cache?: ISegPath2D | ISegPath2D[];\n}\n\ntype ISegmentStyle = Pick<\n IGraphicAttribute,\n 'stroke' | 'strokeOpacity' | 'lineDash' | 'lineDashOffset' | 'lineCap' | 'lineJoin' | 'lineWidth' | 'miterLimit'\n>;\n\nexport interface ISegment extends Partial<ISegmentStyle>, Partial<IConnectedStyle> {\n points: IPointLike[];\n simplify?: boolean;\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IAABBBounds } from '@visactor/vutils';
|
|
2
2
|
import type { ISyncHook } from './sync-hook';
|
|
3
|
-
import type { IGraphic } from './graphic';
|
|
3
|
+
import type { IGraphic, IGraphicAttribute } from './graphic';
|
|
4
4
|
import type { IStage } from './stage';
|
|
5
|
-
import type { IRectGraphicAttribute, IGroup, IGroupGraphicAttribute,
|
|
5
|
+
import type { IRectGraphicAttribute, IGroup, IGroupGraphicAttribute, ISymbolGraphicAttribute, ICircleGraphicAttribute, ICircle, ISymbol, IArcGraphicAttribute, IArc, IAreaGraphicAttribute, IArea, ILineGraphicAttribute, IPathGraphicAttribute, ILine, IPath, IPolygonGraphicAttribute, IPolygon, ITextGraphicAttribute, IText, IRichTextGraphicAttribute, IRichText, IImageGraphicAttribute, IImage, IRect3dGraphicAttribute, IRect, IRect3d, IShadowRoot, IWrapTextGraphicAttribute } from './graphic/index';
|
|
6
6
|
export interface IGraphicService {
|
|
7
7
|
onAttributeUpdate: (graphic: IGraphic) => void;
|
|
8
8
|
onSetStage: (graphic: IGraphic, stage: IStage) => void;
|
|
@@ -27,21 +27,14 @@ export interface IGraphicService {
|
|
|
27
27
|
globalAABBBounds: IAABBBounds;
|
|
28
28
|
}, selfChange: boolean) => void;
|
|
29
29
|
creator: IGraphicCreator;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
updateLineAABBBounds: (attribute: ILineGraphicAttribute, lineTheme: Required<ILineGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: ILine) => IAABBBounds;
|
|
39
|
-
updatePathAABBBounds: (attribute: IPathGraphicAttribute, pathTheme: Required<IPathGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPath) => IAABBBounds;
|
|
40
|
-
updatePolygonAABBBounds: (attribute: IPolygonGraphicAttribute, polygonTheme: Required<IPolygonGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPolygon) => IAABBBounds;
|
|
41
|
-
updatePyramid3dAABBBounds: (attribute: IPyramid3dGraphicAttribute, polygonTheme: Required<IPyramid3dGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IPyramid3d) => IAABBBounds;
|
|
42
|
-
updateTextAABBBounds: (attribute: ITextGraphicAttribute, textTheme: Required<ITextGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IText) => IAABBBounds;
|
|
43
|
-
updateRichTextAABBBounds: (attribute: IRichTextGraphicAttribute, textTheme: Required<IRichTextGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IRichText) => IAABBBounds;
|
|
44
|
-
updateImageAABBBounds: (attribute: IImageGraphicAttribute, textTheme: Required<IImageGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IImage) => IAABBBounds;
|
|
30
|
+
validCheck: (attribute: Partial<IGraphicAttribute>, theme: Required<IGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic) => boolean;
|
|
31
|
+
transformAABBBounds: (attribute: Partial<IGraphicAttribute>, aabbBounds: IAABBBounds, theme: Required<IGraphicAttribute>, miter: boolean, graphic?: IGraphic) => void;
|
|
32
|
+
updateHTMLTextAABBBounds: (attribute: ITextGraphicAttribute, textTheme: Required<ITextGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IText) => void;
|
|
33
|
+
combindShadowAABBBounds: (bounds: IAABBBounds, graphic?: IGraphic) => void;
|
|
34
|
+
updateTempAABBBounds: (aabbBounds: IAABBBounds) => {
|
|
35
|
+
tb1: IAABBBounds;
|
|
36
|
+
tb2: IAABBBounds;
|
|
37
|
+
};
|
|
45
38
|
}
|
|
46
39
|
export type IGraphicCreator = {
|
|
47
40
|
arc: (attributes: IArcGraphicAttribute) => IArc;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/graphic-service.ts"],"names":[],"mappings":"","file":"graphic-service.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\n\nimport type { ISyncHook } from './sync-hook';\nimport type { IGraphic } from './graphic';\nimport type { IStage } from './stage';\nimport type {\n IRectGraphicAttribute,\n IGroup,\n IGroupGraphicAttribute,\n
|
|
1
|
+
{"version":3,"sources":["../src/interface/graphic-service.ts"],"names":[],"mappings":"","file":"graphic-service.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\n\nimport type { ISyncHook } from './sync-hook';\nimport type { IGraphic, IGraphicAttribute } from './graphic';\nimport type { IStage } from './stage';\nimport type {\n IRectGraphicAttribute,\n IGroup,\n IGroupGraphicAttribute,\n ISymbolGraphicAttribute,\n ICircleGraphicAttribute,\n ICircle,\n ISymbol,\n IArcGraphicAttribute,\n IArc,\n IAreaGraphicAttribute,\n IArea,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n ILine,\n IPath,\n IPolygonGraphicAttribute,\n IPolygon,\n ITextGraphicAttribute,\n IText,\n IRichTextGraphicAttribute,\n IRichText,\n IImageGraphicAttribute,\n IImage,\n IRect3dGraphicAttribute,\n IRect,\n IRect3d,\n IShadowRoot,\n IWrapTextGraphicAttribute\n} from './graphic/index';\n\nexport interface IGraphicService {\n // themeService: IThemeService;\n onAttributeUpdate: (graphic: IGraphic) => void;\n onSetStage: (graphic: IGraphic, stage: IStage) => void;\n onRemove: (graphic: IGraphic) => void;\n onRelease: (graphic: IGraphic) => void;\n onAddIncremental: (graphic: IGraphic, group: IGroup, stage: IStage) => void;\n onClearIncremental: (group: IGroup, stage: IStage) => void;\n hooks: {\n onAttributeUpdate: ISyncHook<[IGraphic]>;\n onSetStage: ISyncHook<[IGraphic, IStage]>;\n onRemove: ISyncHook<[IGraphic]>;\n onRelease: ISyncHook<[IGraphic]>;\n onAddIncremental: ISyncHook<[IGraphic, IGroup, IStage]>;\n onClearIncremental: ISyncHook<[IGroup, IStage]>;\n beforeUpdateAABBBounds: ISyncHook<[IGraphic, IStage, boolean, IAABBBounds]>;\n afterUpdateAABBBounds: ISyncHook<[IGraphic, IStage, IAABBBounds, { globalAABBBounds: IAABBBounds }, boolean]>;\n };\n beforeUpdateAABBBounds: (graphic: IGraphic, stage: IStage, willUpdate: boolean, bounds: IAABBBounds) => void;\n afterUpdateAABBBounds: (\n graphic: IGraphic,\n stage: IStage,\n bounds: IAABBBounds,\n params: { globalAABBBounds: IAABBBounds },\n selfChange: boolean\n ) => void;\n\n creator: IGraphicCreator;\n validCheck: (\n attribute: Partial<IGraphicAttribute>,\n theme: Required<IGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ) => boolean;\n\n transformAABBBounds: (\n attribute: Partial<IGraphicAttribute>,\n aabbBounds: IAABBBounds,\n theme: Required<IGraphicAttribute>,\n miter: boolean,\n graphic?: IGraphic\n ) => void;\n\n updateHTMLTextAABBBounds: (\n attribute: ITextGraphicAttribute,\n textTheme: Required<ITextGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IText\n ) => void;\n\n combindShadowAABBBounds: (bounds: IAABBBounds, graphic?: IGraphic) => void;\n updateTempAABBBounds: (aabbBounds: IAABBBounds) => { tb1: IAABBBounds; tb2: IAABBBounds };\n}\n\nexport type IGraphicCreator = {\n arc: (attributes: IArcGraphicAttribute) => IArc;\n area: (attributes: IAreaGraphicAttribute) => IArea;\n circle: (attributes: ICircleGraphicAttribute) => ICircle;\n group: (attributes: IGroupGraphicAttribute) => IGroup;\n image: (attributes: IImageGraphicAttribute) => IImage;\n line: (attributes: ILineGraphicAttribute) => ILine;\n path: (attributes: IPathGraphicAttribute) => IPath;\n rect: (attributes: IRectGraphicAttribute) => IRect;\n rect3d: (attributes: IRect3dGraphicAttribute) => IRect3d;\n symbol: (attributes: ISymbolGraphicAttribute) => ISymbol;\n text: (attributes: ITextGraphicAttribute) => IText;\n richtext: (attributes: IRichTextGraphicAttribute) => IRichText;\n polygon: (attributes: IPolygonGraphicAttribute) => IPolygon;\n shadowRoot: (graphic?: IGraphic) => IShadowRoot;\n wrapText: (attributes: IWrapTextGraphicAttribute) => IText;\n};\n\nexport interface IArcBoundsContribution {\n updateBounds: (\n attribute: IArcGraphicAttribute,\n arcTheme: Required<IArcGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ) => IAABBBounds;\n}\n\nexport interface IAreaBoundsContribution {\n updateBounds: (\n attribute: IAreaGraphicAttribute,\n arcTheme: Required<IAreaGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ) => IAABBBounds;\n}\n\nexport interface ICircleBoundsContribution {\n updateBounds: (\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ) => IAABBBounds;\n}\n\nexport interface IPathBoundsContribution {\n updateBounds: (\n attribute: IPathGraphicAttribute,\n pathTheme: Required<IPathGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ) => IAABBBounds;\n}\n\nexport interface IRectBoundsContribution {\n updateBounds: (\n attribute: IRectGraphicAttribute,\n rectTheme: Required<IRectGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ) => IAABBBounds;\n}\n\nexport interface ISymbolBoundsContribution {\n updateBounds: (\n attribute: ISymbolGraphicAttribute,\n SymbolTheme: Required<ISymbolGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ) => IAABBBounds;\n}\nexport interface IImageBoundsContribution {\n updateBounds: (\n attribute: IImageGraphicAttribute,\n ImageTheme: Required<IImageGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ) => IAABBBounds;\n}\n"]}
|
|
@@ -165,6 +165,7 @@ export type IGraphicAttribute = IDebugType & IGraphicStyle & ITransform & {
|
|
|
165
165
|
renderable: boolean;
|
|
166
166
|
keepDirIn3d?: boolean;
|
|
167
167
|
shadowRootIdx: number;
|
|
168
|
+
shadowPickMode?: 'full' | 'graphic';
|
|
168
169
|
globalZIndex: number;
|
|
169
170
|
globalCompositeOperation: CanvasRenderingContext2D['globalCompositeOperation'] | '';
|
|
170
171
|
overflow: 'scroll' | 'hidden' | 'scroll-x' | 'scroll-y';
|
|
@@ -286,6 +287,7 @@ export interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphi
|
|
|
286
287
|
clone: () => IGraphic;
|
|
287
288
|
stopAnimates: (stopChildren?: boolean) => void;
|
|
288
289
|
getNoWorkAnimateAttr: () => Record<string, number>;
|
|
290
|
+
getGraphicTheme: () => T;
|
|
289
291
|
}
|
|
290
292
|
export interface IRoot extends IGraphic {
|
|
291
293
|
pick: (x: number, y: number) => IGraphic;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/graphic.ts"],"names":[],"mappings":"","file":"graphic.js","sourcesContent":["import type { IAABBBounds, IOBBBounds, IMatrix, IPointLike, IPoint, BoundsAnchorType } from '@visactor/vutils';\nimport type { IAnimate, IStep, EasingType, IAnimateTarget } from './animate';\nimport type { IColor } from './color';\nimport type { IGroup } from './graphic/group';\nimport type { IShadowRoot } from './graphic/shadow-root';\nimport type { ILayer } from './layer';\nimport type { INode } from './node-tree';\nimport type { ICustomPath2D } from './path';\nimport type { IStage } from './stage';\nimport type { IGlyphGraphicAttribute } from './graphic/glyph';\nimport type { IContainPointMode } from '../common/enums';\nimport type { IFace3d } from './graphic/face3d';\nimport type { IPickerService } from './picker';\n\ntype IStrokeSeg = {\n start: number; // 百分比\n // end和length二选一\n end: number; // 百分比\n length: number; // 像素长度\n};\n\n// TODO 最后加一个any\nexport type GraphicType =\n | 'area'\n | 'circle'\n | 'ellipse'\n | 'line'\n | 'rect'\n | 'rect3d'\n | 'path'\n | 'richtext'\n | 'text'\n | 'arc'\n | 'arc3d'\n | 'image'\n | 'symbol'\n | 'group'\n | 'shadowroot'\n | 'polygon'\n | 'pyramid3d'\n | 'glyph';\n\n// Cursor style\n// See: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'all-scroll'\n | 'col-resize'\n | 'row-resize'\n | 'n-resize'\n | 'e-resize'\n | 's-resize'\n | 'w-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'zoom-in'\n | 'zoom-out';\n\nexport type ITransform = {\n x: number;\n y: number;\n z: number;\n dx: number;\n dy: number;\n dz: number;\n scrollX: number;\n scrollY: number;\n scaleX: number;\n scaleY: number;\n scaleZ: number;\n angle: number;\n alpha: number;\n beta: number;\n scaleCenter: [number | string, number | string];\n anchor: [number | string, number | string]; // 基于AABB的锚点位置,用于简单的定位某些path\n anchor3d: [number | string, number | string, number] | [number | string, number | string]; // 3d的锚点位置\n postMatrix: IMatrix;\n};\n\nexport type IFillType = boolean | string | IColor;\nexport type IFillStyle = {\n fillOpacity: number;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n fill: IFillType;\n};\n\nexport type ILayout = {\n alignSelf: 'auto' | 'flex-start' | 'flex-end' | 'center';\n};\n\nexport type IBorderStyle = Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> & {\n distance: number | string;\n visible?: boolean;\n};\n\nexport type IStrokeType = boolean | string | IColor | null;\nexport type IStrokeStyle = {\n outerBorder: Partial<IBorderStyle>;\n innerBorder: Partial<IBorderStyle>;\n strokeOpacity: number;\n lineDash: number[];\n lineDashOffset: number;\n lineWidth: number;\n lineCap: CanvasLineCap;\n lineJoin: CanvasLineJoin;\n miterLimit: number;\n // 描边的boundsBuffer,用于控制bounds的buffer\n strokeBoundsBuffer: number;\n /**\n * stroke - true 全描边\n * stroke - false 不描边\n * stroke 为数值类型,适用于rect\\arc等图形,用于配置部分描边的场景,其中\n *\n * 0b00000 - 不描边\n * 0b000001 - top\n * 0b000010 - right\n * 0b000100 - bottom\n * 0b001000 - left\n * 相应的:\n * 0b000011 - top + right\n * 0b000111 - top + right + bottom\n * 0b001111 - 全描边\n *\n * stroke - boolean[],适用于rect\\arc等图形,用于配置部分描边的场景\n */\n stroke: IStrokeType[] | IStrokeType;\n};\n\ntype TextureType = 'circle' | 'diamond' | 'rect' | 'vertical-line' | 'horizontal-line' | 'bias-lr' | 'bias-rl' | 'grid';\n\nexport type IConnectedStyle = {\n // 连接,取零或者断开\n connectedType: 'connect' | 'zero' | 'none';\n connectedStyle: {\n stroke: IStrokeStyle['stroke'];\n strokeOpacity: IStrokeStyle['strokeOpacity'];\n lineDash: IStrokeStyle['lineDash'];\n lineDashOffset: IStrokeStyle['lineDashOffset'];\n lineCap: IStrokeStyle['lineCap'];\n lineJoin: IStrokeStyle['lineJoin'];\n lineWidth: IStrokeStyle['lineWidth'];\n fill: IFillStyle['fill'];\n fillOpacity: IFillStyle['fillOpacity'];\n };\n connectedX: number;\n connectedY: number;\n};\n\nexport type IBackgroundConfig = {\n stroke?: string | boolean;\n fill?: string | boolean;\n lineWidth?: number;\n cornerRadius?: number;\n expandX?: number;\n expandY?: number;\n};\n\ntype IBackgroundType = string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig;\n\nexport interface SimpleDomStyleOptions {\n width: number; // 容器的宽度\n height: number; // 容器的高度\n style?:\n | string\n | Record<string, any>\n | ((\n pos: { top: number; left: number; width: number; height: number },\n graphic: IGraphic,\n wrapContainer: HTMLElement\n ) => Record<string, any>); // 容器的样式\n}\n\nexport interface CommonDomOptions {\n id?: string;\n container: string | HTMLElement | null; // id或者dom\n visible?: boolean;\n pointerEvents?: boolean | string;\n anchorType?: 'position' | 'boundsLeftTop' | BoundsAnchorType;\n}\n\nexport type IGraphicStyle = ILayout &\n IFillStyle &\n IStrokeStyle &\n IPickStyle & {\n forceBoundsWidth: number | (() => number) | undefined;\n forceBoundsHeight: number | (() => number) | undefined;\n opacity: number;\n shadowGraphic?: IGraphic | undefined;\n backgroundMode: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat'; // 填充模式(与具体图元有关)\n backgroundFit: boolean; // 是否正好填充,只在repeat-x或者repeat-y以及no-repeat的时候生效\n backgroundCornerRadius: number | number[];\n backgroundOpacity: number;\n background:\n | IBackgroundType\n | {\n background: IBackgroundType;\n dx?: number;\n dy?: number;\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n }\n | null; // 背景,可以与fill同时存在\n texture: TextureType | string; // 纹理\n textureColor: string; // 纹理颜色\n textureSize: number; // 纹理大小\n texturePadding: number; // 纹理间隙\n blur: number;\n cursor: Cursor | null; // 鼠标样式\n renderStyle?: 'default' | 'rough' | any;\n // HTML的dom或者string\n html:\n | ({\n dom: string | HTMLElement; // dom字符串或者dom\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n react:\n | ({\n element: any; // react场景节点\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n };\n\nexport type IPickStyle = {\n // 给stroke模式的pick额外加的buffer,用于外界控制stroke区域的pick范围\n pickStrokeBuffer: number;\n};\n\nexport type IDebugType = {\n _debug_bounds: boolean | ((c: any, g: any) => void);\n};\nexport type IGraphicAttribute = IDebugType &\n IGraphicStyle &\n ITransform & {\n /**\n * stroke百分比\n */\n strokeSeg: IStrokeSeg | null;\n // 包围盒的padding\n boundsPadding: number | number[];\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode: 'accurate' | 'imprecise' | 'custom';\n boundsMode: 'accurate' | 'imprecise';\n customPickShape: () => boolean | null;\n /**\n * 是否支持事件拾取,默认为 true。\n * @default true\n */\n pickable: boolean;\n /**\n * 是否支持fill拾取,默认为 true。\n * @experimental\n * @default true\n */\n fillPickable: boolean;\n /**\n * 是否支持stroke拾取,默认为 true。\n * @experimental\n * @default true\n */\n strokePickable: boolean;\n /**\n * 对于 group 节点,是否支持其子元素的事件拾取,默认为 true。\n * 如果 group `pickable` 关闭,`childrenPickable` 开启,那么 group 的子节点仍参与事件拾取\n * @default true\n */\n childrenPickable: boolean;\n /**\n * 元素是否可见。\n * @default true\n */\n visible: boolean;\n zIndex: number;\n layout: any;\n /**\n * 是否隐藏元素(只是绘制的时候不绘制)\n */\n renderable: boolean;\n /**\n * 是否在3d中控制方向\n * false: 不控制方向\n * true: 始终控制方向朝摄像机\n */\n keepDirIn3d?: boolean;\n shadowRootIdx: number;\n globalZIndex: number;\n globalCompositeOperation: CanvasRenderingContext2D['globalCompositeOperation'] | '';\n // 完全支持滚动 | 完全不支持滚动 | 支持x方向的滚动 | 支持y方向的滚动\n overflow: 'scroll' | 'hidden' | 'scroll-x' | 'scroll-y';\n };\n\nexport interface IGraphicJson<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> {\n attribute: Partial<T>;\n _uid: number;\n type: string;\n name: string;\n children: IGraphicJson<T>[];\n}\n\n/** the context of setAttribute */\nexport type ISetAttributeContext = {\n /** type of setAttribute */\n type?: number;\n animationState?: {\n step?: IStep;\n isFirstFrameOfStep?: boolean;\n /** ratio of animation */\n ratio?: number;\n /** is animation end? */\n end?: boolean;\n };\n skipUpdateCallback?: boolean;\n};\n\nexport type IGraphicAnimateParams = {\n id?: number | string;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n};\n\nexport interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends INode,\n IAnimateTarget {\n type?: GraphicType;\n numberType?: number;\n stage?: IStage;\n layer?: ILayer;\n shadowRoot?: IShadowRoot;\n glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n backgroundImg?: boolean;\n attachedThemeGraphic?: IGraphic<any>;\n\n bindDom?: Map<\n string | HTMLElement,\n { container: HTMLElement | string; dom: HTMLElement | any; wrapGroup: HTMLDivElement | any; root?: any }\n >;\n\n valid: boolean;\n parent: IGroup | null;\n isContainer?: boolean;\n // 是否是3d模式(是否应用3d视角)\n in3dMode?: boolean;\n\n // 上次更新的stamp\n stamp?: number;\n animationBackUps?: {\n from: Record<string, any>;\n to: Record<string, any>;\n };\n\n attribute: Partial<T>;\n\n /** 用于实现morph动画场景,转换成bezier曲线渲染 */\n pathProxy?: ICustomPath2D | ((attrs: T) => ICustomPath2D);\n incremental?: number;\n incrementalAt?: number;\n\n /** 记录state对应的图形属性 */\n states?: Record<string, Partial<T>>;\n normalAttrs?: Partial<T>;\n stateProxy?: (stateName: string, targetStates?: string[]) => Partial<T>;\n findFace?: () => IFace3d;\n toggleState: (stateName: string, hasAnimation?: boolean) => void;\n removeState: (stateName: string, hasAnimation?: boolean) => void;\n clearStates: (hasAnimation?: boolean) => void;\n useStates: (states: string[], hasAnimation?: boolean) => void;\n addState: (stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) => void;\n hasState: (stateName?: string) => boolean;\n getState: (stateName: string) => Partial<T>;\n onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n applyStateAttrs: (attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean) => void;\n updateNormalAttrs: (stateAttrs: Partial<T>) => void;\n\n // get\n readonly AABBBounds: IAABBBounds; // 用于获取当前节点的AABB包围盒\n // readonly OBBBounds: IOBBBounds; // 获取OBB包围盒,旋转防重叠需要用\n readonly globalAABBBounds: IAABBBounds; // 全局AABB包围盒\n readonly transMatrix: IMatrix; // 变换矩阵,动态计算\n readonly globalTransMatrix: IMatrix; // 变换矩阵,动态计算\n\n getOffsetXY: (attr?: ITransform) => IPoint;\n\n // function\n containsPoint: (x: number, y: number, mode?: IContainPointMode, picker?: IPickerService) => boolean;\n\n setMode: (mode: '3d' | '2d') => void;\n isValid: () => boolean;\n\n // TODO: transform API\n // 基于当前transform的变换,普通用户尽量别用,拿捏不住的~\n translate: (x: number, y: number) => this;\n translateTo: (x: number, y: number) => this;\n scale: (scaleX: number, scaleY: number, scaleCenter?: IPointLike) => this;\n scaleTo: (scaleX: number, scaleY: number) => this;\n rotate: (angle: number, rotateCenter?: IPointLike) => this;\n rotateTo: (angle: number) => this;\n skewTo: (b: number, c: number) => this;\n addUpdateBoundTag: () => void;\n addUpdateShapeAndBoundsTag: () => void;\n addUpdateLayoutTag: () => void;\n\n update: (d?: { bounds: boolean; trans: boolean }) => void;\n\n // animate\n animate: (params?: IGraphicAnimateParams) => IAnimate;\n\n // 语法糖,可有可无,有的为了首屏性能考虑做成get方法,有的由外界直接托管,内部不赋值\n name?: string;\n\n // 供render处理shape缓存tag\n shouldUpdateShape: () => boolean;\n clearUpdateShapeTag: () => void;\n\n // // 供render缓存shape\n // cacheShape?: ICustomPath2D;\n // // 线段使用的path2D\n // cacheLine?: ISegPath2D | ISegPath2D[];\n // // 面积图使用的path2D\n // cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n\n setAttributes: (params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n initAttributes: (params: Partial<T>) => void;\n\n setAttribute: (key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n setStage: (stage?: IStage, layer?: ILayer) => void;\n onSetStage: (cb: (g: IGraphic, stage: IStage) => void) => void;\n\n shouldUpdateAABBBounds: () => boolean;\n shouldSelfChangeUpdateAABBBounds: () => boolean;\n shouldUpdateGlobalMatrix: () => boolean;\n\n addUpdatePositionTag: () => void;\n addUpdateGlobalPositionTag: () => void;\n\n attachShadow: () => IShadowRoot;\n detachShadow: () => void;\n\n toJson: () => IGraphicJson;\n\n /** 创建pathProxy */\n createPathProxy: (path?: string) => void;\n /** 将图形转换成CustomPath2D */\n toCustomPath?: () => ICustomPath2D;\n\n resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n imageLoadSuccess: (url: string, data: HTMLImageElement) => void;\n imageLoadFail: (url: string) => void;\n\n clone: () => IGraphic;\n stopAnimates: (stopChildren?: boolean) => void;\n getNoWorkAnimateAttr: () => Record<string, number>;\n}\n\nexport interface IRoot extends IGraphic {\n pick: (x: number, y: number) => IGraphic;\n}\n\n/**\n * 动画配置\n */\nexport type IAnimateConfig = {\n duration?: number;\n easing?: EasingType;\n};\n\nexport type GraphicReleaseStatus = 'released' | 'willRelease';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/interface/graphic.ts"],"names":[],"mappings":"","file":"graphic.js","sourcesContent":["import type { IAABBBounds, IMatrix, IPointLike, IPoint, BoundsAnchorType } from '@visactor/vutils';\nimport type { IAnimate, IStep, EasingType, IAnimateTarget } from './animate';\nimport type { IColor } from './color';\nimport type { IGroup } from './graphic/group';\nimport type { IShadowRoot } from './graphic/shadow-root';\nimport type { ILayer } from './layer';\nimport type { INode } from './node-tree';\nimport type { ICustomPath2D } from './path';\nimport type { IStage } from './stage';\nimport type { IGlyphGraphicAttribute } from './graphic/glyph';\nimport type { IContainPointMode } from '../common/enums';\nimport type { IFace3d } from './graphic/face3d';\nimport type { IPickerService } from './picker';\n\ntype IStrokeSeg = {\n start: number; // 百分比\n // end和length二选一\n end: number; // 百分比\n length: number; // 像素长度\n};\n\n// TODO 最后加一个any\nexport type GraphicType =\n | 'area'\n | 'circle'\n | 'ellipse'\n | 'line'\n | 'rect'\n | 'rect3d'\n | 'path'\n | 'richtext'\n | 'text'\n | 'arc'\n | 'arc3d'\n | 'image'\n | 'symbol'\n | 'group'\n | 'shadowroot'\n | 'polygon'\n | 'pyramid3d'\n | 'glyph';\n\n// Cursor style\n// See: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'all-scroll'\n | 'col-resize'\n | 'row-resize'\n | 'n-resize'\n | 'e-resize'\n | 's-resize'\n | 'w-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'zoom-in'\n | 'zoom-out';\n\nexport type ITransform = {\n x: number;\n y: number;\n z: number;\n dx: number;\n dy: number;\n dz: number;\n scrollX: number;\n scrollY: number;\n scaleX: number;\n scaleY: number;\n scaleZ: number;\n angle: number;\n alpha: number;\n beta: number;\n scaleCenter: [number | string, number | string];\n anchor: [number | string, number | string]; // 基于AABB的锚点位置,用于简单的定位某些path\n anchor3d: [number | string, number | string, number] | [number | string, number | string]; // 3d的锚点位置\n postMatrix: IMatrix;\n};\n\nexport type IFillType = boolean | string | IColor;\nexport type IFillStyle = {\n fillOpacity: number;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n fill: IFillType;\n};\n\nexport type ILayout = {\n alignSelf: 'auto' | 'flex-start' | 'flex-end' | 'center';\n};\n\nexport type IBorderStyle = Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> & {\n distance: number | string;\n visible?: boolean;\n};\n\nexport type IStrokeType = boolean | string | IColor | null;\nexport type IStrokeStyle = {\n outerBorder: Partial<IBorderStyle>;\n innerBorder: Partial<IBorderStyle>;\n strokeOpacity: number;\n lineDash: number[];\n lineDashOffset: number;\n lineWidth: number;\n lineCap: CanvasLineCap;\n lineJoin: CanvasLineJoin;\n miterLimit: number;\n // 描边的boundsBuffer,用于控制bounds的buffer\n strokeBoundsBuffer: number;\n /**\n * stroke - true 全描边\n * stroke - false 不描边\n * stroke 为数值类型,适用于rect\\arc等图形,用于配置部分描边的场景,其中\n *\n * 0b00000 - 不描边\n * 0b000001 - top\n * 0b000010 - right\n * 0b000100 - bottom\n * 0b001000 - left\n * 相应的:\n * 0b000011 - top + right\n * 0b000111 - top + right + bottom\n * 0b001111 - 全描边\n *\n * stroke - boolean[],适用于rect\\arc等图形,用于配置部分描边的场景\n */\n stroke: IStrokeType[] | IStrokeType;\n};\n\ntype TextureType = 'circle' | 'diamond' | 'rect' | 'vertical-line' | 'horizontal-line' | 'bias-lr' | 'bias-rl' | 'grid';\n\nexport type IConnectedStyle = {\n // 连接,取零或者断开\n connectedType: 'connect' | 'zero' | 'none';\n connectedStyle: {\n stroke: IStrokeStyle['stroke'];\n strokeOpacity: IStrokeStyle['strokeOpacity'];\n lineDash: IStrokeStyle['lineDash'];\n lineDashOffset: IStrokeStyle['lineDashOffset'];\n lineCap: IStrokeStyle['lineCap'];\n lineJoin: IStrokeStyle['lineJoin'];\n lineWidth: IStrokeStyle['lineWidth'];\n fill: IFillStyle['fill'];\n fillOpacity: IFillStyle['fillOpacity'];\n };\n connectedX: number;\n connectedY: number;\n};\n\nexport type IBackgroundConfig = {\n stroke?: string | boolean;\n fill?: string | boolean;\n lineWidth?: number;\n cornerRadius?: number;\n expandX?: number;\n expandY?: number;\n};\n\ntype IBackgroundType = string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig;\n\nexport interface SimpleDomStyleOptions {\n width: number; // 容器的宽度\n height: number; // 容器的高度\n style?:\n | string\n | Record<string, any>\n | ((\n pos: { top: number; left: number; width: number; height: number },\n graphic: IGraphic,\n wrapContainer: HTMLElement\n ) => Record<string, any>); // 容器的样式\n}\n\nexport interface CommonDomOptions {\n id?: string;\n container: string | HTMLElement | null; // id或者dom\n visible?: boolean;\n pointerEvents?: boolean | string;\n anchorType?: 'position' | 'boundsLeftTop' | BoundsAnchorType;\n}\n\nexport type IGraphicStyle = ILayout &\n IFillStyle &\n IStrokeStyle &\n IPickStyle & {\n forceBoundsWidth: number | (() => number) | undefined;\n forceBoundsHeight: number | (() => number) | undefined;\n opacity: number;\n shadowGraphic?: IGraphic | undefined;\n backgroundMode: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat'; // 填充模式(与具体图元有关)\n backgroundFit: boolean; // 是否正好填充,只在repeat-x或者repeat-y以及no-repeat的时候生效\n backgroundCornerRadius: number | number[];\n backgroundOpacity: number;\n background:\n | IBackgroundType\n | {\n background: IBackgroundType;\n dx?: number;\n dy?: number;\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n }\n | null; // 背景,可以与fill同时存在\n texture: TextureType | string; // 纹理\n textureColor: string; // 纹理颜色\n textureSize: number; // 纹理大小\n texturePadding: number; // 纹理间隙\n blur: number;\n cursor: Cursor | null; // 鼠标样式\n renderStyle?: 'default' | 'rough' | any;\n // HTML的dom或者string\n html:\n | ({\n dom: string | HTMLElement; // dom字符串或者dom\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n react:\n | ({\n element: any; // react场景节点\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n };\n\nexport type IPickStyle = {\n // 给stroke模式的pick额外加的buffer,用于外界控制stroke区域的pick范围\n pickStrokeBuffer: number;\n};\n\nexport type IDebugType = {\n _debug_bounds: boolean | ((c: any, g: any) => void);\n};\nexport type IGraphicAttribute = IDebugType &\n IGraphicStyle &\n ITransform & {\n /**\n * stroke百分比\n */\n strokeSeg: IStrokeSeg | null;\n // 包围盒的padding\n boundsPadding: number | number[];\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode: 'accurate' | 'imprecise' | 'custom';\n boundsMode: 'accurate' | 'imprecise';\n customPickShape: () => boolean | null;\n /**\n * 是否支持事件拾取,默认为 true。\n * @default true\n */\n pickable: boolean;\n /**\n * 是否支持fill拾取,默认为 true。\n * @experimental\n * @default true\n */\n fillPickable: boolean;\n /**\n * 是否支持stroke拾取,默认为 true。\n * @experimental\n * @default true\n */\n strokePickable: boolean;\n /**\n * 对于 group 节点,是否支持其子元素的事件拾取,默认为 true。\n * 如果 group `pickable` 关闭,`childrenPickable` 开启,那么 group 的子节点仍参与事件拾取\n * @default true\n */\n childrenPickable: boolean;\n /**\n * 元素是否可见。\n * @default true\n */\n visible: boolean;\n zIndex: number;\n layout: any;\n /**\n * 是否隐藏元素(只是绘制的时候不绘制)\n */\n renderable: boolean;\n /**\n * 是否在3d中控制方向\n * false: 不控制方向\n * true: 始终控制方向朝摄像机\n */\n keepDirIn3d?: boolean;\n shadowRootIdx: number;\n shadowPickMode?: 'full' | 'graphic';\n globalZIndex: number;\n globalCompositeOperation: CanvasRenderingContext2D['globalCompositeOperation'] | '';\n // 完全支持滚动 | 完全不支持滚动 | 支持x方向的滚动 | 支持y方向的滚动\n overflow: 'scroll' | 'hidden' | 'scroll-x' | 'scroll-y';\n };\n\nexport interface IGraphicJson<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> {\n attribute: Partial<T>;\n _uid: number;\n type: string;\n name: string;\n children: IGraphicJson<T>[];\n}\n\n/** the context of setAttribute */\nexport type ISetAttributeContext = {\n /** type of setAttribute */\n type?: number;\n animationState?: {\n step?: IStep;\n isFirstFrameOfStep?: boolean;\n /** ratio of animation */\n ratio?: number;\n /** is animation end? */\n end?: boolean;\n };\n skipUpdateCallback?: boolean;\n};\n\nexport type IGraphicAnimateParams = {\n id?: number | string;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n};\n\nexport interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends INode,\n IAnimateTarget {\n type?: GraphicType;\n numberType?: number;\n stage?: IStage;\n layer?: ILayer;\n shadowRoot?: IShadowRoot;\n glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n backgroundImg?: boolean;\n attachedThemeGraphic?: IGraphic<any>;\n\n bindDom?: Map<\n string | HTMLElement,\n { container: HTMLElement | string; dom: HTMLElement | any; wrapGroup: HTMLDivElement | any; root?: any }\n >;\n\n valid: boolean;\n parent: IGroup | null;\n isContainer?: boolean;\n // 是否是3d模式(是否应用3d视角)\n in3dMode?: boolean;\n\n // 上次更新的stamp\n stamp?: number;\n animationBackUps?: {\n from: Record<string, any>;\n to: Record<string, any>;\n };\n\n attribute: Partial<T>;\n\n /** 用于实现morph动画场景,转换成bezier曲线渲染 */\n pathProxy?: ICustomPath2D | ((attrs: T) => ICustomPath2D);\n incremental?: number;\n incrementalAt?: number;\n\n /** 记录state对应的图形属性 */\n states?: Record<string, Partial<T>>;\n normalAttrs?: Partial<T>;\n stateProxy?: (stateName: string, targetStates?: string[]) => Partial<T>;\n findFace?: () => IFace3d;\n toggleState: (stateName: string, hasAnimation?: boolean) => void;\n removeState: (stateName: string, hasAnimation?: boolean) => void;\n clearStates: (hasAnimation?: boolean) => void;\n useStates: (states: string[], hasAnimation?: boolean) => void;\n addState: (stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) => void;\n hasState: (stateName?: string) => boolean;\n getState: (stateName: string) => Partial<T>;\n onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n applyStateAttrs: (attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean) => void;\n updateNormalAttrs: (stateAttrs: Partial<T>) => void;\n\n // get\n readonly AABBBounds: IAABBBounds; // 用于获取当前节点的AABB包围盒\n // readonly OBBBounds: IOBBBounds; // 获取OBB包围盒,旋转防重叠需要用\n readonly globalAABBBounds: IAABBBounds; // 全局AABB包围盒\n readonly transMatrix: IMatrix; // 变换矩阵,动态计算\n readonly globalTransMatrix: IMatrix; // 变换矩阵,动态计算\n\n getOffsetXY: (attr?: ITransform) => IPoint;\n\n // function\n containsPoint: (x: number, y: number, mode?: IContainPointMode, picker?: IPickerService) => boolean;\n\n setMode: (mode: '3d' | '2d') => void;\n isValid: () => boolean;\n\n // TODO: transform API\n // 基于当前transform的变换,普通用户尽量别用,拿捏不住的~\n translate: (x: number, y: number) => this;\n translateTo: (x: number, y: number) => this;\n scale: (scaleX: number, scaleY: number, scaleCenter?: IPointLike) => this;\n scaleTo: (scaleX: number, scaleY: number) => this;\n rotate: (angle: number, rotateCenter?: IPointLike) => this;\n rotateTo: (angle: number) => this;\n skewTo: (b: number, c: number) => this;\n addUpdateBoundTag: () => void;\n addUpdateShapeAndBoundsTag: () => void;\n addUpdateLayoutTag: () => void;\n\n update: (d?: { bounds: boolean; trans: boolean }) => void;\n\n // animate\n animate: (params?: IGraphicAnimateParams) => IAnimate;\n\n // 语法糖,可有可无,有的为了首屏性能考虑做成get方法,有的由外界直接托管,内部不赋值\n name?: string;\n\n // 供render处理shape缓存tag\n shouldUpdateShape: () => boolean;\n clearUpdateShapeTag: () => void;\n\n // // 供render缓存shape\n // cacheShape?: ICustomPath2D;\n // // 线段使用的path2D\n // cacheLine?: ISegPath2D | ISegPath2D[];\n // // 面积图使用的path2D\n // cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n\n setAttributes: (params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n initAttributes: (params: Partial<T>) => void;\n\n setAttribute: (key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n setStage: (stage?: IStage, layer?: ILayer) => void;\n onSetStage: (cb: (g: IGraphic, stage: IStage) => void) => void;\n\n shouldUpdateAABBBounds: () => boolean;\n shouldSelfChangeUpdateAABBBounds: () => boolean;\n shouldUpdateGlobalMatrix: () => boolean;\n\n addUpdatePositionTag: () => void;\n addUpdateGlobalPositionTag: () => void;\n\n attachShadow: () => IShadowRoot;\n detachShadow: () => void;\n\n toJson: () => IGraphicJson;\n\n /** 创建pathProxy */\n createPathProxy: (path?: string) => void;\n /** 将图形转换成CustomPath2D */\n toCustomPath?: () => ICustomPath2D;\n\n resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n imageLoadSuccess: (url: string, data: HTMLImageElement) => void;\n imageLoadFail: (url: string) => void;\n\n clone: () => IGraphic;\n stopAnimates: (stopChildren?: boolean) => void;\n getNoWorkAnimateAttr: () => Record<string, number>;\n getGraphicTheme: () => T;\n}\n\nexport interface IRoot extends IGraphic {\n pick: (x: number, y: number) => IGraphic;\n}\n\n/**\n * 动画配置\n */\nexport type IAnimateConfig = {\n duration?: number;\n easing?: EasingType;\n};\n\nexport type GraphicReleaseStatus = 'released' | 'willRelease';\n"]}
|
|
@@ -12,6 +12,8 @@ import { matrixAllocate } from "../allocator/matrix-allocate";
|
|
|
12
12
|
|
|
13
13
|
import { draw3dItem } from "../common/3d-interceptor";
|
|
14
14
|
|
|
15
|
+
import { getTheme } from "../graphic";
|
|
16
|
+
|
|
15
17
|
export const PickItemInterceptor = Symbol.for("PickItemInterceptor");
|
|
16
18
|
|
|
17
19
|
let ShadowRootPickItemInterceptorContribution = class {
|
|
@@ -25,13 +27,15 @@ let ShadowRootPickItemInterceptorContribution = class {
|
|
|
25
27
|
return graphic.attribute.shadowRootIdx < 0 ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
|
|
26
28
|
}
|
|
27
29
|
_pickItem(graphic, pickerService, point, pickParams, params) {
|
|
30
|
+
var _a;
|
|
28
31
|
if (!graphic.shadowRoot) return null;
|
|
29
32
|
const {parentMatrix: parentMatrix} = params || {};
|
|
30
33
|
if (!parentMatrix) return null;
|
|
31
34
|
const context = pickerService.pickContext;
|
|
32
35
|
context.highPerformanceSave();
|
|
33
|
-
const g = graphic.shadowRoot, currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix), newPoint = new Point(currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e, currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f), result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);
|
|
34
|
-
return context.highPerformanceRestore(), result
|
|
36
|
+
const theme = null === (_a = getTheme(graphic)) || void 0 === _a ? void 0 : _a[graphic.type], {shadowPickMode: shadowPickMode = (null == theme ? void 0 : theme.shadowPickMode)} = graphic.attribute, g = graphic.shadowRoot, currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix), newPoint = new Point(currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e, currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f), result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);
|
|
37
|
+
return context.highPerformanceRestore(), !result.graphic && result.group && "full" === shadowPickMode && (result.graphic = result.group),
|
|
38
|
+
result;
|
|
35
39
|
}
|
|
36
40
|
};
|
|
37
41
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/picker/pick-interceptor.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAUtD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/picker/pick-interceptor.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AA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AK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,CAAC,OAAO,IAAI,KAAK,CAAC,EAAE;YACvB,OAAO,IAAI,CAAC;SACb;QACD,UAAU,CAAC,eAAe,GAAG,IAAI,CAAC;QAGlC,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC5B,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAG9B,IAAI,OAAO,CAAC,WAAW,EAAE;YACvB,MAAM,MAAM,GAAG,UAAU,CACvB,OAAO,EACP,OAAO,EACP,GAAG,EAAE;gBACH,OAAO,aAAa,CAAC,SAAS,CAAC,OAAiB,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;YAC5F,CAAC,EACD,UAAU,CACX,CAAC;YAEF,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;YAEtB,UAAU,CAAC,eAAe,GAAG,KAAK,CAAC;YACnC,OAAO,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,MAAM,CAAC;SACf;QACD,OAAO,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,OAAmB;QAC/B,OAAO,CAAC,sBAAsB,EAAE,CAAC;IACnC,CAAC;CACF,CAAA;AArDY,2BAA2B;IADvC,UAAU,EAAE;GACA,2BAA2B,CAqDvC;SArDY,2BAA2B","file":"pick-interceptor.js","sourcesContent":["import type { IMatrix, IPointLike } from '@visactor/vutils';\nimport { Point } from '@visactor/vutils';\nimport { injectable } from '../common/inversify-lite';\nimport type {\n IContext2d,\n IGraphic,\n IGroup,\n IPickItemInterceptorContribution,\n IPickParams,\n IPickerService,\n PickResult\n} from '../interface';\nimport { matrixAllocate } from '../allocator/matrix-allocate';\nimport { draw3dItem } from '../common/3d-interceptor';\nimport { getTheme } from '../graphic';\n\n// 拦截器\nexport const PickItemInterceptor = Symbol.for('PickItemInterceptor');\n\n/**\n * 影子节点拦截器,用于渲染影子节点\n */\n@injectable()\nexport class ShadowRootPickItemInterceptorContribution implements IPickItemInterceptorContribution {\n order: number = 1;\n afterPickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): null | PickResult {\n if (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) {\n return this._pickItem(graphic, pickerService, point, pickParams, params);\n }\n return null;\n }\n\n beforePickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): null | PickResult {\n if (graphic.attribute.shadowRootIdx < 0) {\n return this._pickItem(graphic, pickerService, point, pickParams, params);\n }\n return null;\n }\n\n protected _pickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): PickResult | null {\n if (!graphic.shadowRoot) {\n return null;\n }\n const { parentMatrix } = params || {};\n if (!parentMatrix) {\n return null;\n }\n\n const context = pickerService.pickContext;\n context.highPerformanceSave();\n\n const theme = (getTheme(graphic) as any)?.[graphic.type];\n const { shadowPickMode = theme?.shadowPickMode } = graphic.attribute;\n const g = graphic.shadowRoot;\n const currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix);\n const newPoint = new Point(\n currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e,\n currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f\n );\n // const transMatrix = graphic.transMatrix;\n // currentGroupMatrix.multiply(\n // transMatrix.a,\n // transMatrix.b,\n // transMatrix.c,\n // transMatrix.d,\n // transMatrix.e,\n // transMatrix.f\n // );\n\n // currentGroupMatrix.transformPoint(newPoint, newPoint);\n const result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);\n\n context.highPerformanceRestore();\n\n // 影子节点pick到group也算pick到graphic\n if (!result.graphic && result.group && shadowPickMode === 'full') {\n result.graphic = result.group;\n }\n\n return result;\n }\n}\n\n@injectable()\nexport class InteractivePickItemInterceptorContribution implements IPickItemInterceptorContribution {\n order: number = 1;\n\n beforePickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): null | PickResult {\n const originGraphic = graphic.baseGraphic;\n if (originGraphic && originGraphic.parent) {\n const newPoint = new Point(point.x, point.y);\n const context = pickerService.pickContext;\n context.highPerformanceSave();\n const parentMatrix = originGraphic.parent.globalTransMatrix;\n parentMatrix.transformPoint(newPoint, newPoint);\n\n const result = originGraphic.isContainer\n ? pickerService.pickGroup(originGraphic, newPoint.clone(), parentMatrix, pickParams)\n : pickerService.pickItem(originGraphic, newPoint.clone(), parentMatrix, pickParams);\n context.highPerformanceRestore();\n return result;\n }\n return null;\n }\n}\n\n/**\n * 3d拦截器,用于渲染3d视角\n */\n@injectable()\nexport class Canvas3DPickItemInterceptor implements IPickItemInterceptorContribution {\n // canvas?: ICanvas;\n order: number = 1;\n\n beforePickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ) {\n if (!graphic.in3dMode || pickParams.in3dInterceptor) {\n return null;\n }\n\n const context = pickerService.pickContext;\n const stage = graphic.stage;\n if (!(context && stage)) {\n return null;\n }\n pickParams.in3dInterceptor = true;\n\n // 使用3d模式渲染\n context.save();\n this.initCanvasCtx(context);\n context.camera = stage.camera;\n\n // 设置context的transform到上一个节点\n if (graphic.isContainer) {\n const result = draw3dItem(\n context,\n graphic,\n () => {\n return pickerService.pickGroup(graphic as IGroup, point, params.parentMatrix, pickParams);\n },\n pickParams\n );\n\n context.camera = null;\n\n pickParams.in3dInterceptor = false;\n context.restore();\n return result;\n }\n context.restore();\n return null;\n }\n\n initCanvasCtx(context: IContext2d) {\n context.setTransformForCurrent();\n }\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Generator } from "../../common/generator";
|
|
2
2
|
|
|
3
|
+
import { Factory } from "../../factory";
|
|
4
|
+
|
|
3
5
|
export class ViewTransform3dPlugin {
|
|
4
6
|
constructor() {
|
|
5
7
|
this.name = "ViewTransform3dPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(),
|
|
@@ -33,4 +35,8 @@ export class ViewTransform3dPlugin {
|
|
|
33
35
|
stage.removeEventListener("mousemove", this.onMouseMove);
|
|
34
36
|
}
|
|
35
37
|
}
|
|
38
|
+
|
|
39
|
+
export const registerViewTransform3dPlugin = () => {
|
|
40
|
+
Factory.registerPlugin("ViewTransform3dPlugin", ViewTransform3dPlugin);
|
|
41
|
+
};
|
|
36
42
|
//# sourceMappingURL=3dview-transform-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/builtin-plugin/3dview-transform-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/plugins/builtin-plugin/3dview-transform-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,OAAO,qBAAqB;IAAlC;QACE,SAAI,GAA4B,uBAAuB,CAAC;QACxD,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAMpC,gBAAW,GAAG,CAAC,CAAmB,EAAE,EAAE;YACpC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClB,IAAI,CAAC,QAAQ,GAAG,IAAI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CAAC,WAAW,CAAC,CAAC;QACzD,KAAK,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACrD,KAAK,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC;CACF;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAChD,OAAO,CAAC,cAAc,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,CAAC;AACzE,CAAC,CAAC","file":"3dview-transform-plugin.js","sourcesContent":["import type { IOption3D, IPlugin, IPluginService } from '../../interface';\nimport { Generator } from '../../common/generator';\nimport { Factory } from '../../factory';\n\nexport class ViewTransform3dPlugin implements IPlugin {\n name: 'ViewTransform3dPlugin' = 'ViewTransform3dPlugin';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n mousedown?: boolean;\n pageX?: number;\n pageY?: number;\n option3d?: IOption3D;\n\n onMouseDown = (e: MouseEvent | any) => {\n if (!this.option3d) {\n this.option3d = this.pluginService.stage.option3d;\n }\n if (!this.option3d) {\n return;\n }\n this.mousedown = true;\n this.pageX = e.page.x;\n this.pageY = e.page.y;\n };\n onMouseUp = (e: MouseEvent | any) => {\n if (!this.option3d) {\n this.option3d = this.pluginService.stage.option3d;\n }\n if (!this.option3d) {\n return;\n }\n this.mousedown = false;\n };\n onMouseMove = (e: MouseEvent | any) => {\n const stage = this.pluginService.stage;\n if (!this.option3d) {\n this.option3d = stage.option3d;\n }\n if (!this.option3d) {\n return;\n }\n if (this.mousedown) {\n if (!this.pageX || !this.pageY) {\n this.pageX = e.page.x;\n this.pageY = e.page.y;\n } else {\n const deltaX = e.page.x - this.pageX;\n const deltaY = e.page.y - this.pageY;\n this.pageX = e.page.x;\n this.pageY = e.page.y;\n\n const angle1 = deltaX / 100;\n const angle2 = deltaY / 100;\n this.option3d.alpha = (this.option3d.alpha ?? 0) + angle1;\n this.option3d.beta = (this.option3d.beta ?? 0) + angle2;\n stage.set3dOptions(this.option3d);\n stage.renderNextFrame();\n }\n }\n };\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const stage = context.stage;\n this.option3d = stage.option3d;\n stage.addEventListener('mousedown', this.onMouseDown);\n stage.addEventListener('mouseup', this.onMouseUp);\n stage.addEventListener('mousemove', this.onMouseMove);\n }\n deactivate(context: IPluginService): void {\n const stage = context.stage;\n stage.removeEventListener('mousedown', this.onMouseDown);\n stage.removeEventListener('mouseup', this.onMouseUp);\n stage.removeEventListener('mousemove', this.onMouseMove);\n }\n}\n\nexport const registerViewTransform3dPlugin = () => {\n Factory.registerPlugin('ViewTransform3dPlugin', ViewTransform3dPlugin);\n};\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { IPlugin, IPluginService } from '../../interface';
|
|
1
|
+
import type { IGraphic, IPlugin, IPluginService } from '../../interface';
|
|
2
2
|
export declare class AutoRenderPlugin implements IPlugin {
|
|
3
3
|
name: 'AutoRenderPlugin';
|
|
4
4
|
activeEvent: 'onRegister';
|
|
5
5
|
pluginService: IPluginService;
|
|
6
6
|
_uid: number;
|
|
7
7
|
key: string;
|
|
8
|
+
handleChange: (graphic: IGraphic) => void;
|
|
8
9
|
activate(context: IPluginService): void;
|
|
9
10
|
deactivate(context: IPluginService): void;
|
|
10
11
|
}
|
|
@@ -5,18 +5,19 @@ import { application } from "../../application";
|
|
|
5
5
|
export class AutoRenderPlugin {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.name = "AutoRenderPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(),
|
|
8
|
-
this.key = this.name + this._uid
|
|
8
|
+
this.key = this.name + this._uid, this.handleChange = graphic => {
|
|
9
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage === this.pluginService.stage && null != graphic.stage && graphic.stage.renderNextFrame();
|
|
10
|
+
};
|
|
9
11
|
}
|
|
10
12
|
activate(context) {
|
|
11
|
-
this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key,
|
|
12
|
-
|
|
13
|
-
})), application.graphicService.hooks.onSetStage.tap(this.key, (graphic => {
|
|
14
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage === context.stage && null != graphic.stage && graphic.stage.renderNextFrame();
|
|
15
|
-
}));
|
|
13
|
+
this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handleChange),
|
|
14
|
+
application.graphicService.hooks.onSetStage.tap(this.key, this.handleChange), application.graphicService.hooks.onRemove.tap(this.key, this.handleChange);
|
|
16
15
|
}
|
|
17
16
|
deactivate(context) {
|
|
18
|
-
|
|
19
|
-
application.graphicService.hooks.
|
|
17
|
+
const filterByName = taps => taps.filter((item => item.name !== this.key));
|
|
18
|
+
application.graphicService.hooks.onAttributeUpdate.taps = filterByName(application.graphicService.hooks.onAttributeUpdate.taps),
|
|
19
|
+
application.graphicService.hooks.onSetStage.taps = filterByName(application.graphicService.hooks.onSetStage.taps),
|
|
20
|
+
application.graphicService.hooks.onRemove.taps = filterByName(application.graphicService.hooks.onRemove.taps);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
//# sourceMappingURL=auto-render-plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugins/builtin-plugin/auto-render-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,OAAO,gBAAgB;IAA7B;QACE,SAAI,GAAuB,kBAAkB,CAAC;QAC9C,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"sources":["../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I,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;gBACxB,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC;YAChC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,GAAG,YAAY,CACpE,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CACxD,CAAC;QACF,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAClH,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChH,CAAC;CACF","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"]}
|
|
@@ -6,6 +6,8 @@ import { AABBBounds } from "@visactor/vutils";
|
|
|
6
6
|
|
|
7
7
|
import { application } from "../../application";
|
|
8
8
|
|
|
9
|
+
import { Factory } from "../../factory";
|
|
10
|
+
|
|
9
11
|
const _tempBounds = new AABBBounds;
|
|
10
12
|
|
|
11
13
|
export class FlexLayoutPlugin {
|
|
@@ -249,4 +251,8 @@ export class FlexLayoutPlugin {
|
|
|
249
251
|
function getPadding(graphic, field) {
|
|
250
252
|
return 0;
|
|
251
253
|
}
|
|
254
|
+
|
|
255
|
+
export const registerFlexLayoutPlugin = () => {
|
|
256
|
+
Factory.registerPlugin("FlexLayoutPlugin", FlexLayoutPlugin);
|
|
257
|
+
};
|
|
252
258
|
//# sourceMappingURL=flex-layout-plugin.js.map
|