Blazor.FamilyTreeJS
1.0.0
See the version list below for details.
dotnet add package Blazor.FamilyTreeJS --version 1.0.0
NuGet\Install-Package Blazor.FamilyTreeJS -Version 1.0.0
<PackageReference Include="Blazor.FamilyTreeJS" Version="1.0.0" />
paket add Blazor.FamilyTreeJS --version 1.0.0
#r "nuget: Blazor.FamilyTreeJS, 1.0.0"
// Install Blazor.FamilyTreeJS as a Cake Addin #addin nuget:?package=Blazor.FamilyTreeJS&version=1.0.0 // Install Blazor.FamilyTreeJS as a Cake Tool #tool nuget:?package=Blazor.FamilyTreeJS&version=1.0.0
Blazor.FamilyTreeJS
This is a wrapper library for FamilyTreeJS and it is only compatible for Blazor WASM.
FamilyTreeJS version: 1.9.18
See samples on Github page.
Installation
Install from Nuget (not available yet).
dotnet add package Blazor.FamilyTreeJS --version <latest-version>
Register Blazor.FamilyTreeJS
dependencies.
builder.Services.AddBlazorFamilyJS();
Configure IJSRuntime
's JsonSerializerOptions
. This allows System.Text.Json
to ignore null
when
serializing to JSON and send that JSON to Javascript. Note this affects globally.
var app = builder
.Build()
.ConfigureIJSRuntimeJsonOptions();
If you have classes/records that inhereit from classes/records in this library, then you may
need to use the following extension method, UseDerivedTypes<BaseType>([derive types])
.
This allows serializing your derived classes/records with all of their properties.
var app = builder
.Build()
.ConfigureIJSRuntimeJsonOptions();
.UseDerivedTypes<Node>(typeof(NodeWithProfession))
.UseDerivedTypes<NodeMenu>(typeof(CollapseNodeMenu), typeof(DrawLineNodeMenu));
public record NodeWithProfession : Node
{
public string? Job { get; init; } = null;
}
public record CollapseNodeMenu : NodeMenu
{
public Menu? Collapse { get; init; } = null;
}
public record DrawLineNodeMenu : NodeMenu
{
public Menu? Draw { get; init; } = null;
}
Usage
Simplest usage is to provide a tree id.
<FamilyTree TreeId="my-tree" />
This library is heavily driven by the FamilyTreeOptions
class so almost
every control and UI are specified via this class. This C# class mirrors this
Typescript options interface.
<FamilyTree TreeId="my-tree" Options=@new() { Mode = "dark" } />
Please refer to the sample project for more examples.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
-
net7.0
- Blazor.Core (>= 1.0.3)
- Microsoft.AspNetCore.Components.Web (>= 7.0.11)
- Microsoft.AspNetCore.Components.WebAssembly (>= 7.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.