@visactor/vrender 0.15.0-alpha.14 → 0.15.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/animate/animate.d.ts +0 -1
- package/cjs/animate/animate.js +0 -3
- package/cjs/animate/animate.js.map +1 -1
- package/cjs/animate/timeline.d.ts +1 -1
- package/cjs/animate/timeline.js +2 -2
- package/cjs/animate/timeline.js.map +1 -1
- package/cjs/canvas/contributions/browser/context.d.ts +0 -1
- package/cjs/common/contribution-provider.d.ts +0 -1
- package/cjs/common/contribution-provider.js +2 -7
- package/cjs/common/contribution-provider.js.map +1 -1
- package/cjs/common/enums.d.ts +2 -4
- package/cjs/common/enums.js +2 -3
- package/cjs/common/enums.js.map +1 -1
- package/cjs/core/contributions/env/base-contribution.d.ts +1 -11
- package/cjs/core/contributions/env/base-contribution.js +1 -22
- package/cjs/core/contributions/env/base-contribution.js.map +1 -1
- package/cjs/core/contributions/env/browser-contribution.d.ts +2 -11
- package/cjs/core/contributions/env/browser-contribution.js +0 -66
- package/cjs/core/contributions/env/browser-contribution.js.map +1 -1
- package/cjs/core/contributions/textMeasure/layout.js +1 -1
- package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
- package/cjs/core/contributions/window/base-contribution.d.ts +5 -11
- package/cjs/core/contributions/window/base-contribution.js +0 -10
- package/cjs/core/contributions/window/base-contribution.js.map +1 -1
- package/cjs/core/contributions/window/browser-contribution.d.ts +0 -11
- package/cjs/core/contributions/window/browser-contribution.js +2 -33
- package/cjs/core/contributions/window/browser-contribution.js.map +1 -1
- package/cjs/core/global.d.ts +1 -11
- package/cjs/core/global.js +0 -18
- package/cjs/core/global.js.map +1 -1
- package/cjs/core/layer.js +6 -6
- package/cjs/core/layer.js.map +1 -1
- package/cjs/core/stage.d.ts +4 -13
- package/cjs/core/stage.js +25 -54
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.d.ts +0 -6
- package/cjs/core/window.js +1 -10
- package/cjs/core/window.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-left.js +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-right.js +1 -1
- package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
- package/cjs/graphic/builtin-symbol/index.d.ts +1 -1
- package/cjs/graphic/builtin-symbol/index.js +2 -2
- package/cjs/graphic/builtin-symbol/index.js.map +1 -1
- package/cjs/graphic/builtin-symbol/utils.d.ts +5 -13
- package/cjs/graphic/builtin-symbol/utils.js +9 -23
- package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
- package/cjs/graphic/config.js +6 -7
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/constants.d.ts +0 -22
- package/cjs/graphic/constants.js +2 -20
- package/cjs/graphic/constants.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +0 -3
- package/cjs/graphic/graphic.js +26 -40
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.js +1 -1
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/index.d.ts +0 -1
- package/cjs/graphic/index.js +13 -13
- package/cjs/graphic/index.js.map +1 -1
- package/cjs/graphic/richtext/utils.d.ts +1 -1
- package/cjs/graphic/richtext/utils.js +1 -1
- package/cjs/graphic/richtext/utils.js.map +1 -1
- package/cjs/graphic/symbol.d.ts +1 -2
- package/cjs/graphic/symbol.js +4 -27
- package/cjs/graphic/symbol.js.map +1 -1
- package/cjs/graphic/text.js +23 -33
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/tools.d.ts +2 -3
- package/cjs/graphic/tools.js +3 -58
- package/cjs/graphic/tools.js.map +1 -1
- package/cjs/graphic/wrap-text.js +8 -10
- package/cjs/graphic/wrap-text.js.map +1 -1
- package/cjs/index.d.ts +1 -2
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -1
- package/cjs/interface/animate.d.ts +1 -3
- package/cjs/interface/animate.js.map +1 -1
- package/cjs/interface/global.d.ts +1 -25
- package/cjs/interface/global.js.map +1 -1
- package/cjs/interface/graphic/image.d.ts +0 -1
- package/cjs/interface/graphic/image.js.map +1 -1
- package/cjs/interface/graphic/line.d.ts +1 -0
- package/cjs/interface/graphic/line.js.map +1 -1
- package/cjs/interface/graphic/symbol.d.ts +2 -3
- package/cjs/interface/graphic/symbol.js.map +1 -1
- package/cjs/interface/graphic/text.d.ts +0 -1
- package/cjs/interface/graphic/text.js.map +1 -1
- package/cjs/interface/graphic.d.ts +3 -25
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/render.d.ts +0 -1
- package/cjs/interface/render.js.map +1 -1
- package/cjs/interface/stage.d.ts +3 -10
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/interface/window.d.ts +0 -12
- package/cjs/interface/window.js.map +1 -1
- package/cjs/picker/contributions/canvas-picker/symbol-picker.js +2 -4
- package/cjs/picker/contributions/canvas-picker/symbol-picker.js.map +1 -1
- package/cjs/picker/pick-interceptor.js +3 -2
- package/cjs/picker/pick-interceptor.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.d.ts +0 -2
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +21 -42
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/plugin-modules.js +1 -1
- package/cjs/plugins/plugin-modules.js.map +1 -1
- package/cjs/render/contributions/render/area-render.js +31 -21
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/image-contribution-render.js +1 -23
- package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/cjs/render/contributions/render/draw-contribution.d.ts +1 -3
- package/cjs/render/contributions/render/draw-contribution.js +1 -3
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/image-render.js +3 -7
- package/cjs/render/contributions/render/image-render.js.map +1 -1
- package/cjs/render/contributions/render/line-render.js +50 -23
- package/cjs/render/contributions/render/line-render.js.map +1 -1
- package/cjs/render/contributions/render/symbol-render.js +5 -12
- package/cjs/render/contributions/render/symbol-render.js.map +1 -1
- package/cjs/render/contributions/render/utils.d.ts +2 -2
- package/cjs/render/contributions/render/utils.js.map +1 -1
- package/cjs/render/render-service.js +1 -3
- package/cjs/render/render-service.js.map +1 -1
- package/dist/index.js +318 -3342
- package/dist/index.min.js +1 -1
- package/es/animate/animate.d.ts +0 -1
- package/es/animate/animate.js +0 -3
- package/es/animate/animate.js.map +1 -1
- package/es/animate/timeline.d.ts +1 -1
- package/es/animate/timeline.js +2 -2
- package/es/animate/timeline.js.map +1 -1
- package/es/canvas/contributions/browser/context.d.ts +0 -1
- package/es/common/contribution-provider.d.ts +0 -1
- package/es/common/contribution-provider.js +0 -4
- package/es/common/contribution-provider.js.map +1 -1
- package/es/common/enums.d.ts +2 -4
- package/es/common/enums.js +2 -3
- package/es/common/enums.js.map +1 -1
- package/es/core/contributions/env/base-contribution.d.ts +1 -11
- package/es/core/contributions/env/base-contribution.js +0 -23
- package/es/core/contributions/env/base-contribution.js.map +1 -1
- package/es/core/contributions/env/browser-contribution.d.ts +2 -11
- package/es/core/contributions/env/browser-contribution.js +1 -67
- package/es/core/contributions/env/browser-contribution.js.map +1 -1
- package/es/core/contributions/textMeasure/layout.js +1 -1
- package/es/core/contributions/textMeasure/layout.js.map +1 -1
- package/es/core/contributions/window/base-contribution.d.ts +5 -11
- package/es/core/contributions/window/base-contribution.js +0 -10
- package/es/core/contributions/window/base-contribution.js.map +1 -1
- package/es/core/contributions/window/browser-contribution.d.ts +0 -11
- package/es/core/contributions/window/browser-contribution.js +2 -33
- package/es/core/contributions/window/browser-contribution.js.map +1 -1
- package/es/core/global.d.ts +1 -11
- package/es/core/global.js +0 -18
- package/es/core/global.js.map +1 -1
- package/es/core/layer.js +6 -6
- package/es/core/layer.js.map +1 -1
- package/es/core/stage.d.ts +4 -13
- package/es/core/stage.js +24 -57
- package/es/core/stage.js.map +1 -1
- package/es/core/window.d.ts +0 -6
- package/es/core/window.js +1 -10
- package/es/core/window.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow2-left.js +1 -1
- package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
- package/es/graphic/builtin-symbol/arrow2-right.js +1 -1
- package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
- package/es/graphic/builtin-symbol/index.d.ts +1 -1
- package/es/graphic/builtin-symbol/index.js +1 -11
- package/es/graphic/builtin-symbol/index.js.map +1 -1
- package/es/graphic/builtin-symbol/utils.d.ts +5 -13
- package/es/graphic/builtin-symbol/utils.js +7 -25
- package/es/graphic/builtin-symbol/utils.js.map +1 -1
- package/es/graphic/config.js +6 -7
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/constants.d.ts +0 -22
- package/es/graphic/constants.js +0 -26
- package/es/graphic/constants.js.map +1 -1
- package/es/graphic/graphic.d.ts +0 -3
- package/es/graphic/graphic.js +26 -40
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.js +1 -1
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/index.d.ts +0 -1
- package/es/graphic/index.js +0 -2
- package/es/graphic/index.js.map +1 -1
- package/es/graphic/richtext/utils.d.ts +1 -1
- package/es/graphic/richtext/utils.js +1 -1
- package/es/graphic/richtext/utils.js.map +1 -1
- package/es/graphic/symbol.d.ts +1 -2
- package/es/graphic/symbol.js +1 -28
- package/es/graphic/symbol.js.map +1 -1
- package/es/graphic/text.js +23 -33
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/tools.d.ts +2 -3
- package/es/graphic/tools.js +0 -59
- package/es/graphic/tools.js.map +1 -1
- package/es/graphic/wrap-text.js +8 -10
- package/es/graphic/wrap-text.js.map +1 -1
- package/es/index.d.ts +1 -2
- package/es/index.js +1 -3
- package/es/index.js.map +1 -1
- package/es/interface/animate.d.ts +1 -3
- package/es/interface/animate.js.map +1 -1
- package/es/interface/global.d.ts +1 -25
- package/es/interface/global.js.map +1 -1
- package/es/interface/graphic/image.d.ts +0 -1
- package/es/interface/graphic/image.js.map +1 -1
- package/es/interface/graphic/line.d.ts +1 -0
- package/es/interface/graphic/line.js.map +1 -1
- package/es/interface/graphic/symbol.d.ts +2 -3
- package/es/interface/graphic/symbol.js.map +1 -1
- package/es/interface/graphic/text.d.ts +0 -1
- package/es/interface/graphic/text.js.map +1 -1
- package/es/interface/graphic.d.ts +3 -25
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/render.d.ts +0 -1
- package/es/interface/render.js.map +1 -1
- package/es/interface/stage.d.ts +3 -10
- package/es/interface/stage.js.map +1 -1
- package/es/interface/window.d.ts +0 -12
- package/es/interface/window.js.map +1 -1
- package/es/picker/contributions/canvas-picker/symbol-picker.js +1 -6
- package/es/picker/contributions/canvas-picker/symbol-picker.js.map +1 -1
- package/es/picker/pick-interceptor.js +3 -2
- package/es/picker/pick-interceptor.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.d.ts +0 -2
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +20 -47
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/plugin-modules.js +2 -2
- package/es/plugins/plugin-modules.js.map +1 -1
- package/es/render/contributions/render/area-render.js +30 -20
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/contributions/image-contribution-render.js +0 -27
- package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
- package/es/render/contributions/render/draw-contribution.d.ts +1 -3
- package/es/render/contributions/render/draw-contribution.js +0 -4
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/image-render.js +2 -10
- package/es/render/contributions/render/image-render.js.map +1 -1
- package/es/render/contributions/render/line-render.js +49 -22
- package/es/render/contributions/render/line-render.js.map +1 -1
- package/es/render/contributions/render/symbol-render.js +5 -12
- package/es/render/contributions/render/symbol-render.js.map +1 -1
- package/es/render/contributions/render/utils.d.ts +2 -2
- package/es/render/contributions/render/utils.js.map +1 -1
- package/es/render/render-service.js +1 -3
- package/es/render/render-service.js.map +1 -1
- package/package.json +13 -10
- package/cjs/graphic/builtin-symbol/arrow2-down.d.ts +0 -12
- package/cjs/graphic/builtin-symbol/arrow2-down.js +0 -30
- package/cjs/graphic/builtin-symbol/arrow2-down.js.map +0 -1
- package/cjs/graphic/builtin-symbol/arrow2-up.d.ts +0 -12
- package/cjs/graphic/builtin-symbol/arrow2-up.js +0 -30
- package/cjs/graphic/builtin-symbol/arrow2-up.js.map +0 -1
- package/cjs/graphic/builtin-symbol/close.d.ts +0 -13
- package/cjs/graphic/builtin-symbol/close.js +0 -33
- package/cjs/graphic/builtin-symbol/close.js.map +0 -1
- package/cjs/graphic/builtin-symbol/line-h.d.ts +0 -13
- package/cjs/graphic/builtin-symbol/line-h.js +0 -32
- package/cjs/graphic/builtin-symbol/line-h.js.map +0 -1
- package/cjs/graphic/builtin-symbol/line-v.d.ts +0 -13
- package/cjs/graphic/builtin-symbol/line-v.js +0 -32
- package/cjs/graphic/builtin-symbol/line-v.js.map +0 -1
- package/cjs/jsx/graphicType.d.ts +0 -172
- package/cjs/jsx/graphicType.js +0 -133
- package/cjs/jsx/graphicType.js.map +0 -1
- package/cjs/jsx/index.d.ts +0 -2
- package/cjs/jsx/index.js +0 -21
- package/cjs/jsx/index.js.map +0 -1
- package/cjs/jsx/jsx-classic.d.ts +0 -3
- package/cjs/jsx/jsx-classic.js +0 -58
- package/cjs/jsx/jsx-classic.js.map +0 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.d.ts +0 -13
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -79
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +0 -1
- package/es/graphic/builtin-symbol/arrow2-down.d.ts +0 -12
- package/es/graphic/builtin-symbol/arrow2-down.js +0 -24
- package/es/graphic/builtin-symbol/arrow2-down.js.map +0 -1
- package/es/graphic/builtin-symbol/arrow2-up.d.ts +0 -12
- package/es/graphic/builtin-symbol/arrow2-up.js +0 -24
- package/es/graphic/builtin-symbol/arrow2-up.js.map +0 -1
- package/es/graphic/builtin-symbol/close.d.ts +0 -13
- package/es/graphic/builtin-symbol/close.js +0 -27
- package/es/graphic/builtin-symbol/close.js.map +0 -1
- package/es/graphic/builtin-symbol/line-h.d.ts +0 -13
- package/es/graphic/builtin-symbol/line-h.js +0 -26
- package/es/graphic/builtin-symbol/line-h.js.map +0 -1
- package/es/graphic/builtin-symbol/line-v.d.ts +0 -13
- package/es/graphic/builtin-symbol/line-v.js +0 -26
- package/es/graphic/builtin-symbol/line-v.js.map +0 -1
- package/es/jsx/graphicType.d.ts +0 -172
- package/es/jsx/graphicType.js +0 -126
- package/es/jsx/graphicType.js.map +0 -1
- package/es/jsx/index.d.ts +0 -2
- package/es/jsx/index.js +0 -4
- package/es/jsx/index.js.map +0 -1
- package/es/jsx/jsx-classic.d.ts +0 -3
- package/es/jsx/jsx-classic.js +0 -56
- package/es/jsx/jsx-classic.js.map +0 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.d.ts +0 -13
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -75
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/builtin-symbol/arrow2-left.ts"],"names":[],"mappings":"AAiCA,MAAM,UAAU,UAAU,CAAC,GAAe,EAAE,CAAS,EAAE,MAAc,EAAE,MAAc;IACnF,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjB,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/B,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC;IAEpC,OAAO,IAAI,CAAC;AACd,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AM,CAAC,EAAE,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;IAChB,CAAC;CACF;AAED,eAAe,IAAI,gBAAgB,EAAE,CAAC","file":"arrow2-left.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\n/**\n * 部分源码参考 https://github.com/vega/vega/blob/main/packages/vega-scenegraph/src/path/symbols.js\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nexport function arrow2Left(ctx: IContext2d, r: number, transX: number, transY: number) {\n const r2 = r * 2;\n ctx.moveTo(r + transX, transY - r2);\n ctx.lineTo(transX - r, transY);\n ctx.lineTo(r + transX, r2 + transY);\n\n return true;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class Arrow2LeftSymbol implements ISymbolClass {\n type: SymbolType = 'arrow2Left';\n /* eslint-disable max-len */\n pathStr: string = 'M 0.25 -0.5 L -0.25 0 l 0.5 0.5';\n\n draw(ctx: IContext2d, size: number, transX: number, transY: number) {\n const r = size / 4;\n return arrow2Left(ctx, r, transX, transY);\n }\n\n drawOffset(ctx: IContext2d, size: number, transX: number, transY: number, offset: number) {\n const r = size / 4 + offset;\n return arrow2Left(ctx, r, transX, transY);\n }\n\n bounds(size: number, bounds: IBounds) {\n const r = size / 2;\n bounds.x1 = -r;\n bounds.x2 = r;\n bounds.y1 = -r;\n bounds.y2 = r;\n }\n}\n\nexport default new Arrow2LeftSymbol();\n"]}
|
|
@@ -6,7 +6,7 @@ export function arrow2Right(ctx, r, transX, transY) {
|
|
|
6
6
|
|
|
7
7
|
export class Arrow2RightSymbol {
|
|
8
8
|
constructor() {
|
|
9
|
-
this.type = "arrow2Right", this.pathStr = "M -0.25 -0.5 l 0.
|
|
9
|
+
this.type = "arrow2Right", this.pathStr = "M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5";
|
|
10
10
|
}
|
|
11
11
|
draw(ctx, size, transX, transY) {
|
|
12
12
|
return arrow2Right(ctx, size / 4, transX, transY);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/builtin-symbol/arrow2-right.ts"],"names":[],"mappings":"AAiCA,MAAM,UAAU,WAAW,CAAC,GAAe,EAAE,CAAS,EAAE,MAAc,EAAE,MAAc;IACpF,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjB,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC,CAAC;IACpC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/B,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC;IAEpC,OAAO,IAAI,CAAC;AACd,CAAC;AAGD,MAAM,OAAO,iBAAiB;IAA9B;QACE,SAAI,GAAe,aAAa,CAAC;QAEjC,YAAO,GAAW,mCAAmC,CAAC;IAmBxD,CAAC;IAjBC,IAAI,CAAC,GAAe,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc;QAChE,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QACnB,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAAY,EAAE,MAAc,EAAE,MAAc,EAAE,MAAc;QACtF,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,MAAM,CAAC;QAC5B,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,MAAe;QAClC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QACnB,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;QACd,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;IAChB,CAAC;CACF;AAED,eAAe,IAAI,iBAAiB,EAAE,CAAC","file":"arrow2-right.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\n/**\n * 部分源码参考 https://github.com/vega/vega/blob/main/packages/vega-scenegraph/src/path/symbols.js\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nexport function arrow2Right(ctx: IContext2d, r: number, transX: number, transY: number) {\n const r2 = r * 2;\n ctx.moveTo(transX - r, transY - r2);\n ctx.lineTo(transX + r, transY);\n ctx.lineTo(transX - r, r2 + transY);\n\n return true;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class Arrow2RightSymbol implements ISymbolClass {\n type: SymbolType = 'arrow2Right';\n /* eslint-dis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EAAE,GAAG,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;IAChB,CAAC;CACF;AAED,eAAe,IAAI,iBAAiB,EAAE,CAAC","file":"arrow2-right.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\n/**\n * 部分源码参考 https://github.com/vega/vega/blob/main/packages/vega-scenegraph/src/path/symbols.js\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nexport function arrow2Right(ctx: IContext2d, r: number, transX: number, transY: number) {\n const r2 = r * 2;\n ctx.moveTo(transX - r, transY - r2);\n ctx.lineTo(transX + r, transY);\n ctx.lineTo(transX - r, r2 + transY);\n\n return true;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class Arrow2RightSymbol implements ISymbolClass {\n type: SymbolType = 'arrow2Right';\n /* eslint-disable max-len */\n pathStr: string = 'M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5';\n\n draw(ctx: IContext2d, size: number, transX: number, transY: number) {\n const r = size / 4;\n return arrow2Right(ctx, r, transX, transY);\n }\n\n drawOffset(ctx: IContext2d, size: number, transX: number, transY: number, offset: number) {\n const r = size / 4 + offset;\n return arrow2Right(ctx, r, transX, transY);\n }\n\n bounds(size: number, bounds: IBounds) {\n const r = size / 2;\n bounds.x1 = -r;\n bounds.x2 = r;\n bounds.y1 = -r;\n bounds.y2 = r;\n }\n}\n\nexport default new Arrow2RightSymbol();\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ISymbolClass } from '../../interface';
|
|
2
|
-
export declare const builtinSymbols: (import("./circle").CircleSymbol | import("./cross").CrossSymbol | import("./diamond").DiamondSymbol | import("./square").SquareSymbol | import("./triangle-up").TriangleUpSymbol | import("./star").StarSymbol | import("./arrow").ArrowSymbol | import("./wedge").WedgeSymbol | import("./stroke").StrokeSymbol | import("./wye").WyeSymbol | import("./triangle-left").TriangleLeftSymbol | import("./triangle-right").TriangleRightSymbol | import("./triangle-down").TriangleDownSymbol | import("./arrow2-left").Arrow2LeftSymbol | import("./arrow2-right").Arrow2RightSymbol | import("./
|
|
2
|
+
export declare const builtinSymbols: (import("./circle").CircleSymbol | import("./cross").CrossSymbol | import("./diamond").DiamondSymbol | import("./square").SquareSymbol | import("./triangle-up").TriangleUpSymbol | import("./star").StarSymbol | import("./arrow").ArrowSymbol | import("./wedge").WedgeSymbol | import("./stroke").StrokeSymbol | import("./wye").WyeSymbol | import("./triangle-left").TriangleLeftSymbol | import("./triangle-right").TriangleRightSymbol | import("./triangle-down").TriangleDownSymbol | import("./arrow2-left").Arrow2LeftSymbol | import("./arrow2-right").Arrow2RightSymbol | import("./rect").RectSymbol)[];
|
|
3
3
|
export declare const builtinSymbolsMap: Record<string, ISymbolClass>;
|
|
4
4
|
export * from './utils';
|
|
@@ -32,19 +32,9 @@ import arrow2Left from "./arrow2-left";
|
|
|
32
32
|
|
|
33
33
|
import arrow2Right from "./arrow2-right";
|
|
34
34
|
|
|
35
|
-
import arrow2Up from "./arrow2-up";
|
|
36
|
-
|
|
37
|
-
import arrow2Down from "./arrow2-down";
|
|
38
|
-
|
|
39
|
-
import lineV from "./line-v";
|
|
40
|
-
|
|
41
|
-
import lineH from "./line-h";
|
|
42
|
-
|
|
43
|
-
import close from "./close";
|
|
44
|
-
|
|
45
35
|
import rect from "./rect";
|
|
46
36
|
|
|
47
|
-
export const builtinSymbols = [ circle, cross, diamond, square, thinTriangle, triangle, star, arrow, wedge, stroke, wye, triangleLeft, triangleRight, triangleUp, triangleDown, arrow2Left, arrow2Right,
|
|
37
|
+
export const builtinSymbols = [ circle, cross, diamond, square, thinTriangle, triangle, star, arrow, wedge, stroke, wye, triangleLeft, triangleRight, triangleUp, triangleDown, arrow2Left, arrow2Right, rect ];
|
|
48
38
|
|
|
49
39
|
export const builtinSymbolsMap = {};
|
|
50
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/builtin-symbol/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,MAA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IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,GAAG;IACH,YAAY;IACZ,aAAa;IACb,UAAU;IACV,YAAY;IACZ,UAAU;IACV,WAAW;IACX,IAAI;CACL,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAiC,EAAE,CAAC;AAElE,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;IAC9B,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,cAAc,SAAS,CAAC","file":"index.js","sourcesContent":["import circle from './circle';\nimport cross from './cross';\nimport diamond from './diamond';\nimport square from './square';\nimport triangle from './triangle';\nimport star from './star';\nimport arrow from './arrow';\nimport wedge from './wedge';\nimport stroke from './stroke';\nimport wye from './wye';\nimport triangleLeft from './triangle-left';\nimport triangleRight from './triangle-right';\nimport triangleUp from './triangle-up';\nimport triangleDown from './triangle-down';\nimport thinTriangle from './thin-triangle';\nimport arrow2Left from './arrow2-left';\nimport arrow2Right from './arrow2-right';\nimport rect from './rect';\nimport type { ISymbolClass } from '../../interface';\n\nexport const builtinSymbols = [\n circle,\n cross,\n diamond,\n square,\n thinTriangle,\n triangle,\n star,\n arrow,\n wedge,\n stroke,\n wye,\n triangleLeft,\n triangleRight,\n triangleUp,\n triangleDown,\n arrow2Left,\n arrow2Right,\n rect\n];\nexport const builtinSymbolsMap: Record<string, ISymbolClass> = {};\n\nbuiltinSymbols.forEach(symbol => {\n builtinSymbolsMap[symbol.type] = symbol;\n});\n\nexport * from './utils';\n"]}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { IContext2d, ICustomPath2D,
|
|
1
|
+
import type { IBounds } from '@visactor/vutils';
|
|
2
|
+
import type { IContext2d, ICustomPath2D, ISymbolClass } from '../../interface';
|
|
3
3
|
export declare class CustomSymbolClass implements ISymbolClass {
|
|
4
4
|
type: string;
|
|
5
5
|
path: ICustomPath2D;
|
|
6
6
|
pathStr: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
attribute: Partial<IGraphicAttribute>;
|
|
11
|
-
}[];
|
|
12
|
-
constructor(type: string, path: ICustomPath2D | {
|
|
13
|
-
path: ICustomPath2D;
|
|
14
|
-
attribute: Partial<IGraphicAttribute>;
|
|
15
|
-
}[], isSvg?: boolean);
|
|
16
|
-
drawOffset(ctx: IContext2d, size: number, x: number, y: number, offset: number, z?: number, cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void): boolean;
|
|
17
|
-
draw(ctx: IContext2d, size: number, x: number, y: number, z?: number, cb?: (path: ICustomPath2D, attribute?: Record<string, any>) => void): boolean;
|
|
7
|
+
constructor(type: string, path: ICustomPath2D);
|
|
8
|
+
drawOffset(ctx: IContext2d, size: number, x: number, y: number, offset: number): boolean;
|
|
9
|
+
draw(ctx: IContext2d, size: number, x: number, y: number): boolean;
|
|
18
10
|
bounds(size: number, bounds: IBounds): void;
|
|
19
11
|
}
|
|
@@ -1,35 +1,17 @@
|
|
|
1
|
-
import { isArray, AABBBounds } from "@visactor/vutils";
|
|
2
|
-
|
|
3
1
|
import { renderCommandList } from "../../common/render-command-list";
|
|
4
2
|
|
|
5
|
-
const tempBounds = new AABBBounds;
|
|
6
|
-
|
|
7
3
|
export class CustomSymbolClass {
|
|
8
|
-
constructor(type, path
|
|
9
|
-
this.pathStr = "", this.type = type,
|
|
10
|
-
this.isSvg = isSvg;
|
|
4
|
+
constructor(type, path) {
|
|
5
|
+
this.pathStr = "", this.type = type, this.path = path;
|
|
11
6
|
}
|
|
12
|
-
drawOffset(ctx, size, x, y, offset
|
|
13
|
-
return this.
|
|
14
|
-
|
|
15
|
-
cb && cb(item.path, item.attribute);
|
|
16
|
-
})), !1) : (renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset),
|
|
17
|
-
!1);
|
|
7
|
+
drawOffset(ctx, size, x, y, offset) {
|
|
8
|
+
return renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset),
|
|
9
|
+
!1;
|
|
18
10
|
}
|
|
19
|
-
draw(ctx, size, x, y
|
|
20
|
-
return this.
|
|
21
|
-
ctx.beginPath(), renderCommandList(item.path.commandList, ctx, x, y, size, size),
|
|
22
|
-
cb && cb(item.path, item.attribute);
|
|
23
|
-
})), !1) : (renderCommandList(this.path.commandList, ctx, x, y, size, size), !1);
|
|
11
|
+
draw(ctx, size, x, y) {
|
|
12
|
+
return renderCommandList(this.path.commandList, ctx, x, y, size, size), !1;
|
|
24
13
|
}
|
|
25
14
|
bounds(size, bounds) {
|
|
26
|
-
if (this.isSvg) {
|
|
27
|
-
if (!this.svgCache) return;
|
|
28
|
-
return bounds.clear(), void this.svgCache.forEach((({path: path}) => {
|
|
29
|
-
tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size,
|
|
30
|
-
tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
15
|
this.path.bounds && (bounds.x1 = this.path.bounds.x1 * size, bounds.y1 = this.path.bounds.y1 * size,
|
|
34
16
|
bounds.x2 = this.path.bounds.x2 * size, bounds.y2 = this.path.bounds.y2 * size);
|
|
35
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/builtin-symbol/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/graphic/builtin-symbol/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAGrE,MAAM,OAAO,iBAAiB;IAK5B,YAAY,IAAY,EAAE,IAAmB;QAF7C,YAAO,GAAW,EAAE,CAAC;QAGnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAAY,EAAE,CAAS,EAAE,CAAS,EAAE,MAAc;QAC5E,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC;QAClF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC,GAAe,EAAE,IAAY,EAAE,CAAS,EAAE,CAAS;QACtD,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAChE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,MAAe;QAClC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACrB,OAAO;SACR;QACD,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACzC,CAAC;CACF","file":"utils.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport { renderCommandList } from '../../common/render-command-list';\nimport type { IContext2d, ICustomPath2D, ISymbolClass } from '../../interface';\n\nexport class CustomSymbolClass implements ISymbolClass {\n type: string;\n path: ICustomPath2D;\n pathStr: string = '';\n\n constructor(type: string, path: ICustomPath2D) {\n this.type = type;\n this.path = path;\n }\n\n drawOffset(ctx: IContext2d, size: number, x: number, y: number, offset: number) {\n renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset);\n return false;\n }\n\n draw(ctx: IContext2d, size: number, x: number, y: number) {\n renderCommandList(this.path.commandList, ctx, x, y, size, size);\n return false;\n }\n\n bounds(size: number, bounds: IBounds) {\n if (!this.path.bounds) {\n return;\n }\n bounds.x1 = this.path.bounds.x1 * size;\n bounds.y1 = this.path.bounds.y1 * size;\n bounds.x2 = this.path.bounds.x2 * size;\n bounds.y2 = this.path.bounds.y2 * size;\n }\n}\n\n// export function CustomSymbol(): ISymbolClass {\n\n// }\n"]}
|
package/es/graphic/config.js
CHANGED
|
@@ -21,6 +21,7 @@ export const DefaultTransform = {
|
|
|
21
21
|
angle: 0,
|
|
22
22
|
alpha: 0,
|
|
23
23
|
beta: 0,
|
|
24
|
+
scaleCenter: [ 0, 0 ],
|
|
24
25
|
anchor: [ 0, 0 ],
|
|
25
26
|
anchor3d: [ 0, 0 ],
|
|
26
27
|
postMatrix: new Matrix
|
|
@@ -72,8 +73,7 @@ export const DefaultTextStyle = {
|
|
|
72
73
|
lineThrough: 0,
|
|
73
74
|
scaleIn3d: !1,
|
|
74
75
|
direction: "horizontal",
|
|
75
|
-
wordBreak: "break-all"
|
|
76
|
-
ignoreBuf: !1
|
|
76
|
+
wordBreak: "break-all"
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
export const DefaultStyle = Object.assign(Object.assign(Object.assign({
|
|
@@ -85,8 +85,7 @@ export const DefaultStyle = Object.assign(Object.assign(Object.assign({
|
|
|
85
85
|
texturePadding: 2,
|
|
86
86
|
backgroundMode: 0,
|
|
87
87
|
blur: 0,
|
|
88
|
-
cursor: null
|
|
89
|
-
html: null
|
|
88
|
+
cursor: null
|
|
90
89
|
}, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout);
|
|
91
90
|
|
|
92
91
|
export const DefaultConnectAttribute = {
|
|
@@ -173,7 +172,8 @@ export const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}
|
|
|
173
172
|
segments: [],
|
|
174
173
|
curveType: "linear",
|
|
175
174
|
clipRange: 1,
|
|
176
|
-
clipRangeByDimension: "default"
|
|
175
|
+
clipRangeByDimension: "default",
|
|
176
|
+
closePath: !1
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
export const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
@@ -235,8 +235,7 @@ export const DefaultImageAttribute = Object.assign(Object.assign({
|
|
|
235
235
|
width: 0,
|
|
236
236
|
height: 0
|
|
237
237
|
}, DefaultAttribute), {
|
|
238
|
-
fill: !0
|
|
239
|
-
cornerRadius: 0
|
|
238
|
+
fill: !0
|
|
240
239
|
});
|
|
241
240
|
|
|
242
241
|
export const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), {
|
package/es/graphic/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AA+BvD,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAChB,UAAU,EAAE,IAAI,MAAM,EAAE;CACzB,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AAE,IAAI,EACV,YAAY,EAAE,CAAC,GAChB,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,mCACpC,qBAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,GACX,CAAC","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport type {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute,\n IConnectedStyle,\n ILayout\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n opacity: 1,\n background: null,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 0,\n blur: 0,\n cursor: null,\n html: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n pickable: true,\n childrenPickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start'\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default'\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n console.warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AA+BvD,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAChB,UAAU,EAAE,IAAI,MAAM,EAAE;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,g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mCACpC,qBAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,GACX,CAAC","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport type {\n IArcGraphicAttribute,\n IAreaGraphicAttribute,\n IGraphicAttribute,\n ICircleGraphicAttribute,\n IFillStyle,\n IGlyphGraphicAttribute,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPathGraphicAttribute,\n IPolygonGraphicAttribute,\n IRect3dGraphicAttribute,\n IRectGraphicAttribute,\n IStrokeStyle,\n IGraphicStyle,\n ISymbolGraphicAttribute,\n ITextAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n ITransform,\n RichTextWordBreak,\n RichTextVerticalDirection,\n RichTextGlobalAlignType,\n RichTextGlobalBaselineType,\n IRichTextIconGraphicAttribute,\n IConnectedStyle,\n ILayout\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all'\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n opacity: 1,\n background: null,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 0,\n blur: 0,\n cursor: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n pickable: true,\n childrenPickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start'\n};\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n customPath: () => {\n console.warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n length: 0\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n ...DefaultAttribute,\n fill: true\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
|
|
@@ -16,25 +16,3 @@ export declare const SYMBOL_NUMBER_TYPE: number;
|
|
|
16
16
|
export declare const TEXT_NUMBER_TYPE: number;
|
|
17
17
|
export declare const GraphicService: unique symbol;
|
|
18
18
|
export declare const GraphicCreator: unique symbol;
|
|
19
|
-
export declare const SVG_ATTRIBUTE_MAP: {
|
|
20
|
-
'stroke-linecap': string;
|
|
21
|
-
'stroke-linejoin': string;
|
|
22
|
-
'stroke-dasharray': string;
|
|
23
|
-
'stroke-dashoffset': string;
|
|
24
|
-
'stroke-width': string;
|
|
25
|
-
'fill-opacity': string;
|
|
26
|
-
'stroke-opacity': string;
|
|
27
|
-
};
|
|
28
|
-
export declare const SVG_ATTRIBUTE_MAP_KEYS: string[];
|
|
29
|
-
export declare const SVG_PARSE_ATTRIBUTE_MAP: {
|
|
30
|
-
'@_stroke-linecap': string;
|
|
31
|
-
'@_stroke-linejoin': string;
|
|
32
|
-
'@_stroke-dasharray': string;
|
|
33
|
-
'@_stroke-dashoffset': string;
|
|
34
|
-
'@_stroke-width': string;
|
|
35
|
-
'@_fill-opacity': string;
|
|
36
|
-
'@_stroke-opacity': string;
|
|
37
|
-
'@_stroke': string;
|
|
38
|
-
'@_fill': string;
|
|
39
|
-
};
|
|
40
|
-
export declare const SVG_PARSE_ATTRIBUTE_MAP_KEYS: string[];
|
package/es/graphic/constants.js
CHANGED
|
@@ -35,30 +35,4 @@ export const TEXT_NUMBER_TYPE = genNumberType();
|
|
|
35
35
|
export const GraphicService = Symbol.for("GraphicService");
|
|
36
36
|
|
|
37
37
|
export const GraphicCreator = Symbol.for("GraphicCreator");
|
|
38
|
-
|
|
39
|
-
export const SVG_ATTRIBUTE_MAP = {
|
|
40
|
-
"stroke-linecap": "lineCap",
|
|
41
|
-
"stroke-linejoin": "lineJoin",
|
|
42
|
-
"stroke-dasharray": "lineDash",
|
|
43
|
-
"stroke-dashoffset": "lineDashOffset",
|
|
44
|
-
"stroke-width": "lineWidth",
|
|
45
|
-
"fill-opacity": "fillOpacity",
|
|
46
|
-
"stroke-opacity": "strokeOpacity"
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const SVG_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_ATTRIBUTE_MAP);
|
|
50
|
-
|
|
51
|
-
export const SVG_PARSE_ATTRIBUTE_MAP = {
|
|
52
|
-
"@_stroke-linecap": "lineCap",
|
|
53
|
-
"@_stroke-linejoin": "lineJoin",
|
|
54
|
-
"@_stroke-dasharray": "lineDash",
|
|
55
|
-
"@_stroke-dashoffset": "lineDashOffset",
|
|
56
|
-
"@_stroke-width": "lineWidth",
|
|
57
|
-
"@_fill-opacity": "fillOpacity",
|
|
58
|
-
"@_stroke-opacity": "strokeOpacity",
|
|
59
|
-
"@_stroke": "stroke",
|
|
60
|
-
"@_fill": "fill"
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);
|
|
64
38
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,EAAE,CAAC;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AACjD,MAAM,CAAC,MAAM,g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B,GAAG,aAAa,EAAE,CAAC;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,EAAE,CAAC;AAChD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,EAAE,CAAC;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,EAAE,CAAC;AACnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,EAAE,CAAC;AACrD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,EAAE,CAAC;AAChD,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,EAAE,CAAC;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,EAAE,CAAC;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,EAAE,CAAC;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC","file":"constants.js","sourcesContent":["import { genNumberType } from './tools';\n\nexport const ARC_NUMBER_TYPE = genNumberType();\nexport const ARC3D_NUMBER_TYPE = genNumberType();\nexport const AREA_NUMBER_TYPE = genNumberType();\nexport const CIRCLE_NUMBER_TYPE = genNumberType();\nexport const GLYPH_NUMBER_TYPE = genNumberType();\nexport const GROUP_NUMBER_TYPE = genNumberType();\nexport const IMAGE_NUMBER_TYPE = genNumberType();\nexport const LINE_NUMBER_TYPE = genNumberType();\nexport const PATH_NUMBER_TYPE = genNumberType();\nexport const POLYGON_NUMBER_TYPE = genNumberType();\nexport const PYRAMID3D_NUMBER_TYPE = genNumberType();\nexport const RECT_NUMBER_TYPE = genNumberType();\nexport const RECT3D_NUMBER_TYPE = genNumberType();\nexport const RICHTEXT_NUMBER_TYPE = genNumberType();\nexport const SYMBOL_NUMBER_TYPE = genNumberType();\nexport const TEXT_NUMBER_TYPE = genNumberType();\n\nexport const GraphicService = Symbol.for('GraphicService');\nexport const GraphicCreator = Symbol.for('GraphicCreator');\n"]}
|
package/es/graphic/graphic.d.ts
CHANGED
|
@@ -114,9 +114,6 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
114
114
|
addUpdateGlobalPositionTag(): void;
|
|
115
115
|
protected clearUpdateLocalPositionTag(): void;
|
|
116
116
|
protected clearUpdateGlobalPositionTag(): void;
|
|
117
|
-
addUpdateLayoutTag(): void;
|
|
118
|
-
protected clearUpdateLayoutTag(): void;
|
|
119
|
-
protected needUpdateLayout(): boolean;
|
|
120
117
|
protected doUpdateLocalMatrix(): void;
|
|
121
118
|
protected doUpdateGlobalMatrix(): void;
|
|
122
119
|
setStage(stage?: IStage, layer?: ILayer): void;
|
package/es/graphic/graphic.js
CHANGED
|
@@ -80,7 +80,7 @@ export class Graphic extends Node {
|
|
|
80
80
|
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
81
81
|
application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
82
82
|
const bounds = this.doUpdateAABBBounds(full);
|
|
83
|
-
return
|
|
83
|
+
return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
|
|
84
84
|
bounds;
|
|
85
85
|
}
|
|
86
86
|
combindShadowAABBBounds(bounds) {
|
|
@@ -156,7 +156,7 @@ export class Graphic extends Node {
|
|
|
156
156
|
this.attribute[key] = params[key];
|
|
157
157
|
}
|
|
158
158
|
this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTags(keys) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
|
|
159
|
-
this.addUpdatePositionTag(), this.
|
|
159
|
+
this.addUpdatePositionTag(), this.onAttributeUpdate(context);
|
|
160
160
|
}
|
|
161
161
|
setAttribute(key, value, forceUpdateTag, context) {
|
|
162
162
|
var _a;
|
|
@@ -165,7 +165,7 @@ export class Graphic extends Node {
|
|
|
165
165
|
}, this.attribute, key, context);
|
|
166
166
|
params ? this._setAttributes(params, forceUpdateTag, context) : isNil(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value,
|
|
167
167
|
this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(),
|
|
168
|
-
this.addUpdatePositionTag(), this.
|
|
168
|
+
this.addUpdatePositionTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value,
|
|
169
169
|
"background" === key && this.loadImage(value, !0);
|
|
170
170
|
}
|
|
171
171
|
needUpdateTags(keys) {
|
|
@@ -202,8 +202,8 @@ export class Graphic extends Node {
|
|
|
202
202
|
const attribute = this.attribute, postMatrix = attribute.postMatrix;
|
|
203
203
|
return postMatrix ? application.transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y) : (attribute.x = (null !== (_a = attribute.x) && void 0 !== _a ? _a : DefaultTransform.x) + x,
|
|
204
204
|
attribute.y = (null !== (_b = attribute.y) && void 0 !== _b ? _b : DefaultTransform.y) + y),
|
|
205
|
-
this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.
|
|
206
|
-
this
|
|
205
|
+
this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.onAttributeUpdate(context),
|
|
206
|
+
this;
|
|
207
207
|
}
|
|
208
208
|
translateTo(x, y) {
|
|
209
209
|
const attribute = this.attribute;
|
|
@@ -215,8 +215,8 @@ export class Graphic extends Node {
|
|
|
215
215
|
y: y
|
|
216
216
|
}, this.attribute, tempConstantXYKey, context);
|
|
217
217
|
return params ? (this._setAttributes(params, !1, context), this) : (attribute.x = x,
|
|
218
|
-
attribute.y = y, this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.
|
|
219
|
-
this
|
|
218
|
+
attribute.y = y, this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.onAttributeUpdate(context),
|
|
219
|
+
this);
|
|
220
220
|
}
|
|
221
221
|
scale(scaleX, scaleY, scaleCenter) {
|
|
222
222
|
var _a, _b;
|
|
@@ -236,8 +236,8 @@ export class Graphic extends Node {
|
|
|
236
236
|
postMatrix || (postMatrix = new Matrix, attribute.postMatrix = postMatrix), application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);
|
|
237
237
|
} else attribute.scaleX = (null !== (_a = attribute.scaleX) && void 0 !== _a ? _a : DefaultTransform.scaleX) * scaleX,
|
|
238
238
|
attribute.scaleY = (null !== (_b = attribute.scaleY) && void 0 !== _b ? _b : DefaultTransform.scaleY) * scaleY;
|
|
239
|
-
return this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.
|
|
240
|
-
this
|
|
239
|
+
return this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.onAttributeUpdate(context),
|
|
240
|
+
this;
|
|
241
241
|
}
|
|
242
242
|
scaleTo(scaleX, scaleY) {
|
|
243
243
|
const attribute = this.attribute;
|
|
@@ -250,7 +250,7 @@ export class Graphic extends Node {
|
|
|
250
250
|
}, this.attribute, tempConstantScaleXYKey, context);
|
|
251
251
|
return params ? (this._setAttributes(params, !1, context), this) : (attribute.scaleX = scaleX,
|
|
252
252
|
attribute.scaleY = scaleY, this.addUpdatePositionTag(), this.addUpdateBoundTag(),
|
|
253
|
-
this.
|
|
253
|
+
this.onAttributeUpdate(context), this);
|
|
254
254
|
}
|
|
255
255
|
rotate(angle) {
|
|
256
256
|
var _a;
|
|
@@ -261,8 +261,8 @@ export class Graphic extends Node {
|
|
|
261
261
|
if (params) return this._setAttributes(params, !1, context), this;
|
|
262
262
|
const attribute = this.attribute;
|
|
263
263
|
return attribute.angle = (null !== (_a = attribute.angle) && void 0 !== _a ? _a : DefaultTransform.angle) + angle,
|
|
264
|
-
this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.
|
|
265
|
-
this
|
|
264
|
+
this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.onAttributeUpdate(context),
|
|
265
|
+
this;
|
|
266
266
|
}
|
|
267
267
|
rotateTo(angle) {
|
|
268
268
|
const attribute = this.attribute;
|
|
@@ -271,8 +271,8 @@ export class Graphic extends Node {
|
|
|
271
271
|
type: AttributeUpdateType.ROTATE_TO
|
|
272
272
|
}, params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);
|
|
273
273
|
return params ? (this._setAttributes(params, !1, context), this) : (attribute.angle = angle,
|
|
274
|
-
this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.
|
|
275
|
-
this
|
|
274
|
+
this.addUpdatePositionTag(), this.addUpdateBoundTag(), this.onAttributeUpdate(context),
|
|
275
|
+
this);
|
|
276
276
|
}
|
|
277
277
|
skewTo(b, c) {
|
|
278
278
|
return this;
|
|
@@ -398,17 +398,8 @@ export class Graphic extends Node {
|
|
|
398
398
|
clearUpdateGlobalPositionTag() {
|
|
399
399
|
this._updateTag &= UpdateTag.CLEAR_GLOBAL_MATRIX;
|
|
400
400
|
}
|
|
401
|
-
addUpdateLayoutTag() {
|
|
402
|
-
this._updateTag |= UpdateTag.UPDATE_LAYOUT;
|
|
403
|
-
}
|
|
404
|
-
clearUpdateLayoutTag() {
|
|
405
|
-
this._updateTag &= UpdateTag.CLEAR_LAYOUT;
|
|
406
|
-
}
|
|
407
|
-
needUpdateLayout() {
|
|
408
|
-
return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
|
|
409
|
-
}
|
|
410
401
|
doUpdateLocalMatrix() {
|
|
411
|
-
const {x: x = DefaultTransform.x, y: y = DefaultTransform.y, scaleX: scaleX = DefaultTransform.scaleX, scaleY: scaleY = DefaultTransform.scaleY, angle: angle = DefaultTransform.angle, anchor: anchor, postMatrix: postMatrix} = this.attribute, _anchor = [ 0, 0 ];
|
|
402
|
+
const {x: x = DefaultTransform.x, y: y = DefaultTransform.y, scaleX: scaleX = DefaultTransform.scaleX, scaleY: scaleY = DefaultTransform.scaleY, angle: angle = DefaultTransform.angle, scaleCenter: scaleCenter, anchor: anchor, postMatrix: postMatrix} = this.attribute, _anchor = [ 0, 0 ];
|
|
412
403
|
if (anchor) {
|
|
413
404
|
if ("string" == typeof anchor[0]) {
|
|
414
405
|
const ratio = parseFloat(anchor[0]) / 100, bounds = this.AABBBounds;
|
|
@@ -419,7 +410,14 @@ export class Graphic extends Node {
|
|
|
419
410
|
_anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
|
|
420
411
|
} else _anchor[1] = anchor[1];
|
|
421
412
|
}
|
|
422
|
-
normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);
|
|
413
|
+
if (!scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
|
|
414
|
+
const m = this._transMatrix;
|
|
415
|
+
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]),
|
|
416
|
+
m.translate(x, y), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
417
|
+
x: scaleCenter[0],
|
|
418
|
+
y: scaleCenter[1]
|
|
419
|
+
});
|
|
420
|
+
}
|
|
423
421
|
const p = this.getOffsetXY(DefaultTransform);
|
|
424
422
|
if (this._transMatrix.e += p.x, this._transMatrix.f += p.y, postMatrix) {
|
|
425
423
|
const m1 = tempMatrix.setValue(postMatrix.a, postMatrix.b, postMatrix.c, postMatrix.d, postMatrix.e, postMatrix.f), m2 = this._transMatrix;
|
|
@@ -434,16 +432,8 @@ export class Graphic extends Node {
|
|
|
434
432
|
}
|
|
435
433
|
}
|
|
436
434
|
setStage(stage, layer) {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
this.animates && this.animates.size) {
|
|
440
|
-
const timeline = stage.getTimeline();
|
|
441
|
-
this.animates.forEach((a => {
|
|
442
|
-
a.setTimeline(timeline);
|
|
443
|
-
}));
|
|
444
|
-
}
|
|
445
|
-
this._onSetStage && this._onSetStage(this, stage, layer), application.graphicService.onSetStage(this, stage);
|
|
446
|
-
}
|
|
435
|
+
this.stage !== stage && (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
|
|
436
|
+
this._onSetStage && this._onSetStage(this, stage, layer), application.graphicService.onSetStage(this, stage));
|
|
447
437
|
}
|
|
448
438
|
setStageToShadowRoot(stage, layer) {
|
|
449
439
|
this.shadowRoot && this.shadowRoot.setStage(stage, layer);
|
|
@@ -541,7 +531,7 @@ export class Graphic extends Node {
|
|
|
541
531
|
this.pathProxy;
|
|
542
532
|
}
|
|
543
533
|
loadImage(image, background = !1) {
|
|
544
|
-
if (!image
|
|
534
|
+
if (!image) return;
|
|
545
535
|
const url = image;
|
|
546
536
|
this.resources || (this.resources = new Map);
|
|
547
537
|
const cache = {
|
|
@@ -588,9 +578,5 @@ export class Graphic extends Node {
|
|
|
588
578
|
}
|
|
589
579
|
}
|
|
590
580
|
|
|
591
|
-
function backgroundNotImage(image) {
|
|
592
|
-
return !(!image.fill && !image.stroke);
|
|
593
|
-
}
|
|
594
|
-
|
|
595
581
|
Graphic.mixin(EventTarget);
|
|
596
582
|
//# sourceMappingURL=graphic.js.map
|