@visactor/vrender-core 1.0.0-alpha.5 → 1.0.0-alpha.7
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/config.d.ts +0 -1
- package/cjs/animate/config.js +1 -5
- package/cjs/animate/config.js.map +1 -1
- package/cjs/application.d.ts +2 -1
- package/cjs/application.js.map +1 -1
- package/cjs/color-string/interpolate.js +5 -2
- package/cjs/color-string/interpolate.js.map +1 -1
- package/cjs/common/canvas-utils.js +6 -3
- package/cjs/common/canvas-utils.js.map +1 -1
- package/cjs/common/custom-path2d.js +2 -2
- package/cjs/common/custom-path2d.js.map +1 -1
- package/cjs/common/morphing-utils.js +32 -124
- package/cjs/common/morphing-utils.js.map +1 -1
- package/cjs/common/segment/index.js +3 -0
- package/cjs/common/segment/index.js.map +1 -1
- package/cjs/common/segment/step.d.ts +6 -0
- package/cjs/common/segment/step.js +19 -2
- package/cjs/common/segment/step.js.map +1 -1
- package/cjs/common/shape/arc.d.ts +1 -1
- package/cjs/common/shape/arc.js +7 -3
- package/cjs/common/shape/arc.js.map +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/split-path.js.map +1 -1
- package/cjs/common/utils.d.ts +0 -2
- package/cjs/common/utils.js +4 -8
- package/cjs/common/utils.js.map +1 -1
- package/cjs/core/stage.d.ts +2 -1
- package/cjs/core/stage.js +4 -3
- package/cjs/core/stage.js.map +1 -1
- package/cjs/graphic/arc.d.ts +1 -2
- package/cjs/graphic/arc.js +4 -3
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/area.d.ts +1 -2
- package/cjs/graphic/area.js +5 -2
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/circle.d.ts +1 -2
- package/cjs/graphic/circle.js +7 -3
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.d.ts +2 -1
- package/cjs/graphic/config.js +10 -3
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/constants.d.ts +1 -0
- package/cjs/graphic/constants.js +4 -3
- package/cjs/graphic/constants.js.map +1 -1
- package/cjs/graphic/graphic-service/graphic-module.js +1 -2
- package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +7 -1
- package/cjs/graphic/graphic.js +27 -19
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.js +14 -7
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/image.js +2 -1
- package/cjs/graphic/image.js.map +1 -1
- package/cjs/graphic/index.d.ts +1 -0
- package/cjs/graphic/index.js +8 -8
- package/cjs/graphic/index.js.map +1 -1
- package/cjs/graphic/line.d.ts +1 -2
- package/cjs/graphic/line.js +7 -2
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/path.js +2 -1
- package/cjs/graphic/path.js.map +1 -1
- package/cjs/graphic/polygon.js +2 -1
- package/cjs/graphic/polygon.js.map +1 -1
- package/cjs/graphic/rect.js +7 -3
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/richtext/icon.d.ts +1 -1
- package/cjs/graphic/richtext/icon.js.map +1 -1
- package/cjs/graphic/richtext.js +3 -2
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/star.d.ts +52 -0
- package/cjs/graphic/star.js +78 -0
- package/cjs/graphic/star.js.map +1 -0
- package/cjs/graphic/symbol.js +3 -1
- package/cjs/graphic/symbol.js.map +1 -1
- package/cjs/graphic/text.js +1 -0
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/theme.js +2 -0
- package/cjs/graphic/theme.js.map +1 -1
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +7 -6
- package/cjs/index.js.map +1 -1
- package/cjs/interface/animation/animate.d.ts +17 -0
- package/cjs/interface/animation/animate.js.map +1 -1
- package/cjs/interface/common.d.ts +1 -1
- package/cjs/interface/common.js.map +1 -1
- package/cjs/interface/contribution.d.ts +2 -0
- package/cjs/interface/contribution.js.map +1 -1
- package/cjs/interface/graphic/index.d.ts +1 -0
- package/cjs/interface/graphic/index.js +3 -2
- package/cjs/interface/graphic/index.js.map +1 -1
- package/cjs/interface/graphic/star.d.ts +12 -0
- package/cjs/interface/graphic/star.js +6 -0
- package/cjs/interface/graphic/star.js.map +1 -0
- package/cjs/interface/graphic/theme.d.ts +3 -0
- package/cjs/interface/graphic/theme.js.map +1 -1
- package/cjs/interface/graphic.d.ts +11 -0
- package/cjs/interface/graphic.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 +2 -0
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/modules.d.ts +2 -1
- package/cjs/modules.js +4 -3
- package/cjs/modules.js.map +1 -1
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js +9 -8
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +14 -11
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +13 -10
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/cjs/register/register-star.d.ts +1 -0
- package/cjs/register/register-star.js +14 -0
- package/cjs/register/register-star.js.map +1 -0
- package/cjs/render/contributions/render/area-render.js +2 -2
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- package/cjs/render/contributions/render/contributions/constants.d.ts +1 -0
- package/cjs/render/contributions/render/contributions/constants.js +3 -2
- package/cjs/render/contributions/render/contributions/constants.js.map +1 -1
- package/cjs/render/contributions/render/contributions/index.d.ts +1 -0
- package/cjs/render/contributions/render/contributions/index.js +2 -2
- package/cjs/render/contributions/render/contributions/index.js.map +1 -1
- package/cjs/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
- package/cjs/render/contributions/render/contributions/star-contribution-render.js +11 -0
- package/cjs/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
- package/cjs/render/contributions/render/line-render.js +1 -1
- package/cjs/render/contributions/render/line-render.js.map +1 -1
- package/cjs/render/contributions/render/star-module.d.ts +2 -0
- package/cjs/render/contributions/render/star-module.js +15 -0
- package/cjs/render/contributions/render/star-module.js.map +1 -0
- package/cjs/render/contributions/render/star-render.d.ts +10 -0
- package/cjs/render/contributions/render/star-render.js +54 -0
- package/cjs/render/contributions/render/star-render.js.map +1 -0
- package/cjs/render/contributions/render/symbol.d.ts +1 -0
- package/cjs/render/contributions/render/symbol.js +2 -2
- package/cjs/render/contributions/render/symbol.js.map +1 -1
- package/cjs/render/render-service.d.ts +1 -1
- package/cjs/render/render-service.js.map +1 -1
- package/dist/index.es.js +12340 -12134
- package/es/animate/config.d.ts +0 -1
- package/es/animate/config.js +0 -5
- package/es/animate/config.js.map +1 -1
- package/es/application.d.ts +2 -1
- package/es/application.js.map +1 -1
- package/es/color-string/interpolate.js +4 -1
- package/es/color-string/interpolate.js.map +1 -1
- package/es/common/canvas-utils.js +6 -3
- package/es/common/canvas-utils.js.map +1 -1
- package/es/common/custom-path2d.js +2 -2
- package/es/common/custom-path2d.js.map +1 -1
- package/es/common/morphing-utils.js +29 -124
- package/es/common/morphing-utils.js.map +1 -1
- package/es/common/segment/index.js +4 -1
- package/es/common/segment/index.js.map +1 -1
- package/es/common/segment/step.d.ts +6 -0
- package/es/common/segment/step.js +13 -0
- package/es/common/segment/step.js.map +1 -1
- package/es/common/shape/arc.d.ts +1 -1
- package/es/common/shape/arc.js +7 -3
- package/es/common/shape/arc.js.map +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/split-path.js.map +1 -1
- package/es/common/utils.d.ts +0 -2
- package/es/common/utils.js +0 -4
- package/es/common/utils.js.map +1 -1
- package/es/core/stage.d.ts +2 -1
- package/es/core/stage.js +5 -2
- package/es/core/stage.js.map +1 -1
- package/es/graphic/arc.d.ts +1 -2
- package/es/graphic/arc.js +4 -3
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/area.d.ts +1 -2
- package/es/graphic/area.js +5 -2
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/circle.d.ts +1 -2
- package/es/graphic/circle.js +6 -3
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.d.ts +2 -1
- package/es/graphic/config.js +11 -2
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/constants.d.ts +1 -0
- package/es/graphic/constants.js +2 -0
- package/es/graphic/constants.js.map +1 -1
- package/es/graphic/graphic-service/graphic-module.js +1 -1
- package/es/graphic/graphic-service/graphic-module.js.map +1 -1
- package/es/graphic/graphic.d.ts +7 -1
- package/es/graphic/graphic.js +28 -18
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.js +15 -8
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/image.js +2 -1
- package/es/graphic/image.js.map +1 -1
- package/es/graphic/index.d.ts +1 -0
- package/es/graphic/index.js +2 -0
- package/es/graphic/index.js.map +1 -1
- package/es/graphic/line.d.ts +1 -2
- package/es/graphic/line.js +7 -2
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/path.js +2 -1
- package/es/graphic/path.js.map +1 -1
- package/es/graphic/polygon.js +2 -1
- package/es/graphic/polygon.js.map +1 -1
- package/es/graphic/rect.js +7 -3
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/richtext/icon.d.ts +1 -1
- package/es/graphic/richtext/icon.js.map +1 -1
- package/es/graphic/richtext.js +3 -2
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/star.d.ts +52 -0
- package/es/graphic/star.js +82 -0
- package/es/graphic/star.js.map +1 -0
- package/es/graphic/symbol.js +3 -1
- package/es/graphic/symbol.js.map +1 -1
- package/es/graphic/text.js +1 -0
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/theme.js +3 -1
- package/es/graphic/theme.js.map +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -0
- package/es/index.js.map +1 -1
- package/es/interface/animation/animate.d.ts +17 -0
- package/es/interface/animation/animate.js.map +1 -1
- package/es/interface/common.d.ts +1 -1
- package/es/interface/common.js.map +1 -1
- package/es/interface/contribution.d.ts +2 -0
- package/es/interface/contribution.js.map +1 -1
- package/es/interface/graphic/index.d.ts +1 -0
- package/es/interface/graphic/index.js +2 -0
- package/es/interface/graphic/index.js.map +1 -1
- package/es/interface/graphic/star.d.ts +12 -0
- package/es/interface/graphic/star.js +2 -0
- package/es/interface/graphic/star.js.map +1 -0
- package/es/interface/graphic/theme.d.ts +3 -0
- package/es/interface/graphic/theme.js.map +1 -1
- package/es/interface/graphic.d.ts +11 -0
- package/es/interface/graphic.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 +2 -0
- package/es/interface/stage.js.map +1 -1
- package/es/modules.d.ts +2 -1
- package/es/modules.js +6 -0
- package/es/modules.js.map +1 -1
- package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
- package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +13 -12
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +12 -11
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
- package/es/register/register-star.d.ts +1 -0
- package/es/register/register-star.js +8 -0
- package/es/register/register-star.js.map +1 -0
- package/es/render/contributions/render/area-render.js +2 -2
- package/es/render/contributions/render/area-render.js.map +1 -1
- package/es/render/contributions/render/contributions/constants.d.ts +1 -0
- package/es/render/contributions/render/contributions/constants.js +2 -0
- package/es/render/contributions/render/contributions/constants.js.map +1 -1
- package/es/render/contributions/render/contributions/index.d.ts +1 -0
- package/es/render/contributions/render/contributions/index.js +2 -0
- package/es/render/contributions/render/contributions/index.js.map +1 -1
- package/es/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
- package/es/render/contributions/render/contributions/star-contribution-render.js +8 -0
- package/es/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
- package/es/render/contributions/render/line-render.js +1 -1
- package/es/render/contributions/render/line-render.js.map +1 -1
- package/es/render/contributions/render/star-module.d.ts +2 -0
- package/es/render/contributions/render/star-module.js +13 -0
- package/es/render/contributions/render/star-module.js.map +1 -0
- package/es/render/contributions/render/star-render.d.ts +10 -0
- package/es/render/contributions/render/star-render.js +59 -0
- package/es/render/contributions/render/star-render.js.map +1 -0
- package/es/render/contributions/render/symbol.d.ts +1 -0
- package/es/render/contributions/render/symbol.js +2 -0
- package/es/render/contributions/render/symbol.js.map +1 -1
- package/es/render/render-service.d.ts +1 -1
- package/es/render/render-service.js.map +1 -1
- package/package.json +4 -4
package/es/graphic/circle.js
CHANGED
|
@@ -36,7 +36,8 @@ export class Circle extends Graphic {
|
|
|
36
36
|
this.updatePathProxyAABBBounds(aabbBounds) || (full ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds) : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds));
|
|
37
37
|
const {tb1: tb1, tb2: tb2} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
38
38
|
return updateBoundsOfCommonOuterBorder(attribute, circleTheme, tb1), aabbBounds.union(tb1),
|
|
39
|
-
tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2),
|
|
39
|
+
tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1,
|
|
40
|
+
this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, !1, this),
|
|
40
41
|
aabbBounds;
|
|
41
42
|
}
|
|
42
43
|
updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds) {
|
|
@@ -56,8 +57,10 @@ export class Circle extends Graphic {
|
|
|
56
57
|
}
|
|
57
58
|
toCustomPath() {
|
|
58
59
|
var _a, _b, _c;
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
let path = super.toCustomPath();
|
|
61
|
+
if (path) return path;
|
|
62
|
+
const attribute = this.attribute, radius = null !== (_a = attribute.radius) && void 0 !== _a ? _a : this.getDefaultAttribute("radius"), startAngle = null !== (_b = attribute.startAngle) && void 0 !== _b ? _b : this.getDefaultAttribute("startAngle"), endAngle = null !== (_c = attribute.endAngle) && void 0 !== _c ? _c : this.getDefaultAttribute("endAngle");
|
|
63
|
+
return path = new CustomPath2D, path.arc(0, 0, radius, startAngle, endAngle), path;
|
|
61
64
|
}
|
|
62
65
|
clone() {
|
|
63
66
|
return new Circle(Object.assign({}, this.attribute));
|
package/es/graphic/circle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAoB,MAAM,kBAAkB,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,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AqB,CAAC,CAAC;IACzD,CAAC;IAED,YAAY;;QACV,IAAI,IAAI,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;QAChC,IAAI,IAAI,EAAE;YACR,OAAO,IAAI,CAAC;SACb;QACD,MAAM,CAAC,GAAG,CAAC,CAAC;QACZ,MAAM,CAAC,GAAG,CAAC,CAAC;QAEZ,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,MAAM,MAAM,GAAG,MAAA,SAAS,CAAC,MAAM,mCAAI,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACtE,MAAM,UAAU,GAAG,MAAA,SAAS,CAAC,UAAU,mCAAI,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAClF,MAAM,QAAQ,GAAG,MAAA,SAAS,CAAC,QAAQ,mCAAI,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAE5E,IAAI,GAAG,IAAI,YAAY,EAAE,CAAC;QAE1B,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO,IAAI,MAAM,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AA5GM,0BAAmB,GAAG,mBAAmB,CAAC;AA+GnD,MAAM,UAAU,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC","file":"circle.js","sourcesContent":["import { epsilon, pi2, type IAABBBounds } from '@visactor/vutils';\nimport type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { circleBounds } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { CIRCLE_NUMBER_TYPE } from './constants';\nimport { updateBoundsOfCommonOuterBorder } from './graphic-service/common-outer-boder-bounds';\n\nconst CIRCLE_UPDATE_TAG_KEY = ['radius', 'startAngle', 'endAngle', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Circle extends Graphic<ICircleGraphicAttribute> implements ICircle {\n type: 'circle' = 'circle';\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: ICircleGraphicAttribute = { radius: 1 }) {\n super(params);\n this.numberType = CIRCLE_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, radius } = this.attribute;\n return this._validNumber(startAngle) && this._validNumber(endAngle) && this._validNumber(radius);\n }\n\n getGraphicTheme(): Required<ICircleGraphicAttribute> {\n return getTheme(this).circle;\n }\n\n protected updateAABBBounds(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ) {\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n full\n ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds)\n : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds);\n }\n\n const { tb1, tb2 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n updateBoundsOfCommonOuterBorder(attribute, circleTheme, tb1);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n\n this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1;\n this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;\n\n application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, false, this);\n\n return aabbBounds;\n }\n\n protected updateCircleAABBBoundsImprecise(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n const { radius = circleTheme.radius } = attribute;\n aabbBounds.set(-radius, -radius, radius, radius);\n\n return aabbBounds;\n }\n protected updateCircleAABBBoundsAccurate(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n const {\n startAngle = circleTheme.startAngle,\n endAngle = circleTheme.endAngle,\n radius = circleTheme.radius\n } = attribute;\n\n if (endAngle - startAngle > pi2 - epsilon) {\n aabbBounds.set(-radius, -radius, radius, radius);\n } else {\n circleBounds(startAngle, endAngle, radius, aabbBounds);\n }\n\n return aabbBounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, CIRCLE_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, CIRCLE_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n let path = super.toCustomPath();\n if (path) {\n return path;\n }\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const radius = attribute.radius ?? this.getDefaultAttribute('radius');\n const startAngle = attribute.startAngle ?? this.getDefaultAttribute('startAngle');\n const endAngle = attribute.endAngle ?? this.getDefaultAttribute('endAngle');\n\n path = new CustomPath2D();\n\n path.arc(x, y, radius, startAngle, endAngle);\n\n return path;\n }\n\n clone() {\n return new Circle({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Circle.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createCircle(attributes: ICircleGraphicAttribute): ICircle {\n return new Circle(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
|
package/es/graphic/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IArcGraphicAttribute, type IAreaGraphicAttribute, type IGraphicAttribute, type ICircleGraphicAttribute, type IFillStyle, type IGlyphGraphicAttribute, type IGroupGraphicAttribute, type IImageGraphicAttribute, type ILineGraphicAttribute, type IPathGraphicAttribute, type IPolygonGraphicAttribute, type IRect3dGraphicAttribute, type IRectGraphicAttribute, type IStrokeStyle, type IGraphicStyle, type ISymbolGraphicAttribute, type ITextAttribute, type ITextGraphicAttribute, type IRichTextGraphicAttribute, type ITransform, type IRichTextIconGraphicAttribute, type IConnectedStyle, type ILayout, type IDebugType, type IPickStyle } from '../interface';
|
|
1
|
+
import { type IArcGraphicAttribute, type IAreaGraphicAttribute, type IGraphicAttribute, type ICircleGraphicAttribute, type IFillStyle, type IGlyphGraphicAttribute, type IGroupGraphicAttribute, type IImageGraphicAttribute, type ILineGraphicAttribute, type IPathGraphicAttribute, type IPolygonGraphicAttribute, type IRect3dGraphicAttribute, type IRectGraphicAttribute, type IStrokeStyle, type IGraphicStyle, type ISymbolGraphicAttribute, type ITextAttribute, type ITextGraphicAttribute, type IRichTextGraphicAttribute, type ITransform, type IRichTextIconGraphicAttribute, type IStarGraphicAttribute, type IConnectedStyle, type ILayout, type IDebugType, type IPickStyle } from '../interface';
|
|
2
2
|
export declare const DefaultLayout: ILayout;
|
|
3
3
|
export declare const DefaultTransform: ITransform;
|
|
4
4
|
export declare const DefaultFillStyle: IFillStyle;
|
|
@@ -19,6 +19,7 @@ export declare const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute>;
|
|
|
19
19
|
export declare const DefaultLineAttribute: Required<ILineGraphicAttribute>;
|
|
20
20
|
export declare const DefaultPathAttribute: Required<IPathGraphicAttribute>;
|
|
21
21
|
export declare const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute>;
|
|
22
|
+
export declare const DefaultStarAttribute: Required<IStarGraphicAttribute>;
|
|
22
23
|
export declare const DefaultRectAttribute: Required<IRectGraphicAttribute>;
|
|
23
24
|
export declare const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute>;
|
|
24
25
|
export declare const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute>;
|
package/es/graphic/config.js
CHANGED
|
@@ -120,7 +120,8 @@ export const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.ass
|
|
|
120
120
|
filter: "",
|
|
121
121
|
cursor: null,
|
|
122
122
|
html: null,
|
|
123
|
-
react: null
|
|
123
|
+
react: null,
|
|
124
|
+
vue: null
|
|
124
125
|
}, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout), DefaultPickStyle);
|
|
125
126
|
|
|
126
127
|
export const DefaultConnectAttribute = {
|
|
@@ -158,7 +159,8 @@ export const DefaultAttribute = Object.assign(Object.assign(Object.assign({
|
|
|
158
159
|
overflow: "hidden",
|
|
159
160
|
shadowPickMode: "graphic",
|
|
160
161
|
keepStrokeScale: !1,
|
|
161
|
-
clipConfig: null
|
|
162
|
+
clipConfig: null,
|
|
163
|
+
roughStyle: null
|
|
162
164
|
}, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
|
|
163
165
|
|
|
164
166
|
export function addAttributeToPrototype(obj, c, keys) {
|
|
@@ -250,6 +252,13 @@ export const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAt
|
|
|
250
252
|
closePath: !0
|
|
251
253
|
});
|
|
252
254
|
|
|
255
|
+
export const DefaultStarAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
256
|
+
width: 100,
|
|
257
|
+
height: 100,
|
|
258
|
+
spikes: 5,
|
|
259
|
+
thickness: .5
|
|
260
|
+
});
|
|
261
|
+
|
|
253
262
|
export const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
254
263
|
width: 0,
|
|
255
264
|
height: 0,
|
package/es/graphic/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC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,GAAG,IACX,gBAAgB,KACnB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,OAAO,GACpB,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,mCACpC,qBAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,GACX,CAAC","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Logger, Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport {\n type IArcGraphicAttribute,\n type IAreaGraphicAttribute,\n type IGraphicAttribute,\n type ICircleGraphicAttribute,\n type IFillStyle,\n type IGlyphGraphicAttribute,\n type IGroupGraphicAttribute,\n type IImageGraphicAttribute,\n type ILineGraphicAttribute,\n type IPathGraphicAttribute,\n type IPolygonGraphicAttribute,\n type IRect3dGraphicAttribute,\n type IRectGraphicAttribute,\n type IStrokeStyle,\n type IGraphicStyle,\n type ISymbolGraphicAttribute,\n type ITextAttribute,\n type ITextGraphicAttribute,\n type IRichTextGraphicAttribute,\n type ITransform,\n type RichTextWordBreak,\n type RichTextVerticalDirection,\n type RichTextGlobalAlignType,\n type RichTextGlobalBaselineType,\n type IRichTextIconGraphicAttribute,\n type IConnectedStyle,\n type ILayout,\n type IDebugType,\n type IPickStyle,\n MeasureModeEnum\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 maxWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false,\n verticalMode: 0,\n wrap: false,\n whiteSpace: 'no-wrap',\n heightLimit: Infinity,\n lineClamp: Infinity,\n suffixPosition: 'end',\n underlineDash: [],\n underlineOffset: 0,\n disableAutoClipedPoptip: undefined,\n measureMode: MeasureModeEnum.fontBounding,\n keepCenterInLine: false\n};\n\nexport const DefaultPickStyle: IPickStyle = {\n pickStrokeBuffer: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n forceBoundsWidth: undefined,\n forceBoundsHeight: undefined,\n opacity: 1,\n background: null,\n autoAnimateTexture: false,\n textureRatio: 1,\n textureOptions: null,\n backgroundOpacity: 1,\n backgroundCornerRadius: 0,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 'no-repeat',\n backgroundFit: true,\n backgroundKeepAspectRatio: false,\n backgroundClip: true,\n backgroundScale: 1,\n backgroundOffsetX: 0,\n backgroundOffsetY: 0,\n blur: 0,\n filter: '',\n cursor: null,\n html: null,\n react: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout,\n ...DefaultPickStyle\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultDebugAttribute: Required<IDebugType> = {\n _debug_bounds: false\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n renderable: true,\n pickable: true,\n shadowGraphic: undefined,\n childrenPickable: true,\n fillPickable: true,\n strokePickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n fillStrokeOrder: 0,\n renderStyle: 'default',\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n globalZIndex: 1,\n globalCompositeOperation: '',\n overflow: 'hidden',\n shadowPickMode: 'graphic',\n keepStrokeScale: false,\n clipConfig: null,\n ...DefaultDebugAttribute,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n innerPadding: 0,\n outerPadding: 0,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n closePath: false,\n curveTension: 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 baseOpacity: 1,\n cornerType: 'round'\n // 默认是0,不需要主题\n // drawMode: 0\n} as any;\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 curveTension: 1\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n fillStrokeOrder: 1,\n clipRange: 1,\n customPath: () => {\n Logger.getInstance().warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0,\n closePath: true\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0,\n cornerType: 'round'\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n cornerRadius: 0,\n length: 0,\n cornerType: 'round'\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true,\n clipRange: 1\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n upgradeAttrs: null,\n editable: false,\n editOptions: null,\n ascentDescentMode: 'actual',\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n disableAutoWrapLine: false,\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n maxWidth: 500,\n maxHeight: 500,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0,\n cornerType: 'round'\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EA+BL,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,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,CAA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T,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,GACX,CAAC","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Logger, Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport {\n type IArcGraphicAttribute,\n type IAreaGraphicAttribute,\n type IGraphicAttribute,\n type ICircleGraphicAttribute,\n type IFillStyle,\n type IGlyphGraphicAttribute,\n type IGroupGraphicAttribute,\n type IImageGraphicAttribute,\n type ILineGraphicAttribute,\n type IPathGraphicAttribute,\n type IPolygonGraphicAttribute,\n type IRect3dGraphicAttribute,\n type IRectGraphicAttribute,\n type IStrokeStyle,\n type IGraphicStyle,\n type ISymbolGraphicAttribute,\n type ITextAttribute,\n type ITextGraphicAttribute,\n type IRichTextGraphicAttribute,\n type ITransform,\n type RichTextWordBreak,\n type RichTextVerticalDirection,\n type RichTextGlobalAlignType,\n type RichTextGlobalBaselineType,\n type IRichTextIconGraphicAttribute,\n type IStarGraphicAttribute,\n type IConnectedStyle,\n type ILayout,\n type IDebugType,\n type IPickStyle,\n MeasureModeEnum\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 maxWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false,\n verticalMode: 0,\n wrap: false,\n whiteSpace: 'no-wrap',\n heightLimit: Infinity,\n lineClamp: Infinity,\n suffixPosition: 'end',\n underlineDash: [],\n underlineOffset: 0,\n disableAutoClipedPoptip: undefined,\n measureMode: MeasureModeEnum.fontBounding,\n keepCenterInLine: false\n};\n\nexport const DefaultPickStyle: IPickStyle = {\n pickStrokeBuffer: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n forceBoundsWidth: undefined,\n forceBoundsHeight: undefined,\n opacity: 1,\n background: null,\n autoAnimateTexture: false,\n textureRatio: 1,\n textureOptions: null,\n backgroundOpacity: 1,\n backgroundCornerRadius: 0,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 'no-repeat',\n backgroundFit: true,\n backgroundKeepAspectRatio: false,\n backgroundClip: true,\n backgroundScale: 1,\n backgroundOffsetX: 0,\n backgroundOffsetY: 0,\n blur: 0,\n filter: '',\n cursor: null,\n html: null,\n react: null,\n vue: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout,\n ...DefaultPickStyle\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultDebugAttribute: Required<IDebugType> = {\n _debug_bounds: false\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n renderable: true,\n pickable: true,\n shadowGraphic: undefined,\n childrenPickable: true,\n fillPickable: true,\n strokePickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n fillStrokeOrder: 0,\n renderStyle: 'default',\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n globalZIndex: 1,\n globalCompositeOperation: '',\n overflow: 'hidden',\n shadowPickMode: 'graphic',\n keepStrokeScale: false,\n clipConfig: null,\n roughStyle: null,\n ...DefaultDebugAttribute,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n innerPadding: 0,\n outerPadding: 0,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n closePath: false,\n curveTension: 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 baseOpacity: 1,\n cornerType: 'round'\n // 默认是0,不需要主题\n // drawMode: 0\n} as any;\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 curveTension: 1\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n fillStrokeOrder: 1,\n clipRange: 1,\n customPath: () => {\n Logger.getInstance().warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0,\n closePath: true\n};\n\nexport const DefaultStarAttribute: Required<IStarGraphicAttribute> = {\n ...DefaultAttribute,\n width: 100,\n height: 100,\n spikes: 5,\n thickness: 0.5\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0,\n cornerType: 'round'\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n cornerRadius: 0,\n length: 0,\n cornerType: 'round'\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true,\n clipRange: 1\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n upgradeAttrs: null,\n editable: false,\n editOptions: null,\n ascentDescentMode: 'actual',\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n disableAutoWrapLine: false,\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n maxWidth: 500,\n maxHeight: 500,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0,\n cornerType: 'round'\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"]}
|
|
@@ -12,6 +12,7 @@ export declare const PYRAMID3D_NUMBER_TYPE: number;
|
|
|
12
12
|
export declare const RECT_NUMBER_TYPE: number;
|
|
13
13
|
export declare const RECT3D_NUMBER_TYPE: number;
|
|
14
14
|
export declare const RICHTEXT_NUMBER_TYPE: number;
|
|
15
|
+
export declare const STAR_NUMBER_TYPE: number;
|
|
15
16
|
export declare const SYMBOL_NUMBER_TYPE: number;
|
|
16
17
|
export declare const TEXT_NUMBER_TYPE: number;
|
|
17
18
|
export declare const GraphicService: unique symbol;
|
package/es/graphic/constants.js
CHANGED
|
@@ -28,6 +28,8 @@ export const RECT3D_NUMBER_TYPE = genNumberType();
|
|
|
28
28
|
|
|
29
29
|
export const RICHTEXT_NUMBER_TYPE = genNumberType();
|
|
30
30
|
|
|
31
|
+
export const STAR_NUMBER_TYPE = genNumberType();
|
|
32
|
+
|
|
31
33
|
export const SYMBOL_NUMBER_TYPE = genNumberType();
|
|
32
34
|
|
|
33
35
|
export const TEXT_NUMBER_TYPE = genNumberType();
|
|
@@ -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,gBAAgB,GAAG,aAAa,EAAE,CAAC;AAChD,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,EAAE,CAAC;A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AC3B,iBAAiB,EAAE,UAAU;IAC7B,kBAAkB,EAAE,UAAU;IAC9B,mBAAmB,EAAE,gBAAgB;IACrC,cAAc,EAAE,WAAW;IAC3B,cAAc,EAAE,aAAa;IAC7B,gBAAgB,EAAE,eAAe;IACjC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,uBAAuB,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\nexport const SVG_ATTRIBUTE_MAP = {\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-width': 'lineWidth',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity'\n};\n\nexport const SVG_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_ATTRIBUTE_MAP);\n\nexport const SVG_PARSE_ATTRIBUTE_MAP = {\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-width': 'lineWidth',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n stroke: 'stroke',\n fill: 'fill'\n};\n\nexport const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);\n"]}
|
|
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,gBAAgB,GAAG,aAAa,EAAE,CAAC;AAChD,MAAM,CAAC,MAAM,kBAAkB,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,gBAAgB,GAAG,aAAa,EAAE,CAAC;AAChD,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;AAE3D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,gBAAgB,EAAE,SAAS;IAC3B,iBAAiB,EAAE,UAAU;IAC7B,kBAAkB,EAAE,UAAU;IAC9B,mBAAmB,EAAE,gBAAgB;IACrC,cAAc,EAAE,WAAW;IAC3B,cAAc,EAAE,aAAa;IAC7B,gBAAgB,EAAE,eAAe;CAClC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,gBAAgB,EAAE,SAAS;IAC3B,iBAAiB,EAAE,UAAU;IAC7B,kBAAkB,EAAE,UAAU;IAC9B,mBAAmB,EAAE,gBAAgB;IACrC,cAAc,EAAE,WAAW;IAC3B,cAAc,EAAE,aAAa;IAC7B,gBAAgB,EAAE,eAAe;IACjC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,uBAAuB,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 STAR_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\nexport const SVG_ATTRIBUTE_MAP = {\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-width': 'lineWidth',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity'\n};\n\nexport const SVG_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_ATTRIBUTE_MAP);\n\nexport const SVG_PARSE_ATTRIBUTE_MAP = {\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-width': 'lineWidth',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n stroke: 'stroke',\n fill: 'fill'\n};\n\nexport const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);\n"]}
|
|
@@ -7,6 +7,6 @@ import { GraphicCreator, GraphicService } from "../constants";
|
|
|
7
7
|
import { graphicCreator } from "../graphic-creator";
|
|
8
8
|
|
|
9
9
|
export default new ContainerModule((bind => {
|
|
10
|
-
bind(GraphicService).to(DefaultGraphicService)
|
|
10
|
+
bind(GraphicService).to(DefaultGraphicService), bind(GraphicCreator).toConstantValue(graphicCreator);
|
|
11
11
|
}));
|
|
12
12
|
//# sourceMappingURL=graphic-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/graphic-service/graphic-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,eAAe,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE;IACxC,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC
|
|
1
|
+
{"version":3,"sources":["../src/graphic/graphic-service/graphic-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,eAAe,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE;IACxC,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAE/C,IAAI,CAAC,cAAc,CAAC,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC","file":"graphic-module.js","sourcesContent":["import { ContainerModule } from '../../common/inversify-lite';\n// import { DefaultTheme } from './default-theme';\nimport { DefaultGraphicService } from './graphic-service';\nimport { GraphicCreator, GraphicService } from '../constants';\nimport { graphicCreator } from '../graphic-creator';\n// import { DefaultThemeService, Theme, ThemeServce } from './theme-service';\n\nexport default new ContainerModule(bind => {\n bind(GraphicService).to(DefaultGraphicService);\n\n bind(GraphicCreator).toConstantValue(graphicCreator);\n});\n"]}
|
package/es/graphic/graphic.d.ts
CHANGED
|
@@ -61,6 +61,10 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
61
61
|
glyphHost?: IGraphic<IGlyphGraphicAttribute>;
|
|
62
62
|
_onSetStage?: (g: IGraphic, stage: IStage, layer: ILayer) => void;
|
|
63
63
|
in3dMode?: boolean;
|
|
64
|
+
widthWithoutTransform?: number;
|
|
65
|
+
heightWithoutTransform?: number;
|
|
66
|
+
x1WithoutTransform?: number;
|
|
67
|
+
y1WithoutTransform?: number;
|
|
64
68
|
protected _AABBBounds: IAABBBounds;
|
|
65
69
|
get AABBBounds(): IAABBBounds;
|
|
66
70
|
protected _OBBBounds?: IOBBBounds;
|
|
@@ -117,6 +121,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
117
121
|
shouldUpdateShape(): boolean;
|
|
118
122
|
clearUpdateShapeTag(): void;
|
|
119
123
|
containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean;
|
|
124
|
+
protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds): void;
|
|
120
125
|
setAttributesAndPreventAnimate(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
121
126
|
setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
122
127
|
_setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
@@ -161,7 +166,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
161
166
|
protected needUpdateLayout(): boolean;
|
|
162
167
|
protected getAnchor(anchor: [string | number, string | number], params: {
|
|
163
168
|
b?: IAABBBounds;
|
|
164
|
-
}): [number, number];
|
|
169
|
+
}, resetScale?: boolean): [number, number];
|
|
165
170
|
protected doUpdateLocalMatrix(): void;
|
|
166
171
|
protected doUpdateGlobalMatrix(): void;
|
|
167
172
|
setStage(stage?: IStage, layer?: ILayer): void;
|
|
@@ -185,4 +190,5 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
185
190
|
protected _emitCustomEvent(type: string, context?: any): void;
|
|
186
191
|
abstract getNoWorkAnimateAttr(): Record<string, number>;
|
|
187
192
|
abstract clone(): IGraphic<any>;
|
|
193
|
+
toCustomPath(): ICustomPath2D;
|
|
188
194
|
}
|
package/es/graphic/graphic.js
CHANGED
|
@@ -30,6 +30,8 @@ import { SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS } from "./constan
|
|
|
30
30
|
|
|
31
31
|
import { DefaultStateAnimateConfig } from "../animate/config";
|
|
32
32
|
|
|
33
|
+
import { EmptyContext2d } from "../canvas";
|
|
34
|
+
|
|
33
35
|
const _tempBounds = new AABBBounds, tempMatrix = new Matrix, tempBounds = new AABBBounds;
|
|
34
36
|
|
|
35
37
|
export const PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ];
|
|
@@ -122,12 +124,13 @@ export class Graphic extends Node {
|
|
|
122
124
|
this._emitCustomEvent("animate-bind", animate);
|
|
123
125
|
}
|
|
124
126
|
tryUpdateAABBBounds() {
|
|
127
|
+
var _a, _b;
|
|
125
128
|
const full = "imprecise" === this.attribute.boundsMode;
|
|
126
129
|
if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
|
|
127
130
|
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
128
|
-
|
|
131
|
+
null === (_a = this.stage) || void 0 === _a || _a.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
129
132
|
const bounds = this.doUpdateAABBBounds(full);
|
|
130
|
-
return
|
|
133
|
+
return null === (_b = this.stage) || void 0 === _b || _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
|
|
131
134
|
"empty" === this.attribute.boundsMode && bounds.clear(), bounds;
|
|
132
135
|
}
|
|
133
136
|
tryUpdateOBBBounds() {
|
|
@@ -257,6 +260,9 @@ export class Graphic extends Node {
|
|
|
257
260
|
y: y
|
|
258
261
|
});
|
|
259
262
|
}
|
|
263
|
+
setWidthHeightWithoutTransform(aabbBounds) {
|
|
264
|
+
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
265
|
+
}
|
|
260
266
|
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
|
|
261
267
|
this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach((animate => {
|
|
262
268
|
Object.keys(params).forEach((key => {
|
|
@@ -403,7 +409,8 @@ export class Graphic extends Node {
|
|
|
403
409
|
return this;
|
|
404
410
|
}
|
|
405
411
|
onAttributeUpdate(context) {
|
|
406
|
-
|
|
412
|
+
var _a;
|
|
413
|
+
context && context.skipUpdateCallback || (null === (_a = this.stage) || void 0 === _a || _a.graphicService.onAttributeUpdate(this),
|
|
407
414
|
this._emitCustomEvent("afterAttributeUpdate", context));
|
|
408
415
|
}
|
|
409
416
|
update(d) {
|
|
@@ -425,7 +432,7 @@ export class Graphic extends Node {
|
|
|
425
432
|
keys.forEach((key => {
|
|
426
433
|
noWorkAttrs[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = isClear && void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
|
|
427
434
|
}));
|
|
428
|
-
const stateAnimateConfig = null !== (_b = null !== (_a = this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : DefaultStateAnimateConfig;
|
|
435
|
+
const stateAnimateConfig = null !== (_b = null !== (_a = this.context && this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : DefaultStateAnimateConfig;
|
|
429
436
|
this.applyAnimationState([ "state" ], [ {
|
|
430
437
|
name: "state",
|
|
431
438
|
animation: {
|
|
@@ -534,19 +541,12 @@ export class Graphic extends Node {
|
|
|
534
541
|
needUpdateLayout() {
|
|
535
542
|
return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
|
|
536
543
|
}
|
|
537
|
-
getAnchor(anchor, params) {
|
|
544
|
+
getAnchor(anchor, params, resetScale) {
|
|
538
545
|
const _anchor = [ 0, 0 ], getBounds = () => {
|
|
539
546
|
if (params.b) return params.b;
|
|
540
|
-
const
|
|
541
|
-
return
|
|
542
|
-
|
|
543
|
-
scaleY: 1,
|
|
544
|
-
angle: 0
|
|
545
|
-
}), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
|
|
546
|
-
scaleX: scaleX,
|
|
547
|
-
scaleY: scaleY,
|
|
548
|
-
angle: angle
|
|
549
|
-
}), params.b;
|
|
547
|
+
const graphic = this.clone();
|
|
548
|
+
return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1,
|
|
549
|
+
graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
|
|
550
550
|
};
|
|
551
551
|
if ("string" == typeof anchor[0]) {
|
|
552
552
|
const ratio = parseFloat(anchor[0]) / 100, bounds = getBounds();
|
|
@@ -562,10 +562,10 @@ export class Graphic extends Node {
|
|
|
562
562
|
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;
|
|
563
563
|
let _anchor = [ 0, 0 ];
|
|
564
564
|
const params = {};
|
|
565
|
-
if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
|
|
565
|
+
if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
|
|
566
566
|
const m = this._transMatrix;
|
|
567
567
|
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]),
|
|
568
|
-
m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
568
|
+
m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
569
569
|
x: _anchor[0],
|
|
570
570
|
y: _anchor[1]
|
|
571
571
|
});
|
|
@@ -584,6 +584,7 @@ export class Graphic extends Node {
|
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
setStage(stage, layer) {
|
|
587
|
+
var _a;
|
|
587
588
|
if (this.stage !== stage) {
|
|
588
589
|
if (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
|
|
589
590
|
this.animates && this.animates.size) {
|
|
@@ -592,7 +593,7 @@ export class Graphic extends Node {
|
|
|
592
593
|
a.timeline.isGlobal && (a.setTimeline(timeline), timeline.addAnimate(a));
|
|
593
594
|
}));
|
|
594
595
|
}
|
|
595
|
-
this._onSetStage && this._onSetStage(this, stage, layer),
|
|
596
|
+
this._onSetStage && this._onSetStage(this, stage, layer), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onSetStage(this, stage);
|
|
596
597
|
}
|
|
597
598
|
}
|
|
598
599
|
setStageToShadowRoot(stage, layer) {
|
|
@@ -685,6 +686,15 @@ export class Graphic extends Node {
|
|
|
685
686
|
this.dispatchEvent(changeEvent);
|
|
686
687
|
}
|
|
687
688
|
}
|
|
689
|
+
toCustomPath() {
|
|
690
|
+
var _a, _b, _c;
|
|
691
|
+
const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) || application.renderService) || void 0 === _b ? void 0 : _b.drawContribution) || void 0 === _c ? void 0 : _c.getRenderContribution(this);
|
|
692
|
+
if (renderer) {
|
|
693
|
+
const context = new EmptyContext2d(null, 1);
|
|
694
|
+
return renderer.drawShape(this, context, 0, 0, {}, {}), context.path;
|
|
695
|
+
}
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
688
698
|
}
|
|
689
699
|
|
|
690
700
|
function backgroundNotImage(image) {
|