@visactor/vrender-components 0.17.5-alpha.1 → 0.17.6

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.
Files changed (53) hide show
  1. package/cjs/index.d.ts +1 -1
  2. package/cjs/index.js +1 -1
  3. package/cjs/index.js.map +1 -1
  4. package/cjs/label/base.js +1 -1
  5. package/cjs/label/base.js.map +1 -1
  6. package/cjs/poptip/index.d.ts +2 -1
  7. package/cjs/poptip/index.js +9 -5
  8. package/cjs/poptip/index.js.map +1 -1
  9. package/cjs/poptip/module.d.ts +3 -0
  10. package/cjs/poptip/module.js +21 -0
  11. package/cjs/poptip/module.js.map +1 -0
  12. package/cjs/poptip/poptip-plugin.js +1 -1
  13. package/cjs/poptip/poptip-plugin.js.map +1 -1
  14. package/cjs/poptip/poptip.js.map +1 -1
  15. package/cjs/poptip/register.d.ts +0 -3
  16. package/cjs/poptip/register.js +3 -15
  17. package/cjs/poptip/register.js.map +1 -1
  18. package/cjs/scrollbar/module.d.ts +3 -0
  19. package/cjs/scrollbar/module.js +17 -0
  20. package/cjs/scrollbar/module.js.map +1 -0
  21. package/cjs/scrollbar/register.d.ts +0 -3
  22. package/cjs/scrollbar/register.js +3 -10
  23. package/cjs/scrollbar/register.js.map +1 -1
  24. package/cjs/util/label-smartInvert.js +5 -11
  25. package/cjs/util/label-smartInvert.js.map +1 -1
  26. package/dist/index.js +345 -551
  27. package/dist/index.min.js +1 -1
  28. package/es/index.d.ts +1 -1
  29. package/es/index.js +1 -1
  30. package/es/index.js.map +1 -1
  31. package/es/label/base.js +1 -1
  32. package/es/label/base.js.map +1 -1
  33. package/es/poptip/index.d.ts +2 -1
  34. package/es/poptip/index.js +3 -1
  35. package/es/poptip/index.js.map +1 -1
  36. package/es/poptip/module.d.ts +3 -0
  37. package/es/poptip/module.js +17 -0
  38. package/es/poptip/module.js.map +1 -0
  39. package/es/poptip/poptip-plugin.js +1 -1
  40. package/es/poptip/poptip-plugin.js.map +1 -1
  41. package/es/poptip/poptip.js.map +1 -1
  42. package/es/poptip/register.d.ts +0 -3
  43. package/es/poptip/register.js +0 -17
  44. package/es/poptip/register.js.map +1 -1
  45. package/es/scrollbar/module.d.ts +3 -0
  46. package/es/scrollbar/module.js +12 -0
  47. package/es/scrollbar/module.js.map +1 -0
  48. package/es/scrollbar/register.d.ts +0 -3
  49. package/es/scrollbar/register.js +0 -12
  50. package/es/scrollbar/register.js.map +1 -1
  51. package/es/util/label-smartInvert.js +3 -9
  52. package/es/util/label-smartInvert.js.map +1 -1
  53. package/package.json +5 -5
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.17.5-alpha.1";
1
+ export declare const version = "0.17.6";
2
2
  export * from './core/base';
3
3
  export * from './scrollbar';
4
4
  export * from './tag';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.17.5-alpha.1";
1
+ export const version = "0.17.6";
2
2
 
3
3
  export * from "./core/base";
4
4
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.17.5-alpha.1\";\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 './axis/grid';\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';\nexport * from './jsx';\nexport * from './checkbox';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.17.6\";\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 './axis/grid';\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';\nexport * from './jsx';\nexport * from './checkbox';\n"]}
package/es/label/base.js CHANGED
@@ -256,7 +256,7 @@ export class LabelBase extends AbstractComponent {
256
256
  }), relatedGraphic) {
257
257
  const {from: from, to: to} = getAnimationAttributes(text.attribute, "fadeIn");
258
258
  this.add(text), labelLine && (this._setStatesOfLabelLine(labelLine), labelLines.push(labelLine),
259
- this.add(labelLine)), this._syncStateWithRelatedGraphic(relatedGraphic), relatedGraphic.once("animate-bind", (a => {
259
+ this.add(labelLine)), this._syncStateWithRelatedGraphic(relatedGraphic), this._animationConfig.enter.duration > 0 && relatedGraphic.once("animate-bind", (a => {
260
260
  text.setAttributes(from), labelLine && labelLine.setAttributes(from);
261
261
  const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, labelLine, labelLines, index, relatedGraphic, to, this._animationConfig.enter);
262
262
  relatedGraphic.on("afterAttributeUpdate", listener);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/label/base.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhG,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClH,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChH,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,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C,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;;AAv3BM,2BAAiB,GAA4B;IAClD,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QAIZ,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,QAAQ;QACtB,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;KAC9B;IACD,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,KAAK;CAChB,CAAC","file":"base.js","sourcesContent":["/**\n * @description Label 基类\n */\nimport type {\n IGroup,\n Text,\n IGraphic,\n IText,\n FederatedPointerEvent,\n IColor,\n ILine,\n IArea,\n IRichTextGraphicAttribute,\n IRichText,\n IRichTextCharacter,\n ITextAttribute\n} from '@visactor/vrender-core';\nimport { graphicCreator, AttributeUpdateType, IContainPointMode } from '@visactor/vrender-core';\nimport type { IAABBBounds, IBoundsLike, IPointLike } from '@visactor/vutils';\nimport { isFunction, isEmpty, isValid, isString, merge, isRectIntersect, isNil, isArray } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { PointLocationCfg } from '../core/type';\nimport { labelSmartInvert, contrastAccessibilityChecker, smartInvertStrategy } from '../util/label-smartInvert';\nimport { getMarksByName, getNoneGroupMarksByName, traverseGroup } from '../util';\nimport { StateValue } from '../constant';\nimport type { Bitmap } from './overlap';\nimport { bitmapTool, boundToRange, canPlace, clampText, place } from './overlap';\nimport type {\n BaseLabelAttrs,\n OverlapAttrs,\n ILabelAnimation,\n ArcLabelAttrs,\n LabelItem,\n SmartInvertAttrs,\n ILabelEnterAnimation,\n ILabelExitAnimation,\n ILabelUpdateAnimation\n} from './type';\nimport { DefaultLabelAnimation, getAnimationAttributes, updateAnimation } from './animate/animate';\nimport { getPointsOfLineArea } from './util';\nimport type { ComponentOptions } from '../interface';\nimport { DEFAULT_HTML_TEXT_SPEC } from '../constant';\nimport { loadLabelComponent } from './register';\n\nloadLabelComponent();\nexport class LabelBase<T extends BaseLabelAttrs> extends AbstractComponent<T> {\n name = 'label';\n\n protected _baseMarks?: IGraphic[];\n\n protected _isCollectionBase: boolean;\n\n protected _bitmap?: Bitmap;\n\n protected _animationConfig?: {\n enter: ILabelEnterAnimation;\n exit: ILabelExitAnimation;\n update: ILabelUpdateAnimation;\n };\n\n static defaultAttributes: Partial<BaseLabelAttrs> = {\n textStyle: {\n fontSize: 12,\n // FIXME: we need a default color. Yet in current logic, textStyle will override fill from baseMark.\n // This need a new config option like `colorFull`\n // fill: '#000',\n textAlign: 'center',\n textBaseline: 'middle',\n boundsPadding: [-1, 0, -1, 0] // to ignore the textBound buf\n },\n offset: 0,\n pickable: false\n };\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 | IRichText; labelLine?: ILine }>;\n\n protected _idToGraphic: Map<string, IGraphic>;\n\n protected _idToPoint: Map<string, IPointLike>;\n\n onAfterLabelOverlap?: (bitmap: Bitmap) => void;\n\n private _lastHover: IGraphic;\n private _lastSelect: IGraphic;\n\n private _enableAnimation: boolean;\n\n constructor(attributes: BaseLabelAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, LabelBase.defaultAttributes, attributes));\n }\n\n /**\n * 计算 text 的最终位置属性x, y\n * @param textBounds\n * @param graphicBounds\n * @param position\n * @param offset\n * @returns\n */\n protected labeling(\n textBounds: IBoundsLike,\n graphicBounds: IBoundsLike,\n position?: BaseLabelAttrs['position'],\n offset?: number\n ): { x: number; y: number } | undefined {\n // 基类没有指定的图元类型,需要在 data 中指定位置,故无需进行 labeling\n return;\n }\n\n protected _labelLine(text: LabelItem): ILine | undefined {\n // 基类没有指定的图元类型,需要在 data 中指定位置,故无需进行 labeling\n return;\n }\n\n protected render() {\n this._prepare();\n\n if (isNil(this._idToGraphic) || (this._isCollectionBase && isNil(this._idToPoint))) {\n return;\n }\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 | IRichText)[];\n\n if (isFunction(customLayoutFunc)) {\n labels = customLayoutFunc(\n data,\n this.getRelatedGrphic,\n this._isCollectionBase ? (d: LabelItem) => this._idToPoint.get(d.id) : null\n );\n } else {\n // 根据关联图元和配置的position计算标签坐标\n labels = this._layout(data);\n }\n\n if (isFunction(customOverlapFunc)) {\n labels = customOverlapFunc(\n labels as Text[],\n this.getRelatedGrphic,\n this._isCollectionBase ? (d: LabelItem) => this._idToPoint.get(d.id) : null\n );\n } else {\n // 防重叠逻辑\n if (overlap !== false) {\n labels = this._overlapping(labels);\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 (this.attribute.disableTriggerEvent) {\n return;\n }\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 _setStatesOfText(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 _setStatesOfLabelLine(target: IGraphic) {\n if (!target) {\n return;\n }\n const state = this.attribute.labelLineState;\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 protected _createLabelText(attributes: LabelItem) {\n if (attributes.textType === 'rich') {\n attributes.textConfig = attributes.text as IRichTextCharacter[];\n attributes.width = attributes.width ?? 0;\n attributes.height = attributes.height ?? 0;\n const text = graphicCreator.richtext(attributes as any);\n this._bindEvent(text);\n this._setStatesOfText(text);\n return text;\n } else if (attributes.textType === 'html') {\n attributes.textConfig = [] as IRichTextCharacter[];\n attributes.html = {\n dom: attributes.text as string,\n ...DEFAULT_HTML_TEXT_SPEC,\n ...attributes\n };\n const text = graphicCreator.richtext(attributes as IRichTextGraphicAttribute);\n this._bindEvent(text);\n this._setStatesOfText(text);\n return text;\n }\n const text = graphicCreator.text(attributes);\n this._bindEvent(text);\n this._setStatesOfText(text);\n return text;\n }\n\n private _prepare() {\n const currentBaseMarks: IGraphic[] = [];\n let baseMarks;\n if (isFunction(this.attribute.getBaseMarks)) {\n baseMarks = this.attribute.getBaseMarks();\n } else {\n baseMarks = getMarksByName(this.getRootNode() as IGroup, this.attribute.baseMarkGroupName);\n }\n\n baseMarks.forEach(mark => {\n if ((mark as any).releaseStatus !== 'willRelease') {\n currentBaseMarks.push(mark);\n }\n });\n\n this._idToGraphic?.clear();\n this._idToPoint?.clear();\n this._baseMarks = currentBaseMarks;\n this._isCollectionBase = this.attribute.type === 'line-data';\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 if (!this._idToGraphic) {\n this._idToGraphic = new Map();\n }\n\n // generate id mapping before data filter\n if (this._isCollectionBase) {\n if (!this._idToPoint) {\n this._idToPoint = new Map();\n }\n let cur = 0;\n for (let i = 0; i < currentBaseMarks.length; i++) {\n const baseMark = currentBaseMarks[i];\n const points = getPointsOfLineArea(baseMark as ILine | IArea);\n\n if (points?.length) {\n for (let j = 0; j < points.length; j++) {\n const textData = data[cur];\n if (textData && points[j]) {\n if (!isValid(textData.id)) {\n textData.id = `vrender-component-${this.name}-${cur}`;\n }\n this._idToPoint.set(textData.id, points[j]);\n this._idToGraphic.set(textData.id, baseMark);\n }\n\n cur++;\n }\n }\n }\n } else {\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 if (this.attribute.animation !== false) {\n this._animationConfig = {\n enter: merge({}, DefaultLabelAnimation, this.attribute.animation, this.attribute.animationEnter ?? {}),\n exit: merge({}, DefaultLabelAnimation, this.attribute.animation, this.attribute.animationExit ?? {}),\n update: isArray(this.attribute.animationUpdate)\n ? this.attribute.animationUpdate\n : merge({}, DefaultLabelAnimation, this.attribute.animation, this.attribute.animationUpdate ?? {})\n };\n }\n }\n\n protected getRelatedGrphic(item: LabelItem) {\n return this._idToGraphic.get(item.id);\n }\n\n protected _layout(data: LabelItem[] = []): (IText | IRichText)[] {\n const { textStyle = {}, position, offset } = this.attribute;\n const labels = [];\n\n for (let i = 0; i < data.length; i++) {\n const textData = data[i];\n const baseMark = this.getRelatedGrphic(textData);\n\n const labelAttribute = {\n fill: this._isCollectionBase\n ? isArray(baseMark.attribute.stroke)\n ? baseMark.attribute.stroke.find(entry => !!entry && entry !== true)\n : baseMark.attribute.stroke\n : baseMark.attribute.fill,\n ...textStyle,\n ...textData\n };\n const text = this._createLabelText(labelAttribute);\n const textBounds = this.getGraphicBounds(text);\n const actualPosition = isFunction(position) ? position(textData) : (position as string);\n\n const graphicBounds = this._isCollectionBase\n ? this.getGraphicBounds(null, this._idToPoint.get(textData.id), actualPosition)\n : this.getGraphicBounds(baseMark, { x: textData.x as number, y: textData.y as number }, actualPosition);\n\n const textLocation = this.labeling(textBounds, graphicBounds, actualPosition, offset);\n\n if (textLocation) {\n labelAttribute.x = textLocation.x;\n labelAttribute.y = textLocation.y;\n text.setAttributes(textLocation);\n }\n\n labels.push(text);\n }\n\n return labels;\n }\n\n protected _overlapping(labels: (IText | IRichText)[]) {\n if (labels.length === 0) {\n return [];\n }\n const option = this.attribute.overlap as OverlapAttrs;\n\n const result: (IText | IRichText)[] = [];\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 {\n avoidBaseMark,\n strategy = [],\n hideOnHit = true,\n clampForce = true,\n avoidMarks = [],\n overlapPadding\n } = 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\n const text = labels[i] as IText | IRichText;\n const baseMark = this.getRelatedGrphic(text.attribute);\n text.update();\n if (!isRectIntersect(baseMark.AABBBounds, { x1: 0, x2: bmpTool.width, y1: 0, y2: bmpTool.height }, true)) {\n continue;\n }\n\n // 默认位置可以放置\n if (canPlace(bmpTool, bitmap, text.AABBBounds, clampForce, overlapPadding)) {\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 && this._canPlaceInside(text.AABBBounds, baseMark?.AABBBounds)) {\n bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));\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._isCollectionBase\n ? this.getGraphicBounds(null, this._idToPoint.get((labels[i].attribute as any).id))\n : this.getGraphicBounds(baseMark, labels[i].attribute),\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 // 向内挤压不考虑 overlapPadding\n const { dx = 0, dy = 0 } = clampText(text as IText, bmpTool.width, bmpTool.height);\n if (dx === 0 && dy === 0) {\n if (canPlace(bmpTool, bitmap, text.AABBBounds)) {\n // xy方向偏移都为0,意味着不考虑 overlapPadding 时,实际上可以放得下\n bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));\n result.push(text);\n continue;\n }\n } else if (\n canPlace(\n bmpTool,\n bitmap,\n {\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 // 向内 clamp 只处理超出的位移量,不叠加 overlapPadding\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>, position?: string): IBoundsLike;\n protected getGraphicBounds(graphic?: IGraphic, point: Partial<PointLocationCfg> = {}): IBoundsLike {\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 | IRichText)[]) {\n const disableAnimation = this._enableAnimation === false || this.attribute.animation === false;\n\n if (disableAnimation) {\n this._renderWithOutAnimation(labels);\n } else {\n this._renderWithAnimation(labels);\n }\n }\n\n protected _renderWithAnimation(labels: (IText | IRichText)[]) {\n const currentTextMap: Map<any, { text: IText | IRichText; labelLine?: ILine }> = new Map();\n const prevTextMap: Map<any, { text: IText | IRichText; labelLine?: ILine }> = this._graphicToText || new Map();\n const texts = [] as (IText | IRichText)[];\n const labelLines = [] as ILine[];\n\n labels.forEach((text, index) => {\n const labelLine: ILine = this._labelLine(text as any);\n const relatedGraphic = this.getRelatedGrphic(text.attribute);\n const textId = (text.attribute as LabelItem).id;\n const textKey = this._isCollectionBase ? textId : relatedGraphic;\n const state = prevTextMap?.get(textKey) ? 'update' : 'enter';\n\n // TODO: add animate\n if (state === 'enter') {\n texts.push(text);\n currentTextMap.set(textKey, labelLine ? { text, labelLine } : { text });\n if (relatedGraphic) {\n const { from, to } = getAnimationAttributes(text.attribute, 'fadeIn');\n this.add(text);\n\n if (labelLine) {\n this._setStatesOfLabelLine(labelLine);\n labelLines.push(labelLine);\n this.add(labelLine);\n }\n\n this._syncStateWithRelatedGraphic(relatedGraphic);\n relatedGraphic.once('animate-bind', a => {\n // text和labelLine共用一个from\n text.setAttributes(from);\n labelLine && labelLine.setAttributes(from);\n const listener = this._afterRelatedGraphicAttributeUpdate(\n text,\n texts,\n labelLine,\n labelLines,\n index,\n relatedGraphic,\n to,\n this._animationConfig.enter\n );\n relatedGraphic.on('afterAttributeUpdate', listener);\n });\n }\n } else if (state === 'update') {\n const prevLabel = prevTextMap.get(textKey);\n prevTextMap.delete(textKey);\n currentTextMap.set(textKey, prevLabel);\n const prevText = prevLabel.text;\n const { duration, easing } = this._animationConfig.update;\n updateAnimation(prevText as Text, text as Text, this._animationConfig.update);\n if (prevLabel.labelLine) {\n prevLabel.labelLine.animate().to(\n merge({}, prevLabel.labelLine.attribute, {\n visible:\n ((text.attribute as ArcLabelAttrs)?.line?.visible && text.attribute?.visible) ??\n text.attribute?.visible ??\n true,\n points: (text.attribute as ArcLabelAttrs)?.points\n }),\n duration,\n easing\n );\n }\n }\n });\n prevTextMap.forEach(label => {\n label.text\n ?.animate()\n .to(\n getAnimationAttributes(label.text.attribute, 'fadeOut').to,\n this._animationConfig.exit.duration,\n this._animationConfig.exit.easing\n )\n .onEnd(() => {\n this.removeChild(label.text);\n if (label?.labelLine) {\n this.removeChild(label.labelLine);\n }\n });\n });\n\n this._graphicToText = currentTextMap;\n }\n\n protected _renderWithOutAnimation(labels: (IText | IRichText)[]) {\n const currentTextMap: Map<any, { text: IText | IRichText; labelLine?: ILine }> = new Map();\n const prevTextMap: Map<any, { text: IText | IRichText; labelLine?: ILine }> = this._graphicToText || new Map();\n const texts = [] as (IText | IRichText)[];\n\n labels.forEach(text => {\n const labelLine = this._labelLine(text as any);\n const relatedGraphic = this.getRelatedGrphic(text.attribute);\n const state = prevTextMap?.get(relatedGraphic) ? 'update' : 'enter';\n const textKey = this._isCollectionBase ? (text.attribute as LabelItem).id : relatedGraphic;\n\n if (state === 'enter') {\n texts.push(text);\n currentTextMap.set(textKey, labelLine ? { text, labelLine } : { text });\n this.add(text);\n if (labelLine) {\n this.add(labelLine);\n }\n\n this._syncStateWithRelatedGraphic(relatedGraphic);\n } else if (state === 'update') {\n const prevLabel = prevTextMap.get(textKey);\n prevTextMap.delete(textKey);\n currentTextMap.set(textKey, prevLabel);\n prevLabel.text.setAttributes(text.attribute as any);\n if (prevLabel?.labelLine) {\n prevLabel.labelLine.setAttributes({ points: (text.attribute as ArcLabelAttrs)?.points });\n }\n }\n });\n\n prevTextMap.forEach(label => {\n this.removeChild(label.text);\n if (label?.labelLine) {\n this.removeChild(label.labelLine);\n }\n });\n\n this._graphicToText = currentTextMap;\n }\n\n protected _handleRelatedGraphicSetState = (e: any) => {\n if (e.detail?.type === AttributeUpdateType.STATE) {\n const currentStates = e.target?.currentStates ?? [];\n const labels = this._isCollectionBase ? [...this._graphicToText.values()] : [this._graphicToText.get(e.target)];\n\n labels.forEach(label => {\n if (label) {\n if (label.text) {\n label.text.useStates(currentStates);\n }\n\n if (label.labelLine) {\n label.labelLine.useStates(currentStates);\n }\n }\n });\n }\n };\n\n protected _syncStateWithRelatedGraphic(relatedGraphic: IGraphic) {\n if (this.attribute.syncState) {\n relatedGraphic.on('afterAttributeUpdate', this._handleRelatedGraphicSetState);\n }\n }\n\n // 默认labelLine和text共用相同动画属性\n protected _afterRelatedGraphicAttributeUpdate(\n text: IText | IRichText,\n texts: (IText | IRichText)[],\n labelLine: ILine,\n labelLines: ILine[],\n index: number,\n relatedGraphic: IGraphic,\n to: any,\n { mode, duration, easing, delay }: ILabelAnimation\n ) {\n // TODO: 跟随动画\n const listener = (event: any) => {\n const { detail } = event;\n if (!detail) {\n return {};\n }\n const step = detail.animationState?.step;\n const isValidAnimateState =\n detail.type === AttributeUpdateType.ANIMATE_UPDATE &&\n step &&\n // 不是第一个wait\n !(step.type === 'wait' && step.prev?.type == null);\n\n if (!isValidAnimateState) {\n return {};\n }\n // const prevStep = step.prev;\n // if (prevStep && prevStep.type === 'wait' && prevStep.prev?.type == null) {\n // delay = delay ?? step.position;\n // }\n if (detail.type === AttributeUpdateType.ANIMATE_END) {\n text.setAttributes(to);\n labelLine && labelLine.setAttributes(to);\n return;\n }\n\n const onStart = () => {\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({ onStart }).wait(delay).to(to, duration, easing);\n labelLine && labelLine.animate().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({ onStart }).wait(delay).to(to, duration, easing);\n });\n labelLines.forEach(t => {\n t.animate().wait(delay).to(to, duration, easing);\n });\n }\n }\n break;\n case 'same-time':\n default:\n if (this._isCollectionBase) {\n const point = this._idToPoint.get((text.attribute as LabelItem).id);\n if (\n point &&\n (!text.animates || !text.animates.has('label-animate')) &&\n relatedGraphic.containsPoint(point.x, point.y, IContainPointMode.LOCAL, this.stage?.pickerService)\n ) {\n text.animate({ onStart }).wait(delay).to(to, duration, easing);\n labelLine && labelLine.animate().wait(delay).to(to, duration, easing);\n }\n } else if (detail.animationState.isFirstFrameOfStep) {\n text.animate({ onStart }).wait(delay).to(to, duration, easing);\n labelLine && labelLine.animate().wait(delay).to(to, duration, easing);\n }\n\n break;\n }\n };\n return listener;\n }\n\n protected _smartInvert(labels: (IText | IRichText)[]) {\n const option = (this.attribute.smartInvert || {}) as SmartInvertAttrs;\n const { textType, contrastRatiosThreshold, alternativeColors, mode } = option;\n const fillStrategy = option.fillStrategy ?? 'invertBase';\n const strokeStrategy = option.strokeStrategy ?? 'base';\n const brightColor = option.brightColor ?? '#ffffff';\n const darkColor = option.darkColor ?? '#000000';\n const outsideEnable = option.outsideEnable ?? false;\n\n if (fillStrategy === 'null' && strokeStrategy === 'null') {\n return;\n }\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.getRelatedGrphic(label.attribute as LabelItem);\n\n /**\n * 增加smartInvert时fillStrategy和 strokeStrategy的四种策略:\n * base(baseMark色),\n * inverBase(执行智能反色),\n * similarBase(智能反色的补色),\n * null(不执行智能反色,保持fill设置的颜色)\n * */\n const backgroundColor = baseMark.attribute.fill as IColor;\n const foregroundColor = label.attribute.fill as IColor;\n const baseColor = backgroundColor;\n const invertColor = labelSmartInvert(\n foregroundColor,\n backgroundColor,\n textType,\n contrastRatiosThreshold,\n alternativeColors,\n mode\n );\n const similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;\n\n if (outsideEnable) {\n const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);\n fill && label.setAttributes({ fill });\n\n if (label.attribute.lineWidth === 0) {\n continue;\n }\n\n const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);\n stroke && label.setAttributes({ stroke });\n } else {\n const isInside = this._canPlaceInside(label.AABBBounds, baseMark?.AABBBounds);\n if (isInside) {\n const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);\n fill && label.setAttributes({ fill });\n\n if (label.attribute.lineWidth === 0) {\n continue;\n }\n\n const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);\n stroke && label.setAttributes({ stroke });\n } else {\n /** 当label无法设置stroke时,不进行反色计算(容易反色为白色与白色背景混合不可见) */\n if (label.attribute.lineWidth === 0) {\n continue;\n }\n\n /** 当label设置stroke时,保留stroke设置的颜色,根据stroke对fill做反色 */\n if (label.attribute.stroke) {\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 mode\n )\n });\n continue;\n }\n\n /** 当label未设置stroke,且可设置stroke时,正常计算 */\n const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);\n fill && label.setAttributes({ fill });\n\n const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);\n stroke && label.setAttributes({ stroke });\n }\n }\n }\n }\n\n /**\n * 是否在图形内部\n * @param textBound\n * @param shapeBound\n * @returns\n */\n protected _canPlaceInside(textBound: IBoundsLike, shapeBound: IAABBBounds) {\n if (!textBound || !shapeBound) {\n return false;\n }\n return shapeBound.encloses(textBound);\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":["../src/label/base.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhG,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClH,OAAO,EAAE,iBAAi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,eAAe,CAAC,SAAsB,EAAE,UAAuB;QACvE,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU,EAAE;YAC7B,OAAO,KAAK,CAAC;SACd;QACD,OAAO,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxC,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;;AAz3BM,2BAAiB,GAA4B;IAClD,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QAIZ,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,QAAQ;QACtB,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;KAC9B;IACD,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,KAAK;CAChB,CAAC","file":"base.js","sourcesContent":["/**\n * @description Label 基类\n */\nimport type {\n IGroup,\n Text,\n IGraphic,\n IText,\n FederatedPointerEvent,\n IColor,\n ILine,\n IArea,\n IRichTextGraphicAttribute,\n IRichText,\n IRichTextCharacter,\n ITextAttribute\n} from '@visactor/vrender-core';\nimport { graphicCreator, AttributeUpdateType, IContainPointMode } from '@visactor/vrender-core';\nimport type { IAABBBounds, IBoundsLike, IPointLike } from '@visactor/vutils';\nimport { isFunction, isEmpty, isValid, isString, merge, isRectIntersect, isNil, isArray } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { PointLocationCfg } from '../core/type';\nimport { labelSmartInvert, contrastAccessibilityChecker, smartInvertStrategy } from '../util/label-smartInvert';\nimport { getMarksByName, getNoneGroupMarksByName, traverseGroup } from '../util';\nimport { StateValue } from '../constant';\nimport type { Bitmap } from './overlap';\nimport { bitmapTool, boundToRange, canPlace, clampText, place } from './overlap';\nimport type {\n BaseLabelAttrs,\n OverlapAttrs,\n ILabelAnimation,\n ArcLabelAttrs,\n LabelItem,\n SmartInvertAttrs,\n ILabelEnterAnimation,\n ILabelExitAnimation,\n ILabelUpdateAnimation\n} from './type';\nimport { DefaultLabelAnimation, getAnimationAttributes, updateAnimation } from './animate/animate';\nimport { getPointsOfLineArea } from './util';\nimport type { ComponentOptions } from '../interface';\nimport { DEFAULT_HTML_TEXT_SPEC } from '../constant';\nimport { loadLabelComponent } from './register';\n\nloadLabelComponent();\nexport class LabelBase<T extends BaseLabelAttrs> extends AbstractComponent<T> {\n name = 'label';\n\n protected _baseMarks?: IGraphic[];\n\n protected _isCollectionBase: boolean;\n\n protected _bitmap?: Bitmap;\n\n protected _animationConfig?: {\n enter: ILabelEnterAnimation;\n exit: ILabelExitAnimation;\n update: ILabelUpdateAnimation;\n };\n\n static defaultAttributes: Partial<BaseLabelAttrs> = {\n textStyle: {\n fontSize: 12,\n // FIXME: we need a default color. Yet in current logic, textStyle will override fill from baseMark.\n // This need a new config option like `colorFull`\n // fill: '#000',\n textAlign: 'center',\n textBaseline: 'middle',\n boundsPadding: [-1, 0, -1, 0] // to ignore the textBound buf\n },\n offset: 0,\n pickable: false\n };\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 | IRichText; labelLine?: ILine }>;\n\n protected _idToGraphic: Map<string, IGraphic>;\n\n protected _idToPoint: Map<string, IPointLike>;\n\n onAfterLabelOverlap?: (bitmap: Bitmap) => void;\n\n private _lastHover: IGraphic;\n private _lastSelect: IGraphic;\n\n private _enableAnimation: boolean;\n\n constructor(attributes: BaseLabelAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, LabelBase.defaultAttributes, attributes));\n }\n\n /**\n * 计算 text 的最终位置属性x, y\n * @param textBounds\n * @param graphicBounds\n * @param position\n * @param offset\n * @returns\n */\n protected labeling(\n textBounds: IBoundsLike,\n graphicBounds: IBoundsLike,\n position?: BaseLabelAttrs['position'],\n offset?: number\n ): { x: number; y: number } | undefined {\n // 基类没有指定的图元类型,需要在 data 中指定位置,故无需进行 labeling\n return;\n }\n\n protected _labelLine(text: LabelItem): ILine | undefined {\n // 基类没有指定的图元类型,需要在 data 中指定位置,故无需进行 labeling\n return;\n }\n\n protected render() {\n this._prepare();\n\n if (isNil(this._idToGraphic) || (this._isCollectionBase && isNil(this._idToPoint))) {\n return;\n }\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 | IRichText)[];\n\n if (isFunction(customLayoutFunc)) {\n labels = customLayoutFunc(\n data,\n this.getRelatedGrphic,\n this._isCollectionBase ? (d: LabelItem) => this._idToPoint.get(d.id) : null\n );\n } else {\n // 根据关联图元和配置的position计算标签坐标\n labels = this._layout(data);\n }\n\n if (isFunction(customOverlapFunc)) {\n labels = customOverlapFunc(\n labels as Text[],\n this.getRelatedGrphic,\n this._isCollectionBase ? (d: LabelItem) => this._idToPoint.get(d.id) : null\n );\n } else {\n // 防重叠逻辑\n if (overlap !== false) {\n labels = this._overlapping(labels);\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 (this.attribute.disableTriggerEvent) {\n return;\n }\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 _setStatesOfText(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 _setStatesOfLabelLine(target: IGraphic) {\n if (!target) {\n return;\n }\n const state = this.attribute.labelLineState;\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 protected _createLabelText(attributes: LabelItem) {\n if (attributes.textType === 'rich') {\n attributes.textConfig = attributes.text as IRichTextCharacter[];\n attributes.width = attributes.width ?? 0;\n attributes.height = attributes.height ?? 0;\n const text = graphicCreator.richtext(attributes as any);\n this._bindEvent(text);\n this._setStatesOfText(text);\n return text;\n } else if (attributes.textType === 'html') {\n attributes.textConfig = [] as IRichTextCharacter[];\n attributes.html = {\n dom: attributes.text as string,\n ...DEFAULT_HTML_TEXT_SPEC,\n ...attributes\n };\n const text = graphicCreator.richtext(attributes as IRichTextGraphicAttribute);\n this._bindEvent(text);\n this._setStatesOfText(text);\n return text;\n }\n const text = graphicCreator.text(attributes);\n this._bindEvent(text);\n this._setStatesOfText(text);\n return text;\n }\n\n private _prepare() {\n const currentBaseMarks: IGraphic[] = [];\n let baseMarks;\n if (isFunction(this.attribute.getBaseMarks)) {\n baseMarks = this.attribute.getBaseMarks();\n } else {\n baseMarks = getMarksByName(this.getRootNode() as IGroup, this.attribute.baseMarkGroupName);\n }\n\n baseMarks.forEach(mark => {\n if ((mark as any).releaseStatus !== 'willRelease') {\n currentBaseMarks.push(mark);\n }\n });\n\n this._idToGraphic?.clear();\n this._idToPoint?.clear();\n this._baseMarks = currentBaseMarks;\n this._isCollectionBase = this.attribute.type === 'line-data';\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 if (!this._idToGraphic) {\n this._idToGraphic = new Map();\n }\n\n // generate id mapping before data filter\n if (this._isCollectionBase) {\n if (!this._idToPoint) {\n this._idToPoint = new Map();\n }\n let cur = 0;\n for (let i = 0; i < currentBaseMarks.length; i++) {\n const baseMark = currentBaseMarks[i];\n const points = getPointsOfLineArea(baseMark as ILine | IArea);\n\n if (points?.length) {\n for (let j = 0; j < points.length; j++) {\n const textData = data[cur];\n if (textData && points[j]) {\n if (!isValid(textData.id)) {\n textData.id = `vrender-component-${this.name}-${cur}`;\n }\n this._idToPoint.set(textData.id, points[j]);\n this._idToGraphic.set(textData.id, baseMark);\n }\n\n cur++;\n }\n }\n }\n } else {\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 if (this.attribute.animation !== false) {\n this._animationConfig = {\n enter: merge({}, DefaultLabelAnimation, this.attribute.animation, this.attribute.animationEnter ?? {}),\n exit: merge({}, DefaultLabelAnimation, this.attribute.animation, this.attribute.animationExit ?? {}),\n update: isArray(this.attribute.animationUpdate)\n ? this.attribute.animationUpdate\n : merge({}, DefaultLabelAnimation, this.attribute.animation, this.attribute.animationUpdate ?? {})\n };\n }\n }\n\n protected getRelatedGrphic(item: LabelItem) {\n return this._idToGraphic.get(item.id);\n }\n\n protected _layout(data: LabelItem[] = []): (IText | IRichText)[] {\n const { textStyle = {}, position, offset } = this.attribute;\n const labels = [];\n\n for (let i = 0; i < data.length; i++) {\n const textData = data[i];\n const baseMark = this.getRelatedGrphic(textData);\n\n const labelAttribute = {\n fill: this._isCollectionBase\n ? isArray(baseMark.attribute.stroke)\n ? baseMark.attribute.stroke.find(entry => !!entry && entry !== true)\n : baseMark.attribute.stroke\n : baseMark.attribute.fill,\n ...textStyle,\n ...textData\n };\n const text = this._createLabelText(labelAttribute);\n const textBounds = this.getGraphicBounds(text);\n const actualPosition = isFunction(position) ? position(textData) : (position as string);\n\n const graphicBounds = this._isCollectionBase\n ? this.getGraphicBounds(null, this._idToPoint.get(textData.id), actualPosition)\n : this.getGraphicBounds(baseMark, { x: textData.x as number, y: textData.y as number }, actualPosition);\n\n const textLocation = this.labeling(textBounds, graphicBounds, actualPosition, offset);\n\n if (textLocation) {\n labelAttribute.x = textLocation.x;\n labelAttribute.y = textLocation.y;\n text.setAttributes(textLocation);\n }\n\n labels.push(text);\n }\n\n return labels;\n }\n\n protected _overlapping(labels: (IText | IRichText)[]) {\n if (labels.length === 0) {\n return [];\n }\n const option = this.attribute.overlap as OverlapAttrs;\n\n const result: (IText | IRichText)[] = [];\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 {\n avoidBaseMark,\n strategy = [],\n hideOnHit = true,\n clampForce = true,\n avoidMarks = [],\n overlapPadding\n } = 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\n const text = labels[i] as IText | IRichText;\n const baseMark = this.getRelatedGrphic(text.attribute);\n text.update();\n if (!isRectIntersect(baseMark.AABBBounds, { x1: 0, x2: bmpTool.width, y1: 0, y2: bmpTool.height }, true)) {\n continue;\n }\n\n // 默认位置可以放置\n if (canPlace(bmpTool, bitmap, text.AABBBounds, clampForce, overlapPadding)) {\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 && this._canPlaceInside(text.AABBBounds, baseMark?.AABBBounds)) {\n bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));\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._isCollectionBase\n ? this.getGraphicBounds(null, this._idToPoint.get((labels[i].attribute as any).id))\n : this.getGraphicBounds(baseMark, labels[i].attribute),\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 // 向内挤压不考虑 overlapPadding\n const { dx = 0, dy = 0 } = clampText(text as IText, bmpTool.width, bmpTool.height);\n if (dx === 0 && dy === 0) {\n if (canPlace(bmpTool, bitmap, text.AABBBounds)) {\n // xy方向偏移都为0,意味着不考虑 overlapPadding 时,实际上可以放得下\n bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));\n result.push(text);\n continue;\n }\n } else if (\n canPlace(\n bmpTool,\n bitmap,\n {\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 // 向内 clamp 只处理超出的位移量,不叠加 overlapPadding\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>, position?: string): IBoundsLike;\n protected getGraphicBounds(graphic?: IGraphic, point: Partial<PointLocationCfg> = {}): IBoundsLike {\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 | IRichText)[]) {\n const disableAnimation = this._enableAnimation === false || this.attribute.animation === false;\n\n if (disableAnimation) {\n this._renderWithOutAnimation(labels);\n } else {\n this._renderWithAnimation(labels);\n }\n }\n\n protected _renderWithAnimation(labels: (IText | IRichText)[]) {\n const currentTextMap: Map<any, { text: IText | IRichText; labelLine?: ILine }> = new Map();\n const prevTextMap: Map<any, { text: IText | IRichText; labelLine?: ILine }> = this._graphicToText || new Map();\n const texts = [] as (IText | IRichText)[];\n const labelLines = [] as ILine[];\n\n labels.forEach((text, index) => {\n const labelLine: ILine = this._labelLine(text as any);\n const relatedGraphic = this.getRelatedGrphic(text.attribute);\n const textId = (text.attribute as LabelItem).id;\n const textKey = this._isCollectionBase ? textId : relatedGraphic;\n const state = prevTextMap?.get(textKey) ? 'update' : 'enter';\n\n // TODO: add animate\n if (state === 'enter') {\n texts.push(text);\n currentTextMap.set(textKey, labelLine ? { text, labelLine } : { text });\n if (relatedGraphic) {\n const { from, to } = getAnimationAttributes(text.attribute, 'fadeIn');\n this.add(text);\n\n if (labelLine) {\n this._setStatesOfLabelLine(labelLine);\n labelLines.push(labelLine);\n this.add(labelLine);\n }\n\n this._syncStateWithRelatedGraphic(relatedGraphic);\n // enter的时长如果不是大于0,那么直接跳过动画\n this._animationConfig.enter.duration > 0 &&\n relatedGraphic.once('animate-bind', a => {\n // text和labelLine共用一个from\n text.setAttributes(from);\n labelLine && labelLine.setAttributes(from);\n const listener = this._afterRelatedGraphicAttributeUpdate(\n text,\n texts,\n labelLine,\n labelLines,\n index,\n relatedGraphic,\n to,\n this._animationConfig.enter\n );\n relatedGraphic.on('afterAttributeUpdate', listener);\n });\n }\n } else if (state === 'update') {\n const prevLabel = prevTextMap.get(textKey);\n prevTextMap.delete(textKey);\n currentTextMap.set(textKey, prevLabel);\n const prevText = prevLabel.text;\n const { duration, easing } = this._animationConfig.update;\n updateAnimation(prevText as Text, text as Text, this._animationConfig.update);\n if (prevLabel.labelLine) {\n prevLabel.labelLine.animate().to(\n merge({}, prevLabel.labelLine.attribute, {\n visible:\n ((text.attribute as ArcLabelAttrs)?.line?.visible && text.attribute?.visible) ??\n text.attribute?.visible ??\n true,\n points: (text.attribute as ArcLabelAttrs)?.points\n }),\n duration,\n easing\n );\n }\n }\n });\n prevTextMap.forEach(label => {\n label.text\n ?.animate()\n .to(\n getAnimationAttributes(label.text.attribute, 'fadeOut').to,\n this._animationConfig.exit.duration,\n this._animationConfig.exit.easing\n )\n .onEnd(() => {\n this.removeChild(label.text);\n if (label?.labelLine) {\n this.removeChild(label.labelLine);\n }\n });\n });\n\n this._graphicToText = currentTextMap;\n }\n\n protected _renderWithOutAnimation(labels: (IText | IRichText)[]) {\n const currentTextMap: Map<any, { text: IText | IRichText; labelLine?: ILine }> = new Map();\n const prevTextMap: Map<any, { text: IText | IRichText; labelLine?: ILine }> = this._graphicToText || new Map();\n const texts = [] as (IText | IRichText)[];\n\n labels.forEach(text => {\n const labelLine = this._labelLine(text as any);\n const relatedGraphic = this.getRelatedGrphic(text.attribute);\n const state = prevTextMap?.get(relatedGraphic) ? 'update' : 'enter';\n const textKey = this._isCollectionBase ? (text.attribute as LabelItem).id : relatedGraphic;\n\n if (state === 'enter') {\n texts.push(text);\n currentTextMap.set(textKey, labelLine ? { text, labelLine } : { text });\n this.add(text);\n if (labelLine) {\n this.add(labelLine);\n }\n\n this._syncStateWithRelatedGraphic(relatedGraphic);\n } else if (state === 'update') {\n const prevLabel = prevTextMap.get(textKey);\n prevTextMap.delete(textKey);\n currentTextMap.set(textKey, prevLabel);\n prevLabel.text.setAttributes(text.attribute as any);\n if (prevLabel?.labelLine) {\n prevLabel.labelLine.setAttributes({ points: (text.attribute as ArcLabelAttrs)?.points });\n }\n }\n });\n\n prevTextMap.forEach(label => {\n this.removeChild(label.text);\n if (label?.labelLine) {\n this.removeChild(label.labelLine);\n }\n });\n\n this._graphicToText = currentTextMap;\n }\n\n protected _handleRelatedGraphicSetState = (e: any) => {\n if (e.detail?.type === AttributeUpdateType.STATE) {\n const currentStates = e.target?.currentStates ?? [];\n const labels = this._isCollectionBase ? [...this._graphicToText.values()] : [this._graphicToText.get(e.target)];\n\n labels.forEach(label => {\n if (label) {\n if (label.text) {\n label.text.useStates(currentStates);\n }\n\n if (label.labelLine) {\n label.labelLine.useStates(currentStates);\n }\n }\n });\n }\n };\n\n protected _syncStateWithRelatedGraphic(relatedGraphic: IGraphic) {\n if (this.attribute.syncState) {\n relatedGraphic.on('afterAttributeUpdate', this._handleRelatedGraphicSetState);\n }\n }\n\n // 默认labelLine和text共用相同动画属性\n protected _afterRelatedGraphicAttributeUpdate(\n text: IText | IRichText,\n texts: (IText | IRichText)[],\n labelLine: ILine,\n labelLines: ILine[],\n index: number,\n relatedGraphic: IGraphic,\n to: any,\n { mode, duration, easing, delay }: ILabelAnimation\n ) {\n // TODO: 跟随动画\n const listener = (event: any) => {\n const { detail } = event;\n if (!detail) {\n return {};\n }\n const step = detail.animationState?.step;\n const isValidAnimateState =\n detail.type === AttributeUpdateType.ANIMATE_UPDATE &&\n step &&\n // 不是第一个wait\n !(step.type === 'wait' && step.prev?.type == null);\n\n if (!isValidAnimateState) {\n return {};\n }\n // const prevStep = step.prev;\n // if (prevStep && prevStep.type === 'wait' && prevStep.prev?.type == null) {\n // delay = delay ?? step.position;\n // }\n if (detail.type === AttributeUpdateType.ANIMATE_END) {\n text.setAttributes(to);\n labelLine && labelLine.setAttributes(to);\n return;\n }\n\n const onStart = () => {\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({ onStart }).wait(delay).to(to, duration, easing);\n labelLine && labelLine.animate().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({ onStart }).wait(delay).to(to, duration, easing);\n });\n labelLines.forEach(t => {\n t.animate().wait(delay).to(to, duration, easing);\n });\n }\n }\n break;\n case 'same-time':\n default:\n if (this._isCollectionBase) {\n const point = this._idToPoint.get((text.attribute as LabelItem).id);\n if (\n point &&\n (!text.animates || !text.animates.has('label-animate')) &&\n relatedGraphic.containsPoint(point.x, point.y, IContainPointMode.LOCAL, this.stage?.pickerService)\n ) {\n text.animate({ onStart }).wait(delay).to(to, duration, easing);\n labelLine && labelLine.animate().wait(delay).to(to, duration, easing);\n }\n } else if (detail.animationState.isFirstFrameOfStep) {\n text.animate({ onStart }).wait(delay).to(to, duration, easing);\n labelLine && labelLine.animate().wait(delay).to(to, duration, easing);\n }\n\n break;\n }\n };\n return listener;\n }\n\n protected _smartInvert(labels: (IText | IRichText)[]) {\n const option = (this.attribute.smartInvert || {}) as SmartInvertAttrs;\n const { textType, contrastRatiosThreshold, alternativeColors, mode } = option;\n const fillStrategy = option.fillStrategy ?? 'invertBase';\n const strokeStrategy = option.strokeStrategy ?? 'base';\n const brightColor = option.brightColor ?? '#ffffff';\n const darkColor = option.darkColor ?? '#000000';\n const outsideEnable = option.outsideEnable ?? false;\n\n if (fillStrategy === 'null' && strokeStrategy === 'null') {\n return;\n }\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.getRelatedGrphic(label.attribute as LabelItem);\n\n /**\n * 增加smartInvert时fillStrategy和 strokeStrategy的四种策略:\n * base(baseMark色),\n * inverBase(执行智能反色),\n * similarBase(智能反色的补色),\n * null(不执行智能反色,保持fill设置的颜色)\n * */\n const backgroundColor = baseMark.attribute.fill as IColor;\n const foregroundColor = label.attribute.fill as IColor;\n const baseColor = backgroundColor;\n const invertColor = labelSmartInvert(\n foregroundColor,\n backgroundColor,\n textType,\n contrastRatiosThreshold,\n alternativeColors,\n mode\n );\n const similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;\n\n if (outsideEnable) {\n const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);\n fill && label.setAttributes({ fill });\n\n if (label.attribute.lineWidth === 0) {\n continue;\n }\n\n const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);\n stroke && label.setAttributes({ stroke });\n } else {\n const isInside = this._canPlaceInside(label.AABBBounds, baseMark?.AABBBounds);\n if (isInside) {\n const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);\n fill && label.setAttributes({ fill });\n\n if (label.attribute.lineWidth === 0) {\n continue;\n }\n\n const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);\n stroke && label.setAttributes({ stroke });\n } else {\n /** 当label无法设置stroke时,不进行反色计算(容易反色为白色与白色背景混合不可见) */\n if (label.attribute.lineWidth === 0) {\n continue;\n }\n\n /** 当label设置stroke时,保留stroke设置的颜色,根据stroke对fill做反色 */\n if (label.attribute.stroke) {\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 mode\n )\n });\n continue;\n }\n\n /** 当label未设置stroke,且可设置stroke时,正常计算 */\n const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);\n fill && label.setAttributes({ fill });\n\n const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);\n stroke && label.setAttributes({ stroke });\n }\n }\n }\n }\n\n /**\n * 是否在图形内部\n * @param textBound\n * @param shapeBound\n * @returns\n */\n protected _canPlaceInside(textBound: IBoundsLike, shapeBound: IAABBBounds) {\n if (!textBound || !shapeBound) {\n return false;\n }\n return shapeBound.encloses(textBound);\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,3 +1,4 @@
1
1
  export * from './poptip';
2
2
  export * from './type';
3
- export { loadPoptip, setPoptipTheme } from './register';
3
+ export { setPoptipTheme } from './register';
4
+ export { loadPoptip } from './module';
@@ -2,5 +2,7 @@ export * from "./poptip";
2
2
 
3
3
  export * from "./type";
4
4
 
5
- export { loadPoptip, setPoptipTheme } from "./register";
5
+ export { setPoptipTheme } from "./register";
6
+
7
+ export { loadPoptip } from "./module";
6
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC","file":"index.js","sourcesContent":["export * from './poptip';\nexport * from './type';\nexport { loadPoptip, setPoptipTheme } from './register';\n"]}
1
+ {"version":3,"sources":["../src/poptip/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC","file":"index.js","sourcesContent":["export * from './poptip';\nexport * from './type';\nexport { setPoptipTheme } from './register';\nexport { loadPoptip } from './module';\n"]}
@@ -0,0 +1,3 @@
1
+ import { ContainerModule } from '@visactor/vrender-core';
2
+ export declare const popTipModule: ContainerModule;
3
+ export declare function loadPoptip(): void;
@@ -0,0 +1,17 @@
1
+ import { InteractiveSubRenderContribution, AutoEnablePlugins, ContainerModule, container } from "@visactor/vrender-core";
2
+
3
+ import { PopTipRenderContribution } from "./contribution";
4
+
5
+ import { PopTipPlugin, PopTipForClipedTextPlugin } from "./poptip-plugin";
6
+
7
+ export const popTipModule = new ContainerModule(((bind, unbind, isBound, rebind) => {
8
+ isBound(PopTipRenderContribution) || (bind(PopTipRenderContribution).toSelf().inSingletonScope(),
9
+ bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution)), isBound(PopTipPlugin) || (bind(PopTipPlugin).toSelf(),
10
+ bind(AutoEnablePlugins).toService(PopTipPlugin)), isBound(PopTipForClipedTextPlugin) || (bind(PopTipForClipedTextPlugin).toSelf(),
11
+ bind(AutoEnablePlugins).toService(PopTipForClipedTextPlugin));
12
+ }));
13
+
14
+ export function loadPoptip() {
15
+ container.load(popTipModule);
16
+ }
17
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/poptip/module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,iBAAiB,EACjB,eAAe,EACf,SAAS,EACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAChF,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,EAAE;QACtC,IAAI,CAAC,wBAAwB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QAC3D,IAAI,CAAC,gCAAgC,CAAC,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;KAC5E;IACD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QAC1B,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;KACjD;IACD,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,EAAE;QACvC,IAAI,CAAC,yBAAyB,CAAC,CAAC,MAAM,EAAE,CAAC;QACzC,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;KAC9D;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,UAAU;IACxB,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAC/B,CAAC","file":"module.js","sourcesContent":["import {\n InteractiveSubRenderContribution,\n AutoEnablePlugins,\n ContainerModule,\n container\n} from '@visactor/vrender-core';\nimport { PopTipRenderContribution } from './contribution';\nimport { PopTipPlugin, PopTipForClipedTextPlugin } from './poptip-plugin';\n\nexport const popTipModule = new ContainerModule((bind, unbind, isBound, rebind) => {\n if (!isBound(PopTipRenderContribution)) {\n bind(PopTipRenderContribution).toSelf().inSingletonScope();\n bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution);\n }\n if (!isBound(PopTipPlugin)) {\n bind(PopTipPlugin).toSelf();\n bind(AutoEnablePlugins).toService(PopTipPlugin);\n }\n if (!isBound(PopTipForClipedTextPlugin)) {\n bind(PopTipForClipedTextPlugin).toSelf();\n bind(AutoEnablePlugins).toService(PopTipForClipedTextPlugin);\n }\n});\n\nexport function loadPoptip() {\n container.load(popTipModule);\n}\n"]}
@@ -47,7 +47,7 @@ let PopTipForClipedTextPlugin = class {
47
47
  e.target === stage && this.unpoptip(e);
48
48
  }, this.poptip = e => {
49
49
  const graphic = e.target;
50
- if ("text" !== graphic.type || !graphic.cliped || graphic.isContainer || !graphic.attribute) return void this.unpoptip(e);
50
+ if ("text" !== graphic.type || !graphic.cliped || graphic.isContainer || !graphic.attribute || graphic.attribute.disableAutoClipedPoptip) return void this.unpoptip(e);
51
51
  if (graphic === this.activeGraphic) return;
52
52
  const {poptip: poptip = {}} = graphic.attribute;
53
53
  poptip && (graphic.setAttributes({}), graphic._showPoptip = 1), this.activeGraphic && (this.activeGraphic.setAttributes({}),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/poptip-plugin.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAA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,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC;IAwCD,gBAAgB,CAAC,OAAmB,EAAE,QAAkB;QACtD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAE7B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;IAC7C,CAAC;IAED,UAAU,CAAC,OAAuB;QAChC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QACrC,KAAK,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,KAAK,CAAC,mBAAmB,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AAjEY,yBAAyB;IADrC,UAAU,EAAE;GACA,yBAAyB,CAiErC;SAjEY,yBAAyB","file":"poptip-plugin.js","sourcesContent":["import type { FederatedPointerEvent, IGraphic, IPlugin, IPluginService } from '@visactor/vrender-core';\nimport { Generator, injectable } from '@visactor/vrender-core';\n\n// _showPoptip: 0-没有,1-添加,2-删除\n\n@injectable()\nexport class PopTipPlugin implements IPlugin {\n name: 'poptip' = 'poptip';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n activeGraphic: IGraphic;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const { stage } = this.pluginService;\n\n stage.addEventListener('pointerover', this.poptip);\n }\n poptip = (e: FederatedPointerEvent) => {\n const graphic = e.target as any;\n if (graphic.isContainer || !graphic.attribute) {\n this.unpoptip(e);\n return;\n }\n // 触发graphic重绘\n if (graphic === this.activeGraphic) {\n return;\n }\n const { poptip } = graphic.attribute;\n if (poptip) {\n graphic.setAttributes({});\n graphic._showPoptip = 1;\n }\n\n if (this.activeGraphic) {\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n }\n // console.log(graphic)\n this.setActiveGraphic(graphic, true);\n };\n\n unpoptip = (e: FederatedPointerEvent) => {\n if (!this.activeGraphic) {\n return;\n }\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n this.setActiveGraphic(null, true);\n };\n\n setActiveGraphic(graphic: any | null, rerender?: boolean) {\n this.activeGraphic = graphic;\n // 触发重绘\n this.pluginService.stage.renderNextFrame();\n }\n\n deactivate(context: IPluginService): void {\n const { stage } = this.pluginService;\n stage.removeEventListener('pointerover', this.poptip);\n }\n}\n\n@injectable()\nexport class PopTipForClipedTextPlugin implements IPlugin {\n name: 'poptipForText' = 'poptipForText';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n activeGraphic: IGraphic;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const { stage } = this.pluginService;\n\n stage.addEventListener('pointerover', this.poptip);\n stage.addEventListener('pointerleave', this.pointerlave);\n }\n pointerlave = (e: any) => {\n const { stage } = this.pluginService;\n if (e.target === stage) {\n this.unpoptip(e);\n }\n };\n poptip = (e: FederatedPointerEvent) => {\n const graphic = e.target as any;\n if (graphic.type !== 'text' || !graphic.cliped || graphic.isContainer || !graphic.attribute) {\n this.unpoptip(e);\n return;\n }\n // 触发graphic重绘\n if (graphic === this.activeGraphic) {\n return;\n }\n const { poptip = {} } = graphic.attribute;\n if (poptip) {\n graphic.setAttributes({});\n graphic._showPoptip = 1;\n }\n // 添加默认poptip\n if (this.activeGraphic) {\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n }\n // console.log(graphic)\n this.setActiveGraphic(graphic, true);\n };\n\n unpoptip = (e: FederatedPointerEvent) => {\n if (!this.activeGraphic) {\n return;\n }\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n this.setActiveGraphic(null, true);\n };\n\n setActiveGraphic(graphic: any | null, rerender?: boolean) {\n this.activeGraphic = graphic;\n // 触发重绘\n this.pluginService.stage.renderNextFrame();\n }\n\n deactivate(context: IPluginService): void {\n const { stage } = this.pluginService;\n stage.removeEventListener('pointerover', this.poptip);\n stage.removeEventListener('pointerleave', this.pointerlave);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/poptip/poptip-plugin.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAKxD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAAlB;QACL,SAAI,GAAa,QAAQ,CAAC;QAC1B,gBAAW,GAAiB,YAAY,CAAC;QAEzC,SAAI,GAAW,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAC9C,QAAG,GAAW,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QASpC,WAAM,GAAG,CAAC,CAAwB,EAAE,EAAE;YACpC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAa,CAAC;YAChC,IAAI,OAAO,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;gBAC7C,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACjB,OAAO;aACR;YAED,IAAI,OAAO,KAAK,IAAI,CAAC,aAAa,EAAE;gBAClC,OAAO;aACR;YACD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC;YACrC,IAAI,MAAM,EAAE;gBACV,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBAC1B,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;aACzB;YAED,IAAI,IAAI,CAAC,aAAa,EAAE;gBACtB,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;gBACrC,IAAI,CAAC,aAAa,CAAC,WAAW,GAAG,CAAC,CAAC;aACpC;YAED,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,CAAwB,EAAE,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QACpC,CAAC,CAAC;IAaJ,CAAC;IA/DC,QAAQ,CAAC,OAAuB;QAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAC7B,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QAErC,KAAK,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC;IA8CD,gBAAgB,CAAC,OAAmB,EAAE,QAAkB;QACtD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;QAE7B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;IAC7C,CAAC;IAED,UAAU,CAAC,OAAuB;QAChC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;QACrC,KAAK,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,KAAK,CAAC,mBAAmB,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AAvEY,yBAAyB;IADrC,UAAU,EAAE;GACA,yBAAyB,CAuErC;SAvEY,yBAAyB","file":"poptip-plugin.js","sourcesContent":["import type { FederatedPointerEvent, IGraphic, IPlugin, IPluginService } from '@visactor/vrender-core';\nimport { Generator, injectable } from '@visactor/vrender-core';\n\n// _showPoptip: 0-没有,1-添加,2-删除\n\n@injectable()\nexport class PopTipPlugin implements IPlugin {\n name: 'poptip' = 'poptip';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n activeGraphic: IGraphic;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const { stage } = this.pluginService;\n\n stage.addEventListener('pointerover', this.poptip);\n }\n poptip = (e: FederatedPointerEvent) => {\n const graphic = e.target as any;\n if (graphic.isContainer || !graphic.attribute) {\n this.unpoptip(e);\n return;\n }\n // 触发graphic重绘\n if (graphic === this.activeGraphic) {\n return;\n }\n const { poptip } = graphic.attribute;\n if (poptip) {\n graphic.setAttributes({});\n graphic._showPoptip = 1;\n }\n\n if (this.activeGraphic) {\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n }\n // console.log(graphic)\n this.setActiveGraphic(graphic, true);\n };\n\n unpoptip = (e: FederatedPointerEvent) => {\n if (!this.activeGraphic) {\n return;\n }\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n this.setActiveGraphic(null, true);\n };\n\n setActiveGraphic(graphic: any | null, rerender?: boolean) {\n this.activeGraphic = graphic;\n // 触发重绘\n this.pluginService.stage.renderNextFrame();\n }\n\n deactivate(context: IPluginService): void {\n const { stage } = this.pluginService;\n stage.removeEventListener('pointerover', this.poptip);\n }\n}\n\n@injectable()\nexport class PopTipForClipedTextPlugin implements IPlugin {\n name: 'poptipForText' = 'poptipForText';\n activeEvent: 'onRegister' = 'onRegister';\n pluginService: IPluginService;\n _uid: number = Generator.GenAutoIncrementId();\n key: string = this.name + this._uid;\n activeGraphic: IGraphic;\n\n activate(context: IPluginService): void {\n this.pluginService = context;\n const { stage } = this.pluginService;\n\n stage.addEventListener('pointerover', this.poptip);\n stage.addEventListener('pointerleave', this.pointerlave);\n }\n pointerlave = (e: any) => {\n const { stage } = this.pluginService;\n if (e.target === stage) {\n this.unpoptip(e);\n }\n };\n poptip = (e: FederatedPointerEvent) => {\n const graphic = e.target as any;\n if (\n graphic.type !== 'text' ||\n !graphic.cliped ||\n graphic.isContainer ||\n !graphic.attribute ||\n graphic.attribute.disableAutoClipedPoptip\n ) {\n this.unpoptip(e);\n return;\n }\n // 触发graphic重绘\n if (graphic === this.activeGraphic) {\n return;\n }\n const { poptip = {} } = graphic.attribute;\n if (poptip) {\n graphic.setAttributes({});\n graphic._showPoptip = 1;\n }\n // 添加默认poptip\n if (this.activeGraphic) {\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n }\n // console.log(graphic)\n this.setActiveGraphic(graphic, true);\n };\n\n unpoptip = (e: FederatedPointerEvent) => {\n if (!this.activeGraphic) {\n return;\n }\n this.activeGraphic.setAttributes({});\n this.activeGraphic._showPoptip = 2;\n this.setActiveGraphic(null, true);\n };\n\n setActiveGraphic(graphic: any | null, rerender?: boolean) {\n this.activeGraphic = graphic;\n // 触发重绘\n this.pluginService.stage.renderNextFrame();\n }\n\n deactivate(context: IPluginService): void {\n const { stage } = this.pluginService;\n stage.removeEventListener('pointerover', this.poptip);\n stage.removeEventListener('pointerleave', this.pointerlave);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/poptip.ts"],"names":[],"mappings":";;;;;;;;;;;AAaA,OAAO,EACL,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,OAAO,EACP,OAAO,EACP,GAAG,EACH,KAAK,EACL,gBAAgB,EAChB,EAAE,EACF,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAc,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,QAAQ,GAAG,IAAI,UAAU,EAAE,CAAC;AAElC,mBAAmB,EAAE,CAAC;AACtB,MAAM,OAAO,MAAO,SAAQ,iBAA6C;IAyBvE,YAAY,UAA4B,EAAE,OAA0B;QAClE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAzB7F,SAAI,GAAG,QAAQ,CAAC;QA2OhB,iBAAY,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,E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GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACzG,KAAK,MAAM;gBACT,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChG,KAAK,IAAI;gBACP,OAAO;oBACL,KAAK,EAAE,EAAE;oBACT,MAAM,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;oBACzC,UAAU,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;iBACjD,CAAC;SACL;IACH,CAAC;;AAzRM,wBAAiB,GAA8B;IACpD,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,eAAe,EAAE,GAAG;IACpB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,EAAE;CACZ,CAAC","file":"poptip.js","sourcesContent":["/**\n * @description PopTip组件\n */\nimport type {\n IGroup,\n IRect,\n ISymbol,\n ISymbolGraphicAttribute,\n IText,\n ITextGraphicAttribute,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vrender-core';\nimport {\n AABBBounds,\n Bounds,\n getRectIntersect,\n isArray,\n isBoolean,\n isEmpty,\n isValid,\n max,\n merge,\n normalizePadding,\n pi,\n rectInsideAnotherRect\n} from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { BackgroundAttributes, ComponentOptions } from '../interface';\nimport type { PopTipAttributes } from './type';\nimport { loadPoptip, loadPoptipComponent } from './register';\n\nconst _tBounds = new AABBBounds();\n\nloadPoptipComponent();\nexport class PopTip extends AbstractComponent<Required<PopTipAttributes>> {\n name = 'poptip';\n\n static defaultAttributes: Partial<PopTipAttributes> = {\n position: 'rt',\n visible: true,\n title: null,\n content: null,\n titleStyle: {\n fontSize: 12,\n fill: '#000',\n textAlign: 'left',\n textBaseline: 'top'\n },\n contentStyle: {\n fontSize: 12,\n fill: '#000',\n textAlign: 'left',\n textBaseline: 'top'\n },\n maxWidthPercent: 0.8,\n space: 8,\n padding: 10\n };\n\n constructor(attributes: PopTipAttributes, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, PopTip.defaultAttributes, attributes));\n }\n\n protected render() {\n const {\n titleStyle = {} as ITextGraphicAttribute,\n position,\n contentStyle = {} as ITextGraphicAttribute,\n panel = {} as BackgroundAttributes & ISymbolGraphicAttribute & { space?: number },\n space = 4,\n minWidth = 0,\n maxWidth = Infinity,\n padding = 4,\n maxWidthPercent,\n visible,\n state,\n dx = 0,\n dy = 0\n } = this.attribute as PopTipAttributes;\n\n let { title = '', content = '' } = this.attribute as PopTipAttributes;\n\n title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title;\n content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;\n\n const parsedPadding = normalizePadding(padding);\n\n const group = this.createOrUpdateChild('poptip-content', { x: 0, y: 0, zIndex: 1 }, 'group') as IGroup;\n\n const maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3];\n\n const titleVisible = isValid(title) && visible !== false;\n const titleAttrs = {\n text: isArray(title) ? title : ([title] as any),\n visible: titleVisible,\n ...titleStyle,\n x: parsedPadding[3],\n y: parsedPadding[0],\n maxLineWidth,\n textAlign: 'left' as TextAlignType,\n textBaseline: 'top' as TextBaselineType\n };\n\n const titleShape = group.createOrUpdateChild('poptip-title', titleAttrs, 'wrapText') as IText;\n if (!isEmpty(state?.title)) {\n titleShape.states = state.title;\n }\n\n const titleBounds = titleShape.AABBBounds;\n const titleHeight = titleBounds.height();\n const titleWidth = titleBounds.width();\n let height = titleHeight + space;\n if (!titleVisible) {\n height = 0;\n }\n\n const contentVisible = isValid(content) && visible !== false;\n const contentAttrs = {\n text: isArray(content) ? content : ([content] as any),\n visible: contentVisible,\n ...contentStyle,\n x: parsedPadding[3],\n y: parsedPadding[0] + height,\n maxLineWidth,\n textAlign: 'left' as TextAlignType,\n textBaseline: 'top' as TextBaselineType\n };\n\n const contentShape = group.createOrUpdateChild('poptip-content', contentAttrs, 'wrapText') as IText;\n if (!isEmpty(state?.content)) {\n contentShape.states = state.content;\n }\n\n const contentBounds = contentShape.AABBBounds;\n const contentHeight = contentBounds.height();\n const contentWidth = contentBounds.width();\n\n if (contentVisible) {\n height += contentHeight;\n }\n\n // 计算整个popTip的宽高\n let popTipWidth = max(\n titleWidth + parsedPadding[1] + parsedPadding[3],\n contentWidth + parsedPadding[1] + parsedPadding[3]\n );\n if (popTipWidth > maxWidth) {\n popTipWidth = maxWidth;\n } else if (popTipWidth < minWidth) {\n popTipWidth = minWidth;\n }\n let poptipHeight = parsedPadding[0] + parsedPadding[2] + height;\n\n // 绘制背景层\n const { visible: bgVisible, ...backgroundStyle } = panel;\n const symbolSize = backgroundStyle.size ?? 12;\n const spaceSize: number | [number, number] = isArray(symbolSize)\n ? [symbolSize[0] + (backgroundStyle.space ?? 0), symbolSize[1] + (backgroundStyle.space ?? 0)]\n : (symbolSize as number) + (backgroundStyle.space ?? 0);\n const lineWidth = backgroundStyle.lineWidth ?? 1;\n const range: [number, number] | undefined = (this as any).stage\n ? [\n (this as any).stage.viewWidth ?? (this as any).stage.width,\n (this as any).stage.viewHeight ?? (this as any).stage.height\n ]\n : undefined;\n\n if (range) {\n // 尝试进行换行\n const b = (this as any).AABBBounds;\n const leftWidth = this.attribute.x ?? b.x1;\n const rightWidth = range[0] - b.x1;\n let maxSpace = Math.max(leftWidth, rightWidth);\n // 减一些buffer,buffer不能超过maxSpace的20%\n const buf = (isArray(symbolSize) ? symbolSize[0] : 12) + 3;\n maxSpace = Math.min(maxSpace - buf, maxSpace * maxWidthPercent);\n // 需要进行换行\n if (maxSpace < popTipWidth) {\n popTipWidth = maxSpace;\n const buf = parsedPadding[1] + parsedPadding[3];\n titleShape.setAttribute('maxLineWidth', maxSpace - buf);\n contentShape.setAttribute('maxLineWidth', maxSpace - buf);\n poptipHeight = parsedPadding[0] + parsedPadding[2];\n if (titleVisible) {\n poptipHeight += titleShape.AABBBounds.height() + space;\n }\n poptipHeight += contentShape.AABBBounds.height();\n }\n }\n\n const layout = position === 'auto';\n // 最多循环this.positionList次\n let maxBBoxI: number;\n let maxBBoxSize: number = -Infinity;\n for (let i = 0; i < this.positionList.length + 1; i++) {\n const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;\n const { angle, offset, rectOffset } = this.getAngleAndOffset(\n p,\n popTipWidth,\n poptipHeight,\n isArray(spaceSize) ? (spaceSize as [number, number]) : [spaceSize, spaceSize - lineWidth]\n );\n if (isBoolean(bgVisible)) {\n const offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;\n const bgSymbol = group.createOrUpdateChild(\n 'poptip-symbol-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: offsetX,\n y: 0,\n strokeBoundsBuffer: -1,\n boundsPadding: -2,\n anchor: [0, 0],\n symbolType: 'arrow2Left',\n angle: angle,\n dx: offset[0],\n dy: offset[1],\n size: symbolSize,\n zIndex: -9\n },\n 'symbol'\n ) as ISymbol;\n if (!isEmpty(state?.panel)) {\n bgSymbol.states = state.panel;\n }\n\n const bgRect = group.createOrUpdateChild(\n 'poptip-rect-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: 0,\n y: 0,\n width: popTipWidth,\n height: poptipHeight,\n zIndex: -8\n },\n 'rect'\n ) as IRect;\n if (!isEmpty(state?.panel)) {\n bgRect.states = state.panel;\n }\n }\n\n group.setAttributes({\n x: -offset[0] + dx,\n y: -offset[1] + dy\n });\n\n if (layout && range) {\n _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);\n const b = _tBounds;\n const stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);\n if (rectInsideAnotherRect(b, stageBounds, false)) {\n break;\n } else {\n const bbox = getRectIntersect(b, stageBounds, false);\n const size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);\n if (size > maxBBoxSize) {\n maxBBoxSize = size;\n maxBBoxI = i;\n }\n }\n } else {\n break;\n }\n }\n }\n\n positionList = ['top', 'tl', 'tr', 'bottom', 'bl', 'br', 'left', 'lt', 'lb', 'right', 'rt', 'rb'];\n\n getAngleAndOffset(\n position: string,\n width: number,\n height: number,\n size: [number, number]\n ): { angle: number; offset: [number, number]; rectOffset: [number, number] } {\n // const sizeW = size[0];\n const sizeH = size[1] / 2;\n switch (position) {\n case 'tl':\n return {\n angle: (pi / 2) * 3,\n offset: [width / 4, height + sizeH],\n rectOffset: [-width / 4, -height - size[1]]\n };\n case 'top':\n return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH], rectOffset: [0, -height - size[1]] };\n case 'tr':\n return {\n angle: (pi / 2) * 3,\n offset: [(width / 4) * 3, height + sizeH],\n rectOffset: [(width / 4) * 3, -height - size[1]]\n };\n case 'rt':\n return { angle: 0, offset: [-sizeH, height / 5], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'right':\n return { angle: 0, offset: [-sizeH, height / 2], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'rb':\n return { angle: 0, offset: [-sizeH, (height / 5) * 4], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'bl':\n return { angle: pi / 2, offset: [width / 4, -sizeH], rectOffset: [-width / 4, -height - size[1]] };\n case 'bottom':\n return { angle: pi / 2, offset: [width / 2, -sizeH], rectOffset: [0, -height - size[1]] };\n case 'br':\n return { angle: pi / 2, offset: [(width / 4) * 3, -sizeH], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'lt':\n return { angle: pi, offset: [width + sizeH, height / 5], rectOffset: [-width / 4, -height - size[1]] };\n case 'left':\n return { angle: pi, offset: [width + sizeH, height / 2], rectOffset: [0, -height - size[1]] };\n case 'lb':\n return {\n angle: pi,\n offset: [width + sizeH, (height / 5) * 4],\n rectOffset: [(width / 4) * 3, -height - size[1]]\n };\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/poptip/poptip.ts"],"names":[],"mappings":";;;;;;;;;;;AAaA,OAAO,EACL,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,OAAO,EACP,OAAO,EACP,GAAG,EACH,KAAK,EACL,gBAAgB,EAChB,EAAE,EACF,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,QAAQ,GAAG,IAAI,UAAU,EAAE,CAAC;AAElC,mBAAmB,EAAE,CAAC;AACtB,MAAM,OAAO,MAAO,SAAQ,iBAA6C;IAyBvE,YAAY,UAA4B,EAAE,OAA0B;QAClE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAzB7F,SAAI,GAAG,QAAQ,CAAC;QA2OhB,iBAAY,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,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CAAC,CAAC,EAAE,CAAC;YACzG,KAAK,MAAM;gBACT,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChG,KAAK,IAAI;gBACP,OAAO;oBACL,KAAK,EAAE,EAAE;oBACT,MAAM,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;oBACzC,UAAU,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;iBACjD,CAAC;SACL;IACH,CAAC;;AAzRM,wBAAiB,GAA8B;IACpD,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,eAAe,EAAE,GAAG;IACpB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,EAAE;CACZ,CAAC","file":"poptip.js","sourcesContent":["/**\n * @description PopTip组件\n */\nimport type {\n IGroup,\n IRect,\n ISymbol,\n ISymbolGraphicAttribute,\n IText,\n ITextGraphicAttribute,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vrender-core';\nimport {\n AABBBounds,\n Bounds,\n getRectIntersect,\n isArray,\n isBoolean,\n isEmpty,\n isValid,\n max,\n merge,\n normalizePadding,\n pi,\n rectInsideAnotherRect\n} from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { BackgroundAttributes, ComponentOptions } from '../interface';\nimport type { PopTipAttributes } from './type';\nimport { loadPoptipComponent } from './register';\n\nconst _tBounds = new AABBBounds();\n\nloadPoptipComponent();\nexport class PopTip extends AbstractComponent<Required<PopTipAttributes>> {\n name = 'poptip';\n\n static defaultAttributes: Partial<PopTipAttributes> = {\n position: 'rt',\n visible: true,\n title: null,\n content: null,\n titleStyle: {\n fontSize: 12,\n fill: '#000',\n textAlign: 'left',\n textBaseline: 'top'\n },\n contentStyle: {\n fontSize: 12,\n fill: '#000',\n textAlign: 'left',\n textBaseline: 'top'\n },\n maxWidthPercent: 0.8,\n space: 8,\n padding: 10\n };\n\n constructor(attributes: PopTipAttributes, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, PopTip.defaultAttributes, attributes));\n }\n\n protected render() {\n const {\n titleStyle = {} as ITextGraphicAttribute,\n position,\n contentStyle = {} as ITextGraphicAttribute,\n panel = {} as BackgroundAttributes & ISymbolGraphicAttribute & { space?: number },\n space = 4,\n minWidth = 0,\n maxWidth = Infinity,\n padding = 4,\n maxWidthPercent,\n visible,\n state,\n dx = 0,\n dy = 0\n } = this.attribute as PopTipAttributes;\n\n let { title = '', content = '' } = this.attribute as PopTipAttributes;\n\n title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title;\n content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;\n\n const parsedPadding = normalizePadding(padding);\n\n const group = this.createOrUpdateChild('poptip-content', { x: 0, y: 0, zIndex: 1 }, 'group') as IGroup;\n\n const maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3];\n\n const titleVisible = isValid(title) && visible !== false;\n const titleAttrs = {\n text: isArray(title) ? title : ([title] as any),\n visible: titleVisible,\n ...titleStyle,\n x: parsedPadding[3],\n y: parsedPadding[0],\n maxLineWidth,\n textAlign: 'left' as TextAlignType,\n textBaseline: 'top' as TextBaselineType\n };\n\n const titleShape = group.createOrUpdateChild('poptip-title', titleAttrs, 'wrapText') as IText;\n if (!isEmpty(state?.title)) {\n titleShape.states = state.title;\n }\n\n const titleBounds = titleShape.AABBBounds;\n const titleHeight = titleBounds.height();\n const titleWidth = titleBounds.width();\n let height = titleHeight + space;\n if (!titleVisible) {\n height = 0;\n }\n\n const contentVisible = isValid(content) && visible !== false;\n const contentAttrs = {\n text: isArray(content) ? content : ([content] as any),\n visible: contentVisible,\n ...contentStyle,\n x: parsedPadding[3],\n y: parsedPadding[0] + height,\n maxLineWidth,\n textAlign: 'left' as TextAlignType,\n textBaseline: 'top' as TextBaselineType\n };\n\n const contentShape = group.createOrUpdateChild('poptip-content', contentAttrs, 'wrapText') as IText;\n if (!isEmpty(state?.content)) {\n contentShape.states = state.content;\n }\n\n const contentBounds = contentShape.AABBBounds;\n const contentHeight = contentBounds.height();\n const contentWidth = contentBounds.width();\n\n if (contentVisible) {\n height += contentHeight;\n }\n\n // 计算整个popTip的宽高\n let popTipWidth = max(\n titleWidth + parsedPadding[1] + parsedPadding[3],\n contentWidth + parsedPadding[1] + parsedPadding[3]\n );\n if (popTipWidth > maxWidth) {\n popTipWidth = maxWidth;\n } else if (popTipWidth < minWidth) {\n popTipWidth = minWidth;\n }\n let poptipHeight = parsedPadding[0] + parsedPadding[2] + height;\n\n // 绘制背景层\n const { visible: bgVisible, ...backgroundStyle } = panel;\n const symbolSize = backgroundStyle.size ?? 12;\n const spaceSize: number | [number, number] = isArray(symbolSize)\n ? [symbolSize[0] + (backgroundStyle.space ?? 0), symbolSize[1] + (backgroundStyle.space ?? 0)]\n : (symbolSize as number) + (backgroundStyle.space ?? 0);\n const lineWidth = backgroundStyle.lineWidth ?? 1;\n const range: [number, number] | undefined = (this as any).stage\n ? [\n (this as any).stage.viewWidth ?? (this as any).stage.width,\n (this as any).stage.viewHeight ?? (this as any).stage.height\n ]\n : undefined;\n\n if (range) {\n // 尝试进行换行\n const b = (this as any).AABBBounds;\n const leftWidth = this.attribute.x ?? b.x1;\n const rightWidth = range[0] - b.x1;\n let maxSpace = Math.max(leftWidth, rightWidth);\n // 减一些buffer,buffer不能超过maxSpace的20%\n const buf = (isArray(symbolSize) ? symbolSize[0] : 12) + 3;\n maxSpace = Math.min(maxSpace - buf, maxSpace * maxWidthPercent);\n // 需要进行换行\n if (maxSpace < popTipWidth) {\n popTipWidth = maxSpace;\n const buf = parsedPadding[1] + parsedPadding[3];\n titleShape.setAttribute('maxLineWidth', maxSpace - buf);\n contentShape.setAttribute('maxLineWidth', maxSpace - buf);\n poptipHeight = parsedPadding[0] + parsedPadding[2];\n if (titleVisible) {\n poptipHeight += titleShape.AABBBounds.height() + space;\n }\n poptipHeight += contentShape.AABBBounds.height();\n }\n }\n\n const layout = position === 'auto';\n // 最多循环this.positionList次\n let maxBBoxI: number;\n let maxBBoxSize: number = -Infinity;\n for (let i = 0; i < this.positionList.length + 1; i++) {\n const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;\n const { angle, offset, rectOffset } = this.getAngleAndOffset(\n p,\n popTipWidth,\n poptipHeight,\n isArray(spaceSize) ? (spaceSize as [number, number]) : [spaceSize, spaceSize - lineWidth]\n );\n if (isBoolean(bgVisible)) {\n const offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;\n const bgSymbol = group.createOrUpdateChild(\n 'poptip-symbol-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: offsetX,\n y: 0,\n strokeBoundsBuffer: -1,\n boundsPadding: -2,\n anchor: [0, 0],\n symbolType: 'arrow2Left',\n angle: angle,\n dx: offset[0],\n dy: offset[1],\n size: symbolSize,\n zIndex: -9\n },\n 'symbol'\n ) as ISymbol;\n if (!isEmpty(state?.panel)) {\n bgSymbol.states = state.panel;\n }\n\n const bgRect = group.createOrUpdateChild(\n 'poptip-rect-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: 0,\n y: 0,\n width: popTipWidth,\n height: poptipHeight,\n zIndex: -8\n },\n 'rect'\n ) as IRect;\n if (!isEmpty(state?.panel)) {\n bgRect.states = state.panel;\n }\n }\n\n group.setAttributes({\n x: -offset[0] + dx,\n y: -offset[1] + dy\n });\n\n if (layout && range) {\n _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);\n const b = _tBounds;\n const stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);\n if (rectInsideAnotherRect(b, stageBounds, false)) {\n break;\n } else {\n const bbox = getRectIntersect(b, stageBounds, false);\n const size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);\n if (size > maxBBoxSize) {\n maxBBoxSize = size;\n maxBBoxI = i;\n }\n }\n } else {\n break;\n }\n }\n }\n\n positionList = ['top', 'tl', 'tr', 'bottom', 'bl', 'br', 'left', 'lt', 'lb', 'right', 'rt', 'rb'];\n\n getAngleAndOffset(\n position: string,\n width: number,\n height: number,\n size: [number, number]\n ): { angle: number; offset: [number, number]; rectOffset: [number, number] } {\n // const sizeW = size[0];\n const sizeH = size[1] / 2;\n switch (position) {\n case 'tl':\n return {\n angle: (pi / 2) * 3,\n offset: [width / 4, height + sizeH],\n rectOffset: [-width / 4, -height - size[1]]\n };\n case 'top':\n return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH], rectOffset: [0, -height - size[1]] };\n case 'tr':\n return {\n angle: (pi / 2) * 3,\n offset: [(width / 4) * 3, height + sizeH],\n rectOffset: [(width / 4) * 3, -height - size[1]]\n };\n case 'rt':\n return { angle: 0, offset: [-sizeH, height / 5], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'right':\n return { angle: 0, offset: [-sizeH, height / 2], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'rb':\n return { angle: 0, offset: [-sizeH, (height / 5) * 4], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'bl':\n return { angle: pi / 2, offset: [width / 4, -sizeH], rectOffset: [-width / 4, -height - size[1]] };\n case 'bottom':\n return { angle: pi / 2, offset: [width / 2, -sizeH], rectOffset: [0, -height - size[1]] };\n case 'br':\n return { angle: pi / 2, offset: [(width / 4) * 3, -sizeH], rectOffset: [(width / 4) * 3, -height - size[1]] };\n case 'lt':\n return { angle: pi, offset: [width + sizeH, height / 5], rectOffset: [-width / 4, -height - size[1]] };\n case 'left':\n return { angle: pi, offset: [width + sizeH, height / 2], rectOffset: [0, -height - size[1]] };\n case 'lb':\n return {\n angle: pi,\n offset: [width + sizeH, (height / 5) * 4],\n rectOffset: [(width / 4) * 3, -height - size[1]]\n };\n }\n }\n}\n"]}
@@ -1,6 +1,3 @@
1
- import { ContainerModule } from '@visactor/vrender-core';
2
1
  import type { PopTipAttributes } from './type';
3
- export declare const popTipModule: ContainerModule;
4
- export declare function loadPoptip(): void;
5
2
  export declare function loadPoptipComponent(): void;
6
3
  export declare function setPoptipTheme(defaultPoptipTheme: PopTipAttributes): void;
@@ -1,26 +1,9 @@
1
- import { container, InteractiveSubRenderContribution, AutoEnablePlugins, ContainerModule } from "@visactor/vrender-core";
2
-
3
1
  import { merge } from "@visactor/vutils";
4
2
 
5
- import { PopTipRenderContribution } from "./contribution";
6
-
7
- import { PopTipPlugin, PopTipForClipedTextPlugin } from "./poptip-plugin";
8
-
9
3
  import { DEFAULT_THEME, theme } from "./theme";
10
4
 
11
5
  import { registerGroup, registerRect, registerSymbol, registerWrapText } from "@visactor/vrender-kits";
12
6
 
13
- export const popTipModule = new ContainerModule(((bind, unbind, isBound, rebind) => {
14
- isBound(PopTipRenderContribution) || (bind(PopTipRenderContribution).toSelf().inSingletonScope(),
15
- bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution)), isBound(PopTipPlugin) || (bind(PopTipPlugin).toSelf(),
16
- bind(AutoEnablePlugins).toService(PopTipPlugin)), isBound(PopTipForClipedTextPlugin) || (bind(PopTipForClipedTextPlugin).toSelf(),
17
- bind(AutoEnablePlugins).toService(PopTipForClipedTextPlugin));
18
- }));
19
-
20
- export function loadPoptip() {
21
- container.load(popTipModule);
22
- }
23
-
24
7
  export function loadPoptipComponent() {
25
8
  registerGroup(), registerWrapText(), registerSymbol(), registerRect();
26
9
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/register.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,gCAAgC,EAChC,iBAAiB,EACjB,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEvG,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAChF,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,EAAE;QACtC,IAAI,CAAC,wBAAwB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QAC3D,IAAI,CAAC,gCAAgC,CAAC,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;KAC5E;IACD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QAC1B,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;KACjD;IACD,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,EAAE;QACvC,IAAI,CAAC,yBAAyB,CAAC,CAAC,MAAM,EAAE,CAAC;QACzC,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;KAC9D;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,UAAU;IACxB,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,aAAa,EAAE,CAAC;IAChB,gBAAgB,EAAE,CAAC;IACnB,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,kBAAoC;IACjE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AACzD,CAAC","file":"register.js","sourcesContent":["import {\n container,\n InteractiveSubRenderContribution,\n AutoEnablePlugins,\n ContainerModule\n} from '@visactor/vrender-core';\nimport { merge } from '@visactor/vutils';\nimport { PopTipRenderContribution } from './contribution';\nimport { PopTipPlugin, PopTipForClipedTextPlugin } from './poptip-plugin';\nimport type { PopTipAttributes } from './type';\nimport { DEFAULT_THEME, theme } from './theme';\nimport { registerGroup, registerRect, registerSymbol, registerWrapText } from '@visactor/vrender-kits';\n\nexport const popTipModule = new ContainerModule((bind, unbind, isBound, rebind) => {\n if (!isBound(PopTipRenderContribution)) {\n bind(PopTipRenderContribution).toSelf().inSingletonScope();\n bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution);\n }\n if (!isBound(PopTipPlugin)) {\n bind(PopTipPlugin).toSelf();\n bind(AutoEnablePlugins).toService(PopTipPlugin);\n }\n if (!isBound(PopTipForClipedTextPlugin)) {\n bind(PopTipForClipedTextPlugin).toSelf();\n bind(AutoEnablePlugins).toService(PopTipForClipedTextPlugin);\n }\n});\n\nexport function loadPoptip() {\n container.load(popTipModule);\n}\n\nexport function loadPoptipComponent() {\n registerGroup();\n registerWrapText();\n registerSymbol();\n registerRect();\n}\n\nexport function setPoptipTheme(defaultPoptipTheme: PopTipAttributes) {\n merge(theme.poptip, DEFAULT_THEME, defaultPoptipTheme);\n}\n"]}
1
+ {"version":3,"sources":["../src/poptip/register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEvG,MAAM,UAAU,mBAAmB;IACjC,aAAa,EAAE,CAAC;IAChB,gBAAgB,EAAE,CAAC;IACnB,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,kBAAoC;IACjE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AACzD,CAAC","file":"register.js","sourcesContent":["import { container } from '@visactor/vrender-core';\nimport { merge } from '@visactor/vutils';\nimport type { PopTipAttributes } from './type';\nimport { DEFAULT_THEME, theme } from './theme';\nimport { registerGroup, registerRect, registerSymbol, registerWrapText } from '@visactor/vrender-kits';\n\nexport function loadPoptipComponent() {\n registerGroup();\n registerWrapText();\n registerSymbol();\n registerRect();\n}\n\nexport function setPoptipTheme(defaultPoptipTheme: PopTipAttributes) {\n merge(theme.poptip, DEFAULT_THEME, defaultPoptipTheme);\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { ContainerModule } from '@visactor/vrender-core';
2
+ export declare const scrollbarModule: ContainerModule;
3
+ export declare function loadScrollbar(): void;
@@ -0,0 +1,12 @@
1
+ import { AutoEnablePlugins, ContainerModule, container } from "@visactor/vrender-core";
2
+
3
+ import { ScrollBarPlugin } from "./scrollbar-plugin";
4
+
5
+ export const scrollbarModule = new ContainerModule(((bind, unbind, isBound, rebind) => {
6
+ isBound(ScrollBarPlugin) || (bind(ScrollBarPlugin).toSelf(), bind(AutoEnablePlugins).toService(ScrollBarPlugin));
7
+ }));
8
+
9
+ export function loadScrollbar() {
10
+ container.load(scrollbarModule);
11
+ }
12
+ //# sourceMappingURL=module.js.map