Module

Sankey

This is a flow diagram from source to target where the width of the arrows is proportional to the flow quantity.

This widget is based on D3 Sankey Diagram library.

Tutorials:
See:

View Source widgets/sankey.js, line 7

Methods

# setAlign(bool)

Sets the aligment of the chart. When the breath value is "forward", it's aligned to the right. When the breath value is "backward", it's aligned to the left.

Parameters:
Name Type Description
bool boolean

Align the chart.

View Source widgets/sankey.js, line 184

# setBreadths(val)

Set the nodes breadths.

The following values are supported:

  • forward
  • backward or a function.
Parameters:
Name Type Description
val string | function

Value to apply.

View Source widgets/sankey.js, line 173

# setCycles(func)

Set cycles.

Parameters:
Name Type Description
func function

Callback JavaScript function.

View Source widgets/sankey.js, line 134

# setGenerateNodeTextBackground(bool)

Apply the background filter name in the node. This method needs to set setNodeTextBackgroundFilterName.

Parameters:
Name Type Description
bool Boolean

Apply the filter.

View Source widgets/sankey.js, line 109

# setInfoMargin(num)

Set the info margin.

Parameters:
Name Type Description
num number

Number in pixels.

View Source widgets/sankey.js, line 269

# setInnerJoinOnInitialValue(bool)

Transform outer-join data to inner-join data. This is, it leaves only the nodes and links that are part of paths from the nodes of the first block to the nodes of the last block.

Parameters:
Name Type Description
bool boolean

Enable this transformation.

View Source widgets/sankey.js, line 204

# setIterations(num)

Sets the number of relaxation iterations when generating the layout.

Parameters:
Name Type Description
num number

Numbers of iterations.

View Source widgets/sankey.js, line 193

# setLinkColor(color)

Set the links color.

The following values are supported:

  • source
  • target
  • source-target or an static color.
Parameters:
Name Type Description
color string

Text with the color.

View Source widgets/sankey.js, line 124

# setMargin(margin)

Set the margin value that wraps the chart.

Parameters:
Name Type Description
margin number

Value of margin in pixels.

View Source widgets/sankey.js, line 64

# setNodePadding(num)

Set the vertical separation between adjacent nodes.

Parameters:
Name Type Description
num number

Value of padding.

View Source widgets/sankey.js, line 82

# setNodeTextBackgroundFilterName(filterName)

Set node text background filter name. This method needs to set setGenerateNodeTextBackground.

Parameters:
Name Type Description
filterName string

Text.

View Source widgets/sankey.js, line 90

# setNodeTextBackgroundFilterRef(ref)

Set the filter propperty style as visual effect to a node.

Parameters:
Name Type Description
ref function | string

Filter property.

View Source widgets/sankey.js, line 99

# setNodeWidth(nodeWidth)

Set the width of nodes.

Parameters:
Name Type Description
nodeWidth number

Value of width in pixels.

View Source widgets/sankey.js, line 73

# setPercentile(num)

Apply a percentile score value.

Parameters:
Name Type Description
num number

Number between 0 and 1.

View Source widgets/sankey.js, line 143

# setSourceKey(key)

Set the key of outgoing link.

Parameters:
Name Type Description
key string

Text of the key.

View Source widgets/sankey.js, line 46

# setStatsOnInitialValue(bool)

Set statistics on initial value.

Parameters:
Name Type Description
bool boolean

Enable statistics..

View Source widgets/sankey.js, line 213

# setTailName(str)

Set tail name.

Parameters:
Name Type Description
str string

Text with the name.

View Source widgets/sankey.js, line 159

# setTargetKey(key)

Set the key of incoming link.

Parameters:
Name Type Description
key String

Text of the key.

View Source widgets/sankey.js, line 55

# setValKey(key)

Set the value key.

Parameters:
Name Type Description
key string

Text of the key.

View Source widgets/sankey.js, line 37

# setWeightedPercentile(num)

Apply a weight to the data to apply the percentile.

Parameters:
Name Type Description
num number

Weight value.

View Source widgets/sankey.js, line 150

# setWithInnerJoinToggle(bool)

Set with inner join toggle. #todo

Parameters:
Name Type Description
bool boolean

Enable inner join.

View Source widgets/sankey.js, line 250

# setWithLinkLabels(bool)

Set visible link labels.

Parameters:
Name Type Description
bool boolean

Enable link labels.

View Source widgets/sankey.js, line 231

# setWithNodeLabels(bool)

Add visible title to nodes.

Parameters:
Name Type Description
bool boolean

Enable title.

View Source widgets/sankey.js, line 222

# setWithNodeNames(bool)

Set visible node names.

Parameters:
Name Type Description
bool boolean

Enable node names.

View Source widgets/sankey.js, line 240

# setWithStatsToggle(bool)

Set with stats toggle. #todo

Parameters:
Name Type Description
bool boolean

Enable inner join.

View Source widgets/sankey.js, line 260