Documentation
¶
Overview ¶
Command iso is a browser wasm demonstrator of the go-widgets/toolkit isometric diagram widget (toolkit.IsoDiagram) and its collaborative CRDT backing store (toolkit.IsoCRDTDocument). It is an INTERACTIVE editor you drive in the page — not a static picture:
- a docked toolkit.IsoIconPalette over a rich registry: the built-in architecture icons, the LIVE animated icons ("anim/*") and the vendored cloud-native + AWS packs (go-widgets/isoicons). Drag an icon onto a canvas and a node is created at the exact ground tile under the drop (undoable); picking an icon also arms click-to-place through an mvvm.Observable binding;
- a real toolbar built from [toolkit.ButtonGroup]s of icon+label buttons (Iconoir glyphs, themed): a Modes group (Select / Node / Connect / Zone / Text), an Edit group (Undo / Redo / Delete), a View group (RotateCCW / RotateCW / Zoom+ / Zoom- / Layer) and a Collaborate group (Sync / Reset). Left-drag empty ground pans; right-click opens the widget's own menu;
- TWO canvases side by side ("Site A" / "Site B"), each backed by its own toolkit.IsoCRDTDocument on a distinct CRDT site. Every edit auto-syncs the two replicas (operations exchanged both ways via OpsSince/Apply), so an edit in one panel appears in the other, live, with no server — the collaborative showpiece. The view rotation is LOCAL per canvas, so the two panels may face different orientations without diverging the shared model.
The animated icons advance from a real clock: the shared internal/webcanvas harness drives a requestAnimationFrame loop that hands the scene the elapsed dt through [isoScene.AnimationStep], which the scene forwards to both diagrams' toolkit.IsoDiagram.AnimationStep. The phase-advance logic is a pure function of dt, so it is fully exercised natively (the browser rAF wiring is the only `js && wasm` code, in run_js.go).
All the scene logic lives here in a tag-less file, fully exercised by the native scene_test.go (it renders to a buffer and asserts exact projected pixel positions, drives a palette drop and a CRDT convergence, steps the animation and rotates the view). The only `js && wasm` code is main.go, a one-line hand-off to the shared internal/webcanvas harness, which drops out of the native build.