You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
High-performance 2D canvas engine for an interactive infinite canvas with nodes, pan/zoom, selection, history, and a plugin-friendly architecture built on Konva
π¦ Installation
npm install @flowscape-ui/core-sdk
# or
pnpm add @flowscape-ui/core-sdk
# or
yarn add @flowscape-ui/core-sdk
# or
bun add @flowscape-ui/core-sdk
β¨ Features
π― Framework-agnostic - works with React, Vue, Svelte, Angular or vanilla JS
All supported entities are exported only through the root package @flowscape-ui/core-sdk.
The src/public-api.ts file contains the complete list of stable exports; anything outside this file is considered internal API and may change without notice.
Do not import files directly via @flowscape-ui/core-sdk/src/... β such imports are not supported and may break during updates.
// Subscribe to eventsengine.eventBus.on('node:created',(node)=>{console.log('Node created:',node);});engine.eventBus.on('node:selected',(node)=>{console.log('Node selected:',node);});engine.eventBus.on('camera:zoom',({ scale })=>{console.log('Zoom changed:',scale);});// Unsubscribeconsthandler=(node)=>console.log(node);engine.eventBus.on('node:created',handler);engine.eventBus.off('node:created',handler);
Grouping and Management
// Create groupconstgroup=engine.nodes.addGroup({x: 0,y: 0});// Add nodes to groupconstrect1=engine.nodes.addShape({x: 10,y: 10,width: 50,height: 50});constrect2=engine.nodes.addShape({x: 70,y: 10,width: 50,height: 50});rect1.getNode().moveTo(group.getNode());rect2.getNode().moveTo(group.getNode());// Manage z-indexrect1.getNode().moveUp();// Move up one levelrect2.getNode().moveDown();// Move down one levelrect1.getNode().moveToTop();// Move to top
Camera and Navigation
// Programmatic zoomengine.camera.zoomIn();// Zoom inengine.camera.zoomOut();// Zoom outengine.camera.setZoom(1.5);// Set specific scale// Panningengine.camera.pan(100,50);// Pan by dx, dy// Center on nodeconstnode=engine.nodes.addShape({x: 500,y: 500,width: 100,height: 100});engine.camera.centerOn(node);// Reset cameraengine.camera.reset();
π§ Development
# Install dependencies
bun install
# Run playground
bun run dev
# Build library
bun run build
# Tests
bun run test# Watch mode
bun run test:run # Single run
bun run test:coverage # With coverage# Linting
bun run lint # ESLint
bun run lint:ts # TypeScript check
bun run lint:fix # Auto-fix