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. Try It Out
- Nested Diagrams: Create diagrams within diagrams with unlimited depth
- Hierarchical Navigation: Seamlessly navigate between parent and child diagrams using breadcrumbs
- Visual Hierarchy: Clear visual indicators for nested relationships
- Connectors: Create edges between any two elements by holding Alt and clicking each element
- Live Edge Routing: Edges automatically update as you move elements
- Control Points: Drag connector control points to create bezier curves
- Arrow Markers: Configurable start/end arrows on connectors
- 43 Built-in Shapes: Rectangle, Circle, Diamond, Pill, Cylinder, Cloud, Diamond, Star, Shield, Gear, Pod, Queue, and many more
- SVG Image Support: Import and integrate custom SVG graphics directly into diagrams
- Bounding Boxes: Group related elements with customizable containers
- CRC Cards & Threat Tables: Specialized shapes for security and design modeling
- Custom Colors: Full color pickers for fill and stroke
- Border Styles: Solid and dotted border options with adjustable width
- Font Controls: Family, size, bold, and italic styling
- Responsive Design: Adapts to different screen sizes
- High-Performance Rendering: Smooth animations and interactions
- Multi-Selection: Hold Shift while clicking to select multiple elements
- Grouping: Ctrl+G to group, Ctrl+Shift+G to ungroup
- Copy & Paste: Ctrl+C / Ctrl+V to duplicate elements
- Undo/Redo: Full undo history with 50-step buffer
- Drag & Drop: Intuitive element positioning via Angular CDK
- Rotate: Rotate elements 90 degrees
- JSON Export/Import: Save and load diagrams in standard JSON format
- SVG Export: Export the current diagram level as an SVG file
- Persistent State: Automatic saving of diagram state to localStorage
- Cross-Session Continuity: Resume work exactly where you left off
- Per-Diagram Todos: Add, complete, and delete tasks tied to each diagram
- Persistent Tasks: Todo items persist with the diagram state
- Node.js (v18 or higher)
- npm package manager
-
Clone the repository
git clone https://github.com/anandb/digit.git cd digit -
Install dependencies
npm install
-
Start the development server
ng serve
-
Open your browser Navigate to
http://localhost:4200/
The application will automatically reload when you make changes to the source code.
npm run buildThe build artifacts will be stored in the dist/digit/ directory.
- Add Elements: Click the Add button in the toolbar to open the shape palette, then click a shape to add it
- Position Elements: Drag elements around the canvas to arrange your diagram
- Create Connections: Hold Alt and click on two elements to create a connector between them
- Customize Appearance: Right-click any element to open the Properties window
- Creating Connectors: Hold Alt and click the first element, then Alt+click the second element
- Editing Connectors: Right-click a connector to open its properties
- Control Points: Drag connector control points to create curved bezier paths
- Arrows: Configure start and end arrow styles in the connector properties
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 to return to parent diagrams
- Nested Diagram Indicators: Nodes with inner diagrams show a blue folder badge
Right-click any element to open the Properties window, which provides:
- Name: Label for the element
- Content: Editable text for Note and Text shapes
- Border: Solid/dotted toggle and stroke width (0.5-4px)
- Colors: Fill and stroke color pickers
- Font: Family, size, bold, and italic controls
- Rounded Corners: For boxes and rectangles
- Locked: Prevent accidental moves (padlock shapes)
- Stereotypes: For rectangle elements
- Notes & Tags: Additional metadata
- CRC Card Editor: For CRC Card shapes
- Threat Table Editor: For Threat Table shapes
| Shortcut | Action |
|---|---|
Ctrl+Z |
Undo last action |
Ctrl+A |
Select all elements |
Ctrl+S |
Save diagram as JSON |
Ctrl+C |
Copy selection |
Ctrl+V |
Paste clipboard |
Ctrl+G |
Group selected elements |
Ctrl+Shift+G |
Ungroup |
Delete / Backspace |
Delete selected elements |
Alt+Click (two elements) |
Create connector |
Shift+Click |
Multi-select elements |
Escape |
Close toolbar dropdowns |
- New: Create a new blank diagram
- Save / Load: Export and import diagrams as JSON
- Export: Save the current diagram level as an SVG file
- Add: Open the 43-shape palette
- Add Box: Insert a bounding box container
- Add SVG: Upload a custom SVG image
- View SVG: Open an SVG file in read-only viewer mode
- Rotate: Rotate the selected element 90 degrees
- Delete: Remove selected elements
- Chaos Mode: Toggle to spawn 4-7 randomized copies of each added shape
- Help: Toggle the instructions panel
src/
├── app/
│ ├── components/
│ │ ├── diagram-canvas/ # Main SVG canvas component
│ │ ├── diagram-toolbar/ # Sidebar with tools and shape palette
│ │ ├── properties-window/ # Element property editor
│ │ └── todo-panel/ # Per-diagram task tracker
│ ├── models/
│ │ └── diagram.model.ts # TypeScript interfaces and types
│ ├── services/
│ │ └── diagram.service.ts # Centralized state management
│ └── app.component.ts # Root component
├── public/ # Static assets (favicon)
├── styles.sass # Global styles
└── angular.json # Angular configuration
- Angular 19: Modern reactive framework with standalone components
- TypeScript: Type-safe development with strict mode
- RxJS: Reactive programming for state management
- SVG: Scalable vector graphics for crisp rendering
- Angular CDK: Component development kit for drag-and-drop
- SSR: Server-side rendering support via Angular SSR
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
- localStorage Persistence: Full diagram state saved automatically
| Command | Description |
|---|---|
ng serve |
Start the development server |
npm run build |
Production build to dist/digit/ |
npm run build:single |
Build as a single self-contained HTML file |
npm run serve:ssr:digit |
Start the SSR server (requires prior build) |
Generate new components:
ng generate component component-name
ng generate service service-name
ng generate guard guard-nameCreate 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 Angular and TypeScript
Digit - Where ideas connect visually
