@visactor/vrender-components 0.16.9-alpha.1 → 0.16.10-alpha.0
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/axis/overlap/auto-hide.js +9 -8
- package/cjs/axis/overlap/auto-hide.js.map +1 -1
- package/cjs/axis/overlap/auto-limit.js.map +1 -1
- package/cjs/axis/overlap/auto-rotate.js +3 -35
- package/cjs/axis/overlap/auto-rotate.js.map +1 -1
- package/cjs/axis/overlap/util.d.ts +3 -0
- package/cjs/axis/overlap/util.js +44 -0
- package/cjs/axis/overlap/util.js.map +1 -0
- package/cjs/core/base.js +4 -3
- package/cjs/core/base.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/rect.js +27 -1
- package/cjs/label/rect.js.map +1 -1
- package/cjs/label/type.d.ts +1 -1
- package/cjs/label/type.js.map +1 -1
- package/cjs/marker/base.js +9 -6
- package/cjs/marker/base.js.map +1 -1
- package/cjs/marker/line.js +2 -1
- package/cjs/marker/line.js.map +1 -1
- package/cjs/marker/point.js +2 -1
- package/cjs/marker/point.js.map +1 -1
- package/dist/index.js +105 -57
- package/dist/index.min.js +1 -1
- package/es/axis/overlap/auto-hide.js +9 -7
- package/es/axis/overlap/auto-hide.js.map +1 -1
- package/es/axis/overlap/auto-limit.js.map +1 -1
- package/es/axis/overlap/auto-rotate.js +3 -33
- package/es/axis/overlap/auto-rotate.js.map +1 -1
- package/es/axis/overlap/util.d.ts +3 -0
- package/es/axis/overlap/util.js +35 -0
- package/es/axis/overlap/util.js.map +1 -0
- package/es/core/base.js +1 -1
- package/es/core/base.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/label/rect.js +27 -1
- package/es/label/rect.js.map +1 -1
- package/es/label/type.d.ts +1 -1
- package/es/label/type.js.map +1 -1
- package/es/marker/base.js +9 -6
- package/es/marker/base.js.map +1 -1
- package/es/marker/line.js +2 -1
- package/es/marker/line.js.map +1 -1
- package/es/marker/point.js +2 -1
- package/es/marker/point.js.map +1 -1
- package/package.json +6 -6
package/cjs/marker/point.js
CHANGED
|
@@ -103,7 +103,8 @@ class MarkPoint extends base_1.Marker {
|
|
|
103
103
|
x: position.x + ((null == itemContent ? void 0 : itemContent.offsetX) || 0),
|
|
104
104
|
y: position.y + ((null == itemContent ? void 0 : itemContent.offsetY) || 0)
|
|
105
105
|
}, line = new segment_1.Segment({
|
|
106
|
-
points: []
|
|
106
|
+
points: [],
|
|
107
|
+
pickable: !1
|
|
107
108
|
});
|
|
108
109
|
line.name = "mark-point-line", this._line = line, container.add(line);
|
|
109
110
|
const decorativeLine = (0, vrender_core_1.createLine)({
|
package/cjs/marker/point.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/point.ts"],"names":[],"mappings":";;;AAYA,yDAA+F;AAG/F,6CAAyC;AACzC,wCAAqC;AACrC,gCAA6B;AAC7B,iCAAgC;AAChC,qCAAuF;AAGvF,iCAAgD;AAGhD,MAAa,SAAU,SAAQ,aAAsB;IASnD,YAAY,UAA0B;QACpC,KAAK,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,SAAS,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC5D,CAAC;IAES,WAAW;IAErB,CAAC;IAES,iBAAiB,CACzB,IAAwC,EACxC,WAAyB,EACzB,YAAmB,EACnB,QAA6D;;QAE7D,IAAI,CAAC,IAAI,EAAE;YACT,OAAO;SACR;QACD,MAAM,EACJ,UAAU,GAAG,IAAI,EACjB,IAAI,GAAG,CAAC,EACR,IAAI,GAAG,CAAC,EACR,QAAQ,GAAG,CAAC,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,GAAG,6BAAsB,CAAC,MAAM,EACzC,GAAG,WAAW,CAAC;QAChB,MAAM,SAAS,GAAG,CAAA,MAAA,IAA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AC;QAC7D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,SAAS,CAAC,GAAG,CAAC,IAAwB,CAAC,CAAC;IAC1C,CAAC;IAES,YAAY;;QACpB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,SAA2B,CAAC;QAC7E,MAAM,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,WAAW,CAAC;QACtC,MAAM,YAAY,GAAG;YACnB,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,KAAI,CAAC,CAAC;YAC3C,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,KAAI,CAAC,CAAC;SAC5C,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,CAAC,CAAC;QAC1E,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,cAAc,0CAAE,OAAO,CAAC,CAAC;QACtF,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;;AAlQH,8BAmQC;AAlQQ,2BAAiB,GAAG,iCAAwB,CAAC","file":"point.js","sourcesContent":["import type {\n IGroup,\n IImage,\n INode,\n ISymbol,\n IImageGraphicAttribute,\n IRichText,\n IRichTextGraphicAttribute,\n ILine,\n ILineGraphicAttribute\n} from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { createRichText, createSymbol, createImage, createLine } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { merge } from '@visactor/vutils';\nimport { Segment } from '../segment';\nimport { Tag } from '../tag';\nimport { Marker } from './base';\nimport { DEFAULT_MARK_POINT_TEXT_STYLE_MAP, DEFAULT_MARK_POINT_THEME } from './config';\nimport type { IItemContent, IItemLine, MarkPointAttrs } from './type';\n// eslint-disable-next-line no-duplicate-imports\nimport { IMarkPointItemPosition } from './type';\nimport type { Point } from '../core/type';\n\nexport class MarkPoint extends Marker<MarkPointAttrs> {\n static defaultAttributes = DEFAULT_MARK_POINT_THEME;\n\n private _item!: ISymbol | Tag | IImage | IRichText;\n\n private _line?: Segment;\n\n private _decorativeLine!: ILine;\n\n constructor(attributes: MarkPointAttrs) {\n super(merge({}, MarkPoint.defaultAttributes, attributes));\n }\n\n protected setLabelPos() {\n //do nothing\n }\n\n protected setItemAttributes(\n item: ISymbol | Tag | IImage | IRichText,\n itemContent: IItemContent,\n itemPosition: Point,\n itemType: 'symbol' | 'text' | 'image' | 'richText' | 'custom'\n ) {\n if (!item) {\n return;\n }\n const {\n autoRotate = true,\n refX = 0,\n refY = 0,\n refAngle = 0,\n textStyle,\n richTextStyle,\n imageStyle,\n position = IMarkPointItemPosition.middle\n } = itemContent;\n const itemAngle = this._line?.getEndAngle() || 0;\n const itemOffsetX = refX * Math.cos(itemAngle) + refY * Math.cos(itemAngle - Math.PI / 2);\n const itemOffsetY = refX * Math.sin(itemAngle) + refY * Math.sin(itemAngle - Math.PI / 2);\n if (itemType === 'text') {\n item.setAttributes({\n ...textStyle,\n textStyle: {\n ...DEFAULT_MARK_POINT_TEXT_STYLE_MAP[itemContent?.position || 'end'],\n ...textStyle?.textStyle\n }\n });\n } else if (itemType === 'richText') {\n item.setAttributes({\n dx: this.getItemDx(item, position, richTextStyle) + (richTextStyle?.dx || 0),\n dy: this.getItemDy(item, position, richTextStyle) + (richTextStyle?.dy || 0)\n });\n } else if (itemType === 'image') {\n item.setAttributes({\n dx: this.getItemDx(item, position, imageStyle) + (imageStyle?.dx || 0),\n dy: this.getItemDy(item, position, imageStyle) + (imageStyle?.dy || 0)\n });\n }\n item.setAttributes({\n x: itemPosition.x + (itemOffsetX || 0),\n y: itemPosition.y + (itemOffsetY || 0),\n angle: autoRotate && itemAngle + refAngle\n });\n\n // if (this.attribute.limitRect && this.attribute.itemContent?.confine) {\n // const { x, y, width, height } = this.attribute.limitRect;\n // limitShapeInBounds(item, {\n // x1: x,\n // y1: y,\n // x2: x + width,\n // y2: y + height\n // });\n // }\n }\n\n protected getItemDx(\n item: ISymbol | Tag | IImage | IRichText,\n position: keyof typeof IMarkPointItemPosition,\n style?: IImageGraphicAttribute | IRichTextGraphicAttribute\n ) {\n const width = (item as IGroup)?.AABBBounds?.width() ?? (style?.width || 0);\n if (position.includes('inside')) {\n return -width;\n }\n if (position === 'insideTop') {\n return 0;\n }\n return 0;\n }\n\n protected getItemDy(\n item: ISymbol | Tag | IImage | IRichText,\n position: keyof typeof IMarkPointItemPosition,\n style?: IImageGraphicAttribute | IRichTextGraphicAttribute\n ) {\n const height = (item as IGroup)?.AABBBounds?.height() ?? (style?.height || 0);\n if (position.includes('top') || position.includes('Top')) {\n return -height;\n }\n if (position.includes('middle') || position.includes('Middle')) {\n return -height / 2;\n }\n return 0;\n }\n\n protected initItem(itemContent: IItemContent, itemPosition: Point) {\n const { type = 'text', symbolStyle, richTextStyle, imageStyle, renderCustomCallback } = itemContent;\n let item: ISymbol | Tag | IImage | IRichText | IGroup;\n if (type === 'symbol') {\n item = createSymbol({\n ...itemPosition,\n ...symbolStyle\n });\n } else if (type === 'text') {\n item = new Tag({\n ...itemPosition\n });\n } else if (type === 'richText') {\n item = createRichText({\n ...itemPosition,\n ...richTextStyle\n });\n } else if (type === 'image') {\n item = createImage({\n ...itemPosition,\n ...imageStyle\n });\n } else if (type === 'custom' && renderCustomCallback) {\n item = renderCustomCallback();\n }\n this.setItemAttributes(item, itemContent, itemPosition, type);\n return item;\n }\n\n protected getItemLineAttr(itemLine: IItemLine, position: Point, itemPosition: Point) {\n let points: Point[] = [];\n const { type = 'type-s' } = itemLine;\n if (type === 'type-do') {\n points = [\n position,\n {\n x: (position.x + itemPosition.x) / 2,\n y: itemPosition.y\n },\n itemPosition\n ];\n } else if (type === 'type-po') {\n points = [\n position,\n {\n x: itemPosition.x,\n y: position.y\n },\n itemPosition\n ];\n } else if (type === 'type-op') {\n points = [\n position,\n {\n x: position.x,\n y: itemPosition.y\n },\n itemPosition\n ];\n } else {\n points = [position, itemPosition];\n }\n return points;\n }\n\n protected setItemLineAttr(itemLine: IItemLine, position: Point, itemPosition: Point, visible: boolean) {\n const { startSymbol, endSymbol, lineStyle } = itemLine;\n const points = this.getItemLineAttr(itemLine, position, itemPosition);\n this._line?.setAttributes({\n points,\n startSymbol,\n endSymbol,\n lineStyle,\n visible\n });\n }\n\n protected getDecorativeLineAttr(itemLine: IItemLine, itemPosition: Point) {\n const decorativeLength = itemLine?.decorativeLine?.length || 10;\n const itemAngle = this._line.getEndAngle() || 0;\n const startPointOffsetX = (decorativeLength / 2) * Math.cos(itemAngle - Math.PI / 2);\n const startPointOffsetY = (decorativeLength / 2) * Math.sin(itemAngle - Math.PI / 2);\n const endPointOffsetX = (-decorativeLength / 2) * Math.cos(itemAngle - Math.PI / 2);\n const endPointOffsetY = (-decorativeLength / 2) * Math.sin(itemAngle - Math.PI / 2);\n return {\n startPointOffsetX,\n startPointOffsetY,\n endPointOffsetX,\n endPointOffsetY\n };\n }\n\n protected setDecorativeLineAttr(itemLine: IItemLine, itemPosition: Point, visible: boolean) {\n const { lineStyle } = itemLine;\n const { startPointOffsetX, startPointOffsetY, endPointOffsetX, endPointOffsetY } = this.getDecorativeLineAttr(\n itemLine,\n itemPosition\n );\n this._decorativeLine?.setAttributes({\n points: [\n {\n x: itemPosition.x + startPointOffsetX,\n y: itemPosition.y + startPointOffsetY\n },\n {\n x: itemPosition.x + endPointOffsetX,\n y: itemPosition.y + endPointOffsetY\n }\n ] as IPointLike[],\n ...(lineStyle as Partial<ILineGraphicAttribute>),\n visible\n });\n }\n\n protected initMarker(container: IGroup) {\n const { position, itemLine, itemContent } = this.attribute as MarkPointAttrs;\n const itemPosition = {\n x: position.x + (itemContent?.offsetX || 0),\n y: position.y + (itemContent?.offsetY || 0)\n };\n\n const line = new Segment({\n points: []\n });\n line.name = 'mark-point-line';\n this._line = line;\n container.add(line as unknown as INode);\n\n const decorativeLine = createLine({\n points: []\n });\n decorativeLine.name = 'mark-point-decorativeLine';\n this._decorativeLine = decorativeLine;\n container.add(decorativeLine as unknown as INode);\n\n this.setItemLineAttr(itemLine, position, itemPosition, itemLine?.visible);\n this.setDecorativeLineAttr(itemLine, itemPosition, itemLine?.decorativeLine?.visible);\n\n const item = this.initItem(itemContent as any, itemPosition);\n this._item = item;\n container.add(item as unknown as INode);\n }\n\n protected updateMarker() {\n const { position, itemLine, itemContent } = this.attribute as MarkPointAttrs;\n const { type = 'text' } = itemContent;\n const itemPosition = {\n x: position.x + (itemContent?.offsetX || 0),\n y: position.y + (itemContent?.offsetY || 0)\n };\n this.setItemLineAttr(itemLine, position, itemPosition, itemLine?.visible);\n this.setDecorativeLineAttr(itemLine, itemPosition, itemLine?.decorativeLine?.visible);\n this.setItemAttributes(this._item, itemContent, itemPosition, type);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/marker/point.ts"],"names":[],"mappings":";;;AAYA,yDAA+F;AAG/F,6CAAyC;AACzC,wCAAqC;AACrC,gCAA6B;AAC7B,iCAAgC;AAChC,qCAAuF;AAGvF,iCAAgD;AAGhD,MAAa,SAAU,SAAQ,aAAsB;IASnD,YAAY,UAA0B;QACpC,KAAK,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,SAAS,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC5D,CAAC;IAES,WAAW;IAErB,CAAC;IAES,iBAAiB,CACzB,IAAwC,EACxC,WAAyB,EACzB,YAAmB,EACnB,QAA6D;;QAE7D,IAAI,CAAC,IAAI,EAAE;YACT,OAAO;SACR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,CAAC","file":"point.js","sourcesContent":["import type {\n IGroup,\n IImage,\n INode,\n ISymbol,\n IImageGraphicAttribute,\n IRichText,\n IRichTextGraphicAttribute,\n ILine,\n ILineGraphicAttribute\n} from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { createRichText, createSymbol, createImage, createLine } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { merge } from '@visactor/vutils';\nimport { Segment } from '../segment';\nimport { Tag } from '../tag';\nimport { Marker } from './base';\nimport { DEFAULT_MARK_POINT_TEXT_STYLE_MAP, DEFAULT_MARK_POINT_THEME } from './config';\nimport type { IItemContent, IItemLine, MarkPointAttrs } from './type';\n// eslint-disable-next-line no-duplicate-imports\nimport { IMarkPointItemPosition } from './type';\nimport type { Point } from '../core/type';\n\nexport class MarkPoint extends Marker<MarkPointAttrs> {\n static defaultAttributes = DEFAULT_MARK_POINT_THEME;\n\n private _item!: ISymbol | Tag | IImage | IRichText;\n\n private _line?: Segment;\n\n private _decorativeLine!: ILine;\n\n constructor(attributes: MarkPointAttrs) {\n super(merge({}, MarkPoint.defaultAttributes, attributes));\n }\n\n protected setLabelPos() {\n //do nothing\n }\n\n protected setItemAttributes(\n item: ISymbol | Tag | IImage | IRichText,\n itemContent: IItemContent,\n itemPosition: Point,\n itemType: 'symbol' | 'text' | 'image' | 'richText' | 'custom'\n ) {\n if (!item) {\n return;\n }\n const {\n autoRotate = true,\n refX = 0,\n refY = 0,\n refAngle = 0,\n textStyle,\n richTextStyle,\n imageStyle,\n position = IMarkPointItemPosition.middle\n } = itemContent;\n const itemAngle = this._line?.getEndAngle() || 0;\n const itemOffsetX = refX * Math.cos(itemAngle) + refY * Math.cos(itemAngle - Math.PI / 2);\n const itemOffsetY = refX * Math.sin(itemAngle) + refY * Math.sin(itemAngle - Math.PI / 2);\n if (itemType === 'text') {\n item.setAttributes({\n ...textStyle,\n textStyle: {\n ...DEFAULT_MARK_POINT_TEXT_STYLE_MAP[itemContent?.position || 'end'],\n ...textStyle?.textStyle\n }\n });\n } else if (itemType === 'richText') {\n item.setAttributes({\n dx: this.getItemDx(item, position, richTextStyle) + (richTextStyle?.dx || 0),\n dy: this.getItemDy(item, position, richTextStyle) + (richTextStyle?.dy || 0)\n });\n } else if (itemType === 'image') {\n item.setAttributes({\n dx: this.getItemDx(item, position, imageStyle) + (imageStyle?.dx || 0),\n dy: this.getItemDy(item, position, imageStyle) + (imageStyle?.dy || 0)\n });\n }\n item.setAttributes({\n x: itemPosition.x + (itemOffsetX || 0),\n y: itemPosition.y + (itemOffsetY || 0),\n angle: autoRotate && itemAngle + refAngle\n });\n\n // if (this.attribute.limitRect && this.attribute.itemContent?.confine) {\n // const { x, y, width, height } = this.attribute.limitRect;\n // limitShapeInBounds(item, {\n // x1: x,\n // y1: y,\n // x2: x + width,\n // y2: y + height\n // });\n // }\n }\n\n protected getItemDx(\n item: ISymbol | Tag | IImage | IRichText,\n position: keyof typeof IMarkPointItemPosition,\n style?: IImageGraphicAttribute | IRichTextGraphicAttribute\n ) {\n const width = (item as IGroup)?.AABBBounds?.width() ?? (style?.width || 0);\n if (position.includes('inside')) {\n return -width;\n }\n if (position === 'insideTop') {\n return 0;\n }\n return 0;\n }\n\n protected getItemDy(\n item: ISymbol | Tag | IImage | IRichText,\n position: keyof typeof IMarkPointItemPosition,\n style?: IImageGraphicAttribute | IRichTextGraphicAttribute\n ) {\n const height = (item as IGroup)?.AABBBounds?.height() ?? (style?.height || 0);\n if (position.includes('top') || position.includes('Top')) {\n return -height;\n }\n if (position.includes('middle') || position.includes('Middle')) {\n return -height / 2;\n }\n return 0;\n }\n\n protected initItem(itemContent: IItemContent, itemPosition: Point) {\n const { type = 'text', symbolStyle, richTextStyle, imageStyle, renderCustomCallback } = itemContent;\n let item: ISymbol | Tag | IImage | IRichText | IGroup;\n if (type === 'symbol') {\n item = createSymbol({\n ...itemPosition,\n ...symbolStyle\n });\n } else if (type === 'text') {\n item = new Tag({\n ...itemPosition\n });\n } else if (type === 'richText') {\n item = createRichText({\n ...itemPosition,\n ...richTextStyle\n });\n } else if (type === 'image') {\n item = createImage({\n ...itemPosition,\n ...imageStyle\n });\n } else if (type === 'custom' && renderCustomCallback) {\n item = renderCustomCallback();\n }\n this.setItemAttributes(item, itemContent, itemPosition, type);\n return item;\n }\n\n protected getItemLineAttr(itemLine: IItemLine, position: Point, itemPosition: Point) {\n let points: Point[] = [];\n const { type = 'type-s' } = itemLine;\n if (type === 'type-do') {\n points = [\n position,\n {\n x: (position.x + itemPosition.x) / 2,\n y: itemPosition.y\n },\n itemPosition\n ];\n } else if (type === 'type-po') {\n points = [\n position,\n {\n x: itemPosition.x,\n y: position.y\n },\n itemPosition\n ];\n } else if (type === 'type-op') {\n points = [\n position,\n {\n x: position.x,\n y: itemPosition.y\n },\n itemPosition\n ];\n } else {\n points = [position, itemPosition];\n }\n return points;\n }\n\n protected setItemLineAttr(itemLine: IItemLine, position: Point, itemPosition: Point, visible: boolean) {\n const { startSymbol, endSymbol, lineStyle } = itemLine;\n const points = this.getItemLineAttr(itemLine, position, itemPosition);\n this._line?.setAttributes({\n points,\n startSymbol,\n endSymbol,\n lineStyle,\n visible\n });\n }\n\n protected getDecorativeLineAttr(itemLine: IItemLine, itemPosition: Point) {\n const decorativeLength = itemLine?.decorativeLine?.length || 10;\n const itemAngle = this._line.getEndAngle() || 0;\n const startPointOffsetX = (decorativeLength / 2) * Math.cos(itemAngle - Math.PI / 2);\n const startPointOffsetY = (decorativeLength / 2) * Math.sin(itemAngle - Math.PI / 2);\n const endPointOffsetX = (-decorativeLength / 2) * Math.cos(itemAngle - Math.PI / 2);\n const endPointOffsetY = (-decorativeLength / 2) * Math.sin(itemAngle - Math.PI / 2);\n return {\n startPointOffsetX,\n startPointOffsetY,\n endPointOffsetX,\n endPointOffsetY\n };\n }\n\n protected setDecorativeLineAttr(itemLine: IItemLine, itemPosition: Point, visible: boolean) {\n const { lineStyle } = itemLine;\n const { startPointOffsetX, startPointOffsetY, endPointOffsetX, endPointOffsetY } = this.getDecorativeLineAttr(\n itemLine,\n itemPosition\n );\n this._decorativeLine?.setAttributes({\n points: [\n {\n x: itemPosition.x + startPointOffsetX,\n y: itemPosition.y + startPointOffsetY\n },\n {\n x: itemPosition.x + endPointOffsetX,\n y: itemPosition.y + endPointOffsetY\n }\n ] as IPointLike[],\n ...(lineStyle as Partial<ILineGraphicAttribute>),\n visible\n });\n }\n\n protected initMarker(container: IGroup) {\n const { position, itemLine, itemContent } = this.attribute as MarkPointAttrs;\n const itemPosition = {\n x: position.x + (itemContent?.offsetX || 0),\n y: position.y + (itemContent?.offsetY || 0)\n };\n\n const line = new Segment({\n points: [],\n pickable: false // 组件容器本身不参与拾取\n });\n line.name = 'mark-point-line';\n this._line = line;\n container.add(line as unknown as INode);\n\n const decorativeLine = createLine({\n points: []\n });\n decorativeLine.name = 'mark-point-decorativeLine';\n this._decorativeLine = decorativeLine;\n container.add(decorativeLine as unknown as INode);\n\n this.setItemLineAttr(itemLine, position, itemPosition, itemLine?.visible);\n this.setDecorativeLineAttr(itemLine, itemPosition, itemLine?.decorativeLine?.visible);\n\n const item = this.initItem(itemContent as any, itemPosition);\n this._item = item;\n container.add(item as unknown as INode);\n }\n\n protected updateMarker() {\n const { position, itemLine, itemContent } = this.attribute as MarkPointAttrs;\n const { type = 'text' } = itemContent;\n const itemPosition = {\n x: position.x + (itemContent?.offsetX || 0),\n y: position.y + (itemContent?.offsetY || 0)\n };\n this.setItemLineAttr(itemLine, position, itemPosition, itemLine?.visible);\n this.setDecorativeLineAttr(itemLine, itemPosition, itemLine?.decorativeLine?.visible);\n this.setItemAttributes(this._item, itemContent, itemPosition, type);\n }\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -7658,9 +7658,7 @@
|
|
|
7658
7658
|
var data = ResourceLoader.cache.get(url);
|
|
7659
7659
|
data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(function () {
|
|
7660
7660
|
mark.imageLoadFail(url);
|
|
7661
|
-
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark &&
|
|
7662
|
-
mark.imageLoadSuccess(url, data.data);
|
|
7663
|
-
}) : (data = {
|
|
7661
|
+
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (data = {
|
|
7664
7662
|
type: "image",
|
|
7665
7663
|
loadState: "init"
|
|
7666
7664
|
}, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(function (res) {
|
|
@@ -8492,7 +8490,7 @@
|
|
|
8492
8490
|
data: "init",
|
|
8493
8491
|
state: null
|
|
8494
8492
|
};
|
|
8495
|
-
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading",
|
|
8493
|
+
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (vutils.isValidUrl(image) || image.includes("/") || vutils.isBase64(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
|
|
8496
8494
|
}
|
|
8497
8495
|
}, {
|
|
8498
8496
|
key: "imageLoadSuccess",
|
|
@@ -17831,6 +17829,7 @@
|
|
|
17831
17829
|
}, {
|
|
17832
17830
|
key: "clearScreen",
|
|
17833
17831
|
value: function clearScreen(renderService, context, drawContext) {
|
|
17832
|
+
var _a;
|
|
17834
17833
|
var clear = drawContext.clear;
|
|
17835
17834
|
if (clear) {
|
|
17836
17835
|
var canvas = context.getCanvas(),
|
|
@@ -17840,7 +17839,12 @@
|
|
|
17840
17839
|
height = _drawContext$height === void 0 ? canvas.height : _drawContext$height,
|
|
17841
17840
|
x = 0,
|
|
17842
17841
|
y = 0;
|
|
17843
|
-
context.clearRect(x, y, width, height)
|
|
17842
|
+
context.clearRect(x, y, width, height);
|
|
17843
|
+
var stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
|
|
17844
|
+
if (stage && stage.backgroundImg && stage.resources) {
|
|
17845
|
+
var res = stage.resources.get(clear);
|
|
17846
|
+
res && "success" === res.state && res.data && context.drawImage(res.data, x, y, width, height);
|
|
17847
|
+
} else context.fillStyle = createColor(context, clear, {
|
|
17844
17848
|
AABBBounds: {
|
|
17845
17849
|
x1: x,
|
|
17846
17850
|
y1: y,
|
|
@@ -20037,7 +20041,10 @@
|
|
|
20037
20041
|
});
|
|
20038
20042
|
}
|
|
20039
20043
|
setAttribute(key, value, forceUpdateTag) {
|
|
20040
|
-
if (vutils.isPlainObject(this.attribute[key]) &&
|
|
20044
|
+
if (vutils.isPlainObject(this.attribute[key]) &&
|
|
20045
|
+
vutils.isPlainObject(value) &&
|
|
20046
|
+
!vutils.isFunction(this.attribute[key]) &&
|
|
20047
|
+
!vutils.isFunction(value)) {
|
|
20041
20048
|
vutils.merge(this.attribute[key], value);
|
|
20042
20049
|
}
|
|
20043
20050
|
else {
|
|
@@ -22679,6 +22686,21 @@
|
|
|
22679
22686
|
case 'inside-right':
|
|
22680
22687
|
sx = 0.5;
|
|
22681
22688
|
break;
|
|
22689
|
+
case 'top-right':
|
|
22690
|
+
sx = 0.5;
|
|
22691
|
+
sy = -0.5;
|
|
22692
|
+
break;
|
|
22693
|
+
case 'top-left':
|
|
22694
|
+
sx = -0.5;
|
|
22695
|
+
sy = -0.5;
|
|
22696
|
+
break;
|
|
22697
|
+
case 'bottom-right':
|
|
22698
|
+
sx = 0.5;
|
|
22699
|
+
sy = 0.5;
|
|
22700
|
+
break;
|
|
22701
|
+
case 'bottom-left':
|
|
22702
|
+
sx = -0.5;
|
|
22703
|
+
sy = 0.5;
|
|
22682
22704
|
}
|
|
22683
22705
|
anchorX += sx * rectWidth;
|
|
22684
22706
|
anchorY += sy * rectHeight;
|
|
@@ -22697,6 +22719,16 @@
|
|
|
22697
22719
|
else if (position.includes('right')) {
|
|
22698
22720
|
vx = isInside ? -1 : 1;
|
|
22699
22721
|
}
|
|
22722
|
+
switch (position) {
|
|
22723
|
+
case 'top-right':
|
|
22724
|
+
case 'bottom-right':
|
|
22725
|
+
vx = -1;
|
|
22726
|
+
break;
|
|
22727
|
+
case 'top-left':
|
|
22728
|
+
case 'bottom-left':
|
|
22729
|
+
vx = 1;
|
|
22730
|
+
break;
|
|
22731
|
+
}
|
|
22700
22732
|
const x = anchorX + vx * offset + (vx * width) / 2;
|
|
22701
22733
|
const y = anchorY + vy * offset + (vy * height) / 2;
|
|
22702
22734
|
return { x, y };
|
|
@@ -24288,6 +24320,49 @@
|
|
|
24288
24320
|
}
|
|
24289
24321
|
}
|
|
24290
24322
|
|
|
24323
|
+
function rotate(x, y, deg, originX, originY) {
|
|
24324
|
+
return {
|
|
24325
|
+
x: (x - originX) * Math.cos(deg) + (y - originY) * Math.sin(deg) + originX,
|
|
24326
|
+
y: (x - originX) * Math.sin(deg) + (originY - y) * Math.cos(deg) + originY
|
|
24327
|
+
};
|
|
24328
|
+
}
|
|
24329
|
+
function genNormalBounds(item) {
|
|
24330
|
+
const bounds = item.AABBBounds;
|
|
24331
|
+
return {
|
|
24332
|
+
x1: bounds.x1,
|
|
24333
|
+
x2: bounds.x2,
|
|
24334
|
+
y1: bounds.y1,
|
|
24335
|
+
y2: bounds.y2,
|
|
24336
|
+
centerX: item.attribute.x,
|
|
24337
|
+
centerY: item.attribute.y,
|
|
24338
|
+
angle: item.attribute.angle
|
|
24339
|
+
};
|
|
24340
|
+
}
|
|
24341
|
+
function genRotateBounds(items) {
|
|
24342
|
+
items.forEach(item => {
|
|
24343
|
+
if (item.rotatedBounds || !item.attribute.angle) {
|
|
24344
|
+
return;
|
|
24345
|
+
}
|
|
24346
|
+
const bounds = genNormalBounds(item);
|
|
24347
|
+
const rotatedCenter = rotate(bounds.centerX, bounds.centerY, bounds.angle, item.attribute.x, item.attribute.y);
|
|
24348
|
+
const deltaX = rotatedCenter.x - bounds.centerX;
|
|
24349
|
+
const deltaY = rotatedCenter.y - bounds.centerY;
|
|
24350
|
+
bounds.x1 += deltaX;
|
|
24351
|
+
bounds.x2 += deltaX;
|
|
24352
|
+
bounds.y1 += deltaY;
|
|
24353
|
+
bounds.y2 += deltaY;
|
|
24354
|
+
bounds.centerX += deltaX;
|
|
24355
|
+
bounds.centerY += deltaY;
|
|
24356
|
+
item.rotatedBounds = bounds;
|
|
24357
|
+
});
|
|
24358
|
+
}
|
|
24359
|
+
function itemIntersect(item1, item2) {
|
|
24360
|
+
return (vutils.isRectIntersect(item1.AABBBounds, item2.AABBBounds, false) &&
|
|
24361
|
+
(item1.rotatedBounds && item2.rotatedBounds
|
|
24362
|
+
? vutils.isRotateAABBIntersect(item1.rotatedBounds, item2.rotatedBounds, true)
|
|
24363
|
+
: true));
|
|
24364
|
+
}
|
|
24365
|
+
|
|
24291
24366
|
const methods = {
|
|
24292
24367
|
parity: function (items) {
|
|
24293
24368
|
return items.filter((item, i) => (i % 2 ? item.setAttribute('opacity', 0) : 1));
|
|
@@ -24295,7 +24370,7 @@
|
|
|
24295
24370
|
greedy: function (items, sep) {
|
|
24296
24371
|
let a;
|
|
24297
24372
|
return items.filter((b, i) => {
|
|
24298
|
-
if (!i || !intersect(a
|
|
24373
|
+
if (!i || !intersect(a, b, sep)) {
|
|
24299
24374
|
a = b;
|
|
24300
24375
|
return 1;
|
|
24301
24376
|
}
|
|
@@ -24303,12 +24378,18 @@
|
|
|
24303
24378
|
});
|
|
24304
24379
|
}
|
|
24305
24380
|
};
|
|
24306
|
-
function intersect(
|
|
24307
|
-
|
|
24381
|
+
function intersect(textA, textB, sep) {
|
|
24382
|
+
const a = textA.AABBBounds;
|
|
24383
|
+
const b = textB.AABBBounds;
|
|
24384
|
+
return (sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2) &&
|
|
24385
|
+
(textA.rotatedBounds && textB.rotatedBounds
|
|
24386
|
+
? sep >
|
|
24387
|
+
Math.max(textB.rotatedBounds.x1 - textA.rotatedBounds.x2, textA.rotatedBounds.x1 - textB.rotatedBounds.x2, textB.rotatedBounds.y1 - textA.rotatedBounds.y2, textA.rotatedBounds.y1 - textB.rotatedBounds.y2)
|
|
24388
|
+
: true));
|
|
24308
24389
|
}
|
|
24309
24390
|
function hasOverlap(items, pad) {
|
|
24310
|
-
for (let i = 1, n = items.length, a = items[0]
|
|
24311
|
-
if (intersect(a, (b = items[i]
|
|
24391
|
+
for (let i = 1, n = items.length, a = items[0], b; i < n; a = b, ++i) {
|
|
24392
|
+
if (intersect(a, (b = items[i]), pad)) {
|
|
24312
24393
|
return true;
|
|
24313
24394
|
}
|
|
24314
24395
|
}
|
|
@@ -24331,6 +24412,7 @@
|
|
|
24331
24412
|
}
|
|
24332
24413
|
let items;
|
|
24333
24414
|
items = reset(source);
|
|
24415
|
+
genRotateBounds(items);
|
|
24334
24416
|
const { method = 'parity', separation: sep = 0 } = config;
|
|
24335
24417
|
const reduce = vutils.isFunction(method) ? method : methods[method] || methods.parity;
|
|
24336
24418
|
if (items.length >= 3 && hasOverlap(items, sep)) {
|
|
@@ -24341,7 +24423,6 @@
|
|
|
24341
24423
|
if (items.length > 1) {
|
|
24342
24424
|
vutils.last(items).setAttribute('opacity', 0);
|
|
24343
24425
|
}
|
|
24344
|
-
vutils.last(source).setAttribute('opacity', 1);
|
|
24345
24426
|
}
|
|
24346
24427
|
}
|
|
24347
24428
|
source.forEach(item => {
|
|
@@ -24381,9 +24462,6 @@
|
|
|
24381
24462
|
}
|
|
24382
24463
|
return false;
|
|
24383
24464
|
}
|
|
24384
|
-
function itemIntersect(item1, item2) {
|
|
24385
|
-
return vutils.isRotateAABBIntersect(item1.rotatedBounds, item2.rotatedBounds, true);
|
|
24386
|
-
}
|
|
24387
24465
|
function tryRotate(orient, items) {
|
|
24388
24466
|
if (orient === 'bottom' || orient === 'top') {
|
|
24389
24467
|
rotateXAxis(orient, items);
|
|
@@ -24393,39 +24471,6 @@
|
|
|
24393
24471
|
}
|
|
24394
24472
|
genRotateBounds(items);
|
|
24395
24473
|
}
|
|
24396
|
-
function rotate(x, y, deg, originX, originY) {
|
|
24397
|
-
return {
|
|
24398
|
-
x: (x - originX) * Math.cos(deg) + (y - originY) * Math.sin(deg) + originX,
|
|
24399
|
-
y: (x - originX) * Math.sin(deg) + (originY - y) * Math.cos(deg) + originY
|
|
24400
|
-
};
|
|
24401
|
-
}
|
|
24402
|
-
function genNormalBounds(item) {
|
|
24403
|
-
const bounds = item.AABBBounds;
|
|
24404
|
-
return {
|
|
24405
|
-
x1: bounds.x1,
|
|
24406
|
-
x2: bounds.x2,
|
|
24407
|
-
y1: bounds.y1,
|
|
24408
|
-
y2: bounds.y2,
|
|
24409
|
-
centerX: item.attribute.x,
|
|
24410
|
-
centerY: item.attribute.y,
|
|
24411
|
-
angle: item.attribute.angle
|
|
24412
|
-
};
|
|
24413
|
-
}
|
|
24414
|
-
function genRotateBounds(items) {
|
|
24415
|
-
items.forEach(item => {
|
|
24416
|
-
const bounds = genNormalBounds(item);
|
|
24417
|
-
const rotatedCenter = rotate(bounds.centerX, bounds.centerY, bounds.angle, item.attribute.x, item.attribute.y);
|
|
24418
|
-
const deltaX = rotatedCenter.x - bounds.centerX;
|
|
24419
|
-
const deltaY = rotatedCenter.y - bounds.centerY;
|
|
24420
|
-
bounds.x1 += deltaX;
|
|
24421
|
-
bounds.x2 += deltaX;
|
|
24422
|
-
bounds.y1 += deltaY;
|
|
24423
|
-
bounds.y2 += deltaY;
|
|
24424
|
-
bounds.centerX += deltaX;
|
|
24425
|
-
bounds.centerY += deltaY;
|
|
24426
|
-
item.rotatedBounds = bounds;
|
|
24427
|
-
});
|
|
24428
|
-
}
|
|
24429
24474
|
function clampAngle(angle = 0) {
|
|
24430
24475
|
if (angle < 0) {
|
|
24431
24476
|
while (angle < 0) {
|
|
@@ -26580,7 +26625,8 @@
|
|
|
26580
26625
|
const groupClip = createGroup(Object.assign(Object.assign({}, limitRect), { clip: true, pickable: false }));
|
|
26581
26626
|
group = createGroup({
|
|
26582
26627
|
x: -((_a = limitRect === null || limitRect === void 0 ? void 0 : limitRect.x) !== null && _a !== void 0 ? _a : 0),
|
|
26583
|
-
y: -((_b = limitRect === null || limitRect === void 0 ? void 0 : limitRect.y) !== null && _b !== void 0 ? _b : 0)
|
|
26628
|
+
y: -((_b = limitRect === null || limitRect === void 0 ? void 0 : limitRect.y) !== null && _b !== void 0 ? _b : 0),
|
|
26629
|
+
pickable: false
|
|
26584
26630
|
});
|
|
26585
26631
|
groupClip.add(group);
|
|
26586
26632
|
this._containerClip = groupClip;
|
|
@@ -26589,7 +26635,8 @@
|
|
|
26589
26635
|
else {
|
|
26590
26636
|
group = createGroup({
|
|
26591
26637
|
x: 0,
|
|
26592
|
-
y: 0
|
|
26638
|
+
y: 0,
|
|
26639
|
+
pickable: false
|
|
26593
26640
|
});
|
|
26594
26641
|
this.add(group);
|
|
26595
26642
|
}
|
|
@@ -26606,11 +26653,10 @@
|
|
|
26606
26653
|
});
|
|
26607
26654
|
}
|
|
26608
26655
|
render() {
|
|
26609
|
-
var _a
|
|
26656
|
+
var _a;
|
|
26657
|
+
this.setAttribute('pickable', false);
|
|
26610
26658
|
const markerVisible = (_a = this.attribute.visible) !== null && _a !== void 0 ? _a : true;
|
|
26611
|
-
|
|
26612
|
-
if (!markerInteractive) {
|
|
26613
|
-
this.setAttribute('pickable', false);
|
|
26659
|
+
if (this.attribute.interactive === false) {
|
|
26614
26660
|
this.setAttribute('childrenPickable', false);
|
|
26615
26661
|
}
|
|
26616
26662
|
if (markerVisible) {
|
|
@@ -26934,7 +26980,8 @@
|
|
|
26934
26980
|
endSymbol,
|
|
26935
26981
|
lineStyle,
|
|
26936
26982
|
mainSegmentIndex,
|
|
26937
|
-
multiSegment
|
|
26983
|
+
multiSegment,
|
|
26984
|
+
pickable: false
|
|
26938
26985
|
});
|
|
26939
26986
|
line.name = 'mark-line-line';
|
|
26940
26987
|
this._line = line;
|
|
@@ -27211,7 +27258,8 @@
|
|
|
27211
27258
|
y: position.y + ((itemContent === null || itemContent === void 0 ? void 0 : itemContent.offsetY) || 0)
|
|
27212
27259
|
};
|
|
27213
27260
|
const line = new Segment({
|
|
27214
|
-
points: []
|
|
27261
|
+
points: [],
|
|
27262
|
+
pickable: false
|
|
27215
27263
|
});
|
|
27216
27264
|
line.name = 'mark-point-line';
|
|
27217
27265
|
this._line = line;
|
|
@@ -31212,7 +31260,7 @@
|
|
|
31212
31260
|
}
|
|
31213
31261
|
};
|
|
31214
31262
|
|
|
31215
|
-
const version = "0.16.
|
|
31263
|
+
const version = "0.16.10-alpha.0";
|
|
31216
31264
|
|
|
31217
31265
|
exports.AbstractComponent = AbstractComponent;
|
|
31218
31266
|
exports.ArcInfo = ArcInfo;
|