@visactor/vrender-components 0.18.0-alpha.0 → 0.18.0-alpha.2

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 (199) hide show
  1. package/cjs/axis/base.js +24 -24
  2. package/cjs/axis/base.js.map +1 -1
  3. package/cjs/axis/grid/base.js +1 -1
  4. package/cjs/axis/grid/base.js.map +1 -1
  5. package/cjs/axis/line.js +59 -52
  6. package/cjs/axis/line.js.map +1 -1
  7. package/cjs/axis/overlap/auto-hide.d.ts +1 -0
  8. package/cjs/axis/overlap/auto-hide.js +10 -2
  9. package/cjs/axis/overlap/auto-hide.js.map +1 -1
  10. package/cjs/axis/overlap/auto-limit.d.ts +1 -0
  11. package/cjs/axis/overlap/auto-limit.js +5 -3
  12. package/cjs/axis/overlap/auto-limit.js.map +1 -1
  13. package/cjs/axis/type.d.ts +1 -0
  14. package/cjs/axis/type.js.map +1 -1
  15. package/cjs/brush/brush.js +4 -4
  16. package/cjs/brush/brush.js.map +1 -1
  17. package/cjs/checkbox/checkbox.js +2 -1
  18. package/cjs/checkbox/checkbox.js.map +1 -1
  19. package/cjs/core/type.d.ts +10 -8
  20. package/cjs/core/type.js.map +1 -1
  21. package/cjs/data-zoom/data-zoom.d.ts +6 -1
  22. package/cjs/data-zoom/data-zoom.js +180 -118
  23. package/cjs/data-zoom/data-zoom.js.map +1 -1
  24. package/cjs/data-zoom/type.d.ts +1 -0
  25. package/cjs/data-zoom/type.js.map +1 -1
  26. package/cjs/index.d.ts +2 -1
  27. package/cjs/index.js +3 -2
  28. package/cjs/index.js.map +1 -1
  29. package/cjs/indicator/indicator.d.ts +3 -1
  30. package/cjs/indicator/indicator.js +60 -46
  31. package/cjs/indicator/indicator.js.map +1 -1
  32. package/cjs/indicator/type.d.ts +1 -0
  33. package/cjs/indicator/type.js.map +1 -1
  34. package/cjs/label/arc.d.ts +2 -2
  35. package/cjs/label/arc.js +38 -35
  36. package/cjs/label/arc.js.map +1 -1
  37. package/cjs/label/base.d.ts +6 -8
  38. package/cjs/label/base.js +92 -65
  39. package/cjs/label/base.js.map +1 -1
  40. package/cjs/label/line.js +3 -4
  41. package/cjs/label/line.js.map +1 -1
  42. package/cjs/label/type.d.ts +15 -8
  43. package/cjs/label/type.js.map +1 -1
  44. package/cjs/label/util.d.ts +4 -0
  45. package/cjs/label/util.js +24 -3
  46. package/cjs/label/util.js.map +1 -1
  47. package/cjs/legend/base.js +1 -1
  48. package/cjs/legend/base.js.map +1 -1
  49. package/cjs/legend/color/color.d.ts +7 -0
  50. package/cjs/legend/color/color.js +16 -2
  51. package/cjs/legend/color/color.js.map +1 -1
  52. package/cjs/legend/discrete/discrete.d.ts +6 -2
  53. package/cjs/legend/discrete/discrete.js +139 -69
  54. package/cjs/legend/discrete/discrete.js.map +1 -1
  55. package/cjs/legend/discrete/type.d.ts +17 -7
  56. package/cjs/legend/discrete/type.js.map +1 -1
  57. package/cjs/legend/register.js +2 -2
  58. package/cjs/legend/register.js.map +1 -1
  59. package/cjs/legend/size/size.d.ts +1 -0
  60. package/cjs/legend/size/size.js +4 -1
  61. package/cjs/legend/size/size.js.map +1 -1
  62. package/cjs/legend/type.d.ts +2 -2
  63. package/cjs/legend/type.js.map +1 -1
  64. package/cjs/marker/area.js +5 -1
  65. package/cjs/marker/area.js.map +1 -1
  66. package/cjs/marker/base.d.ts +1 -0
  67. package/cjs/marker/base.js +6 -3
  68. package/cjs/marker/base.js.map +1 -1
  69. package/cjs/marker/line.js +7 -1
  70. package/cjs/marker/line.js.map +1 -1
  71. package/cjs/marker/point.d.ts +1 -0
  72. package/cjs/marker/point.js +24 -11
  73. package/cjs/marker/point.js.map +1 -1
  74. package/cjs/marker/type.d.ts +1 -0
  75. package/cjs/marker/type.js.map +1 -1
  76. package/cjs/pager/pager.js +5 -3
  77. package/cjs/pager/pager.js.map +1 -1
  78. package/cjs/scrollbar/scrollbar.js +19 -5
  79. package/cjs/scrollbar/scrollbar.js.map +1 -1
  80. package/cjs/segment/segment.js +1 -1
  81. package/cjs/segment/segment.js.map +1 -1
  82. package/cjs/slider/slider.d.ts +27 -0
  83. package/cjs/slider/slider.js +102 -13
  84. package/cjs/slider/slider.js.map +1 -1
  85. package/cjs/slider/type.d.ts +9 -1
  86. package/cjs/slider/type.js.map +1 -1
  87. package/cjs/tag/tag.js +28 -42
  88. package/cjs/tag/tag.js.map +1 -1
  89. package/cjs/title/title.js +2 -2
  90. package/cjs/title/title.js.map +1 -1
  91. package/cjs/tooltip/tooltip.js +1 -1
  92. package/cjs/tooltip/tooltip.js.map +1 -1
  93. package/cjs/util/limit-shape.d.ts +4 -0
  94. package/cjs/util/limit-shape.js +13 -4
  95. package/cjs/util/limit-shape.js.map +1 -1
  96. package/cjs/util/text.d.ts +5 -2
  97. package/cjs/util/text.js +19 -6
  98. package/cjs/util/text.js.map +1 -1
  99. package/es/axis/base.js +22 -26
  100. package/es/axis/base.js.map +1 -1
  101. package/es/axis/grid/base.js +1 -1
  102. package/es/axis/grid/base.js.map +1 -1
  103. package/es/axis/line.js +59 -50
  104. package/es/axis/line.js.map +1 -1
  105. package/es/axis/overlap/auto-hide.d.ts +1 -0
  106. package/es/axis/overlap/auto-hide.js +10 -2
  107. package/es/axis/overlap/auto-hide.js.map +1 -1
  108. package/es/axis/overlap/auto-limit.d.ts +1 -0
  109. package/es/axis/overlap/auto-limit.js +5 -3
  110. package/es/axis/overlap/auto-limit.js.map +1 -1
  111. package/es/axis/type.d.ts +1 -0
  112. package/es/axis/type.js.map +1 -1
  113. package/es/brush/brush.js +4 -4
  114. package/es/brush/brush.js.map +1 -1
  115. package/es/checkbox/checkbox.js +2 -1
  116. package/es/checkbox/checkbox.js.map +1 -1
  117. package/es/core/type.d.ts +10 -8
  118. package/es/core/type.js.map +1 -1
  119. package/es/data-zoom/data-zoom.d.ts +6 -1
  120. package/es/data-zoom/data-zoom.js +179 -116
  121. package/es/data-zoom/data-zoom.js.map +1 -1
  122. package/es/data-zoom/type.d.ts +1 -0
  123. package/es/data-zoom/type.js.map +1 -1
  124. package/es/index.d.ts +2 -1
  125. package/es/index.js +3 -1
  126. package/es/index.js.map +1 -1
  127. package/es/indicator/indicator.d.ts +3 -1
  128. package/es/indicator/indicator.js +57 -47
  129. package/es/indicator/indicator.js.map +1 -1
  130. package/es/indicator/type.d.ts +1 -0
  131. package/es/indicator/type.js.map +1 -1
  132. package/es/label/arc.d.ts +2 -2
  133. package/es/label/arc.js +38 -35
  134. package/es/label/arc.js.map +1 -1
  135. package/es/label/base.d.ts +6 -8
  136. package/es/label/base.js +92 -65
  137. package/es/label/base.js.map +1 -1
  138. package/es/label/line.js +3 -4
  139. package/es/label/line.js.map +1 -1
  140. package/es/label/type.d.ts +15 -8
  141. package/es/label/type.js.map +1 -1
  142. package/es/label/util.d.ts +4 -0
  143. package/es/label/util.js +22 -2
  144. package/es/label/util.js.map +1 -1
  145. package/es/legend/base.js +1 -1
  146. package/es/legend/base.js.map +1 -1
  147. package/es/legend/color/color.d.ts +7 -0
  148. package/es/legend/color/color.js +17 -3
  149. package/es/legend/color/color.js.map +1 -1
  150. package/es/legend/discrete/discrete.d.ts +6 -2
  151. package/es/legend/discrete/discrete.js +141 -67
  152. package/es/legend/discrete/discrete.js.map +1 -1
  153. package/es/legend/discrete/type.d.ts +17 -7
  154. package/es/legend/discrete/type.js.map +1 -1
  155. package/es/legend/register.js +3 -1
  156. package/es/legend/register.js.map +1 -1
  157. package/es/legend/size/size.d.ts +1 -0
  158. package/es/legend/size/size.js +4 -1
  159. package/es/legend/size/size.js.map +1 -1
  160. package/es/legend/type.d.ts +2 -2
  161. package/es/legend/type.js.map +1 -1
  162. package/es/marker/area.js +6 -2
  163. package/es/marker/area.js.map +1 -1
  164. package/es/marker/base.d.ts +1 -0
  165. package/es/marker/base.js +6 -3
  166. package/es/marker/base.js.map +1 -1
  167. package/es/marker/line.js +8 -2
  168. package/es/marker/line.js.map +1 -1
  169. package/es/marker/point.d.ts +1 -0
  170. package/es/marker/point.js +25 -11
  171. package/es/marker/point.js.map +1 -1
  172. package/es/marker/type.d.ts +1 -0
  173. package/es/marker/type.js.map +1 -1
  174. package/es/pager/pager.js +4 -3
  175. package/es/pager/pager.js.map +1 -1
  176. package/es/scrollbar/scrollbar.js +19 -5
  177. package/es/scrollbar/scrollbar.js.map +1 -1
  178. package/es/segment/segment.js +1 -1
  179. package/es/segment/segment.js.map +1 -1
  180. package/es/slider/slider.d.ts +27 -0
  181. package/es/slider/slider.js +102 -13
  182. package/es/slider/slider.js.map +1 -1
  183. package/es/slider/type.d.ts +9 -1
  184. package/es/slider/type.js.map +1 -1
  185. package/es/tag/tag.js +29 -45
  186. package/es/tag/tag.js.map +1 -1
  187. package/es/title/title.js +3 -3
  188. package/es/title/title.js.map +1 -1
  189. package/es/tooltip/tooltip.js +1 -1
  190. package/es/tooltip/tooltip.js.map +1 -1
  191. package/es/util/limit-shape.d.ts +4 -0
  192. package/es/util/limit-shape.js +11 -3
  193. package/es/util/limit-shape.js.map +1 -1
  194. package/es/util/text.d.ts +5 -2
  195. package/es/util/text.js +17 -5
  196. package/es/util/text.js.map +1 -1
  197. package/package.json +3 -3
  198. package/dist/index.js +0 -29932
  199. package/dist/index.min.js +0 -1
@@ -28,16 +28,18 @@ export type Padding = number | number[] | {
28
28
  right?: number;
29
29
  };
30
30
  type CommonTextContent = {
31
- type?: 'text';
32
- text?: string | string[] | number | number[];
31
+ text?: string | string[] | number | number[] | {
32
+ type?: 'text';
33
+ text: string | string[] | number | number[];
34
+ };
33
35
  };
34
36
  type RichTextContent = {
35
- type?: 'rich';
36
- text?: IRichTextCharacter[];
37
+ text?: {
38
+ type: 'rich';
39
+ text: IRichTextCharacter[];
40
+ };
37
41
  };
38
- type HtmlTextContent = {
39
- type?: 'html';
40
- text?: string | HTMLElement;
42
+ export type TextContent = (CommonTextContent | RichTextContent) & {
43
+ type?: 'text' | 'rich';
41
44
  };
42
- export type TextContent = CommonTextContent | RichTextContent | HtmlTextContent;
43
45
  export {};
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type { IRichTextCharacter } from '@visactor/vrender-core';\n\nexport type Point = {\n x: number;\n y: number;\n};\n\nexport interface LocationCfg {\n [key: string]: any;\n}\n\nexport interface PointLocationCfg extends LocationCfg {\n /**\n * 位置 x\n * @type {number}\n */\n x: number;\n /**\n * 位置 y\n * @type {number}\n */\n y: number;\n}\n\nexport interface RegionLocationCfg extends LocationCfg {\n /**\n * 起始点\n */\n start: Point;\n /**\n * 结束点\n */\n end: Point;\n}\n\nexport type State<T> = {\n [key: string]: T;\n};\n\nexport type BaseGraphicAttributes<T> = {\n /**\n * 基础样式设置\n */\n style?: T;\n /**\n * 状态样式设置\n */\n state?: State<T>;\n};\n\nexport type Padding =\n | number\n | number[]\n | {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n };\n\ntype CommonTextContent = {\n type?: 'text';\n text?: string | string[] | number | number[];\n};\n\ntype RichTextContent = {\n type?: 'rich';\n text?: IRichTextCharacter[];\n};\n\ntype HtmlTextContent = {\n type?: 'html';\n text?: string | HTMLElement;\n};\n\nexport type TextContent = CommonTextContent | RichTextContent | HtmlTextContent;\n"]}
1
+ {"version":3,"sources":["../src/core/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type { IRichTextCharacter } from '@visactor/vrender-core';\n\nexport type Point = {\n x: number;\n y: number;\n};\n\nexport interface LocationCfg {\n [key: string]: any;\n}\n\nexport interface PointLocationCfg extends LocationCfg {\n /**\n * 位置 x\n * @type {number}\n */\n x: number;\n /**\n * 位置 y\n * @type {number}\n */\n y: number;\n}\n\nexport interface RegionLocationCfg extends LocationCfg {\n /**\n * 起始点\n */\n start: Point;\n /**\n * 结束点\n */\n end: Point;\n}\n\nexport type State<T> = {\n [key: string]: T;\n};\n\nexport type BaseGraphicAttributes<T> = {\n /**\n * 基础样式设置\n */\n style?: T;\n /**\n * 状态样式设置\n */\n state?: State<T>;\n};\n\nexport type Padding =\n | number\n | number[]\n | {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n };\n\ntype CommonTextContent = {\n text?:\n | string\n | string[]\n | number\n | number[]\n | {\n type?: 'text';\n text: string | string[] | number | number[];\n };\n};\n\ntype RichTextContent = {\n text?: {\n type: 'rich';\n text: IRichTextCharacter[];\n };\n};\n\nexport type TextContent = (CommonTextContent | RichTextContent) & {\n /** @deprecated */\n type?: 'text' | 'rich';\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { FederatedPointerEvent, IGroup } from '@visactor/vrender-core';
2
- import type { IPointLike } from '@visactor/vutils';
2
+ import type { IBoundsLike, IPointLike } from '@visactor/vutils';
3
3
  import { AbstractComponent } from '../core/base';
4
4
  import type { TagAttributes } from '../tag';
5
5
  import { Tag } from '../tag';
@@ -154,7 +154,9 @@ export declare class DataZoom extends AbstractComponent<Required<DataZoomAttribu
154
154
  private _previewPointsY1;
155
155
  private _statePointToData;
156
156
  private _layoutAttrFromConfig;
157
+ setPropsFromAttrs(): void;
157
158
  constructor(attributes: DataZoomAttributes, options?: ComponentOptions);
159
+ setAttributes(params: Partial<Required<DataZoomAttributes>>, forceUpdateTag?: boolean): void;
158
160
  protected bindEvents(): void;
159
161
  protected dragMaskSize(): number;
160
162
  protected setStateAttr(start: number, end: number, shouldRender: boolean): void;
@@ -163,6 +165,7 @@ export declare class DataZoom extends AbstractComponent<Required<DataZoomAttribu
163
165
  y: number;
164
166
  };
165
167
  private _onHandlerPointerDown;
168
+ private _pointerMove;
166
169
  private _onHandlerPointerMove;
167
170
  private _onHandlerPointerUp;
168
171
  private _onHandlerPointerEnter;
@@ -170,6 +173,8 @@ export declare class DataZoom extends AbstractComponent<Required<DataZoomAttribu
170
173
  protected backgroundDragZoom(startPos: IPointLike, endPos: IPointLike): void;
171
174
  protected moveZoomWithMiddle(middle: number): void;
172
175
  protected renderDragMask(): void;
176
+ protected isTextOverflow(componentBoundsLike: IBoundsLike, textBounds: IBoundsLike | null, layout: 'start' | 'end'): boolean;
177
+ protected setTextAttr(startTextBounds: IBoundsLike, endTextBounds: IBoundsLike): void;
173
178
  protected renderText(): void;
174
179
  protected getLayoutAttrFromConfig(): any;
175
180
  protected render(): void;
@@ -22,6 +22,18 @@ const vrender_core_1 = require("@visactor/vrender-core"), vutils_1 = require("@v
22
22
  (0, register_1.loadDataZoomComponent)();
23
23
 
24
24
  class DataZoom extends base_1.AbstractComponent {
25
+ setPropsFromAttrs() {
26
+ const {start: start, end: end, orient: orient, previewData: previewData, previewPointsX: previewPointsX, previewPointsY: previewPointsY, previewPointsX1: previewPointsX1, previewPointsY1: previewPointsY1} = this.attribute;
27
+ start && (this.state.start = start), end && (this.state.end = end);
28
+ const {width: width, height: height} = this.getLayoutAttrFromConfig();
29
+ this._spanCache = this.state.end - this.state.start, this._isHorizontal = "top" === orient || "bottom" === orient,
30
+ this._layoutCache.max = this._isHorizontal ? width : height, this._layoutCache.attPos = this._isHorizontal ? "x" : "y",
31
+ this._layoutCache.attSize = this._isHorizontal ? "width" : "height", previewData && (this._previewData = previewData),
32
+ (0, vutils_1.isFunction)(previewPointsX) && (this._previewPointsX = previewPointsX),
33
+ (0, vutils_1.isFunction)(previewPointsY) && (this._previewPointsY = previewPointsY),
34
+ (0, vutils_1.isFunction)(previewPointsX1) && (this._previewPointsX1 = previewPointsX1),
35
+ (0, vutils_1.isFunction)(previewPointsY1) && (this._previewPointsY1 = previewPointsY1);
36
+ }
25
37
  constructor(attributes, options) {
26
38
  super((null == options ? void 0 : options.skipDefault) ? attributes : (0, vutils_1.merge)({}, DataZoom.defaultAttributes, attributes)),
27
39
  this.name = "dataZoom", this._previewData = [], this._activeState = !1, this._activeCache = {
@@ -49,11 +61,11 @@ class DataZoom extends base_1.AbstractComponent {
49
61
  this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this.eventPosToStagePos(e),
50
62
  this._activeCache.lastPos = this.eventPosToStagePos(e), "browser" === vrender_core_1.vglobal.env && (vrender_core_1.vglobal.addEventListener("pointermove", this._onHandlerPointerMove, {
51
63
  capture: !0
52
- }), vrender_core_1.vglobal.addEventListener("pointerup", this._onHandlerPointerUp.bind(this))),
64
+ }), vrender_core_1.vglobal.addEventListener("pointerup", this._onHandlerPointerUp)),
53
65
  this.addEventListener("pointermove", this._onHandlerPointerMove, {
54
66
  capture: !0
55
67
  });
56
- }, this._onHandlerPointerMove = delayMap[this.attribute.delayType]((e => {
68
+ }, this._pointerMove = e => {
57
69
  e.stopPropagation();
58
70
  const {start: startAttr, end: endAttr, brushSelect: brushSelect, realTime: realTime = !0} = this.attribute, pos = this.eventPosToStagePos(e), {attPos: attPos, max: max} = this._layoutCache, dis = (pos[attPos] - this._activeCache.lastPos[attPos]) / max;
59
71
  let {start: start, end: end} = this.state;
@@ -62,21 +74,37 @@ class DataZoom extends base_1.AbstractComponent {
62
74
  start = end + dis, this._activeTag = type_1.DataZoomActiveTag.startHandler) : end += dis),
63
75
  this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1),
64
76
  end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0),
65
- this._dispatchEvent("change", {
77
+ realTime && this._dispatchEvent("change", {
66
78
  start: start,
67
79
  end: end,
68
80
  tag: this._activeTag
69
81
  }));
70
- }), this.attribute.delayTime);
71
- const {start: start, end: end, size: size, orient: orient, showDetail: showDetail, position: position, previewData: previewData, previewPointsX: previewPointsX, previewPointsY: previewPointsY, previewPointsX1: previewPointsX1, previewPointsY1: previewPointsY1, updateStateCallback: updateStateCallback} = this.attribute, {width: width, height: height} = size;
72
- start && (this.state.start = start), end && (this.state.end = end), this._spanCache = this.state.end - this.state.start,
73
- this._isHorizontal = "top" === orient || "bottom" === orient, this._layoutCache.max = this._isHorizontal ? width : height,
74
- this._layoutCache.attPos = this._isHorizontal ? "x" : "y", this._layoutCache.attSize = this._isHorizontal ? "width" : "height",
82
+ }, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap[this.attribute.delayType](this._pointerMove, this.attribute.delayTime),
83
+ this._onHandlerPointerUp = e => {
84
+ e.preventDefault();
85
+ const {start: start, end: end, brushSelect: brushSelect, realTime: realTime = !0} = this.attribute;
86
+ if (this._activeState && this._activeTag === type_1.DataZoomActiveTag.background) {
87
+ const pos = this.eventPosToStagePos(e);
88
+ this.backgroundDragZoom(this._activeCache.startPos, pos);
89
+ }
90
+ this._activeState = !1, brushSelect && this.renderDragMask(), start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0),
91
+ this._dispatchEvent("change", {
92
+ start: this.state.start,
93
+ end: this.state.end,
94
+ tag: this._activeTag
95
+ })), "browser" === vrender_core_1.vglobal.env && (vrender_core_1.vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
96
+ capture: !0
97
+ }), vrender_core_1.vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)),
98
+ this.removeEventListener("pointermove", this._onHandlerPointerMove, {
99
+ capture: !0
100
+ }), this.removeEventListener("pointerup", this._onHandlerPointerUp);
101
+ };
102
+ const {position: position, showDetail: showDetail} = attributes;
75
103
  this._activeCache.startPos = position, this._activeCache.lastPos = position, this._showText = "auto" !== showDetail && showDetail,
76
- previewData && (this._previewData = previewData), (0, vutils_1.isFunction)(previewPointsX) && (this._previewPointsX = previewPointsX),
77
- (0, vutils_1.isFunction)(previewPointsY) && (this._previewPointsY = previewPointsY),
78
- (0, vutils_1.isFunction)(previewPointsX1) && (this._previewPointsX1 = previewPointsX1),
79
- (0, vutils_1.isFunction)(previewPointsY1) && (this._previewPointsY1 = previewPointsY1);
104
+ this.setPropsFromAttrs();
105
+ }
106
+ setAttributes(params, forceUpdateTag) {
107
+ super.setAttributes(params, forceUpdateTag), this.setPropsFromAttrs();
80
108
  }
81
109
  bindEvents() {
82
110
  if (this.attribute.disableTriggerEvent) return;
@@ -108,31 +136,12 @@ class DataZoom extends base_1.AbstractComponent {
108
136
  }
109
137
  eventPosToStagePos(e) {
110
138
  var _a, _b;
111
- const {x: x, y: y} = vrender_core_1.vglobal.mapToCanvasPoint(e);
139
+ const {x: x, y: y} = vrender_core_1.vglobal.mapToCanvasPoint(e, this.stage.window.getContext().canvas.nativeCanvas);
112
140
  return {
113
141
  x: x - ((null === (_a = this.stage) || void 0 === _a ? void 0 : _a.x) || 0),
114
142
  y: y - ((null === (_b = this.stage) || void 0 === _b ? void 0 : _b.y) || 0)
115
143
  };
116
144
  }
117
- _onHandlerPointerUp(e) {
118
- e.preventDefault();
119
- const {start: start, end: end, brushSelect: brushSelect, realTime: realTime = !0} = this.attribute;
120
- if (this._activeState && this._activeTag === type_1.DataZoomActiveTag.background) {
121
- const pos = this.eventPosToStagePos(e);
122
- this.backgroundDragZoom(this._activeCache.startPos, pos);
123
- }
124
- this._activeState = !1, brushSelect && this.renderDragMask(), realTime && start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0),
125
- this._dispatchEvent("change", {
126
- start: this.state.start,
127
- end: this.state.end,
128
- tag: this._activeTag
129
- })), "browser" === vrender_core_1.vglobal.env && (vrender_core_1.vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
130
- capture: !0
131
- }), vrender_core_1.vglobal.removeEventListener("pointerup", this._onHandlerPointerUp.bind(this))),
132
- this.removeEventListener("pointermove", this._onHandlerPointerMove, {
133
- capture: !0
134
- });
135
- }
136
145
  _onHandlerPointerEnter(e) {
137
146
  e.stopPropagation(), this._showText = !0, this.renderText();
138
147
  }
@@ -162,64 +171,85 @@ class DataZoom extends base_1.AbstractComponent {
162
171
  height: this._activeState && this._activeTag === type_1.DataZoomActiveTag.background && Math.abs(this.dragMaskSize()) || 0
163
172
  }, dragMaskStyle), "rect");
164
173
  }
165
- renderText() {
166
- const {startTextStyle: startTextStyle, endTextStyle: endTextStyle} = this.attribute, {formatMethod: startTextFormat} = startTextStyle, restStartStyle = __rest(startTextStyle, [ "formatMethod" ]), {formatMethod: endTextFormat} = endTextStyle, restEndTextStyle = __rest(endTextStyle, [ "formatMethod" ]), {start: start, end: end} = this.state;
174
+ isTextOverflow(componentBoundsLike, textBounds, layout) {
175
+ if (!textBounds) return !1;
176
+ if (this._isHorizontal) {
177
+ if ("start" === layout) {
178
+ if (textBounds.x1 < componentBoundsLike.x1) return !0;
179
+ } else if (textBounds.x2 > componentBoundsLike.x2) return !0;
180
+ } else if ("start" === layout) {
181
+ if (textBounds.y1 < componentBoundsLike.y1) return !0;
182
+ } else if (textBounds.y2 > componentBoundsLike.y2) return !0;
183
+ return !1;
184
+ }
185
+ setTextAttr(startTextBounds, endTextBounds) {
186
+ const {startTextStyle: startTextStyle, endTextStyle: endTextStyle} = this.attribute, {formatMethod: startTextFormat} = startTextStyle, restStartTextStyle = __rest(startTextStyle, [ "formatMethod" ]), {formatMethod: endTextFormat} = endTextStyle, restEndTextStyle = __rest(endTextStyle, [ "formatMethod" ]), {start: start, end: end} = this.state;
167
187
  this._startValue = this._statePointToData(start), this._endValue = this._statePointToData(end);
168
- const {position: position, width: width, height: height} = this.getLayoutAttrFromConfig();
169
- this._isHorizontal ? (this._startText = this.maybeAddLabel(this._container, (0,
170
- vutils_1.merge)({}, restStartStyle, {
171
- text: startTextFormat ? startTextFormat(this._startValue) : this._startValue,
188
+ const {position: position, width: width, height: height} = this.getLayoutAttrFromConfig(), startTextValue = startTextFormat ? startTextFormat(this._startValue) : this._startValue, endTextValue = endTextFormat ? endTextFormat(this._endValue) : this._endValue, componentBoundsLike = {
189
+ x1: position.x,
190
+ y1: position.y,
191
+ x2: position.x + width,
192
+ y2: position.y + height
193
+ };
194
+ let startTextPosition, endTextPosition, startTextAlignStyle, endTextAlignStyle;
195
+ this._isHorizontal ? (startTextPosition = {
172
196
  x: position.x + start * width,
173
- y: position.y + height / 2,
174
- visible: this._showText,
175
- pickable: !1,
176
- childrenPickable: !1,
177
- textStyle: {
178
- textAlign: "right",
179
- textBaseline: "middle"
180
- }
181
- }), `data-zoom-start-text-${position}`), this._endText = this.maybeAddLabel(this._container, (0,
182
- vutils_1.merge)({}, restEndTextStyle, {
183
- text: endTextFormat ? endTextFormat(this._endValue) : this._endValue,
197
+ y: position.y + height / 2
198
+ }, endTextPosition = {
184
199
  x: position.x + end * width,
185
- y: position.y + height / 2,
186
- visible: this._showText,
187
- pickable: !1,
188
- childrenPickable: !1,
189
- textStyle: {
190
- textAlign: "left",
191
- textBaseline: "middle"
192
- }
193
- }), `data-zoom-end-text-${position}`)) : (this._startText = this.maybeAddLabel(this._container, (0,
194
- vutils_1.merge)({}, restStartStyle, {
195
- text: startTextFormat ? startTextFormat(this._startValue) : this._startValue,
200
+ y: position.y + height / 2
201
+ }, startTextAlignStyle = {
202
+ textAlign: this.isTextOverflow(componentBoundsLike, startTextBounds, "start") ? "left" : "right",
203
+ textBaseline: "middle"
204
+ }, endTextAlignStyle = {
205
+ textAlign: this.isTextOverflow(componentBoundsLike, endTextBounds, "end") ? "right" : "left",
206
+ textBaseline: "middle"
207
+ }) : (startTextPosition = {
196
208
  x: position.x + width / 2,
197
- y: position.y + start * height,
209
+ y: position.y + start * height
210
+ }, endTextPosition = {
211
+ x: position.x + width / 2,
212
+ y: position.y + end * height
213
+ }, startTextAlignStyle = {
214
+ textAlign: "center",
215
+ textBaseline: this.isTextOverflow(componentBoundsLike, startTextBounds, "start") ? "top" : "bottom"
216
+ }, endTextAlignStyle = {
217
+ textAlign: "center",
218
+ textBaseline: this.isTextOverflow(componentBoundsLike, endTextBounds, "end") ? "bottom" : "top"
219
+ }), this._startText = this.maybeAddLabel(this._container, (0, vutils_1.merge)({}, restStartTextStyle, {
220
+ text: startTextValue,
221
+ x: startTextPosition.x,
222
+ y: startTextPosition.y,
198
223
  visible: this._showText,
199
224
  pickable: !1,
200
225
  childrenPickable: !1,
201
- textStyle: {
202
- textAlign: "center",
203
- textBaseline: "bottom"
204
- }
226
+ textStyle: startTextAlignStyle
205
227
  }), `data-zoom-start-text-${position}`), this._endText = this.maybeAddLabel(this._container, (0,
206
228
  vutils_1.merge)({}, restEndTextStyle, {
207
- text: endTextFormat ? endTextFormat(this._endValue) : this._endValue,
208
- x: position.x + width / 2,
209
- y: position.y + end * height,
229
+ text: endTextValue,
230
+ x: endTextPosition.x,
231
+ y: endTextPosition.y,
210
232
  visible: this._showText,
211
233
  pickable: !1,
212
234
  childrenPickable: !1,
213
- textStyle: {
214
- textAlign: "center",
215
- textBaseline: "top"
216
- }
217
- }), `data-zoom-end-text-${position}`));
235
+ textStyle: endTextAlignStyle
236
+ }), `data-zoom-end-text-${position}`);
237
+ }
238
+ renderText() {
239
+ let startTextBounds = null, endTextBounds = null;
240
+ this.setTextAttr(startTextBounds, endTextBounds), startTextBounds = this._startText.AABBBounds,
241
+ endTextBounds = this._endText.AABBBounds, this.setTextAttr(startTextBounds, endTextBounds),
242
+ startTextBounds = this._startText.AABBBounds, endTextBounds = this._endText.AABBBounds;
243
+ const {x1: x1, x2: x2, y1: y1, y2: y2} = startTextBounds, {dx: startTextDx = 0, dy: startTextDy = 0} = this.attribute.startTextStyle;
244
+ if ((new vutils_1.Bounds).set(x1, y1, x2, y2).intersects(endTextBounds)) {
245
+ const direction = "bottom" === this.attribute.orient || "right" === this.attribute.orient ? -1 : 1;
246
+ this._isHorizontal ? this._startText.setAttribute("dy", startTextDy + direction * Math.abs(endTextBounds.y1 - endTextBounds.y2)) : this._startText.setAttribute("dx", startTextDx + direction * Math.abs(endTextBounds.x1 - endTextBounds.x2));
247
+ } else this._isHorizontal ? this._startText.setAttribute("dy", startTextDy) : this._startText.setAttribute("dx", startTextDx);
218
248
  }
219
249
  getLayoutAttrFromConfig() {
220
- var _a, _b, _c, _d;
250
+ var _a, _b, _c, _d, _e, _f;
221
251
  if (this._layoutAttrFromConfig) return this._layoutAttrFromConfig;
222
- const {position: positionConfig, size: size, orient: orient, middleHandlerStyle: middleHandlerStyle = {}, startHandlerStyle: startHandlerStyle = {}, endHandlerStyle: endHandlerStyle = {}} = this.attribute, {width: widthConfig, height: heightConfig} = size, middleHandlerSize = null !== (_b = null === (_a = middleHandlerStyle.background) || void 0 === _a ? void 0 : _a.size) && void 0 !== _b ? _b : 10;
252
+ const {position: positionConfig, size: size, orient: orient, middleHandlerStyle: middleHandlerStyle = {}, startHandlerStyle: startHandlerStyle = {}, endHandlerStyle: endHandlerStyle = {}, backgroundStyle: backgroundStyle = {}} = this.attribute, {width: widthConfig, height: heightConfig} = size, middleHandlerSize = null !== (_b = null === (_a = middleHandlerStyle.background) || void 0 === _a ? void 0 : _a.size) && void 0 !== _b ? _b : 10;
223
253
  let width, height, position;
224
254
  middleHandlerStyle.visible ? this._isHorizontal ? (width = widthConfig, height = heightConfig - middleHandlerSize,
225
255
  position = {
@@ -236,70 +266,84 @@ class DataZoom extends base_1.AbstractComponent {
236
266
  y: position.y
237
267
  }) : (height -= (startHandlerSize + endHandlerSize) / 2, position = {
238
268
  x: position.x,
239
- y: position.y + startHandlerSize
240
- })), this._layoutAttrFromConfig = {
269
+ y: position.y + startHandlerSize / 2
270
+ })), height += null !== (_e = backgroundStyle.lineWidth / 2) && void 0 !== _e ? _e : 1,
271
+ width += null !== (_f = backgroundStyle.lineWidth / 2) && void 0 !== _f ? _f : 1,
272
+ this._layoutAttrFromConfig = {
241
273
  position: position,
242
274
  width: width,
243
275
  height: height
244
276
  }, this._layoutAttrFromConfig;
245
277
  }
246
278
  render() {
247
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
279
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
248
280
  this._layoutAttrFromConfig = null;
249
- const {orient: orient, backgroundStyle: backgroundStyle, backgroundChartStyle: backgroundChartStyle = {}, selectedBackgroundStyle: selectedBackgroundStyle = {}, selectedBackgroundChartStyle: selectedBackgroundChartStyle = {}, middleHandlerStyle: middleHandlerStyle = {}, startHandlerStyle: startHandlerStyle = {}, endHandlerStyle: endHandlerStyle = {}, brushSelect: brushSelect} = this.attribute, {start: start, end: end} = this.state, {position: position, width: width, height: height} = this.getLayoutAttrFromConfig(), startHandlerMinSize = null !== (_a = startHandlerStyle.triggerMinSize) && void 0 !== _a ? _a : 40, endHandlerMinSize = null !== (_b = endHandlerStyle.triggerMinSize) && void 0 !== _b ? _b : 40, group = this.createOrUpdateChild("dataZoom-container", {}, "group");
250
- if (this._container = group, this._background = group.createOrUpdateChild("background", Object.assign({
281
+ const {orient: orient, backgroundStyle: backgroundStyle, backgroundChartStyle: backgroundChartStyle = {}, selectedBackgroundStyle: selectedBackgroundStyle = {}, selectedBackgroundChartStyle: selectedBackgroundChartStyle = {}, middleHandlerStyle: middleHandlerStyle = {}, startHandlerStyle: startHandlerStyle = {}, endHandlerStyle: endHandlerStyle = {}, brushSelect: brushSelect, zoomLock: zoomLock} = this.attribute, {start: start, end: end} = this.state, {position: position, width: width, height: height} = this.getLayoutAttrFromConfig(), startHandlerMinSize = null !== (_a = startHandlerStyle.triggerMinSize) && void 0 !== _a ? _a : 40, endHandlerMinSize = null !== (_b = endHandlerStyle.triggerMinSize) && void 0 !== _b ? _b : 40, group = this.createOrUpdateChild("dataZoom-container", {}, "group");
282
+ if (this._container = group, this._background = group.createOrUpdateChild("background", Object.assign(Object.assign({
251
283
  x: position.x,
252
284
  y: position.y,
253
285
  width: width,
254
286
  height: height,
255
287
  cursor: brushSelect ? "crosshair" : "auto"
256
- }, backgroundStyle), "rect"), (null === (_c = backgroundChartStyle.line) || void 0 === _c ? void 0 : _c.visible) && this.setPreviewAttributes("line", group),
257
- (null === (_d = backgroundChartStyle.area) || void 0 === _d ? void 0 : _d.visible) && this.setPreviewAttributes("area", group),
258
- brushSelect && this.renderDragMask(), this._isHorizontal ? this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign({
288
+ }, backgroundStyle), {
289
+ pickable: !zoomLock && (null === (_c = backgroundStyle.pickable) || void 0 === _c || _c)
290
+ }), "rect"), (null === (_d = backgroundChartStyle.line) || void 0 === _d ? void 0 : _d.visible) && this.setPreviewAttributes("line", group),
291
+ (null === (_e = backgroundChartStyle.area) || void 0 === _e ? void 0 : _e.visible) && this.setPreviewAttributes("area", group),
292
+ brushSelect && this.renderDragMask(), this._isHorizontal ? this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
259
293
  x: position.x + start * width,
260
294
  y: position.y,
261
295
  width: (end - start) * width,
262
296
  height: height,
263
297
  cursor: brushSelect ? "crosshair" : "move"
264
- }, selectedBackgroundStyle), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign({
298
+ }, selectedBackgroundStyle), {
299
+ pickable: !zoomLock && (null === (_f = selectedBackgroundChartStyle.pickable) || void 0 === _f || _f)
300
+ }), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
265
301
  x: position.x,
266
302
  y: position.y + start * height,
267
303
  width: width,
268
304
  height: (end - start) * height,
269
305
  cursor: brushSelect ? "crosshair" : "move"
270
- }, selectedBackgroundStyle), "rect"), (null === (_e = selectedBackgroundChartStyle.line) || void 0 === _e ? void 0 : _e.visible) && this.setSelectedPreviewAttributes("line", group),
271
- (null === (_f = selectedBackgroundChartStyle.area) || void 0 === _f ? void 0 : _f.visible) && this.setSelectedPreviewAttributes("area", group),
272
- this._showText && this.renderText(), this._isHorizontal) {
306
+ }, selectedBackgroundStyle), {
307
+ pickable: !zoomLock && (null === (_g = selectedBackgroundStyle.pickable) || void 0 === _g || _g)
308
+ }), "rect"), (null === (_h = selectedBackgroundChartStyle.line) || void 0 === _h ? void 0 : _h.visible) && this.setSelectedPreviewAttributes("line", group),
309
+ (null === (_j = selectedBackgroundChartStyle.area) || void 0 === _j ? void 0 : _j.visible) && this.setSelectedPreviewAttributes("area", group),
310
+ this._isHorizontal) {
273
311
  if (middleHandlerStyle.visible) {
274
- const middleHandlerBackgroundSize = (null === (_g = middleHandlerStyle.background) || void 0 === _g ? void 0 : _g.size) || 10;
275
- this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign({
312
+ const middleHandlerBackgroundSize = (null === (_k = middleHandlerStyle.background) || void 0 === _k ? void 0 : _k.size) || 10;
313
+ this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
276
314
  x: position.x + start * width,
277
315
  y: position.y - middleHandlerBackgroundSize,
278
316
  width: (end - start) * width,
279
317
  height: middleHandlerBackgroundSize
280
- }, null === (_h = middleHandlerStyle.background) || void 0 === _h ? void 0 : _h.style), "rect"),
281
- this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign({
318
+ }, null === (_l = middleHandlerStyle.background) || void 0 === _l ? void 0 : _l.style), {
319
+ pickable: !zoomLock && (null === (_p = null === (_o = null === (_m = middleHandlerStyle.background) || void 0 === _m ? void 0 : _m.style) || void 0 === _o ? void 0 : _o.pickable) || void 0 === _p || _p)
320
+ }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
282
321
  x: position.x + (start + end) / 2 * width,
283
322
  y: position.y - middleHandlerBackgroundSize / 2,
284
323
  strokeBoundsBuffer: 0,
285
324
  angle: 0,
286
- symbolType: null !== (_k = null === (_j = middleHandlerStyle.icon) || void 0 === _j ? void 0 : _j.symbolType) && void 0 !== _k ? _k : "square"
287
- }, middleHandlerStyle.icon), "symbol");
325
+ symbolType: null !== (_r = null === (_q = middleHandlerStyle.icon) || void 0 === _q ? void 0 : _q.symbolType) && void 0 !== _r ? _r : "square"
326
+ }, middleHandlerStyle.icon), {
327
+ pickable: !zoomLock && (null === (_s = middleHandlerStyle.icon.pickable) || void 0 === _s || _s)
328
+ }), "symbol");
288
329
  }
289
- this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign({
330
+ this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
290
331
  x: position.x + start * width,
291
332
  y: position.y + height / 2,
292
333
  size: height,
293
- symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
294
- }, config_1.DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), "symbol"),
295
- this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign({
334
+ symbolType: null !== (_t = startHandlerStyle.symbolType) && void 0 !== _t ? _t : "square"
335
+ }, config_1.DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
336
+ pickable: !zoomLock && (null === (_u = startHandlerStyle.pickable) || void 0 === _u || _u)
337
+ }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
296
338
  x: position.x + end * width,
297
339
  y: position.y + height / 2,
298
340
  size: height,
299
- symbolType: null !== (_m = endHandlerStyle.symbolType) && void 0 !== _m ? _m : "square"
300
- }, config_1.DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), "symbol");
341
+ symbolType: null !== (_v = endHandlerStyle.symbolType) && void 0 !== _v ? _v : "square"
342
+ }, config_1.DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
343
+ pickable: !zoomLock && (null === (_w = endHandlerStyle.pickable) || void 0 === _w || _w)
344
+ }), "symbol");
301
345
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize), startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize), endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize), endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
302
- this._startHandlerMask = group.createOrUpdateChild("startHandlerMask", Object.assign({
346
+ this._startHandlerMask = group.createOrUpdateChild("startHandlerMask", Object.assign(Object.assign({
303
347
  x: position.x + start * width - startHandlerWidth / 2,
304
348
  y: position.y + height / 2 - startHandlerHeight / 2,
305
349
  width: startHandlerWidth,
@@ -307,7 +351,9 @@ class DataZoom extends base_1.AbstractComponent {
307
351
  fill: "white",
308
352
  fillOpacity: 0,
309
353
  zIndex: 999
310
- }, config_1.DEFAULT_HANDLER_ATTR_MAP.horizontal), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign({
354
+ }, config_1.DEFAULT_HANDLER_ATTR_MAP.horizontal), {
355
+ pickable: !zoomLock
356
+ }), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
311
357
  x: position.x + end * width - endHandlerWidth / 2,
312
358
  y: position.y + height / 2 - endHandlerHeight / 2,
313
359
  width: endHandlerWidth,
@@ -315,37 +361,46 @@ class DataZoom extends base_1.AbstractComponent {
315
361
  fill: "white",
316
362
  fillOpacity: 0,
317
363
  zIndex: 999
318
- }, config_1.DEFAULT_HANDLER_ATTR_MAP.horizontal), "rect");
364
+ }, config_1.DEFAULT_HANDLER_ATTR_MAP.horizontal), {
365
+ pickable: !zoomLock
366
+ }), "rect");
319
367
  } else {
320
368
  if (middleHandlerStyle.visible) {
321
- const middleHandlerBackgroundSize = (null === (_o = middleHandlerStyle.background) || void 0 === _o ? void 0 : _o.size) || 10;
322
- this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign({
369
+ const middleHandlerBackgroundSize = (null === (_x = middleHandlerStyle.background) || void 0 === _x ? void 0 : _x.size) || 10;
370
+ this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
323
371
  x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
324
372
  y: position.y + start * height,
325
373
  width: middleHandlerBackgroundSize,
326
374
  height: (end - start) * height
327
- }, null === (_p = middleHandlerStyle.background) || void 0 === _p ? void 0 : _p.style), "rect"),
328
- this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign({
375
+ }, null === (_y = middleHandlerStyle.background) || void 0 === _y ? void 0 : _y.style), {
376
+ pickable: !zoomLock && (null === (_1 = null === (_0 = null === (_z = middleHandlerStyle.background) || void 0 === _z ? void 0 : _z.style) || void 0 === _0 ? void 0 : _0.pickable) || void 0 === _1 || _1)
377
+ }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
329
378
  x: "left" === orient ? position.x - middleHandlerBackgroundSize / 2 : position.x + width + middleHandlerBackgroundSize / 2,
330
379
  y: position.y + (start + end) / 2 * height,
331
380
  angle: Math.PI / 180 * 90,
332
- symbolType: null !== (_r = null === (_q = middleHandlerStyle.icon) || void 0 === _q ? void 0 : _q.symbolType) && void 0 !== _r ? _r : "square",
381
+ symbolType: null !== (_3 = null === (_2 = middleHandlerStyle.icon) || void 0 === _2 ? void 0 : _2.symbolType) && void 0 !== _3 ? _3 : "square",
333
382
  strokeBoundsBuffer: 0
334
- }, middleHandlerStyle.icon), "symbol");
383
+ }, middleHandlerStyle.icon), {
384
+ pickable: !zoomLock && (null === (_5 = null === (_4 = middleHandlerStyle.icon) || void 0 === _4 ? void 0 : _4.pickable) || void 0 === _5 || _5)
385
+ }), "symbol");
335
386
  }
336
- this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign({
387
+ this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
337
388
  x: position.x + width / 2,
338
389
  y: position.y + start * height,
339
390
  size: width,
340
- symbolType: null !== (_s = startHandlerStyle.symbolType) && void 0 !== _s ? _s : "square"
341
- }, config_1.DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign({
391
+ symbolType: null !== (_6 = startHandlerStyle.symbolType) && void 0 !== _6 ? _6 : "square"
392
+ }, config_1.DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
393
+ pickable: !zoomLock && (null === (_7 = startHandlerStyle.pickable) || void 0 === _7 || _7)
394
+ }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
342
395
  x: position.x + width / 2,
343
396
  y: position.y + end * height,
344
397
  size: width,
345
- symbolType: null !== (_t = endHandlerStyle.symbolType) && void 0 !== _t ? _t : "square"
346
- }, config_1.DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), "symbol");
398
+ symbolType: null !== (_8 = endHandlerStyle.symbolType) && void 0 !== _8 ? _8 : "square"
399
+ }, config_1.DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
400
+ pickable: !zoomLock && (null === (_9 = endHandlerStyle.pickable) || void 0 === _9 || _9)
401
+ }), "symbol");
347
402
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize), startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize), endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize), endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
348
- this._startHandlerMask = group.createOrUpdateChild("startHandlerMask", Object.assign({
403
+ this._startHandlerMask = group.createOrUpdateChild("startHandlerMask", Object.assign(Object.assign({
349
404
  x: position.x + width / 2 + startHandlerWidth / 2,
350
405
  y: position.y + start * height - startHandlerHeight / 2,
351
406
  width: endHandlerHeight,
@@ -353,7 +408,9 @@ class DataZoom extends base_1.AbstractComponent {
353
408
  fill: "white",
354
409
  fillOpacity: 0,
355
410
  zIndex: 999
356
- }, config_1.DEFAULT_HANDLER_ATTR_MAP.vertical), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign({
411
+ }, config_1.DEFAULT_HANDLER_ATTR_MAP.vertical), {
412
+ pickable: !zoomLock
413
+ }), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
357
414
  x: position.x + width / 2 + endHandlerWidth / 2,
358
415
  y: position.y + end * height - endHandlerHeight / 2,
359
416
  width: endHandlerHeight,
@@ -361,8 +418,11 @@ class DataZoom extends base_1.AbstractComponent {
361
418
  fill: "white",
362
419
  fillOpacity: 0,
363
420
  zIndex: 999
364
- }, config_1.DEFAULT_HANDLER_ATTR_MAP.vertical), "rect");
421
+ }, config_1.DEFAULT_HANDLER_ATTR_MAP.vertical), {
422
+ pickable: !zoomLock
423
+ }), "rect");
365
424
  }
425
+ this._showText && this.renderText();
366
426
  }
367
427
  computeBasePoints() {
368
428
  const {orient: orient} = this.attribute, {position: position, width: width, height: height} = this.getLayoutAttrFromConfig();
@@ -391,22 +451,24 @@ class DataZoom extends base_1.AbstractComponent {
391
451
  };
392
452
  }
393
453
  getPreviewLinePoints() {
394
- const previewPoints = this._previewData.map((d => ({
454
+ let previewPoints = this._previewData.map((d => ({
395
455
  x: this._previewPointsX && this._previewPointsX(d),
396
456
  y: this._previewPointsY && this._previewPointsY(d)
397
457
  })));
398
458
  if (0 === previewPoints.length) return previewPoints;
459
+ this.attribute.tolerance && (previewPoints = (0, vrender_core_1.flatten_simplify)(previewPoints, this.attribute.tolerance, !1));
399
460
  const {basePointStart: basePointStart, basePointEnd: basePointEnd} = this.computeBasePoints();
400
461
  return basePointStart.concat(previewPoints).concat(basePointEnd);
401
462
  }
402
463
  getPreviewAreaPoints() {
403
- const previewPoints = this._previewData.map((d => ({
464
+ let previewPoints = this._previewData.map((d => ({
404
465
  x: this._previewPointsX && this._previewPointsX(d),
405
466
  y: this._previewPointsY && this._previewPointsY(d),
406
467
  x1: this._previewPointsX1 && this._previewPointsX1(d),
407
468
  y1: this._previewPointsY1 && this._previewPointsY1(d)
408
469
  })));
409
470
  if (0 === previewPoints.length) return previewPoints;
471
+ this.attribute.tolerance && (previewPoints = (0, vrender_core_1.flatten_simplify)(previewPoints, this.attribute.tolerance, !1));
410
472
  const {basePointStart: basePointStart, basePointEnd: basePointEnd} = this.computeBasePoints();
411
473
  return basePointStart.concat(previewPoints).concat(basePointEnd);
412
474
  }