@flanksource/clicky-ui 0.3.4 → 0.3.6

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.
Files changed (77) hide show
  1. package/dist/ai.cjs +15 -0
  2. package/dist/ai.cjs.map +1 -1
  3. package/dist/ai.js +15 -0
  4. package/dist/ai.js.map +1 -1
  5. package/dist/data/ProgressBars.cjs +194 -0
  6. package/dist/data/ProgressBars.cjs.map +1 -0
  7. package/dist/data/ProgressBars.d.ts +85 -0
  8. package/dist/data/ProgressBars.d.ts.map +1 -0
  9. package/dist/data/ProgressBars.js +194 -0
  10. package/dist/data/ProgressBars.js.map +1 -0
  11. package/dist/data/ProgressBars.model.cjs +27 -0
  12. package/dist/data/ProgressBars.model.cjs.map +1 -0
  13. package/dist/data/ProgressBars.model.d.ts +20 -0
  14. package/dist/data/ProgressBars.model.d.ts.map +1 -0
  15. package/dist/data/ProgressBars.model.js +27 -0
  16. package/dist/data/ProgressBars.model.js.map +1 -0
  17. package/dist/data/TimeseriesCoreBars.cjs +19 -173
  18. package/dist/data/TimeseriesCoreBars.cjs.map +1 -1
  19. package/dist/data/TimeseriesCoreBars.d.ts +9 -26
  20. package/dist/data/TimeseriesCoreBars.d.ts.map +1 -1
  21. package/dist/data/TimeseriesCoreBars.js +20 -174
  22. package/dist/data/TimeseriesCoreBars.js.map +1 -1
  23. package/dist/data/WorkloadCard.model.cjs.map +1 -1
  24. package/dist/data/WorkloadCard.model.d.ts +2 -2
  25. package/dist/data/WorkloadCard.model.d.ts.map +1 -1
  26. package/dist/data/WorkloadCard.model.js.map +1 -1
  27. package/dist/data/ai/SessionViewer.cjs +275 -0
  28. package/dist/data/ai/SessionViewer.cjs.map +1 -0
  29. package/dist/data/ai/SessionViewer.d.ts +33 -0
  30. package/dist/data/ai/SessionViewer.d.ts.map +1 -0
  31. package/dist/data/ai/SessionViewer.fixtures.d.ts +4 -0
  32. package/dist/data/ai/SessionViewer.fixtures.d.ts.map +1 -0
  33. package/dist/data/ai/SessionViewer.js +275 -0
  34. package/dist/data/ai/SessionViewer.js.map +1 -0
  35. package/dist/data/ai/SessionViewer.model.cjs +275 -0
  36. package/dist/data/ai/SessionViewer.model.cjs.map +1 -0
  37. package/dist/data/ai/SessionViewer.model.d.ts +87 -0
  38. package/dist/data/ai/SessionViewer.model.d.ts.map +1 -0
  39. package/dist/data/ai/SessionViewer.model.js +275 -0
  40. package/dist/data/ai/SessionViewer.model.js.map +1 -0
  41. package/dist/data/ai/SessionViewerMenu.cjs +190 -0
  42. package/dist/data/ai/SessionViewerMenu.cjs.map +1 -0
  43. package/dist/data/ai/SessionViewerMenu.d.ts +24 -0
  44. package/dist/data/ai/SessionViewerMenu.d.ts.map +1 -0
  45. package/dist/data/ai/SessionViewerMenu.js +190 -0
  46. package/dist/data/ai/SessionViewerMenu.js.map +1 -0
  47. package/dist/data/ai/index.d.ts +3 -0
  48. package/dist/data/ai/index.d.ts.map +1 -1
  49. package/dist/data/ai/session-categories.cjs +219 -0
  50. package/dist/data/ai/session-categories.cjs.map +1 -0
  51. package/dist/data/ai/session-categories.d.ts +36 -0
  52. package/dist/data/ai/session-categories.d.ts.map +1 -0
  53. package/dist/data/ai/session-categories.js +219 -0
  54. package/dist/data/ai/session-categories.js.map +1 -0
  55. package/dist/data/test-runner/TestRunner.fixtures.d.ts.map +1 -1
  56. package/dist/data/version-info.cjs +3 -3
  57. package/dist/data/version-info.cjs.map +1 -1
  58. package/dist/data/version-info.js +3 -3
  59. package/dist/data/version-info.js.map +1 -1
  60. package/dist/data.cjs +4 -2
  61. package/dist/data.cjs.map +1 -1
  62. package/dist/data.d.ts +3 -2
  63. package/dist/data.d.ts.map +1 -1
  64. package/dist/data.js +4 -2
  65. package/dist/data.js.map +1 -1
  66. package/dist/index.cjs +4 -2
  67. package/dist/index.cjs.map +1 -1
  68. package/dist/index.js +4 -2
  69. package/dist/index.js.map +1 -1
  70. package/dist/styles.css +1 -1
  71. package/package.json +1 -1
  72. package/dist/data/TimeseriesCoreBars.model.cjs +0 -27
  73. package/dist/data/TimeseriesCoreBars.model.cjs.map +0 -1
  74. package/dist/data/TimeseriesCoreBars.model.d.ts +0 -20
  75. package/dist/data/TimeseriesCoreBars.model.d.ts.map +0 -1
  76. package/dist/data/TimeseriesCoreBars.model.js +0 -27
  77. package/dist/data/TimeseriesCoreBars.model.js.map +0 -1
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const clamp01 = (n) => Math.min(1, Math.max(0, n));
4
+ function deriveProgressBars(usage, limit, perBar = 1e3) {
5
+ const hasUsage = usage !== void 0;
6
+ const usageUnits = (usage ?? 0) / perBar;
7
+ const hasLimit = limit !== void 0 && limit > 0;
8
+ const limitUnits = hasLimit ? limit / perBar : void 0;
9
+ const barCount = Math.max(
10
+ 1,
11
+ Math.ceil(hasLimit ? limitUnits : usageUnits)
12
+ );
13
+ const pct = hasLimit ? Math.min(100, Math.round(usageUnits / limitUnits * 100)) : 0;
14
+ const bars = Array.from({ length: barCount }, (_, i) => ({
15
+ fill: clamp01(usageUnits - i)
16
+ }));
17
+ return {
18
+ hasUsage,
19
+ usageUnits,
20
+ barCount,
21
+ pct,
22
+ bars,
23
+ ...limitUnits !== void 0 && { limitUnits }
24
+ };
25
+ }
26
+ exports.deriveProgressBars = deriveProgressBars;
27
+ //# sourceMappingURL=ProgressBars.model.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressBars.model.cjs","sources":["../../src/data/ProgressBars.model.ts"],"sourcesContent":["export interface ProgressBarFill {\n /** Fraction of this bar that is in use, in [0, 1]. */\n fill: number;\n}\n\nexport interface ProgressBarsModel {\n /** Whether a usage reading was available. */\n hasUsage: boolean;\n /** Usage expressed in bar-units (raw / perBar). */\n usageUnits: number;\n /** Capacity in bar-units; undefined when no limit was resolved. */\n limitUnits?: number;\n /** Number of bars rendered (one per bar-unit of capacity). */\n barCount: number;\n /** Utilisation percentage of capacity; 0 when unbounded. */\n pct: number;\n /** Per-bar fill fractions, left to right. */\n bars: ProgressBarFill[];\n}\n\nconst clamp01 = (n: number): number => Math.min(1, Math.max(0, n));\n\n// deriveProgressBars turns the latest usage/limit readings into a per-bar model: one\n// bar per unit of capacity (ceil of the limit), filled left to right by usage so\n// the bar straddling the usage boundary is partially filled and the remainder\n// stays empty. When the limit is missing or 0 the bar count falls back to the\n// ceiling of the usage so an unbounded reading still renders sensibly. `perBar`\n// is the raw value that fills one bar (default 1000 = millicores per core); pass\n// e.g. 1 GiB to render one bar per gigabyte of memory.\nexport function deriveProgressBars(\n usage: number | undefined,\n limit: number | undefined,\n perBar = 1000,\n): ProgressBarsModel {\n const hasUsage = usage !== undefined;\n const usageUnits = (usage ?? 0) / perBar;\n const hasLimit = limit !== undefined && limit > 0;\n const limitUnits = hasLimit ? (limit as number) / perBar : undefined;\n\n const barCount = Math.max(\n 1,\n Math.ceil(hasLimit ? (limitUnits as number) : usageUnits),\n );\n const pct = hasLimit\n ? Math.min(100, Math.round((usageUnits / (limitUnits as number)) * 100))\n : 0;\n\n const bars: ProgressBarFill[] = Array.from({ length: barCount }, (_, i) => ({\n fill: clamp01(usageUnits - i),\n }));\n\n return {\n hasUsage,\n usageUnits,\n barCount,\n pct,\n bars,\n ...(limitUnits !== undefined && { limitUnits }),\n };\n}\n"],"names":[],"mappings":";;AAoBA,MAAM,UAAU,CAAC,MAAsB,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;AAS1D,SAAS,mBACd,OACA,OACA,SAAS,KACU;AACnB,QAAM,WAAW,UAAU;AAC3B,QAAM,cAAc,SAAS,KAAK;AAClC,QAAM,WAAW,UAAU,UAAa,QAAQ;AAChD,QAAM,aAAa,WAAY,QAAmB,SAAS;AAE3D,QAAM,WAAW,KAAK;AAAA,IACpB;AAAA,IACA,KAAK,KAAK,WAAY,aAAwB,UAAU;AAAA,EAAA;AAE1D,QAAM,MAAM,WACR,KAAK,IAAI,KAAK,KAAK,MAAO,aAAc,aAAyB,GAAG,CAAC,IACrE;AAEJ,QAAM,OAA0B,MAAM,KAAK,EAAE,QAAQ,SAAA,GAAY,CAAC,GAAG,OAAO;AAAA,IAC1E,MAAM,QAAQ,aAAa,CAAC;AAAA,EAAA,EAC5B;AAEF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,eAAe,UAAa,EAAE,WAAA;AAAA,EAAW;AAEjD;;"}
@@ -0,0 +1,20 @@
1
+ export interface ProgressBarFill {
2
+ /** Fraction of this bar that is in use, in [0, 1]. */
3
+ fill: number;
4
+ }
5
+ export interface ProgressBarsModel {
6
+ /** Whether a usage reading was available. */
7
+ hasUsage: boolean;
8
+ /** Usage expressed in bar-units (raw / perBar). */
9
+ usageUnits: number;
10
+ /** Capacity in bar-units; undefined when no limit was resolved. */
11
+ limitUnits?: number;
12
+ /** Number of bars rendered (one per bar-unit of capacity). */
13
+ barCount: number;
14
+ /** Utilisation percentage of capacity; 0 when unbounded. */
15
+ pct: number;
16
+ /** Per-bar fill fractions, left to right. */
17
+ bars: ProgressBarFill[];
18
+ }
19
+ export declare function deriveProgressBars(usage: number | undefined, limit: number | undefined, perBar?: number): ProgressBarsModel;
20
+ //# sourceMappingURL=ProgressBars.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressBars.model.d.ts","sourceRoot":"","sources":["../../src/data/ProgressBars.model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,GAAG,EAAE,MAAM,CAAC;IACZ,6CAA6C;IAC7C,IAAI,EAAE,eAAe,EAAE,CAAC;CACzB;AAWD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,SAAO,GACZ,iBAAiB,CA0BnB"}
@@ -0,0 +1,27 @@
1
+ const clamp01 = (n) => Math.min(1, Math.max(0, n));
2
+ function deriveProgressBars(usage, limit, perBar = 1e3) {
3
+ const hasUsage = usage !== void 0;
4
+ const usageUnits = (usage ?? 0) / perBar;
5
+ const hasLimit = limit !== void 0 && limit > 0;
6
+ const limitUnits = hasLimit ? limit / perBar : void 0;
7
+ const barCount = Math.max(
8
+ 1,
9
+ Math.ceil(hasLimit ? limitUnits : usageUnits)
10
+ );
11
+ const pct = hasLimit ? Math.min(100, Math.round(usageUnits / limitUnits * 100)) : 0;
12
+ const bars = Array.from({ length: barCount }, (_, i) => ({
13
+ fill: clamp01(usageUnits - i)
14
+ }));
15
+ return {
16
+ hasUsage,
17
+ usageUnits,
18
+ barCount,
19
+ pct,
20
+ bars,
21
+ ...limitUnits !== void 0 && { limitUnits }
22
+ };
23
+ }
24
+ export {
25
+ deriveProgressBars
26
+ };
27
+ //# sourceMappingURL=ProgressBars.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressBars.model.js","sources":["../../src/data/ProgressBars.model.ts"],"sourcesContent":["export interface ProgressBarFill {\n /** Fraction of this bar that is in use, in [0, 1]. */\n fill: number;\n}\n\nexport interface ProgressBarsModel {\n /** Whether a usage reading was available. */\n hasUsage: boolean;\n /** Usage expressed in bar-units (raw / perBar). */\n usageUnits: number;\n /** Capacity in bar-units; undefined when no limit was resolved. */\n limitUnits?: number;\n /** Number of bars rendered (one per bar-unit of capacity). */\n barCount: number;\n /** Utilisation percentage of capacity; 0 when unbounded. */\n pct: number;\n /** Per-bar fill fractions, left to right. */\n bars: ProgressBarFill[];\n}\n\nconst clamp01 = (n: number): number => Math.min(1, Math.max(0, n));\n\n// deriveProgressBars turns the latest usage/limit readings into a per-bar model: one\n// bar per unit of capacity (ceil of the limit), filled left to right by usage so\n// the bar straddling the usage boundary is partially filled and the remainder\n// stays empty. When the limit is missing or 0 the bar count falls back to the\n// ceiling of the usage so an unbounded reading still renders sensibly. `perBar`\n// is the raw value that fills one bar (default 1000 = millicores per core); pass\n// e.g. 1 GiB to render one bar per gigabyte of memory.\nexport function deriveProgressBars(\n usage: number | undefined,\n limit: number | undefined,\n perBar = 1000,\n): ProgressBarsModel {\n const hasUsage = usage !== undefined;\n const usageUnits = (usage ?? 0) / perBar;\n const hasLimit = limit !== undefined && limit > 0;\n const limitUnits = hasLimit ? (limit as number) / perBar : undefined;\n\n const barCount = Math.max(\n 1,\n Math.ceil(hasLimit ? (limitUnits as number) : usageUnits),\n );\n const pct = hasLimit\n ? Math.min(100, Math.round((usageUnits / (limitUnits as number)) * 100))\n : 0;\n\n const bars: ProgressBarFill[] = Array.from({ length: barCount }, (_, i) => ({\n fill: clamp01(usageUnits - i),\n }));\n\n return {\n hasUsage,\n usageUnits,\n barCount,\n pct,\n bars,\n ...(limitUnits !== undefined && { limitUnits }),\n };\n}\n"],"names":[],"mappings":"AAoBA,MAAM,UAAU,CAAC,MAAsB,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;AAS1D,SAAS,mBACd,OACA,OACA,SAAS,KACU;AACnB,QAAM,WAAW,UAAU;AAC3B,QAAM,cAAc,SAAS,KAAK;AAClC,QAAM,WAAW,UAAU,UAAa,QAAQ;AAChD,QAAM,aAAa,WAAY,QAAmB,SAAS;AAE3D,QAAM,WAAW,KAAK;AAAA,IACpB;AAAA,IACA,KAAK,KAAK,WAAY,aAAwB,UAAU;AAAA,EAAA;AAE1D,QAAM,MAAM,WACR,KAAK,IAAI,KAAK,KAAK,MAAO,aAAc,aAAyB,GAAG,CAAC,IACrE;AAEJ,QAAM,OAA0B,MAAM,KAAK,EAAE,QAAQ,SAAA,GAAY,CAAC,GAAG,OAAO;AAAA,IAC1E,MAAM,QAAQ,aAAa,CAAC;AAAA,EAAA,EAC5B;AAEF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,eAAe,UAAa,EAAE,WAAA;AAAA,EAAW;AAEjD;"}
@@ -3,10 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const reactQuery = require("@tanstack/react-query");
5
5
  const react = require("react");
6
- const utils = require("../lib/utils.cjs");
7
- const Icon = require("./Icon.cjs");
8
- const TimeseriesCoreBars_model = require("./TimeseriesCoreBars.model.cjs");
9
- const GaugeHoverCard = require("./GaugeHoverCard.cjs");
6
+ const ProgressBars = require("./ProgressBars.cjs");
10
7
  const gaugeStats = require("./gauge-stats.cjs");
11
8
  const defaultFetcher = async (url) => {
12
9
  const res = await fetch(url);
@@ -19,36 +16,6 @@ function latestValue(resp) {
19
16
  if (!points || points.length === 0) return void 0;
20
17
  return (_a = points[points.length - 1]) == null ? void 0 : _a.value;
21
18
  }
22
- function toneClass(pct, [warn, danger]) {
23
- if (pct >= danger) return "bg-red-500";
24
- if (pct >= warn) return "bg-amber-500";
25
- return "bg-emerald-500";
26
- }
27
- function CoreBarsIcon({ icon }) {
28
- if (typeof icon === "string") {
29
- return /* @__PURE__ */ jsxRuntime.jsx(
30
- Icon.Icon,
31
- {
32
- name: icon,
33
- width: 14,
34
- height: 14,
35
- className: "text-muted-foreground"
36
- }
37
- );
38
- }
39
- return /* @__PURE__ */ jsxRuntime.jsx(
40
- Icon.Icon,
41
- {
42
- icon,
43
- width: 14,
44
- height: 14,
45
- className: "text-muted-foreground"
46
- }
47
- );
48
- }
49
- function formatCores(cores) {
50
- return Number.isInteger(cores) ? String(cores) : cores.toFixed(1);
51
- }
52
19
  function TimeseriesCoreBars({
53
20
  baseUrl = "",
54
21
  value,
@@ -69,10 +36,6 @@ function TimeseriesCoreBars({
69
36
  className
70
37
  }) {
71
38
  var _a, _b, _c, _d;
72
- const perBar = (unit == null ? void 0 : unit.perBar) ?? 1e3;
73
- const unitLabel = (unit == null ? void 0 : unit.label) ?? "cores";
74
- const barLabel = (unit == null ? void 0 : unit.barLabel) ?? "core";
75
- const formatUnits = (unit == null ? void 0 : unit.format) ?? formatCores;
76
39
  const maxIsSeries = typeof max === "object";
77
40
  const maxSeries = maxIsSeries ? max : void 0;
78
41
  const ids = react.useMemo(() => {
@@ -103,144 +66,27 @@ function TimeseriesCoreBars({
103
66
  const rawMax = latestValue((_b = results[1]) == null ? void 0 : _b.data);
104
67
  limit = rawMax === void 0 ? void 0 : maxSeries.transform ? maxSeries.transform(rawMax) : rawMax;
105
68
  }
106
- const model = TimeseriesCoreBars_model.deriveCoreBars(usage, limit, perBar);
107
- const tone = toneClass(model.pct, thresholds);
108
- const usageText = formatUnits(model.usageCores);
109
- const capacityText = model.limitCores !== void 0 ? formatUnits(model.limitCores) : "?";
110
- const caption = !model.hasUsage ? "—" : showCapacity ? `${usageText} / ${capacityText} ${unitLabel}` : `${usageText} ${unitLabel}`;
111
- const compactCaption = !model.hasUsage ? "—" : showCapacity ? `${usageText}/${capacityText} ${unitLabel}` : `${usageText} ${unitLabel}`;
112
- const titleText = `${title}: ${compactCaption}`;
113
- const isCell = variant === "cell";
114
- const pctTone = model.limitCores === void 0 ? void 0 : model.pct >= thresholds[1] ? "text-red-500" : model.pct >= thresholds[0] ? "text-amber-500" : "text-emerald-500";
115
- const stats = gaugeStats.seriesStats(
116
- (_d = (_c = results[0]) == null ? void 0 : _c.data) == null ? void 0 : _d.points,
117
- (v) => (value.transform ? value.transform(v) : v) / perBar
118
- );
119
- const fmt = (n) => `${formatUnits(n)} ${unitLabel}`;
120
- const hoverRows = model.hasUsage ? [
121
- { label: "Current", value: fmt(model.usageCores), ...pctTone ? { tone: pctTone } : {} },
122
- ...stats ? [
123
- { label: "Min", value: fmt(stats.min) },
124
- { label: "Max", value: fmt(stats.max) },
125
- { label: "Avg", value: fmt(stats.avg) }
126
- ] : [],
127
- ...model.limitCores !== void 0 ? [{ label: "Capacity", value: fmt(model.limitCores) }] : []
128
- ] : [];
129
- const resolvedOrientation = orientation ?? "vertical";
130
- const isDense = model.coreCount > 4;
131
- const valueText = isCell ? compactCaption : caption;
132
- const hiddenAccessibleText = !showLabel || !showValue ? titleText : void 0;
133
- const bars = /* @__PURE__ */ jsxRuntime.jsx(
134
- "span",
135
- {
136
- className: utils.cn(
137
- "flex shrink-0",
138
- resolvedOrientation === "vertical" ? utils.cn("items-end", isCell ? "h-4 gap-px" : "h-10 gap-0.5") : utils.cn(
139
- "flex-col justify-center",
140
- isCell ? "h-4 w-10 gap-px" : "h-10 w-16 gap-0.5"
141
- )
142
- ),
143
- "aria-hidden": isCell ? "true" : void 0,
144
- "data-orientation": resolvedOrientation,
145
- "data-core-count": model.coreCount,
146
- "data-core-density": isDense ? "compact" : "default",
147
- children: model.bars.map((bar, i) => {
148
- const corePct = Math.round(bar.fill * 100);
149
- return /* @__PURE__ */ jsxRuntime.jsx(
150
- "span",
151
- {
152
- className: utils.cn(
153
- "relative overflow-hidden bg-muted",
154
- resolvedOrientation === "vertical" ? utils.cn(
155
- "h-full",
156
- isCell ? isDense ? "w-[3px] rounded-[2px]" : "w-1.5 rounded-[2px]" : isDense ? "w-1 rounded-sm" : "w-2 rounded-sm"
157
- ) : utils.cn("min-h-px w-full flex-1 rounded-[2px]")
158
- ),
159
- title: `${barLabel} ${i + 1}: ${corePct}%`,
160
- "aria-label": !isCell ? `${barLabel} ${i + 1}: ${corePct}%` : void 0,
161
- "data-fill": bar.fill,
162
- children: /* @__PURE__ */ jsxRuntime.jsx(
163
- "span",
164
- {
165
- className: utils.cn(
166
- "absolute bottom-0 left-0 transition-all duration-300",
167
- tone
168
- ),
169
- style: resolvedOrientation === "vertical" ? { height: `${corePct}%`, right: 0 } : { width: `${corePct}%`, top: 0 }
170
- }
171
- )
172
- },
173
- i
174
- );
175
- })
176
- }
177
- );
178
- const valueNode = showValue ? /* @__PURE__ */ jsxRuntime.jsx(
179
- "span",
180
- {
181
- className: utils.cn(
182
- "shrink-0 font-semibold tabular-nums text-foreground",
183
- isCell ? null : "text-xs"
184
- ),
185
- children: valueText
186
- }
187
- ) : null;
188
- const label = icon || showLabel ? /* @__PURE__ */ jsxRuntime.jsxs(
189
- "span",
190
- {
191
- className: utils.cn(
192
- "inline-flex min-w-0 items-center gap-1 text-xs text-muted-foreground"
193
- ),
194
- children: [
195
- icon ? /* @__PURE__ */ jsxRuntime.jsx(CoreBarsIcon, { icon }) : null,
196
- showLabel ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: title }) : null
197
- ]
198
- }
199
- ) : null;
200
- const useHover = hoverCard && hoverRows.length > 0;
201
- const footer = `over last ${range}`;
202
- if (isCell) {
203
- const cell = /* @__PURE__ */ jsxRuntime.jsxs(
204
- "span",
205
- {
206
- className: utils.cn(
207
- "inline-flex min-w-0 items-center gap-1.5 whitespace-nowrap align-middle text-xs",
208
- className
209
- ),
210
- ...useHover ? {} : { title: titleText },
211
- "aria-label": useHover ? titleText : hiddenAccessibleText,
212
- children: [
213
- label,
214
- bars,
215
- valueNode
216
- ]
217
- }
218
- );
219
- return useHover ? /* @__PURE__ */ jsxRuntime.jsx(GaugeHoverCard.GaugeHoverCard, { title, rows: hoverRows, footer, trigger: cell }) : cell;
220
- }
221
- const block = /* @__PURE__ */ jsxRuntime.jsxs(
222
- "div",
223
- {
224
- className: utils.cn("flex flex-col items-center gap-1", className),
225
- ...useHover ? {} : { title: hiddenAccessibleText },
226
- "aria-label": useHover ? titleText : hiddenAccessibleText,
227
- children: [
228
- bars,
229
- valueNode,
230
- label
231
- ]
232
- }
233
- );
234
- return useHover ? /* @__PURE__ */ jsxRuntime.jsx(
235
- GaugeHoverCard.GaugeHoverCard,
69
+ const stats = gaugeStats.seriesStats((_d = (_c = results[0]) == null ? void 0 : _c.data) == null ? void 0 : _d.points, value.transform);
70
+ return /* @__PURE__ */ jsxRuntime.jsx(
71
+ ProgressBars.ProgressBars,
236
72
  {
73
+ usage,
74
+ stats,
237
75
  title,
238
- rows: hoverRows,
239
- footer,
240
- trigger: block,
241
- className: "w-full justify-center"
76
+ thresholds,
77
+ variant,
78
+ showLabel,
79
+ showValue,
80
+ showCapacity,
81
+ hoverCard,
82
+ hoverFooter: `over last ${range}`,
83
+ ...limit !== void 0 ? { max: limit } : {},
84
+ ...unit !== void 0 ? { unit } : {},
85
+ ...icon !== void 0 ? { icon } : {},
86
+ ...orientation !== void 0 ? { orientation } : {},
87
+ ...className !== void 0 ? { className } : {}
242
88
  }
243
- ) : block;
89
+ );
244
90
  }
245
91
  exports.TimeseriesCoreBars = TimeseriesCoreBars;
246
92
  //# sourceMappingURL=TimeseriesCoreBars.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeseriesCoreBars.cjs","sources":["../../src/data/TimeseriesCoreBars.tsx"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { useMemo } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Icon, type StaticIconComponent } from \"./Icon\";\nimport type { GaugeSeries } from \"./TimeseriesGauge\";\nimport type { TimeseriesResponse } from \"./TimeseriesPanel\";\nimport { deriveCoreBars } from \"./TimeseriesCoreBars.model\";\nimport { GaugeHoverCard, type GaugeHoverRow } from \"./GaugeHoverCard\";\nimport { seriesStats } from \"./gauge-stats\";\n\nexport type TimeseriesCoreBarsVariant = \"default\" | \"cell\";\nexport type TimeseriesCoreBarsOrientation = \"horizontal\" | \"vertical\";\n\n/**\n * Describes what one bar represents, letting the same component render CPU cores,\n * memory gigabytes, or any other quantised capacity. Defaults model CPU cores.\n */\nexport interface CoreBarsUnit {\n /** Raw value that fills one bar, in the domain of `value`/`max`. Default 1000 (millicores → 1 core). */\n perBar?: number;\n /** Caption/tooltip suffix naming the unit, plural. Default \"cores\". */\n label?: string;\n /** Per-bar hover tooltip noun, singular. Default \"core\". */\n barLabel?: string;\n /** Format a bar-unit count for the caption. Default: integers as-is, else 1 decimal. */\n format?: (units: number) => string;\n}\n\nexport interface TimeseriesCoreBarsProps {\n /** Common prefix; the value/max requests are `baseUrl + id`. */\n baseUrl?: string;\n /** The metric whose latest value (CPU millicores) fills the bars. */\n value: GaugeSeries;\n /**\n * The capacity. Either a `.limit`-style metric series (its latest value) or a\n * fixed number, in the same raw domain as `value`. Determines the number of\n * bars (one per `unit.perBar`). When omitted or 0, the bar count falls back to\n * the ceiling of the usage so an unbounded reading still renders.\n */\n max?: GaugeSeries | number;\n /** What one bar represents. Defaults to CPU cores (perBar 1000, label \"cores\"). */\n unit?: CoreBarsUnit;\n title: string;\n /** Iconify name or static icon component shown beside the label. */\n icon?: string | StaticIconComponent;\n /** Look-back window passed as ?since=; defaults to \"1h\". */\n range?: string;\n /** Poll interval in ms; defaults to 5000. Pass 0 to disable polling. */\n refreshMs?: number;\n /**\n * Utilisation thresholds (percent of capacity) at which the fill turns amber\n * then red. Defaults to [75, 90].\n */\n thresholds?: [warning: number, danger: number];\n /** Visual density/layout. `cell` is a compact inline form for table/grid cells. */\n variant?: TimeseriesCoreBarsVariant;\n /** Show the title text. Icons and values remain visible unless separately hidden. */\n showLabel?: boolean;\n /** Show the value/capacity caption. Icons and bars remain visible when false. */\n showValue?: boolean;\n /**\n * Include the capacity in the caption (\"2.3 / 4 cores\"). Defaults to false — the\n * caption shows only the current value (\"2.3 cores\") since the bars already\n * convey capacity. Set true to append the \"/ <capacity>\".\n */\n showCapacity?: boolean;\n /** Bar direction. Vertical bars fill bottom-up; horizontal bars fill left-to-right. */\n orientation?: TimeseriesCoreBarsOrientation;\n /**\n * Wrap the bars in a hover card summarising the metric (label + current / min /\n * max / avg / capacity over the window). Defaults to true.\n */\n hoverCard?: boolean;\n /** Override the default fetch (e.g. to route through an app's API client). */\n fetcher?: (url: string) => Promise<TimeseriesResponse>;\n className?: string;\n}\n\nconst defaultFetcher = async (url: string): Promise<TimeseriesResponse> => {\n const res = await fetch(url);\n if (!res.ok) throw new Error(`metrics request failed: ${res.status}`);\n return res.json();\n};\n\nfunction latestValue(resp: TimeseriesResponse | undefined): number | undefined {\n const points = resp?.points;\n if (!points || points.length === 0) return undefined;\n return points[points.length - 1]?.value;\n}\n\nfunction toneClass(pct: number, [warn, danger]: [number, number]): string {\n if (pct >= danger) return \"bg-red-500\";\n if (pct >= warn) return \"bg-amber-500\";\n return \"bg-emerald-500\";\n}\n\nfunction CoreBarsIcon({ icon }: { icon: string | StaticIconComponent }) {\n if (typeof icon === \"string\") {\n return (\n <Icon\n name={icon}\n width={14}\n height={14}\n className=\"text-muted-foreground\"\n />\n );\n }\n return (\n <Icon\n icon={icon}\n width={14}\n height={14}\n className=\"text-muted-foreground\"\n />\n );\n}\n\nfunction formatCores(cores: number): string {\n return Number.isInteger(cores) ? String(cores) : cores.toFixed(1);\n}\n\n/**\n * TimeseriesCoreBars renders CPU utilisation as a row of vertical bars — one bar\n * per core (the ceiling of the CPU limit) — filled left to right by the latest\n * usage. The bar that straddles the usage boundary is partially filled (\"blocked\n * out\") to show the fractional core in use, and the trailing bars stay empty to\n * show headroom. Both usage and limit are read live from the timeseries store,\n * mirroring TimeseriesGauge's data plumbing; the bar colour crosses warning and\n * danger thresholds. A \"<used> / <cores>\" caption sits below with the icon+title.\n */\nexport function TimeseriesCoreBars({\n baseUrl = \"\",\n value,\n max,\n unit,\n title,\n icon,\n range = \"1h\",\n refreshMs = 5000,\n thresholds = [75, 90],\n variant = \"default\",\n showLabel = true,\n showValue = true,\n showCapacity = false,\n orientation,\n hoverCard = true,\n fetcher = defaultFetcher,\n className,\n}: TimeseriesCoreBarsProps) {\n const perBar = unit?.perBar ?? 1000;\n const unitLabel = unit?.label ?? \"cores\";\n const barLabel = unit?.barLabel ?? \"core\";\n const formatUnits = unit?.format ?? formatCores;\n const maxIsSeries = typeof max === \"object\";\n const maxSeries = maxIsSeries ? max : undefined;\n const ids = useMemo(() => {\n const list = [value.id];\n if (maxSeries) list.push(maxSeries.id);\n return list;\n }, [value.id, maxSeries]);\n\n const results = useQueries({\n queries: ids.map((id) => {\n const u = new URL(baseUrl + id, window.location.origin);\n if (range) u.searchParams.set(\"since\", range);\n const requestUrl = u.pathname + u.search;\n return {\n queryKey: [\"timeseries\", requestUrl],\n queryFn: () => fetcher(requestUrl),\n refetchInterval: refreshMs > 0 ? refreshMs : false,\n staleTime: 0,\n retry: 0,\n };\n }),\n });\n\n const rawValue = latestValue(results[0]?.data);\n const usage =\n rawValue === undefined\n ? undefined\n : value.transform\n ? value.transform(rawValue)\n : rawValue;\n\n let limit: number | undefined;\n if (typeof max === \"number\") {\n limit = max;\n } else if (maxSeries) {\n const rawMax = latestValue(results[1]?.data);\n limit =\n rawMax === undefined\n ? undefined\n : maxSeries.transform\n ? maxSeries.transform(rawMax)\n : rawMax;\n }\n\n const model = deriveCoreBars(usage, limit, perBar);\n const tone = toneClass(model.pct, thresholds);\n const usageText = formatUnits(model.usageCores);\n const capacityText =\n model.limitCores !== undefined ? formatUnits(model.limitCores) : \"?\";\n const caption = !model.hasUsage\n ? \"—\"\n : showCapacity\n ? `${usageText} / ${capacityText} ${unitLabel}`\n : `${usageText} ${unitLabel}`;\n const compactCaption = !model.hasUsage\n ? \"—\"\n : showCapacity\n ? `${usageText}/${capacityText} ${unitLabel}`\n : `${usageText} ${unitLabel}`;\n const titleText = `${title}: ${compactCaption}`;\n const isCell = variant === \"cell\";\n\n // Hover card: reduce the fetched points to current/min/max/avg in bar-units\n // (raw value transformed, then divided by perBar) so they read in the same unit\n // as the caption. A bounded reading colours the current row by its threshold.\n const pctTone =\n model.limitCores === undefined\n ? undefined\n : model.pct >= thresholds[1]\n ? \"text-red-500\"\n : model.pct >= thresholds[0]\n ? \"text-amber-500\"\n : \"text-emerald-500\";\n const stats = seriesStats(results[0]?.data?.points, (v) =>\n (value.transform ? value.transform(v) : v) / perBar,\n );\n const fmt = (n: number) => `${formatUnits(n)} ${unitLabel}`;\n const hoverRows: GaugeHoverRow[] = model.hasUsage\n ? [\n { label: \"Current\", value: fmt(model.usageCores), ...(pctTone ? { tone: pctTone } : {}) },\n ...(stats\n ? [\n { label: \"Min\", value: fmt(stats.min) },\n { label: \"Max\", value: fmt(stats.max) },\n { label: \"Avg\", value: fmt(stats.avg) },\n ]\n : []),\n ...(model.limitCores !== undefined\n ? [{ label: \"Capacity\", value: fmt(model.limitCores) }]\n : []),\n ]\n : [];\n\n const resolvedOrientation = orientation ?? \"vertical\";\n const isDense = model.coreCount > 4;\n const valueText = isCell ? compactCaption : caption;\n const hiddenAccessibleText = !showLabel || !showValue ? titleText : undefined;\n const bars = (\n <span\n className={cn(\n \"flex shrink-0\",\n resolvedOrientation === \"vertical\"\n ? cn(\"items-end\", isCell ? \"h-4 gap-px\" : \"h-10 gap-0.5\")\n : cn(\n \"flex-col justify-center\",\n isCell ? \"h-4 w-10 gap-px\" : \"h-10 w-16 gap-0.5\",\n ),\n )}\n aria-hidden={isCell ? \"true\" : undefined}\n data-orientation={resolvedOrientation}\n data-core-count={model.coreCount}\n data-core-density={isDense ? \"compact\" : \"default\"}\n >\n {model.bars.map((bar, i) => {\n const corePct = Math.round(bar.fill * 100);\n return (\n <span\n key={i}\n className={cn(\n \"relative overflow-hidden bg-muted\",\n resolvedOrientation === \"vertical\"\n ? cn(\n \"h-full\",\n isCell\n ? isDense\n ? \"w-[3px] rounded-[2px]\"\n : \"w-1.5 rounded-[2px]\"\n : isDense\n ? \"w-1 rounded-sm\"\n : \"w-2 rounded-sm\",\n )\n : cn(\"min-h-px w-full flex-1 rounded-[2px]\"),\n )}\n title={`${barLabel} ${i + 1}: ${corePct}%`}\n aria-label={!isCell ? `${barLabel} ${i + 1}: ${corePct}%` : undefined}\n data-fill={bar.fill}\n >\n <span\n className={cn(\n \"absolute bottom-0 left-0 transition-all duration-300\",\n tone,\n )}\n style={\n resolvedOrientation === \"vertical\"\n ? { height: `${corePct}%`, right: 0 }\n : { width: `${corePct}%`, top: 0 }\n }\n />\n </span>\n );\n })}\n </span>\n );\n const valueNode = showValue ? (\n <span\n className={cn(\n \"shrink-0 font-semibold tabular-nums text-foreground\",\n isCell ? null : \"text-xs\",\n )}\n >\n {valueText}\n </span>\n ) : null;\n const label =\n icon || showLabel ? (\n <span\n className={cn(\n \"inline-flex min-w-0 items-center gap-1 text-xs text-muted-foreground\",\n )}\n >\n {icon ? <CoreBarsIcon icon={icon} /> : null}\n {showLabel ? <span className=\"min-w-0 truncate\">{title}</span> : null}\n </span>\n ) : null;\n\n const useHover = hoverCard && hoverRows.length > 0;\n const footer = `over last ${range}`;\n\n if (isCell) {\n const cell = (\n <span\n className={cn(\n \"inline-flex min-w-0 items-center gap-1.5 whitespace-nowrap align-middle text-xs\",\n className,\n )}\n {...(useHover ? {} : { title: titleText })}\n aria-label={useHover ? titleText : hiddenAccessibleText}\n >\n {label}\n {bars}\n {valueNode}\n </span>\n );\n return useHover ? (\n <GaugeHoverCard title={title} rows={hoverRows} footer={footer} trigger={cell} />\n ) : (\n cell\n );\n }\n\n const block = (\n <div\n className={cn(\"flex flex-col items-center gap-1\", className)}\n {...(useHover ? {} : { title: hiddenAccessibleText })}\n aria-label={useHover ? titleText : hiddenAccessibleText}\n >\n {bars}\n {valueNode}\n {label}\n </div>\n );\n return useHover ? (\n <GaugeHoverCard\n title={title}\n rows={hoverRows}\n footer={footer}\n trigger={block}\n className=\"w-full justify-center\"\n />\n ) : (\n block\n );\n}\n"],"names":["jsx","Icon","useMemo","useQueries","deriveCoreBars","seriesStats","cn","jsxs","GaugeHoverCard"],"mappings":";;;;;;;;;;AA8EA,MAAM,iBAAiB,OAAO,QAA6C;AACzE,QAAM,MAAM,MAAM,MAAM,GAAG;AAC3B,MAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,2BAA2B,IAAI,MAAM,EAAE;AACpE,SAAO,IAAI,KAAA;AACb;AAEA,SAAS,YAAY,MAA0D;;AAC7E,QAAM,SAAS,6BA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MACT,WAAU;AAAA,IAAA;AAAA,EAAA,IAGZ;AAEJ;;"}
1
+ {"version":3,"file":"TimeseriesCoreBars.cjs","sources":["../../src/data/TimeseriesCoreBars.tsx"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { useMemo } from \"react\";\nimport { type StaticIconComponent } from \"./Icon\";\nimport type { GaugeSeries } from \"./TimeseriesGauge\";\nimport type { TimeseriesResponse } from \"./TimeseriesPanel\";\nimport {\n ProgressBars,\n type ProgressBarsOrientation,\n type ProgressBarsUnit,\n type ProgressBarsVariant,\n} from \"./ProgressBars\";\nimport { seriesStats } from \"./gauge-stats\";\n\nexport interface TimeseriesCoreBarsProps {\n /** Common prefix; the value/max requests are `baseUrl + id`. */\n baseUrl?: string;\n /** The metric whose latest value (CPU millicores) fills the bars. */\n value: GaugeSeries;\n /**\n * The capacity. Either a `.limit`-style metric series (its latest value) or a\n * fixed number, in the same raw domain as `value`. Determines the number of\n * bars (one per `unit.perBar`). When omitted or 0, the bar count falls back to\n * the ceiling of the usage so an unbounded reading still renders.\n */\n max?: GaugeSeries | number;\n /** What one bar represents. Defaults to CPU cores (perBar 1000, label \"cores\"). */\n unit?: ProgressBarsUnit;\n title: string;\n /** Iconify name or static icon component shown beside the label. */\n icon?: string | StaticIconComponent;\n /** Look-back window passed as ?since=; defaults to \"1h\". */\n range?: string;\n /** Poll interval in ms; defaults to 5000. Pass 0 to disable polling. */\n refreshMs?: number;\n /**\n * Utilisation thresholds (percent of capacity) at which the fill turns amber\n * then red. Defaults to [75, 90].\n */\n thresholds?: [warning: number, danger: number];\n /** Visual density/layout. `cell` is a compact inline form for table/grid cells. */\n variant?: ProgressBarsVariant;\n /** Show the title text. Icons and values remain visible unless separately hidden. */\n showLabel?: boolean;\n /** Show the value/capacity caption. Icons and bars remain visible when false. */\n showValue?: boolean;\n /**\n * Include the capacity in the caption (\"2.3 / 4 cores\"). Defaults to false — the\n * caption shows only the current value (\"2.3 cores\") since the bars already\n * convey capacity. Set true to append the \"/ <capacity>\".\n */\n showCapacity?: boolean;\n /** Bar direction. Vertical bars fill bottom-up; horizontal bars fill left-to-right. */\n orientation?: ProgressBarsOrientation;\n /**\n * Wrap the bars in a hover card summarising the metric (label + current / min /\n * max / avg / capacity over the window). Defaults to true.\n */\n hoverCard?: boolean;\n /** Override the default fetch (e.g. to route through an app's API client). */\n fetcher?: (url: string) => Promise<TimeseriesResponse>;\n className?: string;\n}\n\nconst defaultFetcher = async (url: string): Promise<TimeseriesResponse> => {\n const res = await fetch(url);\n if (!res.ok) throw new Error(`metrics request failed: ${res.status}`);\n return res.json();\n};\n\nfunction latestValue(resp: TimeseriesResponse | undefined): number | undefined {\n const points = resp?.points;\n if (!points || points.length === 0) return undefined;\n return points[points.length - 1]?.value;\n}\n\n/**\n * TimeseriesCoreBars reads usage and limit live from the timeseries store\n * (mirroring TimeseriesGauge's data plumbing) and renders them as quantised\n * utilisation bars via {@link ProgressBars}. Usage and limit flow through each\n * series' optional `transform`; the hover card summarises current/min/max/avg/\n * capacity over the look-back window.\n */\nexport function TimeseriesCoreBars({\n baseUrl = \"\",\n value,\n max,\n unit,\n title,\n icon,\n range = \"1h\",\n refreshMs = 5000,\n thresholds = [75, 90],\n variant = \"default\",\n showLabel = true,\n showValue = true,\n showCapacity = false,\n orientation,\n hoverCard = true,\n fetcher = defaultFetcher,\n className,\n}: TimeseriesCoreBarsProps) {\n const maxIsSeries = typeof max === \"object\";\n const maxSeries = maxIsSeries ? max : undefined;\n const ids = useMemo(() => {\n const list = [value.id];\n if (maxSeries) list.push(maxSeries.id);\n return list;\n }, [value.id, maxSeries]);\n\n const results = useQueries({\n queries: ids.map((id) => {\n const u = new URL(baseUrl + id, window.location.origin);\n if (range) u.searchParams.set(\"since\", range);\n const requestUrl = u.pathname + u.search;\n return {\n queryKey: [\"timeseries\", requestUrl],\n queryFn: () => fetcher(requestUrl),\n refetchInterval: refreshMs > 0 ? refreshMs : false,\n staleTime: 0,\n retry: 0,\n };\n }),\n });\n\n const rawValue = latestValue(results[0]?.data);\n const usage =\n rawValue === undefined\n ? undefined\n : value.transform\n ? value.transform(rawValue)\n : rawValue;\n\n let limit: number | undefined;\n if (typeof max === \"number\") {\n limit = max;\n } else if (maxSeries) {\n const rawMax = latestValue(results[1]?.data);\n limit =\n rawMax === undefined\n ? undefined\n : maxSeries.transform\n ? maxSeries.transform(rawMax)\n : rawMax;\n }\n\n const stats = seriesStats(results[0]?.data?.points, value.transform);\n\n return (\n <ProgressBars\n usage={usage}\n stats={stats}\n title={title}\n thresholds={thresholds}\n variant={variant}\n showLabel={showLabel}\n showValue={showValue}\n showCapacity={showCapacity}\n hoverCard={hoverCard}\n hoverFooter={`over last ${range}`}\n {...(limit !== undefined ? { max: limit } : {})}\n {...(unit !== undefined ? { unit } : {})}\n {...(icon !== undefined ? { icon } : {})}\n {...(orientation !== undefined ? { orientation } : {})}\n {...(className !== undefined ? { className } : {})}\n />\n );\n}\n"],"names":["useMemo","useQueries","seriesStats","jsx","ProgressBars"],"mappings":";;;;;;;AA+DA,MAAM,iBAAiB,OAAO,QAA6C;AACzE,QAAM,MAAM,MAAM,MAAM,GAAG;AAC3B,MAAI,CAAC,IAAI,GAAI,OAAM,IAAI,MAAM,2BAA2B,IAAI,MAAM,EAAE;AACpE,SAAO,IAAI,KAAA;AACb;AAEA,SAAS,YAAY,MAA0D;;AAC7E,QAAM,SAAS,6BAAM;AACrB,MAAI,CAAC,UAAU,OAAO,WAAW,EAAG,QAAO;AAC3C,UAAO,YAAO,OAAO,SAAS,CAAC,MAAxB,mBAA2B;AACpC;AASO,SAAS,mBAAmB;AAAA,EACjC,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,aAAa,CAAC,IAAI,EAAE;AAAA,EACpB,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,eAAe;AAAA,EACf;AAAA,EACA,YAAY;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A,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,aAAa,KAAK;AAAA,MAC9B,GAAI,UAAU,SAAY,EAAE,KAAK,MAAA,IAAU,CAAA;AAAA,MAC3C,GAAI,SAAS,SAAY,EAAE,KAAA,IAAS,CAAA;AAAA,MACpC,GAAI,SAAS,SAAY,EAAE,KAAA,IAAS,CAAA;AAAA,MACpC,GAAI,gBAAgB,SAAY,EAAE,YAAA,IAAgB,CAAA;AAAA,MAClD,GAAI,cAAc,SAAY,EAAE,cAAc,CAAA;AAAA,IAAC;AAAA,EAAA;AAGtD;;"}
@@ -1,22 +1,7 @@
1
1
  import { StaticIconComponent } from './Icon';
2
2
  import { GaugeSeries } from './TimeseriesGauge';
3
3
  import { TimeseriesResponse } from './TimeseriesPanel';
4
- export type TimeseriesCoreBarsVariant = "default" | "cell";
5
- export type TimeseriesCoreBarsOrientation = "horizontal" | "vertical";
6
- /**
7
- * Describes what one bar represents, letting the same component render CPU cores,
8
- * memory gigabytes, or any other quantised capacity. Defaults model CPU cores.
9
- */
10
- export interface CoreBarsUnit {
11
- /** Raw value that fills one bar, in the domain of `value`/`max`. Default 1000 (millicores → 1 core). */
12
- perBar?: number;
13
- /** Caption/tooltip suffix naming the unit, plural. Default "cores". */
14
- label?: string;
15
- /** Per-bar hover tooltip noun, singular. Default "core". */
16
- barLabel?: string;
17
- /** Format a bar-unit count for the caption. Default: integers as-is, else 1 decimal. */
18
- format?: (units: number) => string;
19
- }
4
+ import { ProgressBarsOrientation, ProgressBarsUnit, ProgressBarsVariant } from './ProgressBars';
20
5
  export interface TimeseriesCoreBarsProps {
21
6
  /** Common prefix; the value/max requests are `baseUrl + id`. */
22
7
  baseUrl?: string;
@@ -30,7 +15,7 @@ export interface TimeseriesCoreBarsProps {
30
15
  */
31
16
  max?: GaugeSeries | number;
32
17
  /** What one bar represents. Defaults to CPU cores (perBar 1000, label "cores"). */
33
- unit?: CoreBarsUnit;
18
+ unit?: ProgressBarsUnit;
34
19
  title: string;
35
20
  /** Iconify name or static icon component shown beside the label. */
36
21
  icon?: string | StaticIconComponent;
@@ -44,7 +29,7 @@ export interface TimeseriesCoreBarsProps {
44
29
  */
45
30
  thresholds?: [warning: number, danger: number];
46
31
  /** Visual density/layout. `cell` is a compact inline form for table/grid cells. */
47
- variant?: TimeseriesCoreBarsVariant;
32
+ variant?: ProgressBarsVariant;
48
33
  /** Show the title text. Icons and values remain visible unless separately hidden. */
49
34
  showLabel?: boolean;
50
35
  /** Show the value/capacity caption. Icons and bars remain visible when false. */
@@ -56,7 +41,7 @@ export interface TimeseriesCoreBarsProps {
56
41
  */
57
42
  showCapacity?: boolean;
58
43
  /** Bar direction. Vertical bars fill bottom-up; horizontal bars fill left-to-right. */
59
- orientation?: TimeseriesCoreBarsOrientation;
44
+ orientation?: ProgressBarsOrientation;
60
45
  /**
61
46
  * Wrap the bars in a hover card summarising the metric (label + current / min /
62
47
  * max / avg / capacity over the window). Defaults to true.
@@ -67,13 +52,11 @@ export interface TimeseriesCoreBarsProps {
67
52
  className?: string;
68
53
  }
69
54
  /**
70
- * TimeseriesCoreBars renders CPU utilisation as a row of vertical bars — one bar
71
- * per core (the ceiling of the CPU limit) filled left to right by the latest
72
- * usage. The bar that straddles the usage boundary is partially filled ("blocked
73
- * out") to show the fractional core in use, and the trailing bars stay empty to
74
- * show headroom. Both usage and limit are read live from the timeseries store,
75
- * mirroring TimeseriesGauge's data plumbing; the bar colour crosses warning and
76
- * danger thresholds. A "<used> / <cores>" caption sits below with the icon+title.
55
+ * TimeseriesCoreBars reads usage and limit live from the timeseries store
56
+ * (mirroring TimeseriesGauge's data plumbing) and renders them as quantised
57
+ * utilisation bars via {@link ProgressBars}. Usage and limit flow through each
58
+ * series' optional `transform`; the hover card summarises current/min/max/avg/
59
+ * capacity over the look-back window.
77
60
  */
78
61
  export declare function TimeseriesCoreBars({ baseUrl, value, max, unit, title, icon, range, refreshMs, thresholds, variant, showLabel, showValue, showCapacity, orientation, hoverCard, fetcher, className, }: TimeseriesCoreBarsProps): import("react/jsx-runtime").JSX.Element;
79
62
  //# sourceMappingURL=TimeseriesCoreBars.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeseriesCoreBars.d.ts","sourceRoot":"","sources":["../../src/data/TimeseriesCoreBars.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAK5D,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,MAAM,CAAC;AAC3D,MAAM,MAAM,6BAA6B,GAAG,YAAY,GAAG,UAAU,CAAC;AAEtE;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,wGAAwG;IACxG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,uBAAuB;IACtC,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,KAAK,EAAE,WAAW,CAAC;IACnB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAC3B,mFAAmF;IACnF,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC;IACpC,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;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