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.

Screenshot of Custom Edge example

Custom Edge

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

Screenshot of Custom Model example

Custom Model

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

Screenshot of Custom Ports example

Custom Ports

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

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.

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.

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.

Screenshot of Save Persistence example

Save Persistence

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

Screenshot of Layout Integration example

Layout Integration

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

Screenshot of Custom Middleware example

Custom Middleware

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

Screenshot of Angular Material Node example

Angular Material Node

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

Screenshot of Performance Test example

Performance Test

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

Screenshot of Performance Landing Page Diagram example

Landing Page Diagram

Demonstrates the library's capabilities and integration with external libraries like charts in real-case scenario.