@burdenoff/microfe-bigconsole 2026.1012.1 → 2026.1012.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.
@@ -1,33 +1,26 @@
1
- import e from "../ChartTooltip.js";
2
- import { buildReferenceElements as t } from "./referenceElements.js";
3
- import { memo as n, useMemo as r } from "react";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import { Bar as o, CartesianGrid as s, ComposedChart as c, Legend as l, Line as u, ResponsiveContainer as d, Tooltip as f, XAxis as p, YAxis as m } from "recharts";
1
+ import { configuredNumericSeries as e } from "./numericSeries.js";
2
+ import t from "../ChartTooltip.js";
3
+ import { buildReferenceElements as n } from "./referenceElements.js";
4
+ import { memo as r, useMemo as i } from "react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import { Bar as s, CartesianGrid as c, ComposedChart as l, Legend as u, Line as d, ResponsiveContainer as f, Tooltip as p, XAxis as m, YAxis as h } from "recharts";
6
7
  //#region src/bigconsole/components/widgets/chart/charts/ComboChart.tsx
7
- var h = [
8
+ var g = [
8
9
  "var(--color-chart-1)",
9
10
  "var(--color-chart-2)",
10
11
  "var(--color-chart-3)",
11
12
  "var(--color-chart-4)",
12
13
  "var(--color-chart-5)"
13
- ], g = n(function({ data: n = [], config: g, hiddenSeries: _ = [], onDataClick: v }) {
14
- let y = r(() => g.series?.length ? g.series : n.length ? Object.keys(n[0]).filter((e) => e !== g.xAxisKey && typeof n[0][e] == "number").map((e, t) => ({
15
- field: e,
16
- type: t === 0 ? "bar" : "line",
17
- axis: t === 0 ? "left" : "right"
18
- })) : [], [
19
- g.series,
20
- n,
21
- g.xAxisKey
22
- ]), b = r(() => y.some((e) => e.axis === "right"), [y]), x = (e) => typeof e == "number" ? new Intl.NumberFormat("en-US", {
14
+ ], _ = r(function({ data: r = [], config: _, hiddenSeries: v = [], onDataClick: y }) {
15
+ let b = i(() => e(r, _), [_, r]), x = i(() => b.some((e) => e.axis === "right"), [b]), S = (e) => typeof e == "number" ? new Intl.NumberFormat("en-US", {
23
16
  notation: e >= 1e4 ? "compact" : "standard",
24
17
  maximumFractionDigits: 2
25
18
  }).format(e) : String(e);
26
- return n?.length ? /* @__PURE__ */ i(d, {
19
+ return r?.length ? /* @__PURE__ */ a(f, {
27
20
  width: "100%",
28
21
  height: "100%",
29
- children: /* @__PURE__ */ a(c, {
30
- data: n,
22
+ children: /* @__PURE__ */ o(l, {
23
+ data: r,
31
24
  margin: {
32
25
  top: 10,
33
26
  right: 10,
@@ -35,17 +28,17 @@ var h = [
35
28
  bottom: 0
36
29
  },
37
30
  onClick: (e) => {
38
- e?.activePayload?.[0] && v && v(e.activePayload[0].payload, e.activeTooltipIndex || 0);
31
+ e?.activePayload?.[0] && y && y(e.activePayload[0].payload, e.activeTooltipIndex || 0);
39
32
  },
40
33
  children: [
41
- g.showGrid !== !1 && /* @__PURE__ */ i(s, {
34
+ _.showGrid !== !1 && /* @__PURE__ */ a(c, {
42
35
  strokeDasharray: "3 3",
43
36
  stroke: "var(--color-border-default)",
44
37
  opacity: .5,
45
38
  vertical: !1
46
39
  }),
47
- /* @__PURE__ */ i(p, {
48
- dataKey: g.xAxisKey || "name",
40
+ /* @__PURE__ */ a(m, {
41
+ dataKey: _.xAxisKey || "name",
49
42
  tick: {
50
43
  fill: "var(--color-text-secondary)",
51
44
  fontSize: 12
@@ -53,7 +46,7 @@ var h = [
53
46
  tickLine: { stroke: "var(--color-border-default)" },
54
47
  axisLine: { stroke: "var(--color-border-default)" }
55
48
  }),
56
- /* @__PURE__ */ i(m, {
49
+ /* @__PURE__ */ a(h, {
57
50
  yAxisId: "left",
58
51
  tick: {
59
52
  fill: "var(--color-text-secondary)",
@@ -61,15 +54,15 @@ var h = [
61
54
  },
62
55
  tickLine: { stroke: "var(--color-border-default)" },
63
56
  axisLine: { stroke: "var(--color-border-default)" },
64
- tickFormatter: x,
65
- label: g.yAxisLabel ? {
66
- value: g.yAxisLabel,
57
+ tickFormatter: S,
58
+ label: _.yAxisLabel ? {
59
+ value: _.yAxisLabel,
67
60
  angle: -90,
68
61
  position: "insideLeft",
69
62
  fill: "var(--color-text-secondary)"
70
63
  } : void 0
71
64
  }),
72
- b && /* @__PURE__ */ i(m, {
65
+ x && /* @__PURE__ */ a(h, {
73
66
  yAxisId: "right",
74
67
  orientation: "right",
75
68
  tick: {
@@ -78,45 +71,45 @@ var h = [
78
71
  },
79
72
  tickLine: { stroke: "var(--color-border-default)" },
80
73
  axisLine: { stroke: "var(--color-border-default)" },
81
- tickFormatter: x,
82
- label: g.yAxisRightLabel ? {
83
- value: g.yAxisRightLabel,
74
+ tickFormatter: S,
75
+ label: _.yAxisRightLabel ? {
76
+ value: _.yAxisRightLabel,
84
77
  angle: 90,
85
78
  position: "insideRight",
86
79
  fill: "var(--color-text-secondary)"
87
80
  } : void 0
88
81
  }),
89
- /* @__PURE__ */ i(f, {
90
- content: /* @__PURE__ */ i(e, { valueFormatter: x }),
82
+ /* @__PURE__ */ a(p, {
83
+ content: /* @__PURE__ */ a(t, { valueFormatter: S }),
91
84
  cursor: {
92
85
  fill: "var(--color-bg-muted)",
93
86
  opacity: .5
94
87
  }
95
88
  }),
96
- g.showLegend !== !1 && /* @__PURE__ */ i(l, {
89
+ _.showLegend !== !1 && /* @__PURE__ */ a(u, {
97
90
  wrapperStyle: { paddingTop: 20 },
98
- formatter: (e) => /* @__PURE__ */ i("span", {
91
+ formatter: (e) => /* @__PURE__ */ a("span", {
99
92
  style: { color: "var(--color-text-primary)" },
100
93
  children: e
101
94
  })
102
95
  }),
103
- y.map((e, t) => {
104
- let n = e.color || g.colors?.[t] || h[t % h.length], r = e.axis === "right" && b ? "right" : "left", a = e.label || g.seriesNames?.[e.field] || e.field, s = _.includes(e.field);
105
- return e.type === "line" ? /* @__PURE__ */ i(u, {
96
+ b.map((e, t) => {
97
+ let n = e.color || _.colors?.[t] || g[t % g.length], r = e.axis === "right" && x ? "right" : "left", i = e.label || _.seriesNames?.[e.field] || e.field, o = v.includes(e.field);
98
+ return e.type === "line" ? /* @__PURE__ */ a(d, {
106
99
  yAxisId: r,
107
- type: g.curveType || "monotone",
100
+ type: _.curveType || "monotone",
108
101
  dataKey: e.field,
109
- name: a,
102
+ name: i,
110
103
  stroke: n,
111
104
  strokeWidth: 2,
112
- dot: g.showDots !== !1,
105
+ dot: _.showDots !== !1,
113
106
  activeDot: { r: 6 },
114
- hide: s,
107
+ hide: o,
115
108
  connectNulls: !0
116
- }, e.field) : /* @__PURE__ */ i(o, {
109
+ }, e.field) : /* @__PURE__ */ a(s, {
117
110
  yAxisId: r,
118
111
  dataKey: e.field,
119
- name: a,
112
+ name: i,
120
113
  fill: n,
121
114
  radius: [
122
115
  4,
@@ -124,14 +117,14 @@ var h = [
124
117
  0,
125
118
  0
126
119
  ],
127
- hide: s,
128
- stackId: g.stacked ? "stack" : void 0
120
+ hide: o,
121
+ stackId: _.stacked ? "stack" : void 0
129
122
  }, e.field);
130
123
  }),
131
- t(g.referenceLines, { yAxisId: "left" })
124
+ n(_.referenceLines, { yAxisId: "left" })
132
125
  ]
133
126
  })
134
127
  }) : null;
135
128
  });
136
129
  //#endregion
137
- export { g as default };
130
+ export { _ as default };
@@ -1,25 +1,30 @@
1
- import e from "../ChartTooltip.js";
2
- import { buildReferenceElements as t } from "./referenceElements.js";
3
- import { memo as n, useMemo as r } from "react";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import { CartesianGrid as o, Legend as s, Line as c, LineChart as l, ResponsiveContainer as u, Tooltip as d, XAxis as f, YAxis as p } from "recharts";
1
+ import { numericSeriesKeys as e } from "./numericSeries.js";
2
+ import t from "../ChartTooltip.js";
3
+ import { buildReferenceElements as n } from "./referenceElements.js";
4
+ import { memo as r, useMemo as i } from "react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import { CartesianGrid as s, Legend as c, Line as l, LineChart as u, ResponsiveContainer as d, Tooltip as f, XAxis as p, YAxis as m } from "recharts";
6
7
  //#region src/bigconsole/components/widgets/chart/charts/LineChart.tsx
7
- var m = [
8
+ var h = [
8
9
  "var(--color-chart-1)",
9
10
  "var(--color-chart-2)",
10
11
  "var(--color-chart-3)",
11
12
  "var(--color-chart-4)",
12
13
  "var(--color-chart-5)"
13
- ], h = n(function({ data: n = [], config: h, hiddenSeries: g = [], onDataClick: _ }) {
14
- let v = r(() => n?.length ? Object.keys(n[0]).filter((e) => e !== h.xAxisKey && typeof n[0][e] == "number") : [], [n, h.xAxisKey]), y = (e) => typeof e == "number" ? new Intl.NumberFormat("en-US", {
14
+ ], g = r(function({ data: r = [], config: g, hiddenSeries: _ = [], onDataClick: v }) {
15
+ let y = i(() => e(r, g.xAxisKey, g.selectedFields), [
16
+ r,
17
+ g.xAxisKey,
18
+ g.selectedFields
19
+ ]), b = (e) => typeof e == "number" ? new Intl.NumberFormat("en-US", {
15
20
  notation: e >= 1e4 ? "compact" : "standard",
16
21
  maximumFractionDigits: 2
17
22
  }).format(e) : String(e);
18
- return n?.length ? /* @__PURE__ */ i(u, {
23
+ return r?.length ? /* @__PURE__ */ a(d, {
19
24
  width: "100%",
20
25
  height: "100%",
21
- children: /* @__PURE__ */ a(l, {
22
- data: n,
26
+ children: /* @__PURE__ */ o(u, {
27
+ data: r,
23
28
  margin: {
24
29
  top: 10,
25
30
  right: 10,
@@ -27,68 +32,68 @@ var m = [
27
32
  bottom: 0
28
33
  },
29
34
  onClick: (e) => {
30
- e?.activePayload?.[0] && _ && _(e.activePayload[0].payload, e.activeTooltipIndex || 0);
35
+ e?.activePayload?.[0] && v && v(e.activePayload[0].payload, e.activeTooltipIndex || 0);
31
36
  },
32
37
  children: [
33
- h.showGrid !== !1 && /* @__PURE__ */ i(o, {
38
+ g.showGrid !== !1 && /* @__PURE__ */ a(s, {
34
39
  strokeDasharray: "3 3",
35
40
  stroke: "var(--color-border-default)",
36
41
  opacity: .5
37
42
  }),
38
- /* @__PURE__ */ i(f, {
39
- dataKey: h.xAxisKey || "name",
43
+ /* @__PURE__ */ a(p, {
44
+ dataKey: g.xAxisKey || "name",
40
45
  tick: {
41
46
  fill: "var(--color-text-secondary)",
42
47
  fontSize: 12
43
48
  },
44
49
  tickLine: { stroke: "var(--color-border-default)" },
45
50
  axisLine: { stroke: "var(--color-border-default)" },
46
- label: h.xAxisLabel ? {
47
- value: h.xAxisLabel,
51
+ label: g.xAxisLabel ? {
52
+ value: g.xAxisLabel,
48
53
  position: "insideBottom",
49
54
  offset: -5,
50
55
  fill: "var(--color-text-secondary)"
51
56
  } : void 0
52
57
  }),
53
- /* @__PURE__ */ i(p, {
58
+ /* @__PURE__ */ a(m, {
54
59
  tick: {
55
60
  fill: "var(--color-text-secondary)",
56
61
  fontSize: 12
57
62
  },
58
63
  tickLine: { stroke: "var(--color-border-default)" },
59
64
  axisLine: { stroke: "var(--color-border-default)" },
60
- tickFormatter: y,
61
- scale: h.logScale ? "log" : "auto",
62
- domain: h.logScale ? ["auto", "auto"] : void 0,
63
- allowDataOverflow: h.logScale || void 0,
64
- label: h.yAxisLabel ? {
65
- value: h.yAxisLabel,
65
+ tickFormatter: b,
66
+ scale: g.logScale ? "log" : "auto",
67
+ domain: g.logScale ? ["auto", "auto"] : void 0,
68
+ allowDataOverflow: g.logScale || void 0,
69
+ label: g.yAxisLabel ? {
70
+ value: g.yAxisLabel,
66
71
  angle: -90,
67
72
  position: "insideLeft",
68
73
  fill: "var(--color-text-secondary)"
69
74
  } : void 0
70
75
  }),
71
- /* @__PURE__ */ i(d, {
72
- content: /* @__PURE__ */ i(e, { valueFormatter: y }),
76
+ /* @__PURE__ */ a(f, {
77
+ content: /* @__PURE__ */ a(t, { valueFormatter: b }),
73
78
  cursor: { stroke: "var(--color-border-default)" }
74
79
  }),
75
- h.showLegend !== !1 && /* @__PURE__ */ i(s, {
80
+ g.showLegend !== !1 && /* @__PURE__ */ a(c, {
76
81
  wrapperStyle: { paddingTop: 20 },
77
- formatter: (e) => /* @__PURE__ */ i("span", {
82
+ formatter: (e) => /* @__PURE__ */ a("span", {
78
83
  style: { color: "var(--color-text-primary)" },
79
84
  children: e
80
85
  })
81
86
  }),
82
- t(h.referenceLines),
83
- v.map((e, t) => /* @__PURE__ */ i(c, {
84
- type: h.curveType || "monotone",
87
+ n(g.referenceLines),
88
+ y.map((e, t) => /* @__PURE__ */ a(l, {
89
+ type: g.curveType || "monotone",
85
90
  dataKey: e,
86
- name: h.seriesNames?.[e] || e,
87
- stroke: h.colors?.[t] || m[t % m.length],
91
+ name: g.seriesNames?.[e] || e,
92
+ stroke: g.colors?.[t] || h[t % h.length],
88
93
  strokeWidth: 2,
89
- dot: h.showDots !== !1,
94
+ dot: g.showDots !== !1,
90
95
  activeDot: { r: 6 },
91
- hide: g.includes(e),
96
+ hide: _.includes(e),
92
97
  connectNulls: !0
93
98
  }, e))
94
99
  ]
@@ -96,4 +101,4 @@ var m = [
96
101
  }) : null;
97
102
  });
98
103
  //#endregion
99
- export { h as default };
104
+ export { g as default };
@@ -0,0 +1,6 @@
1
+ import { ChartConfig, ChartData, SeriesConfig } from './types';
2
+
3
+ /** Use the saved field order and never turn an explicit empty selection into all metrics. */
4
+ export declare function numericSeriesKeys(data: readonly ChartData[], xAxisKey?: string, selectedFields?: readonly string[]): string[];
5
+ /** Keep explicit combo descriptors, but apply a saved numeric selection in its persisted order. */
6
+ export declare function configuredNumericSeries(data: readonly ChartData[], config: ChartConfig): SeriesConfig[];
@@ -0,0 +1,26 @@
1
+ //#region src/bigconsole/components/widgets/chart/charts/numericSeries.ts
2
+ function e(e, t, n) {
3
+ let r = e[0];
4
+ return r ? [...new Set((n ?? Object.keys(r)).filter((e) => {
5
+ if (typeof e != "string" || e === t) return !1;
6
+ let n = r[e];
7
+ return typeof n == "number" && Number.isFinite(n);
8
+ }))] : [];
9
+ }
10
+ function t(t, n) {
11
+ if (n.series?.length) {
12
+ if (n.selectedFields === void 0) return n.series;
13
+ let r = new Map(n.series.map((e) => [e.field, e]));
14
+ return e(t, n.xAxisKey, n.selectedFields).flatMap((e) => {
15
+ let t = r.get(e);
16
+ return t ? [t] : [];
17
+ });
18
+ }
19
+ return e(t, n.xAxisKey, n.selectedFields).map((e, t) => ({
20
+ field: e,
21
+ type: t === 0 ? "bar" : "line",
22
+ axis: t === 0 ? "left" : "right"
23
+ }));
24
+ }
25
+ //#endregion
26
+ export { t as configuredNumericSeries, e as numericSeriesKeys };
@@ -31,6 +31,8 @@ export interface ChartConfig {
31
31
  type?: ChartType;
32
32
  /** X-axis data key */
33
33
  xAxisKey?: string;
34
+ /** Ordered numeric series selection; undefined auto-detects, an empty list displays no series. */
35
+ selectedFields?: string[];
34
36
  /** X-axis label */
35
37
  xAxisLabel?: string;
36
38
  /** Y-axis label */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-bigconsole",
3
- "version": "2026.1012.1",
3
+ "version": "2026.1012.2",
4
4
  "description": "BigConsole - AI-powered analytics and dashboard platform",
5
5
  "type": "module",
6
6
  "files": [