JavaScript/jQuery Sankey API

The Sankey is a UI component that visualizes the flow magnitude between value sets. The values being connected are called nodes; the connections - links. The higher the flow magnitude, the wider the link is.

import Sankey from "devextreme/viz/sankey"
Type:

Object

Options

This section describes properties that configure the Sankey UI component's contents, behavior and appearance.

Name Description
adaptiveLayout

Specifies adaptive layout properties.

alignment

Aligns node columns vertically.

dataSource

Binds the UI component to data.

disabled

Specifies whether the UI component responds to user interaction.

elementAttr

Specifies the global attributes to be attached to the UI component's container element.

export

Configures the exporting and printing features.

hoverEnabled

Specifies whether nodes and links change their style when they are hovered over or pressed.

label

Configures sankey nodes' labels.

link

Configures sankey links' appearance.

loadingIndicator

Configures the loading indicator.

margin

Generates space around the UI component.

node

Configures sankey nodes' appearance.

onDisposing

A function that is executed before the UI component is disposed of.

onDrawn

A function that is executed when the UI component's rendering has finished.

onExported

A function that is executed after the UI component is exported.

onExporting

A function that is executed before the UI component is exported.

onFileSaving

A function that is executed before a file with exported UI component is saved to the user's local storage.

onIncidentOccurred

A function that is executed when an error or warning occurs.

onInitialized

A function used in JavaScript frameworks to save the UI component instance.

onLinkClick

A function that is executed when a sankey link is clicked or tapped.

onLinkHoverChanged

A function that is executed after the pointer enters or leaves a sankey link.

onNodeClick

A function that is executed when a sankey node is clicked or tapped.

onNodeHoverChanged

A function that is executed after the pointer enters or leaves a sankey node.

onOptionChanged

A function that is executed after a UI component property is changed.

palette

Sets the palette to be used to colorize sankey nodes.

paletteExtensionMode

Specifies how to extend the palette when it contains less colors than the number of sankey nodes.

pathModified

Notifies the UI component that it is embedded into an HTML page that uses a tag modifying the path.

redrawOnResize

Specifies whether to redraw the UI component when the size of the parent browser window changes or a mobile device rotates.

rtlEnabled

Switches the UI component to a right-to-left representation.

size

Specifies the UI component's size in pixels.

sortData

Specifies nodes' sorting order in their columns.

sourceField

Specifies which data source field provides links' source nodes.

targetField

Specifies which data source field provides links' target nodes.

theme

Sets the name of the theme the UI component uses.

title

Configures the UI component's title.

tooltip

Configures tooltips - small pop-up rectangles that display information about a data-visualizing UI component element being pressed or hovered over with the mouse pointer.

weightField

Specifies which data source field provides links' weights.

See Also

Methods

This section describes the methods that control the Sankey UI component.

Name Description
beginUpdate()

Prevents the UI component from refreshing until the endUpdate() method is called.

dispose()

Disposes of all the resources allocated to the Sankey instance.

element()

Gets the root UI component element.

endUpdate()

Refreshes the UI component after a call of the beginUpdate() method.

exportTo(fileName, format)

Exports the UI component.

getAllLinks()

Gets all sankey links.

getAllNodes()

Gets all sankey nodes.

getDataSource()

Gets the DataSource instance.

getInstance(element)

Gets the instance of a UI component found using its DOM node.

getSize()

Gets the current UI component size.

hideLoadingIndicator()

Hides the loading indicator.

hideTooltip()

Hides all UI component tooltips.

instance()

Gets the UI component's instance. Use it to access other methods of the UI component.

off(eventName)

Detaches all event handlers from a single event.

off(eventName, eventHandler)

Detaches a particular event handler from a single event.

on(eventName, eventHandler)

Subscribes to an event.

on(events)

Subscribes to events.

option()

Gets all UI component properties.

option(optionName)

Gets the value of a single property.

option(optionName, optionValue)

Updates the value of a single property.

option(options)

Updates the values of several properties.

print()

Opens the browser's print window.

render()

Redraws the UI component.

resetOption(optionName)

Resets an property to its default value.

showLoadingIndicator()

Shows the loading indicator.

svg()

Gets the UI component's SVG markup.

See Also

Events

This section describes events that the Sankey UI component raises.

Name Description
disposing

Raised before the UI component is disposed of.

drawn

Raised when the UI component's rendering has finished.

exported

Raised after the UI component is exported.

exporting

Raised before the UI component is exported.

fileSaving

Raised before a file with exported UI component is saved to the user's local storage.

incidentOccurred

Raised when an error or warning occurs.

initialized

Raised only once, after the UI component is initialized.

linkClick

Raised when a sankey link is clicked or tapped.

linkHoverChanged

Raised after the pointer enters or leaves a sankey link.

nodeClick

Raised when a sankey node is clicked or tapped.

nodeHoverChanged

Raised after the pointer enters or leaves a sankey node.

optionChanged

Raised after a UI component property is changed.

See Also

Node

A sankey node's structure.

You can use the getAllNodes() method and event handlers to access nodes, for example, onNodeClick.

Link

A sankey link's structure.

You can access links using the getAllLinks() method and within some event handlers, for example, onLinkClick.