Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • Context Menu
  • Drawer
  • Footer
  • Menu
  • Navbar
  • On This Page
  • Separator
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Container
  • Flex
  • Grid
  • Text
  • Link
  • Button
  • Form
    • AutocompleteNew
    • Checkbox
    • Color Picker
    • Date Picker
    • Date Range Picker
    • Datetime Picker
    • Datetime Range Picker
    • File Upload
    • Input GroupNew
    • NumericNew
    • Masked InputNew
    • Radio Button
    • Range SliderNew
    • RatingNew
    • Select
    • Slider
    • Switch
    • Tag InputNew
    • Text EditorNew
    • Textfield
    • Time Picker
    • Time Range Picker
  • Toggle
  • Toggle Group
  • Alert
  • Avatar
  • Badge
  • Chip
  • Empty
  • Icon
  • Popover
  • Progress
  • Skeleton
  • Spinner
  • Tooltip
  • Data Table
  • SpreadsheetNew
  • Column Filter Editor
  • Pagination
  • Pick List
  • Barcode
  • QR Code
  • Calendar
  • Table
  • Attachment
  • Overview
    • Bar
    • Bullet
    • Column
    • Dot Plot
    • Dumbbell
    • Icon
    • Lollipop
    • Radial Bar
    • Range
    • Word Cloud
    • Area
    • Bump
    • Bump Area
    • Candlestick
    • Gantt
    • Horizon
    • Line
    • Slope
    • Small Multiples
    • Stream Graph
    • Funnel
    • Gauge
    • Marimekko
    • Nightingale
    • Pie
    • Treemap
    • Waffle
    • Waterfall
    • Circular Treemap
    • Convex Treemap
    • Dendrogram
    • Sunburst
    • Barcode
    • Beeswarm
    • Box Plot
    • Density Plot
    • Histogram
    • Radial Histogram
    • Ridgeline
    • Strip Plot
    • Violin Plot
    • Categorical Scatter
    • Contour
    • Hexagonal Binning
    • Quadrant
    • Scatter
    • Heatmap
    • Matrix
    • Parallel Coordinates
    • Radar
    • Arc Diagram
    • Chord Diagram
    • Flowchart
    • Network Diagram
    • Sankey
    • Euler Diagram
    • Venn Diagram
  • Bubble
  • Marker
  • Message
  • Dialog Service
  • Toast Service
API DocumentationAI Agents & Skills
Home Get Started

Charts

TwNetworkDiagramChart

TwNetworkDiagramChart is a Blazor network diagram that arranges linked nodes close together and unrelated ones apart.

Last updated 23 October 2026

Basic usage

TwNetworkDiagramChart draws each ChartGraphNode as a named dot and each ChartGraphLink as a line. You give no positions: linked nodes pull together and all nodes push apart until the layout settles. Links refer to nodes by Id.
Service dependencies
UI
API
Auth
Database
Cache
UI→ API 1→ Auth 1
API→ Auth 1→ Database 1→ Cache 1← UI 1
Auth← UI 1← API 1
Database← API 1
Cache← API 1
RAZOR
<TwChart Title="Service dependencies">
    <TwNetworkDiagramChart Nodes="@_services" Links="@_dependencies" />
</TwChart>
CSHARP
@code {
    private readonly ChartGraphNode[] _services = [new("ui", "UI"), new("api", "API"), new("auth", "Auth"), new("db", "Database"), new("cache", "Cache")];
    
    private readonly ChartGraphLink[] _dependencies =
    [
        new("ui", "api"), new("ui", "auth"), new("api", "auth"), new("api", "db"), new("api", "cache")
    ];
}

Hubs and clusters

The layout brings structure out of a plain list of links. Here two tightly linked groups separate, joined through the one node that belongs to both.
Who works with whomPeople who shared a project this year
Ana
Bo
Cy
Di
Eli
Fay
Gus
Hal
Ivy
Ana→ Bo 3→ Cy 2
Bo→ Cy 4→ Di 1← Ana 3
Cy→ Di 2← Ana 2← Bo 4
Di← Bo 1← Cy 2← Eli 2
Eli→ Di 2→ Fay 3→ Gus 1
Fay→ Gus 2→ Hal 1← Eli 3
Gus→ Hal 4← Eli 1← Fay 2
Hal→ Ivy 2← Gus 4← Fay 1
Ivy← Hal 2
RAZOR
<TwChart Title="Who works with whom" Description="People who shared a project this year">
    <TwNetworkDiagramChart Nodes="@_people" Links="@_collaborations" SourceHeader="Person" TargetHeader="Worked with" ValueHeader="Projects" Height="ChartHeight.Large" />
</TwChart>
CSHARP
@code {
    private readonly ChartGraphNode[] _people =
    [
        new("ana", "Ana"), new("bo", "Bo"), new("cy", "Cy"), new("di", "Di"), new("eli", "Eli"),
        new("fay", "Fay"), new("gus", "Gus"), new("hal", "Hal"), new("ivy", "Ivy")
    ];
    
    private readonly ChartGraphLink[] _collaborations =
    [
        new("ana", "bo", 3), new("ana", "cy", 2), new("bo", "cy", 4), new("bo", "di", 1), new("cy", "di", 2),
        new("eli", "di", 2),
        new("eli", "fay", 3), new("eli", "gus", 1), new("fay", "gus", 2), new("gus", "hal", 4), new("fay", "hal", 1), new("hal", "ivy", 2)
    ];
}

A star

A single hub with many spokes settles into a star, and nodes with no links drift to the edge.
Office network
Switch
Router
Printer
Storage
Desk 1
Desk 2
Desk 3
Spare laptop
Switch→ Router 1→ Printer 1→ Storage 1→ Desk 1 1→ Desk 2 1→ Desk 3 1
Router← Switch 1
Printer← Switch 1
Storage← Switch 1
Desk 1← Switch 1
Desk 2← Switch 1
Desk 3← Switch 1
Spare laptop
RAZOR
<TwChart Title="Office network">
    <TwNetworkDiagramChart Nodes="@_devices" Links="@_cables" ShowTableToggle="false" />
</TwChart>
CSHARP
@code {
    private readonly ChartGraphNode[] _devices =
    [
        new("switch", "Switch"), new("router", "Router"), new("printer", "Printer"), new("nas", "Storage"),
        new("desk1", "Desk 1"), new("desk2", "Desk 2"), new("desk3", "Desk 3"), new("spare", "Spare laptop")
    ];
    
    private readonly ChartGraphLink[] _cables =
    [
        new("switch", "router"), new("switch", "printer"), new("switch", "nas"),
        new("switch", "desk1"), new("switch", "desk2"), new("switch", "desk3")
    ];
}

When to use

Use a network diagram to show which nodes are connected. Only closeness carries meaning, not left, right, up or down, and the arrangement is the same every time for the same data. Links that name a missing node, or join a node to itself, are left out.

Summary

Tooltips and the table view give the source, target and value of each link.

Shared features

The legend, tooltips, keyboard navigation, table view, value formatting, height and empty state work the same on every chart. See TwChart for those options.

Keyboard navigation

The plot is a single Tab stop. Each data point is announced with its series and value as focus reaches it, and the table view presents the same data without the plot.
Key What it does
Tab Moves focus into the plot, onto the data point last visited.
Arrow Right or Arrow Down Moves to the next data point.
Arrow Left or Arrow Up Moves to the previous data point.
Home or End Moves to the first or last data point.
Escape Hides the tooltip of the focused data point.
Enter or Space On a legend item: shows or hides that series. On the table button: switches between the chart and its data table.

On this page

  • Basic usage
  • Hubs and clusters
  • A star
  • When to use
  • Summary
  • Shared features
  • Keyboard navigation
twblazor

The Tailwind CSS component library for Blazor. Accessible, themeable and MIT licensed.

Discord (opens in a new tab) GitHub(opens in a new tab)

Get started

  • Install guide
  • Theming
  • Class merging
  • Localization

Guides

  • Tailwind CSS with Blazor
  • Why twblazor?
  • Right to left
  • AI agents and skills

Resources

  • API documentation (opens in a new tab)
  • llms.txt (opens in a new tab)
  • MIT License (opens in a new tab)

Community

  • Contributing (opens in a new tab)
  • Code of conduct (opens in a new tab)
  • Report an issue (opens in a new tab)

twblazor is and always will be free and open source.

An unhandled error has occurred. Reload