@visactor/vrender-components 0.18.0-alpha.1 → 0.18.0-alpha.3
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.
- package/cjs/data-zoom/data-zoom.d.ts +1 -0
- package/cjs/data-zoom/data-zoom.js +61 -57
- package/cjs/data-zoom/data-zoom.js.map +1 -1
- package/cjs/data-zoom/type.d.ts +1 -0
- package/cjs/data-zoom/type.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/index.js +2 -1
- package/cjs/label/line.js +1 -1
- package/cjs/label/polygon.js +1 -1
- package/cjs/label/rect.js +1 -1
- package/cjs/label/register.js +1 -1
- package/cjs/label/symbol.js +1 -1
- package/cjs/label/type.js +1 -1
- package/cjs/legend/base.js +1 -1
- package/cjs/legend/color/color.d.ts +7 -0
- package/cjs/legend/color/color.js +16 -2
- package/cjs/legend/color/color.js.map +1 -1
- package/cjs/legend/constant.js +1 -1
- package/cjs/legend/discrete/discrete.d.ts +20 -3
- package/cjs/legend/discrete/discrete.js +166 -75
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/legend/discrete/type.d.ts +18 -7
- package/cjs/legend/discrete/type.js.map +1 -1
- package/cjs/legend/index.js +1 -1
- package/cjs/legend/register.js +3 -3
- package/cjs/legend/register.js.map +1 -1
- package/cjs/legend/size/size.d.ts +1 -0
- package/cjs/legend/size/size.js +4 -1
- package/cjs/legend/size/size.js.map +1 -1
- package/cjs/legend/type.js +1 -2
- package/cjs/legend/util.js +1 -1
- package/cjs/pager/pager.d.ts +2 -0
- package/cjs/pager/pager.js +13 -3
- package/cjs/pager/pager.js.map +1 -1
- package/cjs/pager/type.d.ts +1 -0
- package/cjs/pager/type.js.map +1 -1
- package/cjs/scrollbar/scrollbar.js +10 -2
- package/cjs/scrollbar/scrollbar.js.map +1 -1
- package/cjs/slider/slider.d.ts +27 -0
- package/cjs/slider/slider.js +101 -12
- package/cjs/slider/slider.js.map +1 -1
- package/cjs/slider/type.d.ts +9 -1
- package/cjs/slider/type.js.map +1 -1
- package/es/data-zoom/data-zoom.d.ts +1 -0
- package/es/data-zoom/data-zoom.js +61 -59
- package/es/data-zoom/data-zoom.js.map +1 -1
- package/es/data-zoom/type.d.ts +1 -0
- package/es/data-zoom/type.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/label/index.js +2 -1
- package/es/label/line.js +1 -1
- package/es/label/polygon.js +1 -1
- package/es/label/rect.js +1 -1
- package/es/label/register.js +1 -1
- package/es/label/symbol.js +1 -1
- package/es/label/type.js +1 -1
- package/es/legend/base.js +1 -1
- package/es/legend/color/color.d.ts +7 -0
- package/es/legend/color/color.js +17 -3
- package/es/legend/color/color.js.map +1 -1
- package/es/legend/constant.js +1 -1
- package/es/legend/discrete/discrete.d.ts +20 -3
- package/es/legend/discrete/discrete.js +166 -74
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/legend/discrete/type.d.ts +18 -7
- package/es/legend/discrete/type.js.map +1 -1
- package/es/legend/index.js +1 -1
- package/es/legend/register.js +4 -2
- package/es/legend/register.js.map +1 -1
- package/es/legend/size/size.d.ts +1 -0
- package/es/legend/size/size.js +4 -1
- package/es/legend/size/size.js.map +1 -1
- package/es/legend/type.js +1 -2
- package/es/legend/util.js +1 -1
- package/es/pager/pager.d.ts +2 -0
- package/es/pager/pager.js +14 -4
- package/es/pager/pager.js.map +1 -1
- package/es/pager/type.d.ts +1 -0
- package/es/pager/type.js.map +1 -1
- package/es/scrollbar/scrollbar.js +10 -2
- package/es/scrollbar/scrollbar.js.map +1 -1
- package/es/slider/slider.d.ts +27 -0
- package/es/slider/slider.js +101 -12
- package/es/slider/slider.js.map +1 -1
- package/es/slider/type.d.ts +9 -1
- package/es/slider/type.js.map +1 -1
- package/package.json +5 -5
|
@@ -8,7 +8,7 @@ var __rest = this && this.__rest || function(s, e) {
|
|
|
8
8
|
return t;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
import { vglobal } from "@visactor/vrender-core";
|
|
11
|
+
import { flatten_simplify, vglobal } from "@visactor/vrender-core";
|
|
12
12
|
|
|
13
13
|
import { Bounds, array, clamp, debounce, isFunction, isValid, merge, throttle } from "@visactor/vutils";
|
|
14
14
|
|
|
@@ -67,11 +67,10 @@ export class DataZoom extends AbstractComponent {
|
|
|
67
67
|
this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this.eventPosToStagePos(e),
|
|
68
68
|
this._activeCache.lastPos = this.eventPosToStagePos(e), "browser" === vglobal.env && (vglobal.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
69
69
|
capture: !0
|
|
70
|
-
}), vglobal.addEventListener("pointerup", this._onHandlerPointerUp.
|
|
71
|
-
this.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
70
|
+
}), vglobal.addEventListener("pointerup", this._onHandlerPointerUp)), this.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
72
71
|
capture: !0
|
|
73
72
|
});
|
|
74
|
-
}, this.
|
|
73
|
+
}, this._pointerMove = e => {
|
|
75
74
|
e.stopPropagation();
|
|
76
75
|
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;
|
|
77
76
|
let {start: start, end: end} = this.state;
|
|
@@ -79,13 +78,31 @@ export class DataZoom extends AbstractComponent {
|
|
|
79
78
|
end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start,
|
|
80
79
|
start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis),
|
|
81
80
|
this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1),
|
|
82
|
-
end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end ||
|
|
83
|
-
this._dispatchEvent("change", {
|
|
81
|
+
end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || this.setStateAttr(start, end, !0),
|
|
82
|
+
realTime && this._dispatchEvent("change", {
|
|
84
83
|
start: start,
|
|
85
84
|
end: end,
|
|
86
85
|
tag: this._activeTag
|
|
87
|
-
})
|
|
88
|
-
}
|
|
86
|
+
});
|
|
87
|
+
}, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap[this.attribute.delayType](this._pointerMove, this.attribute.delayTime),
|
|
88
|
+
this._onHandlerPointerUp = e => {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
const {start: start, end: end, brushSelect: brushSelect, realTime: realTime = !0} = this.attribute;
|
|
91
|
+
if (this._activeState && this._activeTag === DataZoomActiveTag.background) {
|
|
92
|
+
const pos = this.eventPosToStagePos(e);
|
|
93
|
+
this.backgroundDragZoom(this._activeCache.startPos, pos);
|
|
94
|
+
}
|
|
95
|
+
this._activeState = !1, brushSelect && this.renderDragMask(), start === this.state.start && end === this.state.end || this.setStateAttr(this.state.start, this.state.end, !0),
|
|
96
|
+
this._dispatchEvent("change", {
|
|
97
|
+
start: this.state.start,
|
|
98
|
+
end: this.state.end,
|
|
99
|
+
tag: this._activeTag
|
|
100
|
+
}), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
101
|
+
capture: !0
|
|
102
|
+
}), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
103
|
+
capture: !0
|
|
104
|
+
}), this.removeEventListener("pointerup", this._onHandlerPointerUp);
|
|
105
|
+
};
|
|
89
106
|
const {position: position, showDetail: showDetail} = attributes;
|
|
90
107
|
this._activeCache.startPos = position, this._activeCache.lastPos = position, this._showText = "auto" !== showDetail && showDetail,
|
|
91
108
|
this.setPropsFromAttrs();
|
|
@@ -129,25 +146,6 @@ export class DataZoom extends AbstractComponent {
|
|
|
129
146
|
y: y - ((null === (_b = this.stage) || void 0 === _b ? void 0 : _b.y) || 0)
|
|
130
147
|
};
|
|
131
148
|
}
|
|
132
|
-
_onHandlerPointerUp(e) {
|
|
133
|
-
e.preventDefault();
|
|
134
|
-
const {start: start, end: end, brushSelect: brushSelect, realTime: realTime = !0} = this.attribute;
|
|
135
|
-
if (this._activeState && this._activeTag === DataZoomActiveTag.background) {
|
|
136
|
-
const pos = this.eventPosToStagePos(e);
|
|
137
|
-
this.backgroundDragZoom(this._activeCache.startPos, pos);
|
|
138
|
-
}
|
|
139
|
-
this._activeState = !1, brushSelect && this.renderDragMask(), realTime && start === this.state.start && end === this.state.end || (this.setStateAttr(this.state.start, this.state.end, !0),
|
|
140
|
-
this._dispatchEvent("change", {
|
|
141
|
-
start: this.state.start,
|
|
142
|
-
end: this.state.end,
|
|
143
|
-
tag: this._activeTag
|
|
144
|
-
})), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
145
|
-
capture: !0
|
|
146
|
-
}), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp.bind(this))),
|
|
147
|
-
this.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
148
|
-
capture: !0
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
149
|
_onHandlerPointerEnter(e) {
|
|
152
150
|
e.stopPropagation(), this._showText = !0, this.renderText();
|
|
153
151
|
}
|
|
@@ -252,9 +250,9 @@ export class DataZoom extends AbstractComponent {
|
|
|
252
250
|
} else this._isHorizontal ? this._startText.setAttribute("dy", startTextDy) : this._startText.setAttribute("dx", startTextDx);
|
|
253
251
|
}
|
|
254
252
|
getLayoutAttrFromConfig() {
|
|
255
|
-
var _a, _b, _c, _d;
|
|
253
|
+
var _a, _b, _c, _d, _e, _f;
|
|
256
254
|
if (this._layoutAttrFromConfig) return this._layoutAttrFromConfig;
|
|
257
|
-
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;
|
|
255
|
+
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;
|
|
258
256
|
let width, height, position;
|
|
259
257
|
middleHandlerStyle.visible ? this._isHorizontal ? (width = widthConfig, height = heightConfig - middleHandlerSize,
|
|
260
258
|
position = {
|
|
@@ -271,15 +269,17 @@ export class DataZoom extends AbstractComponent {
|
|
|
271
269
|
y: position.y
|
|
272
270
|
}) : (height -= (startHandlerSize + endHandlerSize) / 2, position = {
|
|
273
271
|
x: position.x,
|
|
274
|
-
y: position.y + startHandlerSize
|
|
275
|
-
})),
|
|
272
|
+
y: position.y + startHandlerSize / 2
|
|
273
|
+
})), height += null !== (_e = backgroundStyle.lineWidth / 2) && void 0 !== _e ? _e : 1,
|
|
274
|
+
width += null !== (_f = backgroundStyle.lineWidth / 2) && void 0 !== _f ? _f : 1,
|
|
275
|
+
this._layoutAttrFromConfig = {
|
|
276
276
|
position: position,
|
|
277
277
|
width: width,
|
|
278
278
|
height: height
|
|
279
279
|
}, this._layoutAttrFromConfig;
|
|
280
280
|
}
|
|
281
281
|
render() {
|
|
282
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
282
|
+
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;
|
|
283
283
|
this._layoutAttrFromConfig = null;
|
|
284
284
|
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");
|
|
285
285
|
if (this._container = group, this._background = group.createOrUpdateChild("background", Object.assign(Object.assign({
|
|
@@ -289,9 +289,9 @@ export class DataZoom extends AbstractComponent {
|
|
|
289
289
|
height: height,
|
|
290
290
|
cursor: brushSelect ? "crosshair" : "auto"
|
|
291
291
|
}, backgroundStyle), {
|
|
292
|
-
pickable: !zoomLock
|
|
293
|
-
}), "rect"), (null === (
|
|
294
|
-
(null === (
|
|
292
|
+
pickable: !zoomLock && (null === (_c = backgroundStyle.pickable) || void 0 === _c || _c)
|
|
293
|
+
}), "rect"), (null === (_d = backgroundChartStyle.line) || void 0 === _d ? void 0 : _d.visible) && this.setPreviewAttributes("line", group),
|
|
294
|
+
(null === (_e = backgroundChartStyle.area) || void 0 === _e ? void 0 : _e.visible) && this.setPreviewAttributes("area", group),
|
|
295
295
|
brushSelect && this.renderDragMask(), this._isHorizontal ? this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
296
296
|
x: position.x + start * width,
|
|
297
297
|
y: position.y,
|
|
@@ -299,7 +299,7 @@ export class DataZoom extends AbstractComponent {
|
|
|
299
299
|
height: height,
|
|
300
300
|
cursor: brushSelect ? "crosshair" : "move"
|
|
301
301
|
}, selectedBackgroundStyle), {
|
|
302
|
-
pickable: !zoomLock
|
|
302
|
+
pickable: !zoomLock && (null === (_f = selectedBackgroundChartStyle.pickable) || void 0 === _f || _f)
|
|
303
303
|
}), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
304
304
|
x: position.x,
|
|
305
305
|
y: position.y + start * height,
|
|
@@ -307,43 +307,43 @@ export class DataZoom extends AbstractComponent {
|
|
|
307
307
|
height: (end - start) * height,
|
|
308
308
|
cursor: brushSelect ? "crosshair" : "move"
|
|
309
309
|
}, selectedBackgroundStyle), {
|
|
310
|
-
pickable: !zoomLock
|
|
311
|
-
}), "rect"), (null === (
|
|
312
|
-
(null === (
|
|
310
|
+
pickable: !zoomLock && (null === (_g = selectedBackgroundStyle.pickable) || void 0 === _g || _g)
|
|
311
|
+
}), "rect"), (null === (_h = selectedBackgroundChartStyle.line) || void 0 === _h ? void 0 : _h.visible) && this.setSelectedPreviewAttributes("line", group),
|
|
312
|
+
(null === (_j = selectedBackgroundChartStyle.area) || void 0 === _j ? void 0 : _j.visible) && this.setSelectedPreviewAttributes("area", group),
|
|
313
313
|
this._isHorizontal) {
|
|
314
314
|
if (middleHandlerStyle.visible) {
|
|
315
|
-
const middleHandlerBackgroundSize = (null === (
|
|
315
|
+
const middleHandlerBackgroundSize = (null === (_k = middleHandlerStyle.background) || void 0 === _k ? void 0 : _k.size) || 10;
|
|
316
316
|
this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
|
|
317
317
|
x: position.x + start * width,
|
|
318
318
|
y: position.y - middleHandlerBackgroundSize,
|
|
319
319
|
width: (end - start) * width,
|
|
320
320
|
height: middleHandlerBackgroundSize
|
|
321
|
-
}, null === (
|
|
322
|
-
pickable: !zoomLock
|
|
321
|
+
}, null === (_l = middleHandlerStyle.background) || void 0 === _l ? void 0 : _l.style), {
|
|
322
|
+
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)
|
|
323
323
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
324
324
|
x: position.x + (start + end) / 2 * width,
|
|
325
325
|
y: position.y - middleHandlerBackgroundSize / 2,
|
|
326
326
|
strokeBoundsBuffer: 0,
|
|
327
327
|
angle: 0,
|
|
328
|
-
symbolType: null !== (
|
|
328
|
+
symbolType: null !== (_r = null === (_q = middleHandlerStyle.icon) || void 0 === _q ? void 0 : _q.symbolType) && void 0 !== _r ? _r : "square"
|
|
329
329
|
}, middleHandlerStyle.icon), {
|
|
330
|
-
pickable: !zoomLock
|
|
330
|
+
pickable: !zoomLock && (null === (_s = middleHandlerStyle.icon.pickable) || void 0 === _s || _s)
|
|
331
331
|
}), "symbol");
|
|
332
332
|
}
|
|
333
333
|
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
334
334
|
x: position.x + start * width,
|
|
335
335
|
y: position.y + height / 2,
|
|
336
336
|
size: height,
|
|
337
|
-
symbolType: null !== (
|
|
337
|
+
symbolType: null !== (_t = startHandlerStyle.symbolType) && void 0 !== _t ? _t : "square"
|
|
338
338
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
|
|
339
|
-
pickable: !zoomLock
|
|
339
|
+
pickable: !zoomLock && (null === (_u = startHandlerStyle.pickable) || void 0 === _u || _u)
|
|
340
340
|
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
341
341
|
x: position.x + end * width,
|
|
342
342
|
y: position.y + height / 2,
|
|
343
343
|
size: height,
|
|
344
|
-
symbolType: null !== (
|
|
344
|
+
symbolType: null !== (_v = endHandlerStyle.symbolType) && void 0 !== _v ? _v : "square"
|
|
345
345
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
|
|
346
|
-
pickable: !zoomLock
|
|
346
|
+
pickable: !zoomLock && (null === (_w = endHandlerStyle.pickable) || void 0 === _w || _w)
|
|
347
347
|
}), "symbol");
|
|
348
348
|
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);
|
|
349
349
|
this._startHandlerMask = group.createOrUpdateChild("startHandlerMask", Object.assign(Object.assign({
|
|
@@ -369,38 +369,38 @@ export class DataZoom extends AbstractComponent {
|
|
|
369
369
|
}), "rect");
|
|
370
370
|
} else {
|
|
371
371
|
if (middleHandlerStyle.visible) {
|
|
372
|
-
const middleHandlerBackgroundSize = (null === (
|
|
372
|
+
const middleHandlerBackgroundSize = (null === (_x = middleHandlerStyle.background) || void 0 === _x ? void 0 : _x.size) || 10;
|
|
373
373
|
this._middleHandlerRect = group.createOrUpdateChild("middleHandlerRect", Object.assign(Object.assign({
|
|
374
374
|
x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
|
|
375
375
|
y: position.y + start * height,
|
|
376
376
|
width: middleHandlerBackgroundSize,
|
|
377
377
|
height: (end - start) * height
|
|
378
|
-
}, null === (
|
|
379
|
-
pickable: !zoomLock
|
|
378
|
+
}, null === (_y = middleHandlerStyle.background) || void 0 === _y ? void 0 : _y.style), {
|
|
379
|
+
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)
|
|
380
380
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
381
381
|
x: "left" === orient ? position.x - middleHandlerBackgroundSize / 2 : position.x + width + middleHandlerBackgroundSize / 2,
|
|
382
382
|
y: position.y + (start + end) / 2 * height,
|
|
383
383
|
angle: Math.PI / 180 * 90,
|
|
384
|
-
symbolType: null !== (
|
|
384
|
+
symbolType: null !== (_3 = null === (_2 = middleHandlerStyle.icon) || void 0 === _2 ? void 0 : _2.symbolType) && void 0 !== _3 ? _3 : "square",
|
|
385
385
|
strokeBoundsBuffer: 0
|
|
386
386
|
}, middleHandlerStyle.icon), {
|
|
387
|
-
pickable: !zoomLock
|
|
387
|
+
pickable: !zoomLock && (null === (_5 = null === (_4 = middleHandlerStyle.icon) || void 0 === _4 ? void 0 : _4.pickable) || void 0 === _5 || _5)
|
|
388
388
|
}), "symbol");
|
|
389
389
|
}
|
|
390
390
|
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
391
391
|
x: position.x + width / 2,
|
|
392
392
|
y: position.y + start * height,
|
|
393
393
|
size: width,
|
|
394
|
-
symbolType: null !== (
|
|
394
|
+
symbolType: null !== (_6 = startHandlerStyle.symbolType) && void 0 !== _6 ? _6 : "square"
|
|
395
395
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
|
|
396
|
-
pickable: !zoomLock
|
|
396
|
+
pickable: !zoomLock && (null === (_7 = startHandlerStyle.pickable) || void 0 === _7 || _7)
|
|
397
397
|
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
398
398
|
x: position.x + width / 2,
|
|
399
399
|
y: position.y + end * height,
|
|
400
400
|
size: width,
|
|
401
|
-
symbolType: null !== (
|
|
401
|
+
symbolType: null !== (_8 = endHandlerStyle.symbolType) && void 0 !== _8 ? _8 : "square"
|
|
402
402
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
|
|
403
|
-
pickable: !zoomLock
|
|
403
|
+
pickable: !zoomLock && (null === (_9 = endHandlerStyle.pickable) || void 0 === _9 || _9)
|
|
404
404
|
}), "symbol");
|
|
405
405
|
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);
|
|
406
406
|
this._startHandlerMask = group.createOrUpdateChild("startHandlerMask", Object.assign(Object.assign({
|
|
@@ -454,22 +454,24 @@ export class DataZoom extends AbstractComponent {
|
|
|
454
454
|
};
|
|
455
455
|
}
|
|
456
456
|
getPreviewLinePoints() {
|
|
457
|
-
|
|
457
|
+
let previewPoints = this._previewData.map((d => ({
|
|
458
458
|
x: this._previewPointsX && this._previewPointsX(d),
|
|
459
459
|
y: this._previewPointsY && this._previewPointsY(d)
|
|
460
460
|
})));
|
|
461
461
|
if (0 === previewPoints.length) return previewPoints;
|
|
462
|
+
this.attribute.tolerance && (previewPoints = flatten_simplify(previewPoints, this.attribute.tolerance, !1));
|
|
462
463
|
const {basePointStart: basePointStart, basePointEnd: basePointEnd} = this.computeBasePoints();
|
|
463
464
|
return basePointStart.concat(previewPoints).concat(basePointEnd);
|
|
464
465
|
}
|
|
465
466
|
getPreviewAreaPoints() {
|
|
466
|
-
|
|
467
|
+
let previewPoints = this._previewData.map((d => ({
|
|
467
468
|
x: this._previewPointsX && this._previewPointsX(d),
|
|
468
469
|
y: this._previewPointsY && this._previewPointsY(d),
|
|
469
470
|
x1: this._previewPointsX1 && this._previewPointsX1(d),
|
|
470
471
|
y1: this._previewPointsY1 && this._previewPointsY1(d)
|
|
471
472
|
})));
|
|
472
473
|
if (0 === previewPoints.length) return previewPoints;
|
|
474
|
+
this.attribute.tolerance && (previewPoints = flatten_simplify(previewPoints, this.attribute.tolerance, !1));
|
|
473
475
|
const {basePointStart: basePointStart, basePointEnd: basePointEnd} = this.computeBasePoints();
|
|
474
476
|
return basePointStart.concat(previewPoints).concat(basePointEnd);
|
|
475
477
|
}
|