@bitcobblers/wod-wiki-ui 0.55.2206 → 0.56.2208
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.
- package/dist/{chunk-JERLIUE2.mjs → chunk-3NJIIKMT.mjs} +26 -5
- package/dist/chunk-3NJIIKMT.mjs.map +1 -0
- package/dist/extensions/index.cjs +23 -2
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.mjs +1 -1
- package/dist/index.cjs +31 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -7
- package/dist/index.d.ts +18 -7
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-JERLIUE2.mjs.map +0 -1
|
@@ -6706,6 +6706,27 @@ function QueryValue({ result, unit: unitProp, label, thresholds }) {
|
|
|
6706
6706
|
] })
|
|
6707
6707
|
] });
|
|
6708
6708
|
}
|
|
6709
|
+
function formatWithUnit(formattedNumber, unit) {
|
|
6710
|
+
const cleanUnit = unit?.trim();
|
|
6711
|
+
return cleanUnit ? `${formattedNumber} ${cleanUnit}` : formattedNumber;
|
|
6712
|
+
}
|
|
6713
|
+
function formatTimeseriesTick(value, unit) {
|
|
6714
|
+
const numeric = Number(value);
|
|
6715
|
+
if (!Number.isFinite(numeric)) {
|
|
6716
|
+
return formatWithUnit(String(value), unit);
|
|
6717
|
+
}
|
|
6718
|
+
const maximumFractionDigits = Math.abs(numeric) >= 100 ? 0 : 1;
|
|
6719
|
+
const formatted = new Intl.NumberFormat(void 0, { maximumFractionDigits }).format(numeric);
|
|
6720
|
+
return formatWithUnit(formatted, unit);
|
|
6721
|
+
}
|
|
6722
|
+
function formatTimeseriesTooltipValue(value, unit) {
|
|
6723
|
+
const numeric = Number(value);
|
|
6724
|
+
if (!Number.isFinite(numeric)) {
|
|
6725
|
+
return formatWithUnit(String(value), unit);
|
|
6726
|
+
}
|
|
6727
|
+
const formatted = new Intl.NumberFormat(void 0, { maximumFractionDigits: 1 }).format(numeric);
|
|
6728
|
+
return formatWithUnit(formatted, unit);
|
|
6729
|
+
}
|
|
6709
6730
|
function WqlTimeseries({ result, unit: unitProp }) {
|
|
6710
6731
|
const shape = useChartShape(result);
|
|
6711
6732
|
const data2 = React2.useMemo(() => mergeSeries(result.series), [result]);
|
|
@@ -6734,7 +6755,7 @@ function WqlTimeseries({ result, unit: unitProp }) {
|
|
|
6734
6755
|
width: 64,
|
|
6735
6756
|
stroke: "hsl(var(--muted-foreground))",
|
|
6736
6757
|
tick: { fill: "hsl(var(--muted-foreground))", fontSize: 10 },
|
|
6737
|
-
|
|
6758
|
+
tickFormatter: (v) => formatTimeseriesTick(v, unit)
|
|
6738
6759
|
}
|
|
6739
6760
|
),
|
|
6740
6761
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6747,7 +6768,7 @@ function WqlTimeseries({ result, unit: unitProp }) {
|
|
|
6747
6768
|
color: "hsl(var(--popover-foreground))"
|
|
6748
6769
|
},
|
|
6749
6770
|
labelFormatter: (v) => tooltipTimestamp(v),
|
|
6750
|
-
formatter: (v) => [
|
|
6771
|
+
formatter: (v) => [formatTimeseriesTooltipValue(v, unit), ""]
|
|
6751
6772
|
}
|
|
6752
6773
|
),
|
|
6753
6774
|
result.series.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, { wrapperStyle: { fontSize: 11 } }),
|