Soenneker.Blazor.Drawflow
3.0.8
Prefix Reserved
dotnet add package Soenneker.Blazor.Drawflow --version 3.0.8
NuGet\Install-Package Soenneker.Blazor.Drawflow -Version 3.0.8
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="Soenneker.Blazor.Drawflow" Version="3.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.Drawflow" Version="3.0.8" />
<PackageReference Include="Soenneker.Blazor.Drawflow" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Blazor.Drawflow --version 3.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Blazor.Drawflow, 3.0.8"
#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.
#addin nuget:?package=Soenneker.Blazor.Drawflow&version=3.0.8
#tool nuget:?package=Soenneker.Blazor.Drawflow&version=3.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Soenneker.Blazor.Drawflow
Soenneker.Blazor.Drawflow is a lightweight, modern Blazor wrapper for drawflow.js, enabling interactive node-based diagrams in your Blazor applications. It supports advanced features like modules, zoom, import/export, and full event handling.
Features
- Node and Connection Management: Add, remove, and update nodes and connections programmatically.
- Modules: Organize nodes into modules and switch between them.
- Zoom & Pan: Built-in zoom controls and canvas panning.
- Import/Export: Serialize and restore flows as JSON.
- Event Handling: Subscribe to all major events (node created, removed, selected, data changed, etc).
- Customizable: Pass options to control rerouting, curvature, zoom limits, and more.
- CDN or Local Assets: Load drawflow.js and CSS from CDN or local files.
Installation
dotnet add package Soenneker.Blazor.Drawflow
Quick Start
- Register Services (in
Program.cs
):
builder.Services.AddDrawflowInteropAsScoped();
- Add the Component (in your
.razor
file):
<Drawflow @ref="Flow" Options="_options" OnNodeCreated="HandleNodeCreated" style="height:400px"></Drawflow>
@code {
private Drawflow? Flow;
private readonly DrawflowOptions _options = new();
private Task HandleNodeCreated(string id)
{
Console.WriteLine($"Node created {id}");
return Task.CompletedTask;
}
}
Event Callbacks
<Drawflow
@ref="Flow"
Options="_options"
OnNodeCreated="HandleNodeCreated"
OnNodeRemoved="HandleNodeRemoved"
OnConnectionCreated="HandleConnectionCreated"
OnDataChanged="HandleDataChanged"
... />
Programmatic API
await Flow.AddNode("github", 1, 1, 150, 150, "github", new { name = "GitHub" }, "<div>GitHub</div>");
await Flow.AddConnection("github", "slack", "output", "input");
await Flow.ZoomIn();
await Flow.Export();
Options
var options = new DrawflowOptions {
Reroute = true,
Curvature = 0.3,
Zoom = 1.0,
ZoomMax = 2.0,
ZoomMin = 0.3,
DraggableInputs = true,
UseUuid = true,
ManualCreate = false // auto-create on render
};
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Intellenum (>= 1.0.6)
- Microsoft.AspNetCore.Components.Web (>= 9.0.6)
- Soenneker.Blazor.Utils.InteropEventListener (>= 3.0.3666)
- Soenneker.Blazor.Utils.ResourceLoader (>= 3.0.1479)
- Soenneker.Extensions.List (>= 3.0.927)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.