Repository navigation
Commit 8eb8224
authored
feat(frontend): draw the energiavirta nodes as neon signs (#1023)
Each node in the energy flow diagram is now a glowbox neon sign: ring and
glyph as one drawing, lit by the data. An inactive node keeps its unlit
glass instead of fading out, and the battery ring is a gauge — lit as far
as the charge runs, dim tube for the rest, replacing the dasharray arc.
Glow is scaled against a per-node reference power rather than an arbitrary
curve: the sun is glowed against the array's 7.2 kWp nameplate, so only a
clear noon lights it all the way, and the battery against its 5 kW
charge/discharge ceiling.
The glyph geometry (sun, activity, plug, house, six battery states) is
transcribed from lucide 1.30 into path data, since art takes paths or
polylines rather than lucide's circle/rect primitives. Ring and glyph keep
their registration through the art frame, which also makes every glyph
land the same size regardless of how much of its 24 units it fills.
Two things that had to be built around:
- A partial ring shrinks the bounds the sign is scaled to fit, so a lone
62% arc rendered smaller and off-centre and the node resized itself on
every poll. Drawing the unlit remainder as a second, dim circuit keeps
the bounds a full ring at any charge level.
- A canvas in a foreignObject is laid out in SVG user units but measures
itself in scaled CSS pixels, so the signs landed offset and oversized by
the viewBox scale. They are now an overlay positioned by percentages of
the diagram box.
Opening the energy view strikes the board in order — the reveal program
walks the tubes of each sign, and a per-node delay walks outward from the
inverter. A browser tab returning to the front never remounts, so that
case re-strikes through the sign handle. Below 30% the battery flickers,
harder the lower it gets.
The clock faces' glowbox theme bridge moves to hooks/useGlowboxTheme so
both callers share it.1 parent 4af2518 commit 8eb8224
4 files changed
Lines changed: 497 additions & 283 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | 128 | | |
133 | 129 | | |
134 | 130 | | |
| |||
0 commit comments