Data Layer (react_ui/src/data/)
State management, engine↔JS bridge, and real-time metering.
Files
Real-Time Metering Pipeline
Three-Layer Architecture
-
rtBuffer— Raw mutable object, written by the engine event handler. No subscriptions, no notifications. Just a data landing zone. -
displayBuffer— Smoothed values computed by therequestAnimationFrameloop. Applies ballistic smoothing so meters look fluid even with 30Hz data input. Subscribers receive this. -
useMeterStore(Zustand) — Throttled to ~10Hz for the few React components that still use reactive selectors. Most components usesubscribeRtBufferinstead.
Ballistic Smoothing Constants
Attack is always instant — when the new value exceeds the current smoothed value, it snaps immediately.
API
Rendering Best Practices
All meter components use direct DOM manipulation viasubscribeRtBuffer (no React re-renders):
Why transforms?
height/width/left trigger browser layout recalculation (~0.5ms per property). transform is GPU-composited — the browser sends a matrix to the GPU with no layout cost.