AvaloniaGraphControl 0.6.1

dotnet add package AvaloniaGraphControl --version 0.6.1
NuGet\Install-Package AvaloniaGraphControl -Version 0.6.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AvaloniaGraphControl" Version="0.6.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AvaloniaGraphControl --version 0.6.1
#r "nuget: AvaloniaGraphControl, 0.6.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AvaloniaGraphControl as a Cake Addin
#addin nuget:?package=AvaloniaGraphControl&version=0.6.1

// Install AvaloniaGraphControl as a Cake Tool
#tool nuget:?package=AvaloniaGraphControl&version=0.6.1

AvaloniaGraphControl

A graph layout panel for AvaloniaUI

Usage

Each individual graph is displayed through the GraphPanel control included in the assembly

<Window xmlns:agc="clr-namespace:AvaloniaGraphControl;assembly=AvaloniaGraphControl">
    <agc:GraphPanel Graph="{Binding MyGraph}" LayoutMethod="SugiyamaScheme" />
</Window>

The layout is internally implemented with MSAGL (Microsoft Automatic Graph Layout).

The following layout methods are available in MSAGL and can be set in the GraphPanel control independently of the graph model:

The GraphPanel control and the MSAGL assemblies are bundled in a nuget package. The existing MSAGL nuget packages are dedicated to the .NET Framework and do not include any netstandard assembly.

MVVM

The GraphPanel control leverages the MVVM pattern used by AvaloniaUI. Each node of the graph view can be customized according to the underlying view model in the graph definition.

<Window xmlns:agc="clr-namespace:AvaloniaGraphControl;assembly=AvaloniaGraphControl">
    <agc:GraphPanel Graph="{Binding MyGraph}" LayoutMethod="SugiyamaScheme" />
      <agc:GraphPanel.DataTemplates>
        <DataTemplate DataType="{x:Type local:StandardItem}">
          <agc:TextSticker Text="{Binding Name}" Shape="Ellipse" Padding="30,10" />
        </DataTemplate>
        <DataTemplate DataType="{x:Type local:InteractiveItem}">
          <ToggleButton Content="{Binding Name}" Padding="20,5" />
        </DataTemplate>
      </agc:GraphPanel.DataTemplates>
    </agc:GraphPanel>
</Window>

Cross-platform

As shown in the demo, this graph panel can be used in cross-platform AvaloniaUI applications. It was successfully tested on Linux Desktop, Windows Desktop, Android and Browser (web assembly) environments.

Example of graph definition

public static Graph MyGraph
{
  get
  {
    var graph = new Graph();
    graph.Edges.Add(new Edge("A", "B"));
    graph.Edges.Add(new Edge("A", "D"));
    graph.Edges.Add(new Edge("A", "E"));
    graph.Edges.Add(new Edge("B", "C"));
    graph.Edges.Add(new Edge("B", "D"));
    graph.Edges.Add(new Edge("D", "A"));
    graph.Edges.Add(new Edge("D", "E"));
    return graph;
  }
}

Outcome of graph example

Some graphs from the sample application

Family Tree

State Machine

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on AvaloniaGraphControl:

Repository Stars
Oaz/AvaloniaGraphControl
A graph layout panel for AvaloniaUI
Version Downloads Last updated
0.6.1 1,956 10/14/2023
0.5.0 930 7/5/2023
0.4.1 1,064 4/5/2022
0.4.0 4,980 2/23/2021
0.3.3 2,708 11/3/2020

Release