How open-source-labs/svelvet works
Main Components Architecture
┌─────────────────────────────────────────────────────────────┐
• Svelvet Container │
• ┤
• ┌─────────────┐ ┌──────────┐ ┌──────────────────┐ │
• Graph │ │ Editor │ │ Controls │ │
• ┘ └──────────┘ └──────────────────┘ │
• ┌─────────────┐ ┌──────────┐ ┌──────────────────┐ │
• Minimap │ │ Drawer │ │ Theme Toggle │ │
• ┘ └──────────┘ └──────────────────┘ │
• ┘
Core Component Relationships
┌─────────────────────────────────────────────────────────────────────┐
• Graph Component │
• ┤
• ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
• Node │◄───────►│ Edge │◄───────►│ Anchor │ │
• ┘ └──────────┘ └──────────────┘ │
• ▲ ▲ ▲ │
• ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
• Group │ │ Resizer │ │ Background │ │
• ┘ └──────────┘ └──────────────┘ │
• ┘
Data Flow System
┌────────────────────────────────────────────────────┐
• Data Flow System │
• ┤
• ┌──────────┐ ┌──────────┐ ┌──────────┐ │
• Slider │ │ Knob │ │ Toggle │ │
• ┘ └──────────┘ └──────────┘ │
• ┌──────────┐ ┌──────────┐ ┌──────────┐ │
• Group │ │ Picker │ │ Field │ │
• ┘ └──────────┘ └──────────┘ │
• ┘
State Management
┌────────────────────────────────────────────┐
• Store System │
• ┤
• ┌───────────────┐ ┌──────────────┐ │
• Graph Store │ │ Cursor Store │ │
• ┘ └──────────────┘ │
• ┌───────────────┐ ┌──────────────┐ │
• Bounds Store │ │ Edge Store │ │
• ┘ └──────────────┘ │
• ┘
Important Implementation Details
• Core components (blue)
• Data flow components (green)
• Store system (orange)
• Utility components (gray)
• Use different line styles for different types of relationships:
• Annotations for:
• Accessibility features
• Theme system
• Event handling system
• Persistent storage functionality
Technical Stack Indicators
• Svelte/SvelteKit
• TypeScript
• Playwright (testing)
• Vitest (unit testing)
• Local Storage (state persistence)
This system design should emphasize:
• Component modularity
• Event-driven architecture
• State management
• Accessibility features
• Customization options
• Data flow system
• Clear visual hierarchy
• Interactive elements (if possible)
• Exportable formats
• Version control compatibility