@maxhealth.tech/prefab 0.2.39 → 0.3.0
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/CHANGELOG.md +35 -0
- package/README.md +1 -1
- package/dist/app.d.ts +24 -2
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +46 -9
- package/dist/app.js.map +1 -1
- package/dist/components/charts/index.d.ts +56 -4
- package/dist/components/charts/index.d.ts.map +1 -1
- package/dist/components/charts/index.js +33 -7
- package/dist/components/charts/index.js.map +1 -1
- package/dist/core/theme-css.d.ts +32 -0
- package/dist/core/theme-css.d.ts.map +1 -0
- package/dist/core/theme-css.js +55 -0
- package/dist/core/theme-css.js.map +1 -0
- package/dist/core/validate.d.ts.map +1 -1
- package/dist/core/validate.js +24 -1
- package/dist/core/validate.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/display.d.ts +6 -2
- package/dist/mcp/display.d.ts.map +1 -1
- package/dist/mcp/display.js +8 -2
- package/dist/mcp/display.js.map +1 -1
- package/dist/renderer/app.d.ts +2 -0
- package/dist/renderer/app.d.ts.map +1 -1
- package/dist/renderer/app.js +5 -0
- package/dist/renderer/app.js.map +1 -1
- package/dist/renderer/bridge.d.ts.map +1 -1
- package/dist/renderer/bridge.js +2 -0
- package/dist/renderer/bridge.js.map +1 -1
- package/dist/renderer/components/chart-helpers.d.ts +63 -0
- package/dist/renderer/components/chart-helpers.d.ts.map +1 -0
- package/dist/renderer/components/chart-helpers.js +202 -0
- package/dist/renderer/components/chart-helpers.js.map +1 -0
- package/dist/renderer/components/chart-tooltip.d.ts +1 -1
- package/dist/renderer/components/chart-tooltip.d.ts.map +1 -1
- package/dist/renderer/components/charts.d.ts +4 -20
- package/dist/renderer/components/charts.d.ts.map +1 -1
- package/dist/renderer/components/charts.js +246 -195
- package/dist/renderer/components/charts.js.map +1 -1
- package/dist/renderer/index.d.ts +6 -0
- package/dist/renderer/index.d.ts.map +1 -1
- package/dist/renderer/index.js +65 -24
- package/dist/renderer/index.js.map +1 -1
- package/dist/renderer/theme.d.ts +15 -0
- package/dist/renderer/theme.d.ts.map +1 -1
- package/dist/renderer/theme.js +26 -18
- package/dist/renderer/theme.js.map +1 -1
- package/dist/renderer.auto.min.js +14 -12
- package/dist/renderer.min.js +14 -12
- package/package.json +1 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared chart rendering helpers — colors, axes, SVG primitives, legend,
|
|
3
|
+
* value formatting. Used by the per-chart renderers in [charts.ts] and the
|
|
4
|
+
* tooltip zones in [chart-tooltip.ts].
|
|
5
|
+
*/
|
|
6
|
+
import { resolveValue, el } from '../engine.js';
|
|
7
|
+
export const COLORS = ['#3b82f6', '#10b981', '#f59e0b', '#ef4444', '#8b5cf6', '#ec4899'];
|
|
8
|
+
export const AXIS_COLOR = 'var(--muted-foreground, #6b7280)';
|
|
9
|
+
export const GRID_COLOR = 'var(--border, #e5e7eb)';
|
|
10
|
+
export const AXIS_FONT = '10';
|
|
11
|
+
/** Compute chart layout accounting for optional Y-axis label space. */
|
|
12
|
+
export function chartLayout(svgWidth, svgHeight, hasYAxis, hasYAxisRight = false) {
|
|
13
|
+
const plotLeft = hasYAxis ? 44 : 0;
|
|
14
|
+
const plotRight = svgWidth - (hasYAxisRight ? 44 : 0);
|
|
15
|
+
const plotTop = 10;
|
|
16
|
+
const plotBottom = svgHeight - 24;
|
|
17
|
+
return {
|
|
18
|
+
plotLeft,
|
|
19
|
+
plotRight,
|
|
20
|
+
plotTop,
|
|
21
|
+
plotBottom,
|
|
22
|
+
plotWidth: plotRight - plotLeft,
|
|
23
|
+
plotHeight: plotBottom - plotTop,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** Nice round tick values for a 0..max range, returning ~tickCount values. */
|
|
27
|
+
function niceYTicks(max, tickCount = 5) {
|
|
28
|
+
if (max <= 0)
|
|
29
|
+
return [0];
|
|
30
|
+
const rawStep = max / tickCount;
|
|
31
|
+
const magnitude = Math.pow(10, Math.floor(Math.log10(rawStep)));
|
|
32
|
+
const residual = rawStep / magnitude;
|
|
33
|
+
const niceStep = residual <= 1.5 ? magnitude
|
|
34
|
+
: residual <= 3 ? 2 * magnitude
|
|
35
|
+
: residual <= 7 ? 5 * magnitude
|
|
36
|
+
: 10 * magnitude;
|
|
37
|
+
const ticks = [];
|
|
38
|
+
for (let v = 0; v <= max + niceStep * 0.01; v += niceStep) {
|
|
39
|
+
ticks.push(Math.round(v * 1000) / 1000);
|
|
40
|
+
}
|
|
41
|
+
return ticks;
|
|
42
|
+
}
|
|
43
|
+
// ── Axes ─────────────────────────────────────────────────────────────────────
|
|
44
|
+
/** Draw Y-axis labels + optional horizontal grid lines into SVG. */
|
|
45
|
+
export function drawYAxis(svg, layout, max, showGrid, format) {
|
|
46
|
+
const ticks = niceYTicks(max);
|
|
47
|
+
for (const tick of ticks) {
|
|
48
|
+
const y = layout.plotBottom - (max > 0 ? (tick / max) * layout.plotHeight : 0);
|
|
49
|
+
const label = svgEl('text', {
|
|
50
|
+
x: layout.plotLeft - 6, y: y + 3, 'text-anchor': 'end', 'font-size': AXIS_FONT, fill: AXIS_COLOR,
|
|
51
|
+
});
|
|
52
|
+
label.textContent = formatYValue(tick, format);
|
|
53
|
+
svg.appendChild(label);
|
|
54
|
+
if (showGrid && tick > 0) {
|
|
55
|
+
svg.appendChild(svgEl('line', {
|
|
56
|
+
x1: layout.plotLeft, y1: y, x2: layout.plotRight, y2: y,
|
|
57
|
+
stroke: GRID_COLOR, 'stroke-width': 1, 'stroke-dasharray': '4 3',
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Draw secondary Y-axis labels on the right side of the plot. */
|
|
63
|
+
export function drawYAxisRight(svg, layout, max, format) {
|
|
64
|
+
const ticks = niceYTicks(max);
|
|
65
|
+
for (const tick of ticks) {
|
|
66
|
+
const y = layout.plotBottom - (max > 0 ? (tick / max) * layout.plotHeight : 0);
|
|
67
|
+
const label = svgEl('text', {
|
|
68
|
+
x: layout.plotRight + 6, y: y + 3, 'text-anchor': 'start', 'font-size': AXIS_FONT, fill: AXIS_COLOR,
|
|
69
|
+
});
|
|
70
|
+
label.textContent = formatYValue(tick, format);
|
|
71
|
+
svg.appendChild(label);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** Draw X-axis labels under the plot area. */
|
|
75
|
+
export function drawXAxisLabels(svg, data, xAxisKey, getX, yBase, format) {
|
|
76
|
+
for (let i = 0; i < data.length; i++) {
|
|
77
|
+
const val = data[i][xAxisKey];
|
|
78
|
+
const label = svgEl('text', {
|
|
79
|
+
x: getX(i), y: yBase + 14, 'text-anchor': 'middle', 'font-size': AXIS_FONT, fill: AXIS_COLOR,
|
|
80
|
+
});
|
|
81
|
+
label.textContent = val == null ? '' : (format ? format(val) : String(val));
|
|
82
|
+
svg.appendChild(label);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** Draw a baseline (X-axis line) at the bottom of the plot. */
|
|
86
|
+
export function drawBaseline(svg, layout) {
|
|
87
|
+
svg.appendChild(svgEl('line', {
|
|
88
|
+
x1: layout.plotLeft, y1: layout.plotBottom, x2: layout.plotRight, y2: layout.plotBottom,
|
|
89
|
+
stroke: AXIS_COLOR, 'stroke-width': 1,
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
// ── Value formatting ─────────────────────────────────────────────────────────
|
|
93
|
+
/** Apply a pipe expression to a value using the Rx engine. */
|
|
94
|
+
export function applyPipeFormat(value, pipe, ctx) {
|
|
95
|
+
if (value == null)
|
|
96
|
+
return '';
|
|
97
|
+
const result = resolveValue(`{{ __v | ${pipe} }}`, { ...ctx, scope: { ...ctx.scope, __v: value } });
|
|
98
|
+
return result == null ? String(value) : String(result);
|
|
99
|
+
}
|
|
100
|
+
export function formatYValue(value, format) {
|
|
101
|
+
if (format === 'currency')
|
|
102
|
+
return `$${value.toLocaleString()}`;
|
|
103
|
+
if (format === 'percent')
|
|
104
|
+
return `${value}%`;
|
|
105
|
+
if (value >= 1_000_000)
|
|
106
|
+
return `${(value / 1_000_000).toFixed(1)}M`;
|
|
107
|
+
if (value >= 1_000)
|
|
108
|
+
return `${(value / 1_000).toFixed(1)}K`;
|
|
109
|
+
return String(value);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Effective value-axis / tooltip format for a chart node.
|
|
113
|
+
*
|
|
114
|
+
* `valueFormat` (protocol 0.3 / upstream PR #454) is the canonical field;
|
|
115
|
+
* `yAxisFormat` remains a TS-only override for the left axis of dual-axis
|
|
116
|
+
* charts. `"auto"` (upstream's default) means "no explicit format".
|
|
117
|
+
*/
|
|
118
|
+
export function resolveValueFormat(node) {
|
|
119
|
+
const fmt = node.yAxisFormat ?? node.valueFormat;
|
|
120
|
+
return fmt && fmt !== 'auto' ? fmt : undefined;
|
|
121
|
+
}
|
|
122
|
+
/** Create a format callback for tooltip entries that handles per-axis formats + null. */
|
|
123
|
+
export function makeTooltipFormatter(ctx, yAxisFormat, yAxisRightFormat) {
|
|
124
|
+
return (raw, s) => {
|
|
125
|
+
if (raw === null || raw === undefined)
|
|
126
|
+
return '—';
|
|
127
|
+
// Per-series tooltipFormat overrides axis format
|
|
128
|
+
if (s.tooltipFormat)
|
|
129
|
+
return applyPipeFormat(raw, s.tooltipFormat, ctx);
|
|
130
|
+
const fmt = s.yAxisId === 'right' ? yAxisRightFormat : yAxisFormat;
|
|
131
|
+
return formatYValue(Number(raw), fmt);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
// ── SVG primitives ───────────────────────────────────────────────────────────
|
|
135
|
+
export function createSvg(width, height, chartType) {
|
|
136
|
+
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
137
|
+
svg.setAttribute('width', '100%');
|
|
138
|
+
svg.setAttribute('height', String(height));
|
|
139
|
+
svg.setAttribute('viewBox', `0 0 ${width} ${height}`);
|
|
140
|
+
svg.setAttribute('role', 'img');
|
|
141
|
+
if (chartType) {
|
|
142
|
+
svg.setAttribute('aria-label', `${chartType} chart`);
|
|
143
|
+
}
|
|
144
|
+
svg.style.overflow = 'visible';
|
|
145
|
+
return svg;
|
|
146
|
+
}
|
|
147
|
+
/** Create an SVG element with string-coerced attributes. */
|
|
148
|
+
export function svgEl(tag, attrs) {
|
|
149
|
+
const node = document.createElementNS('http://www.w3.org/2000/svg', tag);
|
|
150
|
+
for (const [k, v] of Object.entries(attrs))
|
|
151
|
+
node.setAttribute(k, String(v));
|
|
152
|
+
return node;
|
|
153
|
+
}
|
|
154
|
+
/** Create an SVG <text> element with content. */
|
|
155
|
+
export function svgText(attrs, text) {
|
|
156
|
+
const t = svgEl('text', attrs);
|
|
157
|
+
t.textContent = text;
|
|
158
|
+
return t;
|
|
159
|
+
}
|
|
160
|
+
/** Polar → SVG coords (degrees, math convention with screen y flipped). */
|
|
161
|
+
export function polar(cx, cy, r, angleDeg) {
|
|
162
|
+
const a = (angleDeg * Math.PI) / 180;
|
|
163
|
+
return { x: cx + r * Math.cos(a), y: cy - r * Math.sin(a) };
|
|
164
|
+
}
|
|
165
|
+
/** Sampled arc stroke path between two angles — avoids large-arc/sweep flag math. */
|
|
166
|
+
export function arcPath(cx, cy, r, a1, a2) {
|
|
167
|
+
const steps = Math.max(2, Math.ceil(Math.abs(a2 - a1) / 4));
|
|
168
|
+
const parts = [];
|
|
169
|
+
for (let i = 0; i <= steps; i++) {
|
|
170
|
+
const p = polar(cx, cy, r, a1 + ((a2 - a1) * i) / steps);
|
|
171
|
+
parts.push(`${i === 0 ? 'M' : 'L'} ${p.x.toFixed(2)} ${p.y.toFixed(2)}`);
|
|
172
|
+
}
|
|
173
|
+
return parts.join(' ');
|
|
174
|
+
}
|
|
175
|
+
// ── Legend ───────────────────────────────────────────────────────────────────
|
|
176
|
+
export function addLegend(wrapper, series, show) {
|
|
177
|
+
if (show === false || series.length <= 1)
|
|
178
|
+
return;
|
|
179
|
+
const legend = el('div', 'pf-chart-legend');
|
|
180
|
+
legend.style.display = 'flex';
|
|
181
|
+
legend.style.gap = '12px';
|
|
182
|
+
legend.style.fontSize = '12px';
|
|
183
|
+
legend.style.marginBottom = '8px';
|
|
184
|
+
for (let i = 0; i < series.length; i++) {
|
|
185
|
+
const item = el('div', 'pf-chart-legend-item');
|
|
186
|
+
item.style.display = 'flex';
|
|
187
|
+
item.style.alignItems = 'center';
|
|
188
|
+
item.style.gap = '4px';
|
|
189
|
+
const dot = el('span');
|
|
190
|
+
dot.style.width = '8px';
|
|
191
|
+
dot.style.height = '8px';
|
|
192
|
+
dot.style.borderRadius = '50%';
|
|
193
|
+
dot.style.backgroundColor = series[i].color ?? COLORS[i % COLORS.length];
|
|
194
|
+
const label = el('span');
|
|
195
|
+
label.textContent = series[i].label ?? series[i].dataKey;
|
|
196
|
+
item.appendChild(dot);
|
|
197
|
+
item.appendChild(label);
|
|
198
|
+
legend.appendChild(item);
|
|
199
|
+
}
|
|
200
|
+
wrapper.appendChild(legend);
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=chart-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-helpers.js","sourceRoot":"","sources":["../../../src/renderer/components/chart-helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAG/C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;AACxF,MAAM,CAAC,MAAM,UAAU,GAAG,kCAAkC,CAAA;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAA;AAClD,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAA;AAsB7B,uEAAuE;AACvE,MAAM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CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;QAExD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QACvB,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IACD,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;AAC7B,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extracted from charts.ts to keep each file under 700 LOC.
|
|
5
5
|
*/
|
|
6
|
-
import type { ChartLayout, SeriesEntry } from './
|
|
6
|
+
import type { ChartLayout, SeriesEntry } from './chart-helpers.js';
|
|
7
7
|
export interface TooltipEntry {
|
|
8
8
|
label: string;
|
|
9
9
|
value: string | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-tooltip.d.ts","sourceRoot":"","sources":["../../../src/renderer/components/chart-tooltip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"chart-tooltip.d.ts","sourceRoot":"","sources":["../../../src/renderer/components/chart-tooltip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIlE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,WAAW,CAAA;IACpB,OAAO,EAAE,WAAW,CAAA;IACpB,KAAK,EAAE,aAAa,CAAA;CACrB;AAED,4DAA4D;AAC5D,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE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2
|
+
* Chart component renderers — BarChart, LineChart, AreaChart, PieChart,
|
|
3
|
+
* ScatterChart, RadialChart, Histogram.
|
|
3
4
|
*
|
|
4
|
-
* Charts render as SVG using simple built-in drawing.
|
|
5
|
-
*
|
|
5
|
+
* Charts render as SVG using simple built-in drawing. Shared axis/SVG/format
|
|
6
|
+
* helpers live in [chart-helpers.ts]; tooltip hit-zones in [chart-tooltip.ts].
|
|
6
7
|
*/
|
|
7
8
|
export declare function registerChartComponents(): void;
|
|
8
|
-
export interface SeriesEntry {
|
|
9
|
-
dataKey: string;
|
|
10
|
-
label?: string;
|
|
11
|
-
color?: string;
|
|
12
|
-
yAxisId?: 'left' | 'right';
|
|
13
|
-
tooltipFormat?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ChartLayout {
|
|
16
|
-
/** Usable plot area after axis padding */
|
|
17
|
-
plotLeft: number;
|
|
18
|
-
plotRight: number;
|
|
19
|
-
plotTop: number;
|
|
20
|
-
plotBottom: number;
|
|
21
|
-
plotWidth: number;
|
|
22
|
-
plotHeight: number;
|
|
23
|
-
}
|
|
24
|
-
export declare function formatYValue(value: number, format?: string): string;
|
|
25
9
|
//# sourceMappingURL=charts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../../src/renderer/components/charts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../../src/renderer/components/charts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,wBAAgB,uBAAuB,IAAI,IAAI,CAS9C"}
|