@visactor/vrender-core 0.19.4-alpha.5 → 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/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/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/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/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 +4 -4
|
@@ -20,9 +20,8 @@ function wye(ctx, r, transX, transY) {
|
|
|
20
20
|
exports.wye = wye;
|
|
21
21
|
|
|
22
22
|
class WyeSymbol extends base_1.BaseSymbol {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
23
|
+
type="wye";
|
|
24
|
+
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";
|
|
26
25
|
draw(ctx, size, transX, transY) {
|
|
27
26
|
return wye(ctx, size / 2, transX, transY);
|
|
28
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/builtin-symbol/wye.ts"],"names":[],"mappings":";;;AACA,6CAAwC;AAExC,iCAAoC;AAoBpC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;AACf,MAAM,CAAC,GAAG,IAAA,aAAI,EAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACtB,MAAM,CAAC,GAAG,CAAC,GAAG,IAAA,aAAI,EAAC,EAAE,CAAC,CAAC;AACvB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GA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SAAQ,iBAAU;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;AAlBD,8BAkBC;AAED,kBAAe,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/cjs/graphic/circle.js
CHANGED
|
@@ -7,10 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
const graphic_1 = require("./graphic"), custom_path2d_1 = require("../common/custom-path2d"), utils_1 = require("../common/utils"), theme_1 = require("./theme"), application_1 = require("../application"), constants_1 = require("./constants"), CIRCLE_UPDATE_TAG_KEY = [ "radius", "startAngle", "endAngle", ...graphic_1.GRAPHIC_UPDATE_TAG_KEY ];
|
|
8
8
|
|
|
9
9
|
class Circle extends graphic_1.Graphic {
|
|
10
|
+
type="circle";
|
|
11
|
+
static NOWORK_ANIMATE_ATTR=graphic_1.NOWORK_ANIMATE_ATTR;
|
|
10
12
|
constructor(params = {
|
|
11
13
|
radius: 1
|
|
12
14
|
}) {
|
|
13
|
-
super(params), this.
|
|
15
|
+
super(params), this.numberType = constants_1.CIRCLE_NUMBER_TYPE;
|
|
14
16
|
}
|
|
15
17
|
isValid() {
|
|
16
18
|
return super.isValid() && this._isValid();
|
|
@@ -41,12 +43,13 @@ class Circle extends graphic_1.Graphic {
|
|
|
41
43
|
return super.needUpdateTag(key, CIRCLE_UPDATE_TAG_KEY);
|
|
42
44
|
}
|
|
43
45
|
toCustomPath() {
|
|
44
|
-
|
|
45
|
-
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 custom_path2d_1.CustomPath2D;
|
|
46
|
+
const attribute = this.attribute, radius = attribute.radius ?? this.getDefaultAttribute("radius"), startAngle = attribute.startAngle ?? this.getDefaultAttribute("startAngle"), endAngle = attribute.endAngle ?? this.getDefaultAttribute("endAngle"), path = new custom_path2d_1.CustomPath2D;
|
|
46
47
|
return path.arc(0, 0, radius, startAngle, endAngle), path;
|
|
47
48
|
}
|
|
48
49
|
clone() {
|
|
49
|
-
return new Circle(
|
|
50
|
+
return new Circle({
|
|
51
|
+
...this.attribute
|
|
52
|
+
});
|
|
50
53
|
}
|
|
51
54
|
getNoWorkAnimateAttr() {
|
|
52
55
|
return Circle.NOWORK_ANIMATE_ATTR;
|
|
@@ -57,6 +60,5 @@ function createCircle(attributes) {
|
|
|
57
60
|
return new Circle(attributes);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
exports.Circle = Circle,
|
|
61
|
-
exports.createCircle = createCircle;
|
|
63
|
+
exports.Circle = Circle, exports.createCircle = createCircle;
|
|
62
64
|
//# sourceMappingURL=circle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":";;;AAGA,uCAAiF;AACjF,2DAAuD;AACvD,2CAA+C;AAC/C,mCAAmC;AACnC,gDAA6C;AAC7C,2CAAiD;AAEjD,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,gCAAsB,CAAC,CAAC;AAM9F,MAAa,MAAO,SAAQ,iBAAgC;
|
|
1
|
+
{"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":";;;AAGA,uCAAiF;AACjF,2DAAuD;AACvD,2CAA+C;AAC/C,mCAAmC;AACnC,gDAA6C;AAC7C,2CAAiD;AAEjD,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,gCAAsB,CAAC,CAAC;AAM9F,MAAa,MAAO,SAAQ,iBAAgC;IAC1D,IAAI,GAAa,QAAQ,CAAC;IAE1B,MAAM,CAAC,mBAAmB,GAAG,6BAAmB,CAAC;IAEjD,YAAY,SAAkC,EAAE,MAAM,EAAE,CAAC,EAAE;QACzD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,8BAAkB,CAAC;IACvC,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,QAAQ,E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AAI,EAAE,qBAAqB,CAAC,CAAC;IAC3D,CAAC;IACS,aAAa,CAAC,GAAW;QACjC,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC;IACzD,CAAC;IAED,YAAY;QACV,MAAM,CAAC,GAAG,CAAC,CAAC;QACZ,MAAM,CAAC,GAAG,CAAC,CAAC;QAEZ,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACtE,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,IAAI,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAClF,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,IAAI,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAE5E,MAAM,IAAI,GAAG,IAAI,4BAAY,EAAE,CAAC;QAEhC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO,IAAI,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AA9EH,wBA+EC;AAED,SAAgB,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC;AAFD,oCAEC","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/cjs/graphic/config.js
CHANGED
|
@@ -58,14 +58,17 @@ function rewriteProto(obj, c) {
|
|
|
58
58
|
Object.setPrototypeOf(obj, c);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
exports.DefaultStrokeStyle =
|
|
62
|
-
outerBorder:
|
|
61
|
+
exports.DefaultStrokeStyle = {
|
|
62
|
+
outerBorder: {
|
|
63
|
+
...commonStroke,
|
|
63
64
|
distance: 0
|
|
64
|
-
}
|
|
65
|
-
innerBorder:
|
|
65
|
+
},
|
|
66
|
+
innerBorder: {
|
|
67
|
+
...commonStroke,
|
|
66
68
|
distance: 0
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
+
},
|
|
70
|
+
...commonStroke
|
|
71
|
+
}, exports.DefaultTextStyle = {
|
|
69
72
|
text: "",
|
|
70
73
|
maxLineWidth: 1 / 0,
|
|
71
74
|
textAlign: "left",
|
|
@@ -94,7 +97,7 @@ exports.DefaultStrokeStyle = Object.assign({
|
|
|
94
97
|
disableAutoClipedPoptip: void 0
|
|
95
98
|
}, exports.DefaultPickStyle = {
|
|
96
99
|
pickStrokeBuffer: 0
|
|
97
|
-
}, exports.DefaultStyle =
|
|
100
|
+
}, exports.DefaultStyle = {
|
|
98
101
|
forceBoundsWidth: void 0,
|
|
99
102
|
forceBoundsHeight: void 0,
|
|
100
103
|
opacity: 1,
|
|
@@ -110,19 +113,23 @@ exports.DefaultStrokeStyle = Object.assign({
|
|
|
110
113
|
blur: 0,
|
|
111
114
|
cursor: null,
|
|
112
115
|
html: null,
|
|
113
|
-
react: null
|
|
114
|
-
|
|
115
|
-
exports.
|
|
116
|
+
react: null,
|
|
117
|
+
...exports.DefaultFillStyle,
|
|
118
|
+
...exports.DefaultStrokeStyle,
|
|
119
|
+
...exports.DefaultLayout,
|
|
120
|
+
...exports.DefaultPickStyle
|
|
121
|
+
}, exports.DefaultConnectAttribute = {
|
|
116
122
|
connectedType: "none",
|
|
117
123
|
connectedStyle: {},
|
|
118
124
|
connectedX: NaN,
|
|
119
125
|
connectedY: NaN
|
|
120
126
|
}, exports.DefaultDebugAttribute = {
|
|
121
127
|
_debug_bounds: !1
|
|
122
|
-
}, exports.DefaultAttribute =
|
|
128
|
+
}, exports.DefaultAttribute = {
|
|
123
129
|
strokeSeg: null,
|
|
124
130
|
renderable: !0,
|
|
125
131
|
pickable: !0,
|
|
132
|
+
shadowGraphic: void 0,
|
|
126
133
|
childrenPickable: !0,
|
|
127
134
|
fillPickable: !0,
|
|
128
135
|
strokePickable: !0,
|
|
@@ -138,10 +145,13 @@ exports.DefaultConnectAttribute = {
|
|
|
138
145
|
shadowRootIdx: 1,
|
|
139
146
|
globalZIndex: 1,
|
|
140
147
|
globalCompositeOperation: "",
|
|
141
|
-
overflow: "hidden"
|
|
142
|
-
|
|
143
|
-
exports.
|
|
144
|
-
exports.
|
|
148
|
+
overflow: "hidden",
|
|
149
|
+
...exports.DefaultDebugAttribute,
|
|
150
|
+
...exports.DefaultStyle,
|
|
151
|
+
...exports.DefaultTransform
|
|
152
|
+
}, exports.addAttributeToPrototype = addAttributeToPrototype, exports.rewriteProto = rewriteProto,
|
|
153
|
+
exports.DefaultArcAttribute = {
|
|
154
|
+
...exports.DefaultAttribute,
|
|
145
155
|
startAngle: 0,
|
|
146
156
|
endAngle: vutils_1.pi2,
|
|
147
157
|
innerRadius: 0,
|
|
@@ -153,17 +163,21 @@ exports.DefaultArcAttribute = Object.assign(Object.assign({}, exports.DefaultAtt
|
|
|
153
163
|
padAngle: 0,
|
|
154
164
|
cap: !1,
|
|
155
165
|
forceShowCap: !1
|
|
156
|
-
}
|
|
166
|
+
}, exports.DefaultAreaAttribute = {
|
|
167
|
+
...exports.DefaultAttribute,
|
|
168
|
+
...exports.DefaultConnectAttribute,
|
|
157
169
|
points: [],
|
|
158
170
|
segments: [],
|
|
159
171
|
curveType: "linear",
|
|
160
172
|
clipRange: 1,
|
|
161
173
|
closePath: !1
|
|
162
|
-
}
|
|
174
|
+
}, exports.DefaultCircleAttribute = {
|
|
175
|
+
...exports.DefaultAttribute,
|
|
163
176
|
radius: 1,
|
|
164
177
|
startAngle: 0,
|
|
165
178
|
endAngle: vutils_1.pi2
|
|
166
|
-
}
|
|
179
|
+
}, exports.DefaultGroupAttribute = {
|
|
180
|
+
...exports.DefaultAttribute,
|
|
167
181
|
width: 0,
|
|
168
182
|
height: 0,
|
|
169
183
|
cornerRadius: 0,
|
|
@@ -177,50 +191,62 @@ exports.DefaultArcAttribute = Object.assign(Object.assign({}, exports.DefaultAtt
|
|
|
177
191
|
alignItems: "flex-start",
|
|
178
192
|
alignContent: "flex-start",
|
|
179
193
|
baseOpacity: 1
|
|
180
|
-
}
|
|
194
|
+
}, exports.DefaultGlyphAttribute = {
|
|
195
|
+
...exports.DefaultAttribute,
|
|
181
196
|
path: "",
|
|
182
197
|
width: 0,
|
|
183
198
|
height: 0,
|
|
184
199
|
cornerRadius: 0,
|
|
185
200
|
clip: !1
|
|
186
|
-
}
|
|
201
|
+
}, exports.DefaultLineAttribute = {
|
|
202
|
+
...exports.DefaultAttribute,
|
|
203
|
+
...exports.DefaultConnectAttribute,
|
|
187
204
|
points: [],
|
|
188
205
|
segments: [],
|
|
189
206
|
curveType: "linear",
|
|
190
207
|
clipRange: 1,
|
|
191
208
|
clipRangeByDimension: "default",
|
|
192
209
|
closePath: !1
|
|
193
|
-
}
|
|
210
|
+
}, exports.DefaultPathAttribute = {
|
|
211
|
+
...exports.DefaultAttribute,
|
|
194
212
|
path: new custom_path2d_1.CustomPath2D,
|
|
195
213
|
customPath: () => {
|
|
196
214
|
vutils_1.Logger.getInstance().warn("空函数");
|
|
197
215
|
}
|
|
198
|
-
}
|
|
216
|
+
}, exports.DefaultPolygonAttribute = {
|
|
217
|
+
...exports.DefaultAttribute,
|
|
199
218
|
points: [],
|
|
200
219
|
cornerRadius: 0,
|
|
201
220
|
closePath: !0
|
|
202
|
-
}
|
|
221
|
+
}, exports.DefaultRectAttribute = {
|
|
222
|
+
...exports.DefaultAttribute,
|
|
203
223
|
width: 0,
|
|
204
224
|
height: 0,
|
|
205
225
|
x1: 0,
|
|
206
226
|
y1: 0,
|
|
207
227
|
strokeBoundsBuffer: 0,
|
|
208
228
|
cornerRadius: 0
|
|
209
|
-
}
|
|
229
|
+
}, exports.DefaultRect3dAttribute = {
|
|
230
|
+
...exports.DefaultAttribute,
|
|
210
231
|
width: 0,
|
|
211
232
|
height: 0,
|
|
212
233
|
x1: 0,
|
|
213
234
|
y1: 0,
|
|
214
235
|
cornerRadius: 0,
|
|
215
236
|
length: 0
|
|
216
|
-
}
|
|
237
|
+
}, exports.DefaultSymbolAttribute = {
|
|
238
|
+
...exports.DefaultAttribute,
|
|
217
239
|
symbolType: "circle",
|
|
218
240
|
size: 10,
|
|
219
241
|
keepDirIn3d: !0
|
|
220
|
-
}
|
|
242
|
+
}, exports.DefaultTextAttribute = {
|
|
243
|
+
...exports.DefaultAttribute,
|
|
244
|
+
...exports.DefaultTextStyle,
|
|
221
245
|
strokeBoundsBuffer: 0,
|
|
222
246
|
keepDirIn3d: !0
|
|
223
|
-
}
|
|
247
|
+
}, exports.DefaultRichTextAttribute = {
|
|
248
|
+
...exports.DefaultAttribute,
|
|
249
|
+
...exports.DefaultTextStyle,
|
|
224
250
|
width: 300,
|
|
225
251
|
height: 300,
|
|
226
252
|
ellipsis: !0,
|
|
@@ -234,16 +260,17 @@ exports.DefaultArcAttribute = Object.assign(Object.assign({}, exports.DefaultAtt
|
|
|
234
260
|
maxHeight: void 0,
|
|
235
261
|
maxWidth: void 0,
|
|
236
262
|
singleLine: !1
|
|
237
|
-
}
|
|
263
|
+
}, exports.DefaultImageAttribute = {
|
|
238
264
|
repeatX: "no-repeat",
|
|
239
265
|
repeatY: "no-repeat",
|
|
240
266
|
image: "",
|
|
241
267
|
width: 0,
|
|
242
|
-
height: 0
|
|
243
|
-
|
|
268
|
+
height: 0,
|
|
269
|
+
...exports.DefaultAttribute,
|
|
244
270
|
fill: !0,
|
|
245
271
|
cornerRadius: 0
|
|
246
|
-
}
|
|
272
|
+
}, exports.DefaultRichTextIconAttribute = {
|
|
273
|
+
...exports.DefaultImageAttribute,
|
|
247
274
|
backgroundShowMode: "never",
|
|
248
275
|
backgroundWidth: 0,
|
|
249
276
|
backgroundHeight: 0,
|
|
@@ -260,5 +287,5 @@ exports.DefaultArcAttribute = Object.assign(Object.assign({}, exports.DefaultAtt
|
|
|
260
287
|
backgroundStrokeOpacity: 1,
|
|
261
288
|
backgroundRadius: 4,
|
|
262
289
|
opacity: 1
|
|
263
|
-
}
|
|
290
|
+
};
|
|
264
291
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":";;;AACA,6CAAuD;AACvD,2DAAuD;AAiC1C,QAAA,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEW,QAAA,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;IAC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,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,IACV","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,6CAAuD;AACvD,2DAAuD;AAiC1C,QAAA,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEW,QAAA,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,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,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,GAAG,wBAAgB;IACnB,IAAI,EAAE,IAAI;IACV,YAAY,EAAE,CAAC;CAChB,CAAC;AAEW,QAAA,4BAA4B,GAA4C;IACnF,GAAG,6BAAqB;IACxB,kBAAkB,EAAE,OAAO;IAC3B,eAAe,EAAE,CAAC;IAClB,gBAAgB,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM;IACjB,YAAY,EAAE,QAAQ;IACtB,SAAS,EAAE,YAAY;IACvB,MAAM,EAAE,CAAC;IACT,EAAE,EAAE,EAAE;IAEN,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,cAAc,EAAE,0BAA0B;IAC1C,qBAAqB,EAAE,CAAC;IACxB,gBAAgB,EAAE,KAAK;IACvB,uBAAuB,EAAE,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/cjs/graphic/glyph.js
CHANGED
|
@@ -7,9 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
const graphic_1 = require("./graphic"), theme_1 = require("./theme"), application_1 = require("../application"), constants_1 = require("./constants");
|
|
8
8
|
|
|
9
9
|
class Glyph extends graphic_1.Graphic {
|
|
10
|
+
type="glyph";
|
|
11
|
+
static NOWORK_ANIMATE_ATTR=graphic_1.NOWORK_ANIMATE_ATTR;
|
|
10
12
|
constructor(params) {
|
|
11
|
-
super(params), this.
|
|
12
|
-
this.
|
|
13
|
+
super(params), this.numberType = constants_1.GLYPH_NUMBER_TYPE, this.subGraphic = [],
|
|
14
|
+
this._onInit && this._onInit(this), this.valid = this.isValid();
|
|
13
15
|
}
|
|
14
16
|
setSubGraphic(subGraphic) {
|
|
15
17
|
this.detachSubGraphic(), this.subGraphic = subGraphic, subGraphic.forEach((g => {
|
|
@@ -89,14 +91,12 @@ class Glyph extends graphic_1.Graphic {
|
|
|
89
91
|
return !1;
|
|
90
92
|
}
|
|
91
93
|
useStates(states, hasAnimation) {
|
|
92
|
-
var _a;
|
|
93
94
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
94
|
-
if (!(
|
|
95
|
+
if (!(this.currentStates?.length !== states.length || states.some(((stateName, index) => this.currentStates[index] !== stateName)))) return;
|
|
95
96
|
const stateAttrs = {}, subAttrs = this.subGraphic.map((() => ({})));
|
|
96
97
|
states.forEach((stateName => {
|
|
97
|
-
var _a;
|
|
98
98
|
const attrs = this.glyphStateProxy ? this.glyphStateProxy(stateName, states) : this.glyphStates[stateName];
|
|
99
|
-
attrs && (Object.assign(stateAttrs, attrs.attributes),
|
|
99
|
+
attrs && (Object.assign(stateAttrs, attrs.attributes), attrs.subAttributes?.length && subAttrs.forEach(((subAttrs, index) => {
|
|
100
100
|
Object.assign(subAttrs, attrs.subAttributes[index]);
|
|
101
101
|
})));
|
|
102
102
|
})), this.subGraphic.forEach(((graphic, index) => {
|
|
@@ -111,7 +111,9 @@ class Glyph extends graphic_1.Graphic {
|
|
|
111
111
|
this.normalAttrs = null, this.currentStates = []);
|
|
112
112
|
}
|
|
113
113
|
clone() {
|
|
114
|
-
const glyph = new Glyph(
|
|
114
|
+
const glyph = new Glyph({
|
|
115
|
+
...this.attribute
|
|
116
|
+
});
|
|
115
117
|
return glyph.setSubGraphic(this.subGraphic.map((g => g.clone()))), glyph;
|
|
116
118
|
}
|
|
117
119
|
getNoWorkAnimateAttr() {
|
|
@@ -123,6 +125,5 @@ function createGlyph(attributes) {
|
|
|
123
125
|
return new Glyph(attributes);
|
|
124
126
|
}
|
|
125
127
|
|
|
126
|
-
exports.Glyph = Glyph,
|
|
127
|
-
exports.createGlyph = createGlyph;
|
|
128
|
+
exports.Glyph = Glyph, exports.createGlyph = createGlyph;
|
|
128
129
|
//# sourceMappingURL=glyph.js.map
|
package/cjs/graphic/glyph.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/glyph.ts"],"names":[],"mappings":";;;AACA,uCAAyD;AASzD,mCAAmC;AACnC,gDAA6C;AAC7C,2CAAgD;AAEhD,MAAa,KAAM,SAAQ,iBAA+B;IAsBxD,YAAY,MAAuC;QACjD,KAAK,CAAC,MAAM,CAAC,CAAC;QAtBhB,SAAI,GAAgB,OAAO,CAAC;QAuB1B,IAAI,CAAC,UAAU,GAAG,6BAAiB,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;IAED,aAAa,CAAC,UAAsB;QAClC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACrB,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;YAC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IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC;AAFD,kCAEC","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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AC,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,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,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;;AAtOH,sBAuOC;AAED,SAAgB,WAAW,CAAC,UAAkC;IAC5D,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC;AAFD,kCAEC","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"]}
|
|
@@ -134,7 +134,6 @@ function getExtraModelMatrix(dx, dy, graphic) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
function getModelMatrix(out, graphic, theme) {
|
|
137
|
-
var _a;
|
|
138
137
|
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 ];
|
|
139
138
|
if (anchor3d) {
|
|
140
139
|
if ("string" == typeof anchor3d[0]) {
|
|
@@ -145,7 +144,7 @@ function getModelMatrix(out, graphic, theme) {
|
|
|
145
144
|
const ratio = parseFloat(anchor3d[1]) / 100, bounds = graphic.AABBBounds;
|
|
146
145
|
_anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
|
|
147
146
|
} else _anchor[1] = anchor3d[1];
|
|
148
|
-
_anchor[2] =
|
|
147
|
+
_anchor[2] = anchor3d[2] ?? 0;
|
|
149
148
|
}
|
|
150
149
|
if (identity(out), translate(out, out, [ x + dx, y + dy, z + dz ]), translate(out, out, [ _anchor[0], _anchor[1], _anchor[2] ]),
|
|
151
150
|
rotateX(out, out, beta), rotateY(out, out, alpha), translate(out, out, [ -_anchor[0], -_anchor[1], _anchor[2] ]),
|
|
@@ -177,6 +176,14 @@ exports.getExtraModelMatrix = getExtraModelMatrix, exports.getModelMatrix = getM
|
|
|
177
176
|
exports.shouldUseMat4 = shouldUseMat4;
|
|
178
177
|
|
|
179
178
|
let DefaultGraphicService = class {
|
|
179
|
+
creator;
|
|
180
|
+
_rectBoundsContribitions;
|
|
181
|
+
_symbolBoundsContribitions;
|
|
182
|
+
_circleBoundsContribitions;
|
|
183
|
+
_arcBoundsContribitions;
|
|
184
|
+
_pathBoundsContribitions;
|
|
185
|
+
tempAABBBounds1;
|
|
186
|
+
tempAABBBounds2;
|
|
180
187
|
constructor(creator) {
|
|
181
188
|
this.creator = creator, this.hooks = {
|
|
182
189
|
onAttributeUpdate: new tapable_1.SyncHook([ "graphic" ]),
|
|
@@ -230,8 +237,7 @@ let DefaultGraphicService = class {
|
|
|
230
237
|
if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
|
|
231
238
|
let {width: width, height: height} = attribute;
|
|
232
239
|
const {x1: x1, y1: y1, x: x, y: y} = attribute;
|
|
233
|
-
width =
|
|
234
|
-
aabbBounds.set(0, 0, width || 0, height || 0);
|
|
240
|
+
width = width ?? x1 - x, height = height ?? y1 - y, aabbBounds.set(0, 0, width || 0, height || 0);
|
|
235
241
|
}
|
|
236
242
|
const tb1 = this.tempAABBBounds1, tb2 = this.tempAABBBounds2;
|
|
237
243
|
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
@@ -422,16 +428,14 @@ let DefaultGraphicService = class {
|
|
|
422
428
|
updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic) {
|
|
423
429
|
const {points: points = areaTheme.points} = attribute, b = aabbBounds;
|
|
424
430
|
return points.forEach((p => {
|
|
425
|
-
|
|
426
|
-
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);
|
|
431
|
+
b.add(p.x, p.y), b.add(p.x1 ?? p.x, p.y1 ?? p.y);
|
|
427
432
|
})), b;
|
|
428
433
|
}
|
|
429
434
|
updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds, graphic) {
|
|
430
435
|
const {segments: segments = areaTheme.segments} = attribute, b = aabbBounds;
|
|
431
436
|
return segments.forEach((s => {
|
|
432
437
|
s.points.forEach((p => {
|
|
433
|
-
|
|
434
|
-
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);
|
|
438
|
+
b.add(p.x, p.y), b.add(p.x1 ?? p.x, p.y1 ?? p.y);
|
|
435
439
|
}));
|
|
436
440
|
})), b;
|
|
437
441
|
}
|