@visactor/vtable 1.22.5-alpha.1 → 1.22.5

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 (63) hide show
  1. package/cjs/PivotChart.js +4 -4
  2. package/cjs/PivotChart.js.map +1 -1
  3. package/cjs/components/axis/get-axis-attributes.js +3 -1
  4. package/cjs/components/axis/get-axis-attributes.js.map +1 -1
  5. package/cjs/core/BaseTable.js +1 -1
  6. package/cjs/core/BaseTable.js.map +1 -1
  7. package/cjs/index.d.ts +1 -1
  8. package/cjs/index.js +1 -1
  9. package/cjs/index.js.map +1 -1
  10. package/cjs/layout/chart-helper/get-axis-config.js +10 -6
  11. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  12. package/cjs/layout/chart-helper/get-chart-spec.js +6 -2
  13. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  14. package/cjs/layout/pivot-header-layout.js +21 -5
  15. package/cjs/layout/pivot-header-layout.js.map +1 -1
  16. package/cjs/plugins/index.js +1 -1
  17. package/cjs/scenegraph/graphic/active-cell-chart-list.js +18 -2
  18. package/cjs/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  19. package/cjs/scenegraph/graphic/chart.d.ts +3 -0
  20. package/cjs/scenegraph/graphic/chart.js +45 -13
  21. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  22. package/cjs/scenegraph/refresh-node/update-chart.js +1 -1
  23. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  24. package/cjs/ts-types/table-engine.js.map +1 -1
  25. package/cjs/ts-types/theme.d.ts +4 -4
  26. package/cjs/ts-types/theme.js.map +1 -1
  27. package/cjs/vrender.js.map +1 -1
  28. package/dist/vtable.js +222 -37
  29. package/dist/vtable.min.js +2 -2
  30. package/es/PivotChart.js +4 -4
  31. package/es/PivotChart.js.map +1 -1
  32. package/es/components/axis/get-axis-attributes.js +3 -1
  33. package/es/components/axis/get-axis-attributes.js.map +1 -1
  34. package/es/core/BaseTable.js +1 -1
  35. package/es/core/BaseTable.js.map +1 -1
  36. package/es/index.d.ts +1 -1
  37. package/es/index.js +1 -1
  38. package/es/index.js.map +1 -1
  39. package/es/layout/chart-helper/get-axis-config.js +10 -6
  40. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  41. package/es/layout/chart-helper/get-chart-spec.js +5 -3
  42. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  43. package/es/layout/pivot-header-layout.js +21 -5
  44. package/es/layout/pivot-header-layout.js.map +1 -1
  45. package/es/plugins/index.js +1 -1
  46. package/es/scenegraph/graphic/active-cell-chart-list.js +18 -2
  47. package/es/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  48. package/es/scenegraph/graphic/chart.d.ts +3 -0
  49. package/es/scenegraph/graphic/chart.js +43 -13
  50. package/es/scenegraph/graphic/chart.js.map +1 -1
  51. package/es/scenegraph/refresh-node/update-chart.js +1 -1
  52. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  53. package/es/ts-types/table-engine.js.map +1 -1
  54. package/es/ts-types/theme.d.ts +4 -4
  55. package/es/ts-types/theme.js.map +1 -1
  56. package/es/vrender.js.map +1 -1
  57. package/package.json +8 -8
  58. package/cjs/layout/pivot-layout.d.ts +0 -1
  59. package/cjs/layout/pivot-layout.js +0 -1
  60. package/cjs/layout/pivot-layout.js.map +0 -1
  61. package/es/layout/pivot-layout.d.ts +0 -1
  62. package/es/layout/pivot-layout.js +0 -1
  63. package/es/layout/pivot-layout.js.map +0 -1
package/dist/vtable.js CHANGED
@@ -586,7 +586,7 @@
586
586
 
587
587
  const EnvContribution = Symbol.for("EnvContribution");
588
588
  const VGlobal = Symbol.for("VGlobal");
589
- const DEFAULT_TEXT_FONT_FAMILY$2 = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";
589
+ const DEFAULT_TEXT_FONT_FAMILY$2 = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,'-apple-system',segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";
590
590
 
591
591
  const container = new Container$2();
592
592
 
@@ -4468,7 +4468,7 @@
4468
4468
  textAlign: "left",
4469
4469
  textBaseline: "alphabetic",
4470
4470
  fontSize: 16,
4471
- fontFamily: "PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",
4471
+ fontFamily: "PingFang SC,Microsoft Yahei,system-ui,'-apple-system',segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",
4472
4472
  fontWeight: "",
4473
4473
  ellipsis: "…",
4474
4474
  fontVariant: "",
@@ -11365,9 +11365,10 @@
11365
11365
  }
11366
11366
  updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds) {
11367
11367
  const {
11368
- size = symbolTheme.size
11369
- } = attribute;
11370
- return this.getParsedPath().bounds(size, aabbBounds), aabbBounds;
11368
+ size = symbolTheme.size
11369
+ } = attribute,
11370
+ symbolClass = this.getParsedPath();
11371
+ return symbolClass ? (symbolClass.bounds(size, aabbBounds), aabbBounds) : aabbBounds;
11371
11372
  }
11372
11373
  needUpdateTags(keys) {
11373
11374
  return super.needUpdateTags(keys, SYMBOL_UPDATE_TAG_KEY);
@@ -11376,8 +11377,9 @@
11376
11377
  return super.needUpdateTag(key, SYMBOL_UPDATE_TAG_KEY);
11377
11378
  }
11378
11379
  toCustomPath() {
11379
- const symbolInstance = this.getParsedPath(),
11380
- size = this.attribute.size,
11380
+ const symbolInstance = this.getParsedPath();
11381
+ if (!symbolInstance) return null;
11382
+ const size = this.attribute.size,
11381
11383
  formattedSize = isArray$9(size) ? size : [size, size];
11382
11384
  return symbolInstance.path ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, 0, 0, formattedSize[0], formattedSize[1]) : new CustomPath2D().fromString(symbolInstance.pathStr, 0, 0, formattedSize[0], formattedSize[1]);
11383
11385
  }
@@ -16952,7 +16954,7 @@
16952
16954
  }));
16953
16955
  }
16954
16956
  enableAutoRefresh() {
16955
- this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
16957
+ this.autoRefresh || "node" === this.global.env || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
16956
16958
  }
16957
16959
  disableAutoRefresh() {
16958
16960
  this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
@@ -30398,7 +30400,7 @@
30398
30400
  labelStyle: labelStyle
30399
30401
  } = op,
30400
30402
  radius = null == getRadius ? void 0 : getRadius();
30401
- if (!radius) return convertDomainToTickData(scale.domain());
30403
+ if (!radius || radius <= 0) return convertDomainToTickData(scale.domain());
30402
30404
  let scaleTicks;
30403
30405
  if (isValid$5(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$5(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$5(tickCount)) {
30404
30406
  const range = scale.range(),
@@ -49030,6 +49032,10 @@
49030
49032
  else {
49031
49033
  if (hideTooltip) {
49032
49034
  chartInstanceListColumnByColumnDirection[col][i].hideTooltip();
49035
+ chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
49036
+ tooltip: false,
49037
+ showTooltipOption: { x: canvasXY.x, y: absolutePosition.top + 3, activeType: 'dimension' }
49038
+ });
49033
49039
  }
49034
49040
  else {
49035
49041
  chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
@@ -49122,6 +49128,10 @@
49122
49128
  else {
49123
49129
  if (hideTooltip) {
49124
49130
  chartInstanceListRowByRowDirection[row][i].hideTooltip();
49131
+ chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
49132
+ tooltip: false,
49133
+ showTooltipOption: { x: absolutePosition.left + 3, y: canvasXY.y, activeType: 'dimension' }
49134
+ });
49125
49135
  }
49126
49136
  else {
49127
49137
  chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
@@ -49388,6 +49398,11 @@
49388
49398
  row === layout.columnHeaderLevelCount - 1 &&
49389
49399
  col >= layout.rowHeaderLevelCount &&
49390
49400
  col < layout.colCount - layout.rightFrozenColCount) {
49401
+ const indicatorKey = layout.getIndicatorKey(col, row);
49402
+ const indicatorInfo = layout.getIndicatorInfo(indicatorKey);
49403
+ if (!indicatorInfo?.hasTwoIndicatorAxes) {
49404
+ return;
49405
+ }
49391
49406
  const axisRange = getRange('top', col, row + 1, col, layout.columnHeaderLevelCount - 1, col, row, 1, layout);
49392
49407
  if (!axisRange) {
49393
49408
  return;
@@ -49590,14 +49605,19 @@
49590
49605
  else if (col === layout.colCount - layout.rightFrozenColCount &&
49591
49606
  row >= layout.columnHeaderLevelCount &&
49592
49607
  row < layout.rowCount - layout.bottomFrozenRowCount) {
49608
+ const indicatorKey = layout.getIndicatorKey(col, row);
49609
+ const indicatorInfo = layout.getIndicatorInfo(indicatorKey);
49610
+ if (!indicatorInfo?.hasTwoIndicatorAxes) {
49611
+ return;
49612
+ }
49613
+ const { axisOption, chartType } = getAxisOption(col - 1, row, 'right', layout);
49593
49614
  const axisRange = getRange('right', col - 1, row, layout.rowHeaderLevelCount - 1, row, col, row, 1, layout);
49594
- const { chartType } = getAxisOption(col - 1, row, 'right', layout);
49595
49615
  if (!axisRange) {
49596
49616
  return;
49597
49617
  }
49598
49618
  const chartCellStyle = layout._table._getCellStyle(col - 1, row);
49599
49619
  const bodyChartCellPadding = getQuadProps(getProp('padding', chartCellStyle, col - 1, row, layout._table));
49600
- const { range, ticks, axisOption, index, targetTicks, targetRange, theme } = axisRange;
49620
+ const { range, ticks, index, targetTicks, targetRange, theme } = axisRange;
49601
49621
  if (isNumber$4(axisOption?.min)) {
49602
49622
  range.min = axisOption.min;
49603
49623
  if (range.min > 0) {
@@ -49715,7 +49735,7 @@
49715
49735
  const axisOption = layout._table.pivotChartAxes.find(axisOption => {
49716
49736
  return axisOption.orient === orient;
49717
49737
  }) ?? {};
49718
- if (!axisOption.labelHoverOnAxis) {
49738
+ if (axisOption && !axisOption.labelHoverOnAxis) {
49719
49739
  axisOption.labelHoverOnAxis = layout._table.options.chartDimensionLinkage?.labelHoverOnAxis?.[orient];
49720
49740
  }
49721
49741
  const { isZeroAlign, isTickAlign } = checkZeroAlign(spec, orient, layout);
@@ -49784,7 +49804,7 @@
49784
49804
  }
49785
49805
  return null;
49786
49806
  }
49787
- let defaultKey = indicatorKeys?.[seriesId];
49807
+ let defaultKey = indicatorKeys?.[seriesId] ?? indicatorKeys?.[0];
49788
49808
  if (isArray$7(defaultKey)) {
49789
49809
  defaultKey = defaultKey[0];
49790
49810
  }
@@ -50091,6 +50111,9 @@
50091
50111
  chartInstance;
50092
50112
  activeChartInstance;
50093
50113
  activeChartInstanceHoverOnMark = null;
50114
+ justShowMarkTooltip = undefined;
50115
+ justShowMarkTooltipTimer = Date.now();
50116
+ delayRunDimensionHoverTimer = undefined;
50094
50117
  cacheCanvas;
50095
50118
  isShareChartSpec;
50096
50119
  constructor(isShareChartSpec, params) {
@@ -50233,41 +50256,116 @@
50233
50256
  }
50234
50257
  }
50235
50258
  else {
50236
- let hideTooltip = false;
50259
+ let justShowMarkTooltip = true;
50237
50260
  const preMark = this.activeChartInstanceHoverOnMark;
50261
+ const prev_justShowMarkTooltip = this.justShowMarkTooltip;
50238
50262
  if (params.mark && params.datum && !Array.isArray(params.datum)) {
50239
50263
  this.activeChartInstanceHoverOnMark = params.mark;
50240
- hideTooltip = true;
50264
+ justShowMarkTooltip = true;
50241
50265
  }
50242
50266
  else {
50243
50267
  this.activeChartInstanceHoverOnMark = null;
50268
+ justShowMarkTooltip = false;
50244
50269
  }
50245
- if (params.action === 'enter' || preMark !== this.activeChartInstanceHoverOnMark) {
50270
+ this.justShowMarkTooltip = justShowMarkTooltip;
50271
+ let delayRunDimensionHover = false;
50272
+ if (prev_justShowMarkTooltip === true && justShowMarkTooltip === false) {
50273
+ this.justShowMarkTooltipTimer = Date.now();
50274
+ delayRunDimensionHover = true;
50275
+ }
50276
+ else if (prev_justShowMarkTooltip === false && justShowMarkTooltip === false) {
50277
+ if (Date.now() - this.justShowMarkTooltipTimer < 100) {
50278
+ delayRunDimensionHover = true;
50279
+ }
50280
+ else {
50281
+ delayRunDimensionHover = false;
50282
+ }
50283
+ }
50284
+ else if (prev_justShowMarkTooltip === false && justShowMarkTooltip === true) {
50285
+ delayRunDimensionHover = false;
50286
+ clearTimeout(this.delayRunDimensionHoverTimer);
50287
+ this.delayRunDimensionHoverTimer = undefined;
50288
+ }
50289
+ else if (prev_justShowMarkTooltip === true && justShowMarkTooltip === true) {
50290
+ delayRunDimensionHover = false;
50291
+ clearTimeout(this.delayRunDimensionHoverTimer);
50292
+ this.delayRunDimensionHoverTimer = undefined;
50293
+ }
50294
+ if (params.action === 'enter' ||
50295
+ params.action === 'move' ||
50296
+ preMark !== this.activeChartInstanceHoverOnMark) {
50246
50297
  const dimensionValue = dimensionInfo.value;
50247
50298
  const indicatorsAsCol = table.options.indicatorsAsCol;
50299
+ if (!delayRunDimensionHover) {
50300
+ if (indicatorsAsCol) {
50301
+ generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, false);
50302
+ }
50303
+ else {
50304
+ generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, false);
50305
+ }
50306
+ }
50307
+ else {
50308
+ clearTimeout(this.delayRunDimensionHoverTimer);
50309
+ this.delayRunDimensionHoverTimer = setTimeout(() => {
50310
+ if (indicatorsAsCol) {
50311
+ generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, false);
50312
+ }
50313
+ else {
50314
+ generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, false);
50315
+ }
50316
+ }, 100);
50317
+ }
50248
50318
  if (indicatorsAsCol) {
50249
50319
  const series = dimensionInfo.data[0].series;
50250
- const width = series.getYAxisHelper().getBandwidth(0);
50251
- const y = series.valueToPositionY(dimensionValue);
50320
+ const width = this.attribute.spec.type === 'histogram' ||
50321
+ this.attribute.spec.type === 'boxPlot' ||
50322
+ series.type === 'line' ||
50323
+ series.type === 'area'
50324
+ ? 0
50325
+ : series.getYAxisHelper().getBandwidth(0);
50326
+ let y = series.valueToPositionY(dimensionValue);
50252
50327
  const axisConfig = getAxisConfigInPivotChart(table.rowHeaderLevelCount - 1, row, table.internalProps.layoutMap);
50328
+ let hoverOnLabelValue = yValue;
50329
+ if (this.attribute.spec.type === 'histogram') {
50330
+ const { series, datum } = dimensionInfo.data[0];
50331
+ if (datum.length > 0) {
50332
+ const rangeStartValue = datum[0][series.fieldY[0]];
50333
+ const rangeEndValue = datum[0][series.fieldY2];
50334
+ hoverOnLabelValue = rangeStartValue + ' ~ ' + rangeEndValue;
50335
+ y = (series.valueToPositionY(rangeStartValue) + series.valueToPositionY(rangeEndValue)) / 2;
50336
+ }
50337
+ }
50253
50338
  if (axisConfig.labelHoverOnAxis) {
50254
50339
  table.scenegraph
50255
50340
  .getCell(table.rowHeaderLevelCount - 1, row)
50256
- .firstChild.showLabelHoverOnAxis(y + (series.type === 'line' || series.type === 'area' ? 0 : width / 2), yValue);
50341
+ .firstChild.showLabelHoverOnAxis(y + (series.type === 'line' || series.type === 'area' ? 0 : width / 2), hoverOnLabelValue);
50257
50342
  }
50258
- generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, hideTooltip, false);
50259
50343
  }
50260
50344
  else {
50261
50345
  const series = dimensionInfo.data[0].series;
50262
- const width = series.getXAxisHelper().getBandwidth(0);
50263
- const x = series.valueToPositionX(dimensionValue);
50346
+ const width = this.attribute.spec.type === 'histogram' ||
50347
+ this.attribute.spec.type === 'boxPlot' ||
50348
+ series.type === 'line' ||
50349
+ series.type === 'area'
50350
+ ? 0
50351
+ : series.getXAxisHelper().getBandwidth(0);
50352
+ let x = series.valueToPositionX(dimensionValue);
50264
50353
  const axisConfig = getAxisConfigInPivotChart(col, table.rowCount - table.bottomFrozenRowCount, table.internalProps.layoutMap);
50354
+ let hoverOnLabelValue = dimensionValue;
50355
+ if (this.attribute.spec.type === 'histogram') {
50356
+ const { series, datum } = dimensionInfo.data[0];
50357
+ if (datum.length > 0) {
50358
+ const rangeStartValue = datum[0][series.fieldX[0]];
50359
+ const rangeEndValue = datum[0][series.fieldX2];
50360
+ hoverOnLabelValue = rangeStartValue + ' ~ ' + rangeEndValue;
50361
+ x = (series.valueToPositionX(rangeStartValue) + series.valueToPositionX(rangeEndValue)) / 2;
50362
+ }
50363
+ }
50265
50364
  if (axisConfig.labelHoverOnAxis) {
50266
50365
  table.scenegraph
50267
50366
  .getCell(col, table.rowCount - table.bottomFrozenRowCount)
50268
- .firstChild.showLabelHoverOnAxis(x + (series.type === 'line' || series.type === 'area' ? 0 : width / 2), dimensionValue);
50367
+ .firstChild.showLabelHoverOnAxis(x + width / 2, hoverOnLabelValue);
50269
50368
  }
50270
- generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, hideTooltip, false);
50271
50369
  }
50272
50370
  }
50273
50371
  }
@@ -50279,6 +50377,10 @@
50279
50377
  static temp = 1;
50280
50378
  deactivate(table, { releaseChartInstance = true, releaseColumnChartInstance = true, releaseRowChartInstance = true } = {}) {
50281
50379
  this.activeChartInstanceHoverOnMark = null;
50380
+ this.justShowMarkTooltip = undefined;
50381
+ this.justShowMarkTooltipTimer = Date.now();
50382
+ clearTimeout(this.delayRunDimensionHoverTimer);
50383
+ this.delayRunDimensionHoverTimer = undefined;
50282
50384
  if (releaseChartInstance) {
50283
50385
  this.activeChartInstance?.updateViewBox({
50284
50386
  x1: -1000,
@@ -56732,7 +56834,8 @@
56732
56834
  const table = scenegraph.table;
56733
56835
  if (table.isPivotChart()) {
56734
56836
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
56735
- if ((datum === null || datum?.length === 0 || Object.keys(datum).length === 0) && preSelectItemsCount === 0) {
56837
+ if ((datum === null || datum === undefined || datum?.length === 0 || Object.keys(datum).length === 0) &&
56838
+ preSelectItemsCount === 0) {
56736
56839
  return;
56737
56840
  }
56738
56841
  const newSelectedDataItemsInChart = [];
@@ -69858,7 +69961,7 @@
69858
69961
  return TABLE_EVENT_TYPE;
69859
69962
  }
69860
69963
  options;
69861
- version = "1.22.5-alpha.1";
69964
+ version = "1.22.5";
69862
69965
  pagination;
69863
69966
  id = `VTable${Date.now()}`;
69864
69967
  headerStyleCache;
@@ -74342,7 +74445,7 @@
74342
74445
  domainLine: {
74343
74446
  visible: true,
74344
74447
  style: {
74345
- lineWidth: 1,
74448
+ lineWidth: 0,
74346
74449
  stroke: '#D9DDE4',
74347
74450
  strokeOpacity: 1
74348
74451
  }
@@ -74433,6 +74536,10 @@
74433
74536
  }
74434
74537
  function getAxisAttributes(option) {
74435
74538
  const spec = merge$1({}, option);
74539
+ if (option.labelHoverOnAxis && spec.domainLine.visible === false) {
74540
+ spec.domainLine.style.lineWidth = 0;
74541
+ spec.domainLine.visible = true;
74542
+ }
74436
74543
  let titleAngle = spec.title?.angle ?? 0;
74437
74544
  let titleTextStyle;
74438
74545
  if (spec.orient === 'left' || spec.orient === 'right') {
@@ -74743,6 +74850,15 @@
74743
74850
  const rowPath = layout.getRowKeysPath(col, row);
74744
74851
  const domain = data[rowPath ?? ''];
74745
74852
  const { axisOption, isPercent, chartType } = getAxisOption(col, row, 'left', layout);
74853
+ if (axisOption?.zero &&
74854
+ domain &&
74855
+ !Array.isArray(domain) &&
74856
+ isValid$3(domain.min) &&
74857
+ isValid$3(domain.max) &&
74858
+ (axisOption?.zero || domain.min === domain.max)) {
74859
+ domain.min = Math.min(domain.min, 0);
74860
+ domain.max = Math.max(domain.max, 0);
74861
+ }
74746
74862
  axes.push(merge$1({
74747
74863
  domain: axisOption?.type === 'linear' && !Array.isArray(domain) ? undefined : Array.from(domain ?? []),
74748
74864
  range: axisOption?.type === 'linear' && !Array.isArray(domain) ? domain : undefined,
@@ -74813,6 +74929,15 @@
74813
74929
  const colPath = layout.getColKeysPath(col, row);
74814
74930
  const domain = data?.[colPath ?? ''] ?? [];
74815
74931
  const { axisOption, isPercent, chartType } = getAxisOption(col, row, 'bottom', layout);
74932
+ if (axisOption?.zero &&
74933
+ domain &&
74934
+ !Array.isArray(domain) &&
74935
+ isValid$3(domain.min) &&
74936
+ isValid$3(domain.max) &&
74937
+ (axisOption?.zero || domain.min === domain.max)) {
74938
+ domain.min = Math.min(domain.min, 0);
74939
+ domain.max = Math.max(domain.max, 0);
74940
+ }
74816
74941
  axes.push(merge$1({
74817
74942
  domain: axisOption?.type === 'linear' && !Array.isArray(domain) ? undefined : Array.from(domain ?? []),
74818
74943
  range: axisOption?.type === 'linear' && !Array.isArray(domain) ? domain : undefined,
@@ -85720,7 +85845,8 @@
85720
85845
  this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(this.rowDimensionKeys);
85721
85846
  this.resetRowHeaderLevelCount();
85722
85847
  if (this._table.isPivotChart()) {
85723
- this.hasTwoIndicatorAxes = this.indicatorsDefine.some((indicatorObject) => {
85848
+ this.hasTwoIndicatorAxes = false;
85849
+ this.indicatorsDefine.forEach((indicatorObject) => {
85724
85850
  if (indicatorObject.chartSpec &&
85725
85851
  indicatorObject.chartSpec.series &&
85726
85852
  indicatorObject.chartSpec.series.length > 1) {
@@ -85732,9 +85858,58 @@
85732
85858
  }
85733
85859
  return true;
85734
85860
  })) {
85861
+ indicatorObject.hasTwoIndicatorAxes = true;
85862
+ this.hasTwoIndicatorAxes = true;
85735
85863
  return true;
85736
85864
  }
85737
85865
  }
85866
+ indicatorObject.hasTwoIndicatorAxes = false;
85867
+ return false;
85868
+ });
85869
+ this.indicatorsDefine.forEach((indicatorObject) => {
85870
+ if (indicatorObject.hasTwoIndicatorAxes) {
85871
+ return false;
85872
+ }
85873
+ if (indicatorObject.chartSpec) {
85874
+ const axes = indicatorObject.chartSpec.axes ?? this._table.pivotChartAxes ?? [];
85875
+ if (this.indicatorsAsCol) {
85876
+ const topAxis = axes.find((axis) => {
85877
+ if (axis.orient === 'top' && axis.visible !== false) {
85878
+ return true;
85879
+ }
85880
+ return false;
85881
+ });
85882
+ const bottomAxis = axes.find((axis) => {
85883
+ if (axis.orient === 'bottom' && axis.visible !== false) {
85884
+ return true;
85885
+ }
85886
+ return false;
85887
+ });
85888
+ if (topAxis && bottomAxis) {
85889
+ indicatorObject.hasTwoIndicatorAxes = true;
85890
+ return true;
85891
+ }
85892
+ }
85893
+ else {
85894
+ const leftAxis = axes.find((axis) => {
85895
+ if (axis.orient === 'left' && axis.visible !== false) {
85896
+ return true;
85897
+ }
85898
+ return false;
85899
+ });
85900
+ const rightAxis = axes.find((axis) => {
85901
+ if (axis.orient === 'right' && axis.visible !== false) {
85902
+ return true;
85903
+ }
85904
+ return false;
85905
+ });
85906
+ if (leftAxis && rightAxis) {
85907
+ indicatorObject.hasTwoIndicatorAxes = true;
85908
+ return true;
85909
+ }
85910
+ }
85911
+ }
85912
+ indicatorObject.hasTwoIndicatorAxes = false;
85738
85913
  return false;
85739
85914
  });
85740
85915
  }
@@ -87977,7 +88152,9 @@
87977
88152
  const findLeafNode = (nodes) => {
87978
88153
  for (const node of nodes) {
87979
88154
  const nodeChildren = node.children;
87980
- const nodeHasAxis = checkAxisNode && nodeChildren.some((row) => row.dimensionKey === 'axis');
88155
+ const nodeHasAxis = checkAxisNode &&
88156
+ nodeChildren &&
88157
+ nodeChildren.some((row) => row.dimensionKey === 'axis');
87981
88158
  if (!nodeChildren?.length || nodeHasAxis) {
87982
88159
  return node;
87983
88160
  }
@@ -88446,7 +88623,9 @@
88446
88623
  ? chartSpec.type === 'histogram'
88447
88624
  ? chartSpec.x2Field
88448
88625
  : chartSpec.xField ?? chartSpec?.series?.[0]?.xField
88449
- : chartSpec.yField ?? chartSpec?.series?.[0]?.yField;
88626
+ : chartSpec.type === 'histogram'
88627
+ ? chartSpec.y2Field
88628
+ : chartSpec.yField ?? chartSpec?.series?.[0]?.yField;
88450
88629
  if (dimensionKey) {
88451
88630
  return dimensionKey;
88452
88631
  }
@@ -93444,7 +93623,9 @@
93444
93623
  collectValuesBy[indicatorDefine.indicatorKey] = {
93445
93624
  by: columnKeys,
93446
93625
  range: true,
93447
- sumBy: indicatorSpec?.stack && rowKeys.concat(indicatorSpec?.yField)
93626
+ sumBy: indicatorSpec.type === 'histogram'
93627
+ ? rowKeys.concat(indicatorSpec?.yField, indicatorSpec?.y2Field)
93628
+ : indicatorSpec?.stack && rowKeys.concat(indicatorSpec?.yField)
93448
93629
  };
93449
93630
  }
93450
93631
  if (indicatorSpec.series) {
@@ -93474,7 +93655,11 @@
93474
93655
  });
93475
93656
  }
93476
93657
  else {
93477
- const yField = typeof indicatorSpec.yField === 'string' ? indicatorSpec.yField : indicatorSpec.yField[0];
93658
+ const yField = indicatorSpec.type === 'histogram'
93659
+ ? indicatorSpec.y2Field
93660
+ : typeof indicatorSpec.yField === 'string'
93661
+ ? indicatorSpec.yField
93662
+ : indicatorSpec.yField[0];
93478
93663
  collectValuesBy[yField] = {
93479
93664
  by: rowKeys,
93480
93665
  type: indicatorSpec.direction === 'horizontal' ? 'yField' : undefined,
@@ -93484,14 +93669,14 @@
93484
93669
  indicatorSpec?.stack !== false &&
93485
93670
  (indicatorSpec?.type === 'bar' || indicatorSpec?.type === 'area') &&
93486
93671
  (indicatorSpec.stack = true);
93487
- const xField = indicatorSpec.type === 'histogram'
93488
- ? indicatorSpec.x2Field
93489
- : indicatorSpec.xField ?? indicatorSpec.maxField;
93672
+ const xField = indicatorSpec.xField ?? indicatorSpec.maxField;
93490
93673
  collectValuesBy[xField] = {
93491
93674
  by: columnKeys,
93492
93675
  type: indicatorSpec.direction === 'horizontal' ? 'xField' : undefined,
93493
93676
  range: hasLinearAxis(indicatorSpec, this._axes, indicatorSpec.direction === 'horizontal', true),
93494
- sumBy: indicatorSpec.stack && rowKeys.concat(indicatorSpec?.yField),
93677
+ sumBy: indicatorSpec.type === 'histogram'
93678
+ ? rowKeys.concat(indicatorSpec?.yField, indicatorSpec?.y2Field)
93679
+ : indicatorSpec.stack && rowKeys.concat(indicatorSpec?.yField),
93495
93680
  sortBy: indicatorSpec.direction !== 'horizontal' ? indicatorSpec?.data?.fields?.[xField]?.domain : undefined,
93496
93681
  extendRange: parseMarkLineGetExtendRange(indicatorSpec.markLine),
93497
93682
  considerFields: indicatorSpec?.type === 'boxPlot'
@@ -94503,7 +94688,7 @@
94503
94688
  }
94504
94689
 
94505
94690
  registerForVrender();
94506
- const version = "1.22.5-alpha.1";
94691
+ const version = "1.22.5";
94507
94692
  function getIcons() {
94508
94693
  return get$2();
94509
94694
  }