autoql-fe-utils 1.7.12 → 1.7.14

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.
@@ -17668,9 +17668,6 @@
17668
17668
  if (displayType === "scatterplot" /* SCATTERPLOT */ && columnIndexConfig.numberColumnIndex === columnIndexConfig.numberColumnIndex2) {
17669
17669
  console.debug("Both x and y axes reference the same number column index");
17670
17670
  return false;
17671
- } else if (numberIndicesArraysOverlap(columnIndexConfig)) {
17672
- console.debug("Both axes reference one or more of the same number column index");
17673
- return false;
17674
17671
  }
17675
17672
  if (columnIndexConfig.numberColumnIndices2.find((i) => !columns[i].is_visible)) {
17676
17673
  console.debug("Second axis indices had hidden columns");
@@ -18528,7 +18525,7 @@
18528
18525
  }
18529
18526
  };
18530
18527
  var getNumberFormatConfig = (d, scale) => {
18531
- var _a, _b, _c, _d, _e, _f;
18528
+ var _a, _b, _c, _d, _e, _f, _g, _h;
18532
18529
  const dNumber = typeof d === "string" ? parseFloat(d) : d;
18533
18530
  let minimumFractionDigits = 0;
18534
18531
  let maximumFractionDigits = 0;
@@ -18542,13 +18539,20 @@
18542
18539
  } else if (!isNaN(maxValue) && !isNaN(minValue)) {
18543
18540
  domainRange = Math.abs(maxValue - minValue);
18544
18541
  }
18545
- const tickRange = Math.abs(((_d = (_c = scale == null ? void 0 : scale.tickLabels) == null ? void 0 : _c[1]) != null ? _d : 0) - ((_f = (_e = scale == null ? void 0 : scale.tickLabels) == null ? void 0 : _e[0]) != null ? _f : 0));
18546
- const smallDomain = !isNaN(domainRange) && domainRange >= 0 && domainRange < 10;
18542
+ const numTicks = (_d = (_c = scale == null ? void 0 : scale.tickLabels) == null ? void 0 : _c.length) != null ? _d : 1;
18543
+ const totalRange = Math.abs(((_f = (_e = scale == null ? void 0 : scale.tickLabels) == null ? void 0 : _e[numTicks - 1]) != null ? _f : 0) - ((_h = (_g = scale == null ? void 0 : scale.tickLabels) == null ? void 0 : _g[0]) != null ? _h : 0));
18544
+ const tickRange = totalRange / numTicks;
18547
18545
  const absValue = Math.abs(dNumber);
18548
- if (smallDomain && (!tickRange || tickRange >= 1)) {
18549
- } else if (smallDomain) {
18546
+ if (domainRange < 10 && (!tickRange || tickRange >= 1)) {
18547
+ } else if (domainRange >= 0 && domainRange < 1) {
18548
+ minimumFractionDigits = 3;
18549
+ maximumFractionDigits = 3;
18550
+ } else if (domainRange >= 1 && domainRange < 5) {
18550
18551
  minimumFractionDigits = 2;
18551
18552
  maximumFractionDigits = 2;
18553
+ } else if (domainRange >= 5 && domainRange < 10) {
18554
+ minimumFractionDigits = 1;
18555
+ maximumFractionDigits = 1;
18552
18556
  } else if (absValue >= 1e3) {
18553
18557
  notation = "compact";
18554
18558
  if (absValue > 1e9) {