@shumoku/renderer
v0.1.0
Published
Interactive Svelte-based renderer for Shumoku network diagrams
Readme
@shumoku/renderer
Interactive Svelte renderer for Shumoku diagrams. Provides the building blocks for a live, manipulable topology view — pan/zoom camera, coordinate helpers, layout serialization, and overlay hooks — used by the editor and the server web UI.
Requires Svelte 5 (peer dependency). For static, non-interactive SVG output use
@shumoku/renderer-svginstead.
Install
npm install @shumoku/renderer @shumoku/core svelteWhat it provides
| Area | Exports |
|------|---------|
| Camera | attachCamera (opt-in pan/zoom), Camera, CameraOptions, PanFilter |
| Serialization | layoutToJson / jsonToLayout, serializeLayout / deserializeLayout, SerializedLayout — save and restore manual layout edits |
| Colors | themeToColors — turn a Shumoku theme into a resolved color map |
| SVG coordinates | screenToSvg, svgToScreen, svgPointToContainer, svgRectToContainer, bezierEdgePath, bezierOffsetPath, computePortLabelPosition, getNodeLabel, getVlanStroke |
| Overlays | typed snippet hooks for custom node / link / port / subgraph rendering (RendererOverlaySnippets) |
| Static SVG | renderGraphToSvg, renderSvgString — server-side / SSR fallback |
License
AGPL-3.0-only. For commercial licensing, contact [email protected].
