npx skills add ...
npx skills add syncfusion/angular-ui-components-skills --skill syncfusion-angular-sankey
Create and configure Syncfusion Angular Sankey diagrams for flow visualization. Use this when visualizing weighted flows, processes, and hierarchical relationships. Supports node and link styling, legends, tooltips, events, accessibility features, and comprehensive data binding for complex flow diagrams.
npx skills add syncfusion/angular-ui-components-skills --skill syncfusion-angular-sankey
The Sankey component visualizes directional flow and relationships between entities using nodes and links. Perfect for displaying process flows, energy distribution, resource allocation, and hierarchical relationships with proportional link widths representing quantities.
Use the Sankey component when you need to:
The Sankey diagram consists of:
๐ Read: references/api-reference.md
๐ Read: references/getting-started.md
@syncfusion/ej2-angular-charts package๐ Read: references/nodes-and-links.md
๐ Read: references/appearance-and-sizing.md
๐ Read: references/labels-legends-tooltips.md
๐ Read: references/customization-and-styling.md
๐ Read: references/events-and-interactions.md
๐ Read: references/advanced-features.md
| Property | Type | Purpose |
|---|---|---|
width | string | Component width ('700px', '100%', or '90%') |
height | string | Component height ('420px', '450px', or '100%') |
title | string | Main title for the diagram |
subTitle | string | Subtitle with descriptive text |
orientation | string | Flow direction ('Horizontal' or 'Vertical') |
enableRtl | boolean | Enable right-to-left layout |
theme | string | Built-in theme (Material, Bootstrap, Tailwind, HighContrast, etc.) |
nodeStyle | Object | Global node styling (width, padding, opacity, colors) |
linkStyle | Object | Global link styling (curvature, opacity, colorType) |
labelSettings | Object | Label positioning and visibility |
legendSettings | Object | Legend configuration and positioning |
tooltip | Object | Tooltip template and visibility settings |
nodes | Array | Node definitions (manual property binding) |
links | Array | Link definitions (manual property binding) |
Related Documentation: See implementing-syncfusion-angular-components for other data visualization components.
// Define nodes with categories for legend grouping
const nodes = [
{ id: 'Power', label: { text: 'Power Plant' }, category: 'Source' },
{ id: 'Grid', label: { text: 'Grid' }, category: 'Intermediary' },
{ id: 'Home', label: { text: 'Households' }, category: 'Sink' }
];
// Links represent flow quantities
const links = [
{ sourceID: 'Power', targetID: 'Grid', value: 100 },
{ sourceID: 'Grid', targetID: 'Home', value: 80 }
];// Render event handler for value-based coloring
onNodeRendering = (args: INodeRenderingEventArgs) => {
const value = args.node.value || 0;
args.node.color = value > 100 ? '#00A651' : value > 50 ? '#FFB81C' : '#E81B23';
};// Use opacity to emphasize relationships
onNodeEnter = (args: INodeEnterEventArgs) => {
args.node.highlightOpacity = 1;
};
onNodeLeave = (args: INodeLeaveEventArgs) => {
args.node.highlightOpacity = 0.3;
};