SankeyMark<T> Class

Draws a Sankey diagram of the flows between nodes, with a row per link: the nodes are bars in columns whose heights are their values, and the links are bands whose widths are their values. The nodes take the colors of the palette of the theme, and a link takes the color of its source, unless the Mark<T>.Fill channel colors the links.

public sealed class SankeyMark<T> : Mark<T>

Type parameters

T
The type of the rows: the links.

Remarks

The links must not form a cycle: drawing the plot throws an InvalidOperationException.

Inheritance
Mark<T> SankeyMark<T>

Constructors

NameDescription
SankeyMark(IEnumerable<T>, Func<T, object?>, Func<T, object?>, Func<T, object?>)Initializes a new instance of the SankeyMark<T> class.

SankeyMark(IEnumerable<T>, Func<T, object?>, Func<T, object?>, Func<T, object?>)

SankeyMark.cs

Initializes a new instance of the SankeyMark<T> class.

public SankeyMark(IEnumerable<T> data, Func<T, object?> source, Func<T, object?> target, Func<T, object?> value)

Parameters

data IEnumerable<T>
The rows: the links.
source Func<T, object?>
The channel of the name of the node the link leaves.
target Func<T, object?>
The channel of the name of the node the link reaches.
value Func<T, object?>
The channel of the value of the link.

Properties

NameDescription
AlignmentGets or sets how the nodes are placed in columns. The default is SankeyAlignment.Justify.
LinkOpacityGets or sets the opacity of the links, from 0 to 1. The default is 0.4.
NodePaddingGets or sets the space between the nodes of a column. The default is 10.
NodeWidthGets or sets the width of the nodes. The default is 15.
ShowLabelsGets or sets a value that indicates whether the names of the nodes are drawn. The default is true.
SourceGets the channel of the name of the node the link leaves.
TargetGets the channel of the name of the node the link reaches.
ValueGets the channel of the value of the link.

Alignment

SankeyMark.cs

Gets or sets how the nodes are placed in columns. The default is SankeyAlignment.Justify.

public SankeyAlignment Alignment { get; set; }

Property value

SankeyAlignment

LinkOpacity

SankeyMark.cs

Gets or sets the opacity of the links, from 0 to 1. The default is 0.4.

public double LinkOpacity { get; set; }

Property value

double

NodePadding

SankeyMark.cs

Gets or sets the space between the nodes of a column. The default is 10.

public double NodePadding { get; set; }

Property value

double

NodeWidth

SankeyMark.cs

Gets or sets the width of the nodes. The default is 15.

public double NodeWidth { get; set; }

Property value

double

ShowLabels

SankeyMark.cs

Gets or sets a value that indicates whether the names of the nodes are drawn. The default is true.

public bool ShowLabels { get; set; }

Property value

bool

Gets the channel of the name of the node the link leaves.

public Func<T, object?> Source { get; }

Property value

Func<T, object?>

Gets the channel of the name of the node the link reaches.

public Func<T, object?> Target { get; }

Property value

Func<T, object?>

Gets the channel of the value of the link.

public Func<T, object?> Value { get; }

Property value

Func<T, object?>