Expand description
Generic JSON walker — single source of truth for “show a component”.
Dispatch by JSON shape:
| Shape | Widget |
|---|---|
Object { x, y, z } | Vec3 with X/Y/Z badges |
Object { x, y, z, w } | Quaternion (4 drag values) |
Object { r, g, b, a } | colour swatch + RGBA dragvalues |
Object { "Variant": <inner> } | enum: variant title + recurse |
Object { … } (other) | indented row of children |
Number | DragValue |
Bool | checkbox |
String | text input |
Array<f64> (3 or 4) | falls through to Vec3 / colour |
Null | dim “null” label |
Functions§
- render_
array 🔒 - Generic array row. Numeric arrays of length 3 / 4 are treated like Vec3 / Vec4 with axis colours; everything else falls back to “[i] = …” rows.
- render_
field 🔒 - Renders a single labelled row. Picks a widget by leaf type or recurses for nested structure.
- render_
object 🔒 - Walks a JSON object, picking the right widget for each shape.
- render_
value - Renders a top-level component value. Returns true if the user mutated
any leaf — the caller queues a
SetComponentJsonedit in that case.