@visactor/vchart 1.2.0-beta.3 → 1.2.0-beta.4

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 (95) hide show
  1. package/build/index.js +227 -108
  2. package/build/index.min.js +1 -1
  3. package/cjs/chart/waterfall/waterfall.js +1 -0
  4. package/cjs/chart/waterfall/waterfall.js.map +1 -1
  5. package/cjs/component/axis/cartesian/index.d.ts +1 -0
  6. package/cjs/component/axis/cartesian/index.js +1 -1
  7. package/cjs/component/axis/cartesian/index.js.map +1 -1
  8. package/cjs/component/axis/cartesian/interface/spec.d.ts +4 -1
  9. package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
  10. package/cjs/component/axis/cartesian/linear-axis.d.ts +3 -2
  11. package/cjs/component/axis/cartesian/linear-axis.js.map +1 -1
  12. package/cjs/component/axis/cartesian/log-axis.d.ts +15 -0
  13. package/cjs/component/axis/cartesian/log-axis.js +23 -0
  14. package/cjs/component/axis/cartesian/log-axis.js.map +1 -0
  15. package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +2 -0
  16. package/cjs/component/axis/mixin/linear-axis-mixin.js +13 -1
  17. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  18. package/cjs/component/base/util.js +3 -0
  19. package/cjs/component/base/util.js.map +1 -1
  20. package/cjs/component/data-zoom/data-filter-base-component.js +2 -3
  21. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  22. package/cjs/component/data-zoom/data-zoom/data-zoom.js +6 -6
  23. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  24. package/cjs/component/index.d.ts +4 -4
  25. package/cjs/component/index.js +6 -1
  26. package/cjs/component/index.js.map +1 -1
  27. package/cjs/component/interface/type.d.ts +1 -0
  28. package/cjs/component/interface/type.js +12 -12
  29. package/cjs/component/interface/type.js.map +1 -1
  30. package/cjs/core/index.d.ts +1 -1
  31. package/cjs/core/index.js +1 -1
  32. package/cjs/core/index.js.map +1 -1
  33. package/cjs/data/transforms/sankey.js +10 -2
  34. package/cjs/data/transforms/sankey.js.map +1 -1
  35. package/cjs/series/geo/geo.js +2 -1
  36. package/cjs/series/geo/geo.js.map +1 -1
  37. package/cjs/series/map/map.js +2 -2
  38. package/cjs/series/map/map.js.map +1 -1
  39. package/cjs/series/word-cloud/base.d.ts +1 -0
  40. package/cjs/series/word-cloud/base.js +35 -32
  41. package/cjs/series/word-cloud/base.js.map +1 -1
  42. package/cjs/series/word-cloud/word-cloud-3d.js +33 -33
  43. package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
  44. package/cjs/theme/buildin-theme/light/component/axis/log-axis.d.ts +2 -0
  45. package/cjs/theme/buildin-theme/light/component/axis/log-axis.js +22 -0
  46. package/cjs/theme/buildin-theme/light/component/axis/log-axis.js.map +1 -0
  47. package/cjs/vchart-all.js +1 -1
  48. package/cjs/vchart-all.js.map +1 -1
  49. package/esm/chart/waterfall/waterfall.js +1 -0
  50. package/esm/chart/waterfall/waterfall.js.map +1 -1
  51. package/esm/component/axis/cartesian/index.d.ts +1 -0
  52. package/esm/component/axis/cartesian/index.js +2 -0
  53. package/esm/component/axis/cartesian/index.js.map +1 -1
  54. package/esm/component/axis/cartesian/interface/spec.d.ts +4 -1
  55. package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
  56. package/esm/component/axis/cartesian/linear-axis.d.ts +3 -2
  57. package/esm/component/axis/cartesian/linear-axis.js.map +1 -1
  58. package/esm/component/axis/cartesian/log-axis.d.ts +15 -0
  59. package/esm/component/axis/cartesian/log-axis.js +24 -0
  60. package/esm/component/axis/cartesian/log-axis.js.map +1 -0
  61. package/esm/component/axis/mixin/linear-axis-mixin.d.ts +2 -0
  62. package/esm/component/axis/mixin/linear-axis-mixin.js +8 -1
  63. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  64. package/esm/component/base/util.js +3 -0
  65. package/esm/component/base/util.js.map +1 -1
  66. package/esm/component/data-zoom/data-filter-base-component.js +2 -3
  67. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  68. package/esm/component/data-zoom/data-zoom/data-zoom.js +6 -6
  69. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  70. package/esm/component/index.d.ts +4 -4
  71. package/esm/component/index.js +2 -2
  72. package/esm/component/index.js.map +1 -1
  73. package/esm/component/interface/type.d.ts +1 -0
  74. package/esm/component/interface/type.js +12 -12
  75. package/esm/component/interface/type.js.map +1 -1
  76. package/esm/core/index.d.ts +1 -1
  77. package/esm/core/index.js +1 -1
  78. package/esm/core/index.js.map +1 -1
  79. package/esm/data/transforms/sankey.js +10 -2
  80. package/esm/data/transforms/sankey.js.map +1 -1
  81. package/esm/series/geo/geo.js +2 -1
  82. package/esm/series/geo/geo.js.map +1 -1
  83. package/esm/series/map/map.js +2 -2
  84. package/esm/series/map/map.js.map +1 -1
  85. package/esm/series/word-cloud/base.d.ts +1 -0
  86. package/esm/series/word-cloud/base.js +35 -32
  87. package/esm/series/word-cloud/base.js.map +1 -1
  88. package/esm/series/word-cloud/word-cloud-3d.js +33 -33
  89. package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
  90. package/esm/theme/buildin-theme/light/component/axis/log-axis.d.ts +2 -0
  91. package/esm/theme/buildin-theme/light/component/axis/log-axis.js +18 -0
  92. package/esm/theme/buildin-theme/light/component/axis/log-axis.js.map +1 -0
  93. package/esm/vchart-all.js +2 -2
  94. package/esm/vchart-all.js.map +1 -1
  95. package/package.json +3 -3
package/build/index.js CHANGED
@@ -2588,6 +2588,7 @@
2588
2588
  ComponentTypeEnum["cartesianBandAxis"] = "cartesianAxis-band";
2589
2589
  ComponentTypeEnum["cartesianLinearAxis"] = "cartesianAxis-linear";
2590
2590
  ComponentTypeEnum["cartesianTimeAxis"] = "cartesianAxis-time";
2591
+ ComponentTypeEnum["cartesianLogAxis"] = "cartesianAxis-log";
2591
2592
  ComponentTypeEnum["polarAxis"] = "polarAxis";
2592
2593
  ComponentTypeEnum["polarBandAxis"] = "polarAxis-band";
2593
2594
  ComponentTypeEnum["polarLinearAxis"] = "polarAxis-linear";
@@ -17830,11 +17831,13 @@
17830
17831
  return console.error("暂不支持该函数"), nodes;
17831
17832
  }
17832
17833
  insertBefore(newNode, referenceNode) {
17834
+ if (!referenceNode) return this.appendChild(newNode);
17833
17835
  if (this._uid === newNode._uid) return null;
17834
17836
  if (newNode.isAncestorsOf(this)) throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");
17835
17837
  return referenceNode.parent !== this ? null : (newNode.parent && newNode.parent.removeChild(newNode), newNode.parent = this, newNode._prev = referenceNode._prev, referenceNode._prev ? referenceNode._prev._next = newNode : this._firstChild = newNode, referenceNode._prev = newNode, newNode._next = referenceNode, this._idMap || (this._idMap = new Map()), this._idMap.set(newNode._uid, newNode), this._structEdit = !0, this.setCount(newNode.count), newNode);
17836
17838
  }
17837
17839
  insertAfter(newNode, referenceNode) {
17840
+ if (!referenceNode) return this.appendChild(newNode);
17838
17841
  if (this._uid === newNode._uid) return null;
17839
17842
  if (newNode.isAncestorsOf(this)) throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");
17840
17843
  return referenceNode.parent !== this ? null : (newNode.parent && newNode.parent.removeChild(newNode), newNode.parent = this, referenceNode._next ? (referenceNode._next._prev = newNode, newNode._next = referenceNode._next) : this._lastChild = newNode, referenceNode._next = newNode, newNode._prev = referenceNode, this._idMap || (this._idMap = new Map()), this._idMap.set(newNode._uid, newNode), this._structEdit = !0, this.setCount(newNode.count), newNode);
@@ -35659,10 +35662,12 @@
35659
35662
  };
35660
35663
 
35661
35664
  const transform$9 = (options, upstreamData) => {
35665
+ var _a;
35662
35666
  const positiveValues = new Map(),
35663
35667
  negativeValues = new Map(),
35664
35668
  needSum = options.asPercentStack || options.asPrevPercentStack || options.asPercent || options.asSum,
35665
- data = "negative" === options.orient ? upstreamData.slice().reverse() : upstreamData,
35669
+ orient = null !== (_a = options.orient) && void 0 !== _a ? _a : "positive",
35670
+ data = "negative" === orient ? upstreamData.slice().reverse() : upstreamData,
35666
35671
  defaultDimValue = Symbol("dim");
35667
35672
  let stackedValues = data.map(datum => {
35668
35673
  var _a, _b, _c;
@@ -35693,7 +35698,7 @@
35693
35698
  newDatum = Object.assign({}, datum),
35694
35699
  sum = null !== (_a = (value >= 0 ? positiveValues : negativeValues).get(dimension)) && void 0 !== _a ? _a : 0;
35695
35700
  return options.asSum && (newDatum[options.asSum] = sum), options.asPercent && (newDatum[options.asPercent] = 0 === sum ? 0 : value / sum), options.asPercentStack && (newDatum[options.asPercentStack] = 0 === sum ? 0 : stack / sum), options.asPrevPercentStack && (newDatum[options.asPrevPercentStack] = 0 === sum ? 0 : prevStack / sum), options.asPrevStack && (newDatum[options.asPrevStack] = prevStack), newDatum[null !== (_b = options.asStack) && void 0 !== _b ? _b : options.stackField] = stack, newDatum;
35696
- })), "negative" === options.orient ? stackedValues.reverse() : stackedValues;
35701
+ })), "negative" === orient ? stackedValues.reverse() : stackedValues;
35697
35702
  };
35698
35703
 
35699
35704
  const transform$8 = (options, upstreamData) => {
@@ -36164,9 +36169,9 @@
36164
36169
  }
36165
36170
  }],
36166
36171
  [GrammarMarkType.area]: [{
36167
- channels: ["x", "y", "x1", "y1", "width", "height"],
36172
+ channels: ["x", "y", "x1", "y1"],
36168
36173
  transform: (graphicAttributes, nextAttrs, storedAttrs) => {
36169
- graphicAttributes.x = 0, graphicAttributes.y = 0;
36174
+ graphicAttributes.x = 0, graphicAttributes.y = 0, graphicAttributes.x1 = 0, graphicAttributes.y1 = 0;
36170
36175
  }
36171
36176
  }],
36172
36177
  [GrammarMarkType.line]: [{
@@ -37996,7 +38001,7 @@
37996
38001
  y: y
37997
38002
  }
37998
38003
  };
37999
- return isValidNumber(min) && (animateAttributes.to.min = center, animateAttributes.from.min = min), isValidNumber(max) && (animateAttributes.to.max = center, animateAttributes.from.max = max), isValidNumber(q1) && (animateAttributes.to.q1 = center, animateAttributes.from.q1 = q1), isValidNumber(q3) && (animateAttributes.to.q3 = center, animateAttributes.from.q3 = q3), isValidNumber(median) && (animateAttributes.to.median = center, animateAttributes.from.median = q3), animateAttributes;
38004
+ return isValidNumber(min) && (animateAttributes.to.min = center, animateAttributes.from.min = min), isValidNumber(max) && (animateAttributes.to.max = center, animateAttributes.from.max = max), isValidNumber(q1) && (animateAttributes.to.q1 = center, animateAttributes.from.q1 = q1), isValidNumber(q3) && (animateAttributes.to.q3 = center, animateAttributes.from.q3 = q3), isValidNumber(median) && (animateAttributes.to.median = center, animateAttributes.from.median = median), animateAttributes;
38000
38005
  },
38001
38006
  computeBoxplotCenter = (glyphElement, direction, options) => {
38002
38007
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -38082,6 +38087,8 @@
38082
38087
  x1: x + width / 2
38083
38088
  }))), attributes;
38084
38089
  };
38090
+ const boxplotScaleIn = scaleIn(computeBoxplotCenter);
38091
+ const boxplotScaleOut = scaleOut(computeBoxplotCenter);
38085
38092
  function registerBoxplotGlyph() {
38086
38093
  registerGlyph("boxplot", {
38087
38094
  shaft: "rule",
@@ -38199,7 +38206,7 @@
38199
38206
  median: {
38200
38207
  visible: !1
38201
38208
  }
38202
- })), registerAnimationType("boxplotScaleIn", scaleIn(computeBoxplotCenter)), registerAnimationType("boxplotScaleOut", scaleOut(computeBoxplotCenter));
38209
+ })), registerAnimationType("boxplotScaleIn", boxplotScaleIn), registerAnimationType("boxplotScaleOut", boxplotScaleOut);
38203
38210
  }
38204
38211
  const computeBarBoxplotCenter = (glyphElement, direction, options) => {
38205
38212
  var _a, _b, _c, _d;
@@ -38277,6 +38284,8 @@
38277
38284
  x1: x + width / 2
38278
38285
  }))), attributes;
38279
38286
  };
38287
+ const barBoxplotScaleIn = scaleIn(computeBarBoxplotCenter);
38288
+ const barBoxplotScaleOut = scaleOut(computeBarBoxplotCenter);
38280
38289
  function registerBarBoxplotGlyph() {
38281
38290
  registerGlyph("barBoxplot", {
38282
38291
  minMaxBox: "rect",
@@ -38371,7 +38380,7 @@
38371
38380
  median: {
38372
38381
  visible: !1
38373
38382
  }
38374
- })), registerAnimationType("barBoxplotScaleIn", scaleIn(computeBarBoxplotCenter)), registerAnimationType("barBoxplotScaleOut", scaleOut(computeBarBoxplotCenter));
38383
+ })), registerAnimationType("barBoxplotScaleIn", barBoxplotScaleIn), registerAnimationType("barBoxplotScaleOut", barBoxplotScaleOut);
38375
38384
  }
38376
38385
 
38377
38386
  const getHorizontalPath = (options, ratio) => {
@@ -38622,7 +38631,7 @@
38622
38631
  Object.keys(from).forEach(channel => {
38623
38632
  isNil(from[channel]) && delete from[channel];
38624
38633
  });
38625
- const computePoints = isValidPointsChannel(Object.keys(from), element.mark.markType);
38634
+ const computePoints = isValidPointsChannel(Object.keys(from), element.mark.markType) && !isValid(from.segments);
38626
38635
  if (computePoints) {
38627
38636
  const items = element.items.map(item => Object.assign({}, item, {
38628
38637
  nextAttrs: from
@@ -38635,7 +38644,7 @@
38635
38644
  Object.keys(to).forEach(channel => {
38636
38645
  isNil(to[channel]) && delete to[channel];
38637
38646
  });
38638
- const computePoints = isValidPointsChannel(Object.keys(to), element.mark.markType);
38647
+ const computePoints = isValidPointsChannel(Object.keys(to), element.mark.markType) && !isValid(to.segments);
38639
38648
  if (computePoints) {
38640
38649
  const items = element.items.map(item => Object.assign({}, item, {
38641
38650
  nextAttrs: to
@@ -39445,10 +39454,11 @@
39445
39454
  });
39446
39455
  }
39447
39456
  encodeCustom(nextAttrs) {
39457
+ var _a;
39448
39458
  let customEncodeValues = {};
39449
39459
  const channelEncoder = this.glyphMeta.getChannelEncoder(),
39450
39460
  functionEncoder = this.glyphMeta.getFunctionEncoder();
39451
- if (functionEncoder && (customEncodeValues = functionEncoder.call(null, nextAttrs, this.getDatum(), this, this.mark.getGlyphConfig())), channelEncoder) {
39461
+ if (functionEncoder && (customEncodeValues = functionEncoder.call(null, Object.assign({}, null === (_a = this.graphicItem) || void 0 === _a ? void 0 : _a.attribute, nextAttrs), this.getDatum(), this, this.mark.getGlyphConfig())), channelEncoder) {
39452
39462
  let allAttrs;
39453
39463
  Object.keys(channelEncoder).forEach(channel => {
39454
39464
  var _a;
@@ -39834,7 +39844,7 @@
39834
39844
  }
39835
39845
  getScalesByChannel() {
39836
39846
  const encoders = this.spec.encode;
39837
- if (!encoders) return;
39847
+ if (!encoders) return {};
39838
39848
  const res = {},
39839
39849
  params = this.parameters();
39840
39850
  return Object.keys(encoders).forEach(state => {
@@ -40575,8 +40585,7 @@
40575
40585
  maxWidth: maxWidth,
40576
40586
  padding = 4,
40577
40587
  visible: visible,
40578
- state: state,
40579
- formatMethod: formatMethod
40588
+ state: state
40580
40589
  } = this.attribute,
40581
40590
  parsedPadding = normalizePadding$1(padding),
40582
40591
  group = this.createOrUpdateChild("tag-content", {
@@ -40608,7 +40617,7 @@
40608
40617
  }
40609
40618
  tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
40610
40619
  const textAttrs = Object.assign(Object.assign({
40611
- text: formatMethod ? formatMethod(text) : text,
40620
+ text: text,
40612
40621
  visible: isValid(text) && !1 !== visible,
40613
40622
  lineHeight: null == textStyle ? void 0 : textStyle.fontSize
40614
40623
  }, textStyle), {
@@ -41415,6 +41424,24 @@
41415
41424
  function defaultLabelPosition(type) {
41416
41425
  return "rect" === type ? DefaultRectPositions : DefaultPositions;
41417
41426
  }
41427
+ function clampText(text, width, height) {
41428
+ const {
41429
+ x1: x1,
41430
+ x2: x2,
41431
+ y1: y1,
41432
+ y2: y2
41433
+ } = text.AABBBounds,
41434
+ minX = Math.min(x1, x2),
41435
+ maxX = Math.max(x1, x2),
41436
+ minY = Math.min(y1, y2),
41437
+ maxY = Math.max(y1, y2);
41438
+ let dx = 0,
41439
+ dy = 0;
41440
+ return minX < 0 && maxX - minX <= width ? dx = -minX : maxX > width && minX - (maxX - width) >= 0 && (dx = width - maxX), minY < 0 && maxY - minY <= height ? dy = -minY : maxY > height && minY - (maxY - height) >= 0 && (dy = height - maxY), {
41441
+ dx: dx,
41442
+ dy: dy
41443
+ };
41444
+ }
41418
41445
 
41419
41446
  const fadeIn = function () {
41420
41447
  let textAttribute = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -41493,9 +41520,17 @@
41493
41520
  this._bmpTool = bmpTool;
41494
41521
  }
41495
41522
  render() {
41496
- const currentBaseMarks = this._checkMarks(),
41497
- labels = this.layout(currentBaseMarks);
41498
- this._smartInvert(labels), this._renderLabels(labels);
41523
+ this._prepare();
41524
+ const {
41525
+ overlap: overlap,
41526
+ smartInvert: smartInvert,
41527
+ dataFilter: dataFilter,
41528
+ customLayoutFunc: customLayoutFunc,
41529
+ customOverlapFunc: customOverlapFunc
41530
+ } = this.attribute;
41531
+ let labels,
41532
+ data = this.attribute.data;
41533
+ isFunction(dataFilter) && (data = dataFilter(data)), isFunction(customLayoutFunc) ? labels = customLayoutFunc(data, d => this._idToGraphic.get(d.id)) : (labels = this.layout(data), isFunction(customOverlapFunc) ? labels = customOverlapFunc(labels, d => this._idToGraphic.get(d.id)) : !1 !== overlap && (labels = this._overlapping(labels))), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels);
41499
41534
  }
41500
41535
  _bindEvent(target) {
41501
41536
  if (!target) return;
@@ -41514,52 +41549,53 @@
41514
41549
  const text = createText(attributes);
41515
41550
  return this._bindEvent(text), this._setStates(text), text;
41516
41551
  }
41517
- _checkMarks() {
41552
+ _prepare() {
41518
41553
  var _a;
41519
41554
  const baseMarks = this.getBaseMarks(),
41520
41555
  currentBaseMarks = [];
41521
- return baseMarks.forEach(mark => {
41556
+ if (baseMarks.forEach(mark => {
41522
41557
  "willRelease" !== mark.releaseStatus && currentBaseMarks.push(mark);
41523
- }), this._prevRelationMap = new Map(this._relationMap), null === (_a = this._relationMap) || void 0 === _a || _a.clear(), currentBaseMarks;
41524
- }
41525
- layout(currentMarks) {
41558
+ }), null === (_a = this._idToGraphic) || void 0 === _a || _a.clear(), this._baseMarks = currentBaseMarks, !currentBaseMarks || 0 === currentBaseMarks.length) return;
41526
41559
  const {
41527
- textStyle: textStyle,
41528
- position: position,
41529
- offset: offset
41530
- } = this.attribute;
41531
- let {
41532
41560
  data: data
41533
41561
  } = this.attribute;
41534
- if (isFunction(data) && (data = data({})), !data || 0 === data.length) return [];
41535
- let labels = [];
41536
- isFunction(this.attribute.sort) && currentMarks && currentMarks.length && (currentMarks = currentMarks.sort(this.attribute.sort)), this._relationMap || (this._relationMap = new Map());
41562
+ if (data && 0 !== data.length) {
41563
+ this._idToGraphic || (this._idToGraphic = new Map());
41564
+ for (let i = 0; i < currentBaseMarks.length; i++) {
41565
+ const textData = data[i],
41566
+ baseMark = currentBaseMarks[i];
41567
+ textData && baseMark && (isValid(textData.id) || (textData.id = `vrender-component-${this.name}-${i}`), this._idToGraphic.set(textData.id, baseMark));
41568
+ }
41569
+ }
41570
+ }
41571
+ layout() {
41572
+ let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
41573
+ const {
41574
+ textStyle = {},
41575
+ position: position,
41576
+ offset: offset
41577
+ } = this.attribute,
41578
+ labels = [];
41537
41579
  for (let i = 0; i < data.length; i++) {
41538
41580
  const textData = data[i],
41539
- baseMark = null == currentMarks ? void 0 : currentMarks[i],
41540
- labelAttribute = Object.assign(Object.assign(Object.assign({}, textStyle), textData), {
41541
- _relatedIndex: i
41542
- });
41543
- if (this._relationMap.set(i, baseMark), textData) {
41544
- const text = createText(labelAttribute);
41545
- text.update();
41546
- const textBounds = this.getGraphicBounds(text),
41547
- graphicBounds = this.getGraphicBounds(baseMark, {
41548
- x: textData.x,
41549
- y: textData.y
41550
- }),
41551
- textAttributes = this.labeling(textBounds, graphicBounds, isFunction(position) ? position(textData) : position, offset);
41552
- if (!textAttributes) continue;
41553
- labelAttribute.x = textAttributes.x, labelAttribute.y = textAttributes.y, labels.push(labelAttribute);
41554
- }
41581
+ baseMark = this._idToGraphic.get(textData.id),
41582
+ labelAttribute = Object.assign(Object.assign({}, textStyle), textData),
41583
+ text = this._createLabelText(labelAttribute),
41584
+ textBounds = this.getGraphicBounds(text),
41585
+ graphicBounds = this.getGraphicBounds(baseMark, {
41586
+ x: textData.x,
41587
+ y: textData.y
41588
+ }),
41589
+ textLocation = this.labeling(textBounds, graphicBounds, isFunction(position) ? position(textData) : position, offset);
41590
+ textLocation && (labelAttribute.x = textLocation.x, labelAttribute.y = textLocation.y, text.setAttributes(textLocation), labels.push(text));
41555
41591
  }
41556
- return this._baseMarks = currentMarks, !1 !== this.attribute.overlap && (labels = this.overlapping(labels, this.attribute.overlap)), labels;
41592
+ return labels;
41557
41593
  }
41558
- overlapping(labels) {
41559
- let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
41560
- var _a, _b, _c, _d, _e;
41594
+ _overlapping(labels) {
41595
+ var _a, _b, _c, _d;
41561
41596
  if (0 === labels.length) return [];
41562
- const result = [],
41597
+ const option = this.attribute.overlap,
41598
+ result = [],
41563
41599
  baseMarkGroup = this.getBaseMarkGroup(),
41564
41600
  size = null !== (_a = option.size) && void 0 !== _a ? _a : {
41565
41601
  width: null !== (_b = null == baseMarkGroup ? void 0 : baseMarkGroup.AABBBounds.width()) && void 0 !== _b ? _b : 0,
@@ -41580,27 +41616,45 @@
41580
41616
  }));
41581
41617
  for (let i = 0; i < labels.length; i++) {
41582
41618
  if (!1 === labels[i].visible) continue;
41583
- const text = createText(labels[i]),
41584
- baseMark = null === (_e = this._baseMarks) || void 0 === _e ? void 0 : _e[i];
41619
+ const text = labels[i],
41620
+ baseMark = this._idToGraphic.get(text.attribute.id);
41585
41621
  if (text.update(), canPlace(bmpTool, bitmap, text.AABBBounds, clampForce)) {
41586
41622
  if (!checkBounds) {
41587
- bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(Object.assign({}, text.attribute));
41623
+ bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
41588
41624
  continue;
41589
41625
  }
41590
41626
  if (checkBounds && (null == baseMark ? void 0 : baseMark.AABBBounds) && canPlaceInside(text.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds)) {
41591
- bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(Object.assign({}, text.attribute));
41627
+ bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
41592
41628
  continue;
41593
41629
  }
41594
41630
  }
41595
41631
  let hasPlace = !1;
41596
41632
  for (let j = 0; j < strategy.length; j++) if (hasPlace = place$2(bmpTool, bitmap, strategy[j], this.attribute, text, this.getGraphicBounds(baseMark, labels[i]), this.labeling), !1 !== hasPlace) {
41597
- result.push(Object.assign(Object.assign({}, text.attribute), {
41633
+ text.setAttributes({
41598
41634
  x: hasPlace.x,
41599
41635
  y: hasPlace.y
41600
- }));
41636
+ }), result.push(text);
41601
41637
  break;
41602
41638
  }
41603
- !hasPlace && !hideOnHit && result.push(Object.assign({}, text.attribute));
41639
+ if (clampForce) {
41640
+ const {
41641
+ dx = 0,
41642
+ dy = 0
41643
+ } = clampText(text, bmpTool.width, bmpTool.height);
41644
+ if ((0 !== dx || 0 !== dy) && canPlace(bmpTool, bitmap, {
41645
+ x1: text.AABBBounds.x1 + dx,
41646
+ x2: text.AABBBounds.x2 + dx,
41647
+ y1: text.AABBBounds.y1 + dy,
41648
+ y2: text.AABBBounds.y2 + dy
41649
+ })) {
41650
+ text.setAttributes({
41651
+ x: text.attribute.x + dx,
41652
+ y: text.attribute.y + dy
41653
+ }), bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
41654
+ continue;
41655
+ }
41656
+ }
41657
+ !hasPlace && !hideOnHit && result.push(text);
41604
41658
  }
41605
41659
  return isFunction(this.onAfterLabelOverlap) && this.onAfterLabelOverlap(bitmap), result;
41606
41660
  }
@@ -41632,17 +41686,16 @@
41632
41686
  easing = null !== (_d = animationConfig.easing) && void 0 !== _d ? _d : DefaultLabelAnimation.easing,
41633
41687
  delay = null !== (_e = animationConfig.delay) && void 0 !== _e ? _e : 0,
41634
41688
  currentTextMap = new Map(),
41635
- prevTextMap = this._textMap || new Map(),
41689
+ prevTextMap = this._graphicToText || new Map(),
41636
41690
  texts = [];
41637
- labels.forEach((label, index) => {
41638
- const text = this._createLabelText(label),
41639
- relatedGraphic = this._relationMap.get(label._relatedIndex),
41691
+ labels.forEach((text, index) => {
41692
+ const relatedGraphic = this._idToGraphic.get(text.attribute.id),
41640
41693
  state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter";
41641
41694
  if ("enter" === state) if (texts.push(text), currentTextMap.set(relatedGraphic, text), !disableAnimation && relatedGraphic) {
41642
41695
  const {
41643
41696
  from: from,
41644
41697
  to: to
41645
- } = getAnimationAttributes(label, "fadeIn");
41698
+ } = getAnimationAttributes(text.attribute, "fadeIn");
41646
41699
  this.add(text), relatedGraphic.onAnimateBind = () => {
41647
41700
  text.setAttributes(from);
41648
41701
  const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, {
@@ -41667,7 +41720,7 @@
41667
41720
  disableAnimation ? this.removeChild(label) : null == label || label.animate().to(getAnimationAttributes(label.attribute, "fadeOut").to, duration, easing).onEnd(() => {
41668
41721
  this.removeChild(label);
41669
41722
  });
41670
- }), this._textMap = currentTextMap;
41723
+ }), this._graphicToText = currentTextMap;
41671
41724
  }
41672
41725
  _afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, _ref) {
41673
41726
  let {
@@ -41710,21 +41763,32 @@
41710
41763
  return listener;
41711
41764
  }
41712
41765
  _smartInvert(labels) {
41713
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
41714
- if (!1 !== this.attribute.smartInvert) for (let i = 0; i < labels.length; i++) {
41715
- const label = null == labels ? void 0 : labels[i];
41766
+ const option = this.attribute.smartInvert || {},
41767
+ {
41768
+ textType: textType,
41769
+ contrastRatiosThreshold: contrastRatiosThreshold,
41770
+ alternativeColors: alternativeColors
41771
+ } = option;
41772
+ for (let i = 0; i < labels.length; i++) {
41773
+ const label = labels[i];
41716
41774
  if (!label) continue;
41717
- const isInside = canPlaceInside(createText(label).AABBBounds, null === (_a = this._relationMap.get(label._relatedIndex)) || void 0 === _a ? void 0 : _a.AABBBounds);
41718
- if (label.stroke && label.lineWidth > 0) label.fill = labelSmartInvert(label.fill, label.stroke, null === (_b = this.attribute.smartInvert) || void 0 === _b ? void 0 : _b.textType, null === (_c = this.attribute.smartInvert) || void 0 === _c ? void 0 : _c.contrastRatiosThreshold, null === (_d = this.attribute.smartInvert) || void 0 === _d ? void 0 : _d.alternativeColors);else if (isInside) {
41719
- const backgroundColor = this._relationMap.get(label._relatedIndex).attribute.fill,
41720
- foregroundColor = label.fill;
41721
- label.fill = labelSmartInvert(foregroundColor, backgroundColor, null === (_e = this.attribute.smartInvert) || void 0 === _e ? void 0 : _e.textType, null === (_f = this.attribute.smartInvert) || void 0 === _f ? void 0 : _f.contrastRatiosThreshold, null === (_g = this.attribute.smartInvert) || void 0 === _g ? void 0 : _g.alternativeColors);
41722
- } else if (label.lineWidth > 0) {
41723
- const baseMark = this._relationMap.get(label._relatedIndex);
41724
- label.stroke = baseMark.attribute.fill;
41725
- const backgroundColor = label.stroke,
41726
- foregroundColor = label.fill;
41727
- label.fill = labelSmartInvert(foregroundColor, backgroundColor, null === (_h = this.attribute.smartInvert) || void 0 === _h ? void 0 : _h.textType, null === (_j = this.attribute.smartInvert) || void 0 === _j ? void 0 : _j.contrastRatiosThreshold, null === (_k = this.attribute.smartInvert) || void 0 === _k ? void 0 : _k.alternativeColors);
41775
+ const baseMark = this._idToGraphic.get(label.attribute.id),
41776
+ isInside = canPlaceInside(label.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds);
41777
+ if (label.attribute.stroke && label.attribute.lineWidth > 0) label.setAttributes({
41778
+ fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors)
41779
+ });else if (isInside) {
41780
+ const backgroundColor = baseMark.attribute.fill,
41781
+ foregroundColor = label.attribute.fill;
41782
+ label.setAttributes({
41783
+ fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)
41784
+ });
41785
+ } else if (label.attribute.lineWidth > 0) {
41786
+ const backgroundColor = label.attribute.stroke,
41787
+ foregroundColor = label.attribute.fill;
41788
+ label.setAttributes({
41789
+ stroke: baseMark.attribute.fill,
41790
+ fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)
41791
+ });
41728
41792
  }
41729
41793
  }
41730
41794
  }
@@ -42107,6 +42171,9 @@
42107
42171
  line.name = "line", line.id = this._getNodeId("line"), isEmpty(null == state ? void 0 : state.line) || (line.states = state.line), this.line = line, this.add(line);
42108
42172
  }
42109
42173
  renderSymbol(attribute, dim) {
42174
+ const {
42175
+ autoRotate = !0
42176
+ } = attribute;
42110
42177
  let symbol;
42111
42178
  if (null == attribute ? void 0 : attribute.visible) {
42112
42179
  const startAngle = this._startAngle,
@@ -42135,7 +42202,7 @@
42135
42202
  }, rotate = endAngle + Math.PI / 2), symbol = createSymbol(Object.assign(Object.assign(Object.assign({}, position), {
42136
42203
  symbolType: symbolType,
42137
42204
  size: size,
42138
- angle: rotate + refAngle,
42205
+ angle: autoRotate ? rotate + refAngle : 0,
42139
42206
  strokeBoundsBuffer: 0
42140
42207
  }), style)), symbol.name = `${dim}-symbol`, symbol.id = this._getNodeId(`${dim}-symbol`), isEmpty(null == state ? void 0 : state.symbol) || (symbol.states = state.symbol), this.add(symbol);
42141
42208
  }
@@ -42156,6 +42223,7 @@
42156
42223
  },
42157
42224
  startSymbol: {
42158
42225
  visible: !1,
42226
+ autoRotate: !0,
42159
42227
  symbolType: "triangle",
42160
42228
  size: 12,
42161
42229
  refX: 0,
@@ -42168,6 +42236,7 @@
42168
42236
  },
42169
42237
  endSymbol: {
42170
42238
  visible: !1,
42239
+ autoRotate: !0,
42171
42240
  symbolType: "triangle",
42172
42241
  size: 12,
42173
42242
  refX: 0,
@@ -47840,7 +47909,7 @@
47840
47909
  super(view, ComponentEnum.axis, group), this.spec.componentType = ComponentEnum.axis, this.spec.axisType = "line", this.mode = mode;
47841
47910
  }
47842
47911
  parseAddition(spec) {
47843
- return super.parseAddition(spec), this.tickCount(spec.tickCount), this.inside(spec.inside), this.baseValue(spec.baseValue), this;
47912
+ return super.parseAddition(spec), this.axisType(spec.axisType), this.tickCount(spec.tickCount), this.inside(spec.inside), this.baseValue(spec.baseValue), this;
47844
47913
  }
47845
47914
  axisType(axisType) {
47846
47915
  return this.spec.axisType = axisType, this._axisComponentType = null, this._prepareRejoin(), this.commit(), this;
@@ -58170,7 +58239,7 @@
58170
58239
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
58171
58240
  Factory.registerRegion('region', Region);
58172
58241
  Factory.registerLayout('base', Layout);
58173
- const version = "1.2.0-beta.3";
58242
+ const version = "1.2.0-beta.4";
58174
58243
  Logger.getInstance(LoggerLevel.Error);
58175
58244
 
58176
58245
  var SeriesMarkNameEnum;
@@ -65118,7 +65187,7 @@
65118
65187
  coordinate = 'geo';
65119
65188
  _mapViewData;
65120
65189
  getMapViewData() {
65121
- return this._mapViewData.getDataView();
65190
+ return this._mapViewData?.getDataView();
65122
65191
  }
65123
65192
  _mapViewDataStatistics;
65124
65193
  _nameField;
@@ -65471,7 +65540,9 @@
65471
65540
  spec?.nameMap !== nameMap ||
65472
65541
  spec?.valueField !== valueField ||
65473
65542
  spec?.nameProperty !== nameProperty) {
65543
+ result.change = true;
65474
65544
  result.reRender = true;
65545
+ result.reMake = true;
65475
65546
  }
65476
65547
  return result;
65477
65548
  }
@@ -69007,7 +69078,7 @@
69007
69078
  for (this.data = data; i < n;) {
69008
69079
  if (this.layoutWord(i) && i++, this.progressiveIndex = i, this.exceedTime()) break;
69009
69080
  }
69010
- if (!this.options.clip && this.options.enlarge && this.shrinkBoard(this._bounds), ["cardioid", "triangle", "triangle-upright"].includes(this.options.shape)) {
69081
+ if (!this.options.clip && this.options.enlarge && this._bounds && this.shrinkBoard(this._bounds), this._bounds && ["cardioid", "triangle", "triangle-upright"].includes(this.options.shape)) {
69011
69082
  const currentCenterY = (this._bounds[0].y + this._bounds[1].y) / 2;
69012
69083
  this._dy = -(currentCenterY - this._size[1] / 2);
69013
69084
  }
@@ -69532,8 +69603,9 @@
69532
69603
  var _a, _b, _c, _d, _e, _f, _g;
69533
69604
  if (options.size && (!options.size[0] || !options.size[1])) return upstreamData;
69534
69605
  const data = upstreamData,
69535
- canvasSize = null !== (_a = options.size) && void 0 !== _a ? _a : [500, 500],
69536
- fontFamily = options.fontFamily ? field$1(options.fontFamily) : "sans-serif",
69606
+ canvasSize = (null !== (_a = options.size) && void 0 !== _a ? _a : [500, 500]).slice();
69607
+ canvasSize[0] = Math.floor(canvasSize[0]), canvasSize[1] = Math.floor(canvasSize[1]);
69608
+ const fontFamily = options.fontFamily ? field$1(options.fontFamily) : "sans-serif",
69537
69609
  fontStyle = options.fontStyle ? field$1(options.fontStyle) : "normal",
69538
69610
  fontWeight = options.fontWeight ? field$1(options.fontWeight) : "normal",
69539
69611
  rotate = options.rotate ? field$1(options.rotate) : 0,
@@ -70879,15 +70951,11 @@
70879
70951
  });
70880
70952
  }
70881
70953
  const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;
70882
- const srView = this.getCompiler().getVGrammarView();
70883
70954
  if (!this._isWordCloudShape) {
70884
70955
  wordCloudTransforms.push({
70885
70956
  type: 'wordcloud',
70886
70957
  layoutType: !isTrueBrowser(this._option.mode) ? 'fast' : this._wordCloudConfig.layoutMode,
70887
- size: [
70888
- srView.width() - this._padding?.left || 0 - this._padding?.right || 0,
70889
- srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0
70890
- ],
70958
+ size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
70891
70959
  shape: this._maskShape,
70892
70960
  dataIndexKey: DEFAULT_DATA_KEY,
70893
70961
  text: { field: textField },
@@ -70912,7 +70980,7 @@
70912
70980
  wordCloudTransforms.push({
70913
70981
  type: 'wordcloudShape',
70914
70982
  dataIndexKey: DEFAULT_DATA_KEY,
70915
- size: [srView.width(), srView.height()],
70983
+ size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
70916
70984
  shape: this._maskShape,
70917
70985
  text: { field: this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField },
70918
70986
  fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],
@@ -70987,6 +71055,10 @@
70987
71055
  }
70988
71056
  setValueFieldToPercent() {
70989
71057
  }
71058
+ onLayoutEnd(ctx) {
71059
+ super.onLayoutEnd(ctx);
71060
+ this.compile();
71061
+ }
70990
71062
  updateSpec(spec) {
70991
71063
  const originalSpec = this._originalSpec;
70992
71064
  const result = super.updateSpec(spec);
@@ -71052,15 +71124,11 @@
71052
71124
  });
71053
71125
  }
71054
71126
  const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;
71055
- const srView = this.getCompiler().getVGrammarView();
71056
71127
  if (!this._isWordCloudShape) {
71057
71128
  wordCloudTransforms.push({
71058
71129
  type: 'wordcloud',
71059
71130
  layoutType: this._wordCloudConfig.layoutMode,
71060
- size: [
71061
- srView.width() - this._padding?.left || 0 - this._padding?.right || 0,
71062
- srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0
71063
- ],
71131
+ size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
71064
71132
  shape: this._maskShape,
71065
71133
  postProjection: this._spec.postProjection ?? 'StereographicProjection',
71066
71134
  dataIndexKey: DEFAULT_DATA_KEY,
@@ -71086,7 +71154,7 @@
71086
71154
  else {
71087
71155
  wordCloudTransforms.push({
71088
71156
  type: 'wordcloudShape',
71089
- size: [srView.width(), srView.height()],
71157
+ size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
71090
71158
  shape: this._maskShape,
71091
71159
  postProjection: this._spec.postProjection ?? 'StereographicProjection',
71092
71160
  dataIndexKey: DEFAULT_DATA_KEY,
@@ -74006,11 +74074,25 @@
74006
74074
  view.y1 - view.y0 === Infinity) {
74007
74075
  return data;
74008
74076
  }
74009
- if (data[0]?.latestData) {
74010
- data = data[0].latestData[0];
74077
+ if (data.length > 1) {
74078
+ const updateData = {
74079
+ links: [],
74080
+ nodes: []
74081
+ };
74082
+ data.forEach((datum) => {
74083
+ if (datum.id === 'links' || datum.id === 'nodes') {
74084
+ updateData[datum.id] = datum.values;
74085
+ }
74086
+ });
74087
+ data = updateData;
74011
74088
  }
74012
74089
  else {
74013
- data = data[0];
74090
+ if (data[0]?.latestData) {
74091
+ data = data[0].latestData[0];
74092
+ }
74093
+ else {
74094
+ data = data[0];
74095
+ }
74014
74096
  }
74015
74097
  if (op.sourceField !== 'source' || op.targetField !== 'target') {
74016
74098
  for (const key in data) {
@@ -77400,6 +77482,7 @@
77400
77482
  _getDefaultSeriesSpec(spec) {
77401
77483
  return {
77402
77484
  ...super._getDefaultSeriesSpec(spec),
77485
+ bar: spec.bar,
77403
77486
  stackLabel: spec.stackLabel,
77404
77487
  leaderLine: spec.leaderLine,
77405
77488
  total: spec.total
@@ -77595,6 +77678,8 @@
77595
77678
  return getCartesianAxisTheme(getOrient(componentSpec), 'band', theme);
77596
77679
  case ComponentTypeEnum.cartesianLinearAxis:
77597
77680
  return getCartesianAxisTheme(getOrient(componentSpec), 'linear', theme);
77681
+ case ComponentTypeEnum.cartesianLogAxis:
77682
+ return getCartesianAxisTheme(getOrient(componentSpec), 'log', theme);
77598
77683
  case ComponentTypeEnum.cartesianAxis:
77599
77684
  case ComponentTypeEnum.cartesianTimeAxis:
77600
77685
  return getCartesianAxisTheme(getOrient(componentSpec), undefined, theme);
@@ -78147,9 +78232,6 @@
78147
78232
  return allDomain.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) + 1);
78148
78233
  }
78149
78234
  _handleStateChange = (startValue, endValue) => {
78150
- if (startValue === this._startValue && endValue === this._endValue) {
78151
- return false;
78152
- }
78153
78235
  this._startValue = startValue;
78154
78236
  this._endValue = endValue;
78155
78237
  this._newDomain = this._parseDomainFromState(this._startValue, this._endValue);
@@ -78396,12 +78478,12 @@
78396
78478
  this._middleHandlerSize = this._computeMiddleHandlerSize();
78397
78479
  this._width = this._computeWidth();
78398
78480
  this._height = this._computeHeight();
78399
- if (this._originalSpec.startHandler?.style?.size ?? true) {
78481
+ if (isNil(this._originalSpec?.startHandler?.style?.size)) {
78400
78482
  this._spec.startHandler.style.size = this._isHorizontal
78401
78483
  ? this._height - this._middleHandlerSize
78402
78484
  : this._width - this._middleHandlerSize;
78403
78485
  }
78404
- if (this._originalSpec.endHandler?.style?.size ?? true) {
78486
+ if (isNil(this._originalSpec?.startHandler?.style?.size)) {
78405
78487
  this._spec.endHandler.style.size = this._isHorizontal
78406
78488
  ? this._height - this._middleHandlerSize
78407
78489
  : this._width - this._middleHandlerSize;
@@ -78484,7 +78566,8 @@
78484
78566
  const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
78485
78567
  const offsetHandler = this._isHorizontal ? this._startHandlerSize / 2 : 0;
78486
78568
  const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
78487
- return xScale.scale(datum[this._stateField]) + this.getLayoutStartPoint().x + offsetLeft + offsetHandler;
78569
+ const xField = this._isHorizontal ? this._stateField : this._valueField;
78570
+ return xScale.scale(datum[xField]) + this.getLayoutStartPoint().x + offsetLeft + offsetHandler;
78488
78571
  };
78489
78572
  _dataToPositionX2 = (datum) => {
78490
78573
  const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
@@ -78497,7 +78580,8 @@
78497
78580
  const offsetTop = this._isHorizontal ? this._middleHandlerSize : 0;
78498
78581
  const offsetHandler = this._isHorizontal ? 0 : this._startHandlerSize / 2;
78499
78582
  const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
78500
- return yScale.scale(datum[this._valueField]) + this.getLayoutStartPoint().y + offsetTop + offsetHandler;
78583
+ const yField = this._isHorizontal ? this._valueField : this._stateField;
78584
+ return yScale.scale(datum[yField]) + this.getLayoutStartPoint().y + offsetTop + offsetHandler;
78501
78585
  };
78502
78586
  _dataToPositionY2 = (datum) => {
78503
78587
  const offsetTop = this._isHorizontal ? this._middleHandlerSize : 0;
@@ -81254,7 +81338,7 @@
81254
81338
  transformScaleDomain() {
81255
81339
  this.setScaleNice();
81256
81340
  }
81257
- setScaleNice() {
81341
+ setLinearScaleNice() {
81258
81342
  let tickCount = this._spec.tick?.forceTickCount ?? this._spec.tick?.tickCount ?? 10;
81259
81343
  if (this._spec.niceType === 'accurateFirst') {
81260
81344
  tickCount = Math.max(10, tickCount);
@@ -81269,6 +81353,25 @@
81269
81353
  this._nice && this._scale.niceMin(tickCount);
81270
81354
  }
81271
81355
  }
81356
+ setLogScaleNice() {
81357
+ if (isNil(this._domain?.min) && isNil(this._domain?.max)) {
81358
+ this._nice && this._scale.nice();
81359
+ }
81360
+ else if (isValid(this._domain?.min) && isNil(this._domain?.max)) {
81361
+ this._nice && this._scale.niceMax();
81362
+ }
81363
+ else if (isNil(this._domain?.min) && isValid(this._domain?.max)) {
81364
+ this._nice && this._scale.niceMin();
81365
+ }
81366
+ }
81367
+ setScaleNice() {
81368
+ if (this._spec.type === 'log') {
81369
+ this.setLogScaleNice();
81370
+ }
81371
+ else {
81372
+ this.setLinearScaleNice();
81373
+ }
81374
+ }
81272
81375
  dataToPosition(values, cfg) {
81273
81376
  return this.valueToPosition(values[0]);
81274
81377
  }
@@ -81692,6 +81795,20 @@
81692
81795
  }
81693
81796
  }
81694
81797
 
81798
+ class CartesianLogAxis extends CartesianLinearAxis {
81799
+ static type = ComponentTypeEnum.cartesianLogAxis;
81800
+ type = ComponentTypeEnum.cartesianLogAxis;
81801
+ _zero = false;
81802
+ _scale = new LogScale();
81803
+ initScales() {
81804
+ super.initScales();
81805
+ this._scale.base(this._spec.base ?? 10);
81806
+ }
81807
+ transformScaleDomain() {
81808
+ }
81809
+ }
81810
+ mixin(CartesianLogAxis, LinearAxisMixin);
81811
+
81695
81812
  class PolarAxis extends AxisComponent {
81696
81813
  static type = ComponentTypeEnum.polarAxis;
81697
81814
  type = ComponentTypeEnum.polarAxis;
@@ -89051,6 +89168,7 @@
89051
89168
  CartesianLinearAxis,
89052
89169
  CartesianBandAxis,
89053
89170
  CartesianTimeAxis,
89171
+ CartesianLogAxis,
89054
89172
  PolarBandAxis,
89055
89173
  PolarLinearAxis,
89056
89174
  DiscreteLegend,
@@ -89096,6 +89214,7 @@
89096
89214
  exports.CartesianChart = CartesianChart;
89097
89215
  exports.CartesianCrossHair = CartesianCrossHair;
89098
89216
  exports.CartesianLinearAxis = CartesianLinearAxis;
89217
+ exports.CartesianLogAxis = CartesianLogAxis;
89099
89218
  exports.CartesianSeries = CartesianSeries;
89100
89219
  exports.CartesianTimeAxis = CartesianTimeAxis;
89101
89220
  exports.CellMark = CellMark;