ChordDiagramLinkLabel
New in version 5.0.11
ChordDiagramLinkLabel ( sourceNodeID ; targetNodeID ; position ; text ; font ; size ; style ; color ; alignment ; orientation ; textWidthMax ; textHeightMax ; shadowEffect ; shadowColor )
Argument | Type | Range | Default | Note |
---|---|---|---|---|
sourceNodeID | str | 0..1000 | ||
targetNodeID | str | 0..1000 | ||
position | num | -10..10 | 0 | |
text | styt | 0..1000 | ||
font | str | 0..1000 | ApplFont | |
size | num | 0..1000 | 9 | |
style | int | 0..7 | plain | |
color | rgba | 0..255 | black | |
alignment | int | 1..3 | 2 | |
orientation | num | -360..360 | 0 | Dimension:[deg] |
textWidthMax | num | -1..10000 | -1 | -1...No limit |
textHeightMax | num | -1..10000 | -1 | -1...No limit |
shadowEffect | num[] | -1000..1000 | 0 | |
shadowColor | rgba | 0..255 | #888a |
Examples
ChordDiagramLinkLabel(;;0;"{SOURCE_ID}-{TARGET_ID}\n|u|";Arial;10.5)
ChordDiagramLinkLabel("A";"Z";1;"|f2|";Verdana;12;bold;red)
ChordDiagramLinkLabel(;"X";-0.95;"|u|";Arial;12)
Description
The ChordDiagramLinkLabel() function can be used to add labels to links. Important: To display labels, set the first argument of the ChordDiagram() function to appearanceConstants = label.
The arguments sourceNodeID and targetNodeID define which link the function refers to. If the sourceNodeID argument is empty, the function is applied to all links with the target node defined in the targetNodeID argument. If the targetNodeID argument is empty, the function is applied to all links with the source node defined in the sourceNodeID argument. If both arguments, sourceNodeID and targetNodeID, are empty, then the function is applied to all links.
The 3rd argument position can be used to control the position of the labels.
position = –1: Labels are placed near the source nodes.
position = 0: Labels are placed in the middle of the links (default).
position = 1: Labels are placed near the target nodes.
Position values other than -1,0,1 can be used to customize the label positions, e.g. 1.05, -0.5, etc.
The label text can be controlled by the 4th argument text. The name of a source node or target node can be inserted using the placeholders {SOURCE_ID} and {TARGET_ID}. In addition, the value (weight) of a link can be displayed by adding a format specifier, e.g. "|u|" or "|f1|". For a detailed explanation of all format specifiers, including numerous examples, see Numbers. Multi-line texts are possible by specifying a line feed "\n". Examples:
| CHORD_DIAGRAM_LINK_LABEL_01 |
1 | OpenDrawing(300;300) |
2 | |
3 | ChordDiagram(label;16;4) /* Function ChordDiagram(...) is always listed first. */ |
4 | ChordDiagramData(2;"A" "X" 5; "A" "Y" 7; "A" "Z" 6; "B" "X" 2; "B" "Y" 9; "B" "Z" 4) |
5 | ChordDiagramLinkStyle(;;#AE210933) |
6 | ChordDiagramLinkLabel(;;-0.85;"|u|") |
7 | ChordDiagramNodeStyle(;darkRed) |
8 | ChordDiagramNodeLabel(;-1;"{NODE_ID}: |u|") |
9 | |
10 |
| CHORD_DIAGRAM_LINK_LABEL_02 |
1 | OpenDrawing(300;300) |
2 | |
3 | ChordDiagram(label;16;4) /* Function ChordDiagram(...) is always listed first. */ |
4 | ChordDiagramData(2;"A" "X" 5; "A" "Y" 7; "A" "Z" 6; "B" "X" 2; "B" "Y" 9; "B" "Z" 4) |
5 | ChordDiagramLinkStyle("A";;#AE210933) |
6 | ChordDiagramLinkLabel("A";;-0.7;"{SOURCE_ID} \u2192 {TARGET_ID}: |u|") |
7 | ChordDiagramNodeStyle(;darkRed) |
8 | ChordDiagramNodeStyle("B";gray) |
9 | ChordDiagramNodeLabel(;-1;"{NODE_ID}") |
10 | |
11 |
All text style arguments are discussed in conjunction with the LabelStyle() function.
Note that ChordDiagramLinkLabel() 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.