@visactor/vrender-components 0.14.2 → 0.14.3-alpha.9

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.14.2";
1
+ export declare const version = "0.14.3-alpha.9";
2
2
  export * from './core/base';
3
3
  export * from './scrollbar';
4
4
  export * from './tag';
package/cjs/index.js CHANGED
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), exports.version = void 0, exports.version = "0.14.2", __exportStar(require("./core/base"), exports),
20
+ }), exports.version = void 0, exports.version = "0.14.3-alpha.9", __exportStar(require("./core/base"), exports),
21
21
  __exportStar(require("./scrollbar"), exports), __exportStar(require("./tag"), exports),
22
22
  __exportStar(require("./poptip"), exports), __exportStar(require("./crosshair"), exports),
23
23
  __exportStar(require("./label"), exports), __exportStar(require("./axis"), exports),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.14.2\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.14.3-alpha.9\";\n\nexport * from './core/base';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\n"]}
@@ -1,4 +1,4 @@
1
- import type { IGroup, IGraphic, IText, IPath } from '@visactor/vrender';
1
+ import type { IGroup, IGraphic, IText, ILine } from '@visactor/vrender';
2
2
  import type { IBoundsLike } from '@visactor/vutils';
3
3
  import { AbstractComponent } from '../core/base';
4
4
  import type { PointLocationCfg } from '../core/type';
@@ -14,7 +14,7 @@ export declare abstract class LabelBase<T extends BaseLabelAttrs> extends Abstra
14
14
  setBitmapTool(bmpTool: ReturnType<typeof bitmapTool>): void;
15
15
  protected _graphicToText: Map<IGraphic, {
16
16
  text: IText;
17
- labelLine?: IPath;
17
+ labelLine?: ILine;
18
18
  }>;
19
19
  protected _idToGraphic: Map<string, IGraphic>;
20
20
  onAfterLabelOverlap?: (bitmap: Bitmap) => void;
package/cjs/label/base.js CHANGED
@@ -103,7 +103,7 @@ class LabelBase extends base_1.AbstractComponent {
103
103
  x: basedArc.labelPosition.x,
104
104
  y: basedArc.labelPosition.y,
105
105
  angle: null !== (_a = this.attribute.angle) && void 0 !== _a ? _a : basedArc.angle,
106
- labelLinePath: basedArc.labelLinePath
106
+ points: [ basedArc.pointA, basedArc.pointB, basedArc.pointC ]
107
107
  };
108
108
  labels[i].setAttributes(labelAttribute);
109
109
  }
@@ -202,12 +202,12 @@ class LabelBase extends base_1.AbstractComponent {
202
202
  const animationConfig = null !== (_a = this.attribute.animation) && void 0 !== _a ? _a : {}, disableAnimation = !1 === this._enableAnimation || !1 === animationConfig, mode = null !== (_b = animationConfig.mode) && void 0 !== _b ? _b : animate_1.DefaultLabelAnimation.mode, duration = null !== (_c = animationConfig.duration) && void 0 !== _c ? _c : animate_1.DefaultLabelAnimation.duration, easing = null !== (_d = animationConfig.easing) && void 0 !== _d ? _d : animate_1.DefaultLabelAnimation.easing, delay = null !== (_e = animationConfig.delay) && void 0 !== _e ? _e : 0, currentTextMap = new Map, prevTextMap = this._graphicToText || new Map, texts = [];
203
203
  labels.forEach(((text, index) => {
204
204
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
205
- const labelLine = (null === (_a = text.attribute) || void 0 === _a ? void 0 : _a.labelLinePath) ? (0,
206
- vrender_1.createPath)({
205
+ const labelLine = (null === (_a = text.attribute) || void 0 === _a ? void 0 : _a.points) ? (0,
206
+ vrender_1.createLine)({
207
207
  visible: null === (_c = null === (_b = text.attribute) || void 0 === _b ? void 0 : _b.visible) || void 0 === _c || _c,
208
208
  stroke: null !== (_f = null === (_e = null === (_d = text.attribute) || void 0 === _d ? void 0 : _d.line) || void 0 === _e ? void 0 : _e.stroke) && void 0 !== _f ? _f : null === (_g = text.attribute) || void 0 === _g ? void 0 : _g.fill,
209
209
  lineWidth: 1,
210
- path: null === (_h = text.attribute) || void 0 === _h ? void 0 : _h.labelLinePath
210
+ points: null === (_h = text.attribute) || void 0 === _h ? void 0 : _h.points
211
211
  }) : void 0, relatedGraphic = this._idToGraphic.get(text.attribute.id), state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter";
212
212
  if ("enter" === state) if (texts.push(text), currentTextMap.set(relatedGraphic, labelLine ? {
213
213
  text: text,
@@ -232,12 +232,12 @@ class LabelBase extends base_1.AbstractComponent {
232
232
  const prevLabel = prevTextMap.get(relatedGraphic);
233
233
  if (prevTextMap.delete(relatedGraphic), currentTextMap.set(relatedGraphic, prevLabel),
234
234
  disableAnimation) prevLabel.text.setAttributes(text.attribute), (null == prevLabel ? void 0 : prevLabel.labelLine) && prevLabel.labelLine.setAttributes({
235
- path: null === (_k = text.attribute) || void 0 === _k ? void 0 : _k.labelLinePath
235
+ points: null === (_k = text.attribute) || void 0 === _k ? void 0 : _k.points
236
236
  }); else {
237
237
  const prevText = prevLabel.text;
238
238
  prevText.animate().to(text.attribute, duration, easing), prevLabel.labelLine && prevLabel.labelLine.animate().to((0,
239
239
  vutils_2.merge)({}, prevLabel.labelLine.attribute, {
240
- path: null === (_j = text.attribute) || void 0 === _j ? void 0 : _j.labelLinePath
240
+ points: null === (_j = text.attribute) || void 0 === _j ? void 0 : _j.points
241
241
  }), duration, easing), !1 !== animationConfig.increaseEffect && prevText.attribute.text !== text.attribute.text && (0,
242
242
  vutils_1.isValidNumber)(Number(prevText.attribute.text) * Number(text.attribute.text)) && prevText.animate().play(new vrender_1.IncreaseCount({
243
243
  text: prevText.attribute.text
@@ -1 +1 @@
1
- {"version":3,"sources":["label/base.ts"],"names":[],"mappings":";;;AAIA,+CAA+F;AAE/F,6CAAyF;AACzF,uCAAiD;AAEjD,+DAA4D;AAC5D,kCAAiF;AACjF,0CAAyC;AAEzC,uCAAiG;AAEjG,+CAAkF;AAElF,6CAAyC;AAE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AgB,EAAC,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,uBAAuB,EAAE,iBAAiB,CAAC;iBAC/G,CAAC,CAAC;aACJ;iBAAM,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,EAAE;gBAKxC,MAAM,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,MAAgB,CAAC;gBACzD,MAAM,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,IAAc,CAAC;gBACvD,KAAK,CAAC,aAAa,CAAC;oBAClB,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI;oBAC/B,IAAI,EAAE,IAAA,mCAAgB,EAAC,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,uBAAuB,EAAE,iBAAiB,CAAC;iBAC/G,CAAC,CAAC;aACJ;SACF;IACH,CAAC;IAED,WAAW,CAAC,KAAuB;QACjC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;IAChC,CAAC;IAED,eAAe;QACb,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;CACF;AA9qBD,8BA8qBC","file":"base.js","sourcesContent":["/**\n * @description Label 基类\n */\nimport type { IGroup, Text, IGraphic, IText, FederatedPointerEvent, IColor, IPath, Path } from '@visactor/vrender';\nimport { createText, IncreaseCount, AttributeUpdateType, createPath } from '@visactor/vrender';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport { isFunction, isValidNumber, isEmpty, isValid, isString } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { PointLocationCfg } from '../core/type';\nimport { labelSmartInvert } from '../util/labelSmartInvert';\nimport { getMarksByName, getNoneGroupMarksByName, traverseGroup } from '../util';\nimport { StateValue } from '../constant';\nimport type { Bitmap } from './overlap';\nimport { bitmapTool, boundToRange, canPlace, canPlaceInside, clampText, place } from './overlap';\nimport type { BaseLabelAttrs, OverlapAttrs, ILabelAnimation, ArcLabelAttrs, LabelItem, SmartInvertAttrs } from './type';\nimport { DefaultLabelAnimation, getAnimationAttributes } from './animate/animate';\nimport type { ArcInfo } from './arc';\nimport { merge } from '@visactor/vutils';\n\nexport abstract class LabelBase<T extends BaseLabelAttrs> extends AbstractComponent<T> {\n name = 'label';\n\n protected _baseMarks?: IGraphic[];\n\n protected _bitmap?: Bitmap;\n\n setBitmap(bitmap: Bitmap) {\n this._bitmap = bitmap;\n }\n\n protected _bmpTool?: ReturnType<typeof bitmapTool>;\n setBitmapTool(bmpTool: ReturnType<typeof bitmapTool>) {\n this._bmpTool = bmpTool;\n }\n\n protected _graphicToText: Map<IGraphic, { text: IText; labelLine?: IPath }>;\n\n protected _idToGraphic: Map<string, IGraphic>;\n\n onAfterLabelOverlap?: (bitmap: Bitmap) => void;\n\n private _lastHover: IGraphic;\n private _lastSelect: IGraphic;\n\n private _enableAnimation: boolean;\n\n protected abstract labeling(\n textBounds: IBoundsLike,\n graphicBounds: IBoundsLike,\n position?: BaseLabelAttrs['position'],\n offset?: number\n ): { x: number; y: number } | undefined;\n\n protected layoutArcLabels(\n position?: BaseLabelAttrs['position'],\n attribute?: any,\n currentMarks?: IGraphic[],\n data?: any[],\n textBoundsArray?: any[]\n ): any {\n const arcs: ArcInfo[] = [];\n return arcs;\n }\n\n protected render() {\n this._prepare();\n\n const { overlap, smartInvert, dataFilter, customLayoutFunc, customOverlapFunc } = this.attribute;\n let data = this.attribute.data;\n\n if (isFunction(dataFilter)) {\n data = dataFilter(data);\n }\n\n let labels: IText[];\n\n if (isFunction(customLayoutFunc)) {\n labels = customLayoutFunc(data, (d: LabelItem) => this._idToGraphic.get(d.id));\n } else {\n // 根据关联图元和配置的position计算标签坐标\n labels = this.layout(data);\n\n if (isFunction(customOverlapFunc)) {\n labels = customOverlapFunc(labels as Text[], (d: LabelItem) => this._idToGraphic.get(d.id));\n } else {\n // 防重叠逻辑\n if (overlap !== false) {\n labels = this._overlapping(labels);\n }\n }\n }\n\n if (smartInvert !== false) {\n this._smartInvert(labels);\n }\n\n this._renderLabels(labels);\n }\n\n private _bindEvent(target: IGraphic) {\n if (!target) {\n return;\n }\n\n const { hover, select } = this.attribute;\n\n if (hover) {\n target.addEventListener('pointermove', this._onHover as EventListenerOrEventListenerObject);\n target.addEventListener('pointerout', this._onUnHover as EventListenerOrEventListenerObject);\n }\n\n if (select) {\n target.addEventListener('pointerdown', this._onClick as EventListenerOrEventListenerObject);\n }\n }\n\n private _setStates(target: IGraphic) {\n if (!target) {\n return;\n }\n const state = this.attribute.state;\n\n if (!state || isEmpty(state)) {\n return;\n }\n\n target.states = state;\n }\n\n private _onHover = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGraphic;\n if (target !== this._lastHover && !isEmpty(target.states)) {\n target.addState(StateValue.hover, true);\n traverseGroup(this as unknown as IGraphic, (node: IGraphic) => {\n if (node !== target && !isEmpty(node.states)) {\n node.addState(StateValue.hoverReverse, true);\n }\n });\n this._lastHover = target;\n }\n };\n\n private _onUnHover = (e: FederatedPointerEvent) => {\n if (this._lastHover) {\n traverseGroup(this as unknown as IGraphic, (node: IGraphic) => {\n if (!isEmpty(node.states)) {\n node.removeState(StateValue.hoverReverse);\n node.removeState(StateValue.hover);\n }\n });\n this._lastHover = null;\n }\n };\n\n private _onClick = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGraphic;\n if (this._lastSelect === target && target.hasState('selected')) {\n // 取消选中\n this._lastSelect = null;\n traverseGroup(this as unknown as IGraphic, (node: IGraphic) => {\n if (!isEmpty(node.states)) {\n node.removeState(StateValue.selectedReverse);\n node.removeState(StateValue.selected);\n }\n });\n return;\n }\n\n if (!isEmpty(target.states)) {\n target.addState(StateValue.selected, true);\n traverseGroup(this as unknown as IGraphic, (node: IGraphic) => {\n if (node !== target && !isEmpty(node.states)) {\n node.addState(StateValue.selectedReverse, true);\n }\n });\n this._lastSelect = target;\n }\n };\n\n private _createLabelText(attributes: LabelItem) {\n const text = createText(attributes);\n this._bindEvent(text);\n this._setStates(text);\n return text;\n }\n\n private _prepare() {\n const baseMarks = getMarksByName(this.getRootNode() as IGroup, this.attribute.baseMarkGroupName);\n const currentBaseMarks: IGraphic[] = [];\n baseMarks.forEach(mark => {\n if ((mark as any).releaseStatus !== 'willRelease') {\n currentBaseMarks.push(mark);\n }\n });\n\n this._idToGraphic?.clear();\n this._baseMarks = currentBaseMarks;\n\n if (!currentBaseMarks || currentBaseMarks.length === 0) {\n return;\n }\n\n const { data } = this.attribute;\n\n if (!data || data.length === 0) {\n return;\n }\n\n if (!this._idToGraphic) {\n this._idToGraphic = new Map();\n }\n // generate id mapping before data filter\n for (let i = 0; i < currentBaseMarks.length; i++) {\n const textData = data[i];\n const baseMark = currentBaseMarks[i] as IGraphic;\n if (textData && baseMark) {\n if (!isValid(textData.id)) {\n textData.id = `vrender-component-${this.name}-${i}`;\n }\n this._idToGraphic.set(textData.id, baseMark);\n }\n }\n }\n\n protected layout(data: LabelItem[] = []): IText[] {\n const { textStyle = {}, position, offset } = this.attribute;\n const labels = [];\n const textBoundsArray = [];\n\n for (let i = 0; i < data.length; i++) {\n const textData = data[i];\n const baseMark = this._idToGraphic.get(textData.id);\n\n const labelAttribute = {\n fill: baseMark.attribute.fill,\n ...textStyle,\n ...textData\n };\n const text = this._createLabelText(labelAttribute);\n const textBounds = this.getGraphicBounds(text);\n textBoundsArray.push(textBounds);\n const graphicBounds = this.getGraphicBounds(baseMark, { x: textData.x as number, y: textData.y as number });\n\n const textLocation = this.labeling(\n textBounds,\n graphicBounds,\n isFunction(position) ? position(textData) : position,\n offset\n );\n if (!textLocation) {\n continue;\n }\n labelAttribute.x = textLocation.x;\n labelAttribute.y = textLocation.y;\n\n text.setAttributes(textLocation);\n labels.push(text);\n }\n\n if (this.attribute.type === 'arc') {\n const arcs: ArcInfo[] = this.layoutArcLabels(\n position,\n this.attribute,\n Array.from(this._idToGraphic.values()),\n data,\n textBoundsArray\n );\n for (let i = 0; i < data.length; i++) {\n const textData = data[i];\n const basedArc = arcs.find(arc => arc.labelText === textData.text);\n\n const labelAttribute = {\n x: basedArc.labelPosition.x,\n y: basedArc.labelPosition.y,\n angle: (this.attribute as ArcLabelAttrs).angle ?? basedArc.angle,\n labelLinePath: basedArc.labelLinePath\n };\n\n labels[i].setAttributes(labelAttribute);\n }\n }\n\n return labels;\n }\n\n protected _overlapping(labels: IText[]) {\n if (labels.length === 0) {\n return [];\n }\n const option = this.attribute.overlap as OverlapAttrs;\n\n const result: IText[] = [];\n const baseMarkGroup = this.getBaseMarkGroup();\n\n const size = option.size ?? {\n width: baseMarkGroup?.AABBBounds.width() ?? 0,\n height: baseMarkGroup?.AABBBounds.height() ?? 0\n };\n\n if (size.width === 0 || size.height === 0) {\n return labels;\n }\n\n const { avoidBaseMark, strategy = [], hideOnHit = true, clampForce = true, avoidMarks = [] } = option;\n const bmpTool = this._bmpTool || bitmapTool(size.width, size.height);\n const bitmap = this._bitmap || bmpTool.bitmap();\n const checkBounds = strategy.some(s => s.type === 'bound');\n\n // 躲避关联的基础图元\n if (avoidBaseMark) {\n this._baseMarks?.forEach(mark => {\n mark.AABBBounds && bitmap.setRange(boundToRange(bmpTool, mark.AABBBounds, true));\n });\n }\n\n // 躲避指定图元\n if (avoidMarks.length > 0) {\n avoidMarks.forEach(avoid => {\n if (isString(avoid)) {\n getNoneGroupMarksByName(this.getRootNode() as IGroup, avoid).forEach(avoidMark => {\n avoidMark.AABBBounds && bitmap.setRange(boundToRange(bmpTool, avoidMark.AABBBounds, true));\n });\n } else if (avoid.AABBBounds) {\n bitmap.setRange(boundToRange(bmpTool, avoid.AABBBounds, true));\n }\n });\n }\n\n for (let i = 0; i < labels.length; i++) {\n if (labels[i].visible === false) {\n continue;\n }\n const text = labels[i] as IText;\n const baseMark = this._idToGraphic.get((text.attribute as LabelItem).id);\n text.update();\n\n // 默认位置可以放置\n if (canPlace(bmpTool, bitmap, text.AABBBounds, clampForce)) {\n // 如果配置了限制在图形内部,需要提前判断;\n if (!checkBounds) {\n bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));\n result.push(text);\n continue;\n }\n\n if (checkBounds && baseMark?.AABBBounds && canPlaceInside(text.AABBBounds, baseMark?.AABBBounds)) {\n bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));\n result.push(text);\n continue;\n }\n }\n\n // 尝试向内挤压\n if (clampForce) {\n const { dx = 0, dy = 0 } = clampText(text, bmpTool.width, bmpTool.height);\n if (\n !(dx === 0 && dy === 0) &&\n canPlace(bmpTool, bitmap, {\n x1: text.AABBBounds.x1 + dx,\n x2: text.AABBBounds.x2 + dx,\n y1: text.AABBBounds.y1 + dy,\n y2: text.AABBBounds.y2 + dy\n })\n ) {\n text.setAttributes({ x: text.attribute.x + dx, y: text.attribute.y + dy });\n result.push(text);\n continue;\n }\n }\n\n let hasPlace: ReturnType<typeof place> = false;\n // 发生碰撞,根据策略寻找可放置的位置\n for (let j = 0; j < strategy.length; j++) {\n hasPlace = place(\n bmpTool,\n bitmap,\n strategy[j],\n <BaseLabelAttrs>this.attribute,\n text as Text,\n this.getGraphicBounds(baseMark, labels[i]),\n this.labeling\n );\n if (hasPlace !== false) {\n text.setAttributes({ x: hasPlace.x, y: hasPlace.y });\n result.push(text);\n break;\n }\n }\n\n // 尝试向内挤压\n if (!hasPlace && clampForce) {\n const { dx = 0, dy = 0 } = clampText(text, bmpTool.width, bmpTool.height);\n if (\n !(dx === 0 && dy === 0) &&\n canPlace(bmpTool, bitmap, {\n x1: text.AABBBounds.x1 + dx,\n x2: text.AABBBounds.x2 + dx,\n y1: text.AABBBounds.y1 + dy,\n y2: text.AABBBounds.y2 + dy\n })\n ) {\n text.setAttributes({ x: text.attribute.x + dx, y: text.attribute.y + dy });\n bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));\n result.push(text);\n continue;\n }\n }\n\n !hasPlace && !hideOnHit && result.push(text);\n }\n\n if (isFunction(this.onAfterLabelOverlap)) {\n this.onAfterLabelOverlap(bitmap);\n }\n\n return result;\n }\n\n protected getBaseMarkGroup() {\n const { baseMarkGroupName } = this.attribute as BaseLabelAttrs;\n if (!baseMarkGroupName) {\n return;\n }\n return (this.getRootNode() as IGroup).find(node => node.name === baseMarkGroupName, true) as IGroup;\n }\n\n protected getGraphicBounds(graphic?: IGraphic, point: Partial<PointLocationCfg> = {}): IBoundsLike {\n // if (graphic && !isEmpty((graphic as any).finalAttrs)) {\n // const g = graphic.clone();\n // g.onBeforeAttributeUpdate = graphic.onBeforeAttributeUpdate;\n // g.setAttributes((graphic as any).finalAttrs);\n // g.update();\n // return g.AABBBounds;\n // }\n return (\n graphic?.AABBBounds ||\n ({\n x1: point.x,\n x2: point.x,\n y1: point.y,\n y2: point.y\n } as IBoundsLike)\n );\n }\n\n protected _renderLabels(labels: IText[]) {\n const animationConfig = (this.attribute.animation ?? {}) as ILabelAnimation;\n const disableAnimation = this._enableAnimation === false || (animationConfig as unknown as boolean) === false;\n const mode = animationConfig.mode ?? DefaultLabelAnimation.mode;\n const duration = animationConfig.duration ?? DefaultLabelAnimation.duration;\n const easing = animationConfig.easing ?? DefaultLabelAnimation.easing;\n const delay = animationConfig.delay ?? 0;\n\n const currentTextMap: Map<any, { text: IText; labelLine?: IPath }> = new Map();\n const prevTextMap: Map<any, { text: IText; labelLine?: IPath }> = this._graphicToText || new Map();\n const texts = [] as IText[];\n\n labels.forEach((text, index) => {\n const labelLine: IPath = (text.attribute as ArcLabelAttrs)?.labelLinePath\n ? (createPath({\n visible: text.attribute?.visible ?? true,\n stroke: (text.attribute as ArcLabelAttrs)?.line?.stroke ?? text.attribute?.fill,\n lineWidth: 1,\n path: (text.attribute as ArcLabelAttrs)?.labelLinePath\n }) as Path)\n : undefined;\n const relatedGraphic = this._idToGraphic.get((text.attribute as LabelItem).id);\n const state = prevTextMap?.get(relatedGraphic) ? 'update' : 'enter';\n\n if (state === 'enter') {\n texts.push(text);\n currentTextMap.set(relatedGraphic, labelLine ? { text, labelLine } : { text });\n if (!disableAnimation && relatedGraphic) {\n const { from, to } = getAnimationAttributes(text.attribute, 'fadeIn');\n this.add(text);\n if (labelLine) {\n this.add(labelLine);\n }\n relatedGraphic.onAnimateBind = () => {\n text.setAttributes(from);\n const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, {\n mode,\n duration,\n easing,\n to,\n delay\n });\n relatedGraphic.on('afterAttributeUpdate', listener);\n };\n } else {\n this.add(text);\n if (labelLine) {\n this.add(labelLine);\n }\n }\n }\n\n if (state === 'update') {\n const prevLabel = prevTextMap.get(relatedGraphic);\n prevTextMap.delete(relatedGraphic);\n currentTextMap.set(relatedGraphic, prevLabel);\n if (!disableAnimation) {\n const prevText = prevLabel.text;\n prevText.animate().to(text.attribute, duration, easing);\n if (prevLabel.labelLine) {\n // prevLabel.labelLine.setAttributes({ path: (text.attribute as ArcLabelAttrs)?.labelLinePath });\n prevLabel.labelLine\n .animate()\n .to(\n merge({}, prevLabel.labelLine.attribute, { path: (text.attribute as ArcLabelAttrs)?.labelLinePath }),\n duration,\n easing\n );\n }\n if (\n animationConfig.increaseEffect !== false &&\n prevText.attribute.text !== text.attribute.text &&\n isValidNumber(Number(prevText.attribute.text) * Number(text.attribute.text))\n ) {\n prevText\n .animate()\n .play(\n new IncreaseCount(\n { text: prevText.attribute.text as string },\n { text: text.attribute.text as string },\n duration,\n easing\n )\n );\n }\n } else {\n prevLabel.text.setAttributes(text.attribute);\n if (prevLabel?.labelLine) {\n prevLabel.labelLine.setAttributes({ path: (text.attribute as ArcLabelAttrs)?.labelLinePath });\n }\n }\n }\n });\n prevTextMap.forEach(label => {\n if (disableAnimation) {\n this.removeChild(label.text);\n if (label?.labelLine) {\n this.removeChild(label.labelLine);\n }\n } else {\n label.text\n ?.animate()\n .to(getAnimationAttributes(label.text.attribute, 'fadeOut').to, duration, easing)\n .onEnd(() => {\n this.removeChild(label.text);\n if (label?.labelLine) {\n this.removeChild(label.labelLine);\n }\n });\n }\n });\n\n this._graphicToText = currentTextMap;\n }\n\n protected _afterRelatedGraphicAttributeUpdate(\n text: IText,\n texts: IText[],\n index: number,\n relatedGraphic: IGraphic,\n { mode, duration, easing, to, delay }: ILabelAnimation & { to: any }\n ) {\n const listener = (event: any) => {\n const { detail } = event;\n if (!detail) {\n return {};\n }\n\n const isValidAnimateState =\n detail &&\n detail.type === AttributeUpdateType.ANIMATE_UPDATE &&\n detail.animationState &&\n detail.animationState.step?.type !== 'wait';\n\n if (!isValidAnimateState) {\n return {};\n }\n\n if (detail.type === AttributeUpdateType.ANIMATE_END) {\n text.setAttributes(to);\n return;\n }\n\n const onEnd = () => {\n if (relatedGraphic) {\n relatedGraphic.onAnimateBind = undefined;\n relatedGraphic.removeEventListener('afterAttributeUpdate', listener);\n }\n };\n\n switch (mode) {\n case 'after':\n // 3. 当前关联图元的动画播放结束后\n if (detail.animationState.end) {\n text.animate({ onEnd }).wait(delay).to(to, duration, easing);\n }\n break;\n case 'after-all':\n // 2. 所有完成后才开始;\n if (index === texts.length - 1) {\n if (detail.animationState.end) {\n texts.forEach(t => {\n t.animate({ onEnd }).wait(delay).to(to, duration, easing);\n });\n }\n }\n break;\n case 'same-time':\n default:\n // 1. 与当前关联图元的动画播放同时进行\n if (detail.animationState.isFirstFrameOfStep) {\n text.animate({ onEnd }).wait(delay).to(to, duration, easing);\n }\n break;\n }\n };\n return listener;\n }\n\n protected _smartInvert(labels: IText[]) {\n const option = (this.attribute.smartInvert || {}) as SmartInvertAttrs;\n const { textType, contrastRatiosThreshold, alternativeColors } = option;\n\n for (let i = 0; i < labels.length; i++) {\n const label = labels[i];\n if (!label) {\n continue;\n }\n\n const baseMark = this._idToGraphic.get((label.attribute as LabelItem).id);\n let isInside = canPlaceInside(label.AABBBounds, baseMark?.AABBBounds);\n\n if (this.attribute.type === 'arc') {\n if (this.attribute.position === 'inside') {\n isInside = true;\n } else {\n isInside = false;\n }\n }\n\n /**\n * stroke 的处理逻辑\n * 1. 当文本在图元内部时,有两种情况:\n * - a. 未设置stroke:labelFill为前景色,baseMark填充色为背景色\n * - b. 设置了stroke:labelFill为前景色,labelStroke填充色为背景色\n * 2. 当文本在图元外部时,有两种情况:\n * - a. 未设置stroke:此时设置strokeColor为backgroundColor。labelFill为前景色,labelStroke填充色为背景色。避免文字一半在图元内部,一半在图元外部时,在图元外部文字不可见。\n * - b. 设置了stroke:保持strokeColor。labelFill为前景色,labelStroke填充色为背景色。\n */\n if (label.attribute.stroke && label.attribute.lineWidth > 0) {\n /**\n * 1-b, 2-b\n * 若label存在stroke,label填充色为前景色,label描边色为背景色\n * WCAG 2 字母周围的文本发光/光晕可用作背景颜色\n */\n label.setAttributes({\n fill: labelSmartInvert(\n label.attribute.fill as IColor,\n label.attribute.stroke as IColor,\n textType,\n contrastRatiosThreshold,\n alternativeColors\n )\n });\n } else if (isInside) {\n /**\n * 1-a\n * label在图元内部时,label填充色为前景色,baseMark填充色为背景色\n */\n const backgroundColor = baseMark.attribute.fill as IColor;\n const foregroundColor = label.attribute.fill as IColor;\n label.setAttributes({\n fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)\n });\n } else if (label.attribute.lineWidth > 0) {\n /**\n * 2-a\n * 当文本在图元外部时,设置strokeColor为backgroundColor。labelFill为前景色,labelStroke填充色为背景色。\n */\n const backgroundColor = label.attribute.stroke as IColor;\n const foregroundColor = label.attribute.fill as IColor;\n label.setAttributes({\n stroke: baseMark.attribute.fill,\n fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)\n });\n }\n }\n }\n\n setLocation(point: PointLocationCfg) {\n this.translateTo(point.x, point.y);\n }\n\n disableAnimation() {\n this._enableAnimation = false;\n }\n\n enableAnimation() {\n this._enableAnimation = true;\n }\n}\n"]}
1
+ {"version":3,"sources":["label/base.ts"],"names":[],"mappings":";;;AAIA,+CAA+F;AAE/F,6CAAyF;AACzF,uCAAiD;AAEjD,+DAA4D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SAAS,CAAC,IAAc,CAAC;gBAC1D,MAAM,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,IAAc,CAAC;gBACvD,KAAK,CAAC,aAAa,CAAC;oBAClB,IAAI,EAAE,IAAA,mCAAgB,EAAC,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,uBAAuB,EAAE,iBAAiB,CAAC;iBAC/G,CAAC,CAAC;aACJ;iBAAM,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,EAAE;gBAKxC,MAAM,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,MAAgB,CAAC;gBACzD,MAAM,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,IAAc,CAAC;gBACvD,KAAK,CAAC,aAAa,CAAC;oBAClB,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI;oBAC/B,IAAI,EAAE,IAAA,mCAAgB,EAAC,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,uBAAuB,EAAE,iBAAiB,CAAC;iBAC/G,CAAC,CAAC;aACJ;SACF;IACH,CAAC;IAED,WAAW,CAAC,KAAuB;QACjC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;IAChC,CAAC;IAED,eAAe;QACb,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,CAAC;CACF;AA7qBD,8BA6qBC","file":"base.js","sourcesContent":["/**\n * @description Label 基类\n */\nimport type { IGroup, Text, IGraphic, IText, FederatedPointerEvent, IColor, ILine, Line } from '@visactor/vrender';\nimport { createText, IncreaseCount, AttributeUpdateType, createLine } from '@visactor/vrender';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport { isFunction, isValidNumber, isEmpty, isValid, isString } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { PointLocationCfg } from '../core/type';\nimport { labelSmartInvert } from '../util/labelSmartInvert';\nimport { getMarksByName, getNoneGroupMarksByName, traverseGroup } from '../util';\nimport { StateValue } from '../constant';\nimport type { Bitmap } from './overlap';\nimport { bitmapTool, boundToRange, canPlace, canPlaceInside, clampText, place } from './overlap';\nimport type { BaseLabelAttrs, OverlapAttrs, ILabelAnimation, ArcLabelAttrs, LabelItem, SmartInvertAttrs } from './type';\nimport { DefaultLabelAnimation, getAnimationAttributes } from './animate/animate';\nimport type { ArcInfo } from './arc';\nimport { merge } from '@visactor/vutils';\n\nexport abstract class LabelBase<T extends BaseLabelAttrs> extends AbstractComponent<T> {\n name = 'label';\n\n protected _baseMarks?: IGraphic[];\n\n protected _bitmap?: Bitmap;\n\n setBitmap(bitmap: Bitmap) {\n this._bitmap = bitmap;\n }\n\n protected _bmpTool?: ReturnType<typeof bitmapTool>;\n setBitmapTool(bmpTool: ReturnType<typeof bitmapTool>) {\n this._bmpTool = bmpTool;\n }\n\n protected _graphicToText: Map<IGraphic, { text: IText; labelLine?: ILine }>;\n\n protected _idToGraphic: Map<string, IGraphic>;\n\n onAfterLabelOverlap?: (bitmap: Bitmap) => void;\n\n private _lastHover: IGraphic;\n private _lastSelect: IGraphic;\n\n private _enableAnimation: boolean;\n\n protected abstract labeling(\n textBounds: IBoundsLike,\n graphicBounds: IBoundsLike,\n position?: BaseLabelAttrs['position'],\n offset?: number\n ): { x: number; y: number } | undefined;\n\n protected layoutArcLabels(\n position?: BaseLabelAttrs['position'],\n attribute?: any,\n currentMarks?: IGraphic[],\n data?: any[],\n textBoundsArray?: any[]\n ): any {\n const arcs: ArcInfo[] = [];\n return arcs;\n }\n\n protected render() {\n this._prepare();\n\n const { overlap, smartInvert, dataFilter, customLayoutFunc, customOverlapFunc } = this.attribute;\n let data = this.attribute.data;\n\n if (isFunction(dataFilter)) {\n data = dataFilter(data);\n }\n\n let labels: IText[];\n\n if (isFunction(customLayoutFunc)) {\n labels = customLayoutFunc(data, (d: LabelItem) => this._idToGraphic.get(d.id));\n } else {\n // 根据关联图元和配置的position计算标签坐标\n labels = this.layout(data);\n\n if (isFunction(customOverlapFunc)) {\n labels = customOverlapFunc(labels as Text[], (d: LabelItem) => this._idToGraphic.get(d.id));\n } else {\n // 防重叠逻辑\n if (overlap !== false) {\n labels = this._overlapping(labels);\n }\n }\n }\n\n if (smartInvert !== false) {\n this._smartInvert(labels);\n }\n\n this._renderLabels(labels);\n }\n\n private _bindEvent(target: IGraphic) {\n if (!target) {\n return;\n }\n\n const { hover, select } = this.attribute;\n\n if (hover) {\n target.addEventListener('pointermove', this._onHover as EventListenerOrEventListenerObject);\n target.addEventListener('pointerout', this._onUnHover as EventListenerOrEventListenerObject);\n }\n\n if (select) {\n target.addEventListener('pointerdown', this._onClick as EventListenerOrEventListenerObject);\n }\n }\n\n private _setStates(target: IGraphic) {\n if (!target) {\n return;\n }\n const state = this.attribute.state;\n\n if (!state || isEmpty(state)) {\n return;\n }\n\n target.states = state;\n }\n\n private _onHover = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGraphic;\n if (target !== this._lastHover && !isEmpty(target.states)) {\n target.addState(StateValue.hover, true);\n traverseGroup(this as unknown as IGraphic, (node: IGraphic) => {\n if (node !== target && !isEmpty(node.states)) {\n node.addState(StateValue.hoverReverse, true);\n }\n });\n this._lastHover = target;\n }\n };\n\n private _onUnHover = (e: FederatedPointerEvent) => {\n if (this._lastHover) {\n traverseGroup(this as unknown as IGraphic, (node: IGraphic) => {\n if (!isEmpty(node.states)) {\n node.removeState(StateValue.hoverReverse);\n node.removeState(StateValue.hover);\n }\n });\n this._lastHover = null;\n }\n };\n\n private _onClick = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGraphic;\n if (this._lastSelect === target && target.hasState('selected')) {\n // 取消选中\n this._lastSelect = null;\n traverseGroup(this as unknown as IGraphic, (node: IGraphic) => {\n if (!isEmpty(node.states)) {\n node.removeState(StateValue.selectedReverse);\n node.removeState(StateValue.selected);\n }\n });\n return;\n }\n\n if (!isEmpty(target.states)) {\n target.addState(StateValue.selected, true);\n traverseGroup(this as unknown as IGraphic, (node: IGraphic) => {\n if (node !== target && !isEmpty(node.states)) {\n node.addState(StateValue.selectedReverse, true);\n }\n });\n this._lastSelect = target;\n }\n };\n\n private _createLabelText(attributes: LabelItem) {\n const text = createText(attributes);\n this._bindEvent(text);\n this._setStates(text);\n return text;\n }\n\n private _prepare() {\n const baseMarks = getMarksByName(this.getRootNode() as IGroup, this.attribute.baseMarkGroupName);\n const currentBaseMarks: IGraphic[] = [];\n baseMarks.forEach(mark => {\n if ((mark as any).releaseStatus !== 'willRelease') {\n currentBaseMarks.push(mark);\n }\n });\n\n this._idToGraphic?.clear();\n this._baseMarks = currentBaseMarks;\n\n if (!currentBaseMarks || currentBaseMarks.length === 0) {\n return;\n }\n\n const { data } = this.attribute;\n\n if (!data || data.length === 0) {\n return;\n }\n\n if (!this._idToGraphic) {\n this._idToGraphic = new Map();\n }\n // generate id mapping before data filter\n for (let i = 0; i < currentBaseMarks.length; i++) {\n const textData = data[i];\n const baseMark = currentBaseMarks[i] as IGraphic;\n if (textData && baseMark) {\n if (!isValid(textData.id)) {\n textData.id = `vrender-component-${this.name}-${i}`;\n }\n this._idToGraphic.set(textData.id, baseMark);\n }\n }\n }\n\n protected layout(data: LabelItem[] = []): IText[] {\n const { textStyle = {}, position, offset } = this.attribute;\n const labels = [];\n const textBoundsArray = [];\n\n for (let i = 0; i < data.length; i++) {\n const textData = data[i];\n const baseMark = this._idToGraphic.get(textData.id);\n\n const labelAttribute = {\n fill: baseMark.attribute.fill,\n ...textStyle,\n ...textData\n };\n const text = this._createLabelText(labelAttribute);\n const textBounds = this.getGraphicBounds(text);\n textBoundsArray.push(textBounds);\n const graphicBounds = this.getGraphicBounds(baseMark, { x: textData.x as number, y: textData.y as number });\n\n const textLocation = this.labeling(\n textBounds,\n graphicBounds,\n isFunction(position) ? position(textData) : position,\n offset\n );\n if (!textLocation) {\n continue;\n }\n labelAttribute.x = textLocation.x;\n labelAttribute.y = textLocation.y;\n\n text.setAttributes(textLocation);\n labels.push(text);\n }\n\n if (this.attribute.type === 'arc') {\n const arcs: ArcInfo[] = this.layoutArcLabels(\n position,\n this.attribute,\n Array.from(this._idToGraphic.values()),\n data,\n textBoundsArray\n );\n for (let i = 0; i < data.length; i++) {\n const textData = data[i];\n const basedArc = arcs.find(arc => arc.labelText === textData.text);\n\n const labelAttribute = {\n x: basedArc.labelPosition.x,\n y: basedArc.labelPosition.y,\n angle: (this.attribute as ArcLabelAttrs).angle ?? basedArc.angle,\n points: [basedArc.pointA, basedArc.pointB, basedArc.pointC]\n };\n\n labels[i].setAttributes(labelAttribute);\n }\n }\n\n return labels;\n }\n\n protected _overlapping(labels: IText[]) {\n if (labels.length === 0) {\n return [];\n }\n const option = this.attribute.overlap as OverlapAttrs;\n\n const result: IText[] = [];\n const baseMarkGroup = this.getBaseMarkGroup();\n\n const size = option.size ?? {\n width: baseMarkGroup?.AABBBounds.width() ?? 0,\n height: baseMarkGroup?.AABBBounds.height() ?? 0\n };\n\n if (size.width === 0 || size.height === 0) {\n return labels;\n }\n\n const { avoidBaseMark, strategy = [], hideOnHit = true, clampForce = true, avoidMarks = [] } = option;\n const bmpTool = this._bmpTool || bitmapTool(size.width, size.height);\n const bitmap = this._bitmap || bmpTool.bitmap();\n const checkBounds = strategy.some(s => s.type === 'bound');\n\n // 躲避关联的基础图元\n if (avoidBaseMark) {\n this._baseMarks?.forEach(mark => {\n mark.AABBBounds && bitmap.setRange(boundToRange(bmpTool, mark.AABBBounds, true));\n });\n }\n\n // 躲避指定图元\n if (avoidMarks.length > 0) {\n avoidMarks.forEach(avoid => {\n if (isString(avoid)) {\n getNoneGroupMarksByName(this.getRootNode() as IGroup, avoid).forEach(avoidMark => {\n avoidMark.AABBBounds && bitmap.setRange(boundToRange(bmpTool, avoidMark.AABBBounds, true));\n });\n } else if (avoid.AABBBounds) {\n bitmap.setRange(boundToRange(bmpTool, avoid.AABBBounds, true));\n }\n });\n }\n\n for (let i = 0; i < labels.length; i++) {\n if (labels[i].visible === false) {\n continue;\n }\n const text = labels[i] as IText;\n const baseMark = this._idToGraphic.get((text.attribute as LabelItem).id);\n text.update();\n\n // 默认位置可以放置\n if (canPlace(bmpTool, bitmap, text.AABBBounds, clampForce)) {\n // 如果配置了限制在图形内部,需要提前判断;\n if (!checkBounds) {\n bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));\n result.push(text);\n continue;\n }\n\n if (checkBounds && baseMark?.AABBBounds && canPlaceInside(text.AABBBounds, baseMark?.AABBBounds)) {\n bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));\n result.push(text);\n continue;\n }\n }\n\n // 尝试向内挤压\n if (clampForce) {\n const { dx = 0, dy = 0 } = clampText(text, bmpTool.width, bmpTool.height);\n if (\n !(dx === 0 && dy === 0) &&\n canPlace(bmpTool, bitmap, {\n x1: text.AABBBounds.x1 + dx,\n x2: text.AABBBounds.x2 + dx,\n y1: text.AABBBounds.y1 + dy,\n y2: text.AABBBounds.y2 + dy\n })\n ) {\n text.setAttributes({ x: text.attribute.x + dx, y: text.attribute.y + dy });\n result.push(text);\n continue;\n }\n }\n\n let hasPlace: ReturnType<typeof place> = false;\n // 发生碰撞,根据策略寻找可放置的位置\n for (let j = 0; j < strategy.length; j++) {\n hasPlace = place(\n bmpTool,\n bitmap,\n strategy[j],\n <BaseLabelAttrs>this.attribute,\n text as Text,\n this.getGraphicBounds(baseMark, labels[i]),\n this.labeling\n );\n if (hasPlace !== false) {\n text.setAttributes({ x: hasPlace.x, y: hasPlace.y });\n result.push(text);\n break;\n }\n }\n\n // 尝试向内挤压\n if (!hasPlace && clampForce) {\n const { dx = 0, dy = 0 } = clampText(text, bmpTool.width, bmpTool.height);\n if (\n !(dx === 0 && dy === 0) &&\n canPlace(bmpTool, bitmap, {\n x1: text.AABBBounds.x1 + dx,\n x2: text.AABBBounds.x2 + dx,\n y1: text.AABBBounds.y1 + dy,\n y2: text.AABBBounds.y2 + dy\n })\n ) {\n text.setAttributes({ x: text.attribute.x + dx, y: text.attribute.y + dy });\n bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));\n result.push(text);\n continue;\n }\n }\n\n !hasPlace && !hideOnHit && result.push(text);\n }\n\n if (isFunction(this.onAfterLabelOverlap)) {\n this.onAfterLabelOverlap(bitmap);\n }\n\n return result;\n }\n\n protected getBaseMarkGroup() {\n const { baseMarkGroupName } = this.attribute as BaseLabelAttrs;\n if (!baseMarkGroupName) {\n return;\n }\n return (this.getRootNode() as IGroup).find(node => node.name === baseMarkGroupName, true) as IGroup;\n }\n\n protected getGraphicBounds(graphic?: IGraphic, point: Partial<PointLocationCfg> = {}): IBoundsLike {\n // if (graphic && !isEmpty((graphic as any).finalAttrs)) {\n // const g = graphic.clone();\n // g.onBeforeAttributeUpdate = graphic.onBeforeAttributeUpdate;\n // g.setAttributes((graphic as any).finalAttrs);\n // g.update();\n // return g.AABBBounds;\n // }\n return (\n graphic?.AABBBounds ||\n ({\n x1: point.x,\n x2: point.x,\n y1: point.y,\n y2: point.y\n } as IBoundsLike)\n );\n }\n\n protected _renderLabels(labels: IText[]) {\n const animationConfig = (this.attribute.animation ?? {}) as ILabelAnimation;\n const disableAnimation = this._enableAnimation === false || (animationConfig as unknown as boolean) === false;\n const mode = animationConfig.mode ?? DefaultLabelAnimation.mode;\n const duration = animationConfig.duration ?? DefaultLabelAnimation.duration;\n const easing = animationConfig.easing ?? DefaultLabelAnimation.easing;\n const delay = animationConfig.delay ?? 0;\n\n const currentTextMap: Map<any, { text: IText; labelLine?: ILine }> = new Map();\n const prevTextMap: Map<any, { text: IText; labelLine?: ILine }> = this._graphicToText || new Map();\n const texts = [] as IText[];\n\n labels.forEach((text, index) => {\n const labelLine: ILine = (text.attribute as ArcLabelAttrs)?.points\n ? (createLine({\n visible: text.attribute?.visible ?? true,\n stroke: (text.attribute as ArcLabelAttrs)?.line?.stroke ?? text.attribute?.fill,\n lineWidth: 1,\n points: (text.attribute as ArcLabelAttrs)?.points\n }) as Line)\n : undefined;\n const relatedGraphic = this._idToGraphic.get((text.attribute as LabelItem).id);\n const state = prevTextMap?.get(relatedGraphic) ? 'update' : 'enter';\n\n if (state === 'enter') {\n texts.push(text);\n currentTextMap.set(relatedGraphic, labelLine ? { text, labelLine } : { text });\n if (!disableAnimation && relatedGraphic) {\n const { from, to } = getAnimationAttributes(text.attribute, 'fadeIn');\n this.add(text);\n if (labelLine) {\n this.add(labelLine);\n }\n relatedGraphic.onAnimateBind = () => {\n text.setAttributes(from);\n const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, {\n mode,\n duration,\n easing,\n to,\n delay\n });\n relatedGraphic.on('afterAttributeUpdate', listener);\n };\n } else {\n this.add(text);\n if (labelLine) {\n this.add(labelLine);\n }\n }\n }\n\n if (state === 'update') {\n const prevLabel = prevTextMap.get(relatedGraphic);\n prevTextMap.delete(relatedGraphic);\n currentTextMap.set(relatedGraphic, prevLabel);\n if (!disableAnimation) {\n const prevText = prevLabel.text;\n prevText.animate().to(text.attribute, duration, easing);\n if (prevLabel.labelLine) {\n prevLabel.labelLine.animate().to(\n merge({}, prevLabel.labelLine.attribute, {\n points: (text.attribute as ArcLabelAttrs)?.points\n }),\n duration,\n easing\n );\n }\n if (\n animationConfig.increaseEffect !== false &&\n prevText.attribute.text !== text.attribute.text &&\n isValidNumber(Number(prevText.attribute.text) * Number(text.attribute.text))\n ) {\n prevText\n .animate()\n .play(\n new IncreaseCount(\n { text: prevText.attribute.text as string },\n { text: text.attribute.text as string },\n duration,\n easing\n )\n );\n }\n } else {\n prevLabel.text.setAttributes(text.attribute);\n if (prevLabel?.labelLine) {\n prevLabel.labelLine.setAttributes({ points: (text.attribute as ArcLabelAttrs)?.points });\n }\n }\n }\n });\n prevTextMap.forEach(label => {\n if (disableAnimation) {\n this.removeChild(label.text);\n if (label?.labelLine) {\n this.removeChild(label.labelLine);\n }\n } else {\n label.text\n ?.animate()\n .to(getAnimationAttributes(label.text.attribute, 'fadeOut').to, duration, easing)\n .onEnd(() => {\n this.removeChild(label.text);\n if (label?.labelLine) {\n this.removeChild(label.labelLine);\n }\n });\n }\n });\n\n this._graphicToText = currentTextMap;\n }\n\n protected _afterRelatedGraphicAttributeUpdate(\n text: IText,\n texts: IText[],\n index: number,\n relatedGraphic: IGraphic,\n { mode, duration, easing, to, delay }: ILabelAnimation & { to: any }\n ) {\n const listener = (event: any) => {\n const { detail } = event;\n if (!detail) {\n return {};\n }\n\n const isValidAnimateState =\n detail &&\n detail.type === AttributeUpdateType.ANIMATE_UPDATE &&\n detail.animationState &&\n detail.animationState.step?.type !== 'wait';\n\n if (!isValidAnimateState) {\n return {};\n }\n\n if (detail.type === AttributeUpdateType.ANIMATE_END) {\n text.setAttributes(to);\n return;\n }\n\n const onEnd = () => {\n if (relatedGraphic) {\n relatedGraphic.onAnimateBind = undefined;\n relatedGraphic.removeEventListener('afterAttributeUpdate', listener);\n }\n };\n\n switch (mode) {\n case 'after':\n // 3. 当前关联图元的动画播放结束后\n if (detail.animationState.end) {\n text.animate({ onEnd }).wait(delay).to(to, duration, easing);\n }\n break;\n case 'after-all':\n // 2. 所有完成后才开始;\n if (index === texts.length - 1) {\n if (detail.animationState.end) {\n texts.forEach(t => {\n t.animate({ onEnd }).wait(delay).to(to, duration, easing);\n });\n }\n }\n break;\n case 'same-time':\n default:\n // 1. 与当前关联图元的动画播放同时进行\n if (detail.animationState.isFirstFrameOfStep) {\n text.animate({ onEnd }).wait(delay).to(to, duration, easing);\n }\n break;\n }\n };\n return listener;\n }\n\n protected _smartInvert(labels: IText[]) {\n const option = (this.attribute.smartInvert || {}) as SmartInvertAttrs;\n const { textType, contrastRatiosThreshold, alternativeColors } = option;\n\n for (let i = 0; i < labels.length; i++) {\n const label = labels[i];\n if (!label) {\n continue;\n }\n\n const baseMark = this._idToGraphic.get((label.attribute as LabelItem).id);\n let isInside = canPlaceInside(label.AABBBounds, baseMark?.AABBBounds);\n\n if (this.attribute.type === 'arc') {\n if (this.attribute.position === 'inside') {\n isInside = true;\n } else {\n isInside = false;\n }\n }\n\n /**\n * stroke 的处理逻辑\n * 1. 当文本在图元内部时,有两种情况:\n * - a. 未设置stroke:labelFill为前景色,baseMark填充色为背景色\n * - b. 设置了stroke:labelFill为前景色,labelStroke填充色为背景色\n * 2. 当文本在图元外部时,有两种情况:\n * - a. 未设置stroke:此时设置strokeColor为backgroundColor。labelFill为前景色,labelStroke填充色为背景色。避免文字一半在图元内部,一半在图元外部时,在图元外部文字不可见。\n * - b. 设置了stroke:保持strokeColor。labelFill为前景色,labelStroke填充色为背景色。\n */\n if (label.attribute.stroke && label.attribute.lineWidth > 0) {\n /**\n * 1-b, 2-b\n * 若label存在stroke,label填充色为前景色,label描边色为背景色\n * WCAG 2 字母周围的文本发光/光晕可用作背景颜色\n */\n label.setAttributes({\n fill: labelSmartInvert(\n label.attribute.fill as IColor,\n label.attribute.stroke as IColor,\n textType,\n contrastRatiosThreshold,\n alternativeColors\n )\n });\n } else if (isInside) {\n /**\n * 1-a\n * label在图元内部时,label填充色为前景色,baseMark填充色为背景色\n */\n const backgroundColor = baseMark.attribute.fill as IColor;\n const foregroundColor = label.attribute.fill as IColor;\n label.setAttributes({\n fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)\n });\n } else if (label.attribute.lineWidth > 0) {\n /**\n * 2-a\n * 当文本在图元外部时,设置strokeColor为backgroundColor。labelFill为前景色,labelStroke填充色为背景色。\n */\n const backgroundColor = label.attribute.stroke as IColor;\n const foregroundColor = label.attribute.fill as IColor;\n label.setAttributes({\n stroke: baseMark.attribute.fill,\n fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)\n });\n }\n }\n }\n\n setLocation(point: PointLocationCfg) {\n this.translateTo(point.x, point.y);\n }\n\n disableAnimation() {\n this._enableAnimation = false;\n }\n\n enableAnimation() {\n this._enableAnimation = true;\n }\n}\n"]}
@@ -91,6 +91,7 @@ export interface ArcLabelAttrs extends BaseLabelAttrs {
91
91
  line?: IArcLabelLineSpec;
92
92
  layout?: IArcLabelLayoutSpec;
93
93
  labelLinePath?: string;
94
+ points?: IPoint[];
94
95
  }
95
96
  export interface IArcLabelLineSpec {
96
97
  stroke?: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["label/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n EasingType,\n IGraphic,\n IGroupGraphicAttribute,\n ITextGraphicAttribute,\n Text,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vrender';\n\nexport type LabelItemStateStyle<T> = {\n hover?: T;\n hover_reverse?: T;\n selected?: T;\n selected_reverse?: T;\n};\n\nexport type LabelItem = {\n // 用于动画\n id?: string;\n // 原始数据\n data?: any;\n [key: string]: any;\n} & ITextGraphicAttribute;\n\nexport interface BaseLabelAttrs extends IGroupGraphicAttribute {\n type: string;\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n /**\n * 是否开启选中交互\n * @default false\n */\n select?: boolean;\n /**\n * 是否开启 hover 交互\n * @default false\n */\n hover?: boolean;\n /**\n * 标签数据\n */\n data: LabelItem[];\n\n /** 文本样式,优先级低于 data */\n textStyle?: Partial<ITextGraphicAttribute>;\n\n /** 文本交互样式 */\n state?: LabelItemStateStyle<ITextGraphicAttribute>;\n\n /** 标签默认位置 */\n position?: Functional<string>;\n\n /** 偏移量 */\n offset?: number;\n\n /** 是否开启防重叠\n * @default true\n */\n overlap?: OverlapAttrs | false;\n\n /** 智能反色 */\n smartInvert?: SmartInvertAttrs | false;\n\n /** 动画配置 */\n animation?: ILabelAnimation | false;\n\n // 排序 or 删减\n dataFilter?: (data: LabelItem[]) => LabelItem[];\n\n /** 自定义布局函数\n * @description 当配置了 customLayoutFunc 后,默认布局和防重叠逻辑将不再生效。(overlap/position/offset不生效)\n */\n customLayoutFunc?: (data: LabelItem[], getRelatedGraphic: (data: LabelItem) => IGraphic) => Text[];\n\n /** 自定义标签躲避函数\n * @description 当配置了 customOverlapFunc 后,会根据 position 和 offset 进行初始布局。配置的防重叠逻辑(overlap)不生效。\n */\n customOverlapFunc?: (label: Text[], getRelatedGraphic: (data: LabelItem) => IGraphic) => Text[];\n}\n\nexport interface OverlapAttrs {\n /**\n * 防重叠的区域大小\n */\n size?: { width: number; height: number };\n\n /**\n * 发生重叠后,是否隐藏标签\n * @default true\n */\n hideOnHit?: boolean;\n\n /**\n * 是否约束标签在指定 size 的范围内。开启后若标签被区域裁剪,会向内收缩。\n * @default true\n */\n clampForce?: boolean;\n\n /**\n * 是否躲避基础图元\n * @default false\n */\n avoidBaseMark?: boolean;\n\n /**\n * 躲避指定图元\n * @default []\n */\n avoidMarks?: string[] | IGraphic[];\n\n /**\n * 发生重叠后的躲避策略\n */\n strategy?: Strategy[];\n}\n\nexport interface SmartInvertAttrs {\n /**\n * 文本类型\n * 包含普通文本和大文本,对应不同的对比度标准,label默认为普通文本\n * 'normalText' | 'largeText'\n * @default 'normalText'\n */\n textType?: string;\n /**\n * 自定义对比度阈值\n */\n contrastRatiosThreshold?: number;\n /**\n * 自定义备选label颜色\n */\n alternativeColors?: string | string[];\n}\n\nexport type PositionStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则考虑 position 内的备选位置。\n */\n type: 'position';\n position?: Functional<LabelPosition[]>;\n};\n\nexport type BoundStrategy = {\n /**\n * 标签配置在图形内部时使用。\n * 当图形大小不足以放下标签,则考虑 position 内的备选位置。\n */\n type: 'bound';\n position?: Functional<LabelPosition[]>;\n};\n\nexport type MoveYStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则根据 offset 在Y方向上寻找位置。\n */\n type: 'moveY';\n /**\n * Y方向上的尝试的位置偏移量\n */\n offset: Functional<number[]>;\n};\n\nexport type MoveXStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则根据 offset 在X方向上寻找位置。\n */\n type: 'moveX';\n /**\n * X方向上的尝试的位置偏移量\n */\n offset: Functional<number[]>;\n};\n\nexport type Strategy = PositionStrategy | BoundStrategy | MoveYStrategy | MoveXStrategy;\n\nexport type LabelPosition = SymbolLabelAttrs['position'] | RectLabelAttrs['position'];\n\nexport interface SymbolLabelAttrs extends BaseLabelAttrs {\n type: 'symbol';\n\n /**\n * 标签位置\n * @default 'top'\n */\n position?: Functional<\n 'top' | 'bottom' | 'left' | 'right' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center'\n >;\n}\n\nexport interface RectLabelAttrs extends BaseLabelAttrs {\n type: 'rect';\n\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n\n /**\n * 标签位置\n * @default 'top'\n */\n position?: Functional<\n 'top' | 'bottom' | 'left' | 'right' | 'inside' | 'inside-top' | 'inside-bottom' | 'inside-right' | 'inside-left'\n >;\n}\n\nexport interface LineLabelAttrs extends BaseLabelAttrs {\n type: 'line';\n\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n\n /**\n * 标签位置\n * @default 'end'\n */\n position?: Functional<'start' | 'end'>;\n}\n\nexport interface ArcLabelAttrs extends BaseLabelAttrs {\n type: 'arc';\n\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n\n /**\n * 标签位置\n * @default 'outside'\n */\n position?: Functional<'inside' | 'outside'>;\n\n // 画布宽度\n width?: number;\n // 画布高度\n height?: number;\n\n /**\n * 是否允许标签重叠\n * @default false\n */\n coverEnable?: boolean;\n /**\n * 是否允许标签旋转\n * @default true\n */\n rotate?: boolean;\n\n /**\n * 文字与引导线间隔宽度\n * @default 5\n */\n spaceWidth?: number;\n /**\n * 标签旋转角度\n */\n angle?: number;\n /**\n * 标签横向点对齐\n */\n textAlign?: TextAlignType;\n /**\n * 标签纵向点对齐\n */\n textBaseline?: TextBaselineType;\n /**\n * 扇区间标签的间隔\n * @default 6\n */\n layoutArcGap?: number;\n /** 标签引导线样式 */\n line?: IArcLabelLineSpec;\n /** 标签布局配置 */\n layout?: IArcLabelLayoutSpec;\n /** 标签引导线path */\n labelLinePath?: string;\n}\n\nexport interface IArcLabelLineSpec {\n stroke?: string;\n /**\n * 是否显示引导线\n * @default true\n */\n visible?: boolean;\n /**\n * 引导线 line1 部分最小长度\n * @default 20\n */\n line1MinLength?: number;\n /**\n * 引导线 line2 部分最小长度\n * @default 10\n */\n line2MinLength?: number;\n}\n\nexport type ArcLabelAlignType = 'arc' | 'labelLine' | 'edge';\n\nexport type ArcLabelStrategyType = 'priority' | 'vertical' | 'none';\n\nexport interface IArcLabelLayoutSpec {\n /**\n * 标签对齐方式\n * @default 'arc'\n */\n textAlign?: ArcLabelAlignType;\n /** @deprecate 建议统一使用textAlign,后续将废除 */\n align?: ArcLabelAlignType;\n /**\n * 标签布局策略\n * @default 'priority'\n */\n strategy?: ArcLabelStrategyType;\n /**\n * 是否启用切线约束\n * @default true\n */\n tangentConstraint?: boolean;\n}\n\nexport interface DataLabelAttrs extends IGroupGraphicAttribute {\n dataLabels: (RectLabelAttrs | SymbolLabelAttrs | ArcLabelAttrs)[];\n /**\n * 防重叠的区域大小\n */\n size: { width: number; height: number };\n}\n\nexport type Functional<T> = T | ((data: any) => T);\n\nexport interface ILabelAnimation {\n mode?: 'same-time' | 'after' | 'after-all';\n duration?: number;\n delay?: number;\n easing?: EasingType;\n /** 是否开启 increaseCount 动画\n * @default true\n */\n increaseEffect?: boolean;\n}\n\nexport interface IPoint {\n x: number;\n y: number;\n}\n\nexport interface IPolarPoint {\n radius: number;\n angle: number;\n}\n\nexport type Quadrant = 1 | 2 | 3 | 4;\n\nexport type TextAlign = 'left' | 'right' | 'center';\n"]}
1
+ {"version":3,"sources":["label/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n EasingType,\n IGraphic,\n IGroupGraphicAttribute,\n ITextGraphicAttribute,\n Text,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vrender';\n\nexport type LabelItemStateStyle<T> = {\n hover?: T;\n hover_reverse?: T;\n selected?: T;\n selected_reverse?: T;\n};\n\nexport type LabelItem = {\n // 用于动画\n id?: string;\n // 原始数据\n data?: any;\n [key: string]: any;\n} & ITextGraphicAttribute;\n\nexport interface BaseLabelAttrs extends IGroupGraphicAttribute {\n type: string;\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n /**\n * 是否开启选中交互\n * @default false\n */\n select?: boolean;\n /**\n * 是否开启 hover 交互\n * @default false\n */\n hover?: boolean;\n /**\n * 标签数据\n */\n data: LabelItem[];\n\n /** 文本样式,优先级低于 data */\n textStyle?: Partial<ITextGraphicAttribute>;\n\n /** 文本交互样式 */\n state?: LabelItemStateStyle<ITextGraphicAttribute>;\n\n /** 标签默认位置 */\n position?: Functional<string>;\n\n /** 偏移量 */\n offset?: number;\n\n /** 是否开启防重叠\n * @default true\n */\n overlap?: OverlapAttrs | false;\n\n /** 智能反色 */\n smartInvert?: SmartInvertAttrs | false;\n\n /** 动画配置 */\n animation?: ILabelAnimation | false;\n\n // 排序 or 删减\n dataFilter?: (data: LabelItem[]) => LabelItem[];\n\n /** 自定义布局函数\n * @description 当配置了 customLayoutFunc 后,默认布局和防重叠逻辑将不再生效。(overlap/position/offset不生效)\n */\n customLayoutFunc?: (data: LabelItem[], getRelatedGraphic: (data: LabelItem) => IGraphic) => Text[];\n\n /** 自定义标签躲避函数\n * @description 当配置了 customOverlapFunc 后,会根据 position 和 offset 进行初始布局。配置的防重叠逻辑(overlap)不生效。\n */\n customOverlapFunc?: (label: Text[], getRelatedGraphic: (data: LabelItem) => IGraphic) => Text[];\n}\n\nexport interface OverlapAttrs {\n /**\n * 防重叠的区域大小\n */\n size?: { width: number; height: number };\n\n /**\n * 发生重叠后,是否隐藏标签\n * @default true\n */\n hideOnHit?: boolean;\n\n /**\n * 是否约束标签在指定 size 的范围内。开启后若标签被区域裁剪,会向内收缩。\n * @default true\n */\n clampForce?: boolean;\n\n /**\n * 是否躲避基础图元\n * @default false\n */\n avoidBaseMark?: boolean;\n\n /**\n * 躲避指定图元\n * @default []\n */\n avoidMarks?: string[] | IGraphic[];\n\n /**\n * 发生重叠后的躲避策略\n */\n strategy?: Strategy[];\n}\n\nexport interface SmartInvertAttrs {\n /**\n * 文本类型\n * 包含普通文本和大文本,对应不同的对比度标准,label默认为普通文本\n * 'normalText' | 'largeText'\n * @default 'normalText'\n */\n textType?: string;\n /**\n * 自定义对比度阈值\n */\n contrastRatiosThreshold?: number;\n /**\n * 自定义备选label颜色\n */\n alternativeColors?: string | string[];\n}\n\nexport type PositionStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则考虑 position 内的备选位置。\n */\n type: 'position';\n position?: Functional<LabelPosition[]>;\n};\n\nexport type BoundStrategy = {\n /**\n * 标签配置在图形内部时使用。\n * 当图形大小不足以放下标签,则考虑 position 内的备选位置。\n */\n type: 'bound';\n position?: Functional<LabelPosition[]>;\n};\n\nexport type MoveYStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则根据 offset 在Y方向上寻找位置。\n */\n type: 'moveY';\n /**\n * Y方向上的尝试的位置偏移量\n */\n offset: Functional<number[]>;\n};\n\nexport type MoveXStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则根据 offset 在X方向上寻找位置。\n */\n type: 'moveX';\n /**\n * X方向上的尝试的位置偏移量\n */\n offset: Functional<number[]>;\n};\n\nexport type Strategy = PositionStrategy | BoundStrategy | MoveYStrategy | MoveXStrategy;\n\nexport type LabelPosition = SymbolLabelAttrs['position'] | RectLabelAttrs['position'];\n\nexport interface SymbolLabelAttrs extends BaseLabelAttrs {\n type: 'symbol';\n\n /**\n * 标签位置\n * @default 'top'\n */\n position?: Functional<\n 'top' | 'bottom' | 'left' | 'right' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center'\n >;\n}\n\nexport interface RectLabelAttrs extends BaseLabelAttrs {\n type: 'rect';\n\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n\n /**\n * 标签位置\n * @default 'top'\n */\n position?: Functional<\n 'top' | 'bottom' | 'left' | 'right' | 'inside' | 'inside-top' | 'inside-bottom' | 'inside-right' | 'inside-left'\n >;\n}\n\nexport interface LineLabelAttrs extends BaseLabelAttrs {\n type: 'line';\n\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n\n /**\n * 标签位置\n * @default 'end'\n */\n position?: Functional<'start' | 'end'>;\n}\n\nexport interface ArcLabelAttrs extends BaseLabelAttrs {\n type: 'arc';\n\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n\n /**\n * 标签位置\n * @default 'outside'\n */\n position?: Functional<'inside' | 'outside'>;\n\n // 画布宽度\n width?: number;\n // 画布高度\n height?: number;\n\n /**\n * 是否允许标签重叠\n * @default false\n */\n coverEnable?: boolean;\n /**\n * 是否允许标签旋转\n * @default true\n */\n rotate?: boolean;\n\n /**\n * 文字与引导线间隔宽度\n * @default 5\n */\n spaceWidth?: number;\n /**\n * 标签旋转角度\n */\n angle?: number;\n /**\n * 标签横向点对齐\n */\n textAlign?: TextAlignType;\n /**\n * 标签纵向点对齐\n */\n textBaseline?: TextBaselineType;\n /**\n * 扇区间标签的间隔\n * @default 6\n */\n layoutArcGap?: number;\n /** 标签引导线样式 */\n line?: IArcLabelLineSpec;\n /** 标签布局配置 */\n layout?: IArcLabelLayoutSpec;\n /** 标签引导线path */\n labelLinePath?: string;\n /** 标签引导线点集 */\n points?: IPoint[];\n}\n\nexport interface IArcLabelLineSpec {\n stroke?: string;\n /**\n * 是否显示引导线\n * @default true\n */\n visible?: boolean;\n /**\n * 引导线 line1 部分最小长度\n * @default 20\n */\n line1MinLength?: number;\n /**\n * 引导线 line2 部分最小长度\n * @default 10\n */\n line2MinLength?: number;\n}\n\nexport type ArcLabelAlignType = 'arc' | 'labelLine' | 'edge';\n\nexport type ArcLabelStrategyType = 'priority' | 'vertical' | 'none';\n\nexport interface IArcLabelLayoutSpec {\n /**\n * 标签对齐方式\n * @default 'arc'\n */\n textAlign?: ArcLabelAlignType;\n /** @deprecate 建议统一使用textAlign,后续将废除 */\n align?: ArcLabelAlignType;\n /**\n * 标签布局策略\n * @default 'priority'\n */\n strategy?: ArcLabelStrategyType;\n /**\n * 是否启用切线约束\n * @default true\n */\n tangentConstraint?: boolean;\n}\n\nexport interface DataLabelAttrs extends IGroupGraphicAttribute {\n dataLabels: (RectLabelAttrs | SymbolLabelAttrs | ArcLabelAttrs)[];\n /**\n * 防重叠的区域大小\n */\n size: { width: number; height: number };\n}\n\nexport type Functional<T> = T | ((data: any) => T);\n\nexport interface ILabelAnimation {\n mode?: 'same-time' | 'after' | 'after-all';\n duration?: number;\n delay?: number;\n easing?: EasingType;\n /** 是否开启 increaseCount 动画\n * @default true\n */\n increaseEffect?: boolean;\n}\n\nexport interface IPoint {\n x: number;\n y: number;\n}\n\nexport interface IPolarPoint {\n radius: number;\n angle: number;\n}\n\nexport type Quadrant = 1 | 2 | 3 | 4;\n\nexport type TextAlign = 'left' | 'right' | 'center';\n"]}
package/dist/index.js CHANGED
@@ -1710,7 +1710,7 @@
1710
1710
  x: basedArc.labelPosition.x,
1711
1711
  y: basedArc.labelPosition.y,
1712
1712
  angle: (_a = this.attribute.angle) !== null && _a !== void 0 ? _a : basedArc.angle,
1713
- labelLinePath: basedArc.labelLinePath
1713
+ points: [basedArc.pointA, basedArc.pointB, basedArc.pointC]
1714
1714
  };
1715
1715
  labels[i].setAttributes(labelAttribute);
1716
1716
  }
@@ -1846,12 +1846,12 @@
1846
1846
  const texts = [];
1847
1847
  labels.forEach((text, index) => {
1848
1848
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1849
- const labelLine = ((_a = text.attribute) === null || _a === void 0 ? void 0 : _a.labelLinePath)
1850
- ? vrender.createPath({
1849
+ const labelLine = ((_a = text.attribute) === null || _a === void 0 ? void 0 : _a.points)
1850
+ ? vrender.createLine({
1851
1851
  visible: (_c = (_b = text.attribute) === null || _b === void 0 ? void 0 : _b.visible) !== null && _c !== void 0 ? _c : true,
1852
1852
  stroke: (_f = (_e = (_d = text.attribute) === null || _d === void 0 ? void 0 : _d.line) === null || _e === void 0 ? void 0 : _e.stroke) !== null && _f !== void 0 ? _f : (_g = text.attribute) === null || _g === void 0 ? void 0 : _g.fill,
1853
1853
  lineWidth: 1,
1854
- path: (_h = text.attribute) === null || _h === void 0 ? void 0 : _h.labelLinePath
1854
+ points: (_h = text.attribute) === null || _h === void 0 ? void 0 : _h.points
1855
1855
  })
1856
1856
  : undefined;
1857
1857
  const relatedGraphic = this._idToGraphic.get(text.attribute.id);
@@ -1892,9 +1892,9 @@
1892
1892
  const prevText = prevLabel.text;
1893
1893
  prevText.animate().to(text.attribute, duration, easing);
1894
1894
  if (prevLabel.labelLine) {
1895
- prevLabel.labelLine
1896
- .animate()
1897
- .to(vutils.merge({}, prevLabel.labelLine.attribute, { path: (_j = text.attribute) === null || _j === void 0 ? void 0 : _j.labelLinePath }), duration, easing);
1895
+ prevLabel.labelLine.animate().to(vutils.merge({}, prevLabel.labelLine.attribute, {
1896
+ points: (_j = text.attribute) === null || _j === void 0 ? void 0 : _j.points
1897
+ }), duration, easing);
1898
1898
  }
1899
1899
  if (animationConfig.increaseEffect !== false &&
1900
1900
  prevText.attribute.text !== text.attribute.text &&
@@ -1907,7 +1907,7 @@
1907
1907
  else {
1908
1908
  prevLabel.text.setAttributes(text.attribute);
1909
1909
  if (prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.labelLine) {
1910
- prevLabel.labelLine.setAttributes({ path: (_k = text.attribute) === null || _k === void 0 ? void 0 : _k.labelLinePath });
1910
+ prevLabel.labelLine.setAttributes({ points: (_k = text.attribute) === null || _k === void 0 ? void 0 : _k.points });
1911
1911
  }
1912
1912
  }
1913
1913
  }
@@ -9964,7 +9964,7 @@
9964
9964
  }
9965
9965
  Tooltip.defaultAttributes = defaultAttributes;
9966
9966
 
9967
- const version = "0.14.2";
9967
+ const version = "0.14.3-alpha.9";
9968
9968
 
9969
9969
  exports.AbstractComponent = AbstractComponent;
9970
9970
  exports.ArcInfo = ArcInfo;