@visactor/vrender-core 0.18.0-alpha.0 → 0.18.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/common/canvas-utils.js +2 -2
- package/cjs/common/canvas-utils.js.map +1 -1
- package/cjs/common/color-utils.d.ts +9 -0
- package/cjs/common/color-utils.js +231 -0
- package/cjs/common/color-utils.js.map +1 -0
- package/cjs/common/rect-utils.d.ts +7 -0
- package/cjs/common/rect-utils.js +27 -0
- package/cjs/common/rect-utils.js.map +1 -0
- package/cjs/common/render-area.js +3 -15
- package/cjs/common/render-area.js.map +1 -1
- package/cjs/common/render-curve.js +4 -16
- package/cjs/common/render-curve.js.map +1 -1
- package/cjs/common/render-utils.d.ts +10 -0
- package/cjs/common/render-utils.js +22 -0
- package/cjs/common/render-utils.js.map +1 -0
- package/cjs/common/segment/basis.js +2 -3
- package/cjs/common/segment/basis.js.map +1 -1
- package/cjs/common/segment/common.d.ts +4 -1
- package/cjs/common/segment/common.js +13 -3
- package/cjs/common/segment/common.js.map +1 -1
- package/cjs/common/segment/linear-closed.d.ts +2 -16
- package/cjs/common/segment/linear-closed.js +3 -34
- package/cjs/common/segment/linear-closed.js.map +1 -1
- package/cjs/common/segment/linear.d.ts +1 -1
- package/cjs/common/segment/linear.js +2 -3
- package/cjs/common/segment/linear.js.map +1 -1
- package/cjs/common/segment/monotone.d.ts +2 -2
- package/cjs/common/segment/monotone.js +10 -12
- package/cjs/common/segment/monotone.js.map +1 -1
- package/cjs/common/sort.js +2 -1
- package/cjs/common/split-path.js +2 -2
- package/cjs/common/split-path.js.map +1 -1
- package/cjs/core/application.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/stage.d.ts +2 -1
- package/cjs/core/stage.js +12 -5
- package/cjs/core/stage.js.map +1 -1
- package/cjs/env-check.js +17 -17
- package/cjs/env-check.js.map +1 -1
- package/cjs/event/event-system.js +3 -3
- package/cjs/event/event-system.js.map +1 -1
- package/cjs/graphic/arc.js +1 -1
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/arc3d.js +1 -1
- package/cjs/graphic/arc3d.js.map +1 -1
- package/cjs/graphic/area.js +1 -1
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/bounds.d.ts +2 -2
- package/cjs/graphic/bounds.js +1 -1
- package/cjs/graphic/bounds.js.map +1 -1
- package/cjs/graphic/circle.js +1 -1
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.js +5 -1
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/glyph.js +1 -1
- package/cjs/graphic/glyph.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-service.js +13 -11
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +1 -0
- package/cjs/graphic/graphic.js +8 -6
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +1 -1
- package/cjs/graphic/group.js +3 -3
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/image.d.ts +3 -1
- package/cjs/graphic/image.js +7 -1
- package/cjs/graphic/image.js.map +1 -1
- package/cjs/graphic/line.js +1 -1
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/node-tree.d.ts +1 -1
- package/cjs/graphic/node-tree.js +6 -2
- package/cjs/graphic/node-tree.js.map +1 -1
- package/cjs/graphic/path.js +1 -1
- package/cjs/graphic/path.js.map +1 -1
- package/cjs/graphic/polygon.js +1 -1
- package/cjs/graphic/polygon.js.map +1 -1
- package/cjs/graphic/pyramid3d.js +1 -1
- package/cjs/graphic/pyramid3d.js.map +1 -1
- package/cjs/graphic/rect.js +4 -7
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/richtext/frame.d.ts +2 -2
- package/cjs/graphic/richtext/frame.js +1 -12
- package/cjs/graphic/richtext/frame.js.map +1 -1
- package/cjs/graphic/richtext/line.js +1 -12
- package/cjs/graphic/richtext/line.js.map +1 -1
- package/cjs/graphic/richtext/paragraph.js +2 -2
- package/cjs/graphic/richtext/paragraph.js.map +1 -1
- package/cjs/graphic/richtext.d.ts +45 -2
- package/cjs/graphic/richtext.js +22 -7
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/symbol.js +1 -1
- package/cjs/graphic/symbol.js.map +1 -1
- package/cjs/graphic/text.js +4 -4
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/theme.js +1 -1
- package/cjs/graphic/theme.js.map +1 -1
- package/cjs/interface/event.d.ts +2 -0
- package/cjs/interface/event.js.map +1 -1
- package/cjs/interface/graphic/richText.d.ts +2 -2
- package/cjs/interface/graphic/richText.js.map +1 -1
- package/cjs/interface/graphic/symbol.d.ts +1 -1
- package/cjs/interface/graphic/symbol.js.map +1 -1
- package/cjs/interface/graphic.d.ts +17 -3
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/node-tree.d.ts +1 -1
- package/cjs/interface/node-tree.js.map +1 -1
- package/cjs/interface/picker.d.ts +1 -0
- package/cjs/interface/picker.js.map +1 -1
- package/cjs/interface/render.d.ts +1 -0
- package/cjs/interface/render.js.map +1 -1
- package/cjs/interface/stage.d.ts +7 -1
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/modules.d.ts +3 -0
- package/cjs/modules.js +9 -10
- package/cjs/modules.js.map +1 -1
- package/cjs/picker/picker-service.js +8 -3
- package/cjs/picker/picker-service.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.d.ts +14 -3
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +126 -65
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +28 -25
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +9 -7
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/arc-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/area-contribution-render.d.ts +1 -9
- package/cjs/render/contributions/render/contributions/area-contribution-render.js +3 -55
- package/cjs/render/contributions/render/contributions/area-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/area-texture-contribution-render.d.ts +9 -0
- package/cjs/render/contributions/render/contributions/area-texture-contribution-render.js +26 -0
- package/cjs/render/contributions/render/contributions/area-texture-contribution-render.js.map +1 -0
- package/cjs/render/contributions/render/contributions/base-contribution-render.d.ts +2 -20
- package/cjs/render/contributions/render/contributions/base-contribution-render.js +25 -125
- package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.d.ts +21 -0
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +128 -0
- package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -0
- package/cjs/render/contributions/render/contributions/circle-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/group-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.js +3 -2
- package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/index.d.ts +2 -0
- package/cjs/render/contributions/render/contributions/index.js +2 -1
- package/cjs/render/contributions/render/contributions/index.js.map +1 -1
- package/cjs/render/contributions/render/contributions/path-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/path-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/path-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/polygon-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/polygon-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/polygon-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/rect-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.d.ts +1 -1
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
- package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/text-contribution-render.js +23 -8
- package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.js +11 -5
- package/cjs/render/contributions/render/draw-contribution.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-draw-contribution.d.ts +0 -1
- package/cjs/render/contributions/render/incremental-draw-contribution.js +19 -15
- package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/index.d.ts +1 -0
- package/cjs/render/contributions/render/index.js +2 -1
- package/cjs/render/contributions/render/index.js.map +1 -1
- package/cjs/render/contributions/render/utils.d.ts +1 -1
- package/cjs/render/contributions/render/utils.js.map +1 -1
- package/cjs/resource-loader/loader.d.ts +5 -0
- package/cjs/resource-loader/loader.js +56 -15
- package/cjs/resource-loader/loader.js.map +1 -1
- package/es/common/canvas-utils.js +3 -1
- package/es/common/canvas-utils.js.map +1 -1
- package/es/common/color-utils.d.ts +9 -0
- package/es/common/color-utils.js +224 -0
- package/es/common/color-utils.js.map +1 -0
- package/es/common/rect-utils.d.ts +7 -0
- package/es/common/rect-utils.js +20 -0
- package/es/common/rect-utils.js.map +1 -0
- package/es/common/render-area.js +2 -12
- package/es/common/render-area.js.map +1 -1
- package/es/common/render-curve.js +2 -15
- package/es/common/render-curve.js.map +1 -1
- package/es/common/render-utils.d.ts +10 -0
- package/es/common/render-utils.js +14 -0
- package/es/common/render-utils.js.map +1 -0
- package/es/common/segment/basis.js +2 -8
- package/es/common/segment/basis.js.map +1 -1
- package/es/common/segment/common.d.ts +4 -1
- package/es/common/segment/common.js +11 -0
- package/es/common/segment/common.js.map +1 -1
- package/es/common/segment/linear-closed.d.ts +2 -16
- package/es/common/segment/linear-closed.js +4 -38
- package/es/common/segment/linear-closed.js.map +1 -1
- package/es/common/segment/linear.d.ts +1 -1
- package/es/common/segment/linear.js +2 -8
- package/es/common/segment/linear.js.map +1 -1
- package/es/common/segment/monotone.d.ts +2 -2
- package/es/common/segment/monotone.js +7 -13
- package/es/common/segment/monotone.js.map +1 -1
- package/es/common/sort.js +2 -1
- package/es/common/split-path.js +3 -1
- package/es/common/split-path.js.map +1 -1
- package/es/core/application.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/stage.d.ts +2 -1
- package/es/core/stage.js +12 -5
- package/es/core/stage.js.map +1 -1
- package/es/env-check.js +12 -13
- package/es/env-check.js.map +1 -1
- package/es/event/event-system.js +3 -3
- package/es/event/event-system.js.map +1 -1
- package/es/graphic/arc.js +1 -1
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/arc3d.js +1 -1
- package/es/graphic/arc3d.js.map +1 -1
- package/es/graphic/area.js +1 -1
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/bounds.d.ts +2 -2
- package/es/graphic/bounds.js +1 -1
- package/es/graphic/bounds.js.map +1 -1
- package/es/graphic/circle.js +1 -1
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.js +5 -1
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/glyph.js +1 -1
- package/es/graphic/glyph.js.map +1 -1
- package/es/graphic/graphic-service/graphic-service.js +13 -11
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +1 -0
- package/es/graphic/graphic.js +9 -7
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +1 -1
- package/es/graphic/group.js +3 -3
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/image.d.ts +3 -1
- package/es/graphic/image.js +7 -1
- package/es/graphic/image.js.map +1 -1
- package/es/graphic/line.js +1 -1
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/node-tree.d.ts +1 -1
- package/es/graphic/node-tree.js +6 -2
- package/es/graphic/node-tree.js.map +1 -1
- package/es/graphic/path.js +1 -1
- package/es/graphic/path.js.map +1 -1
- package/es/graphic/polygon.js +1 -1
- package/es/graphic/polygon.js.map +1 -1
- package/es/graphic/pyramid3d.js +1 -1
- package/es/graphic/pyramid3d.js.map +1 -1
- package/es/graphic/rect.js +4 -7
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/richtext/frame.d.ts +2 -2
- package/es/graphic/richtext/frame.js +1 -12
- package/es/graphic/richtext/frame.js.map +1 -1
- package/es/graphic/richtext/line.js +1 -12
- package/es/graphic/richtext/line.js.map +1 -1
- package/es/graphic/richtext/paragraph.js +2 -2
- package/es/graphic/richtext/paragraph.js.map +1 -1
- package/es/graphic/richtext.d.ts +45 -2
- package/es/graphic/richtext.js +23 -6
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/symbol.js +1 -1
- package/es/graphic/symbol.js.map +1 -1
- package/es/graphic/text.js +4 -4
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/theme.js +1 -1
- package/es/graphic/theme.js.map +1 -1
- package/es/interface/event.d.ts +2 -0
- package/es/interface/event.js.map +1 -1
- package/es/interface/graphic/richText.d.ts +2 -2
- package/es/interface/graphic/richText.js.map +1 -1
- package/es/interface/graphic/symbol.d.ts +1 -1
- package/es/interface/graphic/symbol.js.map +1 -1
- package/es/interface/graphic.d.ts +17 -3
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/node-tree.d.ts +1 -1
- package/es/interface/node-tree.js.map +1 -1
- package/es/interface/picker.d.ts +1 -0
- package/es/interface/picker.js.map +1 -1
- package/es/interface/render.d.ts +1 -0
- package/es/interface/render.js.map +1 -1
- package/es/interface/stage.d.ts +7 -1
- package/es/interface/stage.js.map +1 -1
- package/es/modules.d.ts +3 -0
- package/es/modules.js +4 -6
- package/es/modules.js.map +1 -1
- package/es/picker/picker-service.js +8 -3
- package/es/picker/picker-service.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.d.ts +14 -3
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +126 -69
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +28 -25
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/render/contributions/render/area-render.js +9 -7
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/contributions/arc-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/arc-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/area-contribution-render.d.ts +1 -9
- package/es/render/contributions/render/contributions/area-contribution-render.js +2 -51
- package/es/render/contributions/render/contributions/area-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/area-texture-contribution-render.d.ts +9 -0
- package/es/render/contributions/render/contributions/area-texture-contribution-render.js +18 -0
- package/es/render/contributions/render/contributions/area-texture-contribution-render.js.map +1 -0
- package/es/render/contributions/render/contributions/base-contribution-render.d.ts +2 -20
- package/es/render/contributions/render/contributions/base-contribution-render.js +23 -123
- package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/base-texture-contribution-render.d.ts +21 -0
- package/es/render/contributions/render/contributions/base-texture-contribution-render.js +124 -0
- package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -0
- package/es/render/contributions/render/contributions/circle-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/circle-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/group-contribution-render.js +2 -2
- package/es/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.js +3 -2
- package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/index.d.ts +2 -0
- package/es/render/contributions/render/contributions/index.js +4 -0
- package/es/render/contributions/render/contributions/index.js.map +1 -1
- package/es/render/contributions/render/contributions/path-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/path-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/path-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/polygon-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/polygon-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/polygon-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/symbol-contribution-render.d.ts +1 -1
- package/es/render/contributions/render/contributions/symbol-contribution-render.js +3 -1
- package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
- package/es/render/contributions/render/contributions/text-contribution-render.js +28 -7
- package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.js +11 -5
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/image-render.js +6 -2
- package/es/render/contributions/render/image-render.js.map +1 -1
- package/es/render/contributions/render/incremental-draw-contribution.d.ts +0 -1
- package/es/render/contributions/render/incremental-draw-contribution.js +19 -15
- package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
- package/es/render/contributions/render/index.d.ts +1 -0
- package/es/render/contributions/render/index.js +2 -0
- package/es/render/contributions/render/index.js.map +1 -1
- package/es/render/contributions/render/utils.d.ts +1 -1
- package/es/render/contributions/render/utils.js.map +1 -1
- package/es/resource-loader/loader.d.ts +5 -0
- package/es/resource-loader/loader.js +56 -14
- package/es/resource-loader/loader.js.map +1 -1
- package/package.json +6 -4
- package/dist/index.js +0 -27707
- package/dist/index.min.js +0 -1
package/es/graphic/symbol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/symbol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACxG,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,MAAM,WAAW,GAAG,IAAI,UAAU,EAAE,CAAC;AAErC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,sBAAsB,CAAC,CAAC;AAKhF,MAAM,OAAO,MAAO,SAAQ,OAAgC;IAU1D,YAAY,SAAkC,EAAE,UAAU,EAAE,QAAQ,EAAE;QACpE,KAAK,CAAC,MAAM,CAAC,CAAC;QAVhB,SAAI,GAAa,QAAQ,CAAC;QAWxB,I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cAAc,CAAC,IAAI;YACxB,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;YACpG,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC;IAED,KAAK;QACH,OAAO,IAAI,MAAM,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AAzJM,oBAAa,GAAiC,EAAE,CAAC;AAEjD,0BAAmB,mBACxB,UAAU,EAAE,CAAC,IACV,mBAAmB,EACtB;AAuJJ,MAAM,UAAU,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC","file":"symbol.js","sourcesContent":["import type { OBBBounds } from '@visactor/vutils';\nimport { AABBBounds } from '@visactor/vutils';\nimport { isArray, max } from '@visactor/vutils';\nimport type { ISymbol, ISymbolClass, ISymbolGraphicAttribute } from '../interface';\nimport { builtinSymbolsMap, builtInSymbolStrMap, CustomSymbolClass } from './builtin-symbol';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { parsePadding } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE } from './constants';\nimport { XMLParser } from '../common/xml';\nimport { isSvg } from '../common/xml/parser';\n\nconst _tempBounds = new AABBBounds();\n\nconst SYMBOL_UPDATE_TAG_KEY = ['symbolType', 'size', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * symbol\n */\nexport class Symbol extends Graphic<ISymbolGraphicAttribute> implements ISymbol {\n type: 'symbol' = 'symbol';\n\n static userSymbolMap: Record<string, ISymbolClass> = {};\n\n static NOWORK_ANIMATE_ATTR = {\n symbolType: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n constructor(params: ISymbolGraphicAttribute = { symbolType: 'circle' }) {\n super(params);\n this.numberType = SYMBOL_NUMBER_TYPE;\n }\n\n protected _parsedPath?: ISymbolClass;\n\n getParsedPath(): ISymbolClass {\n if (this.shouldUpdateShape()) {\n this.doUpdateParsedPath();\n this.clearUpdateShapeTag();\n }\n return this._parsedPath as ISymbolClass;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { size } = this.attribute;\n return isArray(size) ? size.length === 2 && size.every(this._validNumber) : this._validNumber(size);\n }\n\n protected doUpdateParsedPath(): ISymbolClass {\n const symbolTheme = getTheme(this).symbol;\n // 查找内置symbol\n let { symbolType = symbolTheme.symbolType } = this.attribute;\n let path = builtinSymbolsMap[symbolType];\n if (path) {\n this._parsedPath = path;\n return path;\n }\n path = Symbol.userSymbolMap[symbolType];\n if (path) {\n this._parsedPath = path;\n return path;\n }\n\n const _symbolType = builtInSymbolStrMap[symbolType];\n symbolType = _symbolType || symbolType;\n // 判断是否是svg\n const valid = isSvg(symbolType);\n if (valid === true) {\n const parser = new XMLParser();\n const { svg } = parser.parse(symbolType);\n if (!svg) {\n return null;\n }\n const path = isArray(svg.path) ? svg.path : [svg.path];\n _tempBounds.clear();\n const cacheList: { path: CustomPath2D; attribute: Record<string, any> }[] = [];\n path.forEach((item: any) => {\n const cache = new CustomPath2D().fromString(item.d);\n const attribute: any = {};\n SVG_PARSE_ATTRIBUTE_MAP_KEYS.forEach(k => {\n if (item[k]) {\n attribute[SVG_PARSE_ATTRIBUTE_MAP[k]] = item[k];\n }\n });\n // 查找\n cacheList.push({\n path: cache,\n attribute\n });\n _tempBounds.union(cache.bounds);\n });\n const width = _tempBounds.width();\n const height = _tempBounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cacheList.forEach(cache => cache.path.transform(0, 0, scale, scale));\n\n this._parsedPath = new CustomSymbolClass(symbolType, cacheList, true);\n Symbol.userSymbolMap[symbolType] = this._parsedPath;\n return this._parsedPath;\n }\n\n const cache = new CustomPath2D().fromString(symbolType);\n const width = cache.bounds.width();\n const height = cache.bounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cache.transform(0, 0, scale, scale);\n this._parsedPath = new CustomSymbolClass(symbolType, cache);\n Symbol.userSymbolMap[symbolType] = this._parsedPath;\n return this._parsedPath;\n }\n\n protected doUpdateAABBBounds(full?: boolean): AABBBounds {\n const symbolTheme = getTheme(this).symbol;\n this._AABBBounds.setValue(Infinity, Infinity, -Infinity, -Infinity);\n const attribute = this.attribute;\n const bounds = application.graphicService.updateSymbolAABBBounds(\n attribute,\n getTheme(this).symbol,\n this._AABBBounds,\n full,\n this\n );\n\n const { boundsPadding = symbolTheme.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 symbolTheme = getTheme(this).symbol;\n return symbolTheme[name];\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, SYMBOL_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, SYMBOL_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const symbolInstance = this.getParsedPath();\n const size = this.attribute.size;\n const x = 0;\n const y = 0;\n const formattedSize = isArray(size) ? size : [size, size];\n\n return symbolInstance.path\n ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, x, y, formattedSize[0], formattedSize[1])\n : new CustomPath2D().fromString(symbolInstance.pathStr, x, y, formattedSize[0], formattedSize[1]);\n }\n\n clone() {\n return new Symbol({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Symbol.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createSymbol(attributes: ISymbolGraphicAttribute): ISymbol {\n return new Symbol(attributes);\n}\n\n// addAttributeToPrototype(DefaultSymbolStyle, Symbol, PURE_STYLE_KEY);\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/symbol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACxG,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,MAAM,WAAW,GAAG,IAAI,UAAU,EAAE,CAAC;AAErC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,sBAAsB,CAAC,CAAC;AAKhF,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AC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAE1D,OAAO,cAAc,CAAC,IAAI;YACxB,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,gBAAgB,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;YACpG,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC;IAED,KAAK;QACH,OAAO,IAAI,MAAM,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AAzJM,oBAAa,GAAiC,EAAE,CAAC;AAEjD,0BAAmB,mBACxB,UAAU,EAAE,CAAC,IACV,mBAAmB,EACtB;AAuJJ,MAAM,UAAU,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC","file":"symbol.js","sourcesContent":["import type { OBBBounds } from '@visactor/vutils';\nimport { AABBBounds } from '@visactor/vutils';\nimport { isArray, max } from '@visactor/vutils';\nimport type { ISymbol, ISymbolClass, ISymbolGraphicAttribute } from '../interface';\nimport { builtinSymbolsMap, builtInSymbolStrMap, CustomSymbolClass } from './builtin-symbol';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { parsePadding } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE } from './constants';\nimport { XMLParser } from '../common/xml';\nimport { isSvg } from '../common/xml/parser';\n\nconst _tempBounds = new AABBBounds();\n\nconst SYMBOL_UPDATE_TAG_KEY = ['symbolType', 'size', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * symbol\n */\nexport class Symbol extends Graphic<ISymbolGraphicAttribute> implements ISymbol {\n type: 'symbol' = 'symbol';\n\n static userSymbolMap: Record<string, ISymbolClass> = {};\n\n static NOWORK_ANIMATE_ATTR = {\n symbolType: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n constructor(params: ISymbolGraphicAttribute = { symbolType: 'circle' }) {\n super(params);\n this.numberType = SYMBOL_NUMBER_TYPE;\n }\n\n protected _parsedPath?: ISymbolClass;\n\n getParsedPath(): ISymbolClass {\n if (this.shouldUpdateShape()) {\n this.doUpdateParsedPath();\n this.clearUpdateShapeTag();\n }\n return this._parsedPath as ISymbolClass;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { size } = this.attribute;\n return isArray(size) ? size.length === 2 && size.every(this._validNumber) : this._validNumber(size);\n }\n\n protected doUpdateParsedPath(): ISymbolClass {\n const symbolTheme = getTheme(this).symbol;\n // 查找内置symbol\n let { symbolType = symbolTheme.symbolType } = this.attribute;\n let path = builtinSymbolsMap[symbolType];\n if (path) {\n this._parsedPath = path;\n return path;\n }\n path = Symbol.userSymbolMap[symbolType];\n if (path) {\n this._parsedPath = path;\n return path;\n }\n\n const _symbolType = builtInSymbolStrMap[symbolType];\n symbolType = _symbolType || symbolType;\n // 判断是否是svg\n const valid = isSvg(symbolType);\n if (valid === true) {\n const parser = new XMLParser();\n const { svg } = parser.parse(symbolType);\n if (!svg) {\n return null;\n }\n const path = isArray(svg.path) ? svg.path : [svg.path];\n _tempBounds.clear();\n const cacheList: { path: CustomPath2D; attribute: Record<string, any> }[] = [];\n path.forEach((item: any) => {\n const cache = new CustomPath2D().fromString(item.d);\n const attribute: any = {};\n SVG_PARSE_ATTRIBUTE_MAP_KEYS.forEach(k => {\n if (item[k]) {\n attribute[SVG_PARSE_ATTRIBUTE_MAP[k]] = item[k];\n }\n });\n // 查找\n cacheList.push({\n path: cache,\n attribute\n });\n _tempBounds.union(cache.bounds);\n });\n const width = _tempBounds.width();\n const height = _tempBounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cacheList.forEach(cache => cache.path.transform(0, 0, scale, scale));\n\n this._parsedPath = new CustomSymbolClass(symbolType, cacheList, true);\n Symbol.userSymbolMap[symbolType] = this._parsedPath;\n return this._parsedPath;\n }\n\n const cache = new CustomPath2D().fromString(symbolType);\n const width = cache.bounds.width();\n const height = cache.bounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cache.transform(0, 0, scale, scale);\n this._parsedPath = new CustomSymbolClass(symbolType, cache);\n Symbol.userSymbolMap[symbolType] = this._parsedPath;\n return this._parsedPath;\n }\n\n protected doUpdateAABBBounds(full?: boolean): AABBBounds {\n const symbolTheme = getTheme(this).symbol;\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = application.graphicService.updateSymbolAABBBounds(\n attribute,\n getTheme(this).symbol,\n this._AABBBounds,\n full,\n this\n );\n\n const { boundsPadding = symbolTheme.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 symbolTheme = getTheme(this).symbol;\n return symbolTheme[name];\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, SYMBOL_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, SYMBOL_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const symbolInstance = this.getParsedPath();\n const size = this.attribute.size;\n const x = 0;\n const y = 0;\n const formattedSize = isArray(size) ? size : [size, size];\n\n return symbolInstance.path\n ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, x, y, formattedSize[0], formattedSize[1])\n : new CustomPath2D().fromString(symbolInstance.pathStr, x, y, formattedSize[0], formattedSize[1]);\n }\n\n clone() {\n return new Symbol({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Symbol.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createSymbol(attributes: ISymbolGraphicAttribute): ISymbol {\n return new Symbol(attributes);\n}\n\n// addAttributeToPrototype(DefaultSymbolStyle, Symbol, PURE_STYLE_KEY);\n"]}
|
package/es/graphic/text.js
CHANGED
|
@@ -16,7 +16,7 @@ import { TEXT_NUMBER_TYPE } from "./constants";
|
|
|
16
16
|
|
|
17
17
|
import { TextDirection, verticalLayout } from "./tools";
|
|
18
18
|
|
|
19
|
-
const TEXT_UPDATE_TAG_KEY = [ "text", "maxLineWidth", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...GRAPHIC_UPDATE_TAG_KEY ];
|
|
19
|
+
const TEXT_UPDATE_TAG_KEY = [ "text", "maxLineWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...GRAPHIC_UPDATE_TAG_KEY ];
|
|
20
20
|
|
|
21
21
|
export class Text extends Graphic {
|
|
22
22
|
get font() {
|
|
@@ -35,9 +35,9 @@ export class Text extends Graphic {
|
|
|
35
35
|
}
|
|
36
36
|
get cliped() {
|
|
37
37
|
const textTheme = getTheme(this).text, attribute = this.attribute;
|
|
38
|
-
if (
|
|
38
|
+
if (this.isMultiLine) return;
|
|
39
39
|
const {maxLineWidth: maxLineWidth = textTheme.maxLineWidth} = attribute;
|
|
40
|
-
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
40
|
+
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map((item => item.text)).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
41
41
|
}
|
|
42
42
|
get multilineLayout() {
|
|
43
43
|
if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
|
|
@@ -63,7 +63,7 @@ export class Text extends Graphic {
|
|
|
63
63
|
}
|
|
64
64
|
doUpdateAABBBounds() {
|
|
65
65
|
const textTheme = getTheme(this).text;
|
|
66
|
-
this._AABBBounds.
|
|
66
|
+
this._AABBBounds.clear();
|
|
67
67
|
const attribute = this.attribute, bounds = application.graphicService.updateTextAABBBounds(attribute, textTheme, this._AABBBounds, this), {boundsPadding: boundsPadding = textTheme.boundsPadding} = this.attribute, paddingArray = parsePadding(boundsPadding);
|
|
68
68
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(),
|
|
69
69
|
bounds;
|
package/es/graphic/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,mBAA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,CAAC,EACZ,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,CAAC,EACb,UAAU,EAAE,CAAC,IACV,mBAAmB,EACtB;AAuaK,qBAAgB,GAAG;IACxB,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEK,qBAAgB,GAAG;IACxB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AA8SJ,MAAM,UAAU,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC","file":"text.js","sourcesContent":["import { max, type AABBBounds, type OBBBounds, isArray } from '@visactor/vutils';\nimport { getContextFont, textDrawOffsetX, textLayoutOffsetY } from '../common/text';\nimport { CanvasTextLayout } from '../core/contributions/textMeasure/layout';\nimport { application } from '../application';\nimport type { IText, ITextCache, ITextGraphicAttribute, LayoutItemType, LayoutType } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme } from './theme';\nimport { calculateLineHeight, parsePadding } from '../common/utils';\nimport { TEXT_NUMBER_TYPE } from './constants';\nimport { TextDirection, verticalLayout } from './tools';\n\nconst TEXT_UPDATE_TAG_KEY = [\n 'text',\n 'maxLineWidth',\n // 'textAlign',\n // 'textBaseline',\n 'heightLimit',\n 'lineClamp',\n 'fontSize',\n 'fontFamily',\n 'fontWeight',\n 'ellipsis',\n 'lineHeight',\n 'direction',\n 'wordBreak',\n 'heightLimit',\n 'lineClamp',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\nexport class Text extends Graphic<ITextGraphicAttribute> implements IText {\n type: 'text' = 'text';\n\n static NOWORK_ANIMATE_ATTR = {\n ellipsis: 1,\n wordBreak: 1,\n direction: 1,\n textAlign: 1,\n textBaseline: 1,\n fontFamily: 1,\n fontWeight: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n cache: ITextCache;\n _font: string;\n\n get font(): string {\n const textTheme = getTheme(this).text;\n if (!this._font) {\n this._font = getContextFont(this.attribute, textTheme);\n }\n return this._font as string;\n }\n\n get clipedText(): string | undefined {\n const attribute = this.attribute;\n const textTheme = getTheme(this).text;\n if (!this.isSimplify()) {\n return undefined;\n }\n const { maxLineWidth = textTheme.maxLineWidth } = attribute;\n if (!Number.isFinite(maxLineWidth)) {\n return (attribute.text ?? textTheme.text).toString();\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedText;\n }\n get clipedWidth(): number | undefined {\n if (!this.isSimplify()) {\n return undefined;\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedWidth;\n }\n get cliped(): boolean | undefined {\n const textTheme = getTheme(this).text;\n const attribute = this.attribute;\n if (!this.isSimplify()) {\n return undefined;\n }\n const { maxLineWidth = textTheme.maxLineWidth } = attribute;\n if (!Number.isFinite(maxLineWidth)) {\n return false;\n }\n this.tryUpdateAABBBounds();\n if (this.clipedText == null) {\n return false;\n }\n return this.clipedText !== attribute.text.toString();\n }\n get multilineLayout(): LayoutType | undefined {\n if (!this.isMultiLine) {\n return undefined;\n }\n this.tryUpdateAABBBounds();\n return this.cache.layoutData;\n }\n\n // 是否是简单文字\n // 单行,横排\n private isSimplify(): boolean {\n return !this.isMultiLine && this.attribute.direction !== 'vertical';\n }\n get isMultiLine(): boolean {\n return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';\n }\n\n constructor(params: ITextGraphicAttribute = { text: '', fontSize: 16 }) {\n super(params);\n this.numberType = TEXT_NUMBER_TYPE;\n this.cache = {};\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n protected _isValid(): boolean {\n const { text } = this.attribute;\n if (isArray(text)) {\n return !(text as any[]).every((t: any) => t == null || t === '');\n }\n return text != null && text !== '';\n }\n\n protected doUpdateAABBBounds(): AABBBounds {\n const textTheme = getTheme(this).text;\n this._AABBBounds.setValue(Infinity, Infinity, -Infinity, -Infinity);\n const attribute = this.attribute;\n const bounds = application.graphicService.updateTextAABBBounds(\n attribute,\n textTheme,\n this._AABBBounds,\n this\n ) as AABBBounds;\n\n const { boundsPadding = textTheme.boundsPadding } = this.attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n * @param text\n */\n updateWrapAABBBounds(text: (number | string) | (number | string)[]) {\n const textTheme = getTheme(this).text;\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n wordBreak = textTheme.wordBreak,\n fontWeight = textTheme.fontWeight,\n // widthLimit,\n ignoreBuf = textTheme.ignoreBuf,\n suffixPosition = textTheme.suffixPosition,\n heightLimit = 0,\n lineClamp\n } = this.attribute;\n const lineHeight =\n calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize) ??\n (this.attribute.fontSize || textTheme.fontSize);\n const buf = ignoreBuf ? 0 : 2;\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure as any) as any;\n\n // layoutObj内逻辑\n const lines = isArray(text) ? (text.map(l => l.toString()) as string[]) : [text.toString()];\n const linesLayout: LayoutItemType[] = [];\n const bboxWH: [number, number] = [0, 0];\n\n let lineCountLimit = Infinity;\n if (heightLimit > 0) {\n lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n }\n if (lineClamp) {\n // 处理行数限制\n lineCountLimit = Math.min(lineCountLimit, lineClamp);\n }\n\n if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n // widthLimit > 0\n if (maxLineWidth > 0) {\n for (let i = 0; i < lines.length; i++) {\n const str = lines[i] as string;\n let needCut = true;\n // // 测量当前行宽度\n // width = Math.min(\n // layoutObj.textMeasure.measureTextWidth(str, layoutObj.textOptions),\n // maxLineWidth\n // );\n\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = layoutObj.textMeasure.clipTextWithSuffix(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n break; // 不处理后续行\n }\n\n // 测量截断位置\n const clip = layoutObj.textMeasure.clipText(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n wordBreak === 'break-word'\n );\n if (str !== '' && clip.str === '') {\n if (ellipsis) {\n const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n clip.str = clipEllipsis.str ?? '';\n clip.width = clipEllipsis.width ?? 0;\n } else {\n // 宽度限制不足一个字符,不显示\n clip.str = '';\n clip.width = 0;\n }\n needCut = false;\n }\n\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n if (clip.str.length === str.length) {\n // 不需要截断\n } else if (needCut) {\n const newStr = str.substring(clip.str.length);\n lines.splice(i + 1, 0, newStr);\n }\n }\n }\n // bboxWH[0] = maxLineWidth;\n let maxWidth = 0;\n linesLayout.forEach(layout => {\n maxWidth = Math.max(maxWidth, layout.width);\n });\n bboxWH[0] = maxWidth;\n } else {\n // 使用所有行中最长的作为lineWidth\n let lineWidth = 0;\n let width: number;\n let text: string;\n for (let i = 0, len = lines.length; i < len; i++) {\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = layoutObj.textMeasure.clipTextWithSuffix(\n lines[i],\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n lineWidth = Math.max(lineWidth, clip.width);\n break; // 不处理后续行\n }\n\n text = lines[i] as string;\n width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, wordBreak === 'break-word');\n lineWidth = Math.max(lineWidth, width);\n linesLayout.push({ str: text, width });\n }\n bboxWH[0] = lineWidth;\n }\n bboxWH[1] = linesLayout.length * (lineHeight + buf);\n\n const bbox = {\n xOffset: 0,\n yOffset: 0,\n width: bboxWH[0],\n height: bboxWH[1]\n };\n\n layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any);\n\n const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n // const layoutData = layoutObj.GetLayoutByLines(\n // text,\n // textAlign,\n // textBaseline as any,\n // lineHeight,\n // ellipsis === true ? (DefaultTextAttribute.ellipsis as string) : ellipsis || undefined,\n // maxLineWidth\n // );\n // const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateSingallineAABBBounds(text: number | string): AABBBounds {\n const textTheme = getTheme(this).text;\n const { direction = textTheme.direction } = this.attribute;\n\n return direction === 'horizontal'\n ? this.updateHorizontalSinglelineAABBBounds(text)\n : this.updateVerticalSinglelineAABBBounds(text);\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateMultilineAABBBounds(text: (number | string)[]): AABBBounds {\n const textTheme = getTheme(this).text;\n const { direction = textTheme.direction } = this.attribute;\n\n return direction === 'horizontal'\n ? this.updateHorizontalMultilineAABBBounds(text)\n : this.updateVerticalMultilineAABBBounds(text);\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateHorizontalSinglelineAABBBounds(text: number | string): AABBBounds {\n const textTheme = getTheme(this).text;\n const { wrap = textTheme.wrap } = this.attribute;\n if (wrap) {\n return this.updateWrapAABBBounds([text]);\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n let str: string;\n const attribute = this.attribute;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n ignoreBuf = textTheme.ignoreBuf,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n if (whiteSpace === 'normal') {\n return this.updateWrapAABBBounds(text);\n }\n const buf = ignoreBuf ? 0 : Math.max(2, fontSize * 0.075);\n const textFontSize = attribute.fontSize || textTheme.fontSize;\n const lineHeight = calculateLineHeight(attribute.lineHeight, textFontSize) ?? textFontSize + buf;\n if (!this.shouldUpdateShape() && this.cache) {\n width = this.cache.clipedWidth ?? 0;\n const dx = textDrawOffsetX(textAlign, width);\n const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffix(\n text.toString(),\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n str = data.str;\n width = data.width;\n } else {\n const data = textMeasure.clipText(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, false);\n str = data.str;\n width = data.width;\n }\n this.cache.clipedText = str;\n this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = textMeasure.measureTextWidth(text.toString(), { fontSize, fontWeight, fontFamily });\n this.cache.clipedText = text.toString();\n this.cache.clipedWidth = width;\n }\n this.clearUpdateShapeTag();\n\n const dx = textDrawOffsetX(textAlign, width);\n let lh = lineHeight;\n if (application.global && application.global.isSafari()) {\n // 如果是safari,那么需要额外增加高度\n lh += fontSize * 0.2;\n }\n const dy = textLayoutOffsetY(textBaseline, lh, fontSize, buf);\n this._AABBBounds.set(dx, dy, dx + width, dy + lh);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n getBaselineMapAlign(): Record<string, string> {\n return Text.baselineMapAlign;\n }\n\n getAlignMapBaseline(): Record<string, string> {\n return Text.alignMapBaseline;\n }\n\n static baselineMapAlign = {\n top: 'left',\n bottom: 'right',\n middle: 'center'\n };\n\n static alignMapBaseline = {\n left: 'top',\n right: 'bottom',\n center: 'middle'\n };\n\n /**\n * 计算垂直布局的单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalSinglelineAABBBounds(text: number | string): AABBBounds {\n const textTheme = getTheme(this).text;\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n let str: string;\n const attribute = this.attribute;\n const { ignoreBuf = textTheme.ignoreBuf } = attribute;\n const buf = ignoreBuf ? 0 : 2;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n fontFamily = textTheme.fontFamily,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n\n const lineHeight =\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf;\n\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = Text.baselineMapAlign[textBaseline] ?? 'left';\n textBaseline = Text.alignMapBaseline[t] ?? 'top';\n }\n if (!this.shouldUpdateShape() && this.cache) {\n width = this.cache.clipedWidth;\n const dx = textDrawOffsetX(textAlign, width);\n const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n let verticalList: { text: string; width?: number; direction: TextDirection }[][] = [\n verticalLayout(text.toString())\n ];\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalList[0],\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalList = [data.verticalList];\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalList[0],\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalList = [data.verticalList];\n width = data.width;\n }\n this.cache.verticalList = verticalList;\n this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalList[0].forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n this.cache.verticalList = verticalList;\n this.cache.clipedWidth = width;\n }\n this.clearUpdateShapeTag();\n\n const dx = textDrawOffsetX(textAlign, width);\n const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * @param text\n */\n updateHorizontalMultilineAABBBounds(text: (number | string)[]): AABBBounds {\n const textTheme = getTheme(this).text;\n const { wrap = textTheme.wrap } = this.attribute;\n if (wrap) {\n return this.updateWrapAABBBounds(text);\n }\n\n const attribute = this.attribute;\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n const lineHeight =\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize);\n if (whiteSpace === 'normal') {\n return this.updateWrapAABBBounds(text);\n }\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure);\n const layoutData = layoutObj.GetLayoutByLines(\n text,\n textAlign,\n textBaseline as any,\n lineHeight,\n ellipsis === true ? (textTheme.ellipsis as string) : ellipsis || undefined,\n false,\n maxLineWidth,\n suffixPosition\n );\n const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算垂直布局的多行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalMultilineAABBBounds(text: (number | string)[]): AABBBounds {\n const textTheme = getTheme(this).text;\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n const attribute = this.attribute;\n const { ignoreBuf = textTheme.ignoreBuf } = attribute;\n const buf = ignoreBuf ? 0 : 2;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n const lineHeight =\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf;\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = Text.baselineMapAlign[textBaseline] ?? 'left';\n textBaseline = Text.alignMapBaseline[t] ?? 'top';\n }\n width = 0;\n if (!this.shouldUpdateShape() && this.cache) {\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const verticalLists: { text: string; width?: number; direction: TextDirection }[][] = text.map(str => {\n return verticalLayout(str.toString());\n });\n verticalLists.forEach((verticalData, i) => {\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n }\n // this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalData.forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n }\n });\n this.cache.verticalList = verticalLists;\n this.clearUpdateShapeTag();\n\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n protected tryUpdateOBBBounds(): OBBBounds {\n throw new Error('暂不支持');\n }\n\n getDefaultAttribute(name: string) {\n const textTheme = getTheme(this).text;\n return textTheme[name];\n }\n\n protected needUpdateTags(keys: string[], k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTags(keys, k);\n }\n protected needUpdateTag(key: string, k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTag(key, k);\n }\n\n clone(): Text {\n return new Text({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Text.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createText(attributes: ITextGraphicAttribute): IText {\n return new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sourcesContent":["import { max, type AABBBounds, type OBBBounds, isArray } from '@visactor/vutils';\nimport { getContextFont, textDrawOffsetX, textLayoutOffsetY } from '../common/text';\nimport { CanvasTextLayout } from '../core/contributions/textMeasure/layout';\nimport { application } from '../application';\nimport type { IText, ITextCache, ITextGraphicAttribute, LayoutItemType, LayoutType } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme } from './theme';\nimport { calculateLineHeight, parsePadding } from '../common/utils';\nimport { TEXT_NUMBER_TYPE } from './constants';\nimport { TextDirection, verticalLayout } from './tools';\n\nconst TEXT_UPDATE_TAG_KEY = [\n 'text',\n 'maxLineWidth',\n // 多行文本要用到\n 'textAlign',\n 'textBaseline',\n 'heightLimit',\n 'lineClamp',\n 'fontSize',\n 'fontFamily',\n 'fontWeight',\n 'ellipsis',\n 'lineHeight',\n 'direction',\n 'wordBreak',\n 'heightLimit',\n 'lineClamp',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\nexport class Text extends Graphic<ITextGraphicAttribute> implements IText {\n type: 'text' = 'text';\n\n static NOWORK_ANIMATE_ATTR = {\n ellipsis: 1,\n wordBreak: 1,\n direction: 1,\n textAlign: 1,\n textBaseline: 1,\n fontFamily: 1,\n fontWeight: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n cache: ITextCache;\n _font: string;\n\n get font(): string {\n const textTheme = getTheme(this).text;\n if (!this._font) {\n this._font = getContextFont(this.attribute, textTheme);\n }\n return this._font as string;\n }\n\n get clipedText(): string | undefined {\n const attribute = this.attribute;\n const textTheme = getTheme(this).text;\n if (!this.isSimplify()) {\n return undefined;\n }\n const { maxLineWidth = textTheme.maxLineWidth } = attribute;\n if (!Number.isFinite(maxLineWidth)) {\n return (attribute.text ?? textTheme.text).toString();\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedText;\n }\n get clipedWidth(): number | undefined {\n if (!this.isSimplify()) {\n return undefined;\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedWidth;\n }\n get cliped(): boolean | undefined {\n const textTheme = getTheme(this).text;\n const attribute = this.attribute;\n if (this.isMultiLine) {\n return undefined;\n }\n const { maxLineWidth = textTheme.maxLineWidth } = attribute;\n if (!Number.isFinite(maxLineWidth)) {\n return false;\n }\n this.tryUpdateAABBBounds();\n if (attribute.direction === 'vertical' && this.cache.verticalList && this.cache.verticalList[0]) {\n return this.cache.verticalList[0].map(item => item.text).join('') !== attribute.text.toString();\n }\n if (this.clipedText == null) {\n return false;\n }\n return this.clipedText !== attribute.text.toString();\n }\n get multilineLayout(): LayoutType | undefined {\n if (!this.isMultiLine) {\n return undefined;\n }\n this.tryUpdateAABBBounds();\n return this.cache.layoutData;\n }\n\n // 是否是简单文字\n // 单行,横排\n private isSimplify(): boolean {\n return !this.isMultiLine && this.attribute.direction !== 'vertical';\n }\n get isMultiLine(): boolean {\n return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';\n }\n\n constructor(params: ITextGraphicAttribute = { text: '', fontSize: 16 }) {\n super(params);\n this.numberType = TEXT_NUMBER_TYPE;\n this.cache = {};\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n protected _isValid(): boolean {\n const { text } = this.attribute;\n if (isArray(text)) {\n return !(text as any[]).every((t: any) => t == null || t === '');\n }\n return text != null && text !== '';\n }\n\n protected doUpdateAABBBounds(): AABBBounds {\n const textTheme = getTheme(this).text;\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = application.graphicService.updateTextAABBBounds(\n attribute,\n textTheme,\n this._AABBBounds,\n this\n ) as AABBBounds;\n\n const { boundsPadding = textTheme.boundsPadding } = this.attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n * @param text\n */\n updateWrapAABBBounds(text: (number | string) | (number | string)[]) {\n const textTheme = getTheme(this).text;\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n wordBreak = textTheme.wordBreak,\n fontWeight = textTheme.fontWeight,\n // widthLimit,\n ignoreBuf = textTheme.ignoreBuf,\n suffixPosition = textTheme.suffixPosition,\n heightLimit = 0,\n lineClamp\n } = this.attribute;\n const lineHeight =\n calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize) ??\n (this.attribute.fontSize || textTheme.fontSize);\n const buf = ignoreBuf ? 0 : 2;\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure as any) as any;\n\n // layoutObj内逻辑\n const lines = isArray(text) ? (text.map(l => l.toString()) as string[]) : [text.toString()];\n const linesLayout: LayoutItemType[] = [];\n const bboxWH: [number, number] = [0, 0];\n\n let lineCountLimit = Infinity;\n if (heightLimit > 0) {\n lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n }\n if (lineClamp) {\n // 处理行数限制\n lineCountLimit = Math.min(lineCountLimit, lineClamp);\n }\n\n if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n // widthLimit > 0\n if (maxLineWidth > 0) {\n for (let i = 0; i < lines.length; i++) {\n const str = lines[i] as string;\n let needCut = true;\n // // 测量当前行宽度\n // width = Math.min(\n // layoutObj.textMeasure.measureTextWidth(str, layoutObj.textOptions),\n // maxLineWidth\n // );\n\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = layoutObj.textMeasure.clipTextWithSuffix(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n break; // 不处理后续行\n }\n\n // 测量截断位置\n const clip = layoutObj.textMeasure.clipText(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n wordBreak === 'break-word'\n );\n if (str !== '' && clip.str === '') {\n if (ellipsis) {\n const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n clip.str = clipEllipsis.str ?? '';\n clip.width = clipEllipsis.width ?? 0;\n } else {\n // 宽度限制不足一个字符,不显示\n clip.str = '';\n clip.width = 0;\n }\n needCut = false;\n }\n\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n if (clip.str.length === str.length) {\n // 不需要截断\n } else if (needCut) {\n const newStr = str.substring(clip.str.length);\n lines.splice(i + 1, 0, newStr);\n }\n }\n }\n // bboxWH[0] = maxLineWidth;\n let maxWidth = 0;\n linesLayout.forEach(layout => {\n maxWidth = Math.max(maxWidth, layout.width);\n });\n bboxWH[0] = maxWidth;\n } else {\n // 使用所有行中最长的作为lineWidth\n let lineWidth = 0;\n let width: number;\n let text: string;\n for (let i = 0, len = lines.length; i < len; i++) {\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = layoutObj.textMeasure.clipTextWithSuffix(\n lines[i],\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n lineWidth = Math.max(lineWidth, clip.width);\n break; // 不处理后续行\n }\n\n text = lines[i] as string;\n width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, wordBreak === 'break-word');\n lineWidth = Math.max(lineWidth, width);\n linesLayout.push({ str: text, width });\n }\n bboxWH[0] = lineWidth;\n }\n bboxWH[1] = linesLayout.length * (lineHeight + buf);\n\n const bbox = {\n xOffset: 0,\n yOffset: 0,\n width: bboxWH[0],\n height: bboxWH[1]\n };\n\n layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any);\n\n const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n // const layoutData = layoutObj.GetLayoutByLines(\n // text,\n // textAlign,\n // textBaseline as any,\n // lineHeight,\n // ellipsis === true ? (DefaultTextAttribute.ellipsis as string) : ellipsis || undefined,\n // maxLineWidth\n // );\n // const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateSingallineAABBBounds(text: number | string): AABBBounds {\n const textTheme = getTheme(this).text;\n const { direction = textTheme.direction } = this.attribute;\n\n return direction === 'horizontal'\n ? this.updateHorizontalSinglelineAABBBounds(text)\n : this.updateVerticalSinglelineAABBBounds(text);\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateMultilineAABBBounds(text: (number | string)[]): AABBBounds {\n const textTheme = getTheme(this).text;\n const { direction = textTheme.direction } = this.attribute;\n\n return direction === 'horizontal'\n ? this.updateHorizontalMultilineAABBBounds(text)\n : this.updateVerticalMultilineAABBBounds(text);\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateHorizontalSinglelineAABBBounds(text: number | string): AABBBounds {\n const textTheme = getTheme(this).text;\n const { wrap = textTheme.wrap } = this.attribute;\n if (wrap) {\n return this.updateWrapAABBBounds([text]);\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n let str: string;\n const attribute = this.attribute;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n ignoreBuf = textTheme.ignoreBuf,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n if (whiteSpace === 'normal') {\n return this.updateWrapAABBBounds(text);\n }\n const buf = ignoreBuf ? 0 : Math.max(2, fontSize * 0.075);\n const textFontSize = attribute.fontSize || textTheme.fontSize;\n const lineHeight = calculateLineHeight(attribute.lineHeight, textFontSize) ?? textFontSize + buf;\n if (!this.shouldUpdateShape() && this.cache) {\n width = this.cache.clipedWidth ?? 0;\n const dx = textDrawOffsetX(textAlign, width);\n const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffix(\n text.toString(),\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n str = data.str;\n width = data.width;\n } else {\n const data = textMeasure.clipText(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, false);\n str = data.str;\n width = data.width;\n }\n this.cache.clipedText = str;\n this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = textMeasure.measureTextWidth(text.toString(), { fontSize, fontWeight, fontFamily });\n this.cache.clipedText = text.toString();\n this.cache.clipedWidth = width;\n }\n this.clearUpdateShapeTag();\n\n const dx = textDrawOffsetX(textAlign, width);\n let lh = lineHeight;\n if (application.global && application.global.isSafari()) {\n // 如果是safari,那么需要额外增加高度\n lh += fontSize * 0.2;\n }\n const dy = textLayoutOffsetY(textBaseline, lh, fontSize, buf);\n this._AABBBounds.set(dx, dy, dx + width, dy + lh);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n getBaselineMapAlign(): Record<string, string> {\n return Text.baselineMapAlign;\n }\n\n getAlignMapBaseline(): Record<string, string> {\n return Text.alignMapBaseline;\n }\n\n static baselineMapAlign = {\n top: 'left',\n bottom: 'right',\n middle: 'center'\n };\n\n static alignMapBaseline = {\n left: 'top',\n right: 'bottom',\n center: 'middle'\n };\n\n /**\n * 计算垂直布局的单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalSinglelineAABBBounds(text: number | string): AABBBounds {\n const textTheme = getTheme(this).text;\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n let str: string;\n const attribute = this.attribute;\n const { ignoreBuf = textTheme.ignoreBuf } = attribute;\n const buf = ignoreBuf ? 0 : 2;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n fontFamily = textTheme.fontFamily,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n\n const lineHeight =\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf;\n\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = Text.baselineMapAlign[textBaseline] ?? 'left';\n textBaseline = Text.alignMapBaseline[t] ?? 'top';\n }\n if (!this.shouldUpdateShape() && this.cache) {\n width = this.cache.clipedWidth;\n const dx = textDrawOffsetX(textAlign, width);\n const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n let verticalList: { text: string; width?: number; direction: TextDirection }[][] = [\n verticalLayout(text.toString())\n ];\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalList[0],\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalList = [data.verticalList];\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalList[0],\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalList = [data.verticalList];\n width = data.width;\n }\n this.cache.verticalList = verticalList;\n this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalList[0].forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n this.cache.verticalList = verticalList;\n this.cache.clipedWidth = width;\n }\n this.clearUpdateShapeTag();\n\n const dx = textDrawOffsetX(textAlign, width);\n const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * @param text\n */\n updateHorizontalMultilineAABBBounds(text: (number | string)[]): AABBBounds {\n const textTheme = getTheme(this).text;\n const { wrap = textTheme.wrap } = this.attribute;\n if (wrap) {\n return this.updateWrapAABBBounds(text);\n }\n\n const attribute = this.attribute;\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n // ignoreBuf = textTheme.ignoreBuf,\n lineWidth = textTheme.lineWidth,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n // const buf = ignoreBuf ? 0 : Math.max(2, fontSize * 0.075);\n const lineHeight =\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize);\n if (whiteSpace === 'normal') {\n return this.updateWrapAABBBounds(text);\n }\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure);\n const layoutData = layoutObj.GetLayoutByLines(\n text,\n textAlign,\n textBaseline as any,\n lineHeight,\n ellipsis === true ? (textTheme.ellipsis as string) : ellipsis || undefined,\n false,\n maxLineWidth,\n suffixPosition\n );\n const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算垂直布局的多行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalMultilineAABBBounds(text: (number | string)[]): AABBBounds {\n const textTheme = getTheme(this).text;\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n const attribute = this.attribute;\n const { ignoreBuf = textTheme.ignoreBuf } = attribute;\n const buf = ignoreBuf ? 0 : 2;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n const lineHeight =\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf;\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = Text.baselineMapAlign[textBaseline] ?? 'left';\n textBaseline = Text.alignMapBaseline[t] ?? 'top';\n }\n width = 0;\n if (!this.shouldUpdateShape() && this.cache) {\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const verticalLists: { text: string; width?: number; direction: TextDirection }[][] = text.map(str => {\n return verticalLayout(str.toString());\n });\n verticalLists.forEach((verticalData, i) => {\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n }\n // this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalData.forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n }\n });\n this.cache.verticalList = verticalLists;\n this.clearUpdateShapeTag();\n\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n protected tryUpdateOBBBounds(): OBBBounds {\n throw new Error('暂不支持');\n }\n\n getDefaultAttribute(name: string) {\n const textTheme = getTheme(this).text;\n return textTheme[name];\n }\n\n protected needUpdateTags(keys: string[], k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTags(keys, k);\n }\n protected needUpdateTag(key: string, k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTag(key, k);\n }\n\n clone(): Text {\n return new Text({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Text.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createText(attributes: ITextGraphicAttribute): IText {\n return new Text(attributes);\n}\n\n// addAttributeToPrototype(DefaultLineStyle, Text, PURE_STYLE_KEY);\n"]}
|
package/es/graphic/theme.js
CHANGED
|
@@ -112,7 +112,7 @@ export const globalTheme = new Theme;
|
|
|
112
112
|
|
|
113
113
|
export function getTheme(graphic, theme) {
|
|
114
114
|
return graphic.glyphHost ? getTheme(graphic.glyphHost) : theme ? (graphic.isContainer,
|
|
115
|
-
theme) : getThemeFromGroup(graphic) || globalTheme.getTheme();
|
|
115
|
+
theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic) || globalTheme.getTheme();
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
export function getThemeFromGroup(graphic) {
|
package/es/graphic/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,mBAAmB;IACxB,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,sBAAsB;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,sBAAsB;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,sBAAsB;IAC9B,OAAO,EAAE,uBAAuB;IAChC,QAAQ,EAAE,wBAAwB;IAClC,YAAY,EAAE,4BAA4B;IAC1C,KAAK,EAAE,qBAAqB;IAC5B,KAAK,EAAE,qBAAqB;IAC5B,KAAK,EAAE,qBAAqB;CAC7B,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAE/C,MAAM,UAAU,WAAW;IACzB,OAAO;QACL,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,GAAG,CAAC;QAC3C,IAAI,E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G,CAAC,CAAC,MAAM,CAAC;SACd;QACD,IAAI,CAAC,CAAC,EAAE;YACN,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;SAC/B;QACD,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;YACZ,CAAC,CAAC,WAAW,EAAE,CAAC;SACjB;QACD,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAW,CAAC,CAAC;KACtC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","file":"theme.js","sourcesContent":["import { Logger, clone } from '@visactor/vutils';\nimport type { IGraphicAttribute, IFullThemeSpec, IGraphic, IGroup, ITheme, IThemeSpec } from '../interface';\nimport {\n DefaultArcAttribute,\n DefaultAreaAttribute,\n DefaultCircleAttribute,\n DefaultGlyphAttribute,\n DefaultGroupAttribute,\n DefaultImageAttribute,\n DefaultLineAttribute,\n DefaultPathAttribute,\n DefaultPolygonAttribute,\n DefaultRect3dAttribute,\n DefaultRectAttribute,\n DefaultSymbolAttribute,\n DefaultTextAttribute,\n DefaultRichTextAttribute,\n DefaultRichTextIconAttribute\n} from './config';\n\nconst defaultThemeObj = {\n arc: DefaultArcAttribute,\n area: DefaultAreaAttribute,\n circle: DefaultCircleAttribute,\n line: DefaultLineAttribute,\n path: DefaultPathAttribute,\n symbol: DefaultSymbolAttribute,\n text: DefaultTextAttribute,\n rect: DefaultRectAttribute,\n rect3d: DefaultRect3dAttribute,\n polygon: DefaultPolygonAttribute,\n richtext: DefaultRichTextAttribute,\n richtextIcon: DefaultRichTextIconAttribute,\n image: DefaultImageAttribute,\n group: DefaultGroupAttribute,\n glyph: DefaultGlyphAttribute\n};\n\nconst themeKeys = Object.keys(defaultThemeObj);\n\nexport function newThemeObj(): IFullThemeSpec {\n return {\n arc: Object.assign({}, defaultThemeObj.arc),\n area: Object.assign({}, defaultThemeObj.area),\n circle: Object.assign({}, defaultThemeObj.circle),\n line: Object.assign({}, defaultThemeObj.line),\n path: Object.assign({}, defaultThemeObj.path),\n symbol: Object.assign({}, defaultThemeObj.symbol),\n text: Object.assign({}, defaultThemeObj.text),\n rect: Object.assign({}, defaultThemeObj.rect),\n rect3d: Object.assign({}, defaultThemeObj.rect3d),\n polygon: Object.assign({}, defaultThemeObj.polygon),\n richtext: Object.assign({}, defaultThemeObj.richtext),\n richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),\n image: Object.assign({}, defaultThemeObj.image),\n group: Object.assign({}, defaultThemeObj.group),\n glyph: Object.assign({}, defaultThemeObj.glyph)\n };\n}\n\n// /**\n// * 将t合并到out中\n// * @param out\n// * @param t\n// * @param rewrite 是否重写out的属性\n// * @returns\n// */\n// function combineTheme(out: IThemeSpec, t: IThemeSpec, rewrite: boolean = true) {\n// if (!t) {\n// return;\n// }\n// if (rewrite) {\n// Object.keys(t).forEach(k => {\n// if (out[k]) {\n// Object.assign(out[k], t[k]);\n// } else {\n// out[k] = t[k];\n// }\n// });\n// } else {\n// Object.keys(t).forEach(k => {\n// if (out[k]) {\n// // Object.assign(out[k], t[k]);\n// const outItem = out[k];\n// const tItem = t[k];\n// Object.keys(t[k]).forEach(kItem => {\n// if (outItem[kItem] === undefined) {\n// outItem[kItem] = tItem[kItem];\n// }\n// });\n// } else {\n// out[k] = t[k];\n// }\n// });\n// }\n// }\n\nfunction combine(out: Record<string, any>, t: Record<string, any>) {\n Object.keys(t).forEach(k => {\n out[k] = t[k];\n });\n}\n\nconst globalThemeObj = newThemeObj();\n\n// // 性能优化,没有修改的theme都使用这个\n// const defaultCommontTheme = newThemeObj();\n\n// function combineTheme(out: IThemeSpec, userTheme: IThemeSpec, defaultTheme: IFullThemeSpec) {\n\n// }\n\n// 优先级:\n// 1. userTheme\n// 2. commonTheme\n// 3. parentTheme\n// 4. defaultTheme\n\n// 使用原型链来保存主题,避免大量的merge操作\nexport class Theme implements ITheme {\n // 当前的总theme,最终合并后的theme\n combinedTheme: IFullThemeSpec;\n // 记录累计应用的所有用户设置上的theme\n userTheme?: IThemeSpec;\n\n protected _defaultTheme: IFullThemeSpec;\n\n dirty: boolean;\n\n constructor() {\n this.initTheme();\n this.dirty = false;\n }\n\n initTheme() {\n this._defaultTheme = {} as any;\n themeKeys.forEach(key => {\n this._defaultTheme[key] = Object.create(globalThemeObj[key]);\n });\n this.combinedTheme = this._defaultTheme;\n }\n\n /**\n * 获取group上应该有的主题配置\n * @param group\n * @returns\n */\n getTheme(group?: IGroup) {\n if (!group) {\n return this.combinedTheme;\n }\n if (!this.dirty) {\n return this.combinedTheme;\n }\n let parentTheme = {};\n const parentGroup = this.getParentWithTheme(group);\n if (parentGroup) {\n parentTheme = parentGroup.theme;\n }\n this.applyTheme(group, parentTheme);\n return this.combinedTheme;\n }\n\n // 获取具有主题的parent\n getParentWithTheme(group: IGroup) {\n while (group.parent) {\n group = group.parent;\n if (group.theme) {\n return group;\n }\n }\n return null;\n }\n\n // 应用主题,从根节点一直触发到当前节点(如果上层节点需要的话)\n applyTheme(group: IGroup, pt: IThemeSpec, force: boolean = false): IThemeSpec {\n if (this.dirty) {\n const parentGroup = this.getParentWithTheme(group);\n if (parentGroup) {\n const parentTheme = parentGroup.theme;\n if (parentTheme.dirty || force) {\n // 强制apply所有的上层\n parentTheme.applyTheme(parentGroup, pt, true);\n }\n }\n // 如果当前节点没有userTheme的话,直接复用上层的combinedTheme\n // 或者直接用默认的theme\n if (!this.userTheme) {\n if (parentGroup) {\n this.combinedTheme = parentGroup.theme.combinedTheme;\n } else {\n this.combinedTheme = this._defaultTheme;\n Logger.getInstance().warn('未知错误,走到不应该走的区域里');\n }\n this.dirty = false;\n } else {\n this.doCombine(parentGroup && parentGroup.theme.combinedTheme);\n }\n }\n\n return this.combinedTheme;\n }\n\n // 合并userTheme到combinedTheme\n protected doCombine(parentCombinedTheme?: IThemeSpec) {\n const userTheme = this.userTheme;\n const combinedTheme = this.combinedTheme;\n\n // 1. userTheme\n // 2. combinedTheme\n // 3. parentCombinedTheme\n // 4. defaultTheme\n themeKeys.forEach(k => {\n // init defaultTheme\n const obj = Object.create(globalThemeObj[k]);\n // merge parentCombinedTheme\n if (parentCombinedTheme && parentCombinedTheme[k]) {\n combine(obj, parentCombinedTheme[k]);\n }\n // merge combinedTheme\n if (combinedTheme[k]) {\n combine(obj, combinedTheme[k]);\n }\n // merge userTheme\n if (userTheme[k]) {\n combine(obj, userTheme[k]);\n }\n this.combinedTheme[k] = obj;\n });\n if (userTheme.common) {\n themeKeys.forEach(k => {\n combine(this.combinedTheme[k], userTheme.common);\n });\n }\n this.dirty = false;\n }\n\n setTheme(t: IThemeSpec, g: IGroup) {\n // 设置自己的nextTheme\n let userTheme = this.userTheme;\n if (userTheme) {\n Object.keys(t).forEach(k => {\n if (userTheme[k]) {\n Object.assign(userTheme[k], t[k]);\n } else {\n // todo,这里调用次数不多,应该问题不大\n userTheme[k] = Object.assign({}, t[k]);\n }\n });\n } else {\n userTheme = t;\n }\n this.userTheme = userTheme;\n // 设置自己和子节点的theme都为dirty\n this.dirty = true;\n this.dirtyChildren(g);\n }\n\n resetTheme(t: IThemeSpec, g: IGroup) {\n this.userTheme = t;\n // 设置自己和子节点的theme都为dirty\n this.dirty = true;\n this.dirtyChildren(g);\n }\n\n dirtyChildren(g: IGroup) {\n g.forEachChildren(item => {\n if ((item as IGroup).isContainer) {\n if ((item as IGroup).theme) {\n (item as IGroup).theme.dirty = true;\n }\n this.dirtyChildren(item as IGroup);\n }\n });\n }\n}\n\nexport const globalTheme = new Theme();\n\nexport function getTheme(graphic: IGraphic, theme?: IFullThemeSpec): IFullThemeSpec {\n if (graphic.glyphHost) {\n return getTheme(graphic.glyphHost);\n }\n if (theme) {\n if (graphic.isContainer) {\n // 暂时不支持Group\n return theme;\n }\n return theme;\n }\n\n return getThemeFromGroup(graphic) || globalTheme.getTheme();\n}\n\nexport function getThemeFromGroup(graphic: IGraphic): IFullThemeSpec | null {\n let g: IGroup;\n if (graphic.isContainer) {\n // 找到存在theme的group\n g = graphic as IGroup;\n } else {\n g = graphic.parent;\n }\n\n if (g) {\n while (g) {\n if (g.theme) {\n break;\n }\n g = g.parent;\n }\n if (!g) {\n return globalTheme.getTheme();\n }\n if (!g.theme) {\n g.createTheme();\n }\n return g.theme.getTheme(g as IGroup);\n }\n return null;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,mBAAmB;IACxB,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,sBAAsB;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,sBAAsB;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,sBAAsB;IAC9B,OAAO,EAAE,uBAAuB;IAChC,QAAQ,EAAE,wBAAwB;IAClC,YAAY,EAAE,4BAA4B;IAC1C,KAAK,EAAE,qBAAqB;IAC5B,KAAK,EAAE,qBAAqB;IAC5B,KAAK,EAAE,qBAAqB;CAC7B,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAE/C,MAAM,UAAU,WAAW;IACzB,OAAO;QACL,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,GAAG,CAAC;QAC3C,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC;QAC7C,MAAM,EAAE,MAAM,CA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AAG,CAAC,CAAC,MAAM,CAAC;SACd;QACD,IAAI,CAAC,CAAC,EAAE;YACN,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;SAC/B;QACD,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;YACZ,CAAC,CAAC,WAAW,EAAE,CAAC;SACjB;QACD,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAW,CAAC,CAAC;KACtC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","file":"theme.js","sourcesContent":["import { Logger, clone } from '@visactor/vutils';\nimport type { IGraphicAttribute, IFullThemeSpec, IGraphic, IGroup, ITheme, IThemeSpec } from '../interface';\nimport {\n DefaultArcAttribute,\n DefaultAreaAttribute,\n DefaultCircleAttribute,\n DefaultGlyphAttribute,\n DefaultGroupAttribute,\n DefaultImageAttribute,\n DefaultLineAttribute,\n DefaultPathAttribute,\n DefaultPolygonAttribute,\n DefaultRect3dAttribute,\n DefaultRectAttribute,\n DefaultSymbolAttribute,\n DefaultTextAttribute,\n DefaultRichTextAttribute,\n DefaultRichTextIconAttribute\n} from './config';\n\nconst defaultThemeObj = {\n arc: DefaultArcAttribute,\n area: DefaultAreaAttribute,\n circle: DefaultCircleAttribute,\n line: DefaultLineAttribute,\n path: DefaultPathAttribute,\n symbol: DefaultSymbolAttribute,\n text: DefaultTextAttribute,\n rect: DefaultRectAttribute,\n rect3d: DefaultRect3dAttribute,\n polygon: DefaultPolygonAttribute,\n richtext: DefaultRichTextAttribute,\n richtextIcon: DefaultRichTextIconAttribute,\n image: DefaultImageAttribute,\n group: DefaultGroupAttribute,\n glyph: DefaultGlyphAttribute\n};\n\nconst themeKeys = Object.keys(defaultThemeObj);\n\nexport function newThemeObj(): IFullThemeSpec {\n return {\n arc: Object.assign({}, defaultThemeObj.arc),\n area: Object.assign({}, defaultThemeObj.area),\n circle: Object.assign({}, defaultThemeObj.circle),\n line: Object.assign({}, defaultThemeObj.line),\n path: Object.assign({}, defaultThemeObj.path),\n symbol: Object.assign({}, defaultThemeObj.symbol),\n text: Object.assign({}, defaultThemeObj.text),\n rect: Object.assign({}, defaultThemeObj.rect),\n rect3d: Object.assign({}, defaultThemeObj.rect3d),\n polygon: Object.assign({}, defaultThemeObj.polygon),\n richtext: Object.assign({}, defaultThemeObj.richtext),\n richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),\n image: Object.assign({}, defaultThemeObj.image),\n group: Object.assign({}, defaultThemeObj.group),\n glyph: Object.assign({}, defaultThemeObj.glyph)\n };\n}\n\n// /**\n// * 将t合并到out中\n// * @param out\n// * @param t\n// * @param rewrite 是否重写out的属性\n// * @returns\n// */\n// function combineTheme(out: IThemeSpec, t: IThemeSpec, rewrite: boolean = true) {\n// if (!t) {\n// return;\n// }\n// if (rewrite) {\n// Object.keys(t).forEach(k => {\n// if (out[k]) {\n// Object.assign(out[k], t[k]);\n// } else {\n// out[k] = t[k];\n// }\n// });\n// } else {\n// Object.keys(t).forEach(k => {\n// if (out[k]) {\n// // Object.assign(out[k], t[k]);\n// const outItem = out[k];\n// const tItem = t[k];\n// Object.keys(t[k]).forEach(kItem => {\n// if (outItem[kItem] === undefined) {\n// outItem[kItem] = tItem[kItem];\n// }\n// });\n// } else {\n// out[k] = t[k];\n// }\n// });\n// }\n// }\n\nfunction combine(out: Record<string, any>, t: Record<string, any>) {\n Object.keys(t).forEach(k => {\n out[k] = t[k];\n });\n}\n\nconst globalThemeObj = newThemeObj();\n\n// // 性能优化,没有修改的theme都使用这个\n// const defaultCommontTheme = newThemeObj();\n\n// function combineTheme(out: IThemeSpec, userTheme: IThemeSpec, defaultTheme: IFullThemeSpec) {\n\n// }\n\n// 优先级:\n// 1. userTheme\n// 2. commonTheme\n// 3. parentTheme\n// 4. defaultTheme\n\n// 使用原型链来保存主题,避免大量的merge操作\nexport class Theme implements ITheme {\n // 当前的总theme,最终合并后的theme\n combinedTheme: IFullThemeSpec;\n // 记录累计应用的所有用户设置上的theme\n userTheme?: IThemeSpec;\n\n protected _defaultTheme: IFullThemeSpec;\n\n dirty: boolean;\n\n constructor() {\n this.initTheme();\n this.dirty = false;\n }\n\n initTheme() {\n this._defaultTheme = {} as any;\n themeKeys.forEach(key => {\n this._defaultTheme[key] = Object.create(globalThemeObj[key]);\n });\n this.combinedTheme = this._defaultTheme;\n }\n\n /**\n * 获取group上应该有的主题配置\n * @param group\n * @returns\n */\n getTheme(group?: IGroup) {\n if (!group) {\n return this.combinedTheme;\n }\n if (!this.dirty) {\n return this.combinedTheme;\n }\n let parentTheme = {};\n const parentGroup = this.getParentWithTheme(group);\n if (parentGroup) {\n parentTheme = parentGroup.theme;\n }\n this.applyTheme(group, parentTheme);\n return this.combinedTheme;\n }\n\n // 获取具有主题的parent\n getParentWithTheme(group: IGroup) {\n while (group.parent) {\n group = group.parent;\n if (group.theme) {\n return group;\n }\n }\n return null;\n }\n\n // 应用主题,从根节点一直触发到当前节点(如果上层节点需要的话)\n applyTheme(group: IGroup, pt: IThemeSpec, force: boolean = false): IThemeSpec {\n if (this.dirty) {\n const parentGroup = this.getParentWithTheme(group);\n if (parentGroup) {\n const parentTheme = parentGroup.theme;\n if (parentTheme.dirty || force) {\n // 强制apply所有的上层\n parentTheme.applyTheme(parentGroup, pt, true);\n }\n }\n // 如果当前节点没有userTheme的话,直接复用上层的combinedTheme\n // 或者直接用默认的theme\n if (!this.userTheme) {\n if (parentGroup) {\n this.combinedTheme = parentGroup.theme.combinedTheme;\n } else {\n this.combinedTheme = this._defaultTheme;\n Logger.getInstance().warn('未知错误,走到不应该走的区域里');\n }\n this.dirty = false;\n } else {\n this.doCombine(parentGroup && parentGroup.theme.combinedTheme);\n }\n }\n\n return this.combinedTheme;\n }\n\n // 合并userTheme到combinedTheme\n protected doCombine(parentCombinedTheme?: IThemeSpec) {\n const userTheme = this.userTheme;\n const combinedTheme = this.combinedTheme;\n\n // 1. userTheme\n // 2. combinedTheme\n // 3. parentCombinedTheme\n // 4. defaultTheme\n themeKeys.forEach(k => {\n // init defaultTheme\n const obj = Object.create(globalThemeObj[k]);\n // merge parentCombinedTheme\n if (parentCombinedTheme && parentCombinedTheme[k]) {\n combine(obj, parentCombinedTheme[k]);\n }\n // merge combinedTheme\n if (combinedTheme[k]) {\n combine(obj, combinedTheme[k]);\n }\n // merge userTheme\n if (userTheme[k]) {\n combine(obj, userTheme[k]);\n }\n this.combinedTheme[k] = obj;\n });\n if (userTheme.common) {\n themeKeys.forEach(k => {\n combine(this.combinedTheme[k], userTheme.common);\n });\n }\n this.dirty = false;\n }\n\n setTheme(t: IThemeSpec, g: IGroup) {\n // 设置自己的nextTheme\n let userTheme = this.userTheme;\n if (userTheme) {\n Object.keys(t).forEach(k => {\n if (userTheme[k]) {\n Object.assign(userTheme[k], t[k]);\n } else {\n // todo,这里调用次数不多,应该问题不大\n userTheme[k] = Object.assign({}, t[k]);\n }\n });\n } else {\n userTheme = t;\n }\n this.userTheme = userTheme;\n // 设置自己和子节点的theme都为dirty\n this.dirty = true;\n this.dirtyChildren(g);\n }\n\n resetTheme(t: IThemeSpec, g: IGroup) {\n this.userTheme = t;\n // 设置自己和子节点的theme都为dirty\n this.dirty = true;\n this.dirtyChildren(g);\n }\n\n dirtyChildren(g: IGroup) {\n g.forEachChildren(item => {\n if ((item as IGroup).isContainer) {\n if ((item as IGroup).theme) {\n (item as IGroup).theme.dirty = true;\n }\n this.dirtyChildren(item as IGroup);\n }\n });\n }\n}\n\nexport const globalTheme = new Theme();\n\nexport function getTheme(graphic: IGraphic, theme?: IFullThemeSpec): IFullThemeSpec {\n if (graphic.glyphHost) {\n return getTheme(graphic.glyphHost);\n }\n if (theme) {\n if (graphic.isContainer) {\n // 暂时不支持Group\n return theme;\n }\n return theme;\n }\n\n return (\n getThemeFromGroup(graphic) ||\n (graphic.attachedThemeGraphic && getTheme(graphic.attachedThemeGraphic)) ||\n globalTheme.getTheme()\n );\n}\n\nexport function getThemeFromGroup(graphic: IGraphic): IFullThemeSpec | null {\n let g: IGroup;\n if (graphic.isContainer) {\n // 找到存在theme的group\n g = graphic as IGroup;\n } else {\n g = graphic.parent;\n }\n\n if (g) {\n while (g) {\n if (g.theme) {\n break;\n }\n g = g.parent;\n }\n if (!g) {\n return globalTheme.getTheme();\n }\n if (!g.theme) {\n g.createTheme();\n }\n return g.theme.getTheme(g as IGroup);\n }\n return null;\n}\n"]}
|
package/es/interface/event.d.ts
CHANGED
|
@@ -160,6 +160,8 @@ export type RenderConfig = {
|
|
|
160
160
|
viewBox?: IBounds;
|
|
161
161
|
};
|
|
162
162
|
clickInterval?: number;
|
|
163
|
+
supportsTouchEvents?: boolean;
|
|
164
|
+
supportsPointerEvents?: boolean;
|
|
163
165
|
};
|
|
164
166
|
export type NativeEvent = MouseEvent | PointerEvent | TouchEvent;
|
|
165
167
|
export type GraphicEventType = 'pointerdown' | 'pointerup' | 'pointerupoutside' | 'pointertap' | 'pointerover' | 'pointerenter' | 'pointerleave' | 'pointerout' | 'mousedown' | 'mouseup' | 'mouseupoutside' | 'rightdown' | 'rightup' | 'rightupoutside' | 'click' | 'dblclick' | 'mousemove' | 'mouseover' | 'mouseout' | 'mouseenter' | 'mouseleave' | 'wheel' | 'tap' | 'touchstart' | 'touchend' | 'touchendoutside' | 'touchmove' | 'touchcancel' | 'dragstart' | 'drag' | 'dragenter' | 'dragleave' | 'dragover' | 'dragend' | 'drop' | 'pan' | 'panstart' | 'panend' | 'press' | 'pressup' | 'pressend' | 'pinch' | 'pinchstart' | 'pinchend' | 'swipe';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/event.ts"],"names":[],"mappings":"","file":"event.js","sourcesContent":["import type { INode } from './node-tree';\nimport type { Dict, IBounds } from '@visactor/vutils';\nimport type { Cursor, IGraphicAttribute } from './graphic';\nimport type { IDomRectLike, IEventElement } from './common';\nimport type { ICanvas } from './canvas';\nimport type { IGlobal } from './global';\n\nexport type EventPoint = {\n x: number;\n y: number;\n};\n\nexport interface IEventManager {\n rootTarget: IEventTarget;\n dispatch: any;\n cursor: Cursor | string;\n addEventMapping: (type: string, fn: (e: IFederatedEvent, target: IEventTarget) => void) => void;\n dispatchEvent: (e: IFederatedEvent, type?: string) => void;\n mapEvent: (e: IFederatedEvent) => void;\n propagate: (e: IFederatedEvent, type?: string) => void;\n propagationPath: (target: IEventTarget) => IEventTarget[];\n copyWheelData: (from: IFederatedWheelEvent, to: IFederatedWheelEvent) => void;\n copyPointerData: (from: IFederatedEvent, to: IFederatedEvent) => void;\n copyMouseData: (from: IFederatedEvent, to: IFederatedEvent) => void;\n copyData: (from: IFederatedEvent, to: IFederatedEvent) => void;\n}\n\nexport interface IFederatedEvent<N = Event> {\n bubbles: boolean;\n cancelBubble: boolean;\n cancelable: boolean;\n composed: boolean;\n currentTarget: IEventTarget | null;\n defaultPrevented: boolean;\n eventPhase: number;\n isTrusted: boolean;\n returnValue: boolean;\n srcElement: IEventTarget;\n target: IEventTarget | null;\n timeStamp: number;\n type: string;\n nativeEvent: N;\n originalEvent: IFederatedEvent<N> | null;\n propagationStopped: boolean;\n propagationImmediatelyStopped: boolean;\n path: IEventTarget[];\n manager?: IEventManager;\n detail: any;\n view: any;\n layer: EventPoint;\n get layerX(): number;\n get layerY(): number;\n page: EventPoint;\n get pageX(): number;\n get pageY(): number;\n canvas: EventPoint;\n get x(): number;\n get y(): number;\n get canvasX(): number;\n get canvasY(): number;\n viewport: EventPoint;\n get viewX(): number;\n get viewY(): number;\n composedPath: () => IEventTarget[];\n preventDefault: () => void;\n stopImmediatePropagation: () => void;\n stopPropagation: () => void;\n initEvent: () => void;\n initUIEvent: () => void;\n clone: () => void;\n which: number;\n}\n\nexport interface IFederatedMouseEvent extends IFederatedEvent {\n altKey: boolean;\n button: number;\n buttons: number;\n ctrlKey: boolean;\n metaKey: boolean;\n relatedTarget: EventTarget | null;\n shiftKey: boolean;\n client: EventPoint;\n get clientX(): number;\n get clientY(): number;\n detail: number;\n movement: EventPoint;\n get movementX(): number;\n get movementY(): number;\n offset: EventPoint;\n get offsetX(): number;\n get offsetY(): number;\n global: EventPoint;\n get globalX(): number;\n get globalY(): number;\n screen: EventPoint;\n get screenX(): number;\n get screenY(): number;\n getModifierState: (key: string) => boolean;\n initMouseEvent: (\n _typeArg: string,\n _canBubbleArg: boolean,\n _cancelableArg: boolean,\n _viewArg: Window,\n _detailArg: number,\n _screenXArg: number,\n _screenYArg: number,\n _clientXArg: number,\n _clientYArg: number,\n _ctrlKeyArg: boolean,\n _altKeyArg: boolean,\n _shiftKeyArg: boolean,\n _metaKeyArg: boolean,\n _buttonArg: number,\n _relatedTargetArg: EventTarget\n ) => void;\n}\n\nexport interface IFederatedWheelEvent extends IFederatedMouseEvent {\n deltaMode: number;\n deltaX: number;\n deltaY: number;\n deltaZ: number;\n clone: () => IFederatedWheelEvent;\n}\n\nexport interface IFederatedPointerEvent extends IFederatedMouseEvent {\n pointerId: number;\n width: number;\n height: number;\n isPrimary: boolean;\n pointerType: string;\n pressure: number;\n tangentialPressure: number;\n tiltX: number;\n tiltY: number;\n twist: number;\n detail: number;\n getCoalescedEvents: () => PointerEvent[];\n getPredictedEvents: () => PointerEvent[];\n clone: () => IFederatedPointerEvent;\n}\n\n/**\n * 代码参考自 https://github.com/pixijs/pixijs\n * The MIT License\n\n Copyright (c) 2013-2023 Mathew Groves, Chad Engler\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\nexport interface IEventTarget extends INode {\n /** Whether this event target should fire UI events. */\n pickable: boolean;\n /** The parent of this event target. */\n parent: IEventTarget | null;\n /** Whether this event target should be visible. */\n visible: boolean;\n\n /** The children of this event target. */\n children?: IEventTarget[];\n\n /** Whether this event target has any children that need UI events. This can be used optimize event propagation. */\n childrenPickable?: boolean;\n\n attribute?: Partial<IGraphicAttribute>;\n\n emit: (eventName: any, data: Dict<any>) => boolean;\n\n getCursor: () => string;\n setCursor: (c?: string) => void;\n}\n\nexport interface IRender {\n visualCanvas: {\n getCanvas: () => HTMLElement;\n };\n pickEvent: (position: [number, number], children: IEventTarget[], geoPick?: boolean) => IEventTarget | null;\n [key: string]: any;\n}\n\n// 事件系统扩展接口\nexport interface IEventExtension {\n /**\n * bind events\n */\n initEvents: () => void;\n /**\n * unbind events\n */\n removeEvents: () => void;\n /**\n * release\n */\n release: () => void;\n}\n\nexport type LooseFunction = (...args: any[]) => any;\n\nexport type IElementLike = Omit<IEventElement, 'on' | 'off' | 'once' | 'emit' | 'removeAllListeners'> & {\n style: CSSStyleDeclaration | Record<string, any>;\n getNativeHandler?: () => ICanvas;\n getBoundingClientRect: () => IDomRectLike;\n};\n\nexport type RenderConfig = {\n /**\n * 事件绑定的 canvas 元素\n */\n targetElement: IElementLike;\n /**\n * 环境分辨率\n */\n resolution: number;\n /**\n * 场景树根节点\n */\n rootNode: IEventTarget;\n global: IGlobal;\n /** 是否自动阻止事件 */\n autoPreventDefault?: boolean;\n /** 绘图视口 */\n viewport: {\n x: number;\n y: number;\n width: number;\n height: number;\n viewBox?: IBounds;\n };\n /**\n * 多次点击之间的最大时间,默认为 200 ms\n * @default 200\n */\n clickInterval?: number;\n};\n\nexport type NativeEvent = MouseEvent | PointerEvent | TouchEvent;\n\nexport type GraphicEventType =\n | 'pointerdown'\n | 'pointerup'\n // 指针抬起与按下的图形不同时触发\n | 'pointerupoutside'\n | 'pointertap'\n | 'pointerover'\n | 'pointerenter'\n | 'pointerleave'\n | 'pointerout'\n | 'mousedown'\n | 'mouseup'\n | 'mouseupoutside'\n // 右键操作\n | 'rightdown'\n | 'rightup'\n | 'rightupoutside'\n | 'click'\n // 双击\n | 'dblclick'\n | 'mousemove'\n | 'mouseover'\n | 'mouseout'\n // 不会冒泡\n | 'mouseenter'\n // 不会冒泡\n | 'mouseleave'\n | 'wheel'\n | 'tap'\n | 'touchstart'\n | 'touchend'\n | 'touchendoutside'\n | 'touchmove'\n | 'touchcancel'\n // dragNdrop\n | 'dragstart'\n | 'drag'\n | 'dragenter'\n | 'dragleave'\n | 'dragover'\n | 'dragend'\n | 'drop'\n // gesture\n | 'pan'\n | 'panstart'\n | 'panend'\n | 'press'\n | 'pressup'\n | 'pressend'\n | 'pinch'\n | 'pinchstart'\n | 'pinchend'\n | 'swipe';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/interface/event.ts"],"names":[],"mappings":"","file":"event.js","sourcesContent":["import type { INode } from './node-tree';\nimport type { Dict, IBounds } from '@visactor/vutils';\nimport type { Cursor, IGraphicAttribute } from './graphic';\nimport type { IDomRectLike, IEventElement } from './common';\nimport type { ICanvas } from './canvas';\nimport type { IGlobal } from './global';\n\nexport type EventPoint = {\n x: number;\n y: number;\n};\n\nexport interface IEventManager {\n rootTarget: IEventTarget;\n dispatch: any;\n cursor: Cursor | string;\n addEventMapping: (type: string, fn: (e: IFederatedEvent, target: IEventTarget) => void) => void;\n dispatchEvent: (e: IFederatedEvent, type?: string) => void;\n mapEvent: (e: IFederatedEvent) => void;\n propagate: (e: IFederatedEvent, type?: string) => void;\n propagationPath: (target: IEventTarget) => IEventTarget[];\n copyWheelData: (from: IFederatedWheelEvent, to: IFederatedWheelEvent) => void;\n copyPointerData: (from: IFederatedEvent, to: IFederatedEvent) => void;\n copyMouseData: (from: IFederatedEvent, to: IFederatedEvent) => void;\n copyData: (from: IFederatedEvent, to: IFederatedEvent) => void;\n}\n\nexport interface IFederatedEvent<N = Event> {\n bubbles: boolean;\n cancelBubble: boolean;\n cancelable: boolean;\n composed: boolean;\n currentTarget: IEventTarget | null;\n defaultPrevented: boolean;\n eventPhase: number;\n isTrusted: boolean;\n returnValue: boolean;\n srcElement: IEventTarget;\n target: IEventTarget | null;\n timeStamp: number;\n type: string;\n nativeEvent: N;\n originalEvent: IFederatedEvent<N> | null;\n propagationStopped: boolean;\n propagationImmediatelyStopped: boolean;\n path: IEventTarget[];\n manager?: IEventManager;\n detail: any;\n view: any;\n layer: EventPoint;\n get layerX(): number;\n get layerY(): number;\n page: EventPoint;\n get pageX(): number;\n get pageY(): number;\n canvas: EventPoint;\n get x(): number;\n get y(): number;\n get canvasX(): number;\n get canvasY(): number;\n viewport: EventPoint;\n get viewX(): number;\n get viewY(): number;\n composedPath: () => IEventTarget[];\n preventDefault: () => void;\n stopImmediatePropagation: () => void;\n stopPropagation: () => void;\n initEvent: () => void;\n initUIEvent: () => void;\n clone: () => void;\n which: number;\n}\n\nexport interface IFederatedMouseEvent extends IFederatedEvent {\n altKey: boolean;\n button: number;\n buttons: number;\n ctrlKey: boolean;\n metaKey: boolean;\n relatedTarget: EventTarget | null;\n shiftKey: boolean;\n client: EventPoint;\n get clientX(): number;\n get clientY(): number;\n detail: number;\n movement: EventPoint;\n get movementX(): number;\n get movementY(): number;\n offset: EventPoint;\n get offsetX(): number;\n get offsetY(): number;\n global: EventPoint;\n get globalX(): number;\n get globalY(): number;\n screen: EventPoint;\n get screenX(): number;\n get screenY(): number;\n getModifierState: (key: string) => boolean;\n initMouseEvent: (\n _typeArg: string,\n _canBubbleArg: boolean,\n _cancelableArg: boolean,\n _viewArg: Window,\n _detailArg: number,\n _screenXArg: number,\n _screenYArg: number,\n _clientXArg: number,\n _clientYArg: number,\n _ctrlKeyArg: boolean,\n _altKeyArg: boolean,\n _shiftKeyArg: boolean,\n _metaKeyArg: boolean,\n _buttonArg: number,\n _relatedTargetArg: EventTarget\n ) => void;\n}\n\nexport interface IFederatedWheelEvent extends IFederatedMouseEvent {\n deltaMode: number;\n deltaX: number;\n deltaY: number;\n deltaZ: number;\n clone: () => IFederatedWheelEvent;\n}\n\nexport interface IFederatedPointerEvent extends IFederatedMouseEvent {\n pointerId: number;\n width: number;\n height: number;\n isPrimary: boolean;\n pointerType: string;\n pressure: number;\n tangentialPressure: number;\n tiltX: number;\n tiltY: number;\n twist: number;\n detail: number;\n getCoalescedEvents: () => PointerEvent[];\n getPredictedEvents: () => PointerEvent[];\n clone: () => IFederatedPointerEvent;\n}\n\n/**\n * 代码参考自 https://github.com/pixijs/pixijs\n * The MIT License\n\n Copyright (c) 2013-2023 Mathew Groves, Chad Engler\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\nexport interface IEventTarget extends INode {\n /** Whether this event target should fire UI events. */\n pickable: boolean;\n /** The parent of this event target. */\n parent: IEventTarget | null;\n /** Whether this event target should be visible. */\n visible: boolean;\n\n /** The children of this event target. */\n children?: IEventTarget[];\n\n /** Whether this event target has any children that need UI events. This can be used optimize event propagation. */\n childrenPickable?: boolean;\n\n attribute?: Partial<IGraphicAttribute>;\n\n emit: (eventName: any, data: Dict<any>) => boolean;\n\n getCursor: () => string;\n setCursor: (c?: string) => void;\n}\n\nexport interface IRender {\n visualCanvas: {\n getCanvas: () => HTMLElement;\n };\n pickEvent: (position: [number, number], children: IEventTarget[], geoPick?: boolean) => IEventTarget | null;\n [key: string]: any;\n}\n\n// 事件系统扩展接口\nexport interface IEventExtension {\n /**\n * bind events\n */\n initEvents: () => void;\n /**\n * unbind events\n */\n removeEvents: () => void;\n /**\n * release\n */\n release: () => void;\n}\n\nexport type LooseFunction = (...args: any[]) => any;\n\nexport type IElementLike = Omit<IEventElement, 'on' | 'off' | 'once' | 'emit' | 'removeAllListeners'> & {\n style: CSSStyleDeclaration | Record<string, any>;\n getNativeHandler?: () => ICanvas;\n getBoundingClientRect: () => IDomRectLike;\n};\n\nexport type RenderConfig = {\n /**\n * 事件绑定的 canvas 元素\n */\n targetElement: IElementLike;\n /**\n * 环境分辨率\n */\n resolution: number;\n /**\n * 场景树根节点\n */\n rootNode: IEventTarget;\n global: IGlobal;\n /** 是否自动阻止事件 */\n autoPreventDefault?: boolean;\n /** 绘图视口 */\n viewport: {\n x: number;\n y: number;\n width: number;\n height: number;\n viewBox?: IBounds;\n };\n /**\n * 多次点击之间的最大时间,默认为 200 ms\n * @default 200\n */\n clickInterval?: number;\n\n /**\n * @since 0.17.15\n * 是否支持touch事件,不支持就不监听touch事件\n */\n supportsTouchEvents?: boolean;\n\n /**\n * @since 0.17.15\n * 是否支持pointer事件,不支持就监听mouse事件\n */\n supportsPointerEvents?: boolean;\n};\n\nexport type NativeEvent = MouseEvent | PointerEvent | TouchEvent;\n\nexport type GraphicEventType =\n | 'pointerdown'\n | 'pointerup'\n // 指针抬起与按下的图形不同时触发\n | 'pointerupoutside'\n | 'pointertap'\n | 'pointerover'\n | 'pointerenter'\n | 'pointerleave'\n | 'pointerout'\n | 'mousedown'\n | 'mouseup'\n | 'mouseupoutside'\n // 右键操作\n | 'rightdown'\n | 'rightup'\n | 'rightupoutside'\n | 'click'\n // 双击\n | 'dblclick'\n | 'mousemove'\n | 'mouseover'\n | 'mouseout'\n // 不会冒泡\n | 'mouseenter'\n // 不会冒泡\n | 'mouseleave'\n | 'wheel'\n | 'tap'\n | 'touchstart'\n | 'touchend'\n | 'touchendoutside'\n | 'touchmove'\n | 'touchcancel'\n // dragNdrop\n | 'dragstart'\n | 'drag'\n | 'dragenter'\n | 'dragleave'\n | 'dragover'\n | 'dragend'\n | 'drop'\n // gesture\n | 'pan'\n | 'panstart'\n | 'panend'\n | 'press'\n | 'pressup'\n | 'pressend'\n | 'pinch'\n | 'pinchstart'\n | 'pinchend'\n | 'swipe';\n"]}
|
|
@@ -32,7 +32,7 @@ export type IRichTextBasicCharacter = {
|
|
|
32
32
|
direction?: RichTextLayoutDirectionType;
|
|
33
33
|
};
|
|
34
34
|
export type IRichTextParagraphCharacter = IRichTextBasicCharacter & {
|
|
35
|
-
text: string;
|
|
35
|
+
text: string | number;
|
|
36
36
|
fontSize?: number;
|
|
37
37
|
fontFamily?: string;
|
|
38
38
|
fill?: IColor | boolean;
|
|
@@ -137,7 +137,7 @@ export interface IRichTextFrame {
|
|
|
137
137
|
wordBreak: 'break-word' | 'break-all';
|
|
138
138
|
verticalDirection: 'top' | 'middle' | 'bottom';
|
|
139
139
|
lines: IRichTextLine[];
|
|
140
|
-
globalAlign: 'left' | 'center' | 'right';
|
|
140
|
+
globalAlign: 'left' | 'center' | 'right' | 'start' | 'end';
|
|
141
141
|
globalBaseline: 'top' | 'middle' | 'bottom';
|
|
142
142
|
layoutDirection: 'horizontal' | 'vertical';
|
|
143
143
|
directionKey: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/graphic/richText.ts"],"names":[],"mappings":"","file":"richText.js","sourcesContent":["import type { IColor } from '../color';\nimport type { IContext2d } from '../context';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { IImage, IImageGraphicAttribute } from './image';\n\nexport type IRichTextAttribute = {\n width: number;\n height: number;\n ellipsis: boolean | string;\n wordBreak: RichTextWordBreak;\n verticalDirection: RichTextVerticalDirection;\n maxHeight: number;\n maxWidth: number;\n textAlign: RichTextGlobalAlignType;\n textBaseline: RichTextGlobalBaselineType;\n layoutDirection: RichTextLayoutDirectionType;\n textConfig: IRichTextCharacter[];\n singleLine: boolean;\n};\n\nexport type IRichTextGraphicAttribute = Partial<IGraphicAttribute> & Partial<IRichTextAttribute>;\n\nexport type RichTextWordBreak = 'break-word' | 'break-all';\nexport type RichTextVerticalDirection = 'top' | 'middle' | 'bottom';\nexport type RichTextGlobalAlignType = 'left' | 'right' | 'center';\nexport type RichTextGlobalBaselineType = 'top' | 'middle' | 'bottom';\nexport type RichTextLayoutDirectionType = 'horizontal' | 'vertical';\nexport type RichTextFontStyle = 'normal' | 'italic' | 'oblique';\nexport type RichTextTextDecoration = 'none' | 'underline' | 'line-through';\n// export type RichTextTextAlign = 'left' | 'right' | 'center';\nexport type RichTextScript = 'normal' | 'sub' | 'super';\n\nexport type IRichTextBasicCharacter = {\n lineHeight?: number | string;\n textAlign?: CanvasTextAlign; // left, right, center\n textBaseline?: CanvasTextBaseline;\n direction?: RichTextLayoutDirectionType;\n};\n\nexport type IRichTextParagraphCharacter = IRichTextBasicCharacter & {\n text: string;\n fontSize?: number;\n fontFamily?: string;\n fill?: IColor | boolean;\n stroke?: IColor | boolean;\n fontWeight?: string;\n // lineHeight?: number;\n fontStyle?: RichTextFontStyle; // normal, italic, oblique\n textDecoration?: RichTextTextDecoration; // none, underline, line-through\n // textAlign?: RichTextTextAlign; // left, right, center\n script?: RichTextScript; // normal, sub, super\n underline?: boolean;\n lineThrough?: boolean;\n // direction?: RichTextLayoutDirectionType;\n};\n\nexport type IRichTextImageCharacter = IRichTextBasicCharacter & {\n // 图片基础属性\n image: string | HTMLImageElement | HTMLCanvasElement;\n width: number;\n height: number;\n\n // hover相关属性\n // backgroundShow?: boolean; // 是否显示background\n backgroundShowMode?: 'always' | 'hover';\n backgroundFill?: boolean | IColor; // 背景矩形填充颜色\n backgroundFillOpacity?: number; // 背景矩形填充透明度\n backgroundStroke?: boolean | IColor; // 背景矩形边框颜色\n backgroundStrokeOpacity?: number; // 背景矩形边框透明度\n backgroundRadius?: number; // 背景矩形圆角\n // background size 同时控制了该icon的响应范围\n backgroundWidth?: number;\n backgroundHeight?: number;\n\n // 唯一标识符\n id?: string;\n\n // lineHeight?: number;\n // textAlign?: RichTextTextAlign; // left, right, center\n // direction?: RichTextLayoutDirectionType;\n margin?: number | number[];\n\n funcType?: string;\n hoverImage?: string | HTMLImageElement | HTMLCanvasElement;\n};\n\nexport type IRichTextCharacter = IRichTextParagraphCharacter | IRichTextImageCharacter;\n\nexport type IRichTextIconGraphicAttribute = IImageGraphicAttribute & {\n id?: string;\n backgroundShowMode?: 'always' | 'hover' | 'never';\n backgroundFill?: boolean | IColor; // 背景矩形填充颜色\n backgroundFillOpacity?: number; // 背景矩形填充透明度\n backgroundStroke?: boolean | IColor; // 背景矩形边框颜色\n backgroundStrokeOpacity?: number; // 背景矩形边框透明度\n backgroundRadius?: number; // 背景矩形圆角\n backgroundWidth?: number;\n backgroundHeight?: number;\n\n // lineHeight?: number;\n textAlign?: CanvasTextAlign; // left, right, center\n textBaseline?: CanvasTextBaseline;\n direction?: RichTextLayoutDirectionType;\n\n margin?: number | number[];\n\n // backgroundShow?: boolean;\n};\n\nexport interface IRichTextParagraph {\n text: string;\n ascent: number;\n descent: number;\n width: number;\n height: number;\n lineHeight: number;\n fontSize: number;\n length: number;\n newLine: boolean;\n character: IRichTextParagraphCharacter;\n left: number;\n top: number;\n direction?: 'horizontal' | 'vertical';\n widthOrigin?: number;\n heightOrigin?: number;\n textBaseline?: CanvasTextBaseline;\n ellipsis: 'normal' | 'add' | 'replace' | 'hide';\n ellipsisWidth: number;\n ellipsisOtherParagraphWidth: number;\n verticalEllipsis?: boolean;\n updateWidth: () => void;\n draw: (ctx: IContext2d, baseline: number, deltaLeft: number, isLineFirst: boolean, textAlign: string) => void;\n getWidthWithEllips: (direction: string) => number;\n}\n\nexport interface IRichTextLine {\n left: number;\n top: number;\n width: number;\n height: number;\n baseline: number;\n ascent: number;\n descent: number;\n paragraphs: (IRichTextParagraph | IRichTextIcon)[];\n actualWidth: number;\n blankWidth: number;\n textAlign: string;\n direction: 'horizontal' | 'vertical';\n directionKey: {\n width: string;\n height: string;\n left: string;\n x: string;\n y: string;\n };\n draw: (\n ctx: IContext2d,\n lastLine: boolean,\n x: number,\n y: number,\n drawIcon: (icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) => void\n ) => void;\n getWidthWithEllips: () => number;\n}\n\nexport interface IRichTextFrame {\n left: number;\n top: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n actualHeight: number;\n ellipsis: boolean | string;\n wordBreak: 'break-word' | 'break-all';\n verticalDirection: 'top' | 'middle' | 'bottom';\n lines: IRichTextLine[];\n globalAlign: 'left' | 'center' | 'right';\n globalBaseline: 'top' | 'middle' | 'bottom';\n layoutDirection: 'horizontal' | 'vertical';\n directionKey: {\n width: string;\n height: string;\n left: string;\n top: string;\n bottom: string;\n };\n isWidthMax: boolean;\n isHeightMax: boolean;\n singleLine: boolean;\n icons: Map<string, IRichTextIcon>;\n draw: (\n ctx: IContext2d,\n drawIcon: (icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) => void\n ) => boolean;\n getActualSize: () => {\n width: number;\n height: number;\n };\n getRawActualSize: () => {\n width: number;\n height: number;\n };\n getActualSizeWidthEllipsis: () => {\n width: number;\n height: number;\n };\n}\n\nexport interface IRichText extends IGraphic<IRichTextGraphicAttribute> {\n getFrameCache: () => IRichTextFrame;\n}\n\nexport interface IRichTextIcon extends IImage {\n attribute: IRichTextIconGraphicAttribute;\n richtextId?: string;\n globalX?: number;\n globalY?: number;\n\n _x: number;\n _y: number;\n _hovered: boolean;\n _marginArray: [number, number, number, number];\n\n setHoverState: (hovered: boolean) => void;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/interface/graphic/richText.ts"],"names":[],"mappings":"","file":"richText.js","sourcesContent":["import type { IColor } from '../color';\nimport type { IContext2d } from '../context';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { IImage, IImageGraphicAttribute } from './image';\nimport type { ITextGraphicAttribute } from './text';\n\nexport type IRichTextAttribute = {\n width: number;\n height: number;\n ellipsis: boolean | string;\n wordBreak: RichTextWordBreak;\n verticalDirection: RichTextVerticalDirection;\n maxHeight: number;\n maxWidth: number;\n textAlign: RichTextGlobalAlignType;\n textBaseline: RichTextGlobalBaselineType;\n layoutDirection: RichTextLayoutDirectionType;\n textConfig: IRichTextCharacter[];\n singleLine: boolean;\n};\n\nexport type IRichTextGraphicAttribute = Partial<IGraphicAttribute> & Partial<IRichTextAttribute>;\n\nexport type RichTextWordBreak = 'break-word' | 'break-all';\nexport type RichTextVerticalDirection = 'top' | 'middle' | 'bottom';\nexport type RichTextGlobalAlignType = 'left' | 'right' | 'center';\nexport type RichTextGlobalBaselineType = 'top' | 'middle' | 'bottom';\nexport type RichTextLayoutDirectionType = 'horizontal' | 'vertical';\nexport type RichTextFontStyle = 'normal' | 'italic' | 'oblique';\nexport type RichTextTextDecoration = 'none' | 'underline' | 'line-through';\n// export type RichTextTextAlign = 'left' | 'right' | 'center';\nexport type RichTextScript = 'normal' | 'sub' | 'super';\n\nexport type IRichTextBasicCharacter = {\n lineHeight?: number | string;\n textAlign?: CanvasTextAlign; // left, right, center\n textBaseline?: CanvasTextBaseline;\n direction?: RichTextLayoutDirectionType;\n};\n\nexport type IRichTextParagraphCharacter = IRichTextBasicCharacter & {\n text: string | number;\n fontSize?: number;\n fontFamily?: string;\n fill?: IColor | boolean;\n stroke?: IColor | boolean;\n fontWeight?: string;\n // lineHeight?: number;\n fontStyle?: RichTextFontStyle; // normal, italic, oblique\n textDecoration?: RichTextTextDecoration; // none, underline, line-through\n // textAlign?: RichTextTextAlign; // left, right, center\n script?: RichTextScript; // normal, sub, super\n underline?: boolean;\n lineThrough?: boolean;\n // direction?: RichTextLayoutDirectionType;\n};\n\nexport type IRichTextImageCharacter = IRichTextBasicCharacter & {\n // 图片基础属性\n image: string | HTMLImageElement | HTMLCanvasElement;\n width: number;\n height: number;\n\n // hover相关属性\n // backgroundShow?: boolean; // 是否显示background\n backgroundShowMode?: 'always' | 'hover';\n backgroundFill?: boolean | IColor; // 背景矩形填充颜色\n backgroundFillOpacity?: number; // 背景矩形填充透明度\n backgroundStroke?: boolean | IColor; // 背景矩形边框颜色\n backgroundStrokeOpacity?: number; // 背景矩形边框透明度\n backgroundRadius?: number; // 背景矩形圆角\n // background size 同时控制了该icon的响应范围\n backgroundWidth?: number;\n backgroundHeight?: number;\n\n // 唯一标识符\n id?: string;\n\n // lineHeight?: number;\n // textAlign?: RichTextTextAlign; // left, right, center\n // direction?: RichTextLayoutDirectionType;\n margin?: number | number[];\n\n funcType?: string;\n hoverImage?: string | HTMLImageElement | HTMLCanvasElement;\n};\n\nexport type IRichTextCharacter = IRichTextParagraphCharacter | IRichTextImageCharacter;\n\nexport type IRichTextIconGraphicAttribute = IImageGraphicAttribute & {\n id?: string;\n backgroundShowMode?: 'always' | 'hover' | 'never';\n backgroundFill?: boolean | IColor; // 背景矩形填充颜色\n backgroundFillOpacity?: number; // 背景矩形填充透明度\n backgroundStroke?: boolean | IColor; // 背景矩形边框颜色\n backgroundStrokeOpacity?: number; // 背景矩形边框透明度\n backgroundRadius?: number; // 背景矩形圆角\n backgroundWidth?: number;\n backgroundHeight?: number;\n\n // lineHeight?: number;\n textAlign?: CanvasTextAlign; // left, right, center\n textBaseline?: CanvasTextBaseline;\n direction?: RichTextLayoutDirectionType;\n\n margin?: number | number[];\n\n // backgroundShow?: boolean;\n};\n\nexport interface IRichTextParagraph {\n text: string;\n ascent: number;\n descent: number;\n width: number;\n height: number;\n lineHeight: number;\n fontSize: number;\n length: number;\n newLine: boolean;\n character: IRichTextParagraphCharacter;\n left: number;\n top: number;\n direction?: 'horizontal' | 'vertical';\n widthOrigin?: number;\n heightOrigin?: number;\n textBaseline?: CanvasTextBaseline;\n ellipsis: 'normal' | 'add' | 'replace' | 'hide';\n ellipsisWidth: number;\n ellipsisOtherParagraphWidth: number;\n verticalEllipsis?: boolean;\n updateWidth: () => void;\n draw: (ctx: IContext2d, baseline: number, deltaLeft: number, isLineFirst: boolean, textAlign: string) => void;\n getWidthWithEllips: (direction: string) => number;\n}\n\nexport interface IRichTextLine {\n left: number;\n top: number;\n width: number;\n height: number;\n baseline: number;\n ascent: number;\n descent: number;\n paragraphs: (IRichTextParagraph | IRichTextIcon)[];\n actualWidth: number;\n blankWidth: number;\n textAlign: string;\n direction: 'horizontal' | 'vertical';\n directionKey: {\n width: string;\n height: string;\n left: string;\n x: string;\n y: string;\n };\n draw: (\n ctx: IContext2d,\n lastLine: boolean,\n x: number,\n y: number,\n drawIcon: (icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) => void\n ) => void;\n getWidthWithEllips: () => number;\n}\n\nexport interface IRichTextFrame {\n left: number;\n top: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n actualHeight: number;\n ellipsis: boolean | string;\n wordBreak: 'break-word' | 'break-all';\n verticalDirection: 'top' | 'middle' | 'bottom';\n lines: IRichTextLine[];\n globalAlign: 'left' | 'center' | 'right' | 'start' | 'end';\n globalBaseline: 'top' | 'middle' | 'bottom';\n layoutDirection: 'horizontal' | 'vertical';\n directionKey: {\n width: string;\n height: string;\n left: string;\n top: string;\n bottom: string;\n };\n isWidthMax: boolean;\n isHeightMax: boolean;\n singleLine: boolean;\n icons: Map<string, IRichTextIcon>;\n draw: (\n ctx: IContext2d,\n drawIcon: (icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) => void\n ) => boolean;\n getActualSize: () => {\n width: number;\n height: number;\n };\n getRawActualSize: () => {\n width: number;\n height: number;\n };\n getActualSizeWidthEllipsis: () => {\n width: number;\n height: number;\n };\n}\n\nexport interface IRichText extends IGraphic<IRichTextGraphicAttribute> {\n getFrameCache: () => IRichTextFrame;\n}\n\nexport interface IRichTextIcon extends IImage {\n attribute: IRichTextIconGraphicAttribute;\n richtextId?: string;\n globalX?: number;\n globalY?: number;\n\n _x: number;\n _y: number;\n _hovered: boolean;\n _marginArray: [number, number, number, number];\n\n setHoverState: (hovered: boolean) => void;\n}\n"]}
|
|
@@ -9,7 +9,7 @@ export type ISymbolGraphicAttribute = Partial<IGraphicAttribute> & Partial<ISymb
|
|
|
9
9
|
export interface ISymbol extends IGraphic<ISymbolGraphicAttribute> {
|
|
10
10
|
getParsedPath: () => ISymbolClass;
|
|
11
11
|
}
|
|
12
|
-
export type SymbolType = 'circle' | 'cross' | 'diamond' | 'square' | 'arrow' | 'arrow2Left' | 'arrow2Right' | 'wedge' | 'thinTriangle' | 'triangle' | 'triangleUp' | 'triangleDown' | 'triangleRight' | 'triangleLeft' | 'stroke' | 'star' | 'wye' | 'rect' | string;
|
|
12
|
+
export type SymbolType = 'circle' | 'cross' | 'diamond' | 'square' | 'arrow' | 'arrowLeft' | 'arrowRight' | 'arrow2Left' | 'arrow2Right' | 'wedge' | 'thinTriangle' | 'triangle' | 'triangleUp' | 'triangleDown' | 'triangleRight' | 'triangleLeft' | 'stroke' | 'star' | 'wye' | 'rect' | 'rectRound' | 'roundLine' | string;
|
|
13
13
|
export interface ISymbolClass {
|
|
14
14
|
type: SymbolType | string;
|
|
15
15
|
path?: ICustomPath2D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/interface/graphic/symbol.ts"],"names":[],"mappings":"","file":"symbol.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D, IPath2D } from '../path';\n\nexport type ISymbolAttribute = {\n symbolType: SymbolType;\n size: number | [number, number];\n};\n\nexport type ISymbolGraphicAttribute = Partial<IGraphicAttribute> & Partial<ISymbolAttribute>;\n\nexport interface ISymbol extends IGraphic<ISymbolGraphicAttribute> {\n getParsedPath: () => ISymbolClass;\n}\n\nexport type SymbolType =\n | 'circle'\n | 'cross'\n | 'diamond'\n | 'square'\n | 'arrow'\n | 'arrow2Left'\n | 'arrow2Right'\n | 'wedge'\n | 'thinTriangle'\n | 'triangle'\n | 'triangleUp'\n | 'triangleDown'\n | 'triangleRight'\n | 'triangleLeft'\n | 'stroke'\n | 'star'\n | 'wye'\n | 'rect'\n | string;\n\nexport interface ISymbolClass {\n type: SymbolType | string;\n path?: ICustomPath2D;\n pathStr: string;\n isSvg?: boolean;\n\n // 返回true表示内部已经调用closePath,返回false表示没有调用closePath,外部需要调用closePath\n draw: (\n ctx: IPath2D,\n size: number | [number, number],\n x: number,\n y: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) => boolean;\n drawOffset: (\n ctx: IPath2D,\n size: number | [number, number],\n x: number,\n y: number,\n offset: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) => boolean;\n\n drawToSvgPath?: (size: number | [number, number], x: number, y: number, z?: number) => string;\n\n bounds: (size: number | [number, number], bounds: IBounds) => void;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/interface/graphic/symbol.ts"],"names":[],"mappings":"","file":"symbol.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D, IPath2D } from '../path';\n\nexport type ISymbolAttribute = {\n symbolType: SymbolType;\n size: number | [number, number];\n};\n\nexport type ISymbolGraphicAttribute = Partial<IGraphicAttribute> & Partial<ISymbolAttribute>;\n\nexport interface ISymbol extends IGraphic<ISymbolGraphicAttribute> {\n getParsedPath: () => ISymbolClass;\n}\n\nexport type SymbolType =\n | 'circle'\n | 'cross'\n | 'diamond'\n | 'square'\n | 'arrow'\n | 'arrowLeft'\n | 'arrowRight'\n | 'arrow2Left'\n | 'arrow2Right'\n | 'wedge'\n | 'thinTriangle'\n | 'triangle'\n | 'triangleUp'\n | 'triangleDown'\n | 'triangleRight'\n | 'triangleLeft'\n | 'stroke'\n | 'star'\n | 'wye'\n | 'rect'\n | 'rectRound'\n | 'roundLine'\n | string;\n\nexport interface ISymbolClass {\n type: SymbolType | string;\n path?: ICustomPath2D;\n pathStr: string;\n isSvg?: boolean;\n\n // 返回true表示内部已经调用closePath,返回false表示没有调用closePath,外部需要调用closePath\n draw: (\n ctx: IPath2D,\n size: number | [number, number],\n x: number,\n y: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) => boolean;\n drawOffset: (\n ctx: IPath2D,\n size: number | [number, number],\n x: number,\n y: number,\n offset: number,\n z?: number,\n cb?: (p: ICustomPath2D, a: any) => void\n ) => boolean;\n\n drawToSvgPath?: (size: number | [number, number], x: number, y: number, z?: number) => string;\n\n bounds: (size: number | [number, number], bounds: IBounds) => void;\n}\n"]}
|