AvaloniaGraphControl 0.6.1
dotnet add package AvaloniaGraphControl --version 0.6.1
NuGet\Install-Package AvaloniaGraphControl -Version 0.6.1
<PackageReference Include="AvaloniaGraphControl" Version="0.6.1" />
paket add AvaloniaGraphControl --version 0.6.1
#r "nuget: AvaloniaGraphControl, 0.6.1"
// 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:
- SugiyamaScheme
- MDS
- Ranking
- IncrementalLayout
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;
}
}
Some graphs from the sample application
Product | Versions 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. |
-
.NETStandard 2.1
- Avalonia (>= 11.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on AvaloniaGraphControl:
Package | Downloads |
---|---|
Spice86
Reverse engineer and rewrite real mode DOS programs |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on AvaloniaGraphControl:
Repository | Stars |
---|---|
Oaz/AvaloniaGraphControl
A graph layout panel for AvaloniaUI
|
|
OpenRakis/Spice86
Reverse engineer and rewrite real mode DOS programs!
|
Release