Skip to content

Examples

Explore these examples to learn how to implement various features in ngDiagram. Each example includes a live demo and full source code to help you get started quickly.

Screenshot of Custom Node example

Custom Node

Learn how to create a custom node with your own template and form controls.

View Example →
Screenshot of Custom Edge example

Custom Edge

Create custom edges with unique visual styles and interactive elements, including labeled edges and wave-shaped connections.

View Example →
Screenshot of Custom Model example

Custom Model

Implement a custom model that persists data directly to localStorage with automatic synchronization.

View Example →
Screenshot of Custom Ports example

Custom Ports

Customize port appearance and behavior with styling, positioning, and connection type configuration.

View Example →
Screenshot of Context Menu example

Context Menu

Implement a context menu that adapts its options based on whether a node or the diagram background is clicked.

View Example →
Screenshot of Properties Sidebar example

Properties Sidebar

Build an interactive properties panel that updates when nodes are selected and allows real-time editing of attributes.

View Example →
Screenshot of Download Image example

Download Image

Export the current flow as a PNG image using the html-to-image library with proper bounding box calculation.

View Example →
Screenshot of Save Persistence example

Save Persistence

Implement save and restore functionality to persist diagram state to local storage.

View Example →
Screenshot of Layout Integration example

Layout Integration

Integrate external layout libraries like ELK.js for advanced automatic diagram layouts with edge routing.

View Example →
Screenshot of Custom Middleware example

Custom Middleware

Create a custom middleware that implements read-only functionality by intercepting state changes.

View Example →
Screenshot of Angular Material Node example

Angular Material Node

Learn how to integrate Angular Material components within your custom nodes.

View Example →
Screenshot of Performance Test example

Performance Test

Explore the performance capabilities with 500 nodes arranged in a grid with almost 500 connections.

View Example →