Mathema.Graph.MAUI.Visualization 1.1.9

dotnet add package Mathema.Graph.MAUI.Visualization --version 1.1.9
NuGet\Install-Package Mathema.Graph.MAUI.Visualization -Version 1.1.9
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="Mathema.Graph.MAUI.Visualization" Version="1.1.9" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mathema.Graph.MAUI.Visualization --version 1.1.9
#r "nuget: Mathema.Graph.MAUI.Visualization, 1.1.9"
#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 Mathema.Graph.MAUI.Visualization as a Cake Addin
#addin nuget:?package=Mathema.Graph.MAUI.Visualization&version=1.1.9

// Install Mathema.Graph.MAUI.Visualization as a Cake Tool
#tool nuget:?package=Mathema.Graph.MAUI.Visualization&version=1.1.9

Mathema.Graph.MAUI.Visualization Library

Welcome to the Mathema.Graph.MAUI.Visualization library for .NET MAUI! This library provides a powerful and flexible graph visualization control that allows you to display any graph with ease.

Features and Usage Guidelines

Versatile Graph Display:

The control supports the visualization of any graph, offering flexibility in the representation of graph elements.

Screenshot of Demo Application

Object-Oriented Graph Elements:

Nodes and edges within the graph can hold arbitrary objects, granting users freedom in data representation. Just convert your graph like this:

var graph = new Graph();
var a = new DataNode() { DataItem = new YourObject() };
var b = new DataNode() { DataItem = new YourObject() };
graph.AddNode(a);
graph.AddNode(b);
// add more nodes

var c = new DataEdge(a, b) { DataItem = new YourObject() };
graph.AddEdge(c);
// add more edges...

MSAGL Integration:

Microsoft MSAGL is utilized for efficient graph layout calculations, ensuring a visually appealing presentation.

XAML Integration:

Easily insert the control into your XAML layouts, thanks to seamless integration with SkiaSharp.

Customizable Binding Properties:

  • Layout Settings: Choose from various layout algorithms (e.g., Sigma algorithm or MDS) through the LayoutSetting property.
  • Interactive Elements: Define actions using ICommand for both edge and vertex interactions through OnEdgeClicked and OnVertexClicked.
  • Much more...

Usage Example (with CommunityToolkit.Mvvm):

Here's an example of how to use the control:

  1. Install latest version of https://www.nuget.org/packages/Mathema.Graph.MAUI.Visualization/
  2. Install and add latest version of https://www.nuget.org/packages/SkiaSharp/
C#:
using SkiaSharp.Views.Maui.Controls.Hosting;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder.UseMauiApp<App>().UseSkiaSharp();
	return builder.Build();
    }
}
  1. Add your graph to your viewmodel
// Add using statement
using Mathema.Graph.MAUI.Visualization.Models;

public partial class GraphsViewModel : BaseViewModel
{
    [ObservableProperty]
    Graph graphData;

    public GraphsViewModel()
    {
        var graph = new Graph();
	var a = new DataNode() { DataItem = new YourObject() };
	var b = new DataNode() { DataItem = new YourObject() };
        graph.AddNode(a);
        graph.AddNode(b);
	// add more nodes

	var c = new DataEdge(a, b) { DataItem = new YourObject() });
        graph.AddEdge(c);
	// add more edges...

        // set property
	GraphData = graph;
    }

    [RelayCommand]
    async Task NodeClicked(Node node)
    {
	// Handle individual node "clicked" event
    }

    [RelayCommand]
    async Task EdgeClicked(Edge edge)
    {
	// Handle individual edge "clicked" event
    }
}

  1. Add your customizable control in xaml
XAML:
controls:ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:controls="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:graph="clr-namespace:Mathema.Graph.MAUI.Visualization.Controls;assembly=Mathema.Graph.MAUI.Visualization"
             x:Class="YourPage">
    <graph:VisualizationControlView
        BackgroundColor="Transparent"
        HorizontalOptions="FillAndExpand"
        VerticalOptions="FillAndExpand"
        LayoutSetting="SugiyamaScheme"
        Graph="{Binding GraphData}"
        OnEdgeClicked="{Binding EdgeClickedCommand}"
        OnVertexClicked="{Binding NodeClickedCommand}"
        EdgeThickness="2"
        VertexHeight="45.0"
        VertexWidth="80.0"
        VertexShape="Ellipse">
    </graph:VisualizationControlView>
</controls:ContentPage>

Feel free to explore the various properties and customize the control to suit your specific graph visualization needs. Thank you for choosing Mathema's GraphVisualizationControl library! If you have any questions or feedback, please don't hesitate to reach out.

Project status

If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-android33.0 is compatible.  net7.0-ios was computed.  net7.0-ios16.1 is compatible.  net7.0-maccatalyst was computed.  net7.0-maccatalyst16.1 is compatible.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net7.0-windows10.0.19041 is compatible.  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. 
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

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.9 231 10/24/2023
1.1.8 110 10/24/2023
1.1.7 96 10/23/2023
1.1.6 98 10/23/2023
1.1.5 115 10/22/2023
1.1.4 105 10/22/2023
1.1.3 109 10/22/2023
1.1.2 117 10/22/2023
1.1.1 119 10/22/2023
1.1.0 117 10/21/2023
1.0.13 108 10/18/2023
1.0.12 121 10/14/2023
1.0.11 108 10/13/2023
1.0.10 103 10/13/2023
1.0.9 107 10/13/2023
1.0.8 104 10/13/2023
1.0.7 109 10/13/2023
1.0.6 105 10/13/2023
1.0.5 106 10/13/2023
1.0.4 107 10/13/2023
1.0.3 108 10/13/2023
1.0.2 102 10/13/2023
1.0.1 114 10/13/2023
1.0.0 107 10/13/2023