Syncfusion React Sankey

syncfusion/react-ui-components-skills/skills/syncfusion-react-sankey

作者 syncfusion6fb1c883a8412b611b95f839e0cb06e1fc8170a8无许可证收录于 2026年10月9日更新于 2026年10月9日

Implement Syncfusion React Sankey Chart to visualize energy flows, process dependencies, and hierarchical relationships between nodes. Use this skill when creating Sankey diagrams, flow visualizations, or node-link networks. Covers installation, nodes and links configuration, labeling, legends, tooltips, events, appearance customization, RTL support, accessibility, and export features.

AI 生成的概览

指导实现 Syncfusion React 桑基图,用于流量与节点链接可视化。

功能
提供构建 Syncfusion React 桑基图组件的参考文档,涵盖安装、节点与链接配置、标签、图例、工具提示、事件、样式、RTL、无障碍和导出。包含快速入门示例、常见模式以及属性、事件和方法的机器可读 API 列表。交付物是流程图表的实现指导和代码示例。
适用场景
适用于在 React 应用中使用 Syncfusion 创建桑基图、流量可视化或节点链接网络。适合能源流、流程依赖、层级结构、供应链和数据管道图表。
运行要求
需要包含 @syncfusion/ej2-react-charts 包及其依赖项的 React 项目。仅为说明文档,不附带脚本。

Implementing Syncfusion React Sankey Chart

When to Use This Skill

Use this skill when you need to:

  • Display energy flows or process dependencies
  • Visualize hierarchical relationships and data movement between categories
  • Create interactive node-link diagrams with custom styling
  • Build responsive flow visualizations with legends and tooltips
  • Enable user interactions like clicks and hover effects
  • Export or print flow diagrams
  • Support accessibility features and RTL layouts

Component Overview

The Syncfusion React Sankey Chart component visualizes flow data through interconnected nodes and links, perfect for displaying energy consumption, data flows, process hierarchies, and organizational relationships. It provides rich customization options for appearance, interactivity, and accessibility.

Key Features:

  • Node & Link Configuration - Define data sources and destinations with custom styling
  • Labels & Positioning - Control text display, node positioning, and title/subtitle
  • Legend Support - Display legend with customizable positioning and styling
  • Interactivity - Tooltips, click events, and user interactions
  • Appearance Customization - Colors, opacity, link curvature, and theming
  • RTL Support - Right-to-left layout for international applications
  • Accessibility - WCAG compliance and screen reader support
  • Export Capabilities - Export diagrams and print functionality

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md [blocked]

  • Installation and package setup
  • Dependencies and module injection
  • Basic Sankey component creation
  • Development environment setup
  • Running your first example

Nodes and Links Configuration

📄 Read: references/nodes-and-links.md [blocked]

  • Node structure and properties
  • Link structure and data flow
  • Data binding and source/target relationships
  • Node positioning with offset property
  • Link styling and customization
  • Performance optimization for large datasets

Labels and Positioning

📄 Read: references/labels-and-positioning.md [blocked]

  • Label visibility and configuration
  • Node label positioning and alignment
  • Title and subtitle settings
  • Text formatting and styling options
  • Handling label overflow scenarios

Legend and Display Options

📄 Read: references/legend-and-display.md [blocked]

  • Legend configuration and visibility
  • Legend positioning (Top, Bottom, Left, Right)
  • Display options and item padding
  • Visual styling and theming
  • Color customization

Interactivity and Events

📄 Read: references/interactivity.md [blocked]

  • Tooltip configuration and display
  • Event handling (nodeClick, linkClick, load events)
  • User interaction patterns
  • Enabling/disabling interactive features
  • Event callbacks and data access

Appearance and Styling

📄 Read: references/appearance-and-styling.md [blocked]

  • Link styling (opacity, curvature, colorType)
  • Node appearance customization
  • Color schemes and theming
  • CSS integration and custom styling
  • Responsive design considerations

Accessibility and Orientation

📄 Read: references/accessibility-and-orientation.md [blocked]

  • RTL (Right-to-Left) layout support
  • WCAG accessibility compliance
  • Keyboard navigation support
  • Screen reader compatibility
  • Device responsiveness

Export and Print Features

📄 Read: references/export-and-print.md [blocked]

  • Export functionality and image formats
  • Print capabilities
  • Exporting diagram data
  • Configuration options
  • Common export scenarios

API Reference

📄 Read: references/sankey-props.md [blocked] • references/sankey-events.md [blocked] • references/sankey-methods.md [blocked] • references/sankey-examples.md [blocked]

  • Machine-parsable API listings for component props, events, and methods
  • Verified defaults, types, and short descriptions mapped from Syncfusion React Sankey API
  • Implementation examples illustrating common patterns and method usage

Quick Start Example

tsx
import React from 'react';import {  SankeyComponent, Inject, SankeyTooltip, SankeyLegend, SankeyExport,  SankeyNodeDirective,  SankeyNodesCollectionDirective,  SankeyLinkDirective,  SankeyLinksCollectionDirective} from '@syncfusion/ej2-react-charts';import * as ReactDOM from "react-dom";
function BasicSankey() {  return (    <div className="control-pane">      <div className="control-section">        <SankeyComponent          width="90%"          height="420px"          title="Energy Flow"          tooltip={{ enable: true }}          legendSettings={{ visible: true, position: 'Bottom' }}        >          <SankeyNodesCollectionDirective>            <SankeyNodeDirective id="Solar" label={{ text: 'Solar' }} />            <SankeyNodeDirective id="Generation" label={{ text: 'Generation' }} />            <SankeyNodeDirective id="Consumption" label={{ text: 'Consumption' }} />          </SankeyNodesCollectionDirective>          <SankeyLinksCollectionDirective>            <SankeyLinkDirective sourceId="Solar" targetId="Generation" value={450} />            <SankeyLinkDirective sourceId="Generation" targetId="Consumption" value={400} />          </SankeyLinksCollectionDirective>          <Inject services={[SankeyTooltip, SankeyLegend, SankeyExport]} />        </SankeyComponent>      </div>    </div>  );}
export default BasicSankey;ReactDOM.render(<BasicSankey />, document.getElementById("charts"));

Common Patterns

Pattern 1: Multi-Level Flow Visualization

Create hierarchical flows with multiple source and destination nodes for complex data relationships.

tsx
<SankeyComponent title="Process Flow">  <SankeyNodesCollectionDirective>    <SankeyNodeDirective id="Input" />    <SankeyNodeDirective id="Processing" />    <SankeyNodeDirective id="Output" />  </SankeyNodesCollectionDirective>  <SankeyLinksCollectionDirective>    <SankeyLinkDirective sourceId="Input" targetId="Processing" value={100} />    <SankeyLinkDirective sourceId="Processing" targetId="Output" value={80} />  </SankeyLinksCollectionDirective>  <Inject services={[SankeyTooltip, SankeyLegend]} /></SankeyComponent>

Pattern 2: Styled Links with Color Types

Customize link appearance using colorType to inherit colors from source or apply custom styling.

tsx
<SankeyComponent  linkStyle={{     opacity: 0.6,     curvature: 0.55,     colorType: 'Source'  }}>  {/* nodes and links */}  <Inject services={[SankeyTooltip, SankeyLegend]} /></SankeyComponent>

Pattern 3: Responsive with Device Detection

Adapt component dimensions and display based on device type for better UX.

tsx
import { Browser } from '@syncfusion/ej2-base';
<SankeyComponent  height={Browser.isDevice ? '600px' : '450px'}  labelSettings={{ visible: !Browser.isDevice }}>  {/* nodes and links */}  <Inject services={[SankeyTooltip, SankeyLegend]} /></SankeyComponent>

Key Props Reference

PropTypePurpose
widthstringChart width (e.g., '90%', '800px')
heightstringChart height (e.g., '420px')
titlestringMain chart title
subTitlestringChart subtitle
tooltipobjectTooltip configuration
legendSettingsobjectLegend visibility and positioning
labelSettingsobjectNode label configuration
linkStyleobjectLink styling (opacity, curvature, colorType)

Common Use Cases

  1. Energy Consumption Flow - Track energy from sources through generation, distribution, to consumption sectors
  2. Process Dependencies - Visualize workflow stages and data movement through processes
  3. Organizational Hierarchy - Display reporting structures and resource allocation
  4. Supply Chain Flow - Show product movement from suppliers through manufacturing to distribution
  5. Data Pipeline - Visualize data transformation and routing through system components

来源与署名

来源:syncfusion/react-ui-components-skills位于skills/syncfusion-react-sankey提交6fb1c88

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架