Skip to content

trrahul/nodify-avalonia

Repository files navigation

Nodify.Avalonia

A powerful, feature-rich node editor control for Avalonia UI applications

NuGet NuGet License Docs

Nodify.Avalonia is a comprehensive node editor library that enables you to create visual programming interfaces, data flow diagrams, and interactive graph-based applications in Avalonia UI. Built with performance and extensibility in mind, it provides a rich set of controls for creating professional node-based editors.

๐Ÿš€ Quick Start

Installation

<PackageReference Include="Nodify.Avalonia" Version="1.0.2" />

Or via Package Manager Console:

Install-Package Nodify.Avalonia

Basic Usage

<nodify:NodifyEditor ItemsSource="{Binding Nodes}"
                     Connections="{Binding Connections}"
                     PendingConnection="{Binding PendingConnection}"
                     SelectedItems="{Binding SelectedNodes}" />

โœจ Features

๐ŸŽฏ Core Capabilities

  • MVVM-First Design - Built from the ground up to work seamlessly with MVVM patterns
  • Zero External Dependencies - Only depends on Avalonia UI
  • High Performance - Optimized rendering and interaction handling for large node graphs
  • Extensible Architecture - Highly customizable with dependency properties and styling

๐ŸŽจ Visual Features

  • Built-in Themes - Professional dark and light themes included
  • Flexible Styling - Comprehensive theming system with customizable templates
  • Connection Types - Multiple connection styles: straight lines, bezier curves, and circuit-style
  • Node Shapes - Support for various node shapes and custom templates

๐Ÿ–ฑ๏ธ Interaction & Navigation

  • Multi-Selection - Select multiple nodes with rectangle selection or Ctrl+click
  • Zooming & Panning - Smooth zooming with mouse wheel and panning with middle mouse button
  • Auto-Panning - Automatic panning when dragging near viewport edges
  • Keyboard Shortcuts - Full keyboard support for common operations
  • Undo/Redo Ready - Command-based architecture supports undo/redo implementations

๐Ÿ”— Connection System

  • Visual Connection Creation - Drag from connectors to create connections visually
  • Pending Connections - Preview connections while dragging
  • Connection Validation - Customizable connection rules and validation
  • Multiple Connection Types - Support for different connection styles and behaviors

๐ŸŽ›๏ธ Advanced Features

  • Grouping & Comments - Group nodes together and add comment nodes
  • Decorators Layer - Overlay custom UI elements on the editor
  • State Management - Built-in state system for handling different interaction modes
  • Performance Optimizations - Virtualization and rendering optimizations for large graphs
  • Grid Snapping - Optional grid snapping for precise node placement

๐Ÿ“ฑ Live Demo

See Nodify.Avalonia in action:

Demo Video

๐Ÿ–ผ๏ธ Screenshots

Calculator Demo

A functional calculator built with visual programming nodes:

Calculator Demo

Playground Application

Interactive playground showcasing all features:

Playground Demo

Node Graph Examples

Node Graph 1

Node Graph 2

๐Ÿ“š Example Applications

This repository includes two comprehensive example applications:

๐Ÿงฎ Calculator

A visual calculator where you can:

  • Create mathematical operation nodes
  • Connect operations to build complex calculations
  • Group operations for organization
  • Use various mathematical functions (Add, Multiply, Divide, Pow, etc.)

Key Controls:

  • Right Click: Show operations menu (create nodes)
  • Delete: Delete selected nodes
  • C: Group selected operations
  • Ctrl+T: Toggle theme

๐ŸŽฎ Playground

An interactive demonstration featuring:

  • All editor features and capabilities
  • Customizable settings panel
  • Theme switching
  • Performance testing with large node graphs
  • Various node types and connection styles

๐Ÿ› ๏ธ Key Components

NodifyEditor

The main editor control that hosts nodes and connections:

<nodify:NodifyEditor ItemsSource="{Binding Nodes}"
                     Connections="{Binding Connections}"
                     ViewportZoom="{Binding ZoomLevel}"
                     ViewportLocation="{Binding PanOffset}" />

ItemContainer

Represents individual nodes in the editor:

<Style Selector="nodify|ItemContainer">
    <Setter Property="Location" Value="{Binding Position}" />
    <Setter Property="IsSelected" Value="{Binding IsSelected}" />
</Style>

Connection Types

  • Connection - Basic connection between nodes
  • LineConnection - Straight line connections
  • CircuitConnection - Circuit-style right-angle connections
  • PendingConnection - Temporary connections while dragging

Connectors

Input and output ports for nodes:

<nodify:Connector IsConnected="{Binding IsConnected}"
                  Anchor="{Binding Position}" />

๐Ÿ”ง Configuration Options

Nodify.Avalonia offers extensive customization through dependency properties:

Viewport Control

  • ViewportZoom - Current zoom level
  • MinViewportZoom / MaxViewportZoom - Zoom limits
  • ViewportLocation - Pan offset
  • DisablePanning / DisableZooming - Disable interactions

Selection & Interaction

  • EnableRealtimeSelection - Update selection while dragging
  • SelectedItems - Currently selected items
  • DisableAutoPanning - Disable auto-pan at edges

Visual Customization

  • GridCellSize - Grid snap size
  • ConnectionTemplate - Custom connection appearance
  • DisplayConnectionsOnTop - Z-order for connections

Performance Options

  • EnableRenderingOptimizations - Optimize for large graphs
  • EnableDraggingOptimizations - Optimize dragging performance

๐ŸŽจ Theming

Built-in themes with full customization support:

<Application.Styles>
    <FluentTheme />
    <StyleInclude Source="avares://Nodify.Avalonia/Themes/Controls.xaml"/>
</Application.Styles>

Custom Styling

<Style Selector="nodify|NodifyEditor">
    <Setter Property="Background" Value="#1E1E1E" />
    <Setter Property="ConnectionTemplate" Value="{StaticResource CustomConnectionTemplate}" />
</Style>

๐Ÿค Contributing

Development Setup

  1. Clone the repository
  2. Open Nodify.Avalonia.sln in your IDE
  3. Build and run the example applications

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐ŸŒŸ Show Your Support

If you find Nodify.Avalonia useful, please consider:

  • โญ Starring the repository
  • ๐Ÿ› Reporting issues
  • ๐Ÿ’ก Suggesting new features
  • ๐Ÿ”„ Contributing code improvements

Made with โค๏ธ for the Avalonia community

About

A cross-platform MVVM Node editor for Avalonia.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages