07 — Water Tank
Stopped
Real-time SVG Dashboard
A P&ID schematic generated in Go, with clickable pump and valve controls
What this demonstrates
buildSVG()
— generates a full P&ID schematic with colour-coded pipes, water level, and float switch marks
Clickable SVG
—
<a href="/pump">
and
<a href="/valve">
inside the SVG toggle state directly
Simulation goroutine
— background tick loop at 500ms updates tank level (+3% pump, -1% valve)
Float switch
— auto-off pump at 95%, auto-on at 5% with trip counting
Dual build
— same code runs as server (
net/http
) or WASM in the browser
Live Demo (WASM)
Loading WASM...
Start Simulation
Toggle Pump
Toggle Valve