SankeyDiagramNodeColorScheme

New in version 5.0.10

SankeyDiagramNodeColorScheme ( colorScheme ;​ colorVariant ;​ opacity ;​ borderStroke ;​ borderColor ;​ borderColorVariant )

Argument Type Range Default Note
colorScheme int 0..20 1
colorVariant int -1..0 0
opacity num 0..1 1
borderStroke num[] 0..1000 0 Dimension:[pt]
borderColor rgba 0..255 black
borderColorVariant int -1..0 solid
Description

The appearance of the nodes can be controlled by using the functions SankeyDiagramNodeColorScheme() and SankeyDiagramNodeStyle() . By using the 1st argument colorScheme in function SankeyDiagramNodeColorScheme() one of the 20 built-in color schemes can be applied to the nodes. By using the 2nd argument colorVariant, it is possible to choose between the default appearance solid and shaded. In addition, the transparency of the colors can be controlled by using the 3rd argument opacity. The opacity can be set between 0 (fully transparent) and 1 (completely opaque) — default is 1. Moreover, by using the arguments borderStroke, borderColor and borderColorVariant the border of the nodes can be varied.

SANKEY_DIAGRAM_NODE_COLOR_SCHEME_01
1

OpenDrawing(300;​200)

2

SankeyDiagram(label;​10;​3;​1%) /* Function SankeyDiagram(...) always listed first. */

3

SankeyDiagramData(2;​"A" "X" 5;​ "A" "Y" 7;​ "A" "Z" 6;​ "B" "X" 2;​ "B" "Y" 9;​ "B" "Z" 4)

4

SankeyDiagramNodeColorScheme(2;​shaded)

5

SankeyDiagramNodeLabel(;​auto;​"{NODE_ID}")

6

CloseDrawing()

SANKEY_DIAGRAM_NODE_COLOR_SCHEME_01
SANKEY_DIAGRAM_NODE_COLOR_SCHEME_02
1

OpenDrawing(300;​200)

2

SankeyDiagram(label;​16;​3;​1%) /* Function SankeyDiagram(...) always listed first. */

3

SankeyDiagramData(2;​"A" "X" 5;​ "A" "Y" 7;​ "A" "Z" 6;​ "B" "X" 2;​ "B" "Y" 9;​ "B" "Z" 4)

4

SankeyDiagramNodeColorScheme(5;​shaded;​0.6;​1;​darkGray)

5

SankeyDiagramNodeLabel(;​auto;​"{NODE_ID}")

6

CloseDrawing()

SANKEY_DIAGRAM_NODE_COLOR_SCHEME_02

A custom color scheme can be defined by adding a list of colors as the first argument colorScheme. Colors can be entered as red, green and blue components between 0 and 255 or as hexadecimal RGB color code (#rrggbb) - always without an alpha value.

SANKEY_DIAGRAM_NODE_COLOR_SCHEME_03
1

OpenDrawing(300;​200)

2

SankeyDiagram(label;​16;​3;​1%) /* Function SankeyDiagram(...) always listed first. */

3

SankeyDiagramData(2;​"A" "X" 5;​ "A" "Y" 7;​ "A" "Z" 6;​ "B" "X" 2;​ "B" "Y" 9;​ "B" "Z" 4)

4

SankeyDiagramNodeColorScheme(#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b;​shaded)

5

SankeyDiagramNodeLabel(;​auto;​"{NODE_ID}")

6

CloseDrawing()

SANKEY_DIAGRAM_NODE_COLOR_SCHEME_03

For more details, please refer to Color Schemes.

Function SankeyDiagramNodeColorScheme() can be customized by using the corresponding SankeyDiagramNodeStyle() function. The color scheme function should be listed before the style function(s).

SANKEY_DIAGRAM_NODE_COLOR_SCHEME_04
1

OpenDrawing(300;​200)

2

SankeyDiagram(label;​16;​3;​1%) /* Function SankeyDiagram(...) always listed first. */

3

SankeyDiagramData(2;​"A" "X" 5;​ "A" "Y" 7;​ "A" "Z" 6;​ "B" "X" 2;​ "B" "Y" 9;​ "B" "Z" 4)

4

SankeyDiagramNodeColorScheme(8;​solid;​0.5)

5

SankeyDiagramNodeStyle("A";​red) /* After SankeyDiagramNodeColorScheme() */

6

SankeyDiagramNodeStyle("B";​darkYellow) /* After SankeyDiagramNodeColorScheme() */

7

SankeyDiagramNodeLabel(;​auto;​"{NODE_ID}")

8

CloseDrawing()

SANKEY_DIAGRAM_NODE_COLOR_SCHEME_04

Please note that SankeyDiagramNodeColorScheme() should be listed after function SankeyDiagram() function. This rule generally applies: Function SankeyDiagram() should always be listed first before other Sankey functions are called.

Scroll to Top