Tesserae.GraphKit 26.6.1992

There is a newer version of this package available.
See the version list below for details.
dotnet add package Tesserae.GraphKit --version 26.6.1992
                    
NuGet\Install-Package Tesserae.GraphKit -Version 26.6.1992
                    
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="Tesserae.GraphKit" Version="26.6.1992" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tesserae.GraphKit" Version="26.6.1992" />
                    
Directory.Packages.props
<PackageReference Include="Tesserae.GraphKit" />
                    
Project file
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 Tesserae.GraphKit --version 26.6.1992
                    
#r "nuget: Tesserae.GraphKit, 26.6.1992"
                    
#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.
#:package Tesserae.GraphKit@26.6.1992
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Tesserae.GraphKit&version=26.6.1992
                    
Install as a Cake Addin
#tool nuget:?package=Tesserae.GraphKit&version=26.6.1992
                    
Install as a Cake Tool

Tesserae.GraphKit

Tesserae.GraphKit is a Tesserae (H5 C#-to-JavaScript) wrapper around the graph-kit interactive graph-visualization library.

It lets you drop a fully interactive, WebGL/Canvas-rendered graph into a Tesserae app from C#, with no JavaScript. The graph-kit library itself is bundled into this NuGet package as a browser-global script (window.graphkit) and embedded through h5.json, so there is no preload step — referencing the package is enough.

Usage

using Tesserae.GraphKit;
using static Tesserae.UI;

var graph = GK.Graph()
    .Dark()
    .AddNode("a", label: "Alice", color: "#4dabf7")
    .AddNode("b", label: "Bob",   color: "#51cf66")
    .AddNode("c", label: "Carol")
    .AddEdge("e1", "a", "b")
    .AddEdge("e2", "b", "c")
    .ForceLayout()
    .OnNodeClick(id => Console.WriteLine($"clicked node {id}"));

document.body.appendChild(
    Stack().WS().HS().Children(graph).Render()
);

GraphView is a regular IComponent, so the usual Tesserae sizing helpers (.W(), .H(), .WS(), .HS(), .S(), .Grow(), …) apply. It implements ISpecialCaseStyling, so those styles are written directly onto the graph container.

API highlights

Area Methods
Data AddNode (label, color, size, shape, textColor, textSize, borderColor, borderWidth, opacity), AddEdge (label, color, width, shape, dashed, curvature, labelPlacement, labelOnHover, labelBackground, textColor, textSize, opacity), UpdateNodeLabel, UpdateNode (merge style overrides onto an existing node), RemoveNode, RemoveEdge, Clear
Layouts ForceLayout, GridLayout, CircleLayout, ConcentricLayout, RadialLayout, HierarchicalLayout, RandomLayout, Fit
Appearance Theme, Light, Dark, BackgroundColor (override the canvas background; null reverts to the theme), UseRenderer, PixelRatio, StatsCorner, ShowStats, HideStats, DotGrid (spacing, color, dotRadius), NoGrid, Debug
Interaction NoNodeDragging, NoPanning, NoZoom, NotSelectable, NoNeighborHighlight, AdaptiveDrag, FreeDrag, ZoomingRatio, ZoomLimits, MinZoom, MaxZoom, MultiSelectKey, CurveParallelEdges, ScaleWithZoom (link node/edge/text sizes to the zoom level instead of keeping them screen-space)
Selection SelectNodes, ClearSelection, GetSelectedNodeIds
Highlight HighlightNodes(params ids), HighlightNodes(fadeOpacity, params ids) (override the dim target opacity for non-matches), ClearHighlight, GetHighlightedNodeIds — softly dims everything except the given nodes (and the edges between them); ideal for search-match highlighting
Visibility SetNodesHidden(hidden, params ids), SetEdgesHidden(hidden, params ids) — hide/show elements by id (e.g. to filter by node/edge type); hiding a node also hides its incident edges
Events OnNodeClick, OnEdgeClick, OnSelectionChanged
Overlays OnContextMenu(target => items), Tooltip(target => IComponent), ShowMinimap
Escape hatch Viz / WhenReady(viz => …) — the raw graph-kit GraphViz instance

Edge shape (EdgeShape.Line / Arrow / Curve), label placement (EdgeLabelPlacement.Above / On / Below), the multi-select modifier (MultiSelectModifier) and the stats overlay corner (StatsCorner) are exposed as C# enums mirroring the underlying graph-kit options.

The context menu, tooltip and minimap are rendered by the library itself in the active theme with the same frosted-glass chrome as the stats overlay:

  • OnContextMenu(target => …) receives a GraphContextTarget (IsNode / IsEdge / IsBackground, Id, SourceId, TargetId) and returns GraphMenuItems. Items support nested submenus (GraphMenuItem.Submenu), separators, icons, shortcut hints, disabled rows, destructive (Danger) commands and per-item Action handlers.
  • Tooltip(target => component) returns any Tesserae IComponent as the hover content (or null to suppress it for that target).
  • ShowMinimap(corner, width, height) docks a live minimap that recenters the camera on click/drag.

The underlying GraphViz instance is created lazily once the component is mounted (so the renderer can measure its container) and tracks the container size via a ResizeObserver.

How the JavaScript is embedded

build/bundle.mjs uses esbuild to bundle the graph-kit TypeScript sources (../src) into a single browser-global IIFE, producing both a readable (assets/js/graph-kit.js) and a minified (assets/js/graph-kit.min.js) artifact that expose window.graphkit. h5.json lists both as resources; H5 picks the readable one for Debug builds and the minified one for Release builds. The csproj refreshes the bundle before each build via the BundleGraphKitJs MSBuild target.

Building

npm install      # once, to fetch esbuild (from the Tesserae.GraphKit/ folder)
npm run bundle   # regenerate assets/js/graph-kit*.js
dotnet build     # builds the H5 package (also runs the bundle step)

License

MIT © Curiosity GmbH

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.  net9.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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.
  • .NETStandard 2.0

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Tesserae.GraphKit:

Package Downloads
Curiosity.FrontEnd.Core

Package Description

Curiosity.FrontEnd

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
26.6.2012 113 6/19/2026
26.6.2011 57 6/19/2026
26.6.1992 48 6/19/2026
26.6.1988 51 6/19/2026
26.6.1987 46 6/19/2026
26.6.1981 49 6/18/2026
26.6.1980 50 6/18/2026
26.6.1979 48 6/18/2026
26.6.1978 46 6/18/2026
26.6.1975 46 6/18/2026
26.6.1974 43 6/18/2026
26.6.1972 42 6/18/2026
26.6.1969 44 6/18/2026