@kwirthmagnify/kwirth-common-front 0.5.13 → 0.5.15

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/MiniGauge.js CHANGED
@@ -10,8 +10,8 @@ const GAUGE_ZONES = [
10
10
  { size: 0.3, fill: '#F5CD19' },
11
11
  { size: 0.2, fill: '#EA4228' },
12
12
  ];
13
- const VW = 100, VH = 54;
14
- const GCX = VW / 2, GCY = VH;
13
+ const VW = 100, VH = 58;
14
+ const GCX = VW / 2, GCY = VH - 4;
15
15
  const G_OUTER = VW * 0.46, G_INNER = G_OUTER * 0.58, G_NEEDLE = G_OUTER * 0.86;
16
16
  const ARC_PATHS = (() => {
17
17
  let a = Math.PI;
@@ -36,14 +36,14 @@ const labelStyle = {
36
36
  const MiniGauge = ({ value, max, label, format }) => {
37
37
  const display = format ? format(value) : value.toFixed(1);
38
38
  const pct = Math.min(value / (max || 1), 1);
39
- const na = Math.PI * (1 - pct);
40
- const nx = GCX + G_NEEDLE * Math.cos(na);
41
- const ny = GCY - G_NEEDLE * Math.sin(na);
39
+ const rotateDeg = -(1 - pct) * 180;
42
40
  return (react_1.default.createElement("div", { style: { flex: 1, minWidth: 0, textAlign: 'center' } },
43
41
  react_1.default.createElement("span", { style: Object.assign(Object.assign({}, labelStyle), { marginBottom: 4 }) }, display),
44
42
  react_1.default.createElement("svg", { viewBox: `0 0 ${VW} ${VH}`, style: { width: '100%', display: 'block' } },
45
43
  ARC_PATHS.map((p, i) => react_1.default.createElement("path", { key: i, d: p.d, fill: p.fill })),
46
- react_1.default.createElement("line", { x1: GCX, y1: GCY, x2: nx, y2: ny, stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round' }),
44
+ react_1.default.createElement("g", { transform: `translate(${GCX}, ${GCY})` },
45
+ react_1.default.createElement("g", { style: { transform: `rotate(${rotateDeg}deg)`, transformOrigin: '0px 0px', transition: 'transform 0.5s ease-out' } },
46
+ react_1.default.createElement("line", { x1: 0, y1: 0, x2: G_NEEDLE, y2: 0, stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round' }))),
47
47
  react_1.default.createElement("circle", { cx: GCX, cy: GCY, r: 3, fill: 'currentColor' })),
48
48
  react_1.default.createElement("span", { style: Object.assign(Object.assign({}, labelStyle), { marginTop: 4 }) }, label)));
49
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-front",
3
- "version": "0.5.13",
3
+ "version": "0.5.15",
4
4
  "description": "Frontend channel interfaces for Kwirth plugins and channels",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q && tsc"