@visactor/vrender-components 1.0.43-alpha.0 → 1.0.43-alpha.1
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/config.d.ts +0 -10
- package/cjs/data-zoom/config.js +1 -10
- package/cjs/data-zoom/config.js.map +1 -1
- package/cjs/data-zoom/renderer.js +22 -40
- package/cjs/data-zoom/renderer.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/slider/slider.d.ts +3 -0
- package/cjs/slider/slider.js +26 -18
- package/cjs/slider/slider.js.map +1 -1
- package/cjs/slider/type.d.ts +14 -3
- package/cjs/slider/type.js.map +1 -1
- package/dist/index.es.js +57 -49
- package/es/data-zoom/config.d.ts +0 -10
- package/es/data-zoom/config.js +0 -11
- package/es/data-zoom/config.js.map +1 -1
- package/es/data-zoom/renderer.js +23 -41
- package/es/data-zoom/renderer.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/slider/slider.d.ts +3 -0
- package/es/slider/slider.js +27 -19
- package/es/slider/slider.js.map +1 -1
- package/es/slider/type.d.ts +14 -3
- package/es/slider/type.js.map +1 -1
- package/package.json +5 -5
package/dist/index.es.js
CHANGED
|
@@ -19385,6 +19385,11 @@ class RAFTickHandler {
|
|
|
19385
19385
|
}
|
|
19386
19386
|
}
|
|
19387
19387
|
class DefaultTicker extends EventEmitter {
|
|
19388
|
+
pushFrameTime(time) {
|
|
19389
|
+
this.frameTimeHistory.push(time);
|
|
19390
|
+
const overflow = this.frameTimeHistory.length - 600;
|
|
19391
|
+
overflow > 0 && this.frameTimeHistory.splice(0, overflow);
|
|
19392
|
+
}
|
|
19388
19393
|
constructor(stage) {
|
|
19389
19394
|
super(), this.timelines = [], this.frameTimeHistory = [], this.handleTick = (handler, params) => {
|
|
19390
19395
|
const {
|
|
@@ -19392,10 +19397,10 @@ class DefaultTicker extends EventEmitter {
|
|
|
19392
19397
|
} = null != params ? params : {};
|
|
19393
19398
|
if (this.ifCanStop()) return this.stop(), !1;
|
|
19394
19399
|
const currentTime = handler.getTime();
|
|
19395
|
-
this._lastTickTime = currentTime, this.lastFrameTime < 0 && (this.lastFrameTime = currentTime - this.interval + this.timeOffset, this.
|
|
19400
|
+
this._lastTickTime = currentTime, this.lastFrameTime < 0 && (this.lastFrameTime = currentTime - this.interval + this.timeOffset, this.pushFrameTime(this.lastFrameTime));
|
|
19396
19401
|
const delta = currentTime - this.lastFrameTime,
|
|
19397
19402
|
skip = this.checkSkip(delta);
|
|
19398
|
-
return skip || (this._handlerTick(delta), this.lastFrameTime = currentTime, this.
|
|
19403
|
+
return skip || (this._handlerTick(delta), this.lastFrameTime = currentTime, this.pushFrameTime(this.lastFrameTime)), once || handler.tick(this.interval, this.handleTick), !skip;
|
|
19399
19404
|
}, this._handlerTick = delta => {
|
|
19400
19405
|
this.status === STATUS$1.RUNNING && (this.tickCounts++, this.timelines.forEach(timeline => {
|
|
19401
19406
|
timeline.tick(delta);
|
|
@@ -19487,7 +19492,7 @@ class DefaultTicker extends EventEmitter {
|
|
|
19487
19492
|
}
|
|
19488
19493
|
release() {
|
|
19489
19494
|
var _a;
|
|
19490
|
-
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1, application.global.hooks.onSetEnv.unTap("graph-ticker", this._handleGraphTick);
|
|
19495
|
+
this.stop(), this.timelines = [], this.frameTimeHistory.length = 0, null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1, application.global.hooks.onSetEnv.unTap("graph-ticker", this._handleGraphTick);
|
|
19491
19496
|
}
|
|
19492
19497
|
checkSkip(delta) {
|
|
19493
19498
|
var _a, _b, _c;
|
|
@@ -25263,16 +25268,6 @@ const DEFAULT_HANDLER_ATTR_MAP = {
|
|
|
25263
25268
|
strokeBoundsBuffer: 0
|
|
25264
25269
|
}
|
|
25265
25270
|
};
|
|
25266
|
-
const LAYOUT_LEVEL = {
|
|
25267
|
-
background: 0,
|
|
25268
|
-
preview: 1,
|
|
25269
|
-
dragMask: 2,
|
|
25270
|
-
selectedBackground: 3,
|
|
25271
|
-
selectedPreview: 4,
|
|
25272
|
-
handler: 5,
|
|
25273
|
-
handlerText: 5,
|
|
25274
|
-
handlerMask: 999
|
|
25275
|
-
};
|
|
25276
25271
|
|
|
25277
25272
|
const isTextOverflow = (componentBoundsLike, textBounds, layout, isHorizontal) => {
|
|
25278
25273
|
if (!textBounds) {
|
|
@@ -25412,10 +25407,10 @@ class DataZoomRenderer {
|
|
|
25412
25407
|
const { position, width, height } = this._getLayoutAttrFromConfig();
|
|
25413
25408
|
const { start, end } = this._getState();
|
|
25414
25409
|
if (this._isHorizontal) {
|
|
25415
|
-
this._dragMask = this._getContainer().createOrUpdateChild('dragMask', Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height
|
|
25410
|
+
this._dragMask = this._getContainer().createOrUpdateChild('dragMask', Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height }, dragMaskStyle), 'rect');
|
|
25416
25411
|
}
|
|
25417
25412
|
else {
|
|
25418
|
-
this._dragMask = this._getContainer().createOrUpdateChild('dragMask', Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height
|
|
25413
|
+
this._dragMask = this._getContainer().createOrUpdateChild('dragMask', Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height }, dragMaskStyle), 'rect');
|
|
25419
25414
|
}
|
|
25420
25415
|
return { start, end };
|
|
25421
25416
|
}
|
|
@@ -25425,7 +25420,7 @@ class DataZoomRenderer {
|
|
|
25425
25420
|
const { position, width, height } = this._getLayoutAttrFromConfig();
|
|
25426
25421
|
const group = this._getContainer();
|
|
25427
25422
|
this._background = group.createOrUpdateChild('background', Object.assign(Object.assign({ x: position.x, y: position.y, width,
|
|
25428
|
-
height, cursor: brushSelect ? 'crosshair' : 'auto'
|
|
25423
|
+
height, cursor: brushSelect ? 'crosshair' : 'auto' }, backgroundStyle), { pickable: zoomLock ? false : (_a = backgroundStyle.pickable) !== null && _a !== void 0 ? _a : true }), 'rect');
|
|
25429
25424
|
}
|
|
25430
25425
|
_renderHandler() {
|
|
25431
25426
|
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;
|
|
@@ -25438,34 +25433,34 @@ class DataZoomRenderer {
|
|
|
25438
25433
|
if (this._isHorizontal) {
|
|
25439
25434
|
if (middleHandlerStyle.visible) {
|
|
25440
25435
|
const middleHandlerBackgroundSize = ((_c = middleHandlerStyle.background) === null || _c === void 0 ? void 0 : _c.size) || 10;
|
|
25441
|
-
this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign(Object.assign({ x: position.x + start * width, y: position.y - middleHandlerBackgroundSize, width: (end - start) * width, height: middleHandlerBackgroundSize
|
|
25442
|
-
this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign(Object.assign({ x: position.x + ((start + end) / 2) * width, y: position.y - middleHandlerBackgroundSize / 2, strokeBoundsBuffer: 0, angle: 0, symbolType: (_j = (_h = middleHandlerStyle.icon) === null || _h === void 0 ? void 0 : _h.symbolType) !== null && _j !== void 0 ? _j : 'square'
|
|
25436
|
+
this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign(Object.assign({ x: position.x + start * width, y: position.y - middleHandlerBackgroundSize, width: (end - start) * width, height: middleHandlerBackgroundSize }, (_d = middleHandlerStyle.background) === null || _d === void 0 ? void 0 : _d.style), { pickable: zoomLock ? false : (_g = (_f = (_e = middleHandlerStyle.background) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.pickable) !== null && _g !== void 0 ? _g : true }), 'rect');
|
|
25437
|
+
this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign(Object.assign({ x: position.x + ((start + end) / 2) * width, y: position.y - middleHandlerBackgroundSize / 2, strokeBoundsBuffer: 0, angle: 0, symbolType: (_j = (_h = middleHandlerStyle.icon) === null || _h === void 0 ? void 0 : _h.symbolType) !== null && _j !== void 0 ? _j : 'square' }, middleHandlerStyle.icon), { pickable: zoomLock ? false : (_k = middleHandlerStyle.icon.pickable) !== null && _k !== void 0 ? _k : true }), 'symbol');
|
|
25443
25438
|
}
|
|
25444
|
-
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign(Object.assign(
|
|
25445
|
-
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign(Object.assign(
|
|
25439
|
+
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign(Object.assign({ x: position.x + start * width, y: position.y + height / 2, size: height, symbolType: (_l = startHandlerStyle.symbolType) !== null && _l !== void 0 ? _l : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), { pickable: zoomLock ? false : (_m = startHandlerStyle.pickable) !== null && _m !== void 0 ? _m : true }), 'symbol');
|
|
25440
|
+
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign(Object.assign({ x: position.x + end * width, y: position.y + height / 2, size: height, symbolType: (_o = endHandlerStyle.symbolType) !== null && _o !== void 0 ? _o : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), { pickable: zoomLock ? false : (_p = endHandlerStyle.pickable) !== null && _p !== void 0 ? _p : true }), 'symbol');
|
|
25446
25441
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
|
|
25447
25442
|
const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
|
|
25448
25443
|
const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
|
|
25449
25444
|
const endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
|
|
25450
|
-
this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign(Object.assign({ x: position.x + start * width - startHandlerWidth / 2, y: position.y + height / 2 - startHandlerHeight / 2, width: startHandlerWidth, height: startHandlerHeight, fill: 'white', fillOpacity: 0, zIndex:
|
|
25451
|
-
this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign(Object.assign({ x: position.x + end * width - endHandlerWidth / 2, y: position.y + height / 2 - endHandlerHeight / 2, width: endHandlerWidth, height: endHandlerHeight, fill: 'white', fillOpacity: 0, zIndex:
|
|
25445
|
+
this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign(Object.assign({ x: position.x + start * width - startHandlerWidth / 2, y: position.y + height / 2 - startHandlerHeight / 2, width: startHandlerWidth, height: startHandlerHeight, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.horizontal), { pickable: !zoomLock }), 'rect');
|
|
25446
|
+
this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign(Object.assign({ x: position.x + end * width - endHandlerWidth / 2, y: position.y + height / 2 - endHandlerHeight / 2, width: endHandlerWidth, height: endHandlerHeight, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.horizontal), { pickable: !zoomLock }), 'rect');
|
|
25452
25447
|
}
|
|
25453
25448
|
else {
|
|
25454
25449
|
if (middleHandlerStyle.visible) {
|
|
25455
25450
|
const middleHandlerBackgroundSize = ((_q = middleHandlerStyle.background) === null || _q === void 0 ? void 0 : _q.size) || 10;
|
|
25456
|
-
this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign(Object.assign({ x: orient === 'left' ? position.x - middleHandlerBackgroundSize : position.x + width, y: position.y + start * height, width: middleHandlerBackgroundSize, height: (end - start) * height
|
|
25451
|
+
this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign(Object.assign({ x: orient === 'left' ? position.x - middleHandlerBackgroundSize : position.x + width, y: position.y + start * height, width: middleHandlerBackgroundSize, height: (end - start) * height }, (_r = middleHandlerStyle.background) === null || _r === void 0 ? void 0 : _r.style), { pickable: zoomLock ? false : (_u = (_t = (_s = middleHandlerStyle.background) === null || _s === void 0 ? void 0 : _s.style) === null || _t === void 0 ? void 0 : _t.pickable) !== null && _u !== void 0 ? _u : true }), 'rect');
|
|
25457
25452
|
this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign(Object.assign({ x: orient === 'left'
|
|
25458
25453
|
? position.x - middleHandlerBackgroundSize / 2
|
|
25459
|
-
: position.x + width + middleHandlerBackgroundSize / 2, y: position.y + ((start + end) / 2) * height, angle: 90 * (Math.PI / 180), symbolType: (_w = (_v = middleHandlerStyle.icon) === null || _v === void 0 ? void 0 : _v.symbolType) !== null && _w !== void 0 ? _w : 'square', strokeBoundsBuffer: 0
|
|
25454
|
+
: position.x + width + middleHandlerBackgroundSize / 2, y: position.y + ((start + end) / 2) * height, angle: 90 * (Math.PI / 180), symbolType: (_w = (_v = middleHandlerStyle.icon) === null || _v === void 0 ? void 0 : _v.symbolType) !== null && _w !== void 0 ? _w : 'square', strokeBoundsBuffer: 0 }, middleHandlerStyle.icon), { pickable: zoomLock ? false : (_y = (_x = middleHandlerStyle.icon) === null || _x === void 0 ? void 0 : _x.pickable) !== null && _y !== void 0 ? _y : true }), 'symbol');
|
|
25460
25455
|
}
|
|
25461
|
-
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign(Object.assign(
|
|
25462
|
-
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, symbolType: (_1 = endHandlerStyle.symbolType) !== null && _1 !== void 0 ? _1 : 'square'
|
|
25456
|
+
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + start * height, size: width, symbolType: (_z = startHandlerStyle.symbolType) !== null && _z !== void 0 ? _z : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), { pickable: zoomLock ? false : (_0 = startHandlerStyle.pickable) !== null && _0 !== void 0 ? _0 : true }), 'symbol');
|
|
25457
|
+
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, symbolType: (_1 = endHandlerStyle.symbolType) !== null && _1 !== void 0 ? _1 : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), { pickable: zoomLock ? false : (_2 = endHandlerStyle.pickable) !== null && _2 !== void 0 ? _2 : true }), 'symbol');
|
|
25463
25458
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
|
|
25464
25459
|
const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
|
|
25465
25460
|
const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
|
|
25466
25461
|
const endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
|
|
25467
|
-
this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign(Object.assign({ x: position.x + width / 2 + startHandlerWidth / 2, y: position.y + start * height - startHandlerHeight / 2, width: endHandlerHeight, height: endHandlerWidth, fill: 'white', fillOpacity: 0, zIndex:
|
|
25468
|
-
this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign(Object.assign({ x: position.x + width / 2 + endHandlerWidth / 2, y: position.y + end * height - endHandlerHeight / 2, width: endHandlerHeight, height: endHandlerWidth, fill: 'white', fillOpacity: 0, zIndex:
|
|
25462
|
+
this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign(Object.assign({ x: position.x + width / 2 + startHandlerWidth / 2, y: position.y + start * height - startHandlerHeight / 2, width: endHandlerHeight, height: endHandlerWidth, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.vertical), { pickable: !zoomLock }), 'rect');
|
|
25463
|
+
this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign(Object.assign({ x: position.x + width / 2 + endHandlerWidth / 2, y: position.y + end * height - endHandlerHeight / 2, width: endHandlerHeight, height: endHandlerWidth, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.vertical), { pickable: !zoomLock }), 'rect');
|
|
25469
25464
|
}
|
|
25470
25465
|
}
|
|
25471
25466
|
_renderSelectedBackground() {
|
|
@@ -25475,15 +25470,15 @@ class DataZoomRenderer {
|
|
|
25475
25470
|
const { position, width, height } = this._getLayoutAttrFromConfig();
|
|
25476
25471
|
const group = this._getContainer();
|
|
25477
25472
|
if (this._isHorizontal) {
|
|
25478
|
-
this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign(Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height, cursor: brushSelect ? 'crosshair' : 'move'
|
|
25473
|
+
this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign(Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), { pickable: zoomLock ? false : (_a = selectedBackgroundChartStyle.pickable) !== null && _a !== void 0 ? _a : true }), 'rect');
|
|
25479
25474
|
}
|
|
25480
25475
|
else {
|
|
25481
|
-
this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign(Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height, cursor: brushSelect ? 'crosshair' : 'move'
|
|
25476
|
+
this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign(Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), { pickable: zoomLock ? false : (_b = selectedBackgroundStyle.pickable) !== null && _b !== void 0 ? _b : true }), 'rect');
|
|
25482
25477
|
}
|
|
25483
25478
|
}
|
|
25484
25479
|
_setPreviewAttributes(type, group) {
|
|
25485
25480
|
if (!this._previewGroup) {
|
|
25486
|
-
this._previewGroup = group.createOrUpdateChild('previewGroup', { pickable: false
|
|
25481
|
+
this._previewGroup = group.createOrUpdateChild('previewGroup', { pickable: false }, 'group');
|
|
25487
25482
|
}
|
|
25488
25483
|
if (type === 'line') {
|
|
25489
25484
|
this._previewLine = this._previewGroup.createOrUpdateChild('previewLine', {}, 'line');
|
|
@@ -25499,7 +25494,7 @@ class DataZoomRenderer {
|
|
|
25499
25494
|
}
|
|
25500
25495
|
_setSelectedPreviewClipAttributes(type, group) {
|
|
25501
25496
|
if (!this._selectedPreviewGroupClip) {
|
|
25502
|
-
this._selectedPreviewGroupClip = group.createOrUpdateChild('selectedPreviewGroupClip', { pickable: false
|
|
25497
|
+
this._selectedPreviewGroupClip = group.createOrUpdateChild('selectedPreviewGroupClip', { pickable: false }, 'group');
|
|
25503
25498
|
this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild('selectedPreviewGroup', {}, 'group');
|
|
25504
25499
|
}
|
|
25505
25500
|
const { start, end } = this._getState();
|
|
@@ -30111,14 +30106,36 @@ class Slider extends AbstractComponent {
|
|
|
30111
30106
|
return handler;
|
|
30112
30107
|
}
|
|
30113
30108
|
_renderHandlerText(value, position) {
|
|
30114
|
-
|
|
30109
|
+
const textShape = graphicCreator.text(this._getHandlerTextAttributes(value, position));
|
|
30110
|
+
return textShape;
|
|
30111
|
+
}
|
|
30112
|
+
_getHandlerPosition(isStart) {
|
|
30113
|
+
return this.attribute.range ? (isStart ? 'start' : 'end') : 'end';
|
|
30114
|
+
}
|
|
30115
|
+
_getHandlerTextStyle(value, position) {
|
|
30116
|
+
const { align, handlerSize = 14, handlerText = {}, railHeight, railWidth, slidable } = this.attribute;
|
|
30117
|
+
if (isFunction(handlerText.style)) {
|
|
30118
|
+
return handlerText.style(value, position, {
|
|
30119
|
+
layout: this.attribute.layout,
|
|
30120
|
+
align,
|
|
30121
|
+
railWidth,
|
|
30122
|
+
railHeight,
|
|
30123
|
+
handlerSize,
|
|
30124
|
+
slidable
|
|
30125
|
+
});
|
|
30126
|
+
}
|
|
30127
|
+
return handlerText.style;
|
|
30128
|
+
}
|
|
30129
|
+
_getHandlerTextAttributes(value, position) {
|
|
30130
|
+
var _a, _b;
|
|
30115
30131
|
const { align, handlerSize = 14, handlerText = {}, railHeight, railWidth, slidable } = this.attribute;
|
|
30116
30132
|
const isHorizontal = this._isHorizontal;
|
|
30117
30133
|
const pos = this.calculatePosByValue(value, position);
|
|
30118
30134
|
const textSpace = (_a = handlerText.space) !== null && _a !== void 0 ? _a : 4;
|
|
30135
|
+
const handlerTextStyle = this._getHandlerTextStyle(value, position);
|
|
30119
30136
|
const textStyle = {
|
|
30120
30137
|
text: handlerText.formatter ? handlerText.formatter(value) : value.toFixed((_b = handlerText.precision) !== null && _b !== void 0 ? _b : 0),
|
|
30121
|
-
lineHeight:
|
|
30138
|
+
lineHeight: handlerTextStyle === null || handlerTextStyle === void 0 ? void 0 : handlerTextStyle.lineHeight,
|
|
30122
30139
|
cursor: slidable === false ? 'default' : getDefaultCursor(isHorizontal)
|
|
30123
30140
|
};
|
|
30124
30141
|
if (isHorizontal) {
|
|
@@ -30149,8 +30166,7 @@ class Slider extends AbstractComponent {
|
|
|
30149
30166
|
textStyle.y = pos;
|
|
30150
30167
|
}
|
|
30151
30168
|
}
|
|
30152
|
-
|
|
30153
|
-
return textShape;
|
|
30169
|
+
return Object.assign(Object.assign({}, textStyle), handlerTextStyle);
|
|
30154
30170
|
}
|
|
30155
30171
|
_renderTooltip() {
|
|
30156
30172
|
var _a;
|
|
@@ -30321,16 +30337,12 @@ class Slider extends AbstractComponent {
|
|
|
30321
30337
|
}
|
|
30322
30338
|
}
|
|
30323
30339
|
_updateHandler(handler, position, value) {
|
|
30324
|
-
var _a;
|
|
30325
30340
|
const isHorizontal = this._isHorizontal;
|
|
30326
30341
|
handler.setAttribute(isHorizontal ? 'x' : 'y', position);
|
|
30327
30342
|
const updateHandlerText = handler.name === SLIDER_ELEMENT_NAME.startHandler ? this._startHandlerText : this._endHandlerText;
|
|
30328
30343
|
if (updateHandlerText) {
|
|
30329
|
-
const
|
|
30330
|
-
updateHandlerText.setAttributes(
|
|
30331
|
-
text: handlerText.formatter ? handlerText.formatter(value) : value.toFixed((_a = handlerText.precision) !== null && _a !== void 0 ? _a : 0),
|
|
30332
|
-
[isHorizontal ? 'x' : 'y']: position
|
|
30333
|
-
});
|
|
30344
|
+
const handlerPosition = this._getHandlerPosition(handler.name === SLIDER_ELEMENT_NAME.startHandler);
|
|
30345
|
+
updateHandlerText.setAttributes(this._getHandlerTextAttributes(value, handlerPosition));
|
|
30334
30346
|
}
|
|
30335
30347
|
if (handler.name === SLIDER_ELEMENT_NAME.startHandler) {
|
|
30336
30348
|
this._currentValue.startValue = value;
|
|
@@ -30342,13 +30354,9 @@ class Slider extends AbstractComponent {
|
|
|
30342
30354
|
}
|
|
30343
30355
|
}
|
|
30344
30356
|
_updateHandlerText(handlerText, position, value) {
|
|
30345
|
-
var _a;
|
|
30346
30357
|
const isHorizontal = this._isHorizontal;
|
|
30347
|
-
const
|
|
30348
|
-
handlerText.setAttributes(
|
|
30349
|
-
[isHorizontal ? 'x' : 'y']: position,
|
|
30350
|
-
text: handlerTextAttr.formatter ? handlerTextAttr.formatter(value) : value.toFixed((_a = handlerTextAttr.precision) !== null && _a !== void 0 ? _a : 0)
|
|
30351
|
-
});
|
|
30358
|
+
const handlerPosition = this._getHandlerPosition(handlerText.name === SLIDER_ELEMENT_NAME.startHandlerText);
|
|
30359
|
+
handlerText.setAttributes(this._getHandlerTextAttributes(value, handlerPosition));
|
|
30352
30360
|
const updateHandler = handlerText.name === SLIDER_ELEMENT_NAME.startHandlerText ? this._startHandler : this._endHandler;
|
|
30353
30361
|
if (updateHandler) {
|
|
30354
30362
|
updateHandler.setAttributes({
|
|
@@ -34996,6 +35004,6 @@ TableSeriesNumber.defaultAttributes = {
|
|
|
34996
35004
|
select: true
|
|
34997
35005
|
};
|
|
34998
35006
|
|
|
34999
|
-
const version = "1.0.43-alpha.
|
|
35007
|
+
const version = "1.0.43-alpha.1";
|
|
35000
35008
|
|
|
35001
35009
|
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IDataZoomEvent, IDataZoomInteractiveEvent, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SeriesNumberCellStateValue, SeriesNumberEvent, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, TableSeriesNumber, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
|
package/es/data-zoom/config.d.ts
CHANGED
|
@@ -114,13 +114,3 @@ export declare const DEFAULT_HANDLER_ATTR_MAP: {
|
|
|
114
114
|
strokeBoundsBuffer: number;
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
|
-
export declare const LAYOUT_LEVEL: {
|
|
118
|
-
background: number;
|
|
119
|
-
preview: number;
|
|
120
|
-
dragMask: number;
|
|
121
|
-
selectedBackground: number;
|
|
122
|
-
selectedPreview: number;
|
|
123
|
-
handler: number;
|
|
124
|
-
handlerText: number;
|
|
125
|
-
handlerMask: number;
|
|
126
|
-
};
|
package/es/data-zoom/config.js
CHANGED
|
@@ -116,15 +116,4 @@ export const DEFAULT_HANDLER_ATTR_MAP = {
|
|
|
116
116
|
strokeBoundsBuffer: 0
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
|
|
120
|
-
export const LAYOUT_LEVEL = {
|
|
121
|
-
background: 0,
|
|
122
|
-
preview: 1,
|
|
123
|
-
dragMask: 2,
|
|
124
|
-
selectedBackground: 3,
|
|
125
|
-
selectedPreview: 4,
|
|
126
|
-
handler: 5,
|
|
127
|
-
handlerText: 5,
|
|
128
|
-
handlerMask: 999
|
|
129
|
-
};
|
|
130
119
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/data-zoom/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAE/B,yiBAAyiB,CAAC;AAC5iB,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,IAAI;IACd,eAAe,EAAE;QACf,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;KAChB;IACD,aAAa,EAAE;QACb,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,GAAG;KACjB;IACD,oBAAoB,EAAE;QACpB,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC;YACZ,IAAI,EAAE,SAAS;SAChB;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC;SACb;KACF;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,GAAG;KACjB;IACD,4BAA4B,EAAE;QAC5B,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC;YACZ,IAAI,EAAE,SAAS;SAChB;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC;SACb;KACF;IACD,kBAAkB,EAAE;QAClB,OAAO,EAAE,IAAI;QACb,UAAU,E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next-line max-len\n 'M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z';\nexport const DEFAULT_DATA_ZOOM_ATTRIBUTES = {\n orient: 'bottom',\n showDetail: 'auto',\n brushSelect: true,\n zoomLock: false,\n minSpan: 0,\n maxSpan: 1,\n delayType: 'throttle',\n delayTime: 0,\n realTime: true,\n backgroundStyle: {\n fill: 'white',\n stroke: '#D1DBEE',\n lineWidth: 1,\n cornerRadius: 2\n },\n dragMaskStyle: {\n fill: '#B0C8F9',\n fillOpacity: 0.2\n },\n backgroundChartStyle: {\n area: {\n visible: true,\n stroke: '#D1DBEE',\n lineWidth: 1,\n fill: '#F6F8FC'\n },\n line: {\n visible: true,\n stroke: '#D1DBEE',\n lineWidth: 1\n }\n },\n selectedBackgroundStyle: {\n fill: '#B0C8F9',\n fillOpacity: 0.5\n },\n selectedBackgroundChartStyle: {\n area: {\n visible: true,\n stroke: '#B0C8F9',\n lineWidth: 1,\n fill: '#fbb934'\n },\n line: {\n visible: true,\n stroke: '#fbb934',\n lineWidth: 1\n }\n },\n middleHandlerStyle: {\n visible: true,\n background: {\n size: 8,\n style: {\n fill: 'white',\n stroke: '#B0C8F9',\n cornerRadius: 2\n }\n },\n icon: {\n size: 6,\n fill: 'white',\n stroke: '#B0C8F9',\n symbolType:\n // eslint-disable-next-line max-len\n 'M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z',\n lineWidth: 0.5\n }\n },\n startHandlerStyle: {\n visible: true,\n triggerMinSize: 0,\n symbolType: DEFAULT_HANDLER_PATH,\n fill: 'white',\n stroke: '#B0C8F9',\n lineWidth: 0.5\n },\n endHandlerStyle: {\n visible: true,\n triggerMinSize: 0,\n symbolType: DEFAULT_HANDLER_PATH,\n fill: 'white',\n stroke: '#B0C8F9',\n lineWidth: 0.5\n },\n startTextStyle: {\n padding: 4,\n textStyle: {\n fontSize: 10,\n fill: '#6F6F6F'\n }\n },\n endTextStyle: {\n padding: 4,\n textStyle: {\n fontSize: 10,\n fill: '#6F6F6F'\n }\n }\n};\n\nexport const DEFAULT_HANDLER_ATTR_MAP = {\n horizontal: {\n angle: 0,\n strokeBoundsBuffer: 0,\n boundsPadding: 2,\n pickMode: 'imprecise',\n cursor: 'ew-resize'\n },\n vertical: {\n angle: 90 * (Math.PI / 180),\n cursor: 'ns-resize',\n boundsPadding: 2,\n pickMode: 'imprecise',\n strokeBoundsBuffer: 0\n }\n};\n"]}
|
package/es/data-zoom/renderer.js
CHANGED
|
@@ -14,7 +14,7 @@ import { Bounds, isFunction, merge } from "@visactor/vutils";
|
|
|
14
14
|
|
|
15
15
|
import { Tag } from "../tag";
|
|
16
16
|
|
|
17
|
-
import { DEFAULT_HANDLER_ATTR_MAP
|
|
17
|
+
import { DEFAULT_HANDLER_ATTR_MAP } from "./config";
|
|
18
18
|
|
|
19
19
|
import { isTextOverflow } from "./utils";
|
|
20
20
|
|
|
@@ -112,14 +112,12 @@ export class DataZoomRenderer {
|
|
|
112
112
|
x: position.x + start * width,
|
|
113
113
|
y: position.y,
|
|
114
114
|
width: (end - start) * width,
|
|
115
|
-
height: height
|
|
116
|
-
zIndex: LAYOUT_LEVEL.dragMask
|
|
115
|
+
height: height
|
|
117
116
|
}, dragMaskStyle), "rect") : this._dragMask = this._getContainer().createOrUpdateChild("dragMask", Object.assign({
|
|
118
117
|
x: position.x,
|
|
119
118
|
y: position.y + start * height,
|
|
120
119
|
width: width,
|
|
121
|
-
height: (end - start) * height
|
|
122
|
-
zIndex: LAYOUT_LEVEL.dragMask
|
|
120
|
+
height: (end - start) * height
|
|
123
121
|
}, dragMaskStyle), "rect"), {
|
|
124
122
|
start: start,
|
|
125
123
|
end: end
|
|
@@ -133,8 +131,7 @@ export class DataZoomRenderer {
|
|
|
133
131
|
y: position.y,
|
|
134
132
|
width: width,
|
|
135
133
|
height: height,
|
|
136
|
-
cursor: brushSelect ? "crosshair" : "auto"
|
|
137
|
-
zIndex: LAYOUT_LEVEL.background
|
|
134
|
+
cursor: brushSelect ? "crosshair" : "auto"
|
|
138
135
|
}, backgroundStyle), {
|
|
139
136
|
pickable: !zoomLock && (null === (_a = backgroundStyle.pickable) || void 0 === _a || _a)
|
|
140
137
|
}), "rect");
|
|
@@ -149,8 +146,7 @@ export class DataZoomRenderer {
|
|
|
149
146
|
x: position.x + start * width,
|
|
150
147
|
y: position.y - middleHandlerBackgroundSize,
|
|
151
148
|
width: (end - start) * width,
|
|
152
|
-
height: middleHandlerBackgroundSize
|
|
153
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
149
|
+
height: middleHandlerBackgroundSize
|
|
154
150
|
}, null === (_d = middleHandlerStyle.background) || void 0 === _d ? void 0 : _d.style), {
|
|
155
151
|
pickable: !zoomLock && (null === (_g = null === (_f = null === (_e = middleHandlerStyle.background) || void 0 === _e ? void 0 : _e.style) || void 0 === _f ? void 0 : _f.pickable) || void 0 === _g || _g)
|
|
156
152
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
@@ -158,29 +154,24 @@ export class DataZoomRenderer {
|
|
|
158
154
|
y: position.y - middleHandlerBackgroundSize / 2,
|
|
159
155
|
strokeBoundsBuffer: 0,
|
|
160
156
|
angle: 0,
|
|
161
|
-
symbolType: null !== (_j = null === (_h = middleHandlerStyle.icon) || void 0 === _h ? void 0 : _h.symbolType) && void 0 !== _j ? _j : "square"
|
|
162
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
157
|
+
symbolType: null !== (_j = null === (_h = middleHandlerStyle.icon) || void 0 === _h ? void 0 : _h.symbolType) && void 0 !== _j ? _j : "square"
|
|
163
158
|
}, middleHandlerStyle.icon), {
|
|
164
159
|
pickable: !zoomLock && (null === (_k = middleHandlerStyle.icon.pickable) || void 0 === _k || _k)
|
|
165
160
|
}), "symbol");
|
|
166
161
|
}
|
|
167
|
-
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(
|
|
162
|
+
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
168
163
|
x: position.x + start * width,
|
|
169
164
|
y: position.y + height / 2,
|
|
170
165
|
size: height,
|
|
171
166
|
symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
|
|
172
|
-
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
173
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
174
|
-
}), startHandlerStyle), {
|
|
167
|
+
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
|
|
175
168
|
pickable: !zoomLock && (null === (_m = startHandlerStyle.pickable) || void 0 === _m || _m)
|
|
176
|
-
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign(
|
|
169
|
+
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
177
170
|
x: position.x + end * width,
|
|
178
171
|
y: position.y + height / 2,
|
|
179
172
|
size: height,
|
|
180
173
|
symbolType: null !== (_o = endHandlerStyle.symbolType) && void 0 !== _o ? _o : "square"
|
|
181
|
-
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
182
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
183
|
-
}), endHandlerStyle), {
|
|
174
|
+
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
|
|
184
175
|
pickable: !zoomLock && (null === (_p = endHandlerStyle.pickable) || void 0 === _p || _p)
|
|
185
176
|
}), "symbol");
|
|
186
177
|
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);
|
|
@@ -191,7 +182,7 @@ export class DataZoomRenderer {
|
|
|
191
182
|
height: startHandlerHeight,
|
|
192
183
|
fill: "white",
|
|
193
184
|
fillOpacity: 0,
|
|
194
|
-
zIndex:
|
|
185
|
+
zIndex: 999
|
|
195
186
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
196
187
|
pickable: !zoomLock
|
|
197
188
|
}), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
|
|
@@ -201,7 +192,7 @@ export class DataZoomRenderer {
|
|
|
201
192
|
height: endHandlerHeight,
|
|
202
193
|
fill: "white",
|
|
203
194
|
fillOpacity: 0,
|
|
204
|
-
zIndex:
|
|
195
|
+
zIndex: 999
|
|
205
196
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
206
197
|
pickable: !zoomLock
|
|
207
198
|
}), "rect");
|
|
@@ -212,8 +203,7 @@ export class DataZoomRenderer {
|
|
|
212
203
|
x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
|
|
213
204
|
y: position.y + start * height,
|
|
214
205
|
width: middleHandlerBackgroundSize,
|
|
215
|
-
height: (end - start) * height
|
|
216
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
206
|
+
height: (end - start) * height
|
|
217
207
|
}, null === (_r = middleHandlerStyle.background) || void 0 === _r ? void 0 : _r.style), {
|
|
218
208
|
pickable: !zoomLock && (null === (_u = null === (_t = null === (_s = middleHandlerStyle.background) || void 0 === _s ? void 0 : _s.style) || void 0 === _t ? void 0 : _t.pickable) || void 0 === _u || _u)
|
|
219
209
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
@@ -221,27 +211,23 @@ export class DataZoomRenderer {
|
|
|
221
211
|
y: position.y + (start + end) / 2 * height,
|
|
222
212
|
angle: Math.PI / 180 * 90,
|
|
223
213
|
symbolType: null !== (_w = null === (_v = middleHandlerStyle.icon) || void 0 === _v ? void 0 : _v.symbolType) && void 0 !== _w ? _w : "square",
|
|
224
|
-
strokeBoundsBuffer: 0
|
|
225
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
214
|
+
strokeBoundsBuffer: 0
|
|
226
215
|
}, middleHandlerStyle.icon), {
|
|
227
216
|
pickable: !zoomLock && (null === (_y = null === (_x = middleHandlerStyle.icon) || void 0 === _x ? void 0 : _x.pickable) || void 0 === _y || _y)
|
|
228
217
|
}), "symbol");
|
|
229
218
|
}
|
|
230
|
-
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(
|
|
219
|
+
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
231
220
|
x: position.x + width / 2,
|
|
232
221
|
y: position.y + start * height,
|
|
233
222
|
size: width,
|
|
234
223
|
symbolType: null !== (_z = startHandlerStyle.symbolType) && void 0 !== _z ? _z : "square"
|
|
235
|
-
}, DEFAULT_HANDLER_ATTR_MAP.vertical), {
|
|
236
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
237
|
-
}), startHandlerStyle), {
|
|
224
|
+
}, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
|
|
238
225
|
pickable: !zoomLock && (null === (_0 = startHandlerStyle.pickable) || void 0 === _0 || _0)
|
|
239
226
|
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
240
227
|
x: position.x + width / 2,
|
|
241
228
|
y: position.y + end * height,
|
|
242
229
|
size: width,
|
|
243
|
-
symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square"
|
|
244
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
230
|
+
symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square"
|
|
245
231
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
|
|
246
232
|
pickable: !zoomLock && (null === (_2 = endHandlerStyle.pickable) || void 0 === _2 || _2)
|
|
247
233
|
}), "symbol");
|
|
@@ -253,7 +239,7 @@ export class DataZoomRenderer {
|
|
|
253
239
|
height: endHandlerWidth,
|
|
254
240
|
fill: "white",
|
|
255
241
|
fillOpacity: 0,
|
|
256
|
-
zIndex:
|
|
242
|
+
zIndex: 999
|
|
257
243
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), {
|
|
258
244
|
pickable: !zoomLock
|
|
259
245
|
}), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
|
|
@@ -263,7 +249,7 @@ export class DataZoomRenderer {
|
|
|
263
249
|
height: endHandlerWidth,
|
|
264
250
|
fill: "white",
|
|
265
251
|
fillOpacity: 0,
|
|
266
|
-
zIndex:
|
|
252
|
+
zIndex: 999
|
|
267
253
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), {
|
|
268
254
|
pickable: !zoomLock
|
|
269
255
|
}), "rect");
|
|
@@ -277,8 +263,7 @@ export class DataZoomRenderer {
|
|
|
277
263
|
y: position.y,
|
|
278
264
|
width: (end - start) * width,
|
|
279
265
|
height: height,
|
|
280
|
-
cursor: brushSelect ? "crosshair" : "move"
|
|
281
|
-
zIndex: LAYOUT_LEVEL.selectedBackground
|
|
266
|
+
cursor: brushSelect ? "crosshair" : "move"
|
|
282
267
|
}, selectedBackgroundStyle), {
|
|
283
268
|
pickable: !zoomLock && (null === (_a = selectedBackgroundChartStyle.pickable) || void 0 === _a || _a)
|
|
284
269
|
}), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
@@ -286,16 +271,14 @@ export class DataZoomRenderer {
|
|
|
286
271
|
y: position.y + start * height,
|
|
287
272
|
width: width,
|
|
288
273
|
height: (end - start) * height,
|
|
289
|
-
cursor: brushSelect ? "crosshair" : "move"
|
|
290
|
-
zIndex: LAYOUT_LEVEL.selectedBackground
|
|
274
|
+
cursor: brushSelect ? "crosshair" : "move"
|
|
291
275
|
}, selectedBackgroundStyle), {
|
|
292
276
|
pickable: !zoomLock && (null === (_b = selectedBackgroundStyle.pickable) || void 0 === _b || _b)
|
|
293
277
|
}), "rect");
|
|
294
278
|
}
|
|
295
279
|
_setPreviewAttributes(type, group) {
|
|
296
280
|
this._previewGroup || (this._previewGroup = group.createOrUpdateChild("previewGroup", {
|
|
297
|
-
pickable: !1
|
|
298
|
-
zIndex: LAYOUT_LEVEL.preview
|
|
281
|
+
pickable: !1
|
|
299
282
|
}, "group")), "line" === type ? this._previewLine = this._previewGroup.createOrUpdateChild("previewLine", {}, "line") : this._previewArea = this._previewGroup.createOrUpdateChild("previewArea", {
|
|
300
283
|
curveType: "basis"
|
|
301
284
|
}, "area");
|
|
@@ -312,8 +295,7 @@ export class DataZoomRenderer {
|
|
|
312
295
|
}
|
|
313
296
|
_setSelectedPreviewClipAttributes(type, group) {
|
|
314
297
|
this._selectedPreviewGroupClip || (this._selectedPreviewGroupClip = group.createOrUpdateChild("selectedPreviewGroupClip", {
|
|
315
|
-
pickable: !1
|
|
316
|
-
zIndex: LAYOUT_LEVEL.selectedPreview
|
|
298
|
+
pickable: !1
|
|
317
299
|
}, "group"), this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup", {}, "group"));
|
|
318
300
|
const {start: start, end: end} = this._getState(), {position: position, width: width, height: height} = this._getLayoutAttrFromConfig();
|
|
319
301
|
this._selectedPreviewGroupClip.setAttributes({
|