@visactor/vrender-components 0.22.7-alpha.5 → 0.22.7-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/cjs/axis/util.js +1 -2
  2. package/cjs/brush/type.js +2 -1
  3. package/cjs/crosshair/base.js +2 -1
  4. package/cjs/crosshair/type.js +1 -2
  5. package/cjs/data-zoom/data-zoom.d.ts +3 -0
  6. package/cjs/data-zoom/data-zoom.js +39 -24
  7. package/cjs/data-zoom/data-zoom.js.map +1 -1
  8. package/cjs/index.d.ts +1 -1
  9. package/cjs/index.js +1 -1
  10. package/cjs/index.js.map +1 -1
  11. package/cjs/poptip/contribution.js +2 -4
  12. package/cjs/poptip/contribution.js.map +1 -1
  13. package/cjs/poptip/poptip.d.ts +0 -5
  14. package/cjs/poptip/poptip.js +18 -87
  15. package/cjs/poptip/poptip.js.map +1 -1
  16. package/cjs/poptip/type.d.ts +1 -4
  17. package/cjs/poptip/type.js.map +1 -1
  18. package/cjs/scrollbar/scrollbar.d.ts +1 -0
  19. package/cjs/scrollbar/scrollbar.js +21 -12
  20. package/cjs/scrollbar/scrollbar.js.map +1 -1
  21. package/cjs/slider/slider.d.ts +3 -0
  22. package/cjs/slider/slider.js +48 -27
  23. package/cjs/slider/slider.js.map +1 -1
  24. package/cjs/switch/switch.js +2 -2
  25. package/cjs/switch/switch.js.map +1 -1
  26. package/cjs/util/event.d.ts +1 -0
  27. package/cjs/util/event.js +14 -0
  28. package/cjs/util/event.js.map +1 -0
  29. package/dist/index.es.js +133 -215
  30. package/es/axis/util.js +1 -2
  31. package/es/brush/type.js +2 -1
  32. package/es/crosshair/base.js +2 -1
  33. package/es/crosshair/type.js +1 -2
  34. package/es/data-zoom/data-zoom.d.ts +3 -0
  35. package/es/data-zoom/data-zoom.js +38 -21
  36. package/es/data-zoom/data-zoom.js.map +1 -1
  37. package/es/index.d.ts +1 -1
  38. package/es/index.js +1 -1
  39. package/es/index.js.map +1 -1
  40. package/es/poptip/contribution.js +2 -4
  41. package/es/poptip/contribution.js.map +1 -1
  42. package/es/poptip/poptip.d.ts +0 -5
  43. package/es/poptip/poptip.js +19 -85
  44. package/es/poptip/poptip.js.map +1 -1
  45. package/es/poptip/type.d.ts +1 -4
  46. package/es/poptip/type.js.map +1 -1
  47. package/es/scrollbar/scrollbar.d.ts +1 -0
  48. package/es/scrollbar/scrollbar.js +22 -11
  49. package/es/scrollbar/scrollbar.js.map +1 -1
  50. package/es/slider/slider.d.ts +3 -0
  51. package/es/slider/slider.js +49 -26
  52. package/es/slider/slider.js.map +1 -1
  53. package/es/switch/switch.js +2 -2
  54. package/es/switch/switch.js.map +1 -1
  55. package/es/util/event.d.ts +1 -0
  56. package/es/util/event.js +6 -0
  57. package/es/util/event.js.map +1 -0
  58. package/package.json +3 -3
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AACvB,2CAAyB;AACzB,+CAA6B","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.22.7-alpha.5\";\n\nexport * from './core/base';\nexport * from './core/type';\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 './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,4CAA0B;AAC1B,yCAAuB;AACvB,2CAAyB;AACzB,+CAA6B","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.22.7-alpha.7\";\n\nexport * from './core/base';\nexport * from './core/type';\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 './timeline';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './weather';\nexport * from './util';\nexport * from './switch';\nexport * from './label-item';\n"]}
@@ -34,12 +34,10 @@ let PopTipRenderContribution = class {
34
34
  this.poptipComponent.setAttributes(Object.assign(Object.assign({
35
35
  visibleAll: !0,
36
36
  pickable: !1,
37
- childrenPickable: !1,
38
- poptipAnchor: "bounds"
37
+ childrenPickable: !1
39
38
  }, poptip), {
40
39
  x: matrix.e,
41
- y: matrix.f,
42
- positionBounds: graphic.globalAABBBounds
40
+ y: matrix.f
43
41
  })), drawContext.stage.tryInitInteractiveLayer();
44
42
  const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
45
43
  interactiveLayer && interactiveLayer.add(this.poptipComponent);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/contribution.ts"],"names":[],"mappings":";;;;;;;;;AAQA,yDAAoD;AACpD,qCAAkC;AAClC,6CAAyC;AACzC,mCAAgC;AAEhC,SAAS,UAAU,CAAC,MAA2B,EAAE,MAA2B;IAC1E,IAAA,cAAK,EAAC,MAAM,EAAE,aAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,MAAM,CAAC;AAChB,CAAC;AAGM,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAEnC,MAAM,CACJ,OAA6C,EAC7C,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,gBAA6C,EAC7C,WAAyB,EACzB,MAAiH,EACjH,QAAmH,EACnH,OAAa;;QAEb,IAAI,OAAO,CAAC,WAAW,KAAK,CAAC,EAAE;YAC7B,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAI,OAAO,CAAC,SAAiB,CAAC,MAAM,IAAI,EAAE,CAAC;YACvE,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC,SAAS,IAA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C,uBAAuB,EAAE,CAAC;YAC5C,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;YAC5E,IAAI,gBAAgB,EAAE;gBACpB,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aAC5C;SACF;aAAM,IAAI,OAAO,CAAC,WAAW,KAAK,CAAC,EAAE;YACpC,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,eAAe,EAAE;gBACxB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;oBACjC,UAAU,EAAE,KAAK;iBAClB,CAAC,CAAC;gBACH,MAAA,IAAI,CAAC,eAAe,CAAC,MAAM,0CAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBAC/D,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;aAC7B;SACF;IACH,CAAC;CACF,CAAA;AAtEY,wBAAwB;IADpC,IAAA,yBAAU,GAAE;GACA,wBAAwB,CAsEpC;AAtEY,4DAAwB","file":"contribution.js","sourcesContent":["import type {\n IContext2d,\n IGraphic,\n IGraphicAttribute,\n IInteractiveSubRenderContribution,\n IThemeAttribute,\n IDrawContext\n} from '@visactor/vrender-core';\nimport { injectable } from '@visactor/vrender-core';\nimport { PopTip } from './poptip';\nimport { merge } from '@visactor/vutils';\nimport { theme } from './theme';\n\nfunction wrapPoptip(target: Record<string, any>, source: Record<string, any>) {\n merge(target, theme.poptip, source);\n return target;\n}\n\n@injectable()\nexport class PopTipRenderContribution implements IInteractiveSubRenderContribution {\n declare poptipComponent: PopTip;\n render(\n graphic: IGraphic<Partial<IGraphicAttribute>>,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<IGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n options?: any\n ): void {\n if (graphic._showPoptip === 1) {\n const { visible, visibleCb } = (graphic.attribute as any).poptip || {};\n if (visible === false || (visibleCb && visibleCb(graphic) === false)) {\n return;\n }\n const attribute = {};\n merge(\n attribute,\n PopTip.defaultAttributes,\n (graphic.attribute as any).poptip ? (graphic.attribute as any).poptip : {}\n );\n if (!this.poptipComponent) {\n this.poptipComponent = new PopTip(attribute);\n } else {\n this.poptipComponent.initAttributes(attribute);\n }\n // 如果text图元没有配置title和content的话\n let poptip = (graphic.attribute as any).poptip || {};\n if (graphic.type === 'text' && poptip.title == null && poptip.content == null) {\n const out = {};\n wrapPoptip(out, poptip);\n poptip = out;\n poptip.content = poptip.content ?? (graphic.attribute as any).text;\n }\n const matrix = graphic.globalTransMatrix;\n this.poptipComponent.setAttributes({\n visibleAll: true,\n pickable: false,\n childrenPickable: false,\n // 默认使用bounds作为锚点\n poptipAnchor: 'bounds',\n ...poptip,\n x: matrix.e,\n y: matrix.f,\n positionBounds: graphic.globalAABBBounds\n });\n // 添加到交互层中\n drawContext.stage.tryInitInteractiveLayer();\n const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');\n if (interactiveLayer) {\n interactiveLayer.add(this.poptipComponent);\n }\n } else if (graphic._showPoptip === 2) {\n graphic._showPoptip = 0;\n if (this.poptipComponent) {\n this.poptipComponent.setAttributes({\n visibleAll: false\n });\n this.poptipComponent.parent?.removeChild(this.poptipComponent);\n this.poptipComponent = null;\n }\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/poptip/contribution.ts"],"names":[],"mappings":";;;;;;;;;AAQA,yDAAoD;AACpD,qCAAkC;AAClC,6CAAyC;AACzC,mCAAgC;AAEhC,SAAS,UAAU,CAAC,MAA2B,EAAE,MAA2B;IAC1E,IAAA,cAAK,EAAC,MAAM,EAAE,aAAK,CAAC,MA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AC;gBACxB,MAAM,GAAG,GAAG,CAAC;gBACb,MAAM,CAAC,OAAO,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAK,OAAO,CAAC,SAAiB,CAAC,IAAI,CAAC;aACpE;YACD,MAAM,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;YACzC,IAAI,CAAC,eAAe,CAAC,aAAa,+BAChC,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,KAAK,EACf,gBAAgB,EAAE,KAAK,IACpB,MAAM,KACT,CAAC,EAAE,MAAM,CAAC,CAAC,EACX,CAAC,EAAE,MAAM,CAAC,CAAC,IACX,CAAC;YAEH,WAAW,CAAC,KAAK,CAAC,uBAAuB,EAAE,CAAC;YAC5C,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;YAC5E,IAAI,gBAAgB,EAAE;gBACpB,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aAC5C;SACF;aAAM,IAAI,OAAO,CAAC,WAAW,KAAK,CAAC,EAAE;YACpC,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,eAAe,EAAE;gBACxB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;oBACjC,UAAU,EAAE,KAAK;iBAClB,CAAC,CAAC;gBACH,MAAA,IAAI,CAAC,eAAe,CAAC,MAAM,0CAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBAC/D,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;aAC7B;SACF;IACH,CAAC;CACF,CAAA;AAnEY,wBAAwB;IADpC,IAAA,yBAAU,GAAE;GACA,wBAAwB,CAmEpC;AAnEY,4DAAwB","file":"contribution.js","sourcesContent":["import type {\n IContext2d,\n IGraphic,\n IGraphicAttribute,\n IInteractiveSubRenderContribution,\n IThemeAttribute,\n IDrawContext\n} from '@visactor/vrender-core';\nimport { injectable } from '@visactor/vrender-core';\nimport { PopTip } from './poptip';\nimport { merge } from '@visactor/vutils';\nimport { theme } from './theme';\n\nfunction wrapPoptip(target: Record<string, any>, source: Record<string, any>) {\n merge(target, theme.poptip, source);\n return target;\n}\n\n@injectable()\nexport class PopTipRenderContribution implements IInteractiveSubRenderContribution {\n declare poptipComponent: PopTip;\n render(\n graphic: IGraphic<Partial<IGraphicAttribute>>,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<IGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n options?: any\n ): void {\n if (graphic._showPoptip === 1) {\n const { visible, visibleCb } = (graphic.attribute as any).poptip || {};\n if (visible === false || (visibleCb && visibleCb(graphic) === false)) {\n return;\n }\n const attribute = {};\n merge(\n attribute,\n PopTip.defaultAttributes,\n (graphic.attribute as any).poptip ? (graphic.attribute as any).poptip : {}\n );\n if (!this.poptipComponent) {\n this.poptipComponent = new PopTip(attribute);\n } else {\n this.poptipComponent.initAttributes(attribute);\n }\n // 如果text图元没有配置title和content的话\n let poptip = (graphic.attribute as any).poptip || {};\n if (graphic.type === 'text' && poptip.title == null && poptip.content == null) {\n const out = {};\n wrapPoptip(out, poptip);\n poptip = out;\n poptip.content = poptip.content ?? (graphic.attribute as any).text;\n }\n const matrix = graphic.globalTransMatrix;\n this.poptipComponent.setAttributes({\n visibleAll: true,\n pickable: false,\n childrenPickable: false,\n ...poptip,\n x: matrix.e,\n y: matrix.f\n });\n // 添加到交互层中\n drawContext.stage.tryInitInteractiveLayer();\n const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');\n if (interactiveLayer) {\n interactiveLayer.add(this.poptipComponent);\n }\n } else if (graphic._showPoptip === 2) {\n graphic._showPoptip = 0;\n if (this.poptipComponent) {\n this.poptipComponent.setAttributes({\n visibleAll: false\n });\n this.poptipComponent.parent?.removeChild(this.poptipComponent);\n this.poptipComponent = null;\n }\n }\n }\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  import { type IGroup, type IText } from '@visactor/vrender-core';
2
- import { type IAABBBoundsLike } from '@visactor/vutils';
3
2
  import { AbstractComponent } from '../core/base';
4
3
  import type { ComponentOptions } from '../interface';
5
4
  import type { PopTipAttributes } from './type';
@@ -12,10 +11,6 @@ export declare class PopTip extends AbstractComponent<Required<PopTipAttributes>
12
11
  constructor(attributes: PopTipAttributes, options?: ComponentOptions);
13
12
  protected render(): void;
14
13
  positionList: string[];
15
- calculateAnchorPoint(position: string, positionBounds?: IAABBBoundsLike): {
16
- x: number;
17
- y: number;
18
- };
19
14
  getAngleAndOffset(position: string, width: number, height: number, size: [number, number], symbolType: 'arrow2Left' | string): {
20
15
  angle: number;
21
16
  offset: [number, number];
@@ -36,7 +36,7 @@ class PopTip extends base_1.AbstractComponent {
36
36
  }
37
37
  render() {
38
38
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
39
- const {titleStyle: titleStyle = {}, position: position, contentStyle: contentStyle = {}, panel: panel, logoSymbol: logoSymbol, poptipAnchor: poptipAnchor = "position", logoText: logoText, logoTextStyle: logoTextStyle = {}, triangleMode: triangleMode = "default", space: space = 4, minWidth: minWidth = 0, maxWidth: maxWidth = 1 / 0, padding: padding = 4, maxWidthPercent: maxWidthPercent, visible: visible, state: state, dx: dx = 0, dy: dy = 0, positionBounds: positionBounds} = this.attribute;
39
+ const {titleStyle: titleStyle = {}, position: position, contentStyle: contentStyle = {}, panel: panel, logoSymbol: logoSymbol, logoText: logoText, logoTextStyle: logoTextStyle = {}, triangleMode: triangleMode = "default", space: space = 4, minWidth: minWidth = 0, maxWidth: maxWidth = 1 / 0, padding: padding = 4, maxWidthPercent: maxWidthPercent, visible: visible, state: state, dx: dx = 0, dy: dy = 0} = this.attribute;
40
40
  let {title: title = "", content: content = ""} = this.attribute;
41
41
  title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title,
42
42
  content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;
@@ -104,26 +104,19 @@ class PopTip extends base_1.AbstractComponent {
104
104
  poptipHeight += contentShape.AABBBounds.height();
105
105
  }
106
106
  }
107
- const layout = "auto" === position || (0, vutils_1.isArray)(position), positionList = (0,
108
- vutils_1.isArray)(position) ? position : this.positionList;
107
+ const layout = "auto" === position;
109
108
  let maxBBoxI, maxBBoxSize = -1 / 0;
110
- for (let i = 0; i < positionList.length + 1; i++) {
111
- const p = layout ? positionList[i === positionList.length ? maxBBoxI : i] : position;
109
+ for (let i = 0; i < this.positionList.length + 1; i++) {
110
+ const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;
112
111
  let symbolType = "arrow2Left", offsetX = ((0, vutils_1.isArray)(symbolSize) ? symbolSize[0] : symbolSize) / 4, offsetY = 0;
113
112
  "top" === p || "bottom" === p || "left" === p || "right" === p ? symbolType = "arrow2Left" : "concise" === triangleMode && (symbolType = conciseSymbolMap[p],
114
- offsetX = [ "tl", "bl", "rt", "rb" ].includes(p) ? ((0, vutils_1.isArray)(symbolSize) ? symbolSize[0] : symbolSize) / 2 : -((0,
115
- vutils_1.isArray)(symbolSize) ? symbolSize[0] : symbolSize) / 2, offsetY = [ "tl", "tr", "lb", "rb" ].includes(p) ? -((0,
113
+ offsetX = [ "tl", "bl", "rt", "rb" ].includes(position) ? ((0, vutils_1.isArray)(symbolSize) ? symbolSize[0] : symbolSize) / 2 : -((0,
114
+ vutils_1.isArray)(symbolSize) ? symbolSize[0] : symbolSize) / 2, offsetY = [ "tl", "tr", "lb", "rb" ].includes(position) ? -((0,
116
115
  vutils_1.isArray)(symbolSize) ? symbolSize[1] : symbolSize) / 2 : ((0, vutils_1.isArray)(symbolSize) ? symbolSize[1] : symbolSize) / 2);
117
116
  const {angle: angle, offset: offset} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, (0,
118
117
  vutils_1.isArray)(spaceSize) ? spaceSize : [ spaceSize, spaceSize - lineWidth ], symbolType);
119
- let bgSymbol, anchorPoint = {
120
- x: 0,
121
- y: 0
122
- };
123
- if ("bounds" === poptipAnchor && positionBounds && (anchorPoint = this.calculateAnchorPoint(p, positionBounds)),
124
- (0, vutils_1.isBoolean)(bgVisible)) {
125
- let bgRect;
126
- bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
118
+ if ((0, vutils_1.isBoolean)(bgVisible)) {
119
+ const bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
127
120
  visible: bgVisible && (contentVisible || titleVisible),
128
121
  x: offsetX,
129
122
  y: offsetY,
@@ -136,7 +129,9 @@ class PopTip extends base_1.AbstractComponent {
136
129
  dy: offset[1] - (null !== (_j = backgroundStyle.space) && void 0 !== _j ? _j : 0),
137
130
  size: symbolSize,
138
131
  zIndex: 9
139
- }), "symbol"), (0, vutils_1.isEmpty)(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel),
132
+ }), "symbol");
133
+ let bgRect;
134
+ (0, vutils_1.isEmpty)(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel),
140
135
  bgRect = panel.panelSymbolType ? group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
141
136
  visible: bgVisible && (contentVisible || titleVisible),
142
137
  x: 0,
@@ -154,8 +149,8 @@ class PopTip extends base_1.AbstractComponent {
154
149
  }), "rect"), (0, vutils_1.isEmpty)(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
155
150
  }
156
151
  if (group.setAttributes({
157
- x: -offset[0] + dx + anchorPoint.x,
158
- y: -offset[1] + dy + anchorPoint.y,
152
+ x: -offset[0] + dx,
153
+ y: -offset[1] + dy,
159
154
  anchor: [ offsetX, offsetY ]
160
155
  }), logoSymbol) {
161
156
  const {size: size = 12} = logoSymbol, sizeArray = (0, vutils_1.isArray)(size) ? size : [ size, size ];
@@ -180,82 +175,18 @@ class PopTip extends base_1.AbstractComponent {
180
175
  zIndex: 10
181
176
  }), "text");
182
177
  }
183
- if (!range) break;
178
+ if (!layout || !range) break;
184
179
  {
185
180
  _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
186
181
  const b = _tBounds, stageBounds = (new vutils_1.Bounds).setValue(0, 0, range[0], range[1]);
187
- if (layout) {
188
- if ((0, vutils_1.rectInsideAnotherRect)(b, stageBounds, !1)) break;
189
- {
190
- const bbox = (0, vutils_1.getRectIntersect)(b, stageBounds, !1), size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);
191
- size > maxBBoxSize && (maxBBoxSize = size, maxBBoxI = i);
192
- }
182
+ if ((0, vutils_1.rectInsideAnotherRect)(b, stageBounds, !1)) break;
183
+ {
184
+ const bbox = (0, vutils_1.getRectIntersect)(b, stageBounds, !1), size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);
185
+ size > maxBBoxSize && (maxBBoxSize = size, maxBBoxI = i);
193
186
  }
194
- if ([ "top", "bottom", "left", "right" ].includes(p)) {
195
- const isVerticalPosition = "top" === p || "bottom" === p, isHorizontalPosition = "left" === p || "right" === p;
196
- let mainDirectionOverlap = !1;
197
- if (isVerticalPosition ? mainDirectionOverlap = "top" === p && b.y1 < 0 || "bottom" === p && b.y2 > stageBounds.y2 : isHorizontalPosition && (mainDirectionOverlap = "left" === p && b.x1 < 0 || "right" === p && b.x2 > stageBounds.x2),
198
- !mainDirectionOverlap) {
199
- let secondaryOffset = 0;
200
- const szNumber = ((0, vutils_1.isArray)(symbolSize) ? symbolSize[1] : symbolSize) / 2;
201
- isVerticalPosition ? (b.x1 < 0 ? secondaryOffset = -b.x1 : b.x2 > stageBounds.x2 && (secondaryOffset = stageBounds.x2 - b.x2),
202
- group.setAttribute("x", group.attribute.x + secondaryOffset), bgSymbol.setAttribute("dx", (0,
203
- vutils_1.min)((0, vutils_1.max)(bgSymbol.attribute.dx - secondaryOffset, szNumber), b.width() - szNumber))) : isHorizontalPosition && (b.y1 < 0 ? secondaryOffset = -b.y1 : b.y2 > stageBounds.y2 && (secondaryOffset = stageBounds.y2 - b.y2),
204
- group.setAttribute("y", group.attribute.y + secondaryOffset), bgSymbol.setAttribute("dy", (0,
205
- vutils_1.min)((0, vutils_1.max)(bgSymbol.attribute.dy - secondaryOffset, szNumber), b.height() - szNumber)));
206
- break;
207
- }
208
- }
209
- if (!layout) break;
210
187
  }
211
188
  }
212
189
  }
213
- calculateAnchorPoint(position, positionBounds) {
214
- if (!positionBounds) return {
215
- x: 0,
216
- y: 0
217
- };
218
- const {x: x, y: y} = this.attribute, {x1: x1, y1: y1, x2: x2, y2: y2} = positionBounds, width = x2 - x1, height = y2 - y1;
219
- switch (position) {
220
- case "top":
221
- case "tl":
222
- case "tr":
223
- return {
224
- x: x1 + width / 2 - x,
225
- y: y1 - y
226
- };
227
-
228
- case "bottom":
229
- case "bl":
230
- case "br":
231
- return {
232
- x: x1 + width / 2 - x,
233
- y: y2 - y
234
- };
235
-
236
- case "left":
237
- case "lt":
238
- case "lb":
239
- return {
240
- x: x1 - x,
241
- y: y1 + height / 2 - y
242
- };
243
-
244
- case "right":
245
- case "rt":
246
- case "rb":
247
- return {
248
- x: x2 - x,
249
- y: y1 + height / 2 - y
250
- };
251
-
252
- default:
253
- return {
254
- x: 0,
255
- y: 0
256
- };
257
- }
258
- }
259
190
  getAngleAndOffset(position, width, height, size, symbolType) {
260
191
  const sizeH = "arrow2Left" === symbolType ? size[1] / 2 : size[1];
261
192
  switch (position) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/poptip.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,yDAUgC;AAChC,6CAe0B;AAC1B,uCAAiD;AAGjD,yCAAiD;AAEjD,MAAM,QAAQ,GAAG,IAAI,mBAAU,EAAE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AE,GAAG,EAAE,MAAa,CAAC;iBACrD,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,GAAG,GAAG,CAAC,EAAE,MAAa,CAAC;iBAC1D,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,EAAE,EAAE,GAAG,GAAG,CAAC,EAAE,MAAa,CAAC;iBACzD,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,MAAa,CAAC,CAAC;SACzC;IACH,CAAC;IAED,gBAAgB,CAAC,aAAqD;QAGpE,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,aAAa,CAAC;QAC9D,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAa,CAAC,CAAC;IACvE,CAAC;;AA/hBH,wBAgiBC;AA7hBQ,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,KAAK,EAAE,EAAS;IAChB,eAAe,EAAE,GAAG;IACpB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,EAAE;CACZ,CAAC","file":"poptip.js","sourcesContent":["/**\n * @description PopTip组件\n */\nimport {\n InputText,\n type IGraphic,\n type IGroup,\n type IRect,\n type ISymbol,\n type IText,\n type ITextGraphicAttribute,\n type TextAlignType,\n type 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 min,\n normalizePadding,\n pi,\n rectInsideAnotherRect,\n type IAABBBoundsLike\n} from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { ComponentOptions } from '../interface';\nimport type { PopTipAttributes } from './type';\nimport { loadPoptipComponent } from './register';\n\nconst _tBounds = new AABBBounds();\n\nloadPoptipComponent();\n\nconst tlStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 -0.5, Z';\nconst blStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 0.5, Z';\nconst trStr = 'M -0.5 -0.5, L 0.5 -0.5, L 0.5 0.5, Z';\nconst brStr = 'M 0.5 -0.5, L 0.5 0.5, L -0.5 0.5, Z';\n\nconst conciseSymbolMap = {\n tl: tlStr,\n tr: trStr,\n bl: blStr,\n br: brStr,\n lt: tlStr,\n lb: blStr,\n rt: trStr,\n rb: brStr\n};\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 panel: {} as any,\n maxWidthPercent: 0.8,\n space: 8,\n padding: 10\n };\n\n titleShape?: IText;\n contentShape?: IText;\n group?: IGroup;\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,\n logoSymbol,\n poptipAnchor = 'position',\n logoText,\n logoTextStyle = {} as ITextGraphicAttribute,\n triangleMode = 'default',\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 positionBounds\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 this.group = group;\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 wrap: true,\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, 'text') 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 wrap: true,\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, 'text') 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 this.titleShape = titleShape;\n this.contentShape = contentShape;\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, square, ...backgroundStyle } = panel;\n // 如果是正方形,取宽高的最大值,同时文字也需要居中\n if (square) {\n const maxWH = max(popTipWidth, poptipHeight);\n popTipWidth = maxWH;\n const deltaH = maxWH - poptipHeight;\n poptipHeight = maxWH;\n titleShape.setAttributes({ dy: deltaH / 2 });\n contentShape.setAttributes({ dy: deltaH / 2 });\n }\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' || isArray(position);\n const positionList = isArray(position) ? position : this.positionList;\n // 最多循环this.positionList次\n let maxBBoxI: number;\n let maxBBoxSize: number = -Infinity;\n\n for (let i = 0; i < positionList.length + 1; i++) {\n const p = layout ? positionList[i === positionList.length ? maxBBoxI : i] : position;\n let symbolType = 'arrow2Left';\n let offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;\n let offsetY = 0;\n if (p === 'top' || p === 'bottom' || p === 'left' || p === 'right') {\n symbolType = 'arrow2Left';\n } else if (triangleMode === 'concise') {\n symbolType = (conciseSymbolMap as any)[p];\n offsetX = ['tl', 'bl', 'rt', 'rb'].includes(p)\n ? (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2\n : -(isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2;\n offsetY = ['tl', 'tr', 'lb', 'rb'].includes(p)\n ? -(isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2\n : (isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2;\n }\n\n const { angle, offset } = this.getAngleAndOffset(\n p,\n popTipWidth,\n poptipHeight,\n isArray(spaceSize) ? (spaceSize as [number, number]) : [spaceSize, spaceSize - lineWidth],\n symbolType\n );\n\n // Calculate anchor point if using bounds\n let anchorPoint = { x: 0, y: 0 };\n if (poptipAnchor === 'bounds' && positionBounds) {\n anchorPoint = this.calculateAnchorPoint(p, positionBounds);\n }\n\n // 后续可能需要偏移,所以需要保存\n let bgSymbol: ISymbol;\n if (isBoolean(bgVisible)) {\n bgSymbol = group.createOrUpdateChild(\n 'poptip-symbol-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: offsetX,\n y: offsetY,\n strokeBoundsBuffer: -1,\n boundsPadding: -2,\n anchor: [0, 0],\n symbolType,\n angle: angle,\n dx: offset[0],\n // 标签和背景同时移动\n dy: offset[1] - (backgroundStyle.space ?? 0),\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 let bgRect: IGraphic;\n if (panel.panelSymbolType) {\n bgRect = group.createOrUpdateChild(\n 'poptip-rect-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: 0,\n y: 0,\n symbolType: 'rect',\n size: [popTipWidth, poptipHeight],\n zIndex: -8\n },\n 'symbol'\n ) as ISymbol;\n } else {\n 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 }\n if (!isEmpty(state?.panel)) {\n bgRect.states = state.panel;\n }\n }\n\n group.setAttributes({\n x: -offset[0] + dx + anchorPoint.x,\n y: -offset[1] + dy + anchorPoint.y,\n anchor: [offsetX, offsetY]\n });\n\n // 添加logo和logo内的text\n if (logoSymbol) {\n const { size = 12 } = logoSymbol;\n const sizeArray = isArray(size) ? (size as [number | string, number | string]) : [size, size];\n if (sizeArray[1] === 'auto') {\n sizeArray[1] = poptipHeight;\n }\n if (sizeArray[0] === 'auto') {\n sizeArray[0] = poptipHeight;\n }\n const sizeW = sizeArray[0] as number;\n group.createOrUpdateChild(\n 'poptip-logo',\n {\n ...logoSymbol,\n x: 0,\n y: poptipHeight / 2,\n visible: bgVisible && (contentVisible || titleVisible),\n zIndex: 10,\n size: sizeArray as [number, number]\n },\n 'symbol'\n );\n group.setAttributes({\n x: -offset[0] + dx + sizeW / 2,\n y: -offset[1] + dy\n });\n if (logoText) {\n group.createOrUpdateChild(\n 'poptip-logo-text',\n {\n ...logoTextStyle,\n x: 0,\n y: poptipHeight / 2,\n visible: bgVisible && (contentVisible || titleVisible),\n text: logoText,\n textAlign: 'center',\n textBaseline: 'middle',\n zIndex: 10\n },\n 'text'\n );\n }\n }\n\n if (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 (layout) {\n if (rectInsideAnotherRect(b, stageBounds, false)) {\n break;\n } else {\n const bbox = getRectIntersect(b, stageBounds, false);\n\n const size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);\n if (size > maxBBoxSize) {\n maxBBoxSize = size;\n maxBBoxI = i;\n }\n }\n }\n\n // 检测是否是'top' | 'bottom' | 'left' | 'right',如果是,则需要进行偏移\n // 1. 判断主方向上有没有重叠(top|bottom的话就是垂直方向,left|right的话就是水平方向),如果重叠就无法偏移\n // 2. 找到次方向上的偏移量(top|bottom的话就是水平方向,left|right的话就是垂直方向),然后对group进行偏移即可\n if (['top', 'bottom', 'left', 'right'].includes(p)) {\n const isVerticalPosition = p === 'top' || p === 'bottom';\n const isHorizontalPosition = p === 'left' || p === 'right';\n\n // 判断主方向上有没有偏移\n let mainDirectionOverlap = false;\n if (isVerticalPosition) {\n mainDirectionOverlap = (p === 'top' && b.y1 < 0) || (p === 'bottom' && b.y2 > stageBounds.y2);\n } else if (isHorizontalPosition) {\n mainDirectionOverlap = (p === 'left' && b.x1 < 0) || (p === 'right' && b.x2 > stageBounds.x2);\n }\n\n // 如果主方向上没有偏移,则可以尝试在次方向上找到合适的偏移量\n if (!mainDirectionOverlap) {\n let secondaryOffset = 0;\n\n const szNumber = (isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2;\n if (isVerticalPosition) {\n // 水平偏移\n if (b.x1 < 0) {\n secondaryOffset = -b.x1;\n } else if (b.x2 > stageBounds.x2) {\n secondaryOffset = stageBounds.x2 - b.x2;\n }\n group.setAttribute('x', group.attribute.x + secondaryOffset);\n bgSymbol.setAttribute(\n 'dx',\n min(max(bgSymbol.attribute.dx - secondaryOffset, szNumber), b.width() - szNumber)\n );\n } else if (isHorizontalPosition) {\n // 垂直偏移\n if (b.y1 < 0) {\n secondaryOffset = -b.y1;\n } else if (b.y2 > stageBounds.y2) {\n secondaryOffset = stageBounds.y2 - b.y2;\n }\n\n group.setAttribute('y', group.attribute.y + secondaryOffset);\n bgSymbol.setAttribute(\n 'dy',\n min(max(bgSymbol.attribute.dy - secondaryOffset, szNumber), b.height() - szNumber)\n );\n }\n break;\n }\n }\n\n if (!layout) {\n break;\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 /**\n * Calculate anchor point based on positionBounds and position\n */\n calculateAnchorPoint(position: string, positionBounds?: IAABBBoundsLike): { x: number; y: number } {\n if (!positionBounds) {\n return { x: 0, y: 0 };\n }\n\n const { x, y } = this.attribute;\n\n const { x1, y1, x2, y2 } = positionBounds;\n const width = x2 - x1;\n const height = y2 - y1;\n\n // Calculate anchor point based on position\n switch (position) {\n case 'top':\n case 'tl':\n case 'tr':\n return { x: x1 + width / 2 - x, y: y1 - y };\n case 'bottom':\n case 'bl':\n case 'br':\n return { x: x1 + width / 2 - x, y: y2 - y };\n case 'left':\n case 'lt':\n case 'lb':\n return { x: x1 - x, y: y1 + height / 2 - y };\n case 'right':\n case 'rt':\n case 'rb':\n return { x: x2 - x, y: y1 + height / 2 - y };\n default:\n return { x: 0, y: 0 };\n }\n }\n\n getAngleAndOffset(\n position: string,\n width: number,\n height: number,\n size: [number, number],\n symbolType: 'arrow2Left' | string\n ): { angle: number; offset: [number, number] } {\n // const sizeW = size[0];\n const sizeH = symbolType === 'arrow2Left' ? size[1] / 2 : size[1];\n switch (position) {\n case 'tl':\n return {\n angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,\n offset: symbolType === 'arrow2Left' ? [width / 4, height + sizeH] : [0, height + sizeH]\n };\n case 'top':\n return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH] };\n case 'tr':\n return {\n angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,\n offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, height + sizeH] : [width, height + sizeH]\n };\n case 'rt':\n return {\n angle: 0,\n offset: symbolType === 'arrow2Left' ? [-sizeH, height / 5] : [-sizeH, 0]\n };\n case 'right':\n return { angle: 0, offset: [-sizeH, height / 2] };\n case 'rb':\n return {\n angle: 0,\n offset: symbolType === 'arrow2Left' ? [-sizeH, (height / 5) * 4] : [-sizeH, height]\n };\n case 'bl':\n return {\n angle: symbolType === 'arrow2Left' ? pi / 2 : 0,\n offset: symbolType === 'arrow2Left' ? [width / 4, -sizeH] : [0, -sizeH]\n };\n case 'bottom':\n return { angle: pi / 2, offset: [width / 2, -sizeH] };\n case 'br':\n return {\n angle: symbolType === 'arrow2Left' ? pi / 2 : 0,\n offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, -sizeH] : [width, -sizeH]\n };\n case 'lt':\n return {\n angle: symbolType === 'arrow2Left' ? pi : 0,\n offset: symbolType === 'arrow2Left' ? [width + sizeH, height / 5] : [width + sizeH, 0]\n };\n case 'left':\n return { angle: pi, offset: [width + sizeH, height / 2] };\n case 'lb':\n return {\n angle: symbolType === 'arrow2Left' ? pi : 0,\n offset: symbolType === 'arrow2Left' ? [width + sizeH, (height / 5) * 4] : [width + sizeH, height]\n };\n }\n }\n\n appearAnimate(animateConfig: { duration?: number; easing?: string; wave?: number }) {\n // 基准时间,line[0, 500], point[100, 600] 100 onebyone, pointNormal[600, 1000] 90+90 onebyone, activeLine[500, 700]\n // line和activeLine的clipRange\n const { duration = 1000, easing = 'quadOut' } = animateConfig;\n this.setAttributes({ scaleX: 0, scaleY: 0 });\n this.animate().to({ scaleX: 1, scaleY: 1 }, (duration / 3) * 2, easing as any);\n this.titleShape &&\n this.titleShape\n .animate()\n .play(new InputText({ text: '' }, { text: this.titleShape.attribute.text as string }, duration, easing as any));\n this.contentShape &&\n this.contentShape\n .animate()\n .play(\n new InputText({ text: '' }, { text: this.contentShape.attribute.text as string }, duration, easing as any)\n );\n\n // 摇摆\n if (animateConfig.wave) {\n const dur = duration / 6;\n this.group\n .animate()\n .to({ angle: animateConfig.wave }, dur, easing as any)\n .to({ angle: -animateConfig.wave }, dur * 2, easing as any)\n .to({ angle: animateConfig.wave }, dur * 2, easing as any)\n .to({ angle: 0 }, dur, easing as any);\n }\n }\n\n disappearAnimate(animateConfig: { duration?: number; easing?: string }) {\n // 基准时间,line[0, 500], point[100, 600] 100 onebyone, pointNormal[600, 1000] 90+90 onebyone, activeLine[500, 700]\n // line和activeLine的clipRange\n const { duration = 1000, easing = 'quadOut' } = animateConfig;\n this.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing as any);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/poptip/poptip.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAGA,yDAWgC;AAChC,6CAa0B;AAC1B,uCAAiD;AAGjD,yCAAiD;AAEjD,MAAM,QAAQ,GAAG,IAAI,mBAAU,EAAE,CAAC;AAElC,IAAA,8BAAmB,GAAE,CAAC;AAEtB,MAAM,KAAK,GAAG,wCAAwC,CAAC;AACvD,MAAM,KAAK,GAAG,uCAAuC,CAAC;AACtD,MAAM,KAAK,GAAG,uCAAuC,CAAC;AACtD,MAAM,KAAK,GAAG,sCAAsC,CAAC;AAErD,MAAM,gBAAgB,GAAG;IACvB,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,KAAK;CACV,CAAC;AACF,MAAa,MAAO,SAAQ,wBAA6C;IA8BvE,YAAY,UAA4B,EAAE,OAA0B;QAClE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE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EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;KACpB;IACD,KAAK,EAAE,EAAS;IAChB,eAAe,EAAE,GAAG;IACpB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,EAAE;CACZ,CAAC","file":"poptip.js","sourcesContent":["/**\n * @description PopTip组件\n */\nimport {\n InputText,\n type IGraphic,\n type IGroup,\n type IRect,\n type ISymbol,\n type ISymbolGraphicAttribute,\n type IText,\n type ITextGraphicAttribute,\n type TextAlignType,\n type 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();\n\nconst tlStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 -0.5, Z';\nconst blStr = 'M -0.5 -0.5, L -0.5 0.5, L 0.5 0.5, Z';\nconst trStr = 'M -0.5 -0.5, L 0.5 -0.5, L 0.5 0.5, Z';\nconst brStr = 'M 0.5 -0.5, L 0.5 0.5, L -0.5 0.5, Z';\n\nconst conciseSymbolMap = {\n tl: tlStr,\n tr: trStr,\n bl: blStr,\n br: brStr,\n lt: tlStr,\n lb: blStr,\n rt: trStr,\n rb: brStr\n};\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 panel: {} as any,\n maxWidthPercent: 0.8,\n space: 8,\n padding: 10\n };\n\n titleShape?: IText;\n contentShape?: IText;\n group?: IGroup;\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,\n logoSymbol,\n logoText,\n logoTextStyle = {} as ITextGraphicAttribute,\n triangleMode = 'default',\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 this.group = group;\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 wrap: true,\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, 'text') 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 wrap: true,\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, 'text') 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 this.titleShape = titleShape;\n this.contentShape = contentShape;\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, square, ...backgroundStyle } = panel;\n // 如果是正方形,取宽高的最大值,同时文字也需要居中\n if (square) {\n const maxWH = max(popTipWidth, poptipHeight);\n popTipWidth = maxWH;\n const deltaH = maxWH - poptipHeight;\n poptipHeight = maxWH;\n titleShape.setAttributes({ dy: deltaH / 2 });\n contentShape.setAttributes({ dy: deltaH / 2 });\n }\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\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 let symbolType = 'arrow2Left';\n let offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;\n let offsetY = 0;\n if (p === 'top' || p === 'bottom' || p === 'left' || p === 'right') {\n symbolType = 'arrow2Left';\n } else if (triangleMode === 'concise') {\n symbolType = (conciseSymbolMap as any)[p];\n offsetX = ['tl', 'bl', 'rt', 'rb'].includes(position)\n ? (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2\n : -(isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2;\n offsetY = ['tl', 'tr', 'lb', 'rb'].includes(position)\n ? -(isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2\n : (isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2;\n }\n\n const { angle, offset } = this.getAngleAndOffset(\n p,\n popTipWidth,\n poptipHeight,\n isArray(spaceSize) ? (spaceSize as [number, number]) : [spaceSize, spaceSize - lineWidth],\n symbolType\n );\n if (isBoolean(bgVisible)) {\n const bgSymbol = group.createOrUpdateChild(\n 'poptip-symbol-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: offsetX,\n y: offsetY,\n strokeBoundsBuffer: -1,\n boundsPadding: -2,\n anchor: [0, 0],\n symbolType,\n angle: angle,\n dx: offset[0],\n // 标签和背景同时移动\n dy: offset[1] - (backgroundStyle.space ?? 0),\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 let bgRect: IGraphic;\n if (panel.panelSymbolType) {\n bgRect = group.createOrUpdateChild(\n 'poptip-rect-panel',\n {\n ...backgroundStyle,\n visible: bgVisible && (contentVisible || titleVisible),\n x: 0,\n y: 0,\n symbolType: 'rect',\n size: [popTipWidth, poptipHeight],\n zIndex: -8\n },\n 'symbol'\n ) as ISymbol;\n } else {\n 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 }\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 anchor: [offsetX, offsetY]\n });\n\n // 添加logo和logo内的text\n if (logoSymbol) {\n const { size = 12 } = logoSymbol;\n const sizeArray = isArray(size) ? (size as [number | string, number | string]) : [size, size];\n if (sizeArray[1] === 'auto') {\n sizeArray[1] = poptipHeight;\n }\n if (sizeArray[0] === 'auto') {\n sizeArray[0] = poptipHeight;\n }\n const sizeW = sizeArray[0] as number;\n group.createOrUpdateChild(\n 'poptip-logo',\n {\n ...logoSymbol,\n x: 0,\n y: poptipHeight / 2,\n visible: bgVisible && (contentVisible || titleVisible),\n zIndex: 10,\n size: sizeArray as [number, number]\n },\n 'symbol'\n );\n group.setAttributes({\n x: -offset[0] + dx + sizeW / 2,\n y: -offset[1] + dy\n });\n if (logoText) {\n group.createOrUpdateChild(\n 'poptip-logo-text',\n {\n ...logoTextStyle,\n x: 0,\n y: poptipHeight / 2,\n visible: bgVisible && (contentVisible || titleVisible),\n text: logoText,\n textAlign: 'center',\n textBaseline: 'middle',\n zIndex: 10\n },\n 'text'\n );\n }\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 symbolType: 'arrow2Left' | string\n ): { angle: number; offset: [number, number] } {\n // const sizeW = size[0];\n const sizeH = symbolType === 'arrow2Left' ? size[1] / 2 : size[1];\n switch (position) {\n case 'tl':\n return {\n angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,\n offset: symbolType === 'arrow2Left' ? [width / 4, height + sizeH] : [0, height + sizeH]\n };\n case 'top':\n return { angle: (pi / 2) * 3, offset: [width / 2, height + sizeH] };\n case 'tr':\n return {\n angle: symbolType === 'arrow2Left' ? (pi / 2) * 3 : 0,\n offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, height + sizeH] : [width, height + sizeH]\n };\n case 'rt':\n return {\n angle: 0,\n offset: symbolType === 'arrow2Left' ? [-sizeH, height / 5] : [-sizeH, 0]\n };\n case 'right':\n return { angle: 0, offset: [-sizeH, height / 2] };\n case 'rb':\n return {\n angle: 0,\n offset: symbolType === 'arrow2Left' ? [-sizeH, (height / 5) * 4] : [-sizeH, height]\n };\n case 'bl':\n return {\n angle: symbolType === 'arrow2Left' ? pi / 2 : 0,\n offset: symbolType === 'arrow2Left' ? [width / 4, -sizeH] : [0, -sizeH]\n };\n case 'bottom':\n return { angle: pi / 2, offset: [width / 2, -sizeH] };\n case 'br':\n return {\n angle: symbolType === 'arrow2Left' ? pi / 2 : 0,\n offset: symbolType === 'arrow2Left' ? [(width / 4) * 3, -sizeH] : [width, -sizeH]\n };\n case 'lt':\n return {\n angle: symbolType === 'arrow2Left' ? pi : 0,\n offset: symbolType === 'arrow2Left' ? [width + sizeH, height / 5] : [width + sizeH, 0]\n };\n case 'left':\n return { angle: pi, offset: [width + sizeH, height / 2] };\n case 'lb':\n return {\n angle: symbolType === 'arrow2Left' ? pi : 0,\n offset: symbolType === 'arrow2Left' ? [width + sizeH, (height / 5) * 4] : [width + sizeH, height]\n };\n }\n }\n\n appearAnimate(animateConfig: { duration?: number; easing?: string; wave?: number }) {\n // 基准时间,line[0, 500], point[100, 600] 100 onebyone, pointNormal[600, 1000] 90+90 onebyone, activeLine[500, 700]\n // line和activeLine的clipRange\n const { duration = 1000, easing = 'quadOut' } = animateConfig;\n this.setAttributes({ scaleX: 0, scaleY: 0 });\n this.animate().to({ scaleX: 1, scaleY: 1 }, (duration / 3) * 2, easing as any);\n this.titleShape &&\n this.titleShape\n .animate()\n .play(new InputText({ text: '' }, { text: this.titleShape.attribute.text as string }, duration, easing as any));\n this.contentShape &&\n this.contentShape\n .animate()\n .play(\n new InputText({ text: '' }, { text: this.contentShape.attribute.text as string }, duration, easing as any)\n );\n\n // 摇摆\n if (animateConfig.wave) {\n const dur = duration / 6;\n this.group\n .animate()\n .to({ angle: animateConfig.wave }, dur, easing as any)\n .to({ angle: -animateConfig.wave }, dur * 2, easing as any)\n .to({ angle: animateConfig.wave }, dur * 2, easing as any)\n .to({ angle: 0 }, dur, easing as any);\n }\n }\n\n disappearAnimate(animateConfig: { duration?: number; easing?: string }) {\n // 基准时间,line[0, 500], point[100, 600] 100 onebyone, pointNormal[600, 1000] 90+90 onebyone, activeLine[500, 700]\n // line和activeLine的clipRange\n const { duration = 1000, easing = 'quadOut' } = animateConfig;\n this.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing as any);\n }\n}\n"]}
@@ -1,16 +1,13 @@
1
1
  import type { IGraphic, IGroupGraphicAttribute, IRectGraphicAttribute, ISymbolGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';
2
2
  import type { Padding, State } from '../core/type';
3
3
  import type { BackgroundAttributes } from '../interface';
4
- import type { IAABBBoundsLike } from '@visactor/vutils';
5
4
  type StateStyle = {
6
5
  title?: State<Partial<ITextGraphicAttribute>>;
7
6
  content?: State<Partial<ITextGraphicAttribute>>;
8
7
  panel?: State<Partial<IRectGraphicAttribute>>;
9
8
  };
10
9
  export type PopTipAttributes = {
11
- position?: 'auto' | 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb' | string[];
12
- poptipAnchor?: 'position' | 'bounds';
13
- positionBounds?: IAABBBoundsLike;
10
+ position?: 'auto' | 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb';
14
11
  title?: string | string[] | number | number[];
15
12
  titleStyle?: Partial<ITextGraphicAttribute>;
16
13
  titleFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IGraphic,\n IGroupGraphicAttribute,\n IRectGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { Padding, State } from '../core/type';\nimport type { BackgroundAttributes } from '../interface';\nimport type { IAABBBoundsLike } from '@visactor/vutils';\n\ntype StateStyle = {\n /**\n * title 文本的状态配置\n */\n title?: State<Partial<ITextGraphicAttribute>>;\n /**\n * content 文本的状态配置\n */\n content?: State<Partial<ITextGraphicAttribute>>;\n /**\n * panel 背景的状态配置ß\n */\n panel?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type PopTipAttributes = {\n /**\n * 弹出框的方位,有 12 个方位可供选择\n */\n position?:\n | 'auto'\n | 'top'\n | 'tl'\n | 'tr'\n | 'bottom'\n | 'bl'\n | 'br'\n | 'left'\n | 'lt'\n | 'lb'\n | 'right'\n | 'rt'\n | 'rb'\n | string[];\n /**\n * @since 0.22.7\n * 锚点,默认是position,即锚点在position的位置,如果设置为bounds,则锚点会基于bounds进行计算\n */\n poptipAnchor?: 'position' | 'bounds';\n /**\n * @since 0.22.7\n * 布局的包围盒\n * positionBounds 是定位的包围盒,如果配置了的话\n * position为'top' | 'tl' | 'tr': 锚点为positionBounds的上方中间位置\n * position为'bottom' | 'bl' | 'br': 锚点为positionBounds的下方中间位置\n * position为'left' | 'lt' | 'lb': 锚点为positionBounds的左侧中间位置\n * position为'right' | 'rt' | 'rb': 锚点为positionBounds的右侧中间位置\n */\n positionBounds?: IAABBBoundsLike;\n /**\n * 标题内容,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n */\n title?: string | string[] | number | number[];\n /**\n * 标题样式\n */\n titleStyle?: Partial<ITextGraphicAttribute>;\n /**\n * 标题的格式化方法\n */\n titleFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];\n /**\n * 内容文本,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n */\n content?: string | string[] | number | number[];\n /**\n * 内容文本样式\n */\n contentStyle?: Partial<ITextGraphicAttribute>;\n /**\n * 内容的格式化方法\n */\n contentFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];\n /**\n * 标题与内容的间距\n */\n space?: number;\n /**\n * 内部边距\n */\n padding?: Padding;\n /**\n * 标签的背景面板配置, TODO: 支持symbol形状\n * space: 与位置之间的距离\n * square: 是否是正方形\n */\n panel?: BackgroundAttributes &\n ISymbolGraphicAttribute & { space?: number; square?: boolean; panelSymbolType?: string };\n\n // 标签三角的模式,默认是default,即默认的三角形状,concise是紧凑型三角形状显得更简洁\n // @since 0.22.0\n triangleMode?: 'default' | 'concise';\n\n // 放置在poptip前方的logo区域\n logoSymbol?: ISymbolGraphicAttribute;\n // logo内的text\n logoText?: string | string[] | number | number[];\n // logo内的text样式\n logoTextStyle?: Partial<ITextGraphicAttribute>;\n\n /**\n * 最小宽度,像素值\n * @default 30\n */\n minWidth?: number;\n /**\n * 最大宽度,像素值。当文字超过最大宽度时,会自动省略。\n */\n maxWidth?: number;\n\n /**\n * 最大宽度比例\n */\n maxWidthPercent?: number;\n /**\n * 是否展示\n */\n visible?: boolean;\n /**\n * 自定义的展示逻辑\n */\n visibleFunc?: (graphic: IGraphic) => boolean;\n state?: StateStyle;\n dx?: number;\n dy?: number;\n} & Omit<IGroupGraphicAttribute, 'background'>;\n\nexport type PoptipShapeAttributes = {\n /**\n * 是否展示 shape\n */\n visible: boolean;\n} & Partial<ISymbolGraphicAttribute>;\n"]}
1
+ {"version":3,"sources":["../src/poptip/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IGraphic,\n IGroupGraphicAttribute,\n IRectGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { Padding, State } from '../core/type';\nimport type { BackgroundAttributes } from '../interface';\n\ntype StateStyle = {\n /**\n * title 文本的状态配置\n */\n title?: State<Partial<ITextGraphicAttribute>>;\n /**\n * content 文本的状态配置\n */\n content?: State<Partial<ITextGraphicAttribute>>;\n /**\n * panel 背景的状态配置ß\n */\n panel?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type PopTipAttributes = {\n /**\n * 弹出框的方位,有 12 个方位可供选择\n */\n position?: 'auto' | 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb';\n /**\n * 标题内容,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n */\n title?: string | string[] | number | number[];\n /**\n * 标题样式\n */\n titleStyle?: Partial<ITextGraphicAttribute>;\n /**\n * 标题的格式化方法\n */\n titleFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];\n /**\n * 内容文本,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n */\n content?: string | string[] | number | number[];\n /**\n * 内容文本样式\n */\n contentStyle?: Partial<ITextGraphicAttribute>;\n /**\n * 内容的格式化方法\n */\n contentFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];\n /**\n * 标题与内容的间距\n */\n space?: number;\n /**\n * 内部边距\n */\n padding?: Padding;\n /**\n * 标签的背景面板配置, TODO: 支持symbol形状\n * space: 与位置之间的距离\n * square: 是否是正方形\n */\n panel?: BackgroundAttributes &\n ISymbolGraphicAttribute & { space?: number; square?: boolean; panelSymbolType?: string };\n\n // 标签三角的模式,默认是default,即默认的三角形状,concise是紧凑型三角形状显得更简洁\n // @since 0.22.0\n triangleMode?: 'default' | 'concise';\n\n // 放置在poptip前方的logo区域\n logoSymbol?: ISymbolGraphicAttribute;\n // logo内的text\n logoText?: string | string[] | number | number[];\n // logo内的text样式\n logoTextStyle?: Partial<ITextGraphicAttribute>;\n\n /**\n * 最小宽度,像素值\n * @default 30\n */\n minWidth?: number;\n /**\n * 最大宽度,像素值。当文字超过最大宽度时,会自动省略。\n */\n maxWidth?: number;\n\n /**\n * 最大宽度比例\n */\n maxWidthPercent?: number;\n /**\n * 是否展示\n */\n visible?: boolean;\n /**\n * 自定义的展示逻辑\n */\n visibleFunc?: (graphic: IGraphic) => boolean;\n state?: StateStyle;\n dx?: number;\n dy?: number;\n} & Omit<IGroupGraphicAttribute, 'background'>;\n\nexport type PoptipShapeAttributes = {\n /**\n * 是否展示 shape\n */\n visible: boolean;\n} & Partial<ISymbolGraphicAttribute>;\n"]}
@@ -49,6 +49,7 @@ export declare class ScrollBar extends AbstractComponent<Required<ScrollBarAttri
49
49
  private _computeScrollValue;
50
50
  private _onSliderPointerMove;
51
51
  private _onSliderPointerMoveWithDelay;
52
+ private _clearDragEvents;
52
53
  private _onSliderPointerUp;
53
54
  private _reset;
54
55
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.ScrollBar = void 0;
6
6
 
7
- const vrender_core_1 = require("@visactor/vrender-core"), vutils_1 = require("@visactor/vutils"), base_1 = require("../core/base"), register_1 = require("./register"), constant_1 = require("../constant"), delayMap = {
7
+ const vrender_core_1 = require("@visactor/vrender-core"), vutils_1 = require("@visactor/vutils"), base_1 = require("../core/base"), register_1 = require("./register"), constant_1 = require("../constant"), event_1 = require("../util/event"), delayMap = {
8
8
  debounce: vutils_1.debounce,
9
9
  throttle: vutils_1.throttle
10
10
  };
@@ -27,17 +27,21 @@ class ScrollBar extends base_1.AbstractComponent {
27
27
  this.setScrollRange([ currentScrollValue - (range[1] - range[0]) / 2, currentScrollValue + (range[1] - range[0]) / 2 ], !1),
28
28
  this.stage && !this.stage.autoRender && this.stage.renderNextFrame();
29
29
  }, this._onSliderPointerDown = e => {
30
+ this._clearDragEvents();
30
31
  const {stopSliderDownPropagation: stopSliderDownPropagation = !0} = this.attribute;
31
32
  stopSliderDownPropagation && e.stopPropagation();
32
33
  const {direction: direction} = this.attribute, {x: x, y: y} = this.stage.eventPointTransform(e);
33
34
  this._prePos = "horizontal" === direction ? x : y, this._dispatchEvent(constant_1.SCROLLBAR_START_EVENT, {
34
35
  pos: this._prePos,
35
36
  event: e
36
- }), "browser" === vrender_core_1.vglobal.env ? (vrender_core_1.vglobal.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
37
- capture: !0
38
- }), vrender_core_1.vglobal.addEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
39
- capture: !0
40
- }), this.stage.addEventListener("pointerup", this._onSliderPointerUp), this.stage.addEventListener("pointerupoutside", this._onSliderPointerUp));
37
+ });
38
+ const triggers = (0, event_1.getEndTriggersOfDrag)(), obj = "browser" === vrender_core_1.vglobal.env ? vrender_core_1.vglobal : this.stage;
39
+ obj.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
40
+ capture: !0,
41
+ passive: !0
42
+ }), triggers.forEach((trigger => {
43
+ obj.addEventListener(trigger, this._onSliderPointerUp);
44
+ }));
41
45
  }, this._computeScrollValue = e => {
42
46
  const {direction: direction} = this.attribute, {x: x, y: y} = this.stage.eventPointTransform(e);
43
47
  let currentScrollValue, currentPos, delta = 0;
@@ -46,6 +50,7 @@ class ScrollBar extends base_1.AbstractComponent {
46
50
  currentScrollValue = delta / height) : (currentPos = x, delta = currentPos - this._prePos,
47
51
  currentScrollValue = delta / width), [ currentPos, currentScrollValue ];
48
52
  }, this._onSliderPointerMove = e => {
53
+ e.preventDefault();
49
54
  const {stopSliderMovePropagation: stopSliderMovePropagation = !0} = this.attribute;
50
55
  stopSliderMovePropagation && e.stopPropagation();
51
56
  const preScrollRange = this.getScrollRange(), [currentPos, currentScrollValue] = this._computeScrollValue(e);
@@ -53,16 +58,11 @@ class ScrollBar extends base_1.AbstractComponent {
53
58
  this._prePos = currentPos;
54
59
  }, this._onSliderPointerMoveWithDelay = 0 === this.attribute.delayTime ? this._onSliderPointerMove : delayMap[this.attribute.delayType](this._onSliderPointerMove, this.attribute.delayTime),
55
60
  this._onSliderPointerUp = e => {
56
- e.preventDefault();
57
61
  const {range: preRange, limitRange: limitRange = [ 0, 1 ]} = this.attribute, preScrollRange = this.getScrollRange(), [currentPos, currentScrollValue] = this._computeScrollValue(e), range = [ preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue ];
58
62
  this._dispatchEvent(constant_1.SCROLLBAR_END_EVENT, {
59
63
  pre: preRange,
60
64
  value: (0, vutils_1.clampRange)(range, limitRange[0], limitRange[1])
61
- }), "browser" === vrender_core_1.vglobal.env ? (vrender_core_1.vglobal.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
62
- capture: !0
63
- }), vrender_core_1.vglobal.removeEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
64
- capture: !0
65
- }), this.stage.removeEventListener("pointerup", this._onSliderPointerUp), this.stage.removeEventListener("pointerupoutside", this._onSliderPointerUp));
65
+ }), this._clearDragEvents();
66
66
  };
67
67
  }
68
68
  setScrollRange(range, render = !0) {
@@ -163,6 +163,15 @@ class ScrollBar extends base_1.AbstractComponent {
163
163
  return "horizontal" === direction ? (0, vutils_1.clampRange)([ x1 + min * width, x1 + max * width ], x1, width - sliderSize) : (0,
164
164
  vutils_1.clampRange)([ y1 + min * height, y1 + max * height ], y1, height - sliderSize);
165
165
  }
166
+ _clearDragEvents() {
167
+ const triggers = (0, event_1.getEndTriggersOfDrag)(), obj = "browser" === vrender_core_1.vglobal.env ? vrender_core_1.vglobal : this.stage;
168
+ obj.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
169
+ capture: !0,
170
+ passive: !1
171
+ }), triggers.forEach((trigger => {
172
+ obj.removeEventListener(trigger, this._onSliderPointerUp);
173
+ }));
174
+ }
166
175
  _reset() {
167
176
  this._sliderRenderBounds = null, this._sliderLimitRange = null;
168
177
  }