autoql-fe-utils 1.7.13 → 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.
@@ -18525,7 +18525,7 @@
18525
18525
  }
18526
18526
  };
18527
18527
  var getNumberFormatConfig = (d, scale) => {
18528
- var _a, _b, _c, _d, _e, _f;
18528
+ var _a, _b, _c, _d, _e, _f, _g, _h;
18529
18529
  const dNumber = typeof d === "string" ? parseFloat(d) : d;
18530
18530
  let minimumFractionDigits = 0;
18531
18531
  let maximumFractionDigits = 0;
@@ -18539,13 +18539,20 @@
18539
18539
  } else if (!isNaN(maxValue) && !isNaN(minValue)) {
18540
18540
  domainRange = Math.abs(maxValue - minValue);
18541
18541
  }
18542
- 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));
18543
- 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;
18544
18545
  const absValue = Math.abs(dNumber);
18545
- if (smallDomain && (!tickRange || tickRange >= 1)) {
18546
- } 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) {
18547
18551
  minimumFractionDigits = 2;
18548
18552
  maximumFractionDigits = 2;
18553
+ } else if (domainRange >= 5 && domainRange < 10) {
18554
+ minimumFractionDigits = 1;
18555
+ maximumFractionDigits = 1;
18549
18556
  } else if (absValue >= 1e3) {
18550
18557
  notation = "compact";
18551
18558
  if (absValue > 1e9) {