@visactor/vrender-components 0.23.0-alpha.3 → 1.0.0-alpha.10

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 (240) hide show
  1. package/cjs/animation/animate-component.d.ts +22 -0
  2. package/cjs/animation/animate-component.js +29 -0
  3. package/cjs/animation/animate-component.js.map +1 -0
  4. package/cjs/animation/axis-animate.d.ts +10 -0
  5. package/cjs/animation/axis-animate.js +71 -0
  6. package/cjs/animation/axis-animate.js.map +1 -0
  7. package/cjs/animation/label-animate.d.ts +10 -0
  8. package/cjs/animation/label-animate.js +80 -0
  9. package/cjs/animation/label-animate.js.map +1 -0
  10. package/cjs/axis/animate/config.d.ts +6 -0
  11. package/cjs/axis/animate/config.js +10 -0
  12. package/cjs/axis/animate/config.js.map +1 -0
  13. package/cjs/axis/animate/group-transition.d.ts +2 -1
  14. package/cjs/axis/animate/group-transition.js +2 -2
  15. package/cjs/axis/animate/group-transition.js.map +1 -1
  16. package/cjs/axis/base.d.ts +9 -4
  17. package/cjs/axis/base.js +70 -5
  18. package/cjs/axis/base.js.map +1 -1
  19. package/cjs/axis/line.js.map +1 -1
  20. package/cjs/axis/register.js +2 -2
  21. package/cjs/axis/register.js.map +1 -1
  22. package/cjs/axis/type.d.ts +4 -0
  23. package/cjs/axis/type.js.map +1 -1
  24. package/cjs/axis/util.js +5 -5
  25. package/cjs/axis/util.js.map +1 -1
  26. package/cjs/brush/brush.d.ts +16 -10
  27. package/cjs/brush/brush.js +81 -93
  28. package/cjs/brush/brush.js.map +1 -1
  29. package/cjs/brush/config.d.ts +5 -5
  30. package/cjs/brush/config.js +6 -7
  31. package/cjs/brush/config.js.map +1 -1
  32. package/cjs/brush/type.d.ts +1 -0
  33. package/cjs/brush/type.js +3 -2
  34. package/cjs/brush/type.js.map +1 -1
  35. package/cjs/crosshair/rect.js +1 -2
  36. package/cjs/crosshair/type.js +2 -1
  37. package/cjs/data-zoom/data-zoom.d.ts +3 -0
  38. package/cjs/data-zoom/data-zoom.js +36 -19
  39. package/cjs/data-zoom/data-zoom.js.map +1 -1
  40. package/cjs/index.d.ts +1 -1
  41. package/cjs/index.js +1 -1
  42. package/cjs/index.js.map +1 -1
  43. package/cjs/indicator/register.js +1 -2
  44. package/cjs/jsx/index.js +2 -1
  45. package/cjs/label/animate/animate.d.ts +1 -12
  46. package/cjs/label/animate/animate.js +1 -78
  47. package/cjs/label/animate/animate.js.map +1 -1
  48. package/cjs/label/base.d.ts +5 -3
  49. package/cjs/label/base.js +61 -35
  50. package/cjs/label/base.js.map +1 -1
  51. package/cjs/label/dataLabel.js +1 -1
  52. package/cjs/label/overlap/scaler.js +3 -3
  53. package/cjs/label/overlap/scaler.js.map +1 -1
  54. package/cjs/label/register.d.ts +1 -0
  55. package/cjs/label/register.js +8 -4
  56. package/cjs/label/register.js.map +1 -1
  57. package/cjs/label-item/index.js +1 -1
  58. package/cjs/label-item/label-item.js +1 -1
  59. package/cjs/label-item/label-item.js.map +1 -1
  60. package/cjs/label-item/register.js +1 -1
  61. package/cjs/label-item/type.js +1 -1
  62. package/cjs/marker/animate/animate.d.ts +3 -3
  63. package/cjs/marker/animate/animate.js.map +1 -1
  64. package/cjs/marker/animate/clip-in.d.ts +1 -1
  65. package/cjs/marker/animate/clip-in.js +6 -3
  66. package/cjs/marker/animate/clip-in.js.map +1 -1
  67. package/cjs/marker/animate/fade-in.d.ts +3 -3
  68. package/cjs/marker/animate/fade-in.js +10 -4
  69. package/cjs/marker/animate/fade-in.js.map +1 -1
  70. package/cjs/marker/animate/fade-out.d.ts +3 -3
  71. package/cjs/marker/animate/fade-out.js +10 -4
  72. package/cjs/marker/animate/fade-out.js.map +1 -1
  73. package/cjs/marker/arc-area.d.ts +8 -5
  74. package/cjs/marker/arc-area.js +18 -39
  75. package/cjs/marker/arc-area.js.map +1 -1
  76. package/cjs/marker/arc-line.d.ts +6 -4
  77. package/cjs/marker/arc-line.js +12 -9
  78. package/cjs/marker/arc-line.js.map +1 -1
  79. package/cjs/marker/area.d.ts +6 -4
  80. package/cjs/marker/area.js +14 -32
  81. package/cjs/marker/area.js.map +1 -1
  82. package/cjs/marker/base.d.ts +2 -3
  83. package/cjs/marker/base.js.map +1 -1
  84. package/cjs/marker/common-line.d.ts +11 -7
  85. package/cjs/marker/common-line.js +11 -31
  86. package/cjs/marker/common-line.js.map +1 -1
  87. package/cjs/marker/config.d.ts +2 -0
  88. package/cjs/marker/config.js +2 -0
  89. package/cjs/marker/config.js.map +1 -1
  90. package/cjs/marker/line.d.ts +6 -4
  91. package/cjs/marker/line.js +10 -4
  92. package/cjs/marker/line.js.map +1 -1
  93. package/cjs/marker/mixin/label.d.ts +16 -0
  94. package/cjs/marker/mixin/label.js +57 -0
  95. package/cjs/marker/mixin/label.js.map +1 -0
  96. package/cjs/marker/type.d.ts +19 -16
  97. package/cjs/marker/type.js.map +1 -1
  98. package/cjs/poptip/contribution.js +4 -2
  99. package/cjs/poptip/contribution.js.map +1 -1
  100. package/cjs/poptip/poptip.d.ts +5 -0
  101. package/cjs/poptip/poptip.js +87 -18
  102. package/cjs/poptip/poptip.js.map +1 -1
  103. package/cjs/poptip/type.d.ts +4 -1
  104. package/cjs/poptip/type.js.map +1 -1
  105. package/cjs/scrollbar/scrollbar.d.ts +1 -0
  106. package/cjs/scrollbar/scrollbar.js +21 -12
  107. package/cjs/scrollbar/scrollbar.js.map +1 -1
  108. package/cjs/slider/slider.d.ts +3 -0
  109. package/cjs/slider/slider.js +48 -27
  110. package/cjs/slider/slider.js.map +1 -1
  111. package/cjs/switch/switch.js +2 -2
  112. package/cjs/switch/switch.js.map +1 -1
  113. package/cjs/tag/tag.js +60 -56
  114. package/cjs/tag/tag.js.map +1 -1
  115. package/cjs/util/event.d.ts +1 -0
  116. package/cjs/util/event.js +14 -0
  117. package/cjs/util/event.js.map +1 -0
  118. package/cjs/weather/weather-box.d.ts +1 -2
  119. package/cjs/weather/weather-box.js.map +1 -1
  120. package/dist/index.es.js +14149 -12832
  121. package/es/animation/animate-component.d.ts +22 -0
  122. package/es/animation/animate-component.js +21 -0
  123. package/es/animation/animate-component.js.map +1 -0
  124. package/es/animation/axis-animate.d.ts +10 -0
  125. package/es/animation/axis-animate.js +60 -0
  126. package/es/animation/axis-animate.js.map +1 -0
  127. package/es/animation/label-animate.d.ts +10 -0
  128. package/es/animation/label-animate.js +69 -0
  129. package/es/animation/label-animate.js.map +1 -0
  130. package/es/axis/animate/config.d.ts +6 -0
  131. package/es/axis/animate/config.js +6 -0
  132. package/es/axis/animate/config.js.map +1 -0
  133. package/es/axis/animate/group-transition.d.ts +2 -1
  134. package/es/axis/animate/group-transition.js +3 -1
  135. package/es/axis/animate/group-transition.js.map +1 -1
  136. package/es/axis/base.d.ts +9 -4
  137. package/es/axis/base.js +75 -9
  138. package/es/axis/base.js.map +1 -1
  139. package/es/axis/line.js.map +1 -1
  140. package/es/axis/register.js +3 -1
  141. package/es/axis/register.js.map +1 -1
  142. package/es/axis/type.d.ts +4 -0
  143. package/es/axis/type.js.map +1 -1
  144. package/es/axis/util.js +5 -6
  145. package/es/axis/util.js.map +1 -1
  146. package/es/brush/brush.d.ts +16 -10
  147. package/es/brush/brush.js +83 -95
  148. package/es/brush/brush.js.map +1 -1
  149. package/es/brush/config.d.ts +5 -5
  150. package/es/brush/config.js +6 -7
  151. package/es/brush/config.js.map +1 -1
  152. package/es/brush/type.d.ts +1 -0
  153. package/es/brush/type.js +3 -2
  154. package/es/brush/type.js.map +1 -1
  155. package/es/crosshair/rect.js +1 -2
  156. package/es/crosshair/type.js +2 -1
  157. package/es/data-zoom/data-zoom.d.ts +3 -0
  158. package/es/data-zoom/data-zoom.js +35 -16
  159. package/es/data-zoom/data-zoom.js.map +1 -1
  160. package/es/index.d.ts +1 -1
  161. package/es/index.js +1 -1
  162. package/es/index.js.map +1 -1
  163. package/es/indicator/register.js +1 -2
  164. package/es/jsx/index.js +2 -1
  165. package/es/label/animate/animate.d.ts +1 -12
  166. package/es/label/animate/animate.js +0 -76
  167. package/es/label/animate/animate.js.map +1 -1
  168. package/es/label/base.d.ts +5 -3
  169. package/es/label/base.js +63 -35
  170. package/es/label/base.js.map +1 -1
  171. package/es/label/dataLabel.js +1 -1
  172. package/es/label/overlap/scaler.js +1 -1
  173. package/es/label/overlap/scaler.js.map +1 -1
  174. package/es/label/register.d.ts +1 -0
  175. package/es/label/register.js +7 -1
  176. package/es/label/register.js.map +1 -1
  177. package/es/label-item/index.js +1 -1
  178. package/es/label-item/label-item.js +1 -1
  179. package/es/label-item/label-item.js.map +1 -1
  180. package/es/label-item/register.js +1 -1
  181. package/es/label-item/type.js +1 -1
  182. package/es/marker/animate/animate.d.ts +3 -3
  183. package/es/marker/animate/animate.js.map +1 -1
  184. package/es/marker/animate/clip-in.d.ts +1 -1
  185. package/es/marker/animate/clip-in.js +6 -2
  186. package/es/marker/animate/clip-in.js.map +1 -1
  187. package/es/marker/animate/fade-in.d.ts +3 -3
  188. package/es/marker/animate/fade-in.js +11 -3
  189. package/es/marker/animate/fade-in.js.map +1 -1
  190. package/es/marker/animate/fade-out.d.ts +3 -3
  191. package/es/marker/animate/fade-out.js +11 -3
  192. package/es/marker/animate/fade-out.js.map +1 -1
  193. package/es/marker/arc-area.d.ts +8 -5
  194. package/es/marker/arc-area.js +19 -41
  195. package/es/marker/arc-area.js.map +1 -1
  196. package/es/marker/arc-line.d.ts +6 -4
  197. package/es/marker/arc-line.js +12 -9
  198. package/es/marker/arc-line.js.map +1 -1
  199. package/es/marker/area.d.ts +6 -4
  200. package/es/marker/area.js +15 -34
  201. package/es/marker/area.js.map +1 -1
  202. package/es/marker/base.d.ts +2 -3
  203. package/es/marker/base.js.map +1 -1
  204. package/es/marker/common-line.d.ts +11 -7
  205. package/es/marker/common-line.js +14 -34
  206. package/es/marker/common-line.js.map +1 -1
  207. package/es/marker/config.d.ts +2 -0
  208. package/es/marker/config.js +2 -0
  209. package/es/marker/config.js.map +1 -1
  210. package/es/marker/line.d.ts +6 -4
  211. package/es/marker/line.js +10 -4
  212. package/es/marker/line.js.map +1 -1
  213. package/es/marker/mixin/label.d.ts +16 -0
  214. package/es/marker/mixin/label.js +45 -0
  215. package/es/marker/mixin/label.js.map +1 -0
  216. package/es/marker/type.d.ts +19 -16
  217. package/es/marker/type.js.map +1 -1
  218. package/es/poptip/contribution.js +4 -2
  219. package/es/poptip/contribution.js.map +1 -1
  220. package/es/poptip/poptip.d.ts +5 -0
  221. package/es/poptip/poptip.js +85 -19
  222. package/es/poptip/poptip.js.map +1 -1
  223. package/es/poptip/type.d.ts +4 -1
  224. package/es/poptip/type.js.map +1 -1
  225. package/es/scrollbar/scrollbar.d.ts +1 -0
  226. package/es/scrollbar/scrollbar.js +22 -11
  227. package/es/scrollbar/scrollbar.js.map +1 -1
  228. package/es/slider/slider.d.ts +3 -0
  229. package/es/slider/slider.js +49 -26
  230. package/es/slider/slider.js.map +1 -1
  231. package/es/switch/switch.js +2 -2
  232. package/es/switch/switch.js.map +1 -1
  233. package/es/tag/tag.js +59 -56
  234. package/es/tag/tag.js.map +1 -1
  235. package/es/util/event.d.ts +1 -0
  236. package/es/util/event.js +6 -0
  237. package/es/util/event.js.map +1 -0
  238. package/es/weather/weather-box.d.ts +1 -2
  239. package/es/weather/weather-box.js.map +1 -1
  240. package/package.json +7 -7
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/marker/mixin/label.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAEtD,6CAAgD;AAEhD,mCAAgC;AAOhC,MAAa,cAAc;IAEzB,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,cAAc,CAAC,SAAiB,EAAE,SAAiB,EAAE,iBAAgC;QACnF,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,SAAc,CAAC;QAC7C,MAAM,WAAW,GAAG,IAAA,cAAK,EAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC,CAAC;QACxC,MAAM,qB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KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC,CAAC;QACxC,MAAM,qBAAqB,GAAG,IAAA,cAAK,EAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAC,CAAC;QAC5D,IAAI,WAAW,CAAC,MAAM,EAAE;YACtB,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,KAAK,CAAC,CAAC;YAC5B,WAAW,CAAC,OAAO,CAAC,CAAC,SAAc,EAAE,KAAa,EAAE,EAAE;;gBACpD,MAAM,eAAe,GAAG,IAAA,cAAK,EAAC,EAAE,EAAE,iBAAiB,EAAE,MAAM,CAAC,KAAK,CAAkB,CAAC,CAAC;gBACrF,SAAS,CAAC,aAAa,+BACrB,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,IACF,eAAe,KAClB,KAAK,EAAE;wBACL,KAAK,EAAE,IAAA,cAAK,EAAC,EAAE,EAAE,yBAAc,EAAE,MAAA,qBAAqB,CAAC,KAAK,CAAC,mCAAI,IAAA,aAAI,EAAC,qBAAqB,CAAC,CAAC;wBAC7F,IAAI,EAAE,IAAA,cAAK,EAAC,EAAE,EAAE,yBAAc,EAAE,MAAA,WAAW,CAAC,KAAK,CAAC,mCAAI,IAAA,aAAI,EAAC,WAAW,CAAC,CAAC;qBACzE,IACD,CAAC;gBACH,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CACF;AAnDD,wCAmDC","file":"label.js","sourcesContent":["import { array, last, merge } from '@visactor/vutils';\nimport type { IGroup, INode } from '@visactor/vrender-core';\nimport { DEFAULT_STATES } from '../../constant';\nimport type { TagAttributes } from '../../tag';\nimport { Tag } from '../../tag';\n\nexport interface MarkLabelMixin<T extends { label?: any; state?: any }> {\n attribute: T;\n setLabelPos: (labelNode: IGroup, labelAttrs: any) => any;\n}\n\nexport class MarkLabelMixin<T> {\n _label!: Tag | Tag[];\n getLabel() {\n return this._label;\n }\n _addMarkLabels(container: IGroup, labelName: string, defaultLabelAttrs: TagAttributes) {\n const { label, state } = this.attribute as T;\n const labelStates = array(state?.label);\n const labelBackgroundStates = array(state?.labelBackground);\n // add label\n const labelShapes = array(label).map((labelAttrs, index) => {\n const finalLabelAttrs = merge({}, defaultLabelAttrs, labelAttrs as TagAttributes);\n const markLabel = new Tag({\n ...finalLabelAttrs,\n state: {\n panel: merge({}, DEFAULT_STATES, labelBackgroundStates[index] ?? last(labelBackgroundStates)),\n text: merge({}, DEFAULT_STATES, labelStates[index] ?? last(labelStates))\n }\n });\n markLabel.name = labelName;\n container.add(markLabel as unknown as INode);\n this.setLabelPos(markLabel, finalLabelAttrs);\n\n return markLabel;\n });\n this._label = array(labelShapes).length === 1 ? labelShapes[0] : labelShapes;\n }\n\n _updateMarkLabels(defaultLabelAttrs: TagAttributes) {\n const { label, state } = this.attribute as T;\n\n const labelShapes = array(this._label);\n const labelStates = array(state?.label);\n const labelBackgroundStates = array(state?.labelBackground);\n if (labelShapes.length) {\n const labels = array(label);\n labelShapes.forEach((labelItem: Tag, index: number) => {\n const finalLabelAttrs = merge({}, defaultLabelAttrs, labels[index] as TagAttributes);\n labelItem.setAttributes({\n dx: 0,\n dy: 0, // 需要进行复位\n ...finalLabelAttrs,\n state: {\n panel: merge({}, DEFAULT_STATES, labelBackgroundStates[index] ?? last(labelBackgroundStates)),\n text: merge({}, DEFAULT_STATES, labelStates[index] ?? last(labelStates))\n }\n });\n this.setLabelPos(labelItem, finalLabelAttrs);\n });\n }\n }\n}\n"]}
@@ -107,13 +107,13 @@ export type MarkCommonLineState<LineAttr> = {
107
107
  line?: State<LineAttr>;
108
108
  lineStartSymbol?: State<Partial<ISymbolGraphicAttribute>>;
109
109
  lineEndSymbol?: State<Partial<ISymbolGraphicAttribute>>;
110
- label?: State<Partial<ITextGraphicAttribute>>;
111
- labelBackground?: State<Partial<IRectGraphicAttribute>>;
110
+ label?: State<Partial<ITextGraphicAttribute>> | State<Partial<ITextGraphicAttribute>>[];
111
+ labelBackground?: State<Partial<IRectGraphicAttribute>> | State<Partial<IRectGraphicAttribute>>[];
112
112
  };
113
113
  export type CommonMarkAreaState<AreaAttr> = {
114
114
  area?: State<Partial<AreaAttr>>;
115
- label?: State<Partial<ITextGraphicAttribute>>;
116
- labelBackground?: State<Partial<IRectGraphicAttribute>>;
115
+ label?: State<Partial<ITextGraphicAttribute>> | State<Partial<ITextGraphicAttribute>>[];
116
+ labelBackground?: State<Partial<IRectGraphicAttribute>> | State<Partial<IRectGraphicAttribute>>[];
117
117
  };
118
118
  export type MarkPointState = {
119
119
  line?: State<ILineGraphicWithCornerRadius | Partial<ILineGraphicAttribute>[]>;
@@ -127,11 +127,12 @@ export type MarkPointState = {
127
127
  customMark?: State<Partial<IGroupGraphicAttribute>>;
128
128
  targetItem?: State<Partial<ISymbolGraphicAttribute>>;
129
129
  };
130
+ export type MarkerLineLabelAttrs<LineLabelPosition> = {
131
+ position?: LineLabelPosition;
132
+ confine?: boolean;
133
+ } & IMarkRef & IMarkLabel;
130
134
  export type MarkCommonLineAttrs<LineAttr, LineLabelPosition, MarkCommonLineAnimationType> = MarkerAttrs<MarkCommonLineAnimationType> & Omit<CommonSegmentAttributes, 'state' | 'lineStyle'> & {
131
- label?: {
132
- position?: LineLabelPosition;
133
- confine?: boolean;
134
- } & IMarkRef & IMarkLabel;
135
+ label?: MarkerLineLabelAttrs<LineLabelPosition> | MarkerLineLabelAttrs<LineLabelPosition>[];
135
136
  state?: MarkCommonLineState<LineAttr>;
136
137
  };
137
138
  export type MarkLineAttrs = MarkCommonLineAttrs<ILineGraphicWithCornerRadius | ILineGraphicAttribute[], keyof typeof IMarkLineLabelPosition, MarkCommonLineAnimationType> & {
@@ -152,16 +153,21 @@ export type MarkArcLineAttrs = MarkCommonLineAttrs<IArcGraphicAttribute, keyof t
152
153
  endAngle: number;
153
154
  lineStyle?: IArcGraphicAttribute;
154
155
  };
156
+ export type MarkerAreaLabelAttrs = {
157
+ position?: keyof typeof IMarkAreaLabelPosition;
158
+ confine?: boolean;
159
+ } & IMarkLabel;
155
160
  export type MarkAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {
156
161
  type?: 'area';
157
162
  points: Point[];
158
- label?: {
159
- position?: keyof typeof IMarkAreaLabelPosition;
160
- confine?: boolean;
161
- } & IMarkLabel;
163
+ label?: MarkerAreaLabelAttrs | MarkerAreaLabelAttrs[];
162
164
  areaStyle?: IPolygonAttribute;
163
165
  state?: CommonMarkAreaState<IPolygonGraphicAttribute>;
164
166
  };
167
+ export type MarkerArcAreaLabelAttrs = {
168
+ position?: keyof typeof IMarkCommonArcLabelPosition;
169
+ confine?: boolean;
170
+ } & IMarkRef & IMarkLabel;
165
171
  export type MarkArcAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {
166
172
  type?: 'arc-area';
167
173
  center: {
@@ -172,10 +178,7 @@ export type MarkArcAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {
172
178
  outerRadius: number;
173
179
  startAngle: number;
174
180
  endAngle: number;
175
- label?: {
176
- position?: keyof typeof IMarkCommonArcLabelPosition;
177
- confine?: boolean;
178
- } & IMarkRef & IMarkLabel;
181
+ label?: MarkerArcAreaLabelAttrs | MarkerArcAreaLabelAttrs[];
179
182
  areaStyle?: IArcGraphicAttribute;
180
183
  state?: CommonMarkAreaState<IArcGraphicAttribute>;
181
184
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/marker/type.ts"],"names":[],"mappings":";;;AAmBA,IAAY,sBAkBX;AAlBD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,+CAAqB,CAAA;IACrB,qDAA2B,CAAA;IAC3B,qDAA2B,CAAA;IAC3B,2DAAiC,CAAA;IACjC,iEAAuC,CAAA;IAEvC,2CAAiB,CAAA;IACjB,6DAAmC,CAAA;IACnC,mEAAyC,CAAA;IAEzC,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,iDAAuB,CAAA;IACvB,iDAAuB,CAAA;IACvB,uDAA6B,CAAA;IAC7B,6DAAmC,CAAA;AACrC,CAAC,EAlBW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAkBjC;AAED,IAAY,sBAoBX;AApBD,WAAY,sBAAsB;IAChC,uCAAa,CAAA;IACb,yCAAe,CAAA;IACf,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,6CAAmB,CAAA;IACnB,+CAAqB,CAAA;IACrB,mDAAyB,CAAA;IACzB,qDAA2B,CAAA;IAE3B,2CAAiB,CAAA;IAEjB,mDAAyB,CAAA;IACzB,qDAA2B,CAAA;IAC3B,iDAAuB,CAAA;IACvB,uDAA6B,CAAA;IAC7B,yDAA+B,CAAA;IAC/B,2DAAiC,CAAA;IACjC,+DAAqC,CAAA;IACrC,iEAAuC,CAAA;AACzC,CAAC,EApBW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAoBjC;AAED,IAAY,2BAQX;AARD,WAAY,2BAA2B;IACrC,8DAA+B,CAAA;IAC/B,0DAA2B,CAAA;IAC3B,gEAAiC,CAAA;IACjC,8DAA+B,CAAA;IAC/B,0DAA2B,CAAA;IAC3B,gEAAiC,CAAA;IACjC,gDAAiB,CAAA;AACnB,CAAC,EARW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAQtC;AAED,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,2CAAiB,CAAA;IACjB,iDAAuB,CAAA;IACvB,uDAA6B,CAAA;IAC7B,uDAA6B,CAAA;AAC/B,CAAC,EAPW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAOjC","file":"type.js","sourcesContent":["import type {\n EasingType,\n IArcGraphicAttribute,\n IGroup,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPolygonAttribute,\n IPolygonGraphicAttribute,\n IRectGraphicAttribute,\n IRichTextGraphicAttribute,\n ISymbol,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { CommonSegmentAttributes, ILineGraphicWithCornerRadius, SegmentAttributes } from '../segment/type';\nimport type { TagAttributes } from '../tag/type';\nimport type { Point, State } from '../core/type';\n\nexport enum IMarkLineLabelPosition {\n start = 'start',\n startTop = 'startTop',\n startBottom = 'startBottom',\n insideStart = 'insideStart',\n insideStartTop = 'insideStartTop',\n insideStartBottom = 'insideStartBottom',\n\n middle = 'middle',\n insideMiddleTop = 'insideMiddleTop',\n insideMiddleBottom = 'insideMiddleBottom',\n\n end = 'end',\n endTop = 'endTop',\n endBottom = 'endBottom',\n insideEnd = 'insideEnd',\n insideEndTop = 'insideEndTop',\n insideEndBottom = 'insideEndBottom'\n}\n\nexport enum IMarkAreaLabelPosition {\n left = 'left',\n right = 'right',\n top = 'top',\n bottom = 'bottom',\n topLeft = 'topLeft',\n topRight = 'topRight',\n bottomLeft = 'bottomLeft',\n bottomRight = 'bottomRight',\n\n middle = 'middle',\n\n insideLeft = 'insideLeft',\n insideRight = 'insideRight',\n insideTop = 'insideTop',\n insideBottom = 'insideBottom',\n insideTopLeft = 'insideTopLeft',\n insideTopRight = 'insideTopRight',\n insideBottomLeft = 'insideBottomLeft',\n insideBottomRight = 'insideBottomRight'\n}\n\nexport enum IMarkCommonArcLabelPosition {\n arcInnerStart = 'arcInnerStart',\n arcInnerEnd = 'arcInnerEnd',\n arcInnerMiddle = 'arcInnerMiddle',\n arcOuterStart = 'arcOuterStart',\n arcOuterEnd = 'arcOuterEnd',\n arcOuterMiddle = 'arcOuterMiddle',\n center = 'center'\n}\n\nexport enum IMarkPointItemPosition {\n top = 'top',\n bottom = 'bottom',\n middle = 'middle',\n insideTop = 'insideTop',\n insideBottom = 'insideBottom',\n insideMiddle = 'insideMiddle'\n}\n\nexport type IMarkBackgroundAttributes = {\n /**\n * 是否绘制背景层\n */\n visible: boolean;\n /**\n * TODO: 根据文字宽度进行背景 panel size自适应\n */\n autoHeight?: boolean;\n /**\n * TODO: 根据文高度度进行背景 panel size自适应\n */\n autoWidth?: boolean;\n} & Partial<IRectGraphicAttribute>;\n\nexport type IMarkLabel = Omit<TagAttributes, 'x' | 'y' | 'panel'> & {\n /**\n * 标签的背景面板配置\n */\n panel?: IMarkBackgroundAttributes;\n};\n\nexport type IMarkRef = {\n /**\n * 自动旋转,沿着线的方向\n * @default\n * mark-line/mark-area/mark-point: false - 旧逻辑里autoRotate是false, 保持不变\n * mark-arc-line/mark-arc-area: true - 新增逻辑, 如果不开启的话, 效果不太好, 所以默认true\n * mark-point - 旧逻辑里autoRotate是true, 保持不变\n */\n autoRotate?: boolean;\n /**\n * label 相对line平行方向上的偏移\n */\n refX?: number;\n /**\n * label 相对line正交方向上的偏移\n */\n refY?: number;\n /**\n * label 相对默认角度的偏移 (label跟随line的角度做自动旋转时,默认按照line的平行向量作为初始角度)\n */\n refAngle?: number;\n};\n\nexport type MarkerAttrs<AnimationType> = IGroupGraphicAttribute & {\n /**\n * 设置标注的类型\n */\n type?: 'line' | 'arc-line' | 'area' | 'arc-area' | 'point';\n /**\n * 是否支持交互\n * @default true\n */\n interactive?: boolean;\n /**\n * 是否开启选中交互\n * @default false\n */\n select?: boolean;\n /**\n * 是否开启 hover 交互\n * @default false\n */\n hover?: boolean;\n /**\n * 是否显示marker组件\n * @default true\n */\n visible?: boolean;\n /**\n * 是否将组件在绘制区域内进行剪切\n * @default true\n */\n clipInRange?: boolean;\n /**\n * 组件绘制范围配置\n */\n limitRect?: {\n /**\n * 绘制范围的起点x坐标\n */\n x: number;\n /**\n * 绘制范围的起点y坐标\n */\n y: number;\n /**\n * 绘制范围的宽度\n */\n width: number;\n /**\n * 绘制范围的高度\n */\n height: number;\n };\n} & BaseMarkerAnimation<AnimationType>;\n\n/** animation type */\nexport type BaseMarkerAnimation<T> = {\n /**\n * 动画公共配置\n */\n animation?: MarkerAnimation<T> | boolean;\n /**\n * 入场动画配置\n */\n animationEnter?: MarkerUpdateAnimation<T>;\n /**\n * 更新动画配置\n */\n animationUpdate?: MarkerUpdateAnimation<T>;\n /**\n * 离场动画配置\n */\n animationExit?: MarkerExitAnimation;\n};\nexport type MarkerAnimation<T> = MarkerUpdateAnimation<T> | MarkerUpdateAnimation<T>;\n\nexport type MarkerUpdateAnimation<T> = {\n /**\n * 设置动画的类型\n */\n type: T;\n} & MarkerExitAnimation;\n\nexport type MarkCommonLineAnimationType = 'clipIn' | 'fadeIn';\n\nexport type CommonMarkAreaAnimationType = 'fadeIn';\n\nexport type MarkPointAnimationType = 'callIn' | 'fadeIn';\n\nexport type MarkerExitAnimation = {\n /**\n * 设置离场动画的类型为fadeOut,即淡出\n */\n type: 'fadeOut';\n /**\n * 动画的时长\n */\n duration?: number;\n /**\n * 动画延迟的时长\n */\n delay?: number;\n /**\n * 动画的缓动函数\n */\n easing?: EasingType;\n};\n\nexport type MarkerAnimationState = 'enter' | 'update' | 'exit';\n\n/** state type */\nexport type MarkCommonLineState<LineAttr> = {\n /**\n * 设置线图形的在特定状态下的样式\n */\n line?: State<LineAttr>;\n /**\n * 设置线的起点在特定状态下的样式\n */\n lineStartSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置线的终点在特定状态下的样式\n */\n lineEndSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置标签在特定状态下的样式\n */\n label?: State<Partial<ITextGraphicAttribute>>;\n /**\n * 设置标签背景区块在特定状态下的样式\n */\n labelBackground?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type CommonMarkAreaState<AreaAttr> = {\n /**\n * 设置标注区域在特定状态下的样式\n */\n area?: State<Partial<AreaAttr>>;\n /**\n * 设置标注区域标签在特定状态下的样式\n */\n label?: State<Partial<ITextGraphicAttribute>>;\n /**\n * 设置标签背景区块在特定状态下的样式\n */\n labelBackground?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type MarkPointState = {\n /**\n * 设置标注点连线在特定状态下的样式\n */\n line?: State<ILineGraphicWithCornerRadius | Partial<ILineGraphicAttribute>[]>;\n /**\n * 设置线起点图形在特定状态下的样式\n */\n lineStartSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置线终点图形在特定状态下的样式\n */\n lineEndSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置标注图形在特定状态下的样式\n */\n symbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置标注图形在特定状态下的样式\n */\n image?: State<Partial<IImageGraphicAttribute>>;\n /**\n * 设置标签在特定状态下的样式\n */\n text?: State<Partial<ITextGraphicAttribute>>;\n /**\n * 设置标签背景区块在特定状态下的样式\n */\n textBackground?: State<Partial<IRectGraphicAttribute>>;\n /**\n * 设置富文本在特定状态下的样式\n */\n richText?: State<Partial<IRichTextGraphicAttribute>>;\n /**\n * 设置自定义标注图形在特定状态下的样式\n */\n customMark?: State<Partial<IGroupGraphicAttribute>>;\n /**\n * 设置目标元素在特定状态下的样式\n */\n targetItem?: State<Partial<ISymbolGraphicAttribute>>;\n};\n\nexport type MarkCommonLineAttrs<LineAttr, LineLabelPosition, MarkCommonLineAnimationType> =\n MarkerAttrs<MarkCommonLineAnimationType> &\n Omit<CommonSegmentAttributes, 'state' | 'lineStyle'> & {\n /**\n * 标签\n */\n label?: {\n /**\n * label 相对line的位置\n */\n position?: LineLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n } & IMarkRef &\n IMarkLabel;\n /**\n * 辅助线各种状态下的样式\n */\n state?: MarkCommonLineState<LineAttr>;\n };\n\nexport type MarkLineAttrs = MarkCommonLineAttrs<\n ILineGraphicWithCornerRadius | ILineGraphicAttribute[],\n keyof typeof IMarkLineLabelPosition,\n MarkCommonLineAnimationType\n> & {\n /**\n * 将辅助线的类型设置为 'line'\n */\n type?: 'line';\n /**\n * 是否对 points 进行多段处理,默认为 false,即直接将所有的点连接成线。\n * 如果需要进行多段处理,需要将 points 属性配置为 Point[][] 类型\n * @default false\n */\n multiSegment?: boolean;\n /**\n * 在 `multiSegment` 属性开启的前提下,用于声明那一段线段用来作为主线段,如果不声明,默认全段为主线段\n */\n mainSegmentIndex?: number;\n /**\n * 构成line的点: 如果是两个点,则为直线;多个点则为折线\n */\n points: Point[] | Point[][];\n /**\n * 线的样式设置\n */\n lineStyle?: ILineGraphicAttribute;\n};\n\nexport type MarkArcLineAttrs = MarkCommonLineAttrs<\n IArcGraphicAttribute,\n keyof typeof IMarkCommonArcLabelPosition,\n MarkCommonLineAnimationType\n> & {\n /**\n * 将辅助线的类型设置为 'arc-line',即弧线\n */\n type?: 'arc-line';\n /**\n * 弧线中心位置\n */\n center: {\n x: number;\n y: number;\n };\n /**\n * 弧线半径\n */\n radius: number;\n /**\n * 弧线起始角度(弧度)\n */\n startAngle: number;\n /**\n * 弧线终点角度(弧度)\n */\n endAngle: number;\n /**\n * 设置弧线的样式\n */\n lineStyle?: IArcGraphicAttribute;\n};\n\nexport type MarkAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {\n type?: 'area';\n /**\n * 构成area的点\n */\n points: Point[];\n /**\n * 标签\n */\n label?: {\n /**\n * 设置标签的位置\n */\n position?: keyof typeof IMarkAreaLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n } & IMarkLabel;\n /**\n * area的样式\n */\n areaStyle?: IPolygonAttribute;\n /**\n * 设置标注区域在各种状态下的样式\n */\n state?: CommonMarkAreaState<IPolygonGraphicAttribute>;\n};\n\nexport type MarkArcAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {\n type?: 'arc-area';\n /**\n * 扇区中心位置\n */\n center: {\n x: number;\n y: number;\n };\n /**\n * 扇区内半径\n */\n innerRadius: number;\n /**\n * 扇区外半径\n */\n outerRadius: number;\n /**\n * 扇区起始角度(弧度)\n */\n startAngle: number;\n /**\n * 扇区终点角度(弧度)\n */\n endAngle: number;\n /**\n * 标签\n */\n label?: {\n /**\n * 标签的位置\n */\n position?: keyof typeof IMarkCommonArcLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n } & IMarkRef &\n IMarkLabel;\n /**\n * area的样式\n */\n areaStyle?: IArcGraphicAttribute;\n /**\n * 辅助区域这种状态下各个图元的样式设置\n */\n state?: CommonMarkAreaState<IArcGraphicAttribute>;\n};\n\nexport type IItemContent = IMarkRef & {\n /**\n * 标注类型\n * Tips: 保留'richText'与之前的定义做兼容\n */\n type?: 'symbol' | 'text' | 'image' | 'richText' | 'custom';\n /**\n * 设置标注的位置\n */\n position?: keyof typeof IMarkPointItemPosition;\n /**\n * x 方向偏移量\n */\n offsetX?: number;\n /**\n * y 方向偏移量\n */\n offsetY?: number;\n /**\n * type为symbol时, symbol的样式\n */\n symbolStyle?: ISymbolGraphicAttribute;\n /**\n * type为image时, image的样式\n */\n imageStyle?: IImageGraphicAttribute;\n /**\n * type为text时, text的配置\n * 'text'类型的ItemContent新增三种子类型:'text','rich','html'。配置在textStyle.type上,继承自TagAttributes。\n */\n textStyle?: IMarkLabel;\n /**\n * type为rich text时, rich text的样式\n */\n richTextStyle?: IRichTextGraphicAttribute;\n /**\n * type为custom时,允许以callback的方式传入需要render的item\n */\n renderCustomCallback?: () => IGroup;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n};\n\nexport type IItemLine = {\n /** TODO:'type-opo' */\n type?: 'type-s' | 'type-do' | 'type-po' | 'type-op' | 'type-arc';\n /**\n * 是否展示该标注\n */\n visible?: boolean;\n /**\n * 当type为type-arc时生效, 数值决定曲率, 符号决定法向, 不能等于0\n * @default 0.8\n */\n arcRatio?: number;\n /**\n * 垂直于引导线的装饰线,参考案例: https://observablehq.com/@mikelotis/edmonton-population-history-line-chart\n */\n decorativeLine?: {\n /**\n * 是否显示引导线的装饰线\n */\n visible?: boolean;\n /**\n * 装饰线的长度\n */\n length?: number;\n };\n} & Omit<SegmentAttributes, 'points'>;\n\nexport type MarkPointAttrs = Omit<MarkerAttrs<MarkPointAnimationType>, 'labelStyle'> & {\n /**\n * markPoint的位置(也是path的起点)\n */\n position: Point;\n /**\n * 标注引导线\n */\n itemLine?: IItemLine;\n\n /**\n * 标注内容\n */\n itemContent?: IItemContent;\n\n /**\n * 被标注的内容\n */\n targetSymbol?: {\n /**\n * 被标注内容与标记线间的间隙\n * @default 0\n */\n offset?: number;\n /**\n * 是否显示\n * @default false\n */\n visible?: boolean;\n /**\n * 大小\n * @default 20\n */\n size?: number;\n /**\n * 被标注内容的样式设置\n */\n style?: ISymbol;\n };\n /**\n * 标注点各个状态下的样式\n */\n state?: MarkPointState;\n} & BaseMarkerAnimation<MarkPointAnimationType>;\n"]}
1
+ {"version":3,"sources":["../src/marker/type.ts"],"names":[],"mappings":";;;AAmBA,IAAY,sBAkBX;AAlBD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,+CAAqB,CAAA;IACrB,qDAA2B,CAAA;IAC3B,qDAA2B,CAAA;IAC3B,2DAAiC,CAAA;IACjC,iEAAuC,CAAA;IAEvC,2CAAiB,CAAA;IACjB,6DAAmC,CAAA;IACnC,mEAAyC,CAAA;IAEzC,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,iDAAuB,CAAA;IACvB,iDAAuB,CAAA;IACvB,uDAA6B,CAAA;IAC7B,6DAAmC,CAAA;AACrC,CAAC,EAlBW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAkBjC;AAED,IAAY,sBAoBX;AApBD,WAAY,sBAAsB;IAChC,uCAAa,CAAA;IACb,yCAAe,CAAA;IACf,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,6CAAmB,CAAA;IACnB,+CAAqB,CAAA;IACrB,mDAAyB,CAAA;IACzB,qDAA2B,CAAA;IAE3B,2CAAiB,CAAA;IAEjB,mDAAyB,CAAA;IACzB,qDAA2B,CAAA;IAC3B,iDAAuB,CAAA;IACvB,uDAA6B,CAAA;IAC7B,yDAA+B,CAAA;IAC/B,2DAAiC,CAAA;IACjC,+DAAqC,CAAA;IACrC,iEAAuC,CAAA;AACzC,CAAC,EApBW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAoBjC;AAED,IAAY,2BAQX;AARD,WAAY,2BAA2B;IACrC,8DAA+B,CAAA;IAC/B,0DAA2B,CAAA;IAC3B,gEAAiC,CAAA;IACjC,8DAA+B,CAAA;IAC/B,0DAA2B,CAAA;IAC3B,gEAAiC,CAAA;IACjC,gDAAiB,CAAA;AACnB,CAAC,EARW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAQtC;AAED,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,2CAAiB,CAAA;IACjB,iDAAuB,CAAA;IACvB,uDAA6B,CAAA;IAC7B,uDAA6B,CAAA;AAC/B,CAAC,EAPW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAOjC","file":"type.js","sourcesContent":["import type {\n EasingType,\n IArcGraphicAttribute,\n IGroup,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPolygonAttribute,\n IPolygonGraphicAttribute,\n IRectGraphicAttribute,\n IRichTextGraphicAttribute,\n ISymbol,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { CommonSegmentAttributes, ILineGraphicWithCornerRadius, SegmentAttributes } from '../segment/type';\nimport type { TagAttributes } from '../tag/type';\nimport type { Point, State } from '../core/type';\n\nexport enum IMarkLineLabelPosition {\n start = 'start',\n startTop = 'startTop',\n startBottom = 'startBottom',\n insideStart = 'insideStart',\n insideStartTop = 'insideStartTop',\n insideStartBottom = 'insideStartBottom',\n\n middle = 'middle',\n insideMiddleTop = 'insideMiddleTop',\n insideMiddleBottom = 'insideMiddleBottom',\n\n end = 'end',\n endTop = 'endTop',\n endBottom = 'endBottom',\n insideEnd = 'insideEnd',\n insideEndTop = 'insideEndTop',\n insideEndBottom = 'insideEndBottom'\n}\n\nexport enum IMarkAreaLabelPosition {\n left = 'left',\n right = 'right',\n top = 'top',\n bottom = 'bottom',\n topLeft = 'topLeft',\n topRight = 'topRight',\n bottomLeft = 'bottomLeft',\n bottomRight = 'bottomRight',\n\n middle = 'middle',\n\n insideLeft = 'insideLeft',\n insideRight = 'insideRight',\n insideTop = 'insideTop',\n insideBottom = 'insideBottom',\n insideTopLeft = 'insideTopLeft',\n insideTopRight = 'insideTopRight',\n insideBottomLeft = 'insideBottomLeft',\n insideBottomRight = 'insideBottomRight'\n}\n\nexport enum IMarkCommonArcLabelPosition {\n arcInnerStart = 'arcInnerStart',\n arcInnerEnd = 'arcInnerEnd',\n arcInnerMiddle = 'arcInnerMiddle',\n arcOuterStart = 'arcOuterStart',\n arcOuterEnd = 'arcOuterEnd',\n arcOuterMiddle = 'arcOuterMiddle',\n center = 'center'\n}\n\nexport enum IMarkPointItemPosition {\n top = 'top',\n bottom = 'bottom',\n middle = 'middle',\n insideTop = 'insideTop',\n insideBottom = 'insideBottom',\n insideMiddle = 'insideMiddle'\n}\n\nexport type IMarkBackgroundAttributes = {\n /**\n * 是否绘制背景层\n */\n visible: boolean;\n /**\n * TODO: 根据文字宽度进行背景 panel size自适应\n */\n autoHeight?: boolean;\n /**\n * TODO: 根据文高度度进行背景 panel size自适应\n */\n autoWidth?: boolean;\n} & Partial<IRectGraphicAttribute>;\n\nexport type IMarkLabel = Omit<TagAttributes, 'x' | 'y' | 'panel'> & {\n /**\n * 标签的背景面板配置\n */\n panel?: IMarkBackgroundAttributes;\n};\n\nexport type IMarkRef = {\n /**\n * 自动旋转,沿着线的方向\n * @default\n * mark-line/mark-area/mark-point: false - 旧逻辑里autoRotate是false, 保持不变\n * mark-arc-line/mark-arc-area: true - 新增逻辑, 如果不开启的话, 效果不太好, 所以默认true\n * mark-point - 旧逻辑里autoRotate是true, 保持不变\n */\n autoRotate?: boolean;\n /**\n * label 相对line平行方向上的偏移\n */\n refX?: number;\n /**\n * label 相对line正交方向上的偏移\n */\n refY?: number;\n /**\n * label 相对默认角度的偏移 (label跟随line的角度做自动旋转时,默认按照line的平行向量作为初始角度)\n */\n refAngle?: number;\n};\n\nexport type MarkerAttrs<AnimationType> = IGroupGraphicAttribute & {\n /**\n * 设置标注的类型\n */\n type?: 'line' | 'arc-line' | 'area' | 'arc-area' | 'point';\n /**\n * 是否支持交互\n * @default true\n */\n interactive?: boolean;\n /**\n * 是否开启选中交互\n * @default false\n */\n select?: boolean;\n /**\n * 是否开启 hover 交互\n * @default false\n */\n hover?: boolean;\n /**\n * 是否显示marker组件\n * @default true\n */\n visible?: boolean;\n /**\n * 是否将组件在绘制区域内进行剪切\n * @default true\n */\n clipInRange?: boolean;\n /**\n * 组件绘制范围配置\n */\n limitRect?: {\n /**\n * 绘制范围的起点x坐标\n */\n x: number;\n /**\n * 绘制范围的起点y坐标\n */\n y: number;\n /**\n * 绘制范围的宽度\n */\n width: number;\n /**\n * 绘制范围的高度\n */\n height: number;\n };\n} & BaseMarkerAnimation<AnimationType>;\n\n/** animation type */\nexport type BaseMarkerAnimation<T> = {\n /**\n * 动画公共配置\n */\n animation?: MarkerAnimation<T> | boolean;\n /**\n * 入场动画配置\n */\n animationEnter?: MarkerUpdateAnimation<T>;\n /**\n * 更新动画配置\n */\n animationUpdate?: MarkerUpdateAnimation<T>;\n /**\n * 离场动画配置\n */\n animationExit?: MarkerExitAnimation;\n};\nexport type MarkerAnimation<T> = MarkerUpdateAnimation<T> | MarkerUpdateAnimation<T>;\n\nexport type MarkerUpdateAnimation<T> = {\n /**\n * 设置动画的类型\n */\n type: T;\n} & MarkerExitAnimation;\n\nexport type MarkCommonLineAnimationType = 'clipIn' | 'fadeIn';\n\nexport type CommonMarkAreaAnimationType = 'fadeIn';\n\nexport type MarkPointAnimationType = 'callIn' | 'fadeIn';\n\nexport type MarkerExitAnimation = {\n /**\n * 设置离场动画的类型为fadeOut,即淡出\n */\n type: 'fadeOut';\n /**\n * 动画的时长\n */\n duration?: number;\n /**\n * 动画延迟的时长\n */\n delay?: number;\n /**\n * 动画的缓动函数\n */\n easing?: EasingType;\n};\n\nexport type MarkerAnimationState = 'enter' | 'update' | 'exit';\n\n/** state type */\nexport type MarkCommonLineState<LineAttr> = {\n /**\n * 设置线图形的在特定状态下的样式\n */\n line?: State<LineAttr>;\n /**\n * 设置线的起点在特定状态下的样式\n */\n lineStartSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置线的终点在特定状态下的样式\n */\n lineEndSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置标签在特定状态下的样式\n * 自 0.22.7 版本开始,支持多标签配置\n */\n label?: State<Partial<ITextGraphicAttribute>> | State<Partial<ITextGraphicAttribute>>[];\n /**\n * 设置标签背景区块在特定状态下的样式\n */\n labelBackground?: State<Partial<IRectGraphicAttribute>> | State<Partial<IRectGraphicAttribute>>[];\n};\n\nexport type CommonMarkAreaState<AreaAttr> = {\n /**\n * 设置标注区域在特定状态下的样式\n */\n area?: State<Partial<AreaAttr>>;\n /**\n * 设置标注区域标签在特定状态下的样式\n * 自 0.22.7 版本开始,支持多标签配置\n */\n label?: State<Partial<ITextGraphicAttribute>> | State<Partial<ITextGraphicAttribute>>[];\n /**\n * 设置标签背景区块在特定状态下的样式\n */\n labelBackground?: State<Partial<IRectGraphicAttribute>> | State<Partial<IRectGraphicAttribute>>[];\n};\n\nexport type MarkPointState = {\n /**\n * 设置标注点连线在特定状态下的样式\n */\n line?: State<ILineGraphicWithCornerRadius | Partial<ILineGraphicAttribute>[]>;\n /**\n * 设置线起点图形在特定状态下的样式\n */\n lineStartSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置线终点图形在特定状态下的样式\n */\n lineEndSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置标注图形在特定状态下的样式\n */\n symbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置标注图形在特定状态下的样式\n */\n image?: State<Partial<IImageGraphicAttribute>>;\n /**\n * 设置标签在特定状态下的样式\n */\n text?: State<Partial<ITextGraphicAttribute>>;\n /**\n * 设置标签背景区块在特定状态下的样式\n */\n textBackground?: State<Partial<IRectGraphicAttribute>>;\n /**\n * 设置富文本在特定状态下的样式\n */\n richText?: State<Partial<IRichTextGraphicAttribute>>;\n /**\n * 设置自定义标注图形在特定状态下的样式\n */\n customMark?: State<Partial<IGroupGraphicAttribute>>;\n /**\n * 设置目标元素在特定状态下的样式\n */\n targetItem?: State<Partial<ISymbolGraphicAttribute>>;\n};\n\nexport type MarkerLineLabelAttrs<LineLabelPosition> = {\n /**\n * label 相对line的位置\n */\n position?: LineLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n} & IMarkRef &\n IMarkLabel;\n\nexport type MarkCommonLineAttrs<LineAttr, LineLabelPosition, MarkCommonLineAnimationType> =\n MarkerAttrs<MarkCommonLineAnimationType> &\n Omit<CommonSegmentAttributes, 'state' | 'lineStyle'> & {\n /**\n * 标签\n * 自 0.22.7 版本开始,支持多标签配置\n */\n label?: MarkerLineLabelAttrs<LineLabelPosition> | MarkerLineLabelAttrs<LineLabelPosition>[];\n /**\n * 辅助线各种状态下的样式\n */\n state?: MarkCommonLineState<LineAttr>;\n };\n\nexport type MarkLineAttrs = MarkCommonLineAttrs<\n ILineGraphicWithCornerRadius | ILineGraphicAttribute[],\n keyof typeof IMarkLineLabelPosition,\n MarkCommonLineAnimationType\n> & {\n /**\n * 将辅助线的类型设置为 'line'\n */\n type?: 'line';\n /**\n * 是否对 points 进行多段处理,默认为 false,即直接将所有的点连接成线。\n * 如果需要进行多段处理,需要将 points 属性配置为 Point[][] 类型\n * @default false\n */\n multiSegment?: boolean;\n /**\n * 在 `multiSegment` 属性开启的前提下,用于声明那一段线段用来作为主线段,如果不声明,默认全段为主线段\n */\n mainSegmentIndex?: number;\n /**\n * 构成line的点: 如果是两个点,则为直线;多个点则为折线\n */\n points: Point[] | Point[][];\n /**\n * 线的样式设置\n */\n lineStyle?: ILineGraphicAttribute;\n};\n\nexport type MarkArcLineAttrs = MarkCommonLineAttrs<\n IArcGraphicAttribute,\n keyof typeof IMarkCommonArcLabelPosition,\n MarkCommonLineAnimationType\n> & {\n /**\n * 将辅助线的类型设置为 'arc-line',即弧线\n */\n type?: 'arc-line';\n /**\n * 弧线中心位置\n */\n center: {\n x: number;\n y: number;\n };\n /**\n * 弧线半径\n */\n radius: number;\n /**\n * 弧线起始角度(弧度)\n */\n startAngle: number;\n /**\n * 弧线终点角度(弧度)\n */\n endAngle: number;\n /**\n * 设置弧线的样式\n */\n lineStyle?: IArcGraphicAttribute;\n};\n\nexport type MarkerAreaLabelAttrs = {\n /**\n * 设置标签的位置\n */\n position?: keyof typeof IMarkAreaLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n} & IMarkLabel;\n\nexport type MarkAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {\n type?: 'area';\n /**\n * 构成area的点\n */\n points: Point[];\n /**\n * 标签\n * 自 0.22.7 版本开始,支持多标签配置\n */\n label?: MarkerAreaLabelAttrs | MarkerAreaLabelAttrs[];\n /**\n * area的样式\n */\n areaStyle?: IPolygonAttribute;\n /**\n * 设置标注区域在各种状态下的样式\n */\n state?: CommonMarkAreaState<IPolygonGraphicAttribute>;\n};\n\nexport type MarkerArcAreaLabelAttrs = {\n /**\n * 标签的位置\n */\n position?: keyof typeof IMarkCommonArcLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n} & IMarkRef &\n IMarkLabel;\n\nexport type MarkArcAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {\n type?: 'arc-area';\n /**\n * 扇区中心位置\n */\n center: {\n x: number;\n y: number;\n };\n /**\n * 扇区内半径\n */\n innerRadius: number;\n /**\n * 扇区外半径\n */\n outerRadius: number;\n /**\n * 扇区起始角度(弧度)\n */\n startAngle: number;\n /**\n * 扇区终点角度(弧度)\n */\n endAngle: number;\n /**\n * 标签\n * 自 0.22.7 版本开始,支持多标签配置\n */\n label?: MarkerArcAreaLabelAttrs | MarkerArcAreaLabelAttrs[];\n /**\n * area的样式\n */\n areaStyle?: IArcGraphicAttribute;\n /**\n * 辅助区域这种状态下各个图元的样式设置\n */\n state?: CommonMarkAreaState<IArcGraphicAttribute>;\n};\n\nexport type IItemContent = IMarkRef & {\n /**\n * 标注类型\n * Tips: 保留'richText'与之前的定义做兼容\n */\n type?: 'symbol' | 'text' | 'image' | 'richText' | 'custom';\n /**\n * 设置标注的位置\n */\n position?: keyof typeof IMarkPointItemPosition;\n /**\n * x 方向偏移量\n */\n offsetX?: number;\n /**\n * y 方向偏移量\n */\n offsetY?: number;\n /**\n * type为symbol时, symbol的样式\n */\n symbolStyle?: ISymbolGraphicAttribute;\n /**\n * type为image时, image的样式\n */\n imageStyle?: IImageGraphicAttribute;\n /**\n * type为text时, text的配置\n * 'text'类型的ItemContent新增三种子类型:'text','rich','html'。配置在textStyle.type上,继承自TagAttributes。\n */\n textStyle?: IMarkLabel;\n /**\n * type为rich text时, rich text的样式\n */\n richTextStyle?: IRichTextGraphicAttribute;\n /**\n * type为custom时,允许以callback的方式传入需要render的item\n */\n renderCustomCallback?: () => IGroup;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n};\n\nexport type IItemLine = {\n /** TODO:'type-opo' */\n type?: 'type-s' | 'type-do' | 'type-po' | 'type-op' | 'type-arc';\n /**\n * 是否展示该标注\n */\n visible?: boolean;\n /**\n * 当type为type-arc时生效, 数值决定曲率, 符号决定法向, 不能等于0\n * @default 0.8\n */\n arcRatio?: number;\n /**\n * 垂直于引导线的装饰线,参考案例: https://observablehq.com/@mikelotis/edmonton-population-history-line-chart\n */\n decorativeLine?: {\n /**\n * 是否显示引导线的装饰线\n */\n visible?: boolean;\n /**\n * 装饰线的长度\n */\n length?: number;\n };\n} & Omit<SegmentAttributes, 'points'>;\n\nexport type MarkPointAttrs = Omit<MarkerAttrs<MarkPointAnimationType>, 'labelStyle'> & {\n /**\n * markPoint的位置(也是path的起点)\n */\n position: Point;\n /**\n * 标注引导线\n */\n itemLine?: IItemLine;\n\n /**\n * 标注内容\n */\n itemContent?: IItemContent;\n\n /**\n * 被标注的内容\n */\n targetSymbol?: {\n /**\n * 被标注内容与标记线间的间隙\n * @default 0\n */\n offset?: number;\n /**\n * 是否显示\n * @default false\n */\n visible?: boolean;\n /**\n * 大小\n * @default 20\n */\n size?: number;\n /**\n * 被标注内容的样式设置\n */\n style?: ISymbol;\n };\n /**\n * 标注点各个状态下的样式\n */\n state?: MarkPointState;\n} & BaseMarkerAnimation<MarkPointAnimationType>;\n"]}
@@ -34,10 +34,12 @@ let PopTipRenderContribution = class {
34
34
  this.poptipComponent.setAttributes(Object.assign(Object.assign({
35
35
  visibleAll: !0,
36
36
  pickable: !1,
37
- childrenPickable: !1
37
+ childrenPickable: !1,
38
+ poptipAnchor: "bounds"
38
39
  }, poptip), {
39
40
  x: matrix.e,
40
- y: matrix.f
41
+ y: matrix.f,
42
+ positionBounds: graphic.globalAABBBounds
41
43
  })), drawContext.stage.tryInitInteractiveLayer();
42
44
  const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
43
45
  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;A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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
+ {"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,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC,EAAE;gBACpE,OAAO;aACR;YACD,MAAM,SAAS,GAAG,EAAE,CAAC;YACrB,IAAA,cAAK,EACH,SAAS,EACT,eAAM,CAAC,iBAAiB,EACvB,OAAO,CAAC,SAAiB,CAAC,MAAM,CAAC,CAAC,CAAE,OAAO,CAAC,SAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAC3E,CAAC;YACF,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB,IAAI,CAAC,eAAe,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,CAAC;aAC9C;iBAAM;gBACL,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,SAAS,C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e,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,4 +1,5 @@
1
1
  import { type IGroup, type IText } from '@visactor/vrender-core';
2
+ import { type IAABBBoundsLike } from '@visactor/vutils';
2
3
  import { AbstractComponent } from '../core/base';
3
4
  import type { ComponentOptions } from '../interface';
4
5
  import type { PopTipAttributes } from './type';
@@ -11,6 +12,10 @@ export declare class PopTip extends AbstractComponent<Required<PopTipAttributes>
11
12
  constructor(attributes: PopTipAttributes, options?: ComponentOptions);
12
13
  protected render(): void;
13
14
  positionList: string[];
15
+ calculateAnchorPoint(position: string, positionBounds?: IAABBBoundsLike): {
16
+ x: number;
17
+ y: number;
18
+ };
14
19
  getAngleAndOffset(position: string, width: number, height: number, size: [number, number], symbolType: 'arrow2Left' | string): {
15
20
  angle: number;
16
21
  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, 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;
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;
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,19 +104,26 @@ class PopTip extends base_1.AbstractComponent {
104
104
  poptipHeight += contentShape.AABBBounds.height();
105
105
  }
106
106
  }
107
- const layout = "auto" === position;
107
+ const layout = "auto" === position || (0, vutils_1.isArray)(position), positionList = (0,
108
+ vutils_1.isArray)(position) ? position : this.positionList;
108
109
  let maxBBoxI, maxBBoxSize = -1 / 0;
109
- for (let i = 0; i < this.positionList.length + 1; i++) {
110
- const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;
110
+ for (let i = 0; i < positionList.length + 1; i++) {
111
+ const p = layout ? positionList[i === positionList.length ? maxBBoxI : i] : position;
111
112
  let symbolType = "arrow2Left", offsetX = ((0, vutils_1.isArray)(symbolSize) ? symbolSize[0] : symbolSize) / 4, offsetY = 0;
112
113
  "top" === p || "bottom" === p || "left" === p || "right" === p ? symbolType = "arrow2Left" : "concise" === triangleMode && (symbolType = conciseSymbolMap[p],
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,
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,
115
116
  vutils_1.isArray)(symbolSize) ? symbolSize[1] : symbolSize) / 2 : ((0, vutils_1.isArray)(symbolSize) ? symbolSize[1] : symbolSize) / 2);
116
117
  const {angle: angle, offset: offset} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, (0,
117
118
  vutils_1.isArray)(spaceSize) ? spaceSize : [ spaceSize, spaceSize - lineWidth ], symbolType);
118
- if ((0, vutils_1.isBoolean)(bgVisible)) {
119
- const bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
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), {
120
127
  visible: bgVisible && (contentVisible || titleVisible),
121
128
  x: offsetX,
122
129
  y: offsetY,
@@ -129,9 +136,7 @@ class PopTip extends base_1.AbstractComponent {
129
136
  dy: offset[1] - (null !== (_j = backgroundStyle.space) && void 0 !== _j ? _j : 0),
130
137
  size: symbolSize,
131
138
  zIndex: 9
132
- }), "symbol");
133
- let bgRect;
134
- (0, vutils_1.isEmpty)(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel),
139
+ }), "symbol"), (0, vutils_1.isEmpty)(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel),
135
140
  bgRect = panel.panelSymbolType ? group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
136
141
  visible: bgVisible && (contentVisible || titleVisible),
137
142
  x: 0,
@@ -149,8 +154,8 @@ class PopTip extends base_1.AbstractComponent {
149
154
  }), "rect"), (0, vutils_1.isEmpty)(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
150
155
  }
151
156
  if (group.setAttributes({
152
- x: -offset[0] + dx,
153
- y: -offset[1] + dy,
157
+ x: -offset[0] + dx + anchorPoint.x,
158
+ y: -offset[1] + dy + anchorPoint.y,
154
159
  anchor: [ offsetX, offsetY ]
155
160
  }), logoSymbol) {
156
161
  const {size: size = 12} = logoSymbol, sizeArray = (0, vutils_1.isArray)(size) ? size : [ size, size ];
@@ -175,18 +180,82 @@ class PopTip extends base_1.AbstractComponent {
175
180
  zIndex: 10
176
181
  }), "text");
177
182
  }
178
- if (!layout || !range) break;
183
+ if (!range) break;
179
184
  {
180
185
  _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
181
186
  const b = _tBounds, stageBounds = (new vutils_1.Bounds).setValue(0, 0, range[0], range[1]);
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);
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
+ }
186
193
  }
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;
187
210
  }
188
211
  }
189
212
  }
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
+ }
190
259
  getAngleAndOffset(position, width, height, size, symbolType) {
191
260
  const sizeH = "arrow2Left" === symbolType ? size[1] / 2 : size[1];
192
261
  switch (position) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/poptip/poptip.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAeA,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,MAAM,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QA9B7F,SAAI,GAAG,QAAQ,CAAC;QAmVhB,iBAAY,GAAG,CAAC,KAAK,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AE,EAAE,MAAM,EAAE,CAAC,KAAK,GAAG,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5D,KAAK,IAAI;gBACP,OAAO;oBACL,KAAK,EAAE,UAAU,KAAK,YAAY,CAAC,CAAC,CAAC,WAAE,CAAC,CAAC,CAAC,CAAC;oBAC3C,MAAM,EAAE,UAAU,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,EAAE,MAAM,CAAC;iBAClG,CAAC;SACL;IACH,CAAC;;AAjZH,wBAkZC;AA/YQ,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 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 { InputText } from '@visactor/vrender-animate';\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"]}
1
+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;oBACL,KAAK,EAAE,UAAU,KAAK,YAAY,CAAC,CAAC,CAAC,WAAE,CAAC,CAAC,CAAC,CAAC;oBAC3C,MAAM,EAAE,UAAU,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,KAAK,EAAE,MAAM,CAAC;iBAClG,CAAC;SACL;IACH,CAAC;;AA3fH,wBA4fC;AAzfQ,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 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"]}
@@ -1,13 +1,16 @@
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';
4
5
  type StateStyle = {
5
6
  title?: State<Partial<ITextGraphicAttribute>>;
6
7
  content?: State<Partial<ITextGraphicAttribute>>;
7
8
  panel?: State<Partial<IRectGraphicAttribute>>;
8
9
  };
9
10
  export type PopTipAttributes = {
10
- position?: 'auto' | 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb';
11
+ position?: 'auto' | 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb' | string[];
12
+ poptipAnchor?: 'position' | 'bounds';
13
+ positionBounds?: IAABBBoundsLike;
11
14
  title?: string | string[] | number | number[];
12
15
  titleStyle?: Partial<ITextGraphicAttribute>;
13
16
  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';\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"]}
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"]}
@@ -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
  }