Skip to main content
Version: 2027.02 Beta
View as Markdown

Perspective - Sankey

The default Perspective Sankey chart component.

Component Palette Icon:

The Sankey chart component icon shown in the Perspective Components panel and Project Browser.

The Sankey component visualizes directional flow between stages, categories, or systems where each link width represents quantity. Data is displayed with node entities grouped by levels, and links that correlate node sources and targets to show the volume moving between them. This type of chart is recommended for tracking energy flow, material flow, and process yield diagrams.

Properties​

Most Properties have binding options. For more information on bindings, see Types of Bindings in Perspective. This section only documents the props category of properties. The other categories are described on the Perspective Component Properties page.

NameDescriptionProperty Type
dataSets the node and link arrays displayed on the chart.
  • nodes: Entity description configuration.
    • name: Unique node identifier and display label. Referenced by links[x].source and links[x].target. Value is string.
    • level: Column position. Overrides automatic layout placement. Columns are 0-indexed. Value is numeric.
  • links: Describe the flow between nodes with the following properties:
    • source: Name of the source node. Must match a node name in data.nodes[x]. Value is string.
    • target: Name of the target node. Must match a node name in data.nodes[x]. Value is string.
    • value: The flow quantity, which determines the link width. Value is numeric.
object
levelsColumn-level style overrides. All nodes at a given level inherit these styles, unless overriden at the node level.array
layoutLayout engine configuration for the directional flow diagram.
  • direction: The flow direction, where horizontal renders from left to right, and vertical renders from top to bottom. Value is string.
  • nodeWidth: Width of node rectangles in pixels. Value is numeric.
  • nodeGap: Vertical gap, in pixels, between nodes in the same column. Value is numeric.
  • iterations: Number of layout passes. Higher values produce a more stable layout at the cost of render time. Value is numeric.
object
labelsLabel configuration for nodes and links.
  • node: Node label configuration. See labels.node Properties for property information.
  • link: Link label configuration. See labels.link Properties for property information.
  • level: Column header configuration. Text per column comes from levels[x].label. Only levels with a label produce a header. See labels.level Properties for property information.
object
titleChart title and subtitle configuration. Options include:
  • visible: Shows or hides the title. Value is boolean.
  • position: Horizontal alignment of the title within the chart. Value is string.
  • gap: Pixel gap between the main title and subtitle. Value is numeric.
  • text: Main title text.
  • subtitle: The subtitles displayed below the main title.
    • text: The subtitle text. Value is string.
    • color: The color of the subtitle text. Takes precedence over elementStyle.color when both are set.
    • fontSize: The font size of the subtitle text. Takes precedence over elementStyle.fontSize when both are set. Value is numeric.
    • elementStyle: Text style for a label rendered onto a chart canvas, including typography, alignment, pill/chip box styling, and shadow.
  • color: The color of the main title text. Takes precedence over elementStyle.color when both are set.
  • fontSize: The font size of the main title text. Takes precedence over elementStyle.fontSize when both are set. Value is numeric.
  • elementStyle: Text style for a label rendered onto a chart canvas, including typography, alignment, pill/chip box styling, and shadow.
object
tooltipThe tooltip shown on hover. Configuration options include:
  • enabled: Shows the tooltip when true. Value is boolean.
  • nodeFormat: The tooltip text for nodes. Takes precedence over the default tooltip when both are set. Available tokens include {name}, {value}, and {flow}. Value is string.
  • linkFormat: The tooltip text for links. Takes precedence over the default tooltip when both are set. Available tokens include {name} and {value}. Value is string.
object
interactionUser interaction options:
  • draggable: Allows users to drag nodes to reposition them. Value is boolean.
  • focusOnHover: Highlights the hovered node and its connected links, will dim everything else. Value is boolean.
object
appearanceVisual style configuration:
  • colorPalette: Colors auto-assigned to nodes that do not have an explicit data.color. Assigned in data.nodes[x] array order. Defaults to the Ignition theme palette. Value is array.
  • linkOpacity: Global link opacity between 0 and 1. Lower values reduce visual noise on dense charts. Value is numeric.
  • linkColorMode: Determines how the link color is derived. Value is string. Options include:
    • source: Inherits the source node color.
    • target: Inherits the target node color.
    • gradient: Blends the source to target colors.
    • fixed: Uses the first color in the colorPalette property.
  • padding: Pushes the chart's plotting area in from the container edges. Use to make room for a title so it doesn't overlap the diagram. Each side falls back to its own default when left empty. Value is numeric for each top, left, right, and bottom property.
  • backgroundColor: Chart background fill.
  • animation: Enables chart animation on render and when its data changes. Value is boolean.
object
styleSets a style for this chart. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.object

labels.node Properties​

NameDescriptionProperty Type
visibleShows or hides node labels. True by default.boolean
positionLabel placement relative to the node. Options include:
  • right
  • left
  • top
  • bottom
  • inside
string
formatCustom format expression for node label text. Tokens include {name} and {value}.string
fontSizeFont size of node labels in pixels. Takes precedence over elementStyle.fontSize when both are set.numeric
elementStyleText style for a label rendered onto a chart canvas, including typography, alignment, pill/chip box styling, and shadow.object
NameDescriptionProperty Type
visibleShows or hides the link labels. False by default.boolean
formatCustom format expression for link label text. Tokens include {name} and {value}.string
fontSizeFont size of link labels in pixels. Takes precedence over elementStyle.fontSize when both are set.numeric
elementStyleText style for a label rendered onto a chart canvas, including typography, alignment, pill/chip box styling, and shadow.object

labels.level Properties​

NameDescriptionProperty Type
visibleShows or hides the column headers. True by default.boolean
positionDetermines the edge the column headers are anchored to. Options include:
  • right
  • left
  • top
  • bottom
string
paddingThe distance from the anchored edge, as pixels or a percentage of the container's matching dimension.numeric
colorThe color of the column header text. Takes precedence over elementStyle.color when both are set.color
fontSizeFont size of the column headers in pixels. Takes precedence over elementStyle.fontSize when both are set.numeric
elementStyleText style for a label rendered onto a chart canvas, including typography, alignment, pill/chip box styling, and shadow.object

Component Scripts and Events​

Further component interaction and functionality can be configured for all components through scripting and event actions. Right-click on the component or select Components from the Designer menubar to access the configuration popups for both of these options:

  • Configure Events: Accesses the Event Configuration popup where you can configure actions to run in response to events to make the component dynamic. The Events Configurations page shows how to configure events and actions on a Perspective component.

  • Configure Scripts: Accesses the Script Configuration popup where custom methods and message handlers can be added. The Scripting in Perspective section details scripting fundamentals, creating custom methods, and using message handlers.

The Sankey component also has Component Events associated with it. See the Perspective - Sankey Scripting page for more information.

Chart Example​

The following chart example uses the default data for the Sankey chart, with the exception of the buildings data node. The overall appearance has also been updated with gradient selected as the linkColorMode and title and subtitle text added to the top right corner. The included image shows how the chart's appearance changes with focusOnHover enabled and the tooltip.nodeFormat configured to display the node value.

The sample values used in this example are listed below in JSON format.

A Sankey chart highlighting an energy flow of 117 from a Transport node to Electricity and Oil nodes, where the value splits to 22 and 95, respectively.

Sankey Chart Sample Data
[
{
"props": {
"data": {
"nodes": [
{
"level": 0,
"name": "Coal"
},
{
"level": 0,
"name": "Natural Gas"
},
{
"level": 0,
"name": "Renewables"
},
{
"level": 0,
"name": "Nuclear"
},
{
"level": 0,
"name": "Oil"
},
{
"level": 1,
"name": "Electricity"
},
{
"level": 2,
"name": "Buildings"
},
{
"level": 2,
"name": "Transport"
}
],
"links": [
{
"source": "Coal",
"target": "Electricity",
"value": 70
},
{
"source": "Coal",
"target": "Industry",
"value": 35
},
{
"source": "Natural Gas",
"target": "Electricity",
"value": 45
},
{
"source": "Natural Gas",
"target": "Industry",
"value": 40
},
{
"source": "Natural Gas",
"target": "Buildings",
"value": 20
},
{
"source": "Oil",
"target": "Transport",
"value": 95
},
{
"source": "Oil",
"target": "Industry",
"value": 30
},
{
"source": "Renewables",
"target": "Electricity",
"value": 40
},
{
"source": "Nuclear",
"target": "Electricity",
"value": 28
},
{
"source": "Electricity",
"target": "Industry",
"value": 55
},
{
"source": "Electricity",
"target": "Buildings",
"value": 60
},
{
"source": "Electricity",
"target": "Transport",
"value": 22
}
]
},
"layout": {
"nodeWidth": 30
},
"labels": {
"node": {
"format": "{name}"
},
"link": {
"visible": true,
"format": "{value}"
}
},
"title": {
"position": "top-right",
"text": "Energy Flow",
"subtitle": {
"text": "Production and Consumption"
},
"fontSize": 40
},
"tooltip": {
"nodeFormat": "{value}"
},
"appearance": {
"linkColorMode": "gradient",
"backgroundColor": "#FFFFFF"
}
}
}
]