Digit is a powerful, web-based diagram editor that revolutionizes the way you create and manage complex hierarchical diagrams. Built with modern web technologies, it offers an intuitive interface for creating interconnected node-based diagrams with unlimited nesting capabilities.
- Nested Diagrams: Create diagrams within diagrams with unlimited depth
- Hierarchical Navigation: Seamlessly navigate between parent and child diagrams
- Visual Hierarchy: Clear visual indicators for nested relationships
- Tendrils: Dynamic connection points that can be positioned anywhere on element borders
- Live Edge Routing: Edges automatically update as you move tendrils
- Smart Snapping: Tendrils snap to element borders for precise positioning
- Connection Types: Support for incoming and outgoing connections
- Multiple Shapes: Rectangle, Circle, Diamond, Triangle, Hexagon, Parallelogram, Trapezoid, Pill, Process, Note, Callout, Cube, Tape, and more
- SVG Image Support: Import and integrate SVG graphics directly into diagrams
- Custom Styling: Full control over colors, borders, and visual properties
- Bounding Boxes: Group related elements with customizable containers
- Custom Colors: Choose from predefined palettes or custom colors
- Border Styles: Solid and dotted border options
- Responsive Design: Adapts to different screen sizes
- High-Performance Rendering: Smooth animations and interactions
- Multi-Selection: Select and manipulate multiple elements simultaneously
- Undo/Redo: Full undo history with 50-step buffer
- Drag & Drop: Intuitive element positioning and tendril placement
- Real-time Updates: Live preview of changes as you edit
- JSON Export/Import: Save and load diagrams in standard JSON format
- Persistent State: Automatic saving of sidebar preferences
- Cross-Session Continuity: Resume work exactly where you left off
- Node.js (v18 or higher)
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/anandb/digit.git cd digit -
Install dependencies
npm install
-
Start the development server
npm start # or ng serve -
Open your browser Navigate to
http://localhost:4200/
The application will automatically reload when you make changes to the source code.
- Add Elements: Click on shape buttons in the toolbar to add nodes to the canvas
- Position Elements: Drag elements around the canvas to arrange your diagram
- Create Connections: Hold Ctrl and click on tendrils to create edges between elements
- Customize Appearance: Use the property panels to change colors, labels, and styles
Tendrils are the connection points on your diagram elements:
- Adding Tendrils: Right-click on an element and select "Add Tendril"
- Moving Tendrils: Click and drag tendrils to reposition them on element borders
- Creating Edges: Hold Ctrl while clicking tendrils to create connections
- Edge Labels: Add names to edges for better documentation
Digit supports unlimited nesting levels:
- Create Inner Diagram: Double-click on any node to enter its inner diagram
- Navigate Hierarchy: Use the breadcrumb navigation or back button
- Exposed Tendrils: Mark tendrils as "exposed" to make them visible in parent diagrams
- Propagated Connections: Connect to inner diagram tendrils from parent levels
- Hold Ctrl/Cmd while clicking to select multiple elements
- Selected elements can be moved, styled, or deleted together
- Drag and drop SVG files onto the canvas
- SVGs are automatically scaled and integrated as diagram elements
- Full support for SVG tendrils and connections
Ctrl+Z: Undo last actionCtrl+S: Save diagramDelete: Remove selected elementsCtrl+Click: Multi-select or create edges
src/
βββ app/
β βββ components/
β β βββ diagram-canvas/ # Main canvas component
β β βββ diagram-toolbar/ # Sidebar with tools
β βββ models/
β β βββ diagram.model.ts # TypeScript interfaces
β βββ services/
β β βββ diagram.service.ts # State management
β βββ app.component.ts # Root component
- Angular 19: Modern reactive framework
- TypeScript: Type-safe development
- RxJS: Reactive programming for state management
- SVG: Scalable vector graphics for crisp rendering
- Angular CDK: Component development kit for drag-and-drop
Digit uses a centralized state management approach:
- DiagramService: Manages all diagram state and operations
- Reactive Updates: Real-time UI updates via RxJS observables
- Undo System: 50-step undo buffer per diagram
- Hierarchical State: Maintains state across nested diagrams
To add custom shapes, modify diagram-canvas.component.ts:
// Add new shape calculation method
getCustomShapePoints(node: any): string {
// Return SVG path data for your custom shape
return `M 0 0 L ${node.size.width} 0 L ${node.size.width} ${node.size.height} Z`;
}Customize tendril positioning and behavior in the service layer:
// Override tendril positioning logic
updateTendril(elementId: string, tendrilId: string, updates: Partial<Tendril>): void {
// Custom positioning logic here
}npm run buildThe build artifacts will be stored in the dist/digit/ directory.
npm testGenerate new components:
ng generate component component-name
ng generate service service-name
ng generate guard guard-namedigit/
βββ src/
β βββ app/
β β βββ components/ # UI components
β β βββ models/ # TypeScript interfaces
β β βββ services/ # Business logic
β β βββ styles/ # Global styles
β βββ assets/ # Static assets
β βββ environments/ # Environment configs
βββ dist/ # Build output
βββ node_modules/ # Dependencies
βββ angular.json # Angular configuration
Create detailed system architectures with nested components, showing data flow and dependencies.
Build complex business process flows with conditional logic and decision points.
Map network infrastructure with hierarchical views of subnets, devices, and connections.
Visualize data transformations and processing pipelines across multiple levels.
Design organizational structures with reporting relationships and team hierarchies.
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow Angular style guide
- Write comprehensive tests
- Update documentation
- Maintain TypeScript strict mode
- Use semantic commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Angular team for the excellent framework
- Open source community for inspiration and tools
- Contributors who help improve Digit
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki
Made with β€οΈ using Angular and TypeScript
Digit - Where ideas connect visually
