@burdenoff/microfe-bigconsole 2026.1103.11 → 2026.1104.2
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/bigconsole/components/dashboard/LiveCanvasToggle.js +17 -16
- package/dist/bigconsole/components/embed/widgets/HeatmapEmbed.js +6 -3
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +130 -121
- package/dist/bigconsole/components/widgets/chart/ReferenceLinesEditor.d.ts +8 -0
- package/dist/bigconsole/components/widgets/chart/ReferenceLinesEditor.js +159 -0
- package/dist/bigconsole/components/widgets/chart/charts/referenceElements.d.ts +2 -1
- package/dist/bigconsole/components/widgets/chart/charts/referenceElements.js +8 -4
- package/dist/bigconsole/components/widgets/chart/referenceLineDraft.d.ts +29 -0
- package/dist/bigconsole/components/widgets/chart/referenceLineDraft.js +58 -0
- package/dist/bigconsole/components/widgets/heatmap/HeatmapWidget.d.ts +5 -0
- package/dist/bigconsole/components/widgets/heatmap/HeatmapWidget.js +81 -58
- package/dist/bigconsole/pages/DashboardViewPage.js +247 -238
- package/dist/bigconsole/utils/liveBoardRefresh.d.ts +31 -0
- package/dist/bigconsole/utils/liveBoardRefresh.js +7 -0
- package/package.json +1 -1
|
@@ -10,7 +10,8 @@ export interface ReferenceLineConfig {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Build reference line/band elements for a cartesian chart.
|
|
13
|
-
* `
|
|
13
|
+
* `yAxisId` lets dual-axis charts target the correct axis (defaults to the
|
|
14
|
+
* default axis, id 0).
|
|
14
15
|
*/
|
|
15
16
|
export declare function buildReferenceElements(referenceLines: ReferenceLineConfig[] | undefined, opts?: {
|
|
16
17
|
yAxisId?: string | number;
|
|
@@ -4,7 +4,7 @@ import { ReferenceArea as n, ReferenceLine as r } from "recharts";
|
|
|
4
4
|
//#region src/bigconsole/components/widgets/chart/charts/referenceElements.tsx
|
|
5
5
|
function i(i, a) {
|
|
6
6
|
return i?.length ? i.map((i, o) => {
|
|
7
|
-
let s = e(i.color ?? "danger"), c = (i.axis ?? "y") === "y", l = a?.yAxisId;
|
|
7
|
+
let s = e(i.color ?? "danger"), c = (i.axis ?? "y") === "y", l = a?.yAxisId ?? 0;
|
|
8
8
|
if (i.value2 != null) {
|
|
9
9
|
let e = Math.min(i.value, i.value2), r = Math.max(i.value, i.value2);
|
|
10
10
|
return /* @__PURE__ */ t(n, {
|
|
@@ -15,7 +15,9 @@ function i(i, a) {
|
|
|
15
15
|
x1: e,
|
|
16
16
|
x2: r
|
|
17
17
|
},
|
|
18
|
-
|
|
18
|
+
xAxisId: 0,
|
|
19
|
+
yAxisId: l,
|
|
20
|
+
ifOverflow: "extendDomain",
|
|
19
21
|
fill: s,
|
|
20
22
|
fillOpacity: .1,
|
|
21
23
|
stroke: s,
|
|
@@ -30,7 +32,9 @@ function i(i, a) {
|
|
|
30
32
|
}
|
|
31
33
|
return /* @__PURE__ */ t(r, {
|
|
32
34
|
...c ? { y: i.value } : { x: i.value },
|
|
33
|
-
|
|
35
|
+
xAxisId: 0,
|
|
36
|
+
yAxisId: l,
|
|
37
|
+
ifOverflow: "extendDomain",
|
|
34
38
|
stroke: s,
|
|
35
39
|
strokeWidth: 1.5,
|
|
36
40
|
strokeDasharray: i.dashed === !1 ? void 0 : "6 4",
|
|
@@ -38,7 +42,7 @@ function i(i, a) {
|
|
|
38
42
|
value: i.label,
|
|
39
43
|
fill: s,
|
|
40
44
|
fontSize: 11,
|
|
41
|
-
position: "
|
|
45
|
+
position: "insideTopRight"
|
|
42
46
|
} : void 0
|
|
43
47
|
}, `ref-line-${o}`);
|
|
44
48
|
}) : [];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ChartReferenceLine } from '../../../types';
|
|
2
|
+
import { SemanticIntent } from '../utils/conditionalFormat';
|
|
3
|
+
/** Same cap the embed renderer applies when it reads `referenceLines`. */
|
|
4
|
+
export declare const REFERENCE_LINE_LIMIT = 10;
|
|
5
|
+
/** Colours offered in the editor, in the order they are listed. */
|
|
6
|
+
export declare const REFERENCE_LINE_INTENTS: readonly SemanticIntent[];
|
|
7
|
+
/**
|
|
8
|
+
* Read `config.referenceLines` defensively: stored widget config is untyped
|
|
9
|
+
* JSON, so anything that is not an object with a finite `value` is dropped and
|
|
10
|
+
* unknown keys are not carried forward.
|
|
11
|
+
*/
|
|
12
|
+
export declare function normalizeReferenceLines(raw: unknown): ChartReferenceLine[];
|
|
13
|
+
/**
|
|
14
|
+
* Parse a number typed into the editor. Blank or non-numeric input returns
|
|
15
|
+
* `null` so the caller keeps the last valid value instead of storing NaN,
|
|
16
|
+
* which the chart would silently fail to draw.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseReferenceValue(text: string): number | null;
|
|
19
|
+
/** Append a horizontal dashed threshold line, unless the list is full. */
|
|
20
|
+
export declare function addReferenceLine(lines: readonly ChartReferenceLine[], value?: number): ChartReferenceLine[];
|
|
21
|
+
/**
|
|
22
|
+
* Apply a partial edit to one line. A patch key set to `undefined` removes
|
|
23
|
+
* that key (e.g. clearing a label or the band's upper value); keys the patch
|
|
24
|
+
* does not mention are kept as they were.
|
|
25
|
+
*/
|
|
26
|
+
export declare function updateReferenceLine(lines: readonly ChartReferenceLine[], index: number, patch: Partial<ChartReferenceLine>): ChartReferenceLine[];
|
|
27
|
+
export declare function removeReferenceLine(lines: readonly ChartReferenceLine[], index: number): ChartReferenceLine[];
|
|
28
|
+
/** The value to store on the widget config: omit the key when the list is empty. */
|
|
29
|
+
export declare function toReferenceLinesConfig(lines: readonly ChartReferenceLine[]): ChartReferenceLine[] | undefined;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var e = [
|
|
2
|
+
"danger",
|
|
3
|
+
"warning",
|
|
4
|
+
"success",
|
|
5
|
+
"info",
|
|
6
|
+
"neutral"
|
|
7
|
+
];
|
|
8
|
+
function t(t) {
|
|
9
|
+
return typeof t == "string" && e.includes(t);
|
|
10
|
+
}
|
|
11
|
+
function n(e) {
|
|
12
|
+
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
13
|
+
}
|
|
14
|
+
function r(e) {
|
|
15
|
+
if (!Array.isArray(e)) return [];
|
|
16
|
+
let r = [];
|
|
17
|
+
for (let i of e) {
|
|
18
|
+
if (r.length >= 10) break;
|
|
19
|
+
if (!i || typeof i != "object") continue;
|
|
20
|
+
let e = i, a = n(e.value);
|
|
21
|
+
if (a === void 0) continue;
|
|
22
|
+
let o = { value: a };
|
|
23
|
+
(e.axis === "x" || e.axis === "y") && (o.axis = e.axis);
|
|
24
|
+
let s = n(e.value2);
|
|
25
|
+
s !== void 0 && (o.value2 = s), typeof e.label == "string" && e.label !== "" && (o.label = e.label), t(e.color) && (o.color = e.color), typeof e.dashed == "boolean" && (o.dashed = e.dashed), r.push(o);
|
|
26
|
+
}
|
|
27
|
+
return r;
|
|
28
|
+
}
|
|
29
|
+
function i(e) {
|
|
30
|
+
let t = e.trim();
|
|
31
|
+
if (t === "") return null;
|
|
32
|
+
let n = Number(t);
|
|
33
|
+
return Number.isFinite(n) ? n : null;
|
|
34
|
+
}
|
|
35
|
+
function a(e, t = 0) {
|
|
36
|
+
return e.length >= 10 ? [...e] : [...e, {
|
|
37
|
+
axis: "y",
|
|
38
|
+
value: t,
|
|
39
|
+
color: "danger",
|
|
40
|
+
dashed: !0
|
|
41
|
+
}];
|
|
42
|
+
}
|
|
43
|
+
function o(e, t, n) {
|
|
44
|
+
return e.map((e, r) => {
|
|
45
|
+
if (r !== t) return e;
|
|
46
|
+
let i = { ...e };
|
|
47
|
+
for (let [e, t] of Object.entries(n)) t === void 0 ? delete i[e] : i[e] = t;
|
|
48
|
+
return i;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function s(e, t) {
|
|
52
|
+
return e.filter((e, n) => n !== t);
|
|
53
|
+
}
|
|
54
|
+
function c(e) {
|
|
55
|
+
return e.length > 0 ? [...e] : void 0;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { e as REFERENCE_LINE_INTENTS, a as addReferenceLine, r as normalizeReferenceLines, i as parseReferenceValue, s as removeReferenceLine, c as toReferenceLinesConfig, o as updateReferenceLine };
|
|
@@ -32,5 +32,10 @@ declare const COLOR_RAMPS: {
|
|
|
32
32
|
readonly red: readonly ["bg-status-error-bg/10", "bg-status-error-bg/30", "bg-status-error-bg/50", "bg-status-error-bg/70", "bg-status-error-bg/90"];
|
|
33
33
|
};
|
|
34
34
|
export type HeatmapColorScheme = keyof typeof COLOR_RAMPS;
|
|
35
|
+
/**
|
|
36
|
+
* Whether a scroll container still has content below its visible area. The
|
|
37
|
+
* 1px slack absorbs the fractional scroll offsets browsers report at the end.
|
|
38
|
+
*/
|
|
39
|
+
export declare function hasMoreBelow(scrollTop: number, clientHeight: number, scrollHeight: number): boolean;
|
|
35
40
|
export declare const HeatmapWidget: FC<HeatmapWidgetProps>;
|
|
36
41
|
export default HeatmapWidget;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { memo as e, useCallback as t,
|
|
2
|
-
import { jsx as
|
|
1
|
+
import { memo as e, useCallback as t, useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
3
3
|
//#region src/bigconsole/components/widgets/heatmap/HeatmapWidget.tsx
|
|
4
|
-
var
|
|
4
|
+
var c = {
|
|
5
5
|
blue: [
|
|
6
6
|
"bg-action-primary-bg/10",
|
|
7
7
|
"bg-action-primary-bg/30",
|
|
@@ -24,87 +24,110 @@ var a = {
|
|
|
24
24
|
"bg-status-error-bg/90"
|
|
25
25
|
]
|
|
26
26
|
};
|
|
27
|
-
function
|
|
28
|
-
return
|
|
27
|
+
function l(e) {
|
|
28
|
+
return c[e ?? "blue"] ?? c.blue;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function u(e, t, n) {
|
|
31
|
+
return e + t < n - 1;
|
|
32
|
+
}
|
|
33
|
+
function d(e, t, n, r = "blue") {
|
|
31
34
|
let i = Math.max(0, Math.min(1, (e - t) / (n - t || 1)));
|
|
32
|
-
return
|
|
35
|
+
return l(r)[i < .2 ? 0 : i < .4 ? 1 : i < .6 ? 2 : i < .8 ? 3 : 4];
|
|
33
36
|
}
|
|
34
|
-
var
|
|
35
|
-
let
|
|
37
|
+
var f = e(function({ widget: e, data: c, onClick: f }) {
|
|
38
|
+
let p = e.config, m = r(() => {
|
|
36
39
|
let e = /* @__PURE__ */ new Map();
|
|
37
|
-
return
|
|
40
|
+
return c?.cells && Array.isArray(c.cells) && c.cells.forEach((t) => {
|
|
38
41
|
e.set(`${t.row}:${t.column}`, t.value);
|
|
39
42
|
}), e;
|
|
40
|
-
}, [
|
|
41
|
-
if (!
|
|
43
|
+
}, [c?.cells]), { minValue: h, maxValue: g } = r(() => {
|
|
44
|
+
if (!c?.cells || !Array.isArray(c.cells) || !c.cells.length) return {
|
|
42
45
|
minValue: 0,
|
|
43
46
|
maxValue: 100
|
|
44
47
|
};
|
|
45
|
-
let e =
|
|
48
|
+
let e = c.cells.map((e) => e.value);
|
|
46
49
|
return {
|
|
47
|
-
minValue:
|
|
48
|
-
maxValue:
|
|
50
|
+
minValue: c.minValue ?? Math.min(...e),
|
|
51
|
+
maxValue: c.maxValue ?? Math.max(...e)
|
|
49
52
|
};
|
|
50
|
-
}, [
|
|
51
|
-
|
|
53
|
+
}, [c]), _ = t((t, n, r) => {
|
|
54
|
+
f && e.drilldowns?.length && f({
|
|
52
55
|
row: t,
|
|
53
56
|
column: n,
|
|
54
57
|
value: r
|
|
55
58
|
});
|
|
56
|
-
}, [
|
|
57
|
-
return
|
|
59
|
+
}, [f, e.drilldowns]), v = !!(f && e.drilldowns?.length), y = i(null), [b, x] = a(!1), [S, C] = a(!1);
|
|
60
|
+
return n(() => {
|
|
61
|
+
let e = y.current;
|
|
62
|
+
if (!e) return;
|
|
63
|
+
let t = () => {
|
|
64
|
+
C(e.scrollHeight > e.clientHeight + 1), x(u(e.scrollTop, e.clientHeight, e.scrollHeight));
|
|
65
|
+
};
|
|
66
|
+
t(), e.addEventListener("scroll", t, { passive: !0 });
|
|
67
|
+
let n = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
68
|
+
n?.observe(e);
|
|
69
|
+
let r = e.firstElementChild;
|
|
70
|
+
return r && n?.observe(r), () => {
|
|
71
|
+
e.removeEventListener("scroll", t), n?.disconnect();
|
|
72
|
+
};
|
|
73
|
+
}, [Array.isArray(c?.rows) ? c.rows.length : 0]), !c || !Array.isArray(c.rows) || !Array.isArray(c.columns) || !c.rows.length || !c.columns.length ? /* @__PURE__ */ o("div", {
|
|
58
74
|
className: "flex items-center justify-center h-full text-text-secondary text-sm",
|
|
59
75
|
children: "No heatmap data available"
|
|
60
|
-
}) : /* @__PURE__ */
|
|
61
|
-
className: "flex
|
|
62
|
-
children: [/* @__PURE__ */
|
|
63
|
-
className: "min-h-0 flex-1
|
|
64
|
-
children: /* @__PURE__ */
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
}) : /* @__PURE__ */ s("div", {
|
|
77
|
+
className: "flex h-full min-h-0 flex-col gap-2",
|
|
78
|
+
children: [/* @__PURE__ */ s("div", {
|
|
79
|
+
className: "relative min-h-0 flex-1",
|
|
80
|
+
children: [/* @__PURE__ */ o("div", {
|
|
81
|
+
ref: y,
|
|
82
|
+
className: "h-full overflow-auto focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
|
|
83
|
+
tabIndex: S ? 0 : void 0,
|
|
84
|
+
role: S ? "region" : void 0,
|
|
85
|
+
"aria-label": S ? `${e.title || "Heatmap"}: scroll for more rows` : void 0,
|
|
86
|
+
children: /* @__PURE__ */ s("table", {
|
|
87
|
+
className: "h-full w-full border-separate border-spacing-0.5",
|
|
88
|
+
children: [/* @__PURE__ */ o("thead", { children: /* @__PURE__ */ s("tr", { children: [/* @__PURE__ */ o("th", { className: "sticky top-0 z-[1] bg-bg-surface px-2 py-1 text-xs text-text-secondary text-left" }), c.columns.map((e) => /* @__PURE__ */ o("th", {
|
|
89
|
+
scope: "col",
|
|
90
|
+
className: "sticky top-0 z-[1] bg-bg-surface px-2 py-1 text-xs font-medium text-text-secondary text-center min-w-[60px]",
|
|
91
|
+
children: e
|
|
92
|
+
}, e))] }) }), /* @__PURE__ */ o("tbody", { children: c.rows.map((e) => /* @__PURE__ */ s("tr", { children: [/* @__PURE__ */ o("th", {
|
|
93
|
+
scope: "row",
|
|
94
|
+
className: "px-2 py-0.5 text-xs font-medium text-text-secondary text-left whitespace-nowrap",
|
|
95
|
+
children: e
|
|
96
|
+
}), c.columns.map((t) => {
|
|
97
|
+
let n = m.get(`${e}:${t}`) ?? 0;
|
|
98
|
+
return /* @__PURE__ */ o("td", {
|
|
81
99
|
className: `
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
100
|
+
h-6 rounded px-2 py-0.5 text-center text-xs align-middle
|
|
101
|
+
${d(n, h, g, p?.colorScheme)}
|
|
102
|
+
${v ? "cursor-pointer hover:ring-2 hover:ring-inset hover:ring-action-primary-bg" : ""}
|
|
103
|
+
transition-all
|
|
104
|
+
`,
|
|
105
|
+
onClick: () => _(e, t, n),
|
|
87
106
|
title: `${e} / ${t}: ${n}`,
|
|
88
|
-
children:
|
|
107
|
+
children: p?.showValues !== !1 && /* @__PURE__ */ o("span", {
|
|
89
108
|
className: "text-xs font-medium text-text-primary",
|
|
90
|
-
children: typeof n == "number" ? n.toFixed(
|
|
109
|
+
children: typeof n == "number" ? n.toFixed(p?.decimals || 0) : n
|
|
91
110
|
})
|
|
92
|
-
})
|
|
93
|
-
},
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
|
|
111
|
+
}, t);
|
|
112
|
+
})] }, e)) })]
|
|
113
|
+
})
|
|
114
|
+
}), b && /* @__PURE__ */ o("div", {
|
|
115
|
+
"aria-hidden": "true",
|
|
116
|
+
"data-testid": "heatmap-more-below",
|
|
117
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-bg-surface to-bg-surface/0"
|
|
118
|
+
})]
|
|
119
|
+
}), p?.showLegend !== !1 && /* @__PURE__ */ s("div", {
|
|
120
|
+
className: "flex shrink-0 items-center justify-center gap-2",
|
|
98
121
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ o("span", {
|
|
100
123
|
className: "text-xs text-text-secondary",
|
|
101
124
|
children: "Low"
|
|
102
125
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ o("div", {
|
|
104
127
|
className: "flex gap-0.5",
|
|
105
|
-
children:
|
|
128
|
+
children: l(p?.colorScheme).map((e) => /* @__PURE__ */ o("div", { className: `w-6 h-4 rounded ${e}` }, e))
|
|
106
129
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ o("span", {
|
|
108
131
|
className: "text-xs text-text-secondary",
|
|
109
132
|
children: "High"
|
|
110
133
|
})
|
|
@@ -113,4 +136,4 @@ var c = e(function({ widget: e, data: a, onClick: c }) {
|
|
|
113
136
|
});
|
|
114
137
|
});
|
|
115
138
|
//#endregion
|
|
116
|
-
export {
|
|
139
|
+
export { f as HeatmapWidget, f as default, u as hasMoreBelow };
|