@quantumwake/terminal-ux-dashboard-components 0.1.24 → 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 +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -285,6 +285,7 @@ var DEFAULT_CHART_STYLE = {
|
|
|
285
285
|
areaOpacity: 0.15,
|
|
286
286
|
yFromZero: false,
|
|
287
287
|
barLabels: true,
|
|
288
|
+
animate: false,
|
|
288
289
|
seriesColors: []
|
|
289
290
|
};
|
|
290
291
|
var DEFAULT_SERIES_COLORS = [
|
|
@@ -611,6 +612,7 @@ function BarView({ records, groupColumn, valueColumn, aggFn = "count", data: pre
|
|
|
611
612
|
labelSkipWidth: 12,
|
|
612
613
|
labelSkipHeight: 12,
|
|
613
614
|
labelTextColor: { from: "color", modifiers: [["darker", 3]] },
|
|
615
|
+
animate: s.animate,
|
|
614
616
|
theme: buildNivoTheme(style)
|
|
615
617
|
}
|
|
616
618
|
) });
|
|
@@ -649,6 +651,7 @@ function PieView({ records, groupColumn, data: presetData, style }) {
|
|
|
649
651
|
arcLabelsSkipAngle: 10,
|
|
650
652
|
arcLabelsTextColor: { from: "color", modifiers: [["darker", 3]] },
|
|
651
653
|
legends: legend ? [legend] : [],
|
|
654
|
+
animate: s.animate,
|
|
652
655
|
theme: buildNivoTheme(style)
|
|
653
656
|
}
|
|
654
657
|
) });
|
|
@@ -675,10 +678,12 @@ function LineView({ records, xColumn, yColumn, data: presetData, style }) {
|
|
|
675
678
|
]));
|
|
676
679
|
const longest = data.reduce((a, b) => b.data.length > a.data.length ? b : a, { id: "", data: [] });
|
|
677
680
|
const tickValues = thinTicks(longest.data.map((d) => d.x), s.maxXTicks);
|
|
681
|
+
const ceilRef = react.useRef(0);
|
|
678
682
|
let yScale = { type: "linear", min: "auto", max: "auto" };
|
|
679
683
|
if (s.yFromZero) {
|
|
680
684
|
const dataMax = Math.max(0, ...data.flatMap((serie) => serie.data.map((d) => Math.max(d.y, d.hi ?? d.y))));
|
|
681
|
-
|
|
685
|
+
ceilRef.current = Math.max(ceilRef.current, niceCeil(dataMax));
|
|
686
|
+
yScale = { type: "linear", min: 0, max: ceilRef.current };
|
|
682
687
|
}
|
|
683
688
|
const bandedIds = new Set(data.filter((serie) => serie.data.some((d) => d.lo != null)).map((serie) => serie.id));
|
|
684
689
|
const bandsLayer = ({ series, yScale: yScale2, lineGenerator }) => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: series.map((serie) => {
|
|
@@ -720,6 +725,7 @@ function LineView({ records, xColumn, yColumn, data: presetData, style }) {
|
|
|
720
725
|
axisLeft: makeAxis(style, "y", yColumn, { numeric: true }),
|
|
721
726
|
useMesh: true,
|
|
722
727
|
layers: ["grid", "markers", "axes", "areas", bandsLayer, linesLayer, "crosshair", "slices", "mesh", "legends"],
|
|
728
|
+
animate: s.animate,
|
|
723
729
|
theme: buildNivoTheme(style)
|
|
724
730
|
}
|
|
725
731
|
) });
|
|
@@ -781,6 +787,7 @@ function ScatterView({ records, xColumn, yColumn, data: presetData, style }) {
|
|
|
781
787
|
axisBottom: makeAxis(style, "x", xColumn, { numeric: true }),
|
|
782
788
|
axisLeft: makeAxis(style, "y", yColumn, { numeric: true }),
|
|
783
789
|
useMesh: true,
|
|
790
|
+
animate: s.animate,
|
|
784
791
|
theme: buildNivoTheme(style)
|
|
785
792
|
}
|
|
786
793
|
) });
|
|
@@ -888,6 +895,7 @@ function HeatmapView({
|
|
|
888
895
|
borderColor: "#334155",
|
|
889
896
|
labelTextColor: { from: "color", modifiers: [["darker", 3]] },
|
|
890
897
|
hoverTarget: "cell",
|
|
898
|
+
animate: s.animate,
|
|
891
899
|
theme: buildNivoTheme(style)
|
|
892
900
|
}
|
|
893
901
|
) });
|
|
@@ -1042,6 +1050,7 @@ function HeatmapPlusView({
|
|
|
1042
1050
|
borderColor: "#334155",
|
|
1043
1051
|
labelTextColor: ((cell) => heatLabelColor(tAt(cell.serieId, cell.data.x))),
|
|
1044
1052
|
hoverTarget: "cell",
|
|
1053
|
+
animate: s.animate,
|
|
1045
1054
|
theme: buildNivoTheme(style)
|
|
1046
1055
|
}
|
|
1047
1056
|
) });
|