Skip to content

Network Graph for Angular

AngularCharts

Accessible SVG network graph: nodes and edges laid out by a deterministic force-directed simulation (seeded; it settles, then stops). The settling animates only when animation is allowed and the user has not asked for reduced motion. Node groups get palette colors and marker shapes; nodes can be pinned by dragging or with Shift+Arrow; zoom and pan use the shared chart zoom. Arrow keys move between connected nodes, neighbors are highlighted on focus, and the data table is an adjacency list.

  • Deterministic layoutA seeded force simulation that settles and stops; reduced motion skips the animation.
  • Neighbor navigationArrow keys move to the connected node in that direction; neighbors light up on focus.
  • Pin by drag or keyDrag a node or press Shift with an arrow key to pin it; U unpins.
  • Adjacency tableEvery connection, with weights, in an accessible table.

Behavior, design tokens, and limitations are described on the Network Graph page; this page covers the Angular API.

import { Component } from '@angular/core';
import { AuiNetworkGraph } from '@absoluteui/angular/network-graph';
import type { NetworkEdge, NetworkNode } from '@absoluteui/components/network-graph';
@Component({
selector: 'app-team',
imports: [AuiNetworkGraph],
template: `<aui-network-graph label="Team collaboration" [nodes]="nodes" [edges]="edges"></aui-network-graph>`,
})
export class TeamComponent {
readonly nodes: NetworkNode[] = [{ id: 'a', label: 'Ana' }, { id: 'b', label: 'Ben' }];
readonly edges: NetworkEdge[] = [{ source: 'a', target: 'b' }];
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiNetworkGraph } from '@absoluteui/angular/network-graph';

Defaults for every instance: provideAbsoluteUIConfig({ components: { networkGraph: { ... } } }) (see Configuration).

Class AuiNetworkGraph; template reference #ref="auiNetworkGraph".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
label string Required. Chart title: visible text and the accessible name of the plot (aria-labelledby); also the data table caption.
hideLabel boolean false Visually hide the title; it stays the accessible name.
description string Visible description below the title, also referenced by aria-describedby (text only).
summary string Replaces the generated accessible summary (node, edge, and group counts, the most connected node, nodes without connections, hidden groups).
valueFormat NumberFormatOptions Number format for values in the tooltip and table.
formatValue (value: number) => string Custom value text; overrides valueFormat everywhere.
theme ChartTheme Look and feel: { palette?: string[] (1-8 CSS colors for slots 1-8); fontFamily?; fontSize? (8-32 px); textColor?; gridLines?: boolean; gridColor?; gridDash?; axisColor?; lineWidth?; markerSize?; cornerRadius?; barRadius?; cellRadius?; sliceRadius?; boxRadius?; swatchRadius?; tooltipRadius?; controlRadius?; lineJoin?; areaOpacity?; gradient?; valueLabelColor?; tooltip?: { background?, color?, borderColor? }; legendPosition?: ‘top’ | ‘bottom’ | ‘start’ | ‘end’; animation?: boolean | { duration?: number } }. Applied as –aui-chart-* custom properties and classes on the host through the CSSOM (CSP-safe); colors are validated with CSS.supports(‘color’). Animation is opt-in and never runs with prefers-reduced-motion: reduce or [data-aui-animation=‘none’].
renderTooltip ChartTooltipRenderer Custom tooltip content as DOM nodes (never HTML strings). context: { title, rows: { label, value, seriesId }[], column, row, source: “pointer” | “focus” | “sync” }. Return null for the default tooltip. The tooltip stays aria-hidden; the focused mark keeps its accessible label.
syncGroup string Shared chart option; a network graph has no column concept, so it has no effect.
nodes readonly NetworkNode[] Required. Nodes: { id: string (unique, non-empty); label: string; group?: string (color, shape, legend); value?: number >= 0 (radius grows with its square root) }. At most 1,000.
edges readonly NetworkEdge[] Required. Edges: { source: node id; target: node id (not the source); weight?: positive number (line thickness, table) }. At most 5,000.
groups readonly NetworkGroup[] Group labels, colors, and legend order: { id; label; color?: 1-8; colorValue?: CSS color }. Default: groups in order of first appearance, labelled by id; nodes without a group share one labelled “Other”.
directed boolean false Draw arrowheads at edge targets.
seed number '1' Layout seed (integer 0-4294967295): the same data and seed always give the same layout.
linkDistance number '60' Preferred edge length in layout units (10-400).
charge number '120' Node repulsion (1-2000).
pinned readonly NetworkPin[] Nodes fixed at a position in layout units: { id; x; y } (the coordinate space of positions). Dragging and Shift+Arrow add pins.
zoom boolean true Zoom and pan: toolbar buttons, + / - / 0 keys, Ctrl/Cmd + wheel, drag on the background to pan, Shift + drag to select.
legend ChartLegendMode 'auto' Legend of node groups (toggle buttons): auto shows it with more than one group, show always, hide never.
dataTable ChartTableMode 'toggle' Data table fallback (an adjacency list: node, group, connection count, connected nodes with weights): behind a Show data table button (built on first open), always visible, visually hidden (screen readers only), or none.
tooltip boolean true Tooltip on pointer hover and keyboard focus.
patterns boolean false Shared chart option; groups already differ by marker shape, so it has no extra effect.
height number '400' Plot height in CSS px (integer 120-2000); the width follows the container.
nodeLabels NetworkGraphNodeLabels 'auto' Node labels: auto (graphs up to 50 visible nodes), always, or none.
animate boolean true Animate the layout settling; never with prefers-reduced-motion: reduce or animation: ‘none’ (the final layout is then computed before the first paint).
locale string 'en-US' Number, date, and message locale.
direction Direction 'ltr' rtl puts node labels on the left; the layout is not mirrored.
Model Type Change output Description
[(hiddenSeries)] readonly string[] (hiddenSeriesChange) Ids of hidden groups (legend toggles): their nodes and edges are not drawn and not reachable.
Output Payload Description
(pointClicked) ChartPointClickDetail A node was activated: pointer click or tap, or Enter / Space on the focused node. seriesId is the node id, series its group, value its connection count. Re-emits aui-point-click.
(nodePinned) NetworkGraphNodePinDetail A node was pinned (drag end or Shift+Arrow) or unpinned (U); also announced politely. Re-emits aui-node-pin.
(seriesToggled) ChartSeriesToggleDetail A group was shown or hidden from the legend. Re-emits aui-series-toggle.
(zoomed) ChartZoomDetail The visible window changed (fractions 0-1 of the layout bounds). Re-emits aui-zoom.

Call them through a viewChild query or a template reference.

Method Description
setSeriesVisible(id: string, visible: boolean): void Show or hide an item programmatically (no event).
relayout(): void Run the layout again from the current positions; pinned nodes stay.
unpinAll(): void Remove every pin (no event); call relayout() to let the nodes move.

Pattern: SVG node-link diagram as a named, described group (role=“group” with aria-roledescription “network graph”) of role=“img” nodes with roving focus and neighbor navigation; legend of group toggle buttons; zoom toolbar; adjacency-list data table.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Network Graph: Accessibility and performance.