Diagramming Resources
May 7, 2026 ยท View on GitHub
- ๐ ngDiagram website: ngdiagram.dev
- ๐ป ngDiagram GitHub: github.com/synergycodes/ng-diagram
- ๐ ngDiagram Documentation: Getting Started
- ๐ค Presentation: View slides
- ๐ Additional Resources: synergycodes.com/diagramming-resources
NgDiagramMeetupDemo
A showcase demonstrating how to use ng-diagram - an Angular library for creating interactive diagrams.
Project Structure
๐ src/app/diagram/ - Main ng-diagram Integration
This directory contains all the core ng-diagram logic and showcases how to use the library. Start here to learn ng-diagram!
-
diagram.component.ts- Main diagram component with documentation on:- ng-diagram services (ModelService, SelectionService, ViewportService, etc.)
- Event handling (all diagram events with examples)
- Configuration setup
- Model initialization
-
services/diagram.config.ts- NgDiagramConfig with snapping, zoom, rotation, etc.properties-facade.service.ts- Properties panel integrationdebug-events.service.ts- Complete event handling referencecontext-menu-facade.service.ts- Clipboard and z-order operations
-
palette/- Drag & drop palette system:palette-data.ts- Palette item definitionspalette.component.ts- How ng-diagram drag & drop works- Components for palette items and drag previews
-
node-templates/- Custom node components:trigger-node/- Basic node with ports, resize, and rotationcustom-node/- Interactive node with status dropdowngroup-node/- Container node for groupingnode-template-map.ts- Type-to-component mapping
-
edge-templates/- Custom edge components:custom-edge/- Edge template with label support
๐ src/app/ui-components/ - Supporting UI Components
Angular components that provide the UI around the diagram (navbar, sidebars, properties panel, context menu).
๐ src/app/types.ts - Type Definitions
Shared TypeScript interfaces used across the application.
๐ src/app/diagram/middlewares/ - Custom Middleware
horizontal-lock.middleware.ts- Demonstrates how to constrain node movement using the middleware pipeline. Nodes with the name "horizontal" are restricted to X-axis movement only (their Y position stays locked). Try it out by renaming any node to "horizontal" and dragging it around.
Quick Start
Installation
npm install
Development server
To start a local development server, run:
npm start
Once the server is running, open your browser and navigate to http://localhost:4200/. The application will automatically reload whenever you modify any of the source files.
Building
To build the project run:
npm build
This will compile your project and store the build artifacts in the dist/ directory.