konva-architecture-canvas
v1.0.12
Published
π¨ Professional Angular architecture diagram builder with 47+ pre-built components, drag-and-drop interface, nested grouping, custom shapes, and JSON export. Perfect for cloud infrastructure, AI/ML systems, and technical diagrams.
Downloads
1,218
Maintainers
Readme
π¨ Konva Architecture Canvas
Professional Architecture Diagram Builder for Angular
β¨ Features at a Glance
π― 47+ Pre-Built Components
- Cloud providers (AWS, Azure, GCP)
- AI/ML services (GPT, Claude, Llama)
- Databases (PostgreSQL, MongoDB, Redis)
- Vector DBs (Pinecone, Weaviate, Milvus)
- Agent frameworks (LangChain, AutoGen)
- Observability tools (Grafana, DataDog)
π¨ Professional Drawing Tools
- Shapes: Rectangle, Circle, Arrow, Line
- Text with formatting
- Free-hand pen tool
- Color & opacity controls
- Stroke width customization
π¦ Smart Grouping
- Nested groups with color-coding
- Drag groups as single units
- 5-level hierarchy (purple β red β orange β green β blue)
- Extract/reorganize items easily
π Smart Connections
- Auto-routing arrows
- Multiple connection styles
- Bezier curves
- Label support
- Connection color customization
πΎ Save & Export
- Export to PNG, JSON, SVG
- Save custom templates
- Auto-save to localStorage
- Import/export full diagrams
β‘ Power User Features
- Multi-selection (Shift+Click or drag)
- Undo/Redo (Cmd+Z / Cmd+Shift+Z)
- Keyboard shortcuts
- Zoom & Pan
- Grid snapping
- Dark/Light themes
π¦ Installation
Step 1: Install Package
npm install konva-architecture-canvas konvaStep 2: Verify Peer Dependencies
Ensure you have:
{
"@angular/common": "^21.0.0",
"@angular/core": "^21.0.0",
"@angular/forms": "^21.0.0",
"konva": "^10.0.12"
}π‘ Tip: Works with Angular 15+ but optimized for Angular 21
β‘ Quick Start
1οΈβ£ Import the Component
import { Component } from '@angular/core';
import { KonvaCanvasMainComponent } from 'konva-architecture-canvas';
@Component({
selector: 'app-root',
standalone: true,
imports: [KonvaCanvasMainComponent],
template: '<lib-konva-canvas-main></lib-konva-canvas-main>',
styles: [`
lib-konva-canvas-main {
display: block;
width: 100%;
height: 100vh;
}
`]
})
export class AppComponent {}2οΈβ£ Add Global Styles
In your styles.css:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
overflow: hidden;
}3οΈβ£ Run Your App
ng serveOpen http://localhost:4200 - That's it! π
π§© Component Library
π€ AI Foundation Models (12)
GPT-4 Claude Llama Gemini Mistral Cohere Phi Qwen Grok Nova DeepSeek Gemma
ποΈ Vector Databases (6)
Pinecone Weaviate Milvus Chroma pgVector Neon
π Agent Frameworks (10)
LangChain LangGraph Semantic Kernel AutoGen CrewAI LlamaIndex Camel AI AWS Bedrock Replit OpenAI Operator
π Observability (7)
Langfuse Comet Opik Helicone Arize Phoenix DataDog Amplitude Sentry
π οΈ Tool Execution (5)
Composio NPI Exa LinkUp Browserbase
πΎ Memory Systems (6)
Zep Cognee Mem0 VertexAI NapthaAI MaestroAI
β¨ Total: 47+ components with more being added regularly!
π‘ Usage Guide
Adding Components
- Search for components in the left sidebar
- Drag & Drop onto the canvas
- Components automatically appear with icons
Drawing Shapes
- Click a tool from the top toolbar (Rectangle, Circle, Arrow, etc.)
- Click and drag on the canvas
- Use the right panel to customize colors
Connecting Components
- Click the π Connector tool
- Click on the source component
- Click on the target component
- A smart arrow appears automatically!
Creating Groups
- Select multiple items (Shift+Click or drag a box)
- Press Cmd+G (Mac) or Ctrl+G (Windows)
- The group gets a colored border based on nesting level
- Drag the group to move all items together
Saving & Exporting
- Save as Template: Click πΎ button β Save custom template
- Export PNG: Click Export button β Download image
- Export JSON: Click Save JSON β Download architecture data
- Import: Click Load JSON β Select saved file
β¨οΈ Keyboard Shortcuts
| Shortcut | Action | Shortcut | Action |
|----------|--------|----------|--------|
| V | Select tool | R | Rectangle |
| C | Circle | L | Line |
| A | Arrow | T | Text |
| P | Pen tool | K | Connector |
| Cmd/Ctrl+G | Group | Cmd/Ctrl+Shift+G | Ungroup |
| Cmd/Ctrl+Z | Undo | Cmd/Ctrl+Shift+Z | Redo |
| Cmd/Ctrl+A | Select all | Delete | Delete selected |
| Cmd/Ctrl+D | Duplicate | Space+Drag | Pan canvas |
| Scroll | Zoom | Cmd/Ctrl+0 | Reset zoom |
Press ? in the app to see all shortcuts!
π Examples
Example 1: Minimal Setup
import { Component } from '@angular/core';
import { KonvaCanvasMainComponent } from 'konva-architecture-canvas';
@Component({
selector: 'app-diagram',
standalone: true,
imports: [KonvaCanvasMainComponent],
template: '<lib-konva-canvas-main style="display:block;width:100%;height:100vh"></lib-konva-canvas-main>'
})
export class DiagramComponent {}Example 2: With Custom Container
@Component({
selector: 'app-diagram',
standalone: true,
imports: [KonvaCanvasMainComponent],
template: `
<div class="diagram-container">
<lib-konva-canvas-main></lib-konva-canvas-main>
</div>
`,
styles: [`
.diagram-container {
width: 100vw;
height: 100vh;
background: #1a1a2e;
}
lib-konva-canvas-main {
display: block;
width: 100%;
height: 100%;
}
`]
})
export class DiagramComponent {}Example 3: Embedded in a Page
@Component({
selector: 'app-root',
standalone: true,
imports: [KonvaCanvasMainComponent],
template: `
<header class="app-header">My Application</header>
<div class="canvas-wrapper">
<lib-konva-canvas-main></lib-konva-canvas-main>
</div>
<footer class="app-footer">Β© 2025</footer>
`,
styles: [`
.app-header {
height: 60px;
background: #333;
color: white;
display: flex;
align-items: center;
padding: 0 20px;
}
.canvas-wrapper {
height: calc(100vh - 110px);
}
.app-footer {
height: 50px;
background: #222;
color: white;
display: flex;
align-items: center;
justify-content: center;
}
lib-konva-canvas-main {
display: block;
width: 100%;
height: 100%;
}
`]
})
export class AppComponent {}π¨ Component Styling
Stroke (Border)
- 12 preset colors + custom color picker
- Opacity: 0-100%
- Width: 1-10px
- Styles: Solid, dashed, dotted
Fill (Interior)
- Independent color control from stroke
- Separate opacity control
- Patterns: Solid, hatch, cross-hatch, dotted
Groups
- Auto-colored borders by nesting level:
- Level 1: Purple
- Level 2: Red
- Level 3: Orange
- Level 4: Green
- Level 5: Blue
π Troubleshooting
Canvas Not Showing?
Fix: Add to styles.css:
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }Components Not Draggable?
Fix: Make sure you're in Select mode (βοΈ icon) and not another tool mode.
Icons Not Appearing?
Fix: Icons load from the internet. Wait 2-3 seconds on first load. Check your internet connection.
Can't See the Sidebar?
Fix: Make sure the component has adequate width (min 800px recommended).
Performance Issues?
Fix:
- Group components to reduce individual objects
- Avoid excessive nesting (max 5 levels)
- Close unused panels when working
π More Resources
- π Full Documentation: GitHub Repo
- π Live Demo: Try it now
- π¬ Report Issues: GitHub Issues
- π¦ npm Package: View on npm
π€ Contributing
Contributions are welcome! Please feel free to:
- π Report bugs
- π‘ Suggest features
- π§ Submit pull requests
π License
MIT License - Copyright (c) 2025
See LICENSE file for details.
π― Quick Tips
π‘ Use Shift+Click for multi-selection
π‘ Press Cmd+G to group selected items
π‘ Scroll to zoom in and out
π‘ Space+Drag to pan the canvas
π‘ Export often to save your work
π‘ Try keyboard shortcuts for faster workflow
β Star us on GitHub if you find this useful!
Made with β€οΈ by Alla Samba Siva Rao
π Try Live Demo β’ π¦ View on npm β’ π¬ Get Support
