@visactor/vchart 2.0.23-alpha.0 → 2.0.23-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.
Files changed (38) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +42 -101
  3. package/build/index.js +42 -101
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/chart/index.js +1 -1
  7. package/cjs/chart/stack.js +1 -1
  8. package/cjs/chart/util.js +2 -1
  9. package/cjs/component/crosshair/utils/cartesian.js +5 -3
  10. package/cjs/component/crosshair/utils/cartesian.js.map +1 -1
  11. package/cjs/component/crosshair/utils/common.js +2 -2
  12. package/cjs/component/crosshair/utils/common.js.map +1 -1
  13. package/cjs/constant/base.js +1 -2
  14. package/cjs/constant/scroll-bar.js +2 -1
  15. package/cjs/constant/word-cloud.js +1 -2
  16. package/cjs/core/index.d.ts +1 -1
  17. package/cjs/core/index.js +1 -1
  18. package/cjs/core/index.js.map +1 -1
  19. package/cjs/core/interface.js +1 -1
  20. package/cjs/core/util.js +1 -1
  21. package/cjs/core/vchart.js +1 -1
  22. package/esm/chart/index.js +1 -1
  23. package/esm/chart/stack.js +1 -1
  24. package/esm/chart/util.js +2 -1
  25. package/esm/component/crosshair/utils/cartesian.js +5 -3
  26. package/esm/component/crosshair/utils/cartesian.js.map +1 -1
  27. package/esm/component/crosshair/utils/common.js +2 -2
  28. package/esm/component/crosshair/utils/common.js.map +1 -1
  29. package/esm/constant/base.js +1 -2
  30. package/esm/constant/scroll-bar.js +2 -1
  31. package/esm/constant/word-cloud.js +1 -2
  32. package/esm/core/index.d.ts +1 -1
  33. package/esm/core/index.js +1 -1
  34. package/esm/core/index.js.map +1 -1
  35. package/esm/core/interface.js +1 -1
  36. package/esm/core/util.js +1 -1
  37. package/esm/core/vchart.js +1 -1
  38. package/package.json +9 -9
package/build/index.es.js CHANGED
@@ -16065,7 +16065,6 @@ const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "ancho
16065
16065
  const tempConstantXYKey = ["x", "y"],
16066
16066
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
16067
16067
  tempConstantAngleKey = ["angle"],
16068
- builtinTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave"]),
16069
16068
  point = new Point();
16070
16069
  const NOWORK_ANIMATE_ATTR = {
16071
16070
  strokeSeg: 1,
@@ -16122,7 +16121,7 @@ class Graphic extends Node {
16122
16121
  }
16123
16122
  constructor(params = {}) {
16124
16123
  var _a;
16125
- super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
16124
+ super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
16126
16125
  }
16127
16126
  getGraphicService() {
16128
16127
  var _a, _b;
@@ -16311,7 +16310,7 @@ class Graphic extends Node {
16311
16310
  });
16312
16311
  }
16313
16312
  setAttributes(params, forceUpdateTag = !1, context) {
16314
- params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
16313
+ params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
16315
16314
  }
16316
16315
  _setAttributes(params, forceUpdateTag = !1, context) {
16317
16316
  const keys = Object.keys(params);
@@ -16326,7 +16325,7 @@ class Graphic extends Node {
16326
16325
  const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
16327
16326
  [key]: value
16328
16327
  }, this.attribute, key, context);
16329
- params ? this._setAttributes(params, forceUpdateTag, context) : isNil$1(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
16328
+ params ? this._setAttributes(params, forceUpdateTag, context) : isNil$1(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "shadowGraphic" === key && this.setShadowGraphic(value);
16330
16329
  }
16331
16330
  needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
16332
16331
  for (let i = 0; i < k.length; i++) {
@@ -16345,7 +16344,7 @@ class Graphic extends Node {
16345
16344
  const context = {
16346
16345
  type: AttributeUpdateType.INIT
16347
16346
  };
16348
- params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
16347
+ params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
16349
16348
  }
16350
16349
  translate(x, y) {
16351
16350
  var _a, _b;
@@ -16736,9 +16735,6 @@ class Graphic extends Node {
16736
16735
  function backgroundNotImage(image) {
16737
16736
  return "string" == typeof image ? !(image.startsWith("<svg") || isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
16738
16737
  }
16739
- function isExternalTexture(texture) {
16740
- return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl$1(texture) || texture.includes("/") || isBase64$1(texture)) : isObject$2(texture));
16741
- }
16742
16738
  Graphic.userSymbolMap = {}, Graphic.mixin(EventTarget);
16743
16739
 
16744
16740
  var GroupUpdateAABBBoundsMode;
@@ -20390,7 +20386,6 @@ class DefaultBaseClipRenderAfterContribution {
20390
20386
  }
20391
20387
  const defaultBaseClipRenderAfterContribution = new DefaultBaseClipRenderAfterContribution();
20392
20388
 
20393
- const builtinProceduralTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid"]);
20394
20389
  function formatRatio(ratio) {
20395
20390
  return ratio <= .5 ? 4 * ratio - 1 : -4 * ratio + 3;
20396
20391
  }
@@ -20504,43 +20499,38 @@ class DefaultBaseTextureRenderContribution {
20504
20499
  texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
20505
20500
  }
20506
20501
  drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
20507
- var _a, _b, _c, _d, _e, _f;
20502
+ var _a;
20508
20503
  const {
20509
20504
  textureRatio = graphicAttribute.textureRatio,
20510
20505
  textureOptions = null
20511
20506
  } = graphic.attribute;
20512
- let pattern = null;
20513
- const textureRadius = null !== (_a = null == textureOptions ? void 0 : textureOptions.radius) && void 0 !== _a ? _a : 0,
20514
- patternKey = this.getPatternCacheKey(texture, textureSize, texturePadding, textureColor, context.dpr, textureRadius);
20515
- if (null !== patternKey && (pattern = this.textureMap.get(patternKey)), !pattern) {
20516
- if ("string" == typeof texture) switch (texture) {
20517
- case "circle":
20518
- pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
20519
- break;
20520
- case "diamond":
20521
- pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
20522
- break;
20523
- case "rect":
20524
- pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
20525
- break;
20526
- case "vertical-line":
20527
- pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
20528
- break;
20529
- case "horizontal-line":
20530
- pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
20531
- break;
20532
- case "bias-lr":
20533
- pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
20534
- break;
20535
- case "bias-rl":
20536
- pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
20537
- break;
20538
- case "grid":
20539
- pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
20540
- }
20541
- pattern || (pattern = this.createResourcePattern(texture, graphic, context, texturePadding, textureRadius)), pattern && null !== patternKey && this.textureMap.set(patternKey, pattern);
20507
+ let pattern = this.textureMap.get(texture);
20508
+ if (!pattern) switch (texture) {
20509
+ case "circle":
20510
+ pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
20511
+ break;
20512
+ case "diamond":
20513
+ pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
20514
+ break;
20515
+ case "rect":
20516
+ pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
20517
+ break;
20518
+ case "vertical-line":
20519
+ pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
20520
+ break;
20521
+ case "horizontal-line":
20522
+ pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
20523
+ break;
20524
+ case "bias-lr":
20525
+ pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
20526
+ break;
20527
+ case "bias-rl":
20528
+ pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
20529
+ break;
20530
+ case "grid":
20531
+ pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
20542
20532
  }
20543
- if ("string" == typeof texture && textureOptions && textureOptions.dynamicTexture) {
20533
+ if (textureOptions && textureOptions.dynamicTexture) {
20544
20534
  const {
20545
20535
  gridConfig = {},
20546
20536
  useNewCanvas: useNewCanvas
@@ -20585,24 +20575,10 @@ class DefaultBaseTextureRenderContribution {
20585
20575
  for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
20586
20576
  const _x = x + cellSize / 2 + j * cellSize,
20587
20577
  _y = y + cellSize / 2 + i * cellSize;
20588
- null === (_b = textureOptions.beforeDynamicTexture) || void 0 === _b || _b.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
20578
+ null === (_a = textureOptions.beforeDynamicTexture) || void 0 === _a || _a.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
20589
20579
  }
20590
20580
  useNewCanvas && (originalContext.globalAlpha = 1, originalContext.drawImage(newCanvas.nativeCanvas, 0, 0, newCanvas.nativeCanvas.width, newCanvas.nativeCanvas.height, b.x1, b.y1, b.width() * originalContext.dpr, b.height() * originalContext.dpr)), originalContext.restore();
20591
- } else if (pattern) {
20592
- if (pattern.setTransform) {
20593
- const alignToGraphic = !!(null == textureOptions ? void 0 : textureOptions.alignToGraphic),
20594
- alignOffsetX = null !== (_c = null == textureOptions ? void 0 : textureOptions.alignOffsetX) && void 0 !== _c ? _c : 0,
20595
- alignOffsetY = null !== (_d = null == textureOptions ? void 0 : textureOptions.alignOffsetY) && void 0 !== _d ? _d : 0;
20596
- let translateX = 0,
20597
- translateY = 0;
20598
- if (alignToGraphic) {
20599
- const m = context.currentMatrix;
20600
- translateX = (null !== (_e = null == m ? void 0 : m.e) && void 0 !== _e ? _e : 0) + x + alignOffsetX, translateY = (null !== (_f = null == m ? void 0 : m.f) && void 0 !== _f ? _f : 0) + y + alignOffsetY;
20601
- } else (alignOffsetX || alignOffsetY) && (translateX = alignOffsetX, translateY = alignOffsetY);
20602
- pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, translateX, translateY]));
20603
- }
20604
- context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();
20605
- } else if ("wave" === texture) {
20581
+ } else if (pattern) context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();else if ("wave" === texture) {
20606
20582
  context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
20607
20583
  const b = graphic.AABBBounds;
20608
20584
  drawWave(context, textureRatio, b.width(), b.height(), Object.assign(Object.assign({}, textureOptions || {}), {
@@ -20610,45 +20586,6 @@ class DefaultBaseTextureRenderContribution {
20610
20586
  }), x + b.x1 - x, y + b.y1 - y), context.restore();
20611
20587
  }
20612
20588
  }
20613
- getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr, textureRadius) {
20614
- return "string" != typeof texture ? texturePadding > 0 || textureRadius > 0 ? null : texture : "wave" === texture ? null : builtinProceduralTextureTypes.has(texture) ? `builtin:${texture}|size:${textureSize}|padding:${texturePadding}|color:${textureColor}|dpr:${dpr}` : `resource:${texture}|padding:${texturePadding}|radius:${textureRadius}|dpr:${dpr}`;
20615
- }
20616
- createResourcePattern(texture, graphic, context, texturePadding, textureRadius) {
20617
- var _a;
20618
- const resource = null === (_a = graphic.resources) || void 0 === _a ? void 0 : _a.get(texture),
20619
- data = "success" === (null == resource ? void 0 : resource.state) ? resource.data : "object" == typeof texture ? texture : null;
20620
- if (!data) return null;
20621
- if (texturePadding > 0 || textureRadius > 0) {
20622
- const w = data.naturalWidth || data.width,
20623
- h = data.naturalHeight || data.height;
20624
- if (w > 0 && h > 0) {
20625
- const tileW = w + 2 * texturePadding,
20626
- tileH = h + 2 * texturePadding,
20627
- canvas = canvasAllocate.allocate({
20628
- width: tileW,
20629
- height: tileH,
20630
- dpr: context.dpr
20631
- }),
20632
- ctx = canvas.getContext("2d");
20633
- if (ctx) {
20634
- if (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, tileW, tileH), textureRadius > 0) {
20635
- const r = Math.max(0, Math.min(textureRadius, Math.min(w, h) / 2)),
20636
- x0 = texturePadding,
20637
- y0 = texturePadding,
20638
- x1 = x0 + w,
20639
- y1 = y0 + h;
20640
- ctx.beginPath(), ctx.moveTo(x0 + r, y0), ctx.lineTo(x1 - r, y0), ctx.quadraticCurveTo(x1, y0, x1, y0 + r), ctx.lineTo(x1, y1 - r), ctx.quadraticCurveTo(x1, y1, x1 - r, y1), ctx.lineTo(x0 + r, y1), ctx.quadraticCurveTo(x0, y1, x0, y1 - r), ctx.lineTo(x0, y0 + r), ctx.quadraticCurveTo(x0, y0, x0 + r, y0), ctx.closePath(), ctx.clip();
20641
- }
20642
- ctx.drawImage(data, texturePadding, texturePadding, w, h);
20643
- const pattern = context.createPattern(canvas.nativeCanvas, "repeat");
20644
- return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), canvasAllocate.free(canvas), pattern;
20645
- }
20646
- canvasAllocate.free(canvas);
20647
- }
20648
- }
20649
- const pattern = context.createPattern(data, "repeat");
20650
- return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), pattern;
20651
- }
20652
20589
  }
20653
20590
  const defaultBaseTextureRenderContribution = new DefaultBaseTextureRenderContribution();
20654
20591
 
@@ -62239,7 +62176,7 @@ const lookup = (data, opt) => {
62239
62176
  });
62240
62177
  };
62241
62178
 
62242
- const version = "2.0.21";
62179
+ const version = "2.0.22";
62243
62180
 
62244
62181
  const addVChartProperty = (data, op) => {
62245
62182
  const context = op.beforeCall();
@@ -66150,7 +66087,9 @@ function getDatumByValue(data, value, startField, endField) {
66150
66087
  if (record) {
66151
66088
  const startValue = record[startField];
66152
66089
  const endValue = record[endField || startField];
66153
- if (startValue <= value && endValue >= value) {
66090
+ const min = Math.min(startValue, endValue);
66091
+ const max = Math.max(startValue, endValue);
66092
+ if (min <= value && max >= value) {
66154
66093
  return record;
66155
66094
  }
66156
66095
  }
@@ -71921,15 +71860,17 @@ const layoutByValue$1 = (stateByField, series, layoutStartPoint, enableRemain =
71921
71860
  const field2 = field === 'xField' ? series.fieldX2 : series.fieldY2;
71922
71861
  const datum = getDatumByValue(series.getViewData().latestData, +value, field1, field2);
71923
71862
  if (datum) {
71924
- const startX = field === 'xField' ? series.dataToPositionX(datum) : series.dataToPositionY(datum);
71863
+ const posStart = field === 'xField' ? series.dataToPositionX(datum) : series.dataToPositionY(datum);
71925
71864
  if (field2) {
71926
- bandSize = Math.abs(startX - (field === 'xField' ? series.dataToPositionX1(datum) : series.dataToPositionY1(datum)));
71865
+ const posEnd = field === 'xField' ? series.dataToPositionX1(datum) : series.dataToPositionY1(datum);
71866
+ bandSize = Math.abs(posStart - posEnd);
71867
+ coord = Math.min(posStart, posEnd);
71927
71868
  value = `${datum[field1]} ~ ${datum[field2]}`;
71928
71869
  }
71929
71870
  else {
71930
71871
  bandSize = 1;
71872
+ coord = posStart;
71931
71873
  }
71932
- coord = startX;
71933
71874
  }
71934
71875
  niceLabelFormatter = axis.niceLabelFormatter;
71935
71876
  }
package/build/index.js CHANGED
@@ -16071,7 +16071,6 @@
16071
16071
  const tempConstantXYKey = ["x", "y"],
16072
16072
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
16073
16073
  tempConstantAngleKey = ["angle"],
16074
- builtinTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave"]),
16075
16074
  point = new Point();
16076
16075
  const NOWORK_ANIMATE_ATTR = {
16077
16076
  strokeSeg: 1,
@@ -16128,7 +16127,7 @@
16128
16127
  }
16129
16128
  constructor(params = {}) {
16130
16129
  var _a;
16131
- super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
16130
+ super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
16132
16131
  }
16133
16132
  getGraphicService() {
16134
16133
  var _a, _b;
@@ -16317,7 +16316,7 @@
16317
16316
  });
16318
16317
  }
16319
16318
  setAttributes(params, forceUpdateTag = !1, context) {
16320
- params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
16319
+ params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
16321
16320
  }
16322
16321
  _setAttributes(params, forceUpdateTag = !1, context) {
16323
16322
  const keys = Object.keys(params);
@@ -16332,7 +16331,7 @@
16332
16331
  const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
16333
16332
  [key]: value
16334
16333
  }, this.attribute, key, context);
16335
- params ? this._setAttributes(params, forceUpdateTag, context) : isNil$1(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
16334
+ params ? this._setAttributes(params, forceUpdateTag, context) : isNil$1(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "shadowGraphic" === key && this.setShadowGraphic(value);
16336
16335
  }
16337
16336
  needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
16338
16337
  for (let i = 0; i < k.length; i++) {
@@ -16351,7 +16350,7 @@
16351
16350
  const context = {
16352
16351
  type: AttributeUpdateType.INIT
16353
16352
  };
16354
- params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
16353
+ params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, params.background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
16355
16354
  }
16356
16355
  translate(x, y) {
16357
16356
  var _a, _b;
@@ -16742,9 +16741,6 @@
16742
16741
  function backgroundNotImage(image) {
16743
16742
  return "string" == typeof image ? !(image.startsWith("<svg") || isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
16744
16743
  }
16745
- function isExternalTexture(texture) {
16746
- return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl$1(texture) || texture.includes("/") || isBase64$1(texture)) : isObject$2(texture));
16747
- }
16748
16744
  Graphic.userSymbolMap = {}, Graphic.mixin(EventTarget);
16749
16745
 
16750
16746
  var GroupUpdateAABBBoundsMode;
@@ -20396,7 +20392,6 @@
20396
20392
  }
20397
20393
  const defaultBaseClipRenderAfterContribution = new DefaultBaseClipRenderAfterContribution();
20398
20394
 
20399
- const builtinProceduralTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid"]);
20400
20395
  function formatRatio(ratio) {
20401
20396
  return ratio <= .5 ? 4 * ratio - 1 : -4 * ratio + 3;
20402
20397
  }
@@ -20510,43 +20505,38 @@
20510
20505
  texture && this.drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding);
20511
20506
  }
20512
20507
  drawTexture(texture, graphic, context, x, y, graphicAttribute, textureColor, textureSize, texturePadding) {
20513
- var _a, _b, _c, _d, _e, _f;
20508
+ var _a;
20514
20509
  const {
20515
20510
  textureRatio = graphicAttribute.textureRatio,
20516
20511
  textureOptions = null
20517
20512
  } = graphic.attribute;
20518
- let pattern = null;
20519
- const textureRadius = null !== (_a = null == textureOptions ? void 0 : textureOptions.radius) && void 0 !== _a ? _a : 0,
20520
- patternKey = this.getPatternCacheKey(texture, textureSize, texturePadding, textureColor, context.dpr, textureRadius);
20521
- if (null !== patternKey && (pattern = this.textureMap.get(patternKey)), !pattern) {
20522
- if ("string" == typeof texture) switch (texture) {
20523
- case "circle":
20524
- pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
20525
- break;
20526
- case "diamond":
20527
- pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
20528
- break;
20529
- case "rect":
20530
- pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
20531
- break;
20532
- case "vertical-line":
20533
- pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
20534
- break;
20535
- case "horizontal-line":
20536
- pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
20537
- break;
20538
- case "bias-lr":
20539
- pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
20540
- break;
20541
- case "bias-rl":
20542
- pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
20543
- break;
20544
- case "grid":
20545
- pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
20546
- }
20547
- pattern || (pattern = this.createResourcePattern(texture, graphic, context, texturePadding, textureRadius)), pattern && null !== patternKey && this.textureMap.set(patternKey, pattern);
20513
+ let pattern = this.textureMap.get(texture);
20514
+ if (!pattern) switch (texture) {
20515
+ case "circle":
20516
+ pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);
20517
+ break;
20518
+ case "diamond":
20519
+ pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);
20520
+ break;
20521
+ case "rect":
20522
+ pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);
20523
+ break;
20524
+ case "vertical-line":
20525
+ pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);
20526
+ break;
20527
+ case "horizontal-line":
20528
+ pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);
20529
+ break;
20530
+ case "bias-lr":
20531
+ pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);
20532
+ break;
20533
+ case "bias-rl":
20534
+ pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);
20535
+ break;
20536
+ case "grid":
20537
+ pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);
20548
20538
  }
20549
- if ("string" == typeof texture && textureOptions && textureOptions.dynamicTexture) {
20539
+ if (textureOptions && textureOptions.dynamicTexture) {
20550
20540
  const {
20551
20541
  gridConfig = {},
20552
20542
  useNewCanvas: useNewCanvas
@@ -20591,24 +20581,10 @@
20591
20581
  for (let i = 0; i < gridRows; i++) for (let j = 0; j < gridColumns; j++) {
20592
20582
  const _x = x + cellSize / 2 + j * cellSize,
20593
20583
  _y = y + cellSize / 2 + i * cellSize;
20594
- null === (_b = textureOptions.beforeDynamicTexture) || void 0 === _b || _b.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
20584
+ null === (_a = textureOptions.beforeDynamicTexture) || void 0 === _a || _a.call(textureOptions, context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height()), context.beginPath(), !1 === parsedPath.draw(context, Math.min(sizeW - gutterColumn, sizeH - gutterRow), _x, _y, 0) && context.closePath(), context.fillStyle = textureColor, textureOptions.dynamicTexture(context, i, j, gridRows, gridColumns, textureRatio, graphic, b.width(), b.height());
20595
20585
  }
20596
20586
  useNewCanvas && (originalContext.globalAlpha = 1, originalContext.drawImage(newCanvas.nativeCanvas, 0, 0, newCanvas.nativeCanvas.width, newCanvas.nativeCanvas.height, b.x1, b.y1, b.width() * originalContext.dpr, b.height() * originalContext.dpr)), originalContext.restore();
20597
- } else if (pattern) {
20598
- if (pattern.setTransform) {
20599
- const alignToGraphic = !!(null == textureOptions ? void 0 : textureOptions.alignToGraphic),
20600
- alignOffsetX = null !== (_c = null == textureOptions ? void 0 : textureOptions.alignOffsetX) && void 0 !== _c ? _c : 0,
20601
- alignOffsetY = null !== (_d = null == textureOptions ? void 0 : textureOptions.alignOffsetY) && void 0 !== _d ? _d : 0;
20602
- let translateX = 0,
20603
- translateY = 0;
20604
- if (alignToGraphic) {
20605
- const m = context.currentMatrix;
20606
- translateX = (null !== (_e = null == m ? void 0 : m.e) && void 0 !== _e ? _e : 0) + x + alignOffsetX, translateY = (null !== (_f = null == m ? void 0 : m.f) && void 0 !== _f ? _f : 0) + y + alignOffsetY;
20607
- } else (alignOffsetX || alignOffsetY) && (translateX = alignOffsetX, translateY = alignOffsetY);
20608
- pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, translateX, translateY]));
20609
- }
20610
- context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();
20611
- } else if ("wave" === texture) {
20587
+ } else if (pattern) context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = pattern, context.fill(), context.highPerformanceRestore();else if ("wave" === texture) {
20612
20588
  context.save(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.clip();
20613
20589
  const b = graphic.AABBBounds;
20614
20590
  drawWave(context, textureRatio, b.width(), b.height(), Object.assign(Object.assign({}, textureOptions || {}), {
@@ -20616,45 +20592,6 @@
20616
20592
  }), x + b.x1 - x, y + b.y1 - y), context.restore();
20617
20593
  }
20618
20594
  }
20619
- getPatternCacheKey(texture, textureSize, texturePadding, textureColor, dpr, textureRadius) {
20620
- return "string" != typeof texture ? texturePadding > 0 || textureRadius > 0 ? null : texture : "wave" === texture ? null : builtinProceduralTextureTypes.has(texture) ? `builtin:${texture}|size:${textureSize}|padding:${texturePadding}|color:${textureColor}|dpr:${dpr}` : `resource:${texture}|padding:${texturePadding}|radius:${textureRadius}|dpr:${dpr}`;
20621
- }
20622
- createResourcePattern(texture, graphic, context, texturePadding, textureRadius) {
20623
- var _a;
20624
- const resource = null === (_a = graphic.resources) || void 0 === _a ? void 0 : _a.get(texture),
20625
- data = "success" === (null == resource ? void 0 : resource.state) ? resource.data : "object" == typeof texture ? texture : null;
20626
- if (!data) return null;
20627
- if (texturePadding > 0 || textureRadius > 0) {
20628
- const w = data.naturalWidth || data.width,
20629
- h = data.naturalHeight || data.height;
20630
- if (w > 0 && h > 0) {
20631
- const tileW = w + 2 * texturePadding,
20632
- tileH = h + 2 * texturePadding,
20633
- canvas = canvasAllocate.allocate({
20634
- width: tileW,
20635
- height: tileH,
20636
- dpr: context.dpr
20637
- }),
20638
- ctx = canvas.getContext("2d");
20639
- if (ctx) {
20640
- if (ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, tileW, tileH), textureRadius > 0) {
20641
- const r = Math.max(0, Math.min(textureRadius, Math.min(w, h) / 2)),
20642
- x0 = texturePadding,
20643
- y0 = texturePadding,
20644
- x1 = x0 + w,
20645
- y1 = y0 + h;
20646
- ctx.beginPath(), ctx.moveTo(x0 + r, y0), ctx.lineTo(x1 - r, y0), ctx.quadraticCurveTo(x1, y0, x1, y0 + r), ctx.lineTo(x1, y1 - r), ctx.quadraticCurveTo(x1, y1, x1 - r, y1), ctx.lineTo(x0 + r, y1), ctx.quadraticCurveTo(x0, y1, x0, y1 - r), ctx.lineTo(x0, y0 + r), ctx.quadraticCurveTo(x0, y0, x0 + r, y0), ctx.closePath(), ctx.clip();
20647
- }
20648
- ctx.drawImage(data, texturePadding, texturePadding, w, h);
20649
- const pattern = context.createPattern(canvas.nativeCanvas, "repeat");
20650
- return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), canvasAllocate.free(canvas), pattern;
20651
- }
20652
- canvasAllocate.free(canvas);
20653
- }
20654
- }
20655
- const pattern = context.createPattern(data, "repeat");
20656
- return (null == pattern ? void 0 : pattern.setTransform) && pattern.setTransform(new DOMMatrix([1 / context.dpr, 0, 0, 1 / context.dpr, 0, 0])), pattern;
20657
- }
20658
20595
  }
20659
20596
  const defaultBaseTextureRenderContribution = new DefaultBaseTextureRenderContribution();
20660
20597
 
@@ -62245,7 +62182,7 @@
62245
62182
  });
62246
62183
  };
62247
62184
 
62248
- const version = "2.0.21";
62185
+ const version = "2.0.22";
62249
62186
 
62250
62187
  const addVChartProperty = (data, op) => {
62251
62188
  const context = op.beforeCall();
@@ -66156,7 +66093,9 @@
66156
66093
  if (record) {
66157
66094
  const startValue = record[startField];
66158
66095
  const endValue = record[endField || startField];
66159
- if (startValue <= value && endValue >= value) {
66096
+ const min = Math.min(startValue, endValue);
66097
+ const max = Math.max(startValue, endValue);
66098
+ if (min <= value && max >= value) {
66160
66099
  return record;
66161
66100
  }
66162
66101
  }
@@ -71927,15 +71866,17 @@
71927
71866
  const field2 = field === 'xField' ? series.fieldX2 : series.fieldY2;
71928
71867
  const datum = getDatumByValue(series.getViewData().latestData, +value, field1, field2);
71929
71868
  if (datum) {
71930
- const startX = field === 'xField' ? series.dataToPositionX(datum) : series.dataToPositionY(datum);
71869
+ const posStart = field === 'xField' ? series.dataToPositionX(datum) : series.dataToPositionY(datum);
71931
71870
  if (field2) {
71932
- bandSize = Math.abs(startX - (field === 'xField' ? series.dataToPositionX1(datum) : series.dataToPositionY1(datum)));
71871
+ const posEnd = field === 'xField' ? series.dataToPositionX1(datum) : series.dataToPositionY1(datum);
71872
+ bandSize = Math.abs(posStart - posEnd);
71873
+ coord = Math.min(posStart, posEnd);
71933
71874
  value = `${datum[field1]} ~ ${datum[field2]}`;
71934
71875
  }
71935
71876
  else {
71936
71877
  bandSize = 1;
71878
+ coord = posStart;
71937
71879
  }
71938
- coord = startX;
71939
71880
  }
71940
71881
  niceLabelFormatter = axis.niceLabelFormatter;
71941
71882
  }