Visual node graph made of live HTML forms

Tools like Blender Shader Nodes, ComfyUI, cables.gl, Rete and React Flow pair graph wires with parameter cards, but zooming DOM nodes with CSS transform blurs text once you pass 150%, while drawing form controls by hand on a canvas throws away browser inputs. After /board/ showed that 2D drawElementImage() re-rasterises DOM vector paint commands sharply at any scale, I built a four-node signal graph of real <form> elements with glowing Bézier wires drawn behind them on one 2D canvas. Drag the background to pan, drag node headers to rearrange, drag or tap ports to rewire, and zoom from 35% to 300%.

1. Generator GEN
2. Transform XFORM
3. Palette PAL
4. Preview OUT

Drag empty space to pan, wheel or pinch to zoom (35% to 300%), drag any node header to move it, drag from an output port to an input port (or tap output then input) to rewire, and tap a wired input port to disconnect it.

Show the code Bézier wires, camera zoom and live form nodes on one canvas
  1. Four live <form> nodes inside one drawable canvas. Every select, slider, colour input, checkbox, text box and port button stays native HTML.
  2. Evaluating the signal chain from live form values and active wires. Changing a control or rewiring a port recalculates colours, waveform geometry and the SVG swatch inside the Preview node.
  3. Drawing glowing Bézier wires behind the nodes, then re-rasterising each form at the camera zoom. Wires and optional signal pulses paint first, each visible form paints with 5-argument drawElementImage(), off-screen nodes park their hit boxes via updateElementGeometry(), and the minimap paints last.
  4. Dragging nodes and rewiring ports by pointer or tap. Each port's world coordinate comes from its layout offset inside its form, so wires stay locked to port dots at any zoom level.

How it works

Node-based editors such as Blender Shader Nodes, ComfyUI, cables.gl, Rete and React Flow all face the same browser split: put HTML controls on top of an SVG wire layer and CSS transform: scale() rasterises cards into a bitmap that turns fuzzy at 250% zoom, or draw the whole graph onto a canvas and rebuild every slider, dropdown and text input from scratch. Following /board/, this experiment puts four <form drawable> elements directly inside one <canvas content="drawable" layoutsubtree> and lets one 2D paint handler draw both the wires and the DOM.

On each paint event, the 2D context scales by devicePixelRatio, draws the background dot grid, and strokes every active wire as a horizontal-tangent cubic Bézier curve (an outer glow pass plus a bright core coloured by the live signal). Each visible form node then draws on top under ctx.translate(sx, sy); ctx.scale(cam.k, cam.k); with 5-argument ctx.drawElementImage(node.el, 0, 0, w, h). Because drawElementImage() replays the element's paint commands under the current canvas matrix, labels, borders, inputs and the inline preview SVG re-rasterise cleanly from 35% overview to 300% close-up, and hit-testing tracks the same matrix.

Nodes dragged off screen aren't drawn, so the paint handler calls canvas.updateElementGeometry(node.el, { canvasTransform: OFFSTAGE }) to park their hit boxes away from clicks. After a node drag or camera move finishes, the script toggles a data-hit attribute on moved forms so Chromium clears its hit-test cache without triggering a paint loop. When HTML-in-canvas isn't available or the 2D context fires contextlost, the four forms move into a plain CSS grid with a visible notice so every control keeps working.

Live checks

ResultExperimentDetail

Findings