ChordDiagramNodeColorScheme
New in version 5.0.11
ChordDiagramNodeColorScheme ( 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 | 0 |
Examples
ChordDiagramNodeColorScheme(15)
ChordDiagramNodeColorScheme(15;shaded)
ChordDiagramNodeColorScheme(7;;;1)
Description
The appearance of the nodes can be controlled using the ChordDiagramNodeColorScheme() and ChordDiagramNodeStyle() functions. Using the first argument colorScheme in the ChordDiagramNodeColorScheme() function, one of the 20 built-in color schemes can be applied to the nodes. Using the 2nd argument colorVariant, it is possible to choose between the default solid and shaded appearance. In addition, the transparency of the colors can be controlled using the 3rd argument opacity. The opacity can be set between 0 (fully transparent) and 1 (fully opaque) — the default is 1. The borderStroke, borderColor and borderColorVariant arguments can be used to vary the border of the nodes.
| CHORD_DIAGRAM_NODE_COLOR_SCHEME_01 |
1 | OpenDrawing(300;300) |
2 | ChordDiagram(label;12;3;1%) /* Function ChordDiagram(...) is always listed first. */ |
3 | ChordDiagramData(2;"A" "X" 5; "A" "Y" 7; "A" "Z" 6; "B" "X" 2; "B" "Y" 9; "B" "Z" 4) |
4 | ChordDiagramNodeColorScheme(2;shaded) |
5 | ChordDiagramNodeLabel(;auto;"{NODE_ID}";Verdana;9;bold;white) |
6 |
| CHORD_DIAGRAM_NODE_COLOR_SCHEME_02 |
1 | OpenDrawing(300;300) |
2 | ChordDiagram(label;16;3;1%) /* Function ChordDiagram(...) is always listed first. */ |
3 | ChordDiagramData(2;"A" "X" 5; "A" "Y" 7; "A" "Z" 6; "B" "X" 2; "B" "Y" 9; "B" "Z" 4) |
4 | ChordDiagramNodeColorScheme(16;shaded;0.6;1;darkGray) |
5 | ChordDiagramNodeLabel(;auto;"{NODE_ID}") |
6 |
A custom color scheme can be defined by adding a list of colors as the first argument colorScheme. Colors can be specified as red, green and blue components between 0 and 255, or as hexadecimal RGB color code (#rrggbb) - always without an alpha value.
| CHORD_DIAGRAM_NODE_COLOR_SCHEME_03 |
1 | OpenDrawing(300;300) |
2 | ChordDiagram(label;16;3;1%) /* Function ChordDiagram(...) is always listed first. */ |
3 | ChordDiagramData(2;"A" "X" 5; "A" "Y" 7; "A" "Z" 6; "B" "X" 2; "B" "Y" 9; "B" "Z" 4) |
4 | ChordDiagramNodeColorScheme(#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b;shaded) |
5 | ChordDiagramNodeLabel(;auto;"{NODE_ID}";Arial;9.5;bold;white) |
6 |
See Color Schemes for more details.
The ChordDiagramNodeColorScheme() function can be customized by using the corresponding ChordDiagramNodeStyle() function. The color scheme function should be listed before the style function(s).
| CHORD_DIAGRAM_NODE_COLOR_SCHEME_04 |
1 | OpenDrawing(300;300) |
2 | ChordDiagram(label;16;3;1%) /* Function ChordDiagram(...) is always listed first. */ |
3 | ChordDiagramData(2;"A" "X" 5; "A" "Y" 7; "A" "Z" 6; "B" "X" 2; "B" "Y" 9; "B" "Z" 4) |
4 | ChordDiagramNodeColorScheme(8;solid;0.5) |
5 | ChordDiagramNodeStyle("A";red) /* After ChordDiagramNodeColorScheme() */ |
6 | ChordDiagramNodeStyle("B";darkYellow) /* After ChordDiagramNodeColorScheme() */ |
7 | ChordDiagramNodeLabel(;auto;"{NODE_ID}") |
8 |
Note that ChordDiagramNodeColorScheme() should be listed after the ChordDiagram() function. This rule generally applies: The ChordDiagram() function should always be listed first, before other chord functions are called.