@visactor/vrender-components 0.12.3 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/cjs/axis/base.d.ts +2 -1
  2. package/cjs/axis/base.js +8 -6
  3. package/cjs/axis/base.js.map +1 -1
  4. package/cjs/axis/circle.d.ts +3 -2
  5. package/cjs/axis/circle.js +1 -0
  6. package/cjs/axis/circle.js.map +1 -1
  7. package/cjs/axis/line.d.ts +3 -2
  8. package/cjs/axis/line.js +26 -4
  9. package/cjs/axis/line.js.map +1 -1
  10. package/cjs/axis/overlap/auto-hide.d.ts +9 -0
  11. package/cjs/axis/overlap/auto-hide.js +62 -0
  12. package/cjs/axis/overlap/auto-hide.js.map +1 -0
  13. package/cjs/axis/overlap/auto-limit.d.ts +8 -0
  14. package/cjs/axis/overlap/auto-limit.js +21 -0
  15. package/cjs/axis/overlap/auto-limit.js.map +1 -0
  16. package/cjs/axis/overlap/auto-rotate.d.ts +7 -0
  17. package/cjs/axis/overlap/auto-rotate.js +103 -0
  18. package/cjs/axis/overlap/auto-rotate.js.map +1 -0
  19. package/cjs/axis/type.d.ts +20 -11
  20. package/cjs/axis/type.js.map +1 -1
  21. package/cjs/index.d.ts +2 -1
  22. package/cjs/index.js +10 -9
  23. package/cjs/index.js.map +1 -1
  24. package/cjs/legend/discrete/discrete.js +1 -1
  25. package/cjs/legend/discrete/discrete.js.map +1 -1
  26. package/cjs/marker/area.d.ts +4 -3
  27. package/cjs/marker/area.js +12 -4
  28. package/cjs/marker/area.js.map +1 -1
  29. package/cjs/marker/base.d.ts +5 -4
  30. package/cjs/marker/base.js +5 -5
  31. package/cjs/marker/base.js.map +1 -1
  32. package/cjs/marker/line.d.ts +4 -3
  33. package/cjs/marker/line.js +17 -6
  34. package/cjs/marker/line.js.map +1 -1
  35. package/cjs/marker/point.d.ts +16 -8
  36. package/cjs/marker/point.js +54 -26
  37. package/cjs/marker/point.js.map +1 -1
  38. package/cjs/poptip/contribution.d.ts +6 -0
  39. package/cjs/poptip/contribution.js +34 -0
  40. package/cjs/poptip/contribution.js.map +1 -0
  41. package/cjs/poptip/index.d.ts +3 -0
  42. package/cjs/poptip/index.js +22 -0
  43. package/cjs/poptip/index.js.map +1 -0
  44. package/cjs/poptip/poptip-plugin.d.ts +14 -0
  45. package/cjs/poptip/poptip-plugin.js +43 -0
  46. package/cjs/poptip/poptip-plugin.js.map +1 -0
  47. package/cjs/poptip/poptip.d.ts +13 -0
  48. package/cjs/poptip/poptip.js +201 -0
  49. package/cjs/poptip/poptip.js.map +1 -0
  50. package/cjs/poptip/register.d.ts +3 -0
  51. package/cjs/poptip/register.js +17 -0
  52. package/cjs/poptip/register.js.map +1 -0
  53. package/cjs/poptip/type.d.ts +29 -0
  54. package/cjs/poptip/type.js +6 -0
  55. package/cjs/poptip/type.js.map +1 -0
  56. package/cjs/segment/segment.d.ts +2 -2
  57. package/cjs/segment/segment.js +3 -1
  58. package/cjs/segment/segment.js.map +1 -1
  59. package/cjs/segment/type.d.ts +3 -2
  60. package/cjs/segment/type.js.map +1 -1
  61. package/cjs/tag/tag.d.ts +1 -1
  62. package/cjs/tag/tag.js +1 -1
  63. package/cjs/tag/tag.js.map +1 -1
  64. package/cjs/tooltip/tooltip.js +29 -15
  65. package/cjs/tooltip/tooltip.js.map +1 -1
  66. package/cjs/tooltip/type.d.ts +5 -2
  67. package/cjs/tooltip/type.js.map +1 -1
  68. package/cjs/tooltip/util.d.ts +3 -1
  69. package/cjs/tooltip/util.js +18 -1
  70. package/cjs/tooltip/util.js.map +1 -1
  71. package/cjs/util/text.d.ts +3 -2
  72. package/cjs/util/text.js.map +1 -1
  73. package/dist/index.js +761 -74
  74. package/dist/index.min.js +1 -1
  75. package/es/axis/base.d.ts +2 -1
  76. package/es/axis/base.js +7 -6
  77. package/es/axis/base.js.map +1 -1
  78. package/es/axis/circle.d.ts +3 -2
  79. package/es/axis/circle.js +1 -0
  80. package/es/axis/circle.js.map +1 -1
  81. package/es/axis/line.d.ts +3 -2
  82. package/es/axis/line.js +32 -4
  83. package/es/axis/line.js.map +1 -1
  84. package/es/axis/overlap/auto-hide.d.ts +9 -0
  85. package/es/axis/overlap/auto-hide.js +53 -0
  86. package/es/axis/overlap/auto-hide.js.map +1 -0
  87. package/es/axis/overlap/auto-limit.d.ts +8 -0
  88. package/es/axis/overlap/auto-limit.js +13 -0
  89. package/es/axis/overlap/auto-limit.js.map +1 -0
  90. package/es/axis/overlap/auto-rotate.d.ts +7 -0
  91. package/es/axis/overlap/auto-rotate.js +95 -0
  92. package/es/axis/overlap/auto-rotate.js.map +1 -0
  93. package/es/axis/type.d.ts +20 -11
  94. package/es/axis/type.js.map +1 -1
  95. package/es/index.d.ts +2 -1
  96. package/es/index.js +3 -1
  97. package/es/index.js.map +1 -1
  98. package/es/legend/discrete/discrete.js +1 -1
  99. package/es/legend/discrete/discrete.js.map +1 -1
  100. package/es/marker/area.d.ts +4 -3
  101. package/es/marker/area.js +12 -4
  102. package/es/marker/area.js.map +1 -1
  103. package/es/marker/base.d.ts +5 -4
  104. package/es/marker/base.js +5 -5
  105. package/es/marker/base.js.map +1 -1
  106. package/es/marker/line.d.ts +4 -3
  107. package/es/marker/line.js +17 -6
  108. package/es/marker/line.js.map +1 -1
  109. package/es/marker/point.d.ts +16 -8
  110. package/es/marker/point.js +54 -26
  111. package/es/marker/point.js.map +1 -1
  112. package/es/poptip/contribution.d.ts +6 -0
  113. package/es/poptip/contribution.js +31 -0
  114. package/es/poptip/contribution.js.map +1 -0
  115. package/es/poptip/index.d.ts +3 -0
  116. package/es/poptip/index.js +6 -0
  117. package/es/poptip/index.js.map +1 -0
  118. package/es/poptip/poptip-plugin.d.ts +14 -0
  119. package/es/poptip/poptip-plugin.js +41 -0
  120. package/es/poptip/poptip-plugin.js.map +1 -0
  121. package/es/poptip/poptip.d.ts +13 -0
  122. package/es/poptip/poptip.js +194 -0
  123. package/es/poptip/poptip.js.map +1 -0
  124. package/es/poptip/register.d.ts +3 -0
  125. package/es/poptip/register.js +17 -0
  126. package/es/poptip/register.js.map +1 -0
  127. package/es/poptip/type.d.ts +29 -0
  128. package/es/poptip/type.js +2 -0
  129. package/es/poptip/type.js.map +1 -0
  130. package/es/segment/segment.d.ts +2 -2
  131. package/es/segment/segment.js +3 -1
  132. package/es/segment/segment.js.map +1 -1
  133. package/es/segment/type.d.ts +3 -2
  134. package/es/segment/type.js.map +1 -1
  135. package/es/tag/tag.d.ts +1 -1
  136. package/es/tag/tag.js +1 -1
  137. package/es/tag/tag.js.map +1 -1
  138. package/es/tooltip/tooltip.js +30 -15
  139. package/es/tooltip/tooltip.js.map +1 -1
  140. package/es/tooltip/type.d.ts +5 -2
  141. package/es/tooltip/type.js.map +1 -1
  142. package/es/tooltip/util.d.ts +3 -1
  143. package/es/tooltip/util.js +16 -1
  144. package/es/tooltip/util.js.map +1 -1
  145. package/es/util/text.d.ts +3 -2
  146. package/es/util/text.js.map +1 -1
  147. package/package.json +8 -7
@@ -20,15 +20,15 @@ export class MarkPoint extends Marker {
20
20
  setItemAttributes(item, itemContent, itemPosition, itemType) {
21
21
  var _a;
22
22
  const {autoRotate: autoRotate = !0, refX: refX = 0, refY: refY = 0, refAngle: refAngle = 0, textStyle: textStyle, richTextStyle: richTextStyle, imageStyle: imageStyle, position: position = IMarkPointItemPosition.middle} = itemContent, itemAngle = (null === (_a = this._line) || void 0 === _a ? void 0 : _a.getEndAngle()) || 0, itemOffsetX = refX * Math.cos(itemAngle) + refY * Math.cos(itemAngle - Math.PI / 2), itemOffsetY = refX * Math.sin(itemAngle) + refY * Math.sin(itemAngle - Math.PI / 2);
23
- "text" === itemType ? item.setAttributes(Object.assign(Object.assign({}, textStyle), {
23
+ "text" === itemType ? null == item || item.setAttributes(Object.assign(Object.assign({}, textStyle), {
24
24
  textStyle: Object.assign(Object.assign({}, DEFAULT_MARK_POINT_TEXT_STYLE_MAP[(null == itemContent ? void 0 : itemContent.position) || "end"]), null == textStyle ? void 0 : textStyle.textStyle)
25
- })) : "richText" === itemType ? item.setAttributes({
25
+ })) : "richText" === itemType ? null == item || item.setAttributes({
26
26
  dx: this.getItemDx(item, position, richTextStyle) + ((null == richTextStyle ? void 0 : richTextStyle.dx) || 0),
27
27
  dy: this.getItemDy(item, position, richTextStyle) + ((null == richTextStyle ? void 0 : richTextStyle.dy) || 0)
28
- }) : "image" === itemType && item.setAttributes({
28
+ }) : "image" === itemType && (null == item || item.setAttributes({
29
29
  dx: this.getItemDx(item, position, imageStyle) + ((null == imageStyle ? void 0 : imageStyle.dx) || 0),
30
30
  dy: this.getItemDy(item, position, imageStyle) + ((null == imageStyle ? void 0 : imageStyle.dy) || 0)
31
- }), item.setAttributes({
31
+ })), null == item || item.setAttributes({
32
32
  x: itemPosition.x + (itemOffsetX || 0),
33
33
  y: itemPosition.y + (itemOffsetY || 0),
34
34
  angle: autoRotate && itemAngle + refAngle
@@ -44,16 +44,16 @@ export class MarkPoint extends Marker {
44
44
  const height = null !== (_b = null === (_a = null == item ? void 0 : item.AABBBounds) || void 0 === _a ? void 0 : _a.height()) && void 0 !== _b ? _b : (null == style ? void 0 : style.height) || 0;
45
45
  return position.includes("top") || position.includes("Top") ? -height : position.includes("middle") || position.includes("Middle") ? -height / 2 : 0;
46
46
  }
47
- renderItem(itemContent, itemPosition) {
47
+ initItem(itemContent, itemPosition) {
48
48
  const {type: type = "text", symbolStyle: symbolStyle, richTextStyle: richTextStyle, imageStyle: imageStyle, renderCustomCallback: renderCustomCallback} = itemContent;
49
49
  let item;
50
50
  return "symbol" === type ? item = createSymbol(Object.assign(Object.assign({}, itemPosition), symbolStyle)) : "text" === type ? item = new Tag(Object.assign({}, itemPosition)) : "richText" === type ? item = createRichText(Object.assign(Object.assign({}, itemPosition), richTextStyle)) : "image" === type ? item = createImage(Object.assign(Object.assign({}, itemPosition), imageStyle)) : "custom" === type && renderCustomCallback && (item = renderCustomCallback()),
51
51
  this.setItemAttributes(item, itemContent, itemPosition, type), item;
52
52
  }
53
- renderItemLine(itemLine, position, itemPosition) {
54
- const {startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle, type: type = "type-s"} = itemLine;
53
+ getItemLineAttr(itemLine, position, itemPosition) {
55
54
  let points = [];
56
- points = "type-do" === type ? [ position, {
55
+ const {type: type = "type-s"} = itemLine;
56
+ return points = "type-do" === type ? [ position, {
57
57
  x: (position.x + itemPosition.x) / 2,
58
58
  y: itemPosition.y
59
59
  }, itemPosition ] : "type-po" === type ? [ position, {
@@ -62,18 +62,33 @@ export class MarkPoint extends Marker {
62
62
  }, itemPosition ] : "type-op" === type ? [ position, {
63
63
  x: position.x,
64
64
  y: itemPosition.y
65
- }, itemPosition ] : [ position, itemPosition ];
66
- return new Segment({
65
+ }, itemPosition ] : [ position, itemPosition ], points;
66
+ }
67
+ setItemLineAttr(itemLine, position, itemPosition, visible) {
68
+ var _a;
69
+ const {startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle} = itemLine, points = this.getItemLineAttr(itemLine, position, itemPosition);
70
+ null === (_a = this._line) || void 0 === _a || _a.setAttributes({
67
71
  points: points,
68
72
  startSymbol: startSymbol,
69
73
  endSymbol: endSymbol,
70
- lineStyle: lineStyle
74
+ lineStyle: lineStyle,
75
+ visible: visible
71
76
  });
72
77
  }
73
- renderDecorativeLine(itemLine, itemPosition) {
78
+ getDecorativeLineAttr(itemLine, itemPosition) {
74
79
  var _a;
75
- const {lineStyle: lineStyle} = itemLine, decorativeLength = (null === (_a = null == itemLine ? void 0 : itemLine.decorativeLine) || void 0 === _a ? void 0 : _a.length) || 10, itemAngle = this._line.getEndAngle() || 0, startPointOffsetX = decorativeLength / 2 * Math.cos(itemAngle - Math.PI / 2), startPointOffsetY = decorativeLength / 2 * Math.sin(itemAngle - Math.PI / 2), endPointOffsetX = -decorativeLength / 2 * Math.cos(itemAngle - Math.PI / 2), endPointOffsetY = -decorativeLength / 2 * Math.sin(itemAngle - Math.PI / 2);
76
- return createLine(Object.assign({
80
+ const decorativeLength = (null === (_a = null == itemLine ? void 0 : itemLine.decorativeLine) || void 0 === _a ? void 0 : _a.length) || 10, itemAngle = this._line.getEndAngle() || 0;
81
+ return {
82
+ startPointOffsetX: decorativeLength / 2 * Math.cos(itemAngle - Math.PI / 2),
83
+ startPointOffsetY: decorativeLength / 2 * Math.sin(itemAngle - Math.PI / 2),
84
+ endPointOffsetX: -decorativeLength / 2 * Math.cos(itemAngle - Math.PI / 2),
85
+ endPointOffsetY: -decorativeLength / 2 * Math.sin(itemAngle - Math.PI / 2)
86
+ };
87
+ }
88
+ setDecorativeLineAttr(itemLine, itemPosition, visible) {
89
+ var _a;
90
+ const {lineStyle: lineStyle} = itemLine, {startPointOffsetX: startPointOffsetX, startPointOffsetY: startPointOffsetY, endPointOffsetX: endPointOffsetX, endPointOffsetY: endPointOffsetY} = this.getDecorativeLineAttr(itemLine, itemPosition);
91
+ null === (_a = this._decorativeLine) || void 0 === _a || _a.setAttributes(Object.assign(Object.assign({
77
92
  points: [ {
78
93
  x: itemPosition.x + startPointOffsetX,
79
94
  y: itemPosition.y + startPointOffsetY
@@ -81,25 +96,38 @@ export class MarkPoint extends Marker {
81
96
  x: itemPosition.x + endPointOffsetX,
82
97
  y: itemPosition.y + endPointOffsetY
83
98
  } ]
84
- }, lineStyle));
99
+ }, lineStyle), {
100
+ visible: visible
101
+ }));
85
102
  }
86
- renderMarker(container) {
103
+ initMarker(container) {
87
104
  var _a;
88
105
  const {position: position, itemLine: itemLine, itemContent: itemContent} = this.attribute, itemPosition = {
89
106
  x: position.x + ((null == itemContent ? void 0 : itemContent.offsetX) || 0),
90
107
  y: position.y + ((null == itemContent ? void 0 : itemContent.offsetY) || 0)
91
- };
92
- if (null == itemLine ? void 0 : itemLine.visible) {
93
- const line = this.renderItemLine(itemLine, position, itemPosition);
94
- if (line.name = "mark-point-line", this._line = line, container.add(line), null === (_a = null == itemLine ? void 0 : itemLine.decorativeLine) || void 0 === _a ? void 0 : _a.visible) {
95
- const decorativeLine = this.renderDecorativeLine(itemLine, itemPosition);
96
- decorativeLine.name = "mark-point-decorativeLine", this._decorativeLine = decorativeLine,
97
- container.add(decorativeLine);
98
- }
99
- }
100
- const item = this.renderItem(itemContent, itemPosition);
108
+ }, line = new Segment({
109
+ points: []
110
+ });
111
+ line.name = "mark-point-line", this._line = line, container.add(line);
112
+ const decorativeLine = createLine({
113
+ points: []
114
+ });
115
+ decorativeLine.name = "mark-point-decorativeLine", this._decorativeLine = decorativeLine,
116
+ container.add(decorativeLine), this.setItemLineAttr(itemLine, position, itemPosition, null == itemLine ? void 0 : itemLine.visible),
117
+ this.setDecorativeLineAttr(itemLine, itemPosition, null === (_a = null == itemLine ? void 0 : itemLine.decorativeLine) || void 0 === _a ? void 0 : _a.visible);
118
+ const item = this.initItem(itemContent, itemPosition);
101
119
  this._item = item, container.add(item);
102
120
  }
121
+ updateMarker() {
122
+ var _a;
123
+ const {position: position, itemLine: itemLine, itemContent: itemContent} = this.attribute, {type: type = "text"} = itemContent, itemPosition = {
124
+ x: position.x + ((null == itemContent ? void 0 : itemContent.offsetX) || 0),
125
+ y: position.y + ((null == itemContent ? void 0 : itemContent.offsetY) || 0)
126
+ };
127
+ this.setItemLineAttr(itemLine, position, itemPosition, null == itemLine ? void 0 : itemLine.visible),
128
+ this.setDecorativeLineAttr(itemLine, itemPosition, null === (_a = null == itemLine ? void 0 : itemLine.decorativeLine) || void 0 === _a ? void 0 : _a.visible),
129
+ this.setItemAttributes(this._item, itemContent, itemPosition, type);
130
+ }
103
131
  }
104
132
 
105
133
  MarkPoint.defaultAttributes = DEFAULT_MARK_POINT_THEME;
@@ -1 +1 @@
1
- {"version":3,"sources":["marker/point.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,UAAU,EASX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAc,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY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ED,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,WAAkB,EAAE,YAAY,CAAC,CAAC;QAC/D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,SAAS,CAAC,GAAG,CAAC,IAAwB,CAAC,CAAC;IAC1C,CAAC;;AAhNM,2BAAiB,GAAG,wBAAwB,CAAC","file":"point.js","sourcesContent":["import {\n createRichText,\n createSymbol,\n createImage,\n createLine,\n IGroup,\n IImage,\n INode,\n ISymbol,\n IImageGraphicAttribute,\n IRichText,\n IRichTextGraphicAttribute,\n ILine\n} from '@visactor/vrender';\nimport { IPointLike, merge } from '@visactor/vutils';\nimport { Segment } from '../segment';\nimport { Tag } from '../tag';\nimport { Marker } from './base';\nimport { DEFAULT_MARK_POINT_TEXT_STYLE_MAP, DEFAULT_MARK_POINT_THEME } from './config';\nimport { IItemContent, IItemLine, IMarkPointItemPosition, MarkPointAttrs } from './type';\n\nexport class MarkPoint extends Marker<MarkPointAttrs> {\n static defaultAttributes = DEFAULT_MARK_POINT_THEME;\n\n private _item!: ISymbol | Tag | IImage | IRichText;\n\n private _line?: Segment;\n\n private _decorativeLine!: ILine;\n\n constructor(attributes: MarkPointAttrs) {\n super(merge({}, MarkPoint.defaultAttributes, attributes));\n }\n\n protected setLabelPos() {\n //do nothing\n }\n\n protected setItemAttributes(\n item: ISymbol | Tag | IImage | IRichText,\n itemContent: IItemContent,\n itemPosition: IPointLike,\n itemType: 'symbol' | 'text' | 'image' | 'richText' | 'custom'\n ) {\n const {\n autoRotate = true,\n refX = 0,\n refY = 0,\n refAngle = 0,\n textStyle,\n richTextStyle,\n imageStyle,\n position = IMarkPointItemPosition.middle\n } = itemContent;\n const itemAngle = this._line?.getEndAngle() || 0;\n const itemOffsetX = refX * Math.cos(itemAngle) + refY * Math.cos(itemAngle - Math.PI / 2);\n const itemOffsetY = refX * Math.sin(itemAngle) + refY * Math.sin(itemAngle - Math.PI / 2);\n if (itemType === 'text') {\n item.setAttributes({\n ...textStyle,\n textStyle: {\n ...DEFAULT_MARK_POINT_TEXT_STYLE_MAP[itemContent?.position || 'end'],\n ...textStyle?.textStyle\n }\n });\n } else if (itemType === 'richText') {\n item.setAttributes({\n dx: this.getItemDx(item, position, richTextStyle) + (richTextStyle?.dx || 0),\n dy: this.getItemDy(item, position, richTextStyle) + (richTextStyle?.dy || 0)\n });\n } else if (itemType === 'image') {\n item.setAttributes({\n dx: this.getItemDx(item, position, imageStyle) + (imageStyle?.dx || 0),\n dy: this.getItemDy(item, position, imageStyle) + (imageStyle?.dy || 0)\n });\n }\n item.setAttributes({\n x: itemPosition.x + (itemOffsetX || 0),\n y: itemPosition.y + (itemOffsetY || 0),\n angle: autoRotate && itemAngle + refAngle\n });\n }\n\n protected getItemDx(\n item: ISymbol | Tag | IImage | IRichText,\n position: IMarkPointItemPosition,\n style?: IImageGraphicAttribute | IRichTextGraphicAttribute\n ) {\n const width = (item as IGroup)?.AABBBounds?.width() ?? (style?.width || 0);\n if (position.includes('inside')) {\n return -width;\n } else if (position === 'insideTop') {\n return 0;\n }\n return 0;\n }\n\n protected getItemDy(\n item: ISymbol | Tag | IImage | IRichText,\n position: IMarkPointItemPosition,\n style?: IImageGraphicAttribute | IRichTextGraphicAttribute\n ) {\n const height = (item as IGroup)?.AABBBounds?.height() ?? (style?.height || 0);\n if (position.includes('top') || position.includes('Top')) {\n return -height;\n } else if (position.includes('middle') || position.includes('Middle')) {\n return -height / 2;\n }\n return 0;\n }\n\n protected renderItem(itemContent: IItemContent, itemPosition: IPointLike) {\n const { type = 'text', symbolStyle, richTextStyle, imageStyle, renderCustomCallback } = itemContent;\n let item: ISymbol | Tag | IImage | IRichText | IGroup;\n if (type === 'symbol') {\n item = createSymbol({\n ...itemPosition,\n ...symbolStyle\n });\n } else if (type === 'text') {\n item = new Tag({\n ...itemPosition\n });\n } else if (type === 'richText') {\n item = createRichText({\n ...itemPosition,\n ...richTextStyle\n });\n } else if (type === 'image') {\n item = createImage({\n ...itemPosition,\n ...imageStyle\n });\n } else if (type === 'custom' && renderCustomCallback) {\n item = renderCustomCallback();\n }\n this.setItemAttributes(item, itemContent, itemPosition, type);\n return item;\n }\n\n protected renderItemLine(itemLine: IItemLine, position: IPointLike, itemPosition: IPointLike) {\n const { startSymbol, endSymbol, lineStyle, type = 'type-s' } = itemLine;\n let points: IPointLike[] = [];\n if (type === 'type-do') {\n points = [\n position,\n {\n x: (position.x + itemPosition.x) / 2,\n y: itemPosition.y\n },\n itemPosition\n ];\n } else if (type === 'type-po') {\n points = [\n position,\n {\n x: itemPosition.x,\n y: position.y\n },\n itemPosition\n ];\n } else if (type === 'type-op') {\n points = [\n position,\n {\n x: position.x,\n y: itemPosition.y\n },\n itemPosition\n ];\n } else {\n points = [position, itemPosition];\n }\n\n const line = new Segment({\n points,\n startSymbol,\n endSymbol,\n lineStyle\n });\n return line;\n }\n\n protected renderDecorativeLine(itemLine: IItemLine, itemPosition: IPointLike) {\n const { lineStyle } = itemLine;\n const decorativeLength = itemLine?.decorativeLine?.length || 10;\n const itemAngle = this._line.getEndAngle() || 0;\n const startPointOffsetX = (decorativeLength / 2) * Math.cos(itemAngle - Math.PI / 2);\n const startPointOffsetY = (decorativeLength / 2) * Math.sin(itemAngle - Math.PI / 2);\n const endPointOffsetX = (-decorativeLength / 2) * Math.cos(itemAngle - Math.PI / 2);\n const endPointOffsetY = (-decorativeLength / 2) * Math.sin(itemAngle - Math.PI / 2);\n return createLine({\n points: [\n {\n x: itemPosition.x + startPointOffsetX,\n y: itemPosition.y + startPointOffsetY\n },\n {\n x: itemPosition.x + endPointOffsetX,\n y: itemPosition.y + endPointOffsetY\n }\n ],\n ...lineStyle\n });\n }\n\n protected renderMarker(container: IGroup) {\n const { position, itemLine, itemContent } = this.attribute as MarkPointAttrs;\n const itemPosition = {\n x: position.x + (itemContent?.offsetX || 0),\n y: position.y + (itemContent?.offsetY || 0)\n };\n\n if (itemLine?.visible) {\n const line = this.renderItemLine(itemLine, position, itemPosition);\n line.name = 'mark-point-line';\n this._line = line;\n container.add(line as unknown as INode);\n\n if (itemLine?.decorativeLine?.visible) {\n const decorativeLine = this.renderDecorativeLine(itemLine, itemPosition);\n decorativeLine.name = 'mark-point-decorativeLine';\n this._decorativeLine = decorativeLine;\n container.add(decorativeLine as unknown as INode);\n }\n }\n\n const item = this.renderItem(itemContent as any, itemPosition);\n this._item = item;\n container.add(item as unknown as INode);\n }\n}\n"]}
1
+ {"version":3,"sources":["marker/point.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE1F,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,iCAAiC,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAEhD,MAAM,OAAO,SAAU,SAAQ,MAAsB;IASnD,YAAY,UAA0B;QACpC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC5D,CAAC;IAES,WAAW;IAErB,CAAC;IAES,iBAAiB,CACzB,IAAwC,EACxC,WAAyB,EACzB,YAAwB,EACxB,QAA6D;;QAE7D,MAAM,EACJ,UAAU,GAAG,IAAI,EACjB,IAAI,GAAG,CAAC,EACR,IAAI,GAAG,CAAC,EACR,QAAQ,GAAG,CAAC,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,GAAG,sBAAsB,CAAC,MAAM,EACzC,GAAG,WAAW,CAAC;QAChB,MAAM,SAAS,GAAG,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,WAAW,EA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,IAAI,CAAC,QAAQ,CAAC,WAAkB,EAAE,YAAY,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,SAAS,CAAC,GAAG,CAAC,IAAwB,CAAC,CAAC;IAC1C,CAAC;IAES,YAAY;;QACpB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,SAA2B,CAAC;QAC7E,MAAM,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,WAAW,CAAC;QACtC,MAAM,YAAY,GAAG;YACnB,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,KAAI,CAAC,CAAC;YAC3C,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,KAAI,CAAC,CAAC;SAC5C,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,CAAC,CAAC;QAC1E,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,cAAc,0CAAE,OAAO,CAAC,CAAC;QACtF,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;;AAlPM,2BAAiB,GAAG,wBAAwB,CAAC","file":"point.js","sourcesContent":["import type {\n IGroup,\n IImage,\n INode,\n ISymbol,\n IImageGraphicAttribute,\n IRichText,\n IRichTextGraphicAttribute,\n ILine\n} from '@visactor/vrender';\nimport { createRichText, createSymbol, createImage, createLine } from '@visactor/vrender';\nimport type { IPointLike } from '@visactor/vutils';\nimport { merge } from '@visactor/vutils';\nimport { Segment } from '../segment';\nimport { Tag } from '../tag';\nimport { Marker } from './base';\nimport { DEFAULT_MARK_POINT_TEXT_STYLE_MAP, DEFAULT_MARK_POINT_THEME } from './config';\nimport type { IItemContent, IItemLine, MarkPointAttrs } from './type';\nimport { IMarkPointItemPosition } from './type';\n\nexport class MarkPoint extends Marker<MarkPointAttrs> {\n static defaultAttributes = DEFAULT_MARK_POINT_THEME;\n\n private _item!: ISymbol | Tag | IImage | IRichText;\n\n private _line?: Segment;\n\n private _decorativeLine!: ILine;\n\n constructor(attributes: MarkPointAttrs) {\n super(merge({}, MarkPoint.defaultAttributes, attributes));\n }\n\n protected setLabelPos() {\n //do nothing\n }\n\n protected setItemAttributes(\n item: ISymbol | Tag | IImage | IRichText,\n itemContent: IItemContent,\n itemPosition: IPointLike,\n itemType: 'symbol' | 'text' | 'image' | 'richText' | 'custom'\n ) {\n const {\n autoRotate = true,\n refX = 0,\n refY = 0,\n refAngle = 0,\n textStyle,\n richTextStyle,\n imageStyle,\n position = IMarkPointItemPosition.middle\n } = itemContent;\n const itemAngle = this._line?.getEndAngle() || 0;\n const itemOffsetX = refX * Math.cos(itemAngle) + refY * Math.cos(itemAngle - Math.PI / 2);\n const itemOffsetY = refX * Math.sin(itemAngle) + refY * Math.sin(itemAngle - Math.PI / 2);\n if (itemType === 'text') {\n item?.setAttributes({\n ...textStyle,\n textStyle: {\n ...DEFAULT_MARK_POINT_TEXT_STYLE_MAP[itemContent?.position || 'end'],\n ...textStyle?.textStyle\n }\n });\n } else if (itemType === 'richText') {\n item?.setAttributes({\n dx: this.getItemDx(item, position, richTextStyle) + (richTextStyle?.dx || 0),\n dy: this.getItemDy(item, position, richTextStyle) + (richTextStyle?.dy || 0)\n });\n } else if (itemType === 'image') {\n item?.setAttributes({\n dx: this.getItemDx(item, position, imageStyle) + (imageStyle?.dx || 0),\n dy: this.getItemDy(item, position, imageStyle) + (imageStyle?.dy || 0)\n });\n }\n item?.setAttributes({\n x: itemPosition.x + (itemOffsetX || 0),\n y: itemPosition.y + (itemOffsetY || 0),\n angle: autoRotate && itemAngle + refAngle\n });\n }\n\n protected getItemDx(\n item: ISymbol | Tag | IImage | IRichText,\n position: IMarkPointItemPosition,\n style?: IImageGraphicAttribute | IRichTextGraphicAttribute\n ) {\n const width = (item as IGroup)?.AABBBounds?.width() ?? (style?.width || 0);\n if (position.includes('inside')) {\n return -width;\n } else if (position === 'insideTop') {\n return 0;\n }\n return 0;\n }\n\n protected getItemDy(\n item: ISymbol | Tag | IImage | IRichText,\n position: IMarkPointItemPosition,\n style?: IImageGraphicAttribute | IRichTextGraphicAttribute\n ) {\n const height = (item as IGroup)?.AABBBounds?.height() ?? (style?.height || 0);\n if (position.includes('top') || position.includes('Top')) {\n return -height;\n } else if (position.includes('middle') || position.includes('Middle')) {\n return -height / 2;\n }\n return 0;\n }\n\n protected initItem(itemContent: IItemContent, itemPosition: IPointLike) {\n const { type = 'text', symbolStyle, richTextStyle, imageStyle, renderCustomCallback } = itemContent;\n let item: ISymbol | Tag | IImage | IRichText | IGroup;\n if (type === 'symbol') {\n item = createSymbol({\n ...itemPosition,\n ...symbolStyle\n });\n } else if (type === 'text') {\n item = new Tag({\n ...itemPosition\n });\n } else if (type === 'richText') {\n item = createRichText({\n ...itemPosition,\n ...richTextStyle\n });\n } else if (type === 'image') {\n item = createImage({\n ...itemPosition,\n ...imageStyle\n });\n } else if (type === 'custom' && renderCustomCallback) {\n item = renderCustomCallback();\n }\n this.setItemAttributes(item, itemContent, itemPosition, type);\n return item;\n }\n\n protected getItemLineAttr(itemLine: IItemLine, position: IPointLike, itemPosition: IPointLike) {\n let points: IPointLike[] = [];\n const { type = 'type-s' } = itemLine;\n if (type === 'type-do') {\n points = [\n position,\n {\n x: (position.x + itemPosition.x) / 2,\n y: itemPosition.y\n },\n itemPosition\n ];\n } else if (type === 'type-po') {\n points = [\n position,\n {\n x: itemPosition.x,\n y: position.y\n },\n itemPosition\n ];\n } else if (type === 'type-op') {\n points = [\n position,\n {\n x: position.x,\n y: itemPosition.y\n },\n itemPosition\n ];\n } else {\n points = [position, itemPosition];\n }\n return points;\n }\n\n protected setItemLineAttr(itemLine: IItemLine, position: IPointLike, itemPosition: IPointLike, visible: boolean) {\n const { startSymbol, endSymbol, lineStyle } = itemLine;\n const points = this.getItemLineAttr(itemLine, position, itemPosition);\n this._line?.setAttributes({\n points,\n startSymbol,\n endSymbol,\n lineStyle,\n visible\n });\n }\n\n protected getDecorativeLineAttr(itemLine: IItemLine, itemPosition: IPointLike) {\n const decorativeLength = itemLine?.decorativeLine?.length || 10;\n const itemAngle = this._line.getEndAngle() || 0;\n const startPointOffsetX = (decorativeLength / 2) * Math.cos(itemAngle - Math.PI / 2);\n const startPointOffsetY = (decorativeLength / 2) * Math.sin(itemAngle - Math.PI / 2);\n const endPointOffsetX = (-decorativeLength / 2) * Math.cos(itemAngle - Math.PI / 2);\n const endPointOffsetY = (-decorativeLength / 2) * Math.sin(itemAngle - Math.PI / 2);\n return {\n startPointOffsetX,\n startPointOffsetY,\n endPointOffsetX,\n endPointOffsetY\n };\n }\n\n protected setDecorativeLineAttr(itemLine: IItemLine, itemPosition: IPointLike, visible: boolean) {\n const { lineStyle } = itemLine;\n const { startPointOffsetX, startPointOffsetY, endPointOffsetX, endPointOffsetY } = this.getDecorativeLineAttr(\n itemLine,\n itemPosition\n );\n this._decorativeLine?.setAttributes({\n points: [\n {\n x: itemPosition.x + startPointOffsetX,\n y: itemPosition.y + startPointOffsetY\n },\n {\n x: itemPosition.x + endPointOffsetX,\n y: itemPosition.y + endPointOffsetY\n }\n ],\n ...lineStyle,\n visible\n });\n }\n\n protected initMarker(container: IGroup) {\n const { position, itemLine, itemContent } = this.attribute as MarkPointAttrs;\n const itemPosition = {\n x: position.x + (itemContent?.offsetX || 0),\n y: position.y + (itemContent?.offsetY || 0)\n };\n\n const line = new Segment({\n points: []\n });\n line.name = 'mark-point-line';\n this._line = line;\n container.add(line as unknown as INode);\n\n const decorativeLine = createLine({\n points: []\n });\n decorativeLine.name = 'mark-point-decorativeLine';\n this._decorativeLine = decorativeLine;\n container.add(decorativeLine as unknown as INode);\n\n this.setItemLineAttr(itemLine, position, itemPosition, itemLine?.visible);\n this.setDecorativeLineAttr(itemLine, itemPosition, itemLine?.decorativeLine?.visible);\n\n const item = this.initItem(itemContent as any, itemPosition);\n this._item = item;\n container.add(item as unknown as INode);\n }\n\n protected updateMarker() {\n const { position, itemLine, itemContent } = this.attribute as MarkPointAttrs;\n const { type = 'text' } = itemContent;\n const itemPosition = {\n x: position.x + (itemContent?.offsetX || 0),\n y: position.y + (itemContent?.offsetY || 0)\n };\n this.setItemLineAttr(itemLine, position, itemPosition, itemLine?.visible);\n this.setDecorativeLineAttr(itemLine, itemPosition, itemLine?.decorativeLine?.visible);\n this.setItemAttributes(this._item, itemContent, itemPosition, type);\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { IContext2d, IGraphic, IGraphicAttribute, IInteractiveSubRenderContribution, IThemeAttribute, IDrawContext } from '@visactor/vrender';
2
+ import { PopTip } from './poptip';
3
+ export declare class PopTipRenderContribution implements IInteractiveSubRenderContribution {
4
+ poptipComponent: PopTip;
5
+ render(graphic: IGraphic<Partial<IGraphicAttribute>>, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, graphicAttribute: Required<IGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, options?: any): void;
6
+ }
@@ -0,0 +1,31 @@
1
+ var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
2
+ var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
3
+ if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
4
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
5
+ };
6
+
7
+ import { injectable } from "inversify";
8
+
9
+ import { PopTip } from "./poptip";
10
+
11
+ let PopTipRenderContribution = class {
12
+ render(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
13
+ if (graphic._showPoptip) {
14
+ const {visible: visible, visibleCb: visibleCb} = graphic.attribute.poptip;
15
+ if (!1 === visible || visibleCb && !1 === visibleCb(graphic)) return;
16
+ this.poptipComponent || (this.poptipComponent = new PopTip(graphic.attribute.poptip)),
17
+ this.poptipComponent.setAttributes(Object.assign(Object.assign({}, graphic.attribute.poptip), {
18
+ x: 0,
19
+ y: 0,
20
+ postMatrix: graphic.globalTransMatrix
21
+ }));
22
+ const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
23
+ interactiveLayer && interactiveLayer.add(this.poptipComponent);
24
+ }
25
+ }
26
+ };
27
+
28
+ PopTipRenderContribution = __decorate([ injectable() ], PopTipRenderContribution);
29
+
30
+ export { PopTipRenderContribution };
31
+ //# sourceMappingURL=contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["poptip/contribution.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AASvC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAG3B,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,EAAE;YACvB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAI,OAAO,CAAC,SAAiB,CAAC,MAAM,CAAC;YACjE,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC,EAAE;gBACpE,OAAO;aACR;YACD,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB,IAAI,CAAC,eAAe,GAAG,IAAI,MAAM,CAAE,OAAO,CAAC,SAAiB,CAAC,MAAM,CAAC,CAAC;aACtE;YACD,IAAI,CAAC,eAAe,CAAC,aAAa,iCAC5B,OAAO,CAAC,SAAiB,CAAC,MAAM,KACpC,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,UAAU,EAAE,OAAO,CAAC,iBAAiB,IACrC,CAAC;YAEH,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;IACH,CAAC;CACF,CAAA;AAtCY,wBAAwB;IADpC,UAAU,EAAE;GACA,wBAAwB,CAsCpC;SAtCY,wBAAwB","file":"contribution.js","sourcesContent":["import { injectable } from 'inversify';\nimport type {\n IContext2d,\n IGraphic,\n IGraphicAttribute,\n IInteractiveSubRenderContribution,\n IThemeAttribute,\n IDrawContext\n} from '@visactor/vrender';\nimport { PopTip } from './poptip';\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) {\n const { visible, visibleCb } = (graphic.attribute as any).poptip;\n if (visible === false || (visibleCb && visibleCb(graphic) === false)) {\n return;\n }\n if (!this.poptipComponent) {\n this.poptipComponent = new PopTip((graphic.attribute as any).poptip);\n }\n this.poptipComponent.setAttributes({\n ...(graphic.attribute as any).poptip,\n x: 0,\n y: 0,\n postMatrix: graphic.globalTransMatrix\n });\n // 添加到交互层中\n const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');\n if (interactiveLayer) {\n interactiveLayer.add(this.poptipComponent);\n }\n }\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export * from './poptip';
2
+ export * from './type';
3
+ export * from './register';
@@ -0,0 +1,6 @@
1
+ export * from "./poptip";
2
+
3
+ export * from "./type";
4
+
5
+ export * from "./register";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["poptip/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC","file":"index.js","sourcesContent":["export * from './poptip';\nexport * from './type';\nexport * from './register';\n"]}
@@ -0,0 +1,14 @@
1
+ import type { FederatedPointerEvent, IGraphic, IPlugin, IPluginService } from '@visactor/vrender';
2
+ export declare class PopTipPlugin implements IPlugin {
3
+ name: 'poptip';
4
+ activeEvent: 'onRegister';
5
+ pluginService: IPluginService;
6
+ _uid: number;
7
+ key: string;
8
+ activeGraphic: IGraphic;
9
+ activate(context: IPluginService): void;
10
+ poptip: (e: FederatedPointerEvent) => void;
11
+ unpoptip: (e: FederatedPointerEvent) => void;
12
+ setActiveGraphic(graphic: any | null, rerender?: boolean): void;
13
+ deactivate(context: IPluginService): void;
14
+ }
@@ -0,0 +1,41 @@
1
+ var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
2
+ var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
3
+ if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
4
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
5
+ };
6
+
7
+ import { injectable } from "inversify";
8
+
9
+ import { Generator } from "@visactor/vrender";
10
+
11
+ let PopTipPlugin = class {
12
+ constructor() {
13
+ this.name = "poptip", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(),
14
+ this.key = this.name + this._uid, this.poptip = e => {
15
+ const graphic = e.target;
16
+ if (graphic.isContainer || !graphic.attribute || graphic === this.activeGraphic) return void this.unpoptip(e);
17
+ const {poptip: poptip} = graphic.attribute;
18
+ poptip && (graphic._showPoptip = !0), this.activeGraphic && (this.activeGraphic._showPoptip = !1),
19
+ this.setActiveGraphic(graphic, !0);
20
+ }, this.unpoptip = e => {
21
+ this.activeGraphic && (this.activeGraphic._showPoptip = !1, this.setActiveGraphic(null, !0));
22
+ };
23
+ }
24
+ activate(context) {
25
+ this.pluginService = context;
26
+ const {stage: stage} = this.pluginService;
27
+ stage.addEventListener("pointerover", this.poptip);
28
+ }
29
+ setActiveGraphic(graphic, rerender) {
30
+ this.activeGraphic = graphic, this.pluginService.stage.renderNextFrame();
31
+ }
32
+ deactivate(context) {
33
+ const {stage: stage} = this.pluginService;
34
+ stage.removeEventListener("pointerover", this.poptip);
35
+ }
36
+ };
37
+
38
+ PopTipPlugin = __decorate([ injectable() ], PopTipPlugin);
39
+
40
+ export { PopTipPlugin };
41
+ //# sourceMappingURL=poptip-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["poptip/poptip-plugin.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EA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CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IA2BD,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;IACxD,CAAC;CACF,CAAA;AAlDY,YAAY;IADxB,UAAU,EAAE;GACA,YAAY,CAkDxB;SAlDY,YAAY","file":"poptip-plugin.js","sourcesContent":["import { injectable } from 'inversify';\nimport type { FederatedPointerEvent, IGraphic, IPlugin, IPluginService } from '@visactor/vrender';\nimport { Generator } from '@visactor/vrender';\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 || graphic === this.activeGraphic) {\n this.unpoptip(e);\n return;\n }\n const { poptip } = graphic.attribute;\n if (poptip) {\n graphic._showPoptip = true;\n }\n\n if (this.activeGraphic) {\n this.activeGraphic._showPoptip = false;\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._showPoptip = false;\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"]}
@@ -0,0 +1,13 @@
1
+ import { AbstractComponent } from '../core/base';
2
+ import type { PopTipAttributes } from './type';
3
+ export declare class PopTip extends AbstractComponent<Required<PopTipAttributes>> {
4
+ name: string;
5
+ static defaultAttributes: Partial<PopTipAttributes>;
6
+ constructor(attributes: PopTipAttributes);
7
+ protected render(): void;
8
+ getAngleAndOffset(position: string, width: number, height: number, size: [number, number]): {
9
+ angle: number;
10
+ offset: [number, number];
11
+ rectOffset: [number, number];
12
+ };
13
+ }
@@ -0,0 +1,194 @@
1
+ var __rest = this && this.__rest || function(s, e) {
2
+ var t = {};
3
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
4
+ if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
5
+ var i = 0;
6
+ for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
7
+ }
8
+ return t;
9
+ };
10
+
11
+ import { isArray, isBoolean, isEmpty, isValid, max, merge, normalizePadding, pi } from "@visactor/vutils";
12
+
13
+ import { AbstractComponent } from "../core/base";
14
+
15
+ export class PopTip extends AbstractComponent {
16
+ constructor(attributes) {
17
+ super(merge({}, PopTip.defaultAttributes, attributes)), this.name = "poptip";
18
+ }
19
+ render() {
20
+ var _a, _b;
21
+ const {title: title = "", titleStyle: titleStyle = {}, position: position, content: content = "", contentStyle: contentStyle = {}, panel: panel = {}, space: space = 4, minWidth: minWidth = 0, maxWidth: maxWidth = 1 / 0, padding: padding = 4, visible: visible, state: state, dx: dx = 0, dy: dy = 0} = this.attribute, parsedPadding = normalizePadding(padding), group = this.createOrUpdateChild("poptip-content", {
22
+ x: 0,
23
+ y: 0,
24
+ zIndex: 1
25
+ }, "group"), maxLineWidth = maxWidth - parsedPadding[1] - parsedPadding[3], titleVisible = isValid(title) && !1 !== visible, titleAttrs = Object.assign(Object.assign({
26
+ text: title,
27
+ visible: titleVisible
28
+ }, titleStyle), {
29
+ x: parsedPadding[3],
30
+ y: parsedPadding[0],
31
+ maxLineWidth: maxLineWidth,
32
+ textAlign: "left",
33
+ textBaseline: "top"
34
+ }), titleShape = group.createOrUpdateChild("poptip-title", titleAttrs, "text");
35
+ isEmpty(null == state ? void 0 : state.title) || (titleShape.states = state.title);
36
+ const titleBounds = titleShape.AABBBounds, titleHeight = titleBounds.height(), titleWidth = titleBounds.width();
37
+ let height = titleHeight + space;
38
+ titleVisible || (height = 0);
39
+ const contentVisible = isValid(content) && !1 !== visible, contentAttrs = Object.assign(Object.assign({
40
+ text: content,
41
+ visible: contentVisible
42
+ }, contentStyle), {
43
+ x: parsedPadding[3],
44
+ y: parsedPadding[0] + height,
45
+ maxLineWidth: maxLineWidth,
46
+ textAlign: "left",
47
+ textBaseline: "top"
48
+ }), contentShape = group.createOrUpdateChild("poptip-content", contentAttrs, "text");
49
+ isEmpty(null == state ? void 0 : state.content) || (contentShape.states = state.content);
50
+ const contentBounds = contentShape.AABBBounds, contentHeight = contentBounds.height(), contentWidth = contentBounds.width();
51
+ contentVisible && (height += contentHeight);
52
+ let popTipWidth = max(titleWidth + parsedPadding[1] + parsedPadding[3], contentWidth + parsedPadding[1] + parsedPadding[3]);
53
+ popTipWidth > maxWidth ? popTipWidth = maxWidth : popTipWidth < minWidth && (popTipWidth = minWidth);
54
+ const poptipHeight = parsedPadding[0] + parsedPadding[2] + height, {visible: bgVisible} = panel, backgroundStyle = __rest(panel, [ "visible" ]), symbolSize = null !== (_a = backgroundStyle.size) && void 0 !== _a ? _a : 12, lineWidth = null !== (_b = backgroundStyle.lineWidth) && void 0 !== _b ? _b : 1, {angle: angle, offset: offset, rectOffset: rectOffset} = this.getAngleAndOffset(position, popTipWidth, poptipHeight, isArray(symbolSize) ? symbolSize : [ symbolSize, symbolSize - lineWidth ]);
55
+ if (isBoolean(bgVisible)) {
56
+ const offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4, bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
57
+ visible: bgVisible && (contentVisible || titleVisible),
58
+ x: offsetX,
59
+ y: 0,
60
+ anchor: [ 0, 0 ],
61
+ symbolType: "arrow2Left",
62
+ angle: angle,
63
+ dx: offset[0],
64
+ dy: offset[1],
65
+ size: symbolSize,
66
+ zIndex: -9
67
+ }), "symbol");
68
+ isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel);
69
+ const bgRect = group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
70
+ visible: bgVisible && (contentVisible || titleVisible),
71
+ x: 0,
72
+ y: 0,
73
+ width: popTipWidth,
74
+ height: poptipHeight,
75
+ zIndex: -10
76
+ }), "rect");
77
+ isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
78
+ }
79
+ group.setAttributes({
80
+ x: -offset[0] + dx,
81
+ y: -offset[1] + dy
82
+ });
83
+ }
84
+ getAngleAndOffset(position, width, height, size) {
85
+ const sizeH = size[1] / 2;
86
+ switch (position) {
87
+ case "tl":
88
+ return {
89
+ angle: pi / 2 * 3,
90
+ offset: [ width / 4, height + sizeH ],
91
+ rectOffset: [ -width / 4, -height - size[1] ]
92
+ };
93
+
94
+ case "top":
95
+ return {
96
+ angle: pi / 2 * 3,
97
+ offset: [ width / 2, height + sizeH ],
98
+ rectOffset: [ 0, -height - size[1] ]
99
+ };
100
+
101
+ case "tr":
102
+ return {
103
+ angle: pi / 2 * 3,
104
+ offset: [ width / 4 * 3, height + sizeH ],
105
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
106
+ };
107
+
108
+ case "rt":
109
+ return {
110
+ angle: 0,
111
+ offset: [ -sizeH, height / 5 ],
112
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
113
+ };
114
+
115
+ case "right":
116
+ return {
117
+ angle: 0,
118
+ offset: [ -sizeH, height / 2 ],
119
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
120
+ };
121
+
122
+ case "rb":
123
+ return {
124
+ angle: 0,
125
+ offset: [ -sizeH, height / 5 * 4 ],
126
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
127
+ };
128
+
129
+ case "bl":
130
+ return {
131
+ angle: pi / 2,
132
+ offset: [ width / 4, -sizeH ],
133
+ rectOffset: [ -width / 4, -height - size[1] ]
134
+ };
135
+
136
+ case "bottom":
137
+ return {
138
+ angle: pi / 2,
139
+ offset: [ width / 2, -sizeH ],
140
+ rectOffset: [ 0, -height - size[1] ]
141
+ };
142
+
143
+ case "br":
144
+ return {
145
+ angle: pi / 2,
146
+ offset: [ width / 4 * 3, -sizeH ],
147
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
148
+ };
149
+
150
+ case "lt":
151
+ return {
152
+ angle: pi,
153
+ offset: [ width + sizeH, height / 5 ],
154
+ rectOffset: [ -width / 4, -height - size[1] ]
155
+ };
156
+
157
+ case "left":
158
+ return {
159
+ angle: pi,
160
+ offset: [ width + sizeH, height / 2 ],
161
+ rectOffset: [ 0, -height - size[1] ]
162
+ };
163
+
164
+ case "lb":
165
+ return {
166
+ angle: pi,
167
+ offset: [ width + sizeH, height / 5 * 4 ],
168
+ rectOffset: [ width / 4 * 3, -height - size[1] ]
169
+ };
170
+ }
171
+ }
172
+ }
173
+
174
+ PopTip.defaultAttributes = {
175
+ position: "rt",
176
+ visible: !0,
177
+ title: null,
178
+ content: null,
179
+ titleStyle: {
180
+ fontSize: 12,
181
+ fill: "#000",
182
+ textAlign: "left",
183
+ textBaseline: "top"
184
+ },
185
+ contentStyle: {
186
+ fontSize: 12,
187
+ fill: "#000",
188
+ textAlign: "left",
189
+ textBaseline: "top"
190
+ },
191
+ space: 8,
192
+ padding: 10
193
+ };
194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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,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';\nimport { isArray, isBoolean, isEmpty, isValid, max, merge, normalizePadding, pi } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { BackgroundAttributes } from '../interface';\nimport type { PopTipAttributes } from './type';\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 space: 8,\n padding: 10\n };\n\n constructor(attributes: PopTipAttributes) {\n super(merge({}, PopTip.defaultAttributes, attributes));\n }\n\n protected render() {\n const {\n title = '',\n titleStyle = {} as ITextGraphicAttribute,\n position,\n content = '',\n contentStyle = {} as ITextGraphicAttribute,\n panel = {} as BackgroundAttributes & ISymbolGraphicAttribute,\n space = 4,\n minWidth = 0,\n maxWidth = Infinity,\n padding = 4,\n visible,\n state,\n dx = 0,\n dy = 0\n } = this.attribute as PopTipAttributes;\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: title,\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, '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: content,\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, '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 // 计算整个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 const poptipHeight = parsedPadding[0] + parsedPadding[2] + height;\n\n // 绘制背景层\n const { visible: bgVisible, ...backgroundStyle } = panel;\n const symbolSize = backgroundStyle.size ?? 12;\n const lineWidth = backgroundStyle.lineWidth ?? 1;\n const { angle, offset, rectOffset } = this.getAngleAndOffset(\n position,\n popTipWidth,\n poptipHeight,\n isArray(symbolSize) ? symbolSize : [symbolSize, symbolSize - 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 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: -10\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\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"]}
@@ -0,0 +1,3 @@
1
+ import { ContainerModule } from 'inversify';
2
+ export declare const module: ContainerModule;
3
+ export declare function enablePoptip(): void;
@@ -0,0 +1,17 @@
1
+ import { container, InteractiveSubRenderContribution, AutoEnablePlugins } from "@visactor/vrender";
2
+
3
+ import { ContainerModule } from "inversify";
4
+
5
+ import { PopTipRenderContribution } from "./contribution";
6
+
7
+ import { PopTipPlugin } from "./poptip-plugin";
8
+
9
+ export const module = new ContainerModule((bind => {
10
+ bind(PopTipRenderContribution).toSelf().inSingletonScope(), bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution),
11
+ bind(PopTipPlugin).toSelf().inSingletonScope(), bind(AutoEnablePlugins).toService(PopTipPlugin);
12
+ }));
13
+
14
+ export function enablePoptip() {
15
+ container.load(module);
16
+ }
17
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["poptip/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE;IAC/C,IAAI,CAAC,wBAAwB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC3D,IAAI,CAAC,gCAAgC,CAAC,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;IAE3E,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC/C,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,YAAY;IAC1B,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC","file":"register.js","sourcesContent":["import { container, InteractiveSubRenderContribution, AutoEnablePlugins } from '@visactor/vrender';\nimport { ContainerModule } from 'inversify';\nimport { PopTipRenderContribution } from './contribution';\nimport { PopTipPlugin } from './poptip-plugin';\n\nexport const module = new ContainerModule(bind => {\n bind(PopTipRenderContribution).toSelf().inSingletonScope();\n bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution);\n\n bind(PopTipPlugin).toSelf().inSingletonScope();\n bind(AutoEnablePlugins).toService(PopTipPlugin);\n});\n\nexport function enablePoptip() {\n container.load(module);\n}\n"]}