API
›
Canvas
Elenweave Canvas API
A client-only JavaScript library under canvas/lib/, framework-agnostic, shipped as ES modules. The surface is structured around Workspace, Graph, View, and Navigator.
Structured interaction
Theme Options
Select a preset with options.themeName (blueprint, light, dark) and override values with options.theme.
JavaScript
const view = new ElenweaveView({
canvas,
workspace,
options: {
themeName: 'light',
theme: {
bg: '#061526',
nodeStroke: '#6fe7ff',
edge: '#78dbff',
selection: '#41ffb4'
}
}
});
Interaction Defaults
Default interaction model for canvas nodes and navigation.
- Drag to move nodes.
- Resize from corners.
- Shift+drag to link (or toggle setLinkMode(true)).
- Wheel to zoom, Space+drag or middle mouse to pan.
- Double-click to edit text nodes.
- Set pulse: true on nodes or edges to enable a gentle border/edge pulse.
- Set fixed: true on a node to disable dragging and resizing.
Virtualization
For large graphs, enable virtualization to render only nodes within the viewport bounds (plus padding).
JavaScript
view.setVirtualization({ enabled: true, padding: 240, edges: true });
edges: when true, draws edges if either endpoint is visible. When disabled, all edges render regardless of visibility.