Skip to content
daisyBlazor

NetworkChart

A force-directed graph: linked nodes pull together and all nodes push apart, which shows clusters and hubs, such as dependencies between services. D3 runs the simulation to rest before drawing, so the same data always gives the same picture; the chart draws it in theme colours.
Hierarchy and networks
Cover · <NetworkChart>
Network graphGateway linked to Auth; Gateway linked to Projects; Gateway linked to Search; Projects linked to Database; Projects linked to Storage; Auth linked to Database; Search linked to DatabaseGateway – Auth: 1Gateway – Projects: 1Gateway – Search: 1Projects – Database: 1Projects – Storage: 1Auth – Database: 1Search – Database: 1Gateway (Edge): 3 linksAuth (Core): 2 linksProjects (Core): 3 linksSearch (Core): 2 linksDatabase (Data): 3 linksStorage (Data): 1 linkGatewayAuthProjectsSearchDatabaseStorage

Examples

Basic

Each GraphLink joins two node names; nodes grow with their number of links, and their names sit to the right.

Service dependencies
Service dependenciesGateway linked to Auth; Gateway linked to Projects; Gateway linked to Search; Gateway linked to Deployments; Projects linked to Storage; Projects linked to Auth; Projects linked to Database; Search linked to Index; Search linked to Database; Deployments linked to Builder; Deployments linked to Storage; Deployments linked to Notifications; Builder linked to Registry; Notifications linked to Mailer; Auth linked to DatabaseGateway – Auth: 1Gateway – Projects: 1Gateway – Search: 1Gateway – Deployments: 1Projects – Storage: 1Projects – Auth: 1Projects – Database: 1Search – Index: 1Search – Database: 1Deployments – Builder: 1Deployments – Storage: 1Deployments – Notifications: 1Builder – Registry: 1Notifications – Mailer: 1Auth – Database: 1Gateway: 4 linksAuth: 3 linksProjects: 4 linksSearch: 3 linksDeployments: 4 linksStorage: 2 linksDatabase: 3 linksIndex: 1 linkBuilder: 2 linksNotifications: 2 linksRegistry: 1 linkMailer: 1 linkGatewayAuthProjectsSearchDeploymentsStorageDatabaseIndexBuilderNotificationsRegistryMailer
website/Examples/Charts/NetworkChartBasicExample.razor Source

Groups

Nodes gives each GraphNode a Group, which sets its colour and a legend key; a link's Value sets its thickness.

Network graphCDN linked to Gateway; Gateway linked to Auth; Gateway linked to Projects; Gateway linked to Search; Gateway linked to Deployments; Projects linked to Database; Projects linked to Storage; Auth linked to Database; Search linked to Index; Deployments linked to Queue; Deployments linked to StorageCDN – Gateway: 8Gateway – Auth: 6Gateway – Projects: 5Gateway – Search: 3Gateway – Deployments: 2Projects – Database: 5Projects – Storage: 3Auth – Database: 4Search – Index: 3Deployments – Queue: 2Deployments – Storage: 2Gateway (Edge): 5 linksCDN (Edge): 1 linkAuth (Core): 2 linksProjects (Core): 3 linksDeployments (Core): 3 linksSearch (Core): 2 linksDatabase (Data): 2 linksStorage (Data): 2 linksIndex (Data): 1 linkQueue (Data): 1 linkGatewayCDNAuthProjectsDeploymentsSearchDatabaseStorageIndexQueue
Edge Core Data
website/Examples/Charts/NetworkChartGroupsExample.razor Source

Playground

Service dependencies
Service dependenciesGateway linked to Auth; Gateway linked to Projects; Gateway linked to Search; Gateway linked to Deployments; Projects linked to Storage; Projects linked to Auth; Projects linked to Database; Search linked to Index; Search linked to Database; Deployments linked to Builder; Deployments linked to Storage; Deployments linked to Notifications; Builder linked to Registry; Notifications linked to Mailer; Auth linked to DatabaseGateway – Auth: 1Gateway – Projects: 1Gateway – Search: 1Gateway – Deployments: 1Projects – Storage: 1Projects – Auth: 1Projects – Database: 1Search – Index: 1Search – Database: 1Deployments – Builder: 1Deployments – Storage: 1Deployments – Notifications: 1Builder – Registry: 1Notifications – Mailer: 1Auth – Database: 1Gateway: 4 linksAuth: 3 linksProjects: 4 linksSearch: 3 linksDeployments: 4 linksStorage: 2 linksDatabase: 3 linksIndex: 1 linkBuilder: 2 linksNotifications: 2 linksRegistry: 1 linkMailer: 1 linkGatewayAuthProjectsSearchDeploymentsStorageDatabaseIndexBuilderNotificationsRegistryMailer
<NetworkChart Title="Service dependencies" Links="@_dependencies" />

@code {
    private readonly GraphLink[] _dependencies =
    [
        new("Gateway", "Auth"),
        new("Gateway", "Projects"),
        new("Gateway", "Search"),
        new("Gateway", "Deployments"),
        new("Projects", "Storage"),
        new("Projects", "Auth"),
        new("Projects", "Database"),
        new("Search", "Index"),
        new("Search", "Database"),
        new("Deployments", "Builder"),
        new("Deployments", "Storage"),
        new("Deployments", "Notifications"),
        new("Builder", "Registry"),
        new("Notifications", "Mailer"),
        new("Auth", "Database"),
    ];
}

API

<NetworkChart>

DaisyBlazor.Charts

Parameters

  • AspectRatio double
    = 1.78

    Width divided by height. The chart keeps this shape at any width; its text keeps its size.

  • GroupColors IReadOnlyDictionary<string, string>
    = null

    Optional colour per group name (any CSS colour); other groups cycle through the theme palette.

  • Iterations int
    = 300

    Simulation steps run before drawing (0 to 1000). More steps settle large graphs further.

  • Links IReadOnlyList<GraphLink>
    = []

    The connections. Node names come from Source and Target; links to the same node or without a positive Value are skipped.

  • Nodes IReadOnlyList<GraphNode>
    = null

    Optional node list: sets each node's Group (its colour) and adds nodes that have no links.

  • RowHeight double?
    = null

    Height of each row in px, for a chart that lays its categories out as rows (horizontal bars, a Gantt's lanes, a heatmap's rows…): its height then follows its number of rows instead of AspectRatio, so a long list keeps readable rows at any width. A chart, or an orientation, without rows ignores it.

  • ShowLabels bool
    = true

    Print each node's name to its right.

  • ShowLegend bool
    = true

    Show a colour key for the node groups under the chart.

  • ShowTitle bool
    = true

    Draw Title as a visible heading above the chart (the default); false keeps it only as the chart's accessible name, for a chart inside a card that already has a heading.

  • Title string
    = null

    Optional heading rendered above the chart; it is also the chart's accessible name.

  • ValueFormat string
    = "{0:#,0.##}"

    Format string for link values in tooltips, e.g. "{0:N0} calls".

  • Width string
    = "100%"

    CSS width of the chart wrapper.

  • Class string
    = null

    Additional CSS classes merged onto the w-full wrapper.

  • Style string
    = null

    Inline styles appended after the width on the wrapper.

Something went wrong while running the docs. Reload