@visactor/vrender-core 0.19.4-alpha.4 → 0.19.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/allocator/allocator-modules.js +0 -2
- package/cjs/allocator/bounds-allocate.js +1 -1
- package/cjs/allocator/bounds-allocate.js.map +1 -1
- package/cjs/allocator/canvas-allocate.js +11 -9
- package/cjs/allocator/canvas-allocate.js.map +1 -1
- package/cjs/allocator/graphic-allocate.js +5 -9
- package/cjs/allocator/graphic-allocate.js.map +1 -1
- package/cjs/allocator/matrix-allocate.js +2 -6
- package/cjs/allocator/matrix-allocate.js.map +1 -1
- package/cjs/animate/Ticker/default-ticker.js +25 -14
- package/cjs/animate/Ticker/default-ticker.js.map +1 -1
- package/cjs/animate/animate.js +8 -7
- package/cjs/animate/animate.js.map +1 -1
- package/cjs/animate/config.js +1 -2
- package/cjs/animate/custom-animate.js +54 -51
- package/cjs/animate/custom-animate.js.map +1 -1
- package/cjs/animate/easing.js +19 -8
- package/cjs/animate/easing.js.map +1 -1
- package/cjs/animate/morphing.js +20 -23
- package/cjs/animate/morphing.js.map +1 -1
- package/cjs/application.js +7 -1
- package/cjs/application.js.map +1 -1
- package/cjs/canvas/conical-gradient.js +12 -5
- package/cjs/canvas/conical-gradient.js.map +1 -1
- package/cjs/canvas/contributions/base-canvas.js +19 -7
- package/cjs/canvas/contributions/base-canvas.js.map +1 -1
- package/cjs/color-string/interpolate.js +5 -3
- package/cjs/color-string/interpolate.js.map +1 -1
- package/cjs/color-string/store.js +3 -1
- package/cjs/color-string/store.js.map +1 -1
- package/cjs/common/bounds-context.js +1 -0
- package/cjs/common/bounds-context.js.map +1 -1
- package/cjs/common/canvas-utils.js +3 -6
- package/cjs/common/canvas-utils.js.map +1 -1
- package/cjs/common/contribution-provider.js +3 -0
- package/cjs/common/contribution-provider.js.map +1 -1
- package/cjs/common/custom-path2d.js +7 -1
- package/cjs/common/custom-path2d.js.map +1 -1
- package/cjs/common/generator.js +2 -1
- package/cjs/common/generator.js.map +1 -1
- package/cjs/common/inversify/binding.js +12 -0
- package/cjs/common/inversify/binding.js.map +1 -1
- package/cjs/common/inversify/container.js +4 -0
- package/cjs/common/inversify/container.js.map +1 -1
- package/cjs/common/inversify/cotainer-module.js +2 -0
- package/cjs/common/inversify/cotainer-module.js.map +1 -1
- package/cjs/common/inversify/meta-data.js +2 -0
- package/cjs/common/inversify/meta-data.js.map +1 -1
- package/cjs/common/inversify/syntax/binding_in_syntax.js +1 -0
- package/cjs/common/inversify/syntax/binding_in_syntax.js.map +1 -1
- package/cjs/common/inversify/syntax/binding_to_syntax.js +1 -0
- package/cjs/common/inversify/syntax/binding_to_syntax.js.map +1 -1
- package/cjs/common/inversify-lite/annotation/lazy_service_identifier.js +1 -0
- package/cjs/common/inversify-lite/annotation/lazy_service_identifier.js.map +1 -1
- package/cjs/common/inversify-lite/bindings/binding.js +14 -0
- package/cjs/common/inversify-lite/bindings/binding.js.map +1 -1
- package/cjs/common/inversify-lite/container/container.js +22 -46
- package/cjs/common/inversify-lite/container/container.js.map +1 -1
- package/cjs/common/inversify-lite/container/container_module.js +4 -0
- package/cjs/common/inversify-lite/container/container_module.js.map +1 -1
- package/cjs/common/inversify-lite/container/lookup.js +1 -0
- package/cjs/common/inversify-lite/container/lookup.js.map +1 -1
- package/cjs/common/inversify-lite/planning/context.js +4 -0
- package/cjs/common/inversify-lite/planning/context.js.map +1 -1
- package/cjs/common/inversify-lite/planning/metadata.js +2 -0
- package/cjs/common/inversify-lite/planning/metadata.js.map +1 -1
- package/cjs/common/inversify-lite/planning/plan.js +2 -0
- package/cjs/common/inversify-lite/planning/plan.js.map +1 -1
- package/cjs/common/inversify-lite/planning/queryable_string.js +1 -0
- package/cjs/common/inversify-lite/planning/queryable_string.js.map +1 -1
- package/cjs/common/inversify-lite/planning/request.js +8 -0
- package/cjs/common/inversify-lite/planning/request.js.map +1 -1
- package/cjs/common/inversify-lite/planning/target.js +7 -0
- package/cjs/common/inversify-lite/planning/target.js.map +1 -1
- package/cjs/common/inversify-lite/resolution/instantiation.js +16 -42
- package/cjs/common/inversify-lite/resolution/instantiation.js.map +1 -1
- package/cjs/common/inversify-lite/scope/scope.js +3 -29
- package/cjs/common/inversify-lite/scope/scope.js.map +1 -1
- package/cjs/common/inversify-lite/syntax/binding_in_syntax.js +1 -0
- package/cjs/common/inversify-lite/syntax/binding_in_syntax.js.map +1 -1
- package/cjs/common/inversify-lite/syntax/binding_in_when_on_syntax.js +3 -0
- package/cjs/common/inversify-lite/syntax/binding_in_when_on_syntax.js.map +1 -1
- package/cjs/common/inversify-lite/syntax/binding_on_syntax.js +1 -0
- package/cjs/common/inversify-lite/syntax/binding_on_syntax.js.map +1 -1
- package/cjs/common/inversify-lite/syntax/binding_to_syntax.js +1 -0
- package/cjs/common/inversify-lite/syntax/binding_to_syntax.js.map +1 -1
- package/cjs/common/inversify-lite/syntax/binding_when_on_syntax.js +2 -0
- package/cjs/common/inversify-lite/syntax/binding_when_on_syntax.js.map +1 -1
- package/cjs/common/inversify-lite/syntax/binding_when_syntax.js +1 -0
- package/cjs/common/inversify-lite/syntax/binding_when_syntax.js.map +1 -1
- package/cjs/common/polygon.js +1 -2
- package/cjs/common/polygon.js.map +1 -1
- package/cjs/common/render-area.js +2 -3
- package/cjs/common/render-area.js.map +1 -1
- package/cjs/common/render-curve.js +4 -8
- package/cjs/common/render-curve.js.map +1 -1
- package/cjs/common/seg-context.js +12 -3
- package/cjs/common/seg-context.js.map +1 -1
- package/cjs/common/segment/basis.js +13 -0
- package/cjs/common/segment/basis.js.map +1 -1
- package/cjs/common/segment/common.js +2 -2
- package/cjs/common/segment/common.js.map +1 -1
- package/cjs/common/segment/curve/arc.js +2 -2
- package/cjs/common/segment/curve/arc.js.map +1 -1
- package/cjs/common/segment/curve/base.js +4 -0
- package/cjs/common/segment/curve/base.js.map +1 -1
- package/cjs/common/segment/curve/cubic-bezier.js +2 -2
- package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
- package/cjs/common/segment/curve/curve-context.js +4 -0
- package/cjs/common/segment/curve/curve-context.js.map +1 -1
- package/cjs/common/segment/curve/ellipse.js +3 -3
- package/cjs/common/segment/curve/ellipse.js.map +1 -1
- package/cjs/common/segment/curve/line.js +2 -1
- package/cjs/common/segment/curve/line.js.map +1 -1
- package/cjs/common/segment/curve/move.js +2 -1
- package/cjs/common/segment/curve/move.js.map +1 -1
- package/cjs/common/segment/curve/path.js +2 -0
- package/cjs/common/segment/curve/path.js.map +1 -1
- package/cjs/common/segment/curve/quadratic-bezier.js +2 -2
- package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
- package/cjs/common/segment/linear-closed.js.map +1 -1
- package/cjs/common/segment/linear.js +10 -0
- package/cjs/common/segment/linear.js.map +1 -1
- package/cjs/common/segment/monotone.js +13 -0
- package/cjs/common/segment/monotone.js.map +1 -1
- package/cjs/common/segment/step.js +13 -2
- package/cjs/common/segment/step.js.map +1 -1
- package/cjs/common/sort.js +3 -34
- package/cjs/common/sort.js.map +1 -1
- package/cjs/common/split-path.js +4 -11
- package/cjs/common/split-path.js.map +1 -1
- package/cjs/common/utils.d.ts +1 -1
- package/cjs/common/utils.js +10 -6
- package/cjs/common/utils.js.map +1 -1
- package/cjs/common/xml/parser.js +3 -2
- package/cjs/common/xml/parser.js.map +1 -1
- package/cjs/core/camera.js +11 -4
- package/cjs/core/camera.js.map +1 -1
- package/cjs/core/contributions/env/base-contribution.js +6 -0
- package/cjs/core/contributions/env/base-contribution.js.map +1 -1
- package/cjs/core/contributions/layerHandler/canvas2d-contribution.js +20 -11
- package/cjs/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
- package/cjs/core/contributions/layerHandler/empty-contribution.js +8 -8
- package/cjs/core/contributions/layerHandler/empty-contribution.js.map +1 -1
- package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js +5 -6
- package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
- package/cjs/core/contributions/textMeasure/AtextMeasure.js +11 -8
- package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
- package/cjs/core/contributions/textMeasure/layout.js +3 -0
- package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
- package/cjs/core/contributions/window/base-contribution.js +2 -0
- package/cjs/core/contributions/window/base-contribution.js.map +1 -1
- package/cjs/core/global.js +8 -0
- package/cjs/core/global.js.map +1 -1
- package/cjs/core/graphic-utils.js +16 -5
- package/cjs/core/graphic-utils.js.map +1 -1
- package/cjs/core/layer-service.js +7 -7
- package/cjs/core/layer-service.js.map +1 -1
- package/cjs/core/layer.js +7 -9
- package/cjs/core/layer.js.map +1 -1
- package/cjs/core/stage.js +79 -35
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.js +16 -13
- package/cjs/core/window.js.map +1 -1
- package/cjs/event/event-manager.js +152 -143
- package/cjs/event/event-manager.js.map +1 -1
- package/cjs/event/event-system.js +60 -43
- package/cjs/event/event-system.js.map +1 -1
- package/cjs/event/event-target.js +1 -3
- package/cjs/event/event-target.js.map +1 -1
- package/cjs/event/federated-event/base-event.js +43 -15
- package/cjs/event/federated-event/base-event.js.map +1 -1
- package/cjs/event/federated-event/mouse-event.js +27 -18
- package/cjs/event/federated-event/mouse-event.js.map +1 -1
- package/cjs/event/federated-event/pointer-event.js +13 -8
- package/cjs/event/federated-event/pointer-event.js.map +1 -1
- package/cjs/event/federated-event/wheel-event.js +14 -10
- package/cjs/event/federated-event/wheel-event.js.map +1 -1
- package/cjs/graphic/arc.js +10 -5
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/arc3d.js +7 -4
- package/cjs/graphic/arc3d.js.map +1 -1
- package/cjs/graphic/area.js +14 -9
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow.js +2 -3
- package/cjs/graphic/builtin-symbol/arrow.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-down.js +2 -3
- package/cjs/graphic/builtin-symbol/arrow2-down.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-left.js +2 -3
- package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-right.js +2 -3
- package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-up.js +2 -3
- package/cjs/graphic/builtin-symbol/arrow2-up.js.map +1 -1
- package/cjs/graphic/builtin-symbol/circle.js +2 -3
- package/cjs/graphic/builtin-symbol/circle.js.map +1 -1
- package/cjs/graphic/builtin-symbol/close.js +2 -3
- package/cjs/graphic/builtin-symbol/close.js.map +1 -1
- package/cjs/graphic/builtin-symbol/cross.js +2 -3
- package/cjs/graphic/builtin-symbol/cross.js.map +1 -1
- package/cjs/graphic/builtin-symbol/diamond.js +2 -3
- package/cjs/graphic/builtin-symbol/diamond.js.map +1 -1
- package/cjs/graphic/builtin-symbol/line-h.js +2 -3
- package/cjs/graphic/builtin-symbol/line-h.js.map +1 -1
- package/cjs/graphic/builtin-symbol/line-v.js +2 -3
- package/cjs/graphic/builtin-symbol/line-v.js.map +1 -1
- package/cjs/graphic/builtin-symbol/rect.js +2 -3
- package/cjs/graphic/builtin-symbol/rect.js.map +1 -1
- package/cjs/graphic/builtin-symbol/square.js +2 -3
- package/cjs/graphic/builtin-symbol/square.js.map +1 -1
- package/cjs/graphic/builtin-symbol/star.js +2 -3
- package/cjs/graphic/builtin-symbol/star.js.map +1 -1
- package/cjs/graphic/builtin-symbol/stroke.js +2 -3
- package/cjs/graphic/builtin-symbol/stroke.js.map +1 -1
- package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -3
- package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-down.js +2 -3
- package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-left.js +2 -3
- package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-right.js +2 -3
- package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle-up.js +2 -3
- package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
- package/cjs/graphic/builtin-symbol/triangle.js +1 -3
- package/cjs/graphic/builtin-symbol/triangle.js.map +1 -1
- package/cjs/graphic/builtin-symbol/utils.js +6 -1
- package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
- package/cjs/graphic/builtin-symbol/wedge.js +2 -3
- package/cjs/graphic/builtin-symbol/wedge.js.map +1 -1
- package/cjs/graphic/builtin-symbol/wye.js +2 -3
- package/cjs/graphic/builtin-symbol/wye.js.map +1 -1
- package/cjs/graphic/circle.js +8 -6
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.js +59 -32
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/glyph.js +10 -9
- package/cjs/graphic/glyph.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-service.js +12 -8
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +1 -0
- package/cjs/graphic/graphic.js +32 -42
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.js +9 -5
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/image.js +18 -16
- package/cjs/graphic/image.js.map +1 -1
- package/cjs/graphic/line.js +11 -6
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/node-tree.js +25 -44
- package/cjs/graphic/node-tree.js.map +1 -1
- package/cjs/graphic/path.js +12 -6
- package/cjs/graphic/path.js.map +1 -1
- package/cjs/graphic/polygon.js +7 -4
- package/cjs/graphic/polygon.js.map +1 -1
- package/cjs/graphic/pyramid3d.js +4 -3
- package/cjs/graphic/pyramid3d.js.map +1 -1
- package/cjs/graphic/rect.js +7 -3
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/rect3d.js +5 -4
- package/cjs/graphic/rect3d.js.map +1 -1
- package/cjs/graphic/richtext/frame.js +19 -0
- package/cjs/graphic/richtext/frame.js.map +1 -1
- package/cjs/graphic/richtext/icon.js +14 -6
- package/cjs/graphic/richtext/icon.js.map +1 -1
- package/cjs/graphic/richtext/line.js +14 -2
- package/cjs/graphic/richtext/line.js.map +1 -1
- package/cjs/graphic/richtext/paragraph.js +22 -0
- package/cjs/graphic/richtext/paragraph.js.map +1 -1
- package/cjs/graphic/richtext/utils.js +1 -2
- package/cjs/graphic/richtext/utils.js.map +1 -1
- package/cjs/graphic/richtext/wrapper.js +12 -0
- package/cjs/graphic/richtext/wrapper.js.map +1 -1
- package/cjs/graphic/richtext.js +38 -45
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/shadow-root.js +2 -1
- package/cjs/graphic/shadow-root.js.map +1 -1
- package/cjs/graphic/symbol.js +12 -5
- package/cjs/graphic/symbol.js.map +1 -1
- package/cjs/graphic/text.js +45 -45
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/theme.js +4 -0
- package/cjs/graphic/theme.js.map +1 -1
- package/cjs/graphic/tools.js +16 -44
- package/cjs/graphic/tools.js.map +1 -1
- package/cjs/graphic/wrap-text.js +7 -7
- package/cjs/graphic/wrap-text.js.map +1 -1
- package/cjs/interface/global.d.ts +2 -1
- package/cjs/interface/global.js.map +1 -1
- package/cjs/interface/graphic.d.ts +1 -0
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/picker/global-picker-service.js +1 -0
- package/cjs/picker/global-picker-service.js.map +1 -1
- package/cjs/picker/pick-interceptor.js +5 -15
- package/cjs/picker/pick-interceptor.js.map +1 -1
- package/cjs/picker/picker-service.js +5 -5
- package/cjs/picker/picker-service.js.map +1 -1
- package/cjs/plugins/builtin-plugin/3dview-transform-plugin.js +26 -20
- package/cjs/plugins/builtin-plugin/3dview-transform-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js +5 -4
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +5 -4
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +11 -8
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +28 -19
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +12 -8
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.js +6 -7
- package/cjs/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
- package/cjs/plugins/plugin-service.js +1 -0
- package/cjs/plugins/plugin-service.js.map +1 -1
- package/cjs/render/contributions/render/arc-render.js +6 -4
- package/cjs/render/contributions/render/arc-render.js.map +1 -1
- package/cjs/render/contributions/render/arc3d-render.js +5 -7
- package/cjs/render/contributions/render/arc3d-render.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +21 -23
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/base-render.js +5 -0
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/cjs/render/contributions/render/circle-render.js +6 -4
- package/cjs/render/contributions/render/circle-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js +3 -4
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/area-texture-contribution-render.js +6 -9
- package/cjs/render/contributions/render/contributions/area-texture-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/base-contribution-render.js +10 -8
- package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +4 -4
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/circle-contribution-render.js +3 -4
- package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/group-contribution-render.js +1 -3
- package/cjs/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.js +1 -3
- package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js +11 -14
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +3 -4
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/text-contribution-render.js +6 -8
- package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.js +12 -14
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/draw-interceptor.js +11 -21
- package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
- package/cjs/render/contributions/render/glyph-render.js +2 -3
- package/cjs/render/contributions/render/glyph-render.js.map +1 -1
- package/cjs/render/contributions/render/graphic-render.js +4 -1
- package/cjs/render/contributions/render/graphic-render.js.map +1 -1
- package/cjs/render/contributions/render/group-render.js +7 -3
- package/cjs/render/contributions/render/group-render.js.map +1 -1
- package/cjs/render/contributions/render/image-render.js +4 -2
- package/cjs/render/contributions/render/image-render.js.map +1 -1
- package/cjs/render/contributions/render/incremental-area-render.js +1 -3
- package/cjs/render/contributions/render/incremental-area-render.js.map +1 -1
- package/cjs/render/contributions/render/incremental-draw-contribution.js +80 -109
- package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/incremental-line-render.js +1 -3
- package/cjs/render/contributions/render/incremental-line-render.js.map +1 -1
- package/cjs/render/contributions/render/line-render.js +12 -16
- package/cjs/render/contributions/render/line-render.js.map +1 -1
- package/cjs/render/contributions/render/path-render.js +8 -7
- package/cjs/render/contributions/render/path-render.js.map +1 -1
- package/cjs/render/contributions/render/polygon-render.js +6 -4
- package/cjs/render/contributions/render/polygon-render.js.map +1 -1
- package/cjs/render/contributions/render/pyramid3d-render.js +3 -5
- package/cjs/render/contributions/render/pyramid3d-render.js.map +1 -1
- package/cjs/render/contributions/render/rect-render.js +8 -7
- package/cjs/render/contributions/render/rect-render.js.map +1 -1
- package/cjs/render/contributions/render/rect3d-render.js +5 -7
- package/cjs/render/contributions/render/rect3d-render.js.map +1 -1
- package/cjs/render/contributions/render/richtext-render.js +4 -3
- package/cjs/render/contributions/render/richtext-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-render.js +11 -14
- package/cjs/render/contributions/render/symbol-render.js.map +1 -1
- package/cjs/render/contributions/render/text-render.js +8 -8
- package/cjs/render/contributions/render/text-render.js.map +1 -1
- package/cjs/render/contributions/render/utils.js +1 -1
- package/cjs/render/contributions/render/utils.js.map +1 -1
- package/cjs/render/render-service.js +11 -2
- package/cjs/render/render-service.js.map +1 -1
- package/cjs/resource-loader/loader.js +13 -16
- package/cjs/resource-loader/loader.js.map +1 -1
- package/cjs/tapable/Hook.js +3 -0
- package/cjs/tapable/Hook.js.map +1 -1
- package/dist/index.es.js +28908 -0
- package/es/allocator/allocator-modules.js +0 -2
- package/es/allocator/bounds-allocate.js +1 -1
- package/es/allocator/bounds-allocate.js.map +1 -1
- package/es/allocator/canvas-allocate.js +11 -9
- package/es/allocator/canvas-allocate.js.map +1 -1
- package/es/allocator/graphic-allocate.js +5 -9
- package/es/allocator/graphic-allocate.js.map +1 -1
- package/es/allocator/matrix-allocate.js +2 -6
- package/es/allocator/matrix-allocate.js.map +1 -1
- package/es/animate/Ticker/default-ticker.js +25 -14
- package/es/animate/Ticker/default-ticker.js.map +1 -1
- package/es/animate/animate.js +7 -8
- package/es/animate/animate.js.map +1 -1
- package/es/animate/config.js +1 -2
- package/es/animate/custom-animate.js +52 -50
- package/es/animate/custom-animate.js.map +1 -1
- package/es/animate/easing.js +18 -8
- package/es/animate/easing.js.map +1 -1
- package/es/animate/morphing.js +20 -23
- package/es/animate/morphing.js.map +1 -1
- package/es/application.js +7 -1
- package/es/application.js.map +1 -1
- package/es/canvas/conical-gradient.js +12 -6
- package/es/canvas/conical-gradient.js.map +1 -1
- package/es/canvas/contributions/base-canvas.js +19 -7
- package/es/canvas/contributions/base-canvas.js.map +1 -1
- package/es/color-string/interpolate.js +5 -3
- package/es/color-string/interpolate.js.map +1 -1
- package/es/color-string/store.js +2 -2
- package/es/color-string/store.js.map +1 -1
- package/es/common/bounds-context.js +1 -0
- package/es/common/bounds-context.js.map +1 -1
- package/es/common/canvas-utils.js +3 -6
- package/es/common/canvas-utils.js.map +1 -1
- package/es/common/contribution-provider.js +3 -0
- package/es/common/contribution-provider.js.map +1 -1
- package/es/common/custom-path2d.js +7 -1
- package/es/common/custom-path2d.js.map +1 -1
- package/es/common/generator.js +1 -2
- package/es/common/generator.js.map +1 -1
- package/es/common/inversify/binding.js +12 -0
- package/es/common/inversify/binding.js.map +1 -1
- package/es/common/inversify/container.js +4 -0
- package/es/common/inversify/container.js.map +1 -1
- package/es/common/inversify/cotainer-module.js +2 -0
- package/es/common/inversify/cotainer-module.js.map +1 -1
- package/es/common/inversify/meta-data.js +2 -0
- package/es/common/inversify/meta-data.js.map +1 -1
- package/es/common/inversify/syntax/binding_in_syntax.js +1 -0
- package/es/common/inversify/syntax/binding_in_syntax.js.map +1 -1
- package/es/common/inversify/syntax/binding_to_syntax.js +1 -0
- package/es/common/inversify/syntax/binding_to_syntax.js.map +1 -1
- package/es/common/inversify-lite/annotation/lazy_service_identifier.js +1 -0
- package/es/common/inversify-lite/annotation/lazy_service_identifier.js.map +1 -1
- package/es/common/inversify-lite/bindings/binding.js +14 -0
- package/es/common/inversify-lite/bindings/binding.js.map +1 -1
- package/es/common/inversify-lite/container/container.js +22 -48
- package/es/common/inversify-lite/container/container.js.map +1 -1
- package/es/common/inversify-lite/container/container_module.js +4 -0
- package/es/common/inversify-lite/container/container_module.js.map +1 -1
- package/es/common/inversify-lite/container/lookup.js +1 -0
- package/es/common/inversify-lite/container/lookup.js.map +1 -1
- package/es/common/inversify-lite/planning/context.js +4 -0
- package/es/common/inversify-lite/planning/context.js.map +1 -1
- package/es/common/inversify-lite/planning/metadata.js +2 -0
- package/es/common/inversify-lite/planning/metadata.js.map +1 -1
- package/es/common/inversify-lite/planning/plan.js +2 -0
- package/es/common/inversify-lite/planning/plan.js.map +1 -1
- package/es/common/inversify-lite/planning/queryable_string.js +1 -0
- package/es/common/inversify-lite/planning/queryable_string.js.map +1 -1
- package/es/common/inversify-lite/planning/request.js +8 -0
- package/es/common/inversify-lite/planning/request.js.map +1 -1
- package/es/common/inversify-lite/planning/target.js +7 -0
- package/es/common/inversify-lite/planning/target.js.map +1 -1
- package/es/common/inversify-lite/resolution/instantiation.js +16 -44
- package/es/common/inversify-lite/resolution/instantiation.js.map +1 -1
- package/es/common/inversify-lite/scope/scope.js +3 -29
- package/es/common/inversify-lite/scope/scope.js.map +1 -1
- package/es/common/inversify-lite/syntax/binding_in_syntax.js +1 -0
- package/es/common/inversify-lite/syntax/binding_in_syntax.js.map +1 -1
- package/es/common/inversify-lite/syntax/binding_in_when_on_syntax.js +3 -0
- package/es/common/inversify-lite/syntax/binding_in_when_on_syntax.js.map +1 -1
- package/es/common/inversify-lite/syntax/binding_on_syntax.js +1 -0
- package/es/common/inversify-lite/syntax/binding_on_syntax.js.map +1 -1
- package/es/common/inversify-lite/syntax/binding_to_syntax.js +1 -0
- package/es/common/inversify-lite/syntax/binding_to_syntax.js.map +1 -1
- package/es/common/inversify-lite/syntax/binding_when_on_syntax.js +2 -0
- package/es/common/inversify-lite/syntax/binding_when_on_syntax.js.map +1 -1
- package/es/common/inversify-lite/syntax/binding_when_syntax.js +1 -0
- package/es/common/inversify-lite/syntax/binding_when_syntax.js.map +1 -1
- package/es/common/polygon.js +1 -2
- package/es/common/polygon.js.map +1 -1
- package/es/common/render-area.js +2 -3
- package/es/common/render-area.js.map +1 -1
- package/es/common/render-curve.js +4 -8
- package/es/common/render-curve.js.map +1 -1
- package/es/common/seg-context.js +12 -3
- package/es/common/seg-context.js.map +1 -1
- package/es/common/segment/basis.js +13 -0
- package/es/common/segment/basis.js.map +1 -1
- package/es/common/segment/common.js +1 -1
- package/es/common/segment/common.js.map +1 -1
- package/es/common/segment/curve/arc.js +2 -1
- package/es/common/segment/curve/arc.js.map +1 -1
- package/es/common/segment/curve/base.js +4 -0
- package/es/common/segment/curve/base.js.map +1 -1
- package/es/common/segment/curve/cubic-bezier.js +2 -2
- package/es/common/segment/curve/cubic-bezier.js.map +1 -1
- package/es/common/segment/curve/curve-context.js +4 -0
- package/es/common/segment/curve/curve-context.js.map +1 -1
- package/es/common/segment/curve/ellipse.js +3 -3
- package/es/common/segment/curve/ellipse.js.map +1 -1
- package/es/common/segment/curve/line.js +2 -1
- package/es/common/segment/curve/line.js.map +1 -1
- package/es/common/segment/curve/move.js +2 -1
- package/es/common/segment/curve/move.js.map +1 -1
- package/es/common/segment/curve/path.js +2 -0
- package/es/common/segment/curve/path.js.map +1 -1
- package/es/common/segment/curve/quadratic-bezier.js +2 -2
- package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
- package/es/common/segment/linear-closed.js.map +1 -1
- package/es/common/segment/linear.js +10 -0
- package/es/common/segment/linear.js.map +1 -1
- package/es/common/segment/monotone.js +13 -0
- package/es/common/segment/monotone.js.map +1 -1
- package/es/common/segment/step.js +12 -1
- package/es/common/segment/step.js.map +1 -1
- package/es/common/sort.js +3 -34
- package/es/common/sort.js.map +1 -1
- package/es/common/split-path.js +4 -11
- package/es/common/split-path.js.map +1 -1
- package/es/common/utils.d.ts +1 -1
- package/es/common/utils.js +9 -7
- package/es/common/utils.js.map +1 -1
- package/es/common/xml/parser.js +2 -2
- package/es/common/xml/parser.js.map +1 -1
- package/es/core/camera.js +11 -4
- package/es/core/camera.js.map +1 -1
- package/es/core/contributions/env/base-contribution.js +6 -0
- package/es/core/contributions/env/base-contribution.js.map +1 -1
- package/es/core/contributions/layerHandler/canvas2d-contribution.js +20 -11
- package/es/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
- package/es/core/contributions/layerHandler/empty-contribution.js +8 -8
- package/es/core/contributions/layerHandler/empty-contribution.js.map +1 -1
- package/es/core/contributions/layerHandler/offscreen2d-contribution.js +5 -6
- package/es/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
- package/es/core/contributions/textMeasure/AtextMeasure.js +11 -8
- package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
- package/es/core/contributions/textMeasure/layout.js +3 -0
- package/es/core/contributions/textMeasure/layout.js.map +1 -1
- package/es/core/contributions/window/base-contribution.js +2 -0
- package/es/core/contributions/window/base-contribution.js.map +1 -1
- package/es/core/global.js +8 -0
- package/es/core/global.js.map +1 -1
- package/es/core/graphic-utils.js +16 -5
- package/es/core/graphic-utils.js.map +1 -1
- package/es/core/layer-service.js +7 -7
- package/es/core/layer-service.js.map +1 -1
- package/es/core/layer.js +7 -9
- package/es/core/layer.js.map +1 -1
- package/es/core/stage.js +79 -35
- package/es/core/stage.js.map +1 -1
- package/es/core/window.js +16 -14
- package/es/core/window.js.map +1 -1
- package/es/event/event-manager.js +152 -143
- package/es/event/event-manager.js.map +1 -1
- package/es/event/event-system.js +60 -43
- package/es/event/event-system.js.map +1 -1
- package/es/event/event-target.js +1 -3
- package/es/event/event-target.js.map +1 -1
- package/es/event/federated-event/base-event.js +43 -15
- package/es/event/federated-event/base-event.js.map +1 -1
- package/es/event/federated-event/mouse-event.js +27 -18
- package/es/event/federated-event/mouse-event.js.map +1 -1
- package/es/event/federated-event/pointer-event.js +13 -8
- package/es/event/federated-event/pointer-event.js.map +1 -1
- package/es/event/federated-event/wheel-event.js +13 -11
- package/es/event/federated-event/wheel-event.js.map +1 -1
- package/es/graphic/arc.js +9 -6
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/arc3d.js +6 -5
- package/es/graphic/arc3d.js.map +1 -1
- package/es/graphic/area.js +13 -10
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow.js +2 -3
- package/es/graphic/builtin-symbol/arrow.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow2-down.js +2 -3
- package/es/graphic/builtin-symbol/arrow2-down.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow2-left.js +2 -3
- package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow2-right.js +2 -3
- package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow2-up.js +2 -3
- package/es/graphic/builtin-symbol/arrow2-up.js.map +1 -1
- package/es/graphic/builtin-symbol/circle.js +2 -3
- package/es/graphic/builtin-symbol/circle.js.map +1 -1
- package/es/graphic/builtin-symbol/close.js +2 -3
- package/es/graphic/builtin-symbol/close.js.map +1 -1
- package/es/graphic/builtin-symbol/cross.js +2 -3
- package/es/graphic/builtin-symbol/cross.js.map +1 -1
- package/es/graphic/builtin-symbol/diamond.js +2 -3
- package/es/graphic/builtin-symbol/diamond.js.map +1 -1
- package/es/graphic/builtin-symbol/line-h.js +2 -3
- package/es/graphic/builtin-symbol/line-h.js.map +1 -1
- package/es/graphic/builtin-symbol/line-v.js +2 -3
- package/es/graphic/builtin-symbol/line-v.js.map +1 -1
- package/es/graphic/builtin-symbol/rect.js +2 -3
- package/es/graphic/builtin-symbol/rect.js.map +1 -1
- package/es/graphic/builtin-symbol/square.js +2 -3
- package/es/graphic/builtin-symbol/square.js.map +1 -1
- package/es/graphic/builtin-symbol/star.js +2 -3
- package/es/graphic/builtin-symbol/star.js.map +1 -1
- package/es/graphic/builtin-symbol/stroke.js +2 -3
- package/es/graphic/builtin-symbol/stroke.js.map +1 -1
- package/es/graphic/builtin-symbol/thin-triangle.js +2 -3
- package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-down.js +2 -3
- package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-left.js +2 -3
- package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-right.js +2 -3
- package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle-up.js +2 -3
- package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
- package/es/graphic/builtin-symbol/triangle.js +1 -3
- package/es/graphic/builtin-symbol/triangle.js.map +1 -1
- package/es/graphic/builtin-symbol/utils.js +6 -2
- package/es/graphic/builtin-symbol/utils.js.map +1 -1
- package/es/graphic/builtin-symbol/wedge.js +2 -3
- package/es/graphic/builtin-symbol/wedge.js.map +1 -1
- package/es/graphic/builtin-symbol/wye.js +2 -3
- package/es/graphic/builtin-symbol/wye.js.map +1 -1
- package/es/graphic/circle.js +7 -6
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.js +73 -44
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/glyph.js +9 -9
- package/es/graphic/glyph.js.map +1 -1
- package/es/graphic/graphic-service/graphic-service.js +12 -8
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +1 -0
- package/es/graphic/graphic.js +32 -42
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.js +8 -5
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/image.js +17 -16
- package/es/graphic/image.js.map +1 -1
- package/es/graphic/line.js +10 -7
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/node-tree.js +25 -44
- package/es/graphic/node-tree.js.map +1 -1
- package/es/graphic/path.js +11 -7
- package/es/graphic/path.js.map +1 -1
- package/es/graphic/polygon.js +6 -4
- package/es/graphic/polygon.js.map +1 -1
- package/es/graphic/pyramid3d.js +3 -3
- package/es/graphic/pyramid3d.js.map +1 -1
- package/es/graphic/rect.js +6 -4
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/rect3d.js +4 -4
- package/es/graphic/rect3d.js.map +1 -1
- package/es/graphic/richtext/frame.js +19 -0
- package/es/graphic/richtext/frame.js.map +1 -1
- package/es/graphic/richtext/icon.js +14 -6
- package/es/graphic/richtext/icon.js.map +1 -1
- package/es/graphic/richtext/line.js +14 -2
- package/es/graphic/richtext/line.js.map +1 -1
- package/es/graphic/richtext/paragraph.js +22 -0
- package/es/graphic/richtext/paragraph.js.map +1 -1
- package/es/graphic/richtext/utils.js +1 -2
- package/es/graphic/richtext/utils.js.map +1 -1
- package/es/graphic/richtext/wrapper.js +12 -0
- package/es/graphic/richtext/wrapper.js.map +1 -1
- package/es/graphic/richtext.js +37 -46
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/shadow-root.js +2 -1
- package/es/graphic/shadow-root.js.map +1 -1
- package/es/graphic/symbol.js +11 -6
- package/es/graphic/symbol.js.map +1 -1
- package/es/graphic/text.js +39 -40
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/theme.js +4 -0
- package/es/graphic/theme.js.map +1 -1
- package/es/graphic/tools.js +16 -44
- package/es/graphic/tools.js.map +1 -1
- package/es/graphic/wrap-text.js +6 -6
- package/es/graphic/wrap-text.js.map +1 -1
- package/es/interface/global.d.ts +2 -1
- package/es/interface/global.js.map +1 -1
- package/es/interface/graphic.d.ts +1 -0
- package/es/interface/graphic.js.map +1 -1
- package/es/picker/global-picker-service.js +1 -0
- package/es/picker/global-picker-service.js.map +1 -1
- package/es/picker/pick-interceptor.js +5 -15
- package/es/picker/pick-interceptor.js.map +1 -1
- package/es/picker/picker-service.js +5 -5
- package/es/picker/picker-service.js.map +1 -1
- package/es/plugins/builtin-plugin/3dview-transform-plugin.js +26 -20
- package/es/plugins/builtin-plugin/3dview-transform-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/auto-render-plugin.js +5 -4
- package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +5 -4
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +11 -8
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +28 -17
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +12 -8
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/react-attribute-plugin.js +6 -6
- package/es/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
- package/es/plugins/plugin-service.js +1 -0
- package/es/plugins/plugin-service.js.map +1 -1
- package/es/render/contributions/render/arc-render.js +6 -4
- package/es/render/contributions/render/arc-render.js.map +1 -1
- package/es/render/contributions/render/arc3d-render.js +5 -7
- package/es/render/contributions/render/arc3d-render.js.map +1 -1
- package/es/render/contributions/render/area-render.js +21 -23
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/base-render.js +5 -0
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/es/render/contributions/render/circle-render.js +6 -4
- package/es/render/contributions/render/circle-render.js.map +1 -1
- package/es/render/contributions/render/contributions/arc-contribution-render.js +3 -3
- package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/area-texture-contribution-render.js +2 -5
- package/es/render/contributions/render/contributions/area-texture-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/base-contribution-render.js +10 -7
- package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/base-texture-contribution-render.js +4 -3
- package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/circle-contribution-render.js +3 -3
- package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/group-contribution-render.js +1 -3
- package/es/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.js +1 -3
- package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.js +11 -11
- package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/symbol-contribution-render.js +3 -3
- package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/text-contribution-render.js +6 -8
- package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.js +12 -14
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/draw-interceptor.js +11 -21
- package/es/render/contributions/render/draw-interceptor.js.map +1 -1
- package/es/render/contributions/render/glyph-render.js +2 -3
- package/es/render/contributions/render/glyph-render.js.map +1 -1
- package/es/render/contributions/render/graphic-render.js +4 -1
- package/es/render/contributions/render/graphic-render.js.map +1 -1
- package/es/render/contributions/render/group-render.js +7 -3
- package/es/render/contributions/render/group-render.js.map +1 -1
- package/es/render/contributions/render/image-render.js +5 -2
- package/es/render/contributions/render/image-render.js.map +1 -1
- package/es/render/contributions/render/incremental-area-render.js +1 -3
- package/es/render/contributions/render/incremental-area-render.js.map +1 -1
- package/es/render/contributions/render/incremental-draw-contribution.js +80 -109
- package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
- package/es/render/contributions/render/incremental-line-render.js +1 -3
- package/es/render/contributions/render/incremental-line-render.js.map +1 -1
- package/es/render/contributions/render/line-render.js +12 -16
- package/es/render/contributions/render/line-render.js.map +1 -1
- package/es/render/contributions/render/path-render.js +8 -6
- package/es/render/contributions/render/path-render.js.map +1 -1
- package/es/render/contributions/render/polygon-render.js +6 -4
- package/es/render/contributions/render/polygon-render.js.map +1 -1
- package/es/render/contributions/render/pyramid3d-render.js +3 -5
- package/es/render/contributions/render/pyramid3d-render.js.map +1 -1
- package/es/render/contributions/render/rect-render.js +8 -6
- package/es/render/contributions/render/rect-render.js.map +1 -1
- package/es/render/contributions/render/rect3d-render.js +5 -7
- package/es/render/contributions/render/rect3d-render.js.map +1 -1
- package/es/render/contributions/render/richtext-render.js +4 -3
- package/es/render/contributions/render/richtext-render.js.map +1 -1
- package/es/render/contributions/render/symbol-render.js +11 -14
- package/es/render/contributions/render/symbol-render.js.map +1 -1
- package/es/render/contributions/render/text-render.js +9 -8
- package/es/render/contributions/render/text-render.js.map +1 -1
- package/es/render/contributions/render/utils.js +1 -1
- package/es/render/contributions/render/utils.js.map +1 -1
- package/es/render/render-service.js +11 -2
- package/es/render/render-service.js.map +1 -1
- package/es/resource-loader/loader.js +12 -17
- package/es/resource-loader/loader.js.map +1 -1
- package/es/tapable/Hook.js +3 -0
- package/es/tapable/Hook.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,9 +15,8 @@ export function wye(ctx, r, transX, transY) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export class WyeSymbol extends BaseSymbol {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
18
|
+
type="wye";
|
|
19
|
+
pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z";
|
|
21
20
|
draw(ctx, size, transX, transY) {
|
|
22
21
|
return wye(ctx, size / 2, transX, transY);
|
|
23
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/builtin-symbol/wye.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAoBpC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;AACf,MAAM,CAAC,GAAG,IAAI,CAAC,C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AAG,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC;IAC/D,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,OAAO,KAAK,CAAC;AACf,CAAC;AAGD,MAAM,OAAO,SAAU,SAAQ,UAAU;IACvC,IAAI,GAAe,KAAK,CAAC;IAEzB,OAAO,GAEL,8RAA8R,CAAC;IAEjS,IAAI,CAAC,GAAe,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc;QAChE,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QAEnB,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc,EAAE,MAAc;QACtF,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,MAAM,CAAC;QAE5B,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;CACF;AAED,eAAe,IAAI,SAAS,EAAE,CAAC","file":"wye.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport { sqrt } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\nimport { BaseSymbol } from './base';\n\n/**\n * \n *Copyright 2010-2021 Mike Bostock\n\n Permission to use, copy, modify, and/or distribute this software for any purpose\n with or without fee is hereby granted, provided that the above copyright notice\n and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\n FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\n THIS SOFTWARE.\n */\n// 借鉴自d3\n// https://github.com/d3/d3-shape/blob/main/src/symbol/wye.js\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\nexport function wye(ctx: IContext2d, r: number, transX: number, transY: number) {\n const x0 = r / 2;\n const y0 = r * k;\n const x1 = x0;\n const y1 = r * k + r;\n const x2 = -x1;\n const y2 = y1;\n ctx.moveTo(x0 + transX, y0 + transY);\n ctx.lineTo(x1 + transX, y1 + transY);\n ctx.lineTo(x2 + transX, y2 + transY);\n ctx.lineTo(c * x0 - s * y0 + transX, s * x0 + c * y0 + transY);\n ctx.lineTo(c * x1 - s * y1 + transX, s * x1 + c * y1 + transY);\n ctx.lineTo(c * x2 - s * y2 + transX, s * x2 + c * y2 + transY);\n ctx.lineTo(c * x0 + s * y0 + transX, c * y0 - s * x0 + transY);\n ctx.lineTo(c * x1 + s * y1 + transX, c * y1 - s * x1 + transY);\n ctx.lineTo(c * x2 + s * y2 + transX, c * y2 - s * x2 + transY);\n ctx.closePath();\n return false;\n}\n\n// 以中心为锚点,size为wye外接正方形的面积\nexport class WyeSymbol extends BaseSymbol implements ISymbolClass {\n type: SymbolType = 'wye';\n /* eslint-disable max-len */\n pathStr: string =\n /* eslint-disable max-len */\n 'M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z';\n\n draw(ctx: IContext2d, size: number, transX: number, transY: number) {\n const r = size / 2;\n // const r = sqrt(size / a);\n return wye(ctx, r, transX, transY);\n }\n\n drawOffset(ctx: IContext2d, size: number, transX: number, transY: number, offset: number) {\n const r = size / 2 + offset;\n // const r = sqrt(size / a);\n return wye(ctx, r, transX, transY);\n }\n}\n\nexport default new WyeSymbol();\n"]}
|
package/es/graphic/circle.js
CHANGED
|
@@ -13,10 +13,12 @@ import { CIRCLE_NUMBER_TYPE } from "./constants";
|
|
|
13
13
|
const CIRCLE_UPDATE_TAG_KEY = [ "radius", "startAngle", "endAngle", ...GRAPHIC_UPDATE_TAG_KEY ];
|
|
14
14
|
|
|
15
15
|
export class Circle extends Graphic {
|
|
16
|
+
type="circle";
|
|
17
|
+
static NOWORK_ANIMATE_ATTR=NOWORK_ANIMATE_ATTR;
|
|
16
18
|
constructor(params = {
|
|
17
19
|
radius: 1
|
|
18
20
|
}) {
|
|
19
|
-
super(params), this.
|
|
21
|
+
super(params), this.numberType = CIRCLE_NUMBER_TYPE;
|
|
20
22
|
}
|
|
21
23
|
isValid() {
|
|
22
24
|
return super.isValid() && this._isValid();
|
|
@@ -45,20 +47,19 @@ export class Circle extends Graphic {
|
|
|
45
47
|
return super.needUpdateTag(key, CIRCLE_UPDATE_TAG_KEY);
|
|
46
48
|
}
|
|
47
49
|
toCustomPath() {
|
|
48
|
-
|
|
49
|
-
const attribute = this.attribute, radius = null !== (_a = attribute.radius) && void 0 !== _a ? _a : this.getDefaultAttribute("radius"), startAngle = null !== (_b = attribute.startAngle) && void 0 !== _b ? _b : this.getDefaultAttribute("startAngle"), endAngle = null !== (_c = attribute.endAngle) && void 0 !== _c ? _c : this.getDefaultAttribute("endAngle"), path = new CustomPath2D;
|
|
50
|
+
const attribute = this.attribute, radius = attribute.radius ?? this.getDefaultAttribute("radius"), startAngle = attribute.startAngle ?? this.getDefaultAttribute("startAngle"), endAngle = attribute.endAngle ?? this.getDefaultAttribute("endAngle"), path = new CustomPath2D;
|
|
50
51
|
return path.arc(0, 0, radius, startAngle, endAngle), path;
|
|
51
52
|
}
|
|
52
53
|
clone() {
|
|
53
|
-
return new Circle(
|
|
54
|
+
return new Circle({
|
|
55
|
+
...this.attribute
|
|
56
|
+
});
|
|
54
57
|
}
|
|
55
58
|
getNoWorkAnimateAttr() {
|
|
56
59
|
return Circle.NOWORK_ANIMATE_ATTR;
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
Circle.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
|
|
61
|
-
|
|
62
63
|
export function createCircle(attributes) {
|
|
63
64
|
return new Circle(attributes);
|
|
64
65
|
}
|
package/es/graphic/circle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,sBAAsB,CAAC,CAAC;AAM9F,MAAM,OAAO,MAAO,SAAQ,OAAgC;
|
|
1
|
+
{"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,C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AAM,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AAGH,MAAM,UAAU,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC","file":"circle.js","sourcesContent":["import type { AABBBounds, OBBBounds } from '@visactor/vutils';\nimport { transformBounds } from '@visactor/vutils';\nimport type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { parsePadding } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { CIRCLE_NUMBER_TYPE } from './constants';\n\nconst CIRCLE_UPDATE_TAG_KEY = ['radius', 'startAngle', 'endAngle', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Circle extends Graphic<ICircleGraphicAttribute> implements ICircle {\n type: 'circle' = 'circle';\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: ICircleGraphicAttribute = { radius: 1 }) {\n super(params);\n this.numberType = CIRCLE_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, radius } = this.attribute;\n return this._validNumber(startAngle) && this._validNumber(endAngle) && this._validNumber(radius);\n }\n\n protected doUpdateAABBBounds(full?: boolean): AABBBounds {\n const circleTheme = getTheme(this).circle;\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = application.graphicService.updateCircleAABBBounds(\n attribute,\n getTheme(this).circle,\n this._AABBBounds,\n full,\n this\n );\n\n const { boundsPadding = circleTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n (bounds as AABBBounds).expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds as AABBBounds;\n }\n\n protected tryUpdateOBBBounds(): OBBBounds {\n throw new Error('暂不支持');\n }\n\n getDefaultAttribute(name: string) {\n const circleTheme = getTheme(this).circle;\n return circleTheme[name];\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, CIRCLE_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, CIRCLE_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const radius = attribute.radius ?? this.getDefaultAttribute('radius');\n const startAngle = attribute.startAngle ?? this.getDefaultAttribute('startAngle');\n const endAngle = attribute.endAngle ?? this.getDefaultAttribute('endAngle');\n\n const path = new CustomPath2D();\n\n path.arc(x, y, radius, startAngle, endAngle);\n\n return path;\n }\n\n clone() {\n return new Circle({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Circle.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createCircle(attributes: ICircleGraphicAttribute): ICircle {\n return new Circle(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
|
package/es/graphic/config.js
CHANGED
|
@@ -48,14 +48,17 @@ const commonStroke = {
|
|
|
48
48
|
stroke: !1
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
export const DefaultStrokeStyle =
|
|
52
|
-
outerBorder:
|
|
51
|
+
export const DefaultStrokeStyle = {
|
|
52
|
+
outerBorder: {
|
|
53
|
+
...commonStroke,
|
|
53
54
|
distance: 0
|
|
54
|
-
}
|
|
55
|
-
innerBorder:
|
|
55
|
+
},
|
|
56
|
+
innerBorder: {
|
|
57
|
+
...commonStroke,
|
|
56
58
|
distance: 0
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
+
},
|
|
60
|
+
...commonStroke
|
|
61
|
+
};
|
|
59
62
|
|
|
60
63
|
export const DefaultTextStyle = {
|
|
61
64
|
text: "",
|
|
@@ -90,7 +93,7 @@ export const DefaultPickStyle = {
|
|
|
90
93
|
pickStrokeBuffer: 0
|
|
91
94
|
};
|
|
92
95
|
|
|
93
|
-
export const DefaultStyle =
|
|
96
|
+
export const DefaultStyle = {
|
|
94
97
|
forceBoundsWidth: void 0,
|
|
95
98
|
forceBoundsHeight: void 0,
|
|
96
99
|
opacity: 1,
|
|
@@ -106,8 +109,12 @@ export const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.ass
|
|
|
106
109
|
blur: 0,
|
|
107
110
|
cursor: null,
|
|
108
111
|
html: null,
|
|
109
|
-
react: null
|
|
110
|
-
|
|
112
|
+
react: null,
|
|
113
|
+
...DefaultFillStyle,
|
|
114
|
+
...DefaultStrokeStyle,
|
|
115
|
+
...DefaultLayout,
|
|
116
|
+
...DefaultPickStyle
|
|
117
|
+
};
|
|
111
118
|
|
|
112
119
|
export const DefaultConnectAttribute = {
|
|
113
120
|
connectedType: "none",
|
|
@@ -120,10 +127,11 @@ export const DefaultDebugAttribute = {
|
|
|
120
127
|
_debug_bounds: !1
|
|
121
128
|
};
|
|
122
129
|
|
|
123
|
-
export const DefaultAttribute =
|
|
130
|
+
export const DefaultAttribute = {
|
|
124
131
|
strokeSeg: null,
|
|
125
132
|
renderable: !0,
|
|
126
133
|
pickable: !0,
|
|
134
|
+
shadowGraphic: void 0,
|
|
127
135
|
childrenPickable: !0,
|
|
128
136
|
fillPickable: !0,
|
|
129
137
|
strokePickable: !0,
|
|
@@ -139,8 +147,11 @@ export const DefaultAttribute = Object.assign(Object.assign(Object.assign({
|
|
|
139
147
|
shadowRootIdx: 1,
|
|
140
148
|
globalZIndex: 1,
|
|
141
149
|
globalCompositeOperation: "",
|
|
142
|
-
overflow: "hidden"
|
|
143
|
-
|
|
150
|
+
overflow: "hidden",
|
|
151
|
+
...DefaultDebugAttribute,
|
|
152
|
+
...DefaultStyle,
|
|
153
|
+
...DefaultTransform
|
|
154
|
+
};
|
|
144
155
|
|
|
145
156
|
export function addAttributeToPrototype(obj, c, keys) {
|
|
146
157
|
keys.forEach((key => {
|
|
@@ -152,7 +163,8 @@ export function rewriteProto(obj, c) {
|
|
|
152
163
|
Object.setPrototypeOf(obj, c);
|
|
153
164
|
}
|
|
154
165
|
|
|
155
|
-
export const DefaultArcAttribute =
|
|
166
|
+
export const DefaultArcAttribute = {
|
|
167
|
+
...DefaultAttribute,
|
|
156
168
|
startAngle: 0,
|
|
157
169
|
endAngle: pi2,
|
|
158
170
|
innerRadius: 0,
|
|
@@ -164,23 +176,27 @@ export const DefaultArcAttribute = Object.assign(Object.assign({}, DefaultAttrib
|
|
|
164
176
|
padAngle: 0,
|
|
165
177
|
cap: !1,
|
|
166
178
|
forceShowCap: !1
|
|
167
|
-
}
|
|
179
|
+
};
|
|
168
180
|
|
|
169
|
-
export const DefaultAreaAttribute =
|
|
181
|
+
export const DefaultAreaAttribute = {
|
|
182
|
+
...DefaultAttribute,
|
|
183
|
+
...DefaultConnectAttribute,
|
|
170
184
|
points: [],
|
|
171
185
|
segments: [],
|
|
172
186
|
curveType: "linear",
|
|
173
187
|
clipRange: 1,
|
|
174
188
|
closePath: !1
|
|
175
|
-
}
|
|
189
|
+
};
|
|
176
190
|
|
|
177
|
-
export const DefaultCircleAttribute =
|
|
191
|
+
export const DefaultCircleAttribute = {
|
|
192
|
+
...DefaultAttribute,
|
|
178
193
|
radius: 1,
|
|
179
194
|
startAngle: 0,
|
|
180
195
|
endAngle: pi2
|
|
181
|
-
}
|
|
196
|
+
};
|
|
182
197
|
|
|
183
|
-
export const DefaultGroupAttribute =
|
|
198
|
+
export const DefaultGroupAttribute = {
|
|
199
|
+
...DefaultAttribute,
|
|
184
200
|
width: 0,
|
|
185
201
|
height: 0,
|
|
186
202
|
cornerRadius: 0,
|
|
@@ -194,68 +210,80 @@ export const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttr
|
|
|
194
210
|
alignItems: "flex-start",
|
|
195
211
|
alignContent: "flex-start",
|
|
196
212
|
baseOpacity: 1
|
|
197
|
-
}
|
|
213
|
+
};
|
|
198
214
|
|
|
199
|
-
export const DefaultGlyphAttribute =
|
|
215
|
+
export const DefaultGlyphAttribute = {
|
|
216
|
+
...DefaultAttribute,
|
|
200
217
|
path: "",
|
|
201
218
|
width: 0,
|
|
202
219
|
height: 0,
|
|
203
220
|
cornerRadius: 0,
|
|
204
221
|
clip: !1
|
|
205
|
-
}
|
|
222
|
+
};
|
|
206
223
|
|
|
207
|
-
export const DefaultLineAttribute =
|
|
224
|
+
export const DefaultLineAttribute = {
|
|
225
|
+
...DefaultAttribute,
|
|
226
|
+
...DefaultConnectAttribute,
|
|
208
227
|
points: [],
|
|
209
228
|
segments: [],
|
|
210
229
|
curveType: "linear",
|
|
211
230
|
clipRange: 1,
|
|
212
231
|
clipRangeByDimension: "default",
|
|
213
232
|
closePath: !1
|
|
214
|
-
}
|
|
233
|
+
};
|
|
215
234
|
|
|
216
|
-
export const DefaultPathAttribute =
|
|
235
|
+
export const DefaultPathAttribute = {
|
|
236
|
+
...DefaultAttribute,
|
|
217
237
|
path: new CustomPath2D,
|
|
218
238
|
customPath: () => {
|
|
219
239
|
Logger.getInstance().warn("空函数");
|
|
220
240
|
}
|
|
221
|
-
}
|
|
241
|
+
};
|
|
222
242
|
|
|
223
|
-
export const DefaultPolygonAttribute =
|
|
243
|
+
export const DefaultPolygonAttribute = {
|
|
244
|
+
...DefaultAttribute,
|
|
224
245
|
points: [],
|
|
225
246
|
cornerRadius: 0,
|
|
226
247
|
closePath: !0
|
|
227
|
-
}
|
|
248
|
+
};
|
|
228
249
|
|
|
229
|
-
export const DefaultRectAttribute =
|
|
250
|
+
export const DefaultRectAttribute = {
|
|
251
|
+
...DefaultAttribute,
|
|
230
252
|
width: 0,
|
|
231
253
|
height: 0,
|
|
232
254
|
x1: 0,
|
|
233
255
|
y1: 0,
|
|
234
256
|
strokeBoundsBuffer: 0,
|
|
235
257
|
cornerRadius: 0
|
|
236
|
-
}
|
|
258
|
+
};
|
|
237
259
|
|
|
238
|
-
export const DefaultRect3dAttribute =
|
|
260
|
+
export const DefaultRect3dAttribute = {
|
|
261
|
+
...DefaultAttribute,
|
|
239
262
|
width: 0,
|
|
240
263
|
height: 0,
|
|
241
264
|
x1: 0,
|
|
242
265
|
y1: 0,
|
|
243
266
|
cornerRadius: 0,
|
|
244
267
|
length: 0
|
|
245
|
-
}
|
|
268
|
+
};
|
|
246
269
|
|
|
247
|
-
export const DefaultSymbolAttribute =
|
|
270
|
+
export const DefaultSymbolAttribute = {
|
|
271
|
+
...DefaultAttribute,
|
|
248
272
|
symbolType: "circle",
|
|
249
273
|
size: 10,
|
|
250
274
|
keepDirIn3d: !0
|
|
251
|
-
}
|
|
275
|
+
};
|
|
252
276
|
|
|
253
|
-
export const DefaultTextAttribute =
|
|
277
|
+
export const DefaultTextAttribute = {
|
|
278
|
+
...DefaultAttribute,
|
|
279
|
+
...DefaultTextStyle,
|
|
254
280
|
strokeBoundsBuffer: 0,
|
|
255
281
|
keepDirIn3d: !0
|
|
256
|
-
}
|
|
282
|
+
};
|
|
257
283
|
|
|
258
|
-
export const DefaultRichTextAttribute =
|
|
284
|
+
export const DefaultRichTextAttribute = {
|
|
285
|
+
...DefaultAttribute,
|
|
286
|
+
...DefaultTextStyle,
|
|
259
287
|
width: 300,
|
|
260
288
|
height: 300,
|
|
261
289
|
ellipsis: !0,
|
|
@@ -269,20 +297,21 @@ export const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assig
|
|
|
269
297
|
maxHeight: void 0,
|
|
270
298
|
maxWidth: void 0,
|
|
271
299
|
singleLine: !1
|
|
272
|
-
}
|
|
300
|
+
};
|
|
273
301
|
|
|
274
|
-
export const DefaultImageAttribute =
|
|
302
|
+
export const DefaultImageAttribute = {
|
|
275
303
|
repeatX: "no-repeat",
|
|
276
304
|
repeatY: "no-repeat",
|
|
277
305
|
image: "",
|
|
278
306
|
width: 0,
|
|
279
|
-
height: 0
|
|
280
|
-
|
|
307
|
+
height: 0,
|
|
308
|
+
...DefaultAttribute,
|
|
281
309
|
fill: !0,
|
|
282
310
|
cornerRadius: 0
|
|
283
|
-
}
|
|
311
|
+
};
|
|
284
312
|
|
|
285
|
-
export const DefaultRichTextIconAttribute =
|
|
313
|
+
export const DefaultRichTextIconAttribute = {
|
|
314
|
+
...DefaultImageAttribute,
|
|
286
315
|
backgroundShowMode: "never",
|
|
287
316
|
backgroundWidth: 0,
|
|
288
317
|
backgroundHeight: 0,
|
|
@@ -299,5 +328,5 @@ export const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, Defa
|
|
|
299
328
|
backgroundStrokeOpacity: 1,
|
|
300
329
|
backgroundRadius: 4,
|
|
301
330
|
opacity: 1
|
|
302
|
-
}
|
|
331
|
+
};
|
|
303
332
|
//# sourceMappingURL=config.js.map
|
package/es/graphic/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAiCvD,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,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,IAAI,EACV,YAAY,EAAE,CAAC,GAChB,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,mCACpC,qBAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,GACX,CAAC","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Logger, Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport type {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute,\n IConnectedStyle,\n ILayout,\n IDebugType,\n IPickStyle\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false,\n verticalMode: 0,\n wrap: false,\n whiteSpace: 'no-wrap',\n heightLimit: Infinity,\n lineClamp: Infinity,\n suffixPosition: 'end',\n underlineDash: [],\n underlineOffset: 0,\n disableAutoClipedPoptip: undefined\n};\n\nexport const DefaultPickStyle: IPickStyle = {\n pickStrokeBuffer: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n forceBoundsWidth: undefined,\n forceBoundsHeight: undefined,\n opacity: 1,\n background: null,\n backgroundOpacity: 1,\n backgroundCornerRadius: 0,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 'no-repeat',\n backgroundFit: true,\n blur: 0,\n cursor: null,\n html: null,\n react: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout,\n ...DefaultPickStyle\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultDebugAttribute: Required<IDebugType> = {\n _debug_bounds: false\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n renderable: true,\n pickable: true,\n childrenPickable: true,\n fillPickable: true,\n strokePickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n renderStyle: 'default',\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n globalZIndex: 1,\n globalCompositeOperation: '',\n overflow: 'hidden',\n ...DefaultDebugAttribute,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n innerPadding: 0,\n outerPadding: 0,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n closePath: false\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start',\n baseOpacity: 1\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n Logger.getInstance().warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0,\n closePath: true\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n disableAutoWrapLine: false,\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EA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,CAAC;IAC1B,gBAAgB,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC;CACX,CAAC","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Logger, Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport type {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute,\n IConnectedStyle,\n ILayout,\n IDebugType,\n IPickStyle\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false,\n verticalMode: 0,\n wrap: false,\n whiteSpace: 'no-wrap',\n heightLimit: Infinity,\n lineClamp: Infinity,\n suffixPosition: 'end',\n underlineDash: [],\n underlineOffset: 0,\n disableAutoClipedPoptip: undefined\n};\n\nexport const DefaultPickStyle: IPickStyle = {\n pickStrokeBuffer: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n forceBoundsWidth: undefined,\n forceBoundsHeight: undefined,\n opacity: 1,\n background: null,\n backgroundOpacity: 1,\n backgroundCornerRadius: 0,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 'no-repeat',\n backgroundFit: true,\n blur: 0,\n cursor: null,\n html: null,\n react: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout,\n ...DefaultPickStyle\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultDebugAttribute: Required<IDebugType> = {\n _debug_bounds: false\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n renderable: true,\n pickable: true,\n shadowGraphic: undefined,\n childrenPickable: true,\n fillPickable: true,\n strokePickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n renderStyle: 'default',\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n globalZIndex: 1,\n globalCompositeOperation: '',\n overflow: 'hidden',\n ...DefaultDebugAttribute,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n innerPadding: 0,\n outerPadding: 0,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n closePath: false\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start',\n baseOpacity: 1\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n Logger.getInstance().warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0,\n closePath: true\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n disableAutoWrapLine: false,\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
|
package/es/graphic/glyph.js
CHANGED
|
@@ -7,9 +7,11 @@ import { application } from "../application";
|
|
|
7
7
|
import { GLYPH_NUMBER_TYPE } from "./constants";
|
|
8
8
|
|
|
9
9
|
export class Glyph extends Graphic {
|
|
10
|
+
type="glyph";
|
|
11
|
+
static NOWORK_ANIMATE_ATTR=NOWORK_ANIMATE_ATTR;
|
|
10
12
|
constructor(params) {
|
|
11
|
-
super(params), this.
|
|
12
|
-
this.
|
|
13
|
+
super(params), this.numberType = GLYPH_NUMBER_TYPE, this.subGraphic = [], this._onInit && this._onInit(this),
|
|
14
|
+
this.valid = this.isValid();
|
|
13
15
|
}
|
|
14
16
|
setSubGraphic(subGraphic) {
|
|
15
17
|
this.detachSubGraphic(), this.subGraphic = subGraphic, subGraphic.forEach((g => {
|
|
@@ -88,14 +90,12 @@ export class Glyph extends Graphic {
|
|
|
88
90
|
return !1;
|
|
89
91
|
}
|
|
90
92
|
useStates(states, hasAnimation) {
|
|
91
|
-
var _a;
|
|
92
93
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
93
|
-
if (!(
|
|
94
|
+
if (!(this.currentStates?.length !== states.length || states.some(((stateName, index) => this.currentStates[index] !== stateName)))) return;
|
|
94
95
|
const stateAttrs = {}, subAttrs = this.subGraphic.map((() => ({})));
|
|
95
96
|
states.forEach((stateName => {
|
|
96
|
-
var _a;
|
|
97
97
|
const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];
|
|
98
|
-
attrs && (Object.assign(stateAttrs, attrs.attributes),
|
|
98
|
+
attrs && (Object.assign(stateAttrs, attrs.attributes), attrs.subAttributes?.length && subAttrs.forEach(((subAttrs, index) => {
|
|
99
99
|
Object.assign(subAttrs, attrs.subAttributes[index]);
|
|
100
100
|
})));
|
|
101
101
|
})), this.subGraphic.forEach(((graphic, index) => {
|
|
@@ -110,7 +110,9 @@ export class Glyph extends Graphic {
|
|
|
110
110
|
this.normalAttrs = null, this.currentStates = []);
|
|
111
111
|
}
|
|
112
112
|
clone() {
|
|
113
|
-
const glyph = new Glyph(
|
|
113
|
+
const glyph = new Glyph({
|
|
114
|
+
...this.attribute
|
|
115
|
+
});
|
|
114
116
|
return glyph.setSubGraphic(this.subGraphic.map((g => g.clone()))), glyph;
|
|
115
117
|
}
|
|
116
118
|
getNoWorkAnimateAttr() {
|
|
@@ -118,8 +120,6 @@ export class Glyph extends Graphic {
|
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
Glyph.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
|
|
122
|
-
|
|
123
123
|
export function createGlyph(attributes) {
|
|
124
124
|
return new Glyph(attributes);
|
|
125
125
|
}
|
package/es/graphic/glyph.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/glyph.ts"],"names":[],"mappings":"AACA,OAAO,E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AAW,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;YACrF,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;QAC/E,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK;QACH,MAAM,KAAK,GAAG,IAAI,KAAK,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;QAC/C,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,oBAAoB;QAClB,OAAO,KAAK,CAAC,mBAAmB,CAAC;IACnC,CAAC;;AAlNM,yBAAmB,GAAG,mBAAmB,CAAC;AAqNnD,MAAM,UAAU,WAAW,CAAC,UAAkC;IAC5D,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC","file":"glyph.js","sourcesContent":["import type { AABBBounds, IPointLike, OBBBounds } from '@visactor/vutils';\nimport { Graphic, NOWORK_ANIMATE_ATTR } from './graphic';\nimport type {\n GraphicType,\n IGraphic,\n IGlyph,\n IGlyphGraphicAttribute,\n IGraphicAttribute,\n ISetAttributeContext\n} from '../interface';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { GLYPH_NUMBER_TYPE } from './constants';\n\nexport class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {\n type: GraphicType = 'glyph';\n declare _onInit: (g: IGlyph) => void;\n declare _onUpdate: (g: IGlyph) => void;\n declare glyphStates?: Record<\n string,\n {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n }\n >;\n declare glyphStateProxy?: (\n stateName: string,\n targetStates?: string[]\n ) => {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n };\n protected declare subGraphic: IGraphic[];\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: Partial<IGlyphGraphicAttribute>) {\n super(params);\n this.numberType = GLYPH_NUMBER_TYPE;\n this.subGraphic = [];\n this._onInit && this._onInit(this);\n this.valid = this.isValid();\n }\n\n setSubGraphic(subGraphic: IGraphic[]) {\n this.detachSubGraphic();\n this.subGraphic = subGraphic;\n subGraphic.forEach(g => {\n g.glyphHost = this;\n Object.setPrototypeOf(g.attribute, this.attribute);\n });\n this.valid = this.isValid();\n this.addUpdateBoundTag();\n }\n\n protected detachSubGraphic() {\n this.subGraphic.forEach(g => {\n g.glyphHost = null;\n Object.setPrototypeOf(g.attribute, {});\n });\n }\n\n getSubGraphic() {\n return this.subGraphic;\n }\n\n onInit(cb: (g: this) => void): void {\n this._onInit = cb;\n }\n\n onUpdate(cb: (g: this) => void): void {\n this._onUpdate = cb;\n }\n\n isValid(): boolean {\n return true;\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n super.setAttribute(key, value, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n setAttributes(\n params: Partial<IGlyphGraphicAttribute>,\n forceUpdateTag: boolean = false,\n context?: ISetAttributeContext\n ) {\n super.setAttributes(params, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n translate(x: number, y: number) {\n super.translate(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n translateTo(x: number, y: number) {\n super.translateTo(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n super.scale(scaleX, scaleY, scaleCenter);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n super.scaleTo(scaleX, scaleY);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotate(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotateTo(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n protected doUpdateAABBBounds(): AABBBounds {\n this._AABBBounds.clear();\n const bounds = application.graphicService.updateGlyphAABBBounds(\n this.attribute,\n getTheme(this).glyph,\n this._AABBBounds,\n this\n ) as AABBBounds;\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): OBBBounds {\n throw new Error('暂不支持');\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return false;\n }\n protected needUpdateTag(key: string): boolean {\n return false;\n }\n\n useStates(states: string[], hasAnimation?: boolean): void {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const isChange =\n this.currentStates?.length !== states.length ||\n states.some((stateName, index) => this.currentStates[index] !== stateName);\n if (!isChange) {\n return;\n }\n\n const stateAttrs = {};\n const subAttrs = this.subGraphic.map(() => ({}));\n states.forEach(stateName => {\n const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];\n\n if (attrs) {\n Object.assign(stateAttrs, attrs.attributes);\n\n if (attrs.subAttributes?.length) {\n subAttrs.forEach((subAttrs, index) => {\n Object.assign(subAttrs, attrs.subAttributes[index]);\n });\n }\n }\n });\n\n this.subGraphic.forEach((graphic, index) => {\n graphic.updateNormalAttrs(subAttrs[index]);\n graphic.applyStateAttrs(subAttrs[index], states, hasAnimation);\n });\n\n this.updateNormalAttrs(stateAttrs);\n this.currentStates = states;\n this.applyStateAttrs(stateAttrs, states, hasAnimation);\n }\n\n clearStates(hasAnimation?: boolean) {\n if (!this.hasState() || !this.normalAttrs) {\n return;\n }\n\n this.subGraphic.forEach(graphic => {\n graphic.applyStateAttrs(graphic.normalAttrs, this.currentStates, hasAnimation, true);\n graphic.normalAttrs = null;\n });\n\n this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);\n this.normalAttrs = null;\n\n this.currentStates = [];\n }\n\n clone(): Graphic<Partial<IGlyphGraphicAttribute>> {\n const glyph = new Glyph({ ...this.attribute });\n glyph.setSubGraphic(this.subGraphic.map(g => g.clone()));\n return glyph;\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Glyph.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createGlyph(attributes: IGlyphGraphicAttribute): IGlyph {\n return new Glyph(attributes);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/glyph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AASzD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,OAAO,KAAM,SAAQ,OAA+B;IACxD,IAAI,GAAgB,OAAO,CAAC;IAmB5B,MAAM,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IAEjD,YAAY,MAAuC;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG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C,CAAC;QAC/C,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,oBAAoB;QAClB,OAAO,KAAK,CAAC,mBAAmB,CAAC;IACnC,CAAC;;AAGH,MAAM,UAAU,WAAW,CAAC,UAAkC;IAC5D,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC","file":"glyph.js","sourcesContent":["import type { AABBBounds, IPointLike, OBBBounds } from '@visactor/vutils';\nimport { Graphic, NOWORK_ANIMATE_ATTR } from './graphic';\nimport type {\n GraphicType,\n IGraphic,\n IGlyph,\n IGlyphGraphicAttribute,\n IGraphicAttribute,\n ISetAttributeContext\n} from '../interface';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { GLYPH_NUMBER_TYPE } from './constants';\n\nexport class Glyph extends Graphic<IGlyphGraphicAttribute> implements IGlyph {\n type: GraphicType = 'glyph';\n declare _onInit: (g: IGlyph) => void;\n declare _onUpdate: (g: IGlyph) => void;\n declare glyphStates?: Record<\n string,\n {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n }\n >;\n declare glyphStateProxy?: (\n stateName: string,\n targetStates?: string[]\n ) => {\n attributes: Partial<IGlyphGraphicAttribute>;\n subAttributes: Partial<IGraphicAttribute>[];\n };\n protected declare subGraphic: IGraphic[];\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: Partial<IGlyphGraphicAttribute>) {\n super(params);\n this.numberType = GLYPH_NUMBER_TYPE;\n this.subGraphic = [];\n this._onInit && this._onInit(this);\n this.valid = this.isValid();\n }\n\n setSubGraphic(subGraphic: IGraphic[]) {\n this.detachSubGraphic();\n this.subGraphic = subGraphic;\n subGraphic.forEach(g => {\n g.glyphHost = this;\n Object.setPrototypeOf(g.attribute, this.attribute);\n });\n this.valid = this.isValid();\n this.addUpdateBoundTag();\n }\n\n protected detachSubGraphic() {\n this.subGraphic.forEach(g => {\n g.glyphHost = null;\n Object.setPrototypeOf(g.attribute, {});\n });\n }\n\n getSubGraphic() {\n return this.subGraphic;\n }\n\n onInit(cb: (g: this) => void): void {\n this._onInit = cb;\n }\n\n onUpdate(cb: (g: this) => void): void {\n this._onUpdate = cb;\n }\n\n isValid(): boolean {\n return true;\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n super.setAttribute(key, value, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n setAttributes(\n params: Partial<IGlyphGraphicAttribute>,\n forceUpdateTag: boolean = false,\n context?: ISetAttributeContext\n ) {\n super.setAttributes(params, forceUpdateTag, context);\n this.subGraphic.forEach(g => {\n g.addUpdateShapeAndBoundsTag();\n g.addUpdatePositionTag();\n });\n }\n\n translate(x: number, y: number) {\n super.translate(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n translateTo(x: number, y: number) {\n super.translateTo(x, y);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n super.scale(scaleX, scaleY, scaleCenter);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n super.scaleTo(scaleX, scaleY);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotate(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n rotateTo(angle: number) {\n super.rotate(angle);\n\n this.subGraphic.forEach(g => {\n g.addUpdatePositionTag();\n g.addUpdateBoundTag();\n });\n return this;\n }\n\n protected doUpdateAABBBounds(): AABBBounds {\n this._AABBBounds.clear();\n const bounds = application.graphicService.updateGlyphAABBBounds(\n this.attribute,\n getTheme(this).glyph,\n this._AABBBounds,\n this\n ) as AABBBounds;\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): OBBBounds {\n throw new Error('暂不支持');\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return false;\n }\n protected needUpdateTag(key: string): boolean {\n return false;\n }\n\n useStates(states: string[], hasAnimation?: boolean): void {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const isChange =\n this.currentStates?.length !== states.length ||\n states.some((stateName, index) => this.currentStates[index] !== stateName);\n if (!isChange) {\n return;\n }\n\n const stateAttrs = {};\n const subAttrs = this.subGraphic.map(() => ({}));\n states.forEach(stateName => {\n const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];\n\n if (attrs) {\n Object.assign(stateAttrs, attrs.attributes);\n\n if (attrs.subAttributes?.length) {\n subAttrs.forEach((subAttrs, index) => {\n Object.assign(subAttrs, attrs.subAttributes[index]);\n });\n }\n }\n });\n\n this.subGraphic.forEach((graphic, index) => {\n graphic.updateNormalAttrs(subAttrs[index]);\n graphic.applyStateAttrs(subAttrs[index], states, hasAnimation);\n });\n\n this.updateNormalAttrs(stateAttrs);\n this.currentStates = states;\n this.applyStateAttrs(stateAttrs, states, hasAnimation);\n }\n\n clearStates(hasAnimation?: boolean) {\n if (!this.hasState() || !this.normalAttrs) {\n return;\n }\n\n this.subGraphic.forEach(graphic => {\n graphic.applyStateAttrs(graphic.normalAttrs, this.currentStates, hasAnimation, true);\n graphic.normalAttrs = null;\n });\n\n this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);\n this.normalAttrs = null;\n\n this.currentStates = [];\n }\n\n clone(): Graphic<Partial<IGlyphGraphicAttribute>> {\n const glyph = new Glyph({ ...this.attribute });\n glyph.setSubGraphic(this.subGraphic.map(g => g.clone()));\n return glyph;\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Glyph.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createGlyph(attributes: IGlyphGraphicAttribute): IGlyph {\n return new Glyph(attributes);\n}\n"]}
|
|
@@ -150,7 +150,6 @@ export function getExtraModelMatrix(dx, dy, graphic) {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
export function getModelMatrix(out, graphic, theme) {
|
|
153
|
-
var _a;
|
|
154
153
|
const {x: x = theme.x, y: y = theme.y, z: z = theme.z, dx: dx = theme.dx, dy: dy = theme.dy, dz: dz = theme.dz, scaleX: scaleX = theme.scaleX, scaleY: scaleY = theme.scaleY, scaleZ: scaleZ = theme.scaleZ, alpha: alpha = theme.alpha, beta: beta = theme.beta, angle: angle = theme.angle, anchor3d: anchor3d = graphic.attribute.anchor, anchor: anchor} = graphic.attribute, _anchor = [ 0, 0, 0 ];
|
|
155
154
|
if (anchor3d) {
|
|
156
155
|
if ("string" == typeof anchor3d[0]) {
|
|
@@ -161,7 +160,7 @@ export function getModelMatrix(out, graphic, theme) {
|
|
|
161
160
|
const ratio = parseFloat(anchor3d[1]) / 100, bounds = graphic.AABBBounds;
|
|
162
161
|
_anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
|
|
163
162
|
} else _anchor[1] = anchor3d[1];
|
|
164
|
-
_anchor[2] =
|
|
163
|
+
_anchor[2] = anchor3d[2] ?? 0;
|
|
165
164
|
}
|
|
166
165
|
if (identity(out), translate(out, out, [ x + dx, y + dy, z + dz ]), translate(out, out, [ _anchor[0], _anchor[1], _anchor[2] ]),
|
|
167
166
|
rotateX(out, out, beta), rotateY(out, out, alpha), translate(out, out, [ -_anchor[0], -_anchor[1], _anchor[2] ]),
|
|
@@ -188,6 +187,14 @@ export function shouldUseMat4(graphic) {
|
|
|
188
187
|
}
|
|
189
188
|
|
|
190
189
|
let DefaultGraphicService = class {
|
|
190
|
+
creator;
|
|
191
|
+
_rectBoundsContribitions;
|
|
192
|
+
_symbolBoundsContribitions;
|
|
193
|
+
_circleBoundsContribitions;
|
|
194
|
+
_arcBoundsContribitions;
|
|
195
|
+
_pathBoundsContribitions;
|
|
196
|
+
tempAABBBounds1;
|
|
197
|
+
tempAABBBounds2;
|
|
191
198
|
constructor(creator) {
|
|
192
199
|
this.creator = creator, this.hooks = {
|
|
193
200
|
onAttributeUpdate: new SyncHook([ "graphic" ]),
|
|
@@ -238,8 +245,7 @@ let DefaultGraphicService = class {
|
|
|
238
245
|
if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
|
|
239
246
|
let {width: width, height: height} = attribute;
|
|
240
247
|
const {x1: x1, y1: y1, x: x, y: y} = attribute;
|
|
241
|
-
width =
|
|
242
|
-
aabbBounds.set(0, 0, width || 0, height || 0);
|
|
248
|
+
width = width ?? x1 - x, height = height ?? y1 - y, aabbBounds.set(0, 0, width || 0, height || 0);
|
|
243
249
|
}
|
|
244
250
|
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
245
251
|
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
@@ -427,16 +433,14 @@ let DefaultGraphicService = class {
|
|
|
427
433
|
updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic) {
|
|
428
434
|
const {points: points = areaTheme.points} = attribute, b = aabbBounds;
|
|
429
435
|
return points.forEach((p => {
|
|
430
|
-
|
|
431
|
-
b.add(p.x, p.y), b.add(null !== (_a = p.x1) && void 0 !== _a ? _a : p.x, null !== (_b = p.y1) && void 0 !== _b ? _b : p.y);
|
|
436
|
+
b.add(p.x, p.y), b.add(p.x1 ?? p.x, p.y1 ?? p.y);
|
|
432
437
|
})), b;
|
|
433
438
|
}
|
|
434
439
|
updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds, graphic) {
|
|
435
440
|
const {segments: segments = areaTheme.segments} = attribute, b = aabbBounds;
|
|
436
441
|
return segments.forEach((s => {
|
|
437
442
|
s.points.forEach((p => {
|
|
438
|
-
|
|
439
|
-
b.add(p.x, p.y), b.add(null !== (_a = p.x1) && void 0 !== _a ? _a : p.x, null !== (_b = p.y1) && void 0 !== _b ? _b : p.y);
|
|
443
|
+
b.add(p.x, p.y), b.add(p.x1 ?? p.x, p.y1 ?? p.y);
|
|
440
444
|
}));
|
|
441
445
|
})), b;
|
|
442
446
|
}
|