@quantumwake/terminal-ux-dashboard-components 0.1.25 → 0.1.26
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/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext, useContext, useMemo, useId, useState, useEffect,
|
|
1
|
+
import { createContext, useContext, useMemo, useRef, useId, useState, useEffect, useCallback, Suspense } from 'react';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { interpolateRdYlGn } from 'd3-scale-chromatic';
|
|
4
4
|
import { ResponsiveBar } from '@nivo/bar';
|
|
@@ -670,10 +670,12 @@ function LineView({ records, xColumn, yColumn, data: presetData, style }) {
|
|
|
670
670
|
]));
|
|
671
671
|
const longest = data.reduce((a, b) => b.data.length > a.data.length ? b : a, { id: "", data: [] });
|
|
672
672
|
const tickValues = thinTicks(longest.data.map((d) => d.x), s.maxXTicks);
|
|
673
|
+
const ceilRef = useRef(0);
|
|
673
674
|
let yScale = { type: "linear", min: "auto", max: "auto" };
|
|
674
675
|
if (s.yFromZero) {
|
|
675
676
|
const dataMax = Math.max(0, ...data.flatMap((serie) => serie.data.map((d) => Math.max(d.y, d.hi ?? d.y))));
|
|
676
|
-
|
|
677
|
+
ceilRef.current = Math.max(ceilRef.current, niceCeil(dataMax));
|
|
678
|
+
yScale = { type: "linear", min: 0, max: ceilRef.current };
|
|
677
679
|
}
|
|
678
680
|
const bandedIds = new Set(data.filter((serie) => serie.data.some((d) => d.lo != null)).map((serie) => serie.id));
|
|
679
681
|
const bandsLayer = ({ series, yScale: yScale2, lineGenerator }) => /* @__PURE__ */ jsx(Fragment, { children: series.map((serie) => {
|