@visactor/vrender-components 1.0.41 → 1.0.43-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -12230,9 +12230,10 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
12230
12230
  }), context.highPerformanceRestore(), context.setTransformForCurrent();
12231
12231
  } else {
12232
12232
  const {
12233
- backgroundCornerRadius: backgroundCornerRadius
12233
+ backgroundCornerRadius: backgroundCornerRadius,
12234
+ backgroundOpacity = 1
12234
12235
  } = graphic.attribute;
12235
- context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
12236
+ context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity, context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
12236
12237
  }
12237
12238
  shouldReCalBounds && boundsAllocate.free(b), restore();
12238
12239
  }
@@ -23641,6 +23642,7 @@ class LabelBase extends AnimateComponent {
23641
23642
  }
23642
23643
  const baseMark = this.getRelatedGraphic(label.attribute);
23643
23644
  let backgroundColor = baseMark.getAttributes(true).fill;
23645
+ const backgroundOpacity = baseMark.getAttributes(true).fillOpacity;
23644
23646
  let foregroundColor = label.attribute.fill;
23645
23647
  if (isObject(backgroundColor) && backgroundColor.gradient) {
23646
23648
  const firstStopColor = (_g = (_f = backgroundColor.stops) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.color;
@@ -23659,10 +23661,21 @@ class LabelBase extends AnimateComponent {
23659
23661
  if (label.attribute.lineWidth === 0 || label.attribute.strokeOpacity === 0) {
23660
23662
  continue;
23661
23663
  }
23662
- const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
23663
- stroke && label.setAttributes({ stroke });
23664
+ if (interactInvertType === 'background') {
23665
+ label.setAttributes({ stroke: false });
23666
+ }
23667
+ else {
23668
+ const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
23669
+ stroke && label.setAttributes({ stroke });
23670
+ }
23664
23671
  }
23665
23672
  else if (isIntersect && interactInvertType !== 'none') {
23673
+ if (interactInvertType === 'background') {
23674
+ const fill = smartInvertStrategy(fillStrategy, backgroundColor, invertColor, similarColor);
23675
+ fill && label.setAttributes({ fill });
23676
+ label.setAttributes({ stroke: false, background: backgroundColor, backgroundOpacity });
23677
+ continue;
23678
+ }
23666
23679
  if (label.attribute.lineWidth === 0 || label.attribute.strokeOpacity === 0) {
23667
23680
  continue;
23668
23681
  }
@@ -23677,6 +23690,9 @@ class LabelBase extends AnimateComponent {
23677
23690
  const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
23678
23691
  stroke && label.setAttributes({ stroke });
23679
23692
  }
23693
+ if (isInside === false && interactInvertType === 'background') {
23694
+ label.setAttributes({ background: null });
23695
+ }
23680
23696
  }
23681
23697
  }
23682
23698
  _canPlaceInside(textBound, shapeBound) {
@@ -25247,6 +25263,16 @@ const DEFAULT_HANDLER_ATTR_MAP = {
25247
25263
  strokeBoundsBuffer: 0
25248
25264
  }
25249
25265
  };
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
+ };
25250
25276
 
25251
25277
  const isTextOverflow = (componentBoundsLike, textBounds, layout, isHorizontal) => {
25252
25278
  if (!textBounds) {
@@ -25386,10 +25412,10 @@ class DataZoomRenderer {
25386
25412
  const { position, width, height } = this._getLayoutAttrFromConfig();
25387
25413
  const { start, end } = this._getState();
25388
25414
  if (this._isHorizontal) {
25389
- this._dragMask = this._getContainer().createOrUpdateChild('dragMask', Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height }, dragMaskStyle), 'rect');
25415
+ this._dragMask = this._getContainer().createOrUpdateChild('dragMask', Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height, zIndex: LAYOUT_LEVEL.dragMask }, dragMaskStyle), 'rect');
25390
25416
  }
25391
25417
  else {
25392
- this._dragMask = this._getContainer().createOrUpdateChild('dragMask', Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height }, dragMaskStyle), 'rect');
25418
+ this._dragMask = this._getContainer().createOrUpdateChild('dragMask', Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height, zIndex: LAYOUT_LEVEL.dragMask }, dragMaskStyle), 'rect');
25393
25419
  }
25394
25420
  return { start, end };
25395
25421
  }
@@ -25399,7 +25425,7 @@ class DataZoomRenderer {
25399
25425
  const { position, width, height } = this._getLayoutAttrFromConfig();
25400
25426
  const group = this._getContainer();
25401
25427
  this._background = group.createOrUpdateChild('background', Object.assign(Object.assign({ x: position.x, y: position.y, width,
25402
- height, cursor: brushSelect ? 'crosshair' : 'auto' }, backgroundStyle), { pickable: zoomLock ? false : (_a = backgroundStyle.pickable) !== null && _a !== void 0 ? _a : true }), 'rect');
25428
+ height, cursor: brushSelect ? 'crosshair' : 'auto', zIndex: LAYOUT_LEVEL.background }, backgroundStyle), { pickable: zoomLock ? false : ((_a = backgroundStyle.pickable) !== null && _a !== void 0 ? _a : true) }), 'rect');
25403
25429
  }
25404
25430
  _renderHandler() {
25405
25431
  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;
@@ -25412,34 +25438,34 @@ class DataZoomRenderer {
25412
25438
  if (this._isHorizontal) {
25413
25439
  if (middleHandlerStyle.visible) {
25414
25440
  const middleHandlerBackgroundSize = ((_c = middleHandlerStyle.background) === null || _c === void 0 ? void 0 : _c.size) || 10;
25415
- 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');
25416
- 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');
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, zIndex: LAYOUT_LEVEL.handler }, (_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');
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', zIndex: LAYOUT_LEVEL.handler }, middleHandlerStyle.icon), { pickable: zoomLock ? false : ((_k = middleHandlerStyle.icon.pickable) !== null && _k !== void 0 ? _k : true) }), 'symbol');
25417
25443
  }
25418
- 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');
25419
- 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');
25444
+ this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(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), { zIndex: LAYOUT_LEVEL.handler }), startHandlerStyle), { pickable: zoomLock ? false : ((_m = startHandlerStyle.pickable) !== null && _m !== void 0 ? _m : true) }), 'symbol');
25445
+ this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(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), { zIndex: LAYOUT_LEVEL.handler }), endHandlerStyle), { pickable: zoomLock ? false : ((_p = endHandlerStyle.pickable) !== null && _p !== void 0 ? _p : true) }), 'symbol');
25420
25446
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
25421
25447
  const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
25422
25448
  const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
25423
25449
  const endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
25424
- 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');
25425
- 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');
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: LAYOUT_LEVEL.handlerMask }, DEFAULT_HANDLER_ATTR_MAP.horizontal), { pickable: !zoomLock }), 'rect');
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: LAYOUT_LEVEL.handlerMask }, DEFAULT_HANDLER_ATTR_MAP.horizontal), { pickable: !zoomLock }), 'rect');
25426
25452
  }
25427
25453
  else {
25428
25454
  if (middleHandlerStyle.visible) {
25429
25455
  const middleHandlerBackgroundSize = ((_q = middleHandlerStyle.background) === null || _q === void 0 ? void 0 : _q.size) || 10;
25430
- 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');
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, zIndex: LAYOUT_LEVEL.handler }, (_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');
25431
25457
  this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign(Object.assign({ x: orient === 'left'
25432
25458
  ? position.x - middleHandlerBackgroundSize / 2
25433
- : 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');
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, zIndex: LAYOUT_LEVEL.handler }, middleHandlerStyle.icon), { pickable: zoomLock ? false : ((_y = (_x = middleHandlerStyle.icon) === null || _x === void 0 ? void 0 : _x.pickable) !== null && _y !== void 0 ? _y : true) }), 'symbol');
25434
25460
  }
25435
- 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');
25436
- 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');
25461
+ this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(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), { zIndex: LAYOUT_LEVEL.handler }), startHandlerStyle), { pickable: zoomLock ? false : ((_0 = startHandlerStyle.pickable) !== null && _0 !== void 0 ? _0 : true) }), 'symbol');
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', zIndex: LAYOUT_LEVEL.handler }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), { pickable: zoomLock ? false : ((_2 = endHandlerStyle.pickable) !== null && _2 !== void 0 ? _2 : true) }), 'symbol');
25437
25463
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
25438
25464
  const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
25439
25465
  const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
25440
25466
  const endHandlerHeight = Math.max(this._endHandler.AABBBounds.height(), endHandlerMinSize);
25441
- 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');
25442
- 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');
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: LAYOUT_LEVEL.handlerMask }, DEFAULT_HANDLER_ATTR_MAP.vertical), { pickable: !zoomLock }), 'rect');
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: LAYOUT_LEVEL.handlerMask }, DEFAULT_HANDLER_ATTR_MAP.vertical), { pickable: !zoomLock }), 'rect');
25443
25469
  }
25444
25470
  }
25445
25471
  _renderSelectedBackground() {
@@ -25449,15 +25475,15 @@ class DataZoomRenderer {
25449
25475
  const { position, width, height } = this._getLayoutAttrFromConfig();
25450
25476
  const group = this._getContainer();
25451
25477
  if (this._isHorizontal) {
25452
- 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');
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', zIndex: LAYOUT_LEVEL.selectedBackground }, selectedBackgroundStyle), { pickable: zoomLock ? false : ((_a = selectedBackgroundChartStyle.pickable) !== null && _a !== void 0 ? _a : true) }), 'rect');
25453
25479
  }
25454
25480
  else {
25455
- 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');
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', zIndex: LAYOUT_LEVEL.selectedBackground }, selectedBackgroundStyle), { pickable: zoomLock ? false : ((_b = selectedBackgroundStyle.pickable) !== null && _b !== void 0 ? _b : true) }), 'rect');
25456
25482
  }
25457
25483
  }
25458
25484
  _setPreviewAttributes(type, group) {
25459
25485
  if (!this._previewGroup) {
25460
- this._previewGroup = group.createOrUpdateChild('previewGroup', { pickable: false }, 'group');
25486
+ this._previewGroup = group.createOrUpdateChild('previewGroup', { pickable: false, zIndex: LAYOUT_LEVEL.preview }, 'group');
25461
25487
  }
25462
25488
  if (type === 'line') {
25463
25489
  this._previewLine = this._previewGroup.createOrUpdateChild('previewLine', {}, 'line');
@@ -25473,7 +25499,7 @@ class DataZoomRenderer {
25473
25499
  }
25474
25500
  _setSelectedPreviewClipAttributes(type, group) {
25475
25501
  if (!this._selectedPreviewGroupClip) {
25476
- this._selectedPreviewGroupClip = group.createOrUpdateChild('selectedPreviewGroupClip', { pickable: false }, 'group');
25502
+ this._selectedPreviewGroupClip = group.createOrUpdateChild('selectedPreviewGroupClip', { pickable: false, zIndex: LAYOUT_LEVEL.selectedPreview }, 'group');
25477
25503
  this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild('selectedPreviewGroup', {}, 'group');
25478
25504
  }
25479
25505
  const { start, end } = this._getState();
@@ -34970,6 +34996,6 @@ TableSeriesNumber.defaultAttributes = {
34970
34996
  select: true
34971
34997
  };
34972
34998
 
34973
- const version = "1.0.41";
34999
+ const version = "1.0.43-alpha.0";
34974
35000
 
34975
35001
  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 };
@@ -114,3 +114,13 @@ 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
+ };
@@ -116,4 +116,15 @@ 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
+ };
119
130
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/data-zoom/config.ts"],"names":[],"mappings":"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","file":"config.js","sourcesContent":["export const DEFAULT_HANDLER_PATH =\n // eslint-disable-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"]}
1
+ {"version":3,"sources":["../src/data-zoom/config.ts"],"names":[],"mappings":"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","file":"config.js","sourcesContent":["export const DEFAULT_HANDLER_PATH =\n // eslint-disable-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\nexport const LAYOUT_LEVEL = {\n background: 0, // 背景\n preview: 1, // 背景图表\n dragMask: 2, // 背景选框\n selectedBackground: 3, // 选中背景\n selectedPreview: 4, // 选中背景图表\n handler: 5, // 手柄\n handlerText: 5, // 文字\n handlerMask: 999 // 热区\n};\n"]}
@@ -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 } from "./config";
17
+ import { DEFAULT_HANDLER_ATTR_MAP, LAYOUT_LEVEL } from "./config";
18
18
 
19
19
  import { isTextOverflow } from "./utils";
20
20
 
@@ -112,12 +112,14 @@ export class DataZoomRenderer {
112
112
  x: position.x + start * width,
113
113
  y: position.y,
114
114
  width: (end - start) * width,
115
- height: height
115
+ height: height,
116
+ zIndex: LAYOUT_LEVEL.dragMask
116
117
  }, dragMaskStyle), "rect") : this._dragMask = this._getContainer().createOrUpdateChild("dragMask", Object.assign({
117
118
  x: position.x,
118
119
  y: position.y + start * height,
119
120
  width: width,
120
- height: (end - start) * height
121
+ height: (end - start) * height,
122
+ zIndex: LAYOUT_LEVEL.dragMask
121
123
  }, dragMaskStyle), "rect"), {
122
124
  start: start,
123
125
  end: end
@@ -131,7 +133,8 @@ export class DataZoomRenderer {
131
133
  y: position.y,
132
134
  width: width,
133
135
  height: height,
134
- cursor: brushSelect ? "crosshair" : "auto"
136
+ cursor: brushSelect ? "crosshair" : "auto",
137
+ zIndex: LAYOUT_LEVEL.background
135
138
  }, backgroundStyle), {
136
139
  pickable: !zoomLock && (null === (_a = backgroundStyle.pickable) || void 0 === _a || _a)
137
140
  }), "rect");
@@ -146,7 +149,8 @@ export class DataZoomRenderer {
146
149
  x: position.x + start * width,
147
150
  y: position.y - middleHandlerBackgroundSize,
148
151
  width: (end - start) * width,
149
- height: middleHandlerBackgroundSize
152
+ height: middleHandlerBackgroundSize,
153
+ zIndex: LAYOUT_LEVEL.handler
150
154
  }, null === (_d = middleHandlerStyle.background) || void 0 === _d ? void 0 : _d.style), {
151
155
  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)
152
156
  }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
@@ -154,24 +158,29 @@ export class DataZoomRenderer {
154
158
  y: position.y - middleHandlerBackgroundSize / 2,
155
159
  strokeBoundsBuffer: 0,
156
160
  angle: 0,
157
- symbolType: null !== (_j = null === (_h = middleHandlerStyle.icon) || void 0 === _h ? void 0 : _h.symbolType) && void 0 !== _j ? _j : "square"
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
158
163
  }, middleHandlerStyle.icon), {
159
164
  pickable: !zoomLock && (null === (_k = middleHandlerStyle.icon.pickable) || void 0 === _k || _k)
160
165
  }), "symbol");
161
166
  }
162
- this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
167
+ this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(Object.assign({
163
168
  x: position.x + start * width,
164
169
  y: position.y + height / 2,
165
170
  size: height,
166
171
  symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
167
- }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
172
+ }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
173
+ zIndex: LAYOUT_LEVEL.handler
174
+ }), startHandlerStyle), {
168
175
  pickable: !zoomLock && (null === (_m = startHandlerStyle.pickable) || void 0 === _m || _m)
169
- }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
176
+ }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign(Object.assign({
170
177
  x: position.x + end * width,
171
178
  y: position.y + height / 2,
172
179
  size: height,
173
180
  symbolType: null !== (_o = endHandlerStyle.symbolType) && void 0 !== _o ? _o : "square"
174
- }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
181
+ }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
182
+ zIndex: LAYOUT_LEVEL.handler
183
+ }), endHandlerStyle), {
175
184
  pickable: !zoomLock && (null === (_p = endHandlerStyle.pickable) || void 0 === _p || _p)
176
185
  }), "symbol");
177
186
  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);
@@ -182,7 +191,7 @@ export class DataZoomRenderer {
182
191
  height: startHandlerHeight,
183
192
  fill: "white",
184
193
  fillOpacity: 0,
185
- zIndex: 999
194
+ zIndex: LAYOUT_LEVEL.handlerMask
186
195
  }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
187
196
  pickable: !zoomLock
188
197
  }), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
@@ -192,7 +201,7 @@ export class DataZoomRenderer {
192
201
  height: endHandlerHeight,
193
202
  fill: "white",
194
203
  fillOpacity: 0,
195
- zIndex: 999
204
+ zIndex: LAYOUT_LEVEL.handlerMask
196
205
  }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
197
206
  pickable: !zoomLock
198
207
  }), "rect");
@@ -203,7 +212,8 @@ export class DataZoomRenderer {
203
212
  x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
204
213
  y: position.y + start * height,
205
214
  width: middleHandlerBackgroundSize,
206
- height: (end - start) * height
215
+ height: (end - start) * height,
216
+ zIndex: LAYOUT_LEVEL.handler
207
217
  }, null === (_r = middleHandlerStyle.background) || void 0 === _r ? void 0 : _r.style), {
208
218
  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)
209
219
  }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
@@ -211,23 +221,27 @@ export class DataZoomRenderer {
211
221
  y: position.y + (start + end) / 2 * height,
212
222
  angle: Math.PI / 180 * 90,
213
223
  symbolType: null !== (_w = null === (_v = middleHandlerStyle.icon) || void 0 === _v ? void 0 : _v.symbolType) && void 0 !== _w ? _w : "square",
214
- strokeBoundsBuffer: 0
224
+ strokeBoundsBuffer: 0,
225
+ zIndex: LAYOUT_LEVEL.handler
215
226
  }, middleHandlerStyle.icon), {
216
227
  pickable: !zoomLock && (null === (_y = null === (_x = middleHandlerStyle.icon) || void 0 === _x ? void 0 : _x.pickable) || void 0 === _y || _y)
217
228
  }), "symbol");
218
229
  }
219
- this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
230
+ this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(Object.assign({
220
231
  x: position.x + width / 2,
221
232
  y: position.y + start * height,
222
233
  size: width,
223
234
  symbolType: null !== (_z = startHandlerStyle.symbolType) && void 0 !== _z ? _z : "square"
224
- }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
235
+ }, DEFAULT_HANDLER_ATTR_MAP.vertical), {
236
+ zIndex: LAYOUT_LEVEL.handler
237
+ }), startHandlerStyle), {
225
238
  pickable: !zoomLock && (null === (_0 = startHandlerStyle.pickable) || void 0 === _0 || _0)
226
239
  }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
227
240
  x: position.x + width / 2,
228
241
  y: position.y + end * height,
229
242
  size: width,
230
- symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square"
243
+ symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square",
244
+ zIndex: LAYOUT_LEVEL.handler
231
245
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
232
246
  pickable: !zoomLock && (null === (_2 = endHandlerStyle.pickable) || void 0 === _2 || _2)
233
247
  }), "symbol");
@@ -239,7 +253,7 @@ export class DataZoomRenderer {
239
253
  height: endHandlerWidth,
240
254
  fill: "white",
241
255
  fillOpacity: 0,
242
- zIndex: 999
256
+ zIndex: LAYOUT_LEVEL.handlerMask
243
257
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), {
244
258
  pickable: !zoomLock
245
259
  }), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
@@ -249,7 +263,7 @@ export class DataZoomRenderer {
249
263
  height: endHandlerWidth,
250
264
  fill: "white",
251
265
  fillOpacity: 0,
252
- zIndex: 999
266
+ zIndex: LAYOUT_LEVEL.handlerMask
253
267
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), {
254
268
  pickable: !zoomLock
255
269
  }), "rect");
@@ -263,7 +277,8 @@ export class DataZoomRenderer {
263
277
  y: position.y,
264
278
  width: (end - start) * width,
265
279
  height: height,
266
- cursor: brushSelect ? "crosshair" : "move"
280
+ cursor: brushSelect ? "crosshair" : "move",
281
+ zIndex: LAYOUT_LEVEL.selectedBackground
267
282
  }, selectedBackgroundStyle), {
268
283
  pickable: !zoomLock && (null === (_a = selectedBackgroundChartStyle.pickable) || void 0 === _a || _a)
269
284
  }), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
@@ -271,14 +286,16 @@ export class DataZoomRenderer {
271
286
  y: position.y + start * height,
272
287
  width: width,
273
288
  height: (end - start) * height,
274
- cursor: brushSelect ? "crosshair" : "move"
289
+ cursor: brushSelect ? "crosshair" : "move",
290
+ zIndex: LAYOUT_LEVEL.selectedBackground
275
291
  }, selectedBackgroundStyle), {
276
292
  pickable: !zoomLock && (null === (_b = selectedBackgroundStyle.pickable) || void 0 === _b || _b)
277
293
  }), "rect");
278
294
  }
279
295
  _setPreviewAttributes(type, group) {
280
296
  this._previewGroup || (this._previewGroup = group.createOrUpdateChild("previewGroup", {
281
- pickable: !1
297
+ pickable: !1,
298
+ zIndex: LAYOUT_LEVEL.preview
282
299
  }, "group")), "line" === type ? this._previewLine = this._previewGroup.createOrUpdateChild("previewLine", {}, "line") : this._previewArea = this._previewGroup.createOrUpdateChild("previewArea", {
283
300
  curveType: "basis"
284
301
  }, "area");
@@ -295,7 +312,8 @@ export class DataZoomRenderer {
295
312
  }
296
313
  _setSelectedPreviewClipAttributes(type, group) {
297
314
  this._selectedPreviewGroupClip || (this._selectedPreviewGroupClip = group.createOrUpdateChild("selectedPreviewGroupClip", {
298
- pickable: !1
315
+ pickable: !1,
316
+ zIndex: LAYOUT_LEVEL.selectedPreview
299
317
  }, "group"), this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup", {}, "group"));
300
318
  const {start: start, end: end} = this._getState(), {position: position, width: width, height: height} = this._getLayoutAttrFromConfig();
301
319
  this._selectedPreviewGroupClip.setAttributes({