ragraph.plot.components
¶
Plot components.¶
This module contains several re-usable plot components that contain the data for a Plotly (sub-)
figure. See Component
for the definition of a plot component.
Blank
¶
Bases: Component
Blank plot component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
style
|
Style
|
Plot style mapping. |
Style()
|
Source code in ragraph/plot/components/blank.py
Labels
¶
Bases: Component
Labels list plot component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
leafs
|
List[Node]
|
List of leaf nodes. |
required |
style
|
Style
|
Plot style mapping. |
Style()
|
Source code in ragraph/plot/components/labels.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
Legend
¶
Bases: Component
Legend component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
edges
|
List[Edge]
|
List displayed edges. |
required |
style
|
Style
|
Plot style mapping. |
Style()
|
Source code in ragraph/plot/components/legend.py
PieMap
¶
Bases: Component
A map of piecharts plot component.
This map, or matrix, of pie-charts display the edges between leaf nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rows
|
List[Node]
|
The nodes to be placed on the rows of the matrix. |
required |
cols
|
List[Node]
|
The columns to be placed on the columns of the matrix. |
required |
edges
|
List[Edge]
|
Edges to be displayed between leaf nodes. |
[]
|
style
|
Style
|
Plot style option mapping. |
Style()
|
Note
The pie-charts can represent a number of things, including edge weights, edge labels as well as other metrics. The node hierarchy is included using squares drawn around the diagonal.
Furthermore, bus nodes have their respective row and column in a shaded background color. This sets apart the buses' "highly integrative" edges from the regular edges between nodes.
Source code in ragraph/plot/components/piemap.py
Tree
¶
Bases: Component
Hierarchy tree plot component of leaf nodes up to their roots.
Leaf nodes are plotted as a vertical list with their roots on the left side.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
leafs
|
List[Node]
|
List of leaf nodes. |
required |
style
|
Style
|
Plot style mapping. |
Style()
|
Source code in ragraph/plot/components/tree.py
blank
¶
Blank plot component¶
Blank
¶
Bases: Component
Blank plot component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
style
|
Style
|
Plot style mapping. |
Style()
|
Source code in ragraph/plot/components/blank.py
chord
¶
Chord plots usings openchord¶
chord
¶
Make a chord plot for the given nodes in a graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
Graph
|
Graph to create a chord plot for. |
required |
nodes
|
Optional[Union[List[Node], List[str]]]
|
Nodes or node names to include in the chord plot. Defaults to leaf nodes. |
None
|
style
|
Optional[Style]
|
Plotting style. |
None
|
adj_kwargs
|
Optional[Dict[str, Any]]
|
Additional arguments to |
None
|
symmetrize
|
bool
|
Whether to symmetrize the adjacency matrix. |
False
|
show
|
bool
|
Whether to show the resulting figure. |
False
|
Returns:
Type | Description |
---|---|
Chord
|
Chord plot using openchord. |
Source code in ragraph/plot/components/chord.py
labels
¶
Labels list plot component¶
Labels
¶
Bases: Component
Labels list plot component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
leafs
|
List[Node]
|
List of leaf nodes. |
required |
style
|
Style
|
Plot style mapping. |
Style()
|
Source code in ragraph/plot/components/labels.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
legend
¶
Legend plot component¶
Legend
¶
Bases: Component
Legend component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
edges
|
List[Edge]
|
List displayed edges. |
required |
style
|
Style
|
Plot style mapping. |
Style()
|
Source code in ragraph/plot/components/legend.py
get_categorical_legend_traces
¶
Create categorical legend traces.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
categories
|
List[str]
|
List of categories. |
required |
style
|
Style
|
Plot style mapping. |
Style()
|
Returns:
Type | Description |
---|---|
List[Scatter]
|
List of traces. |
Source code in ragraph/plot/components/legend.py
get_legend_categories
¶
Get the number of categories to be included in the legend.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
edges
|
List[Edge]
|
The list of edges that are being displayed. |
required |
display
|
str
|
The selected display mode. |
required |
Returns:
Type | Description |
---|---|
List[str]
|
list of categories. |
Source code in ragraph/plot/components/legend.py
get_numerical_legend_traces
¶
Get traces for a numerical legend,
Parameters:
Name | Type | Description | Default |
---|---|---|---|
edges
|
List[Edge]
|
List of edges that are displayed. |
required |
style
|
Style
|
Style object. |
Style()
|
Returns:
Type | Description |
---|---|
List[Scatter]
|
List of traces. |
Source code in ragraph/plot/components/legend.py
get_swatchtraces
¶
Swatch bar of color map.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
idx
|
int
|
Number of the swatch that must be created. |
required |
name
|
str
|
name of the swatch trace. |
required |
colors
|
List[str]
|
List of colors to be added to the swatch trace |
required |
min_value
|
float
|
Minimum value of the weight related to the color map. |
required |
max_value
|
float
|
Maximmum value of the weight related to the color map. |
required |
style
|
Style
|
Style object. |
Style()
|
Returns:
Type | Description |
---|---|
List[Scatter]
|
List of go.Scatter traces. |
Source code in ragraph/plot/components/legend.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
|
piemap
¶
Piechart mapping matrix plot component¶
The mapping plot is a matrix of pie-charts, indicating the edges between leaf nodes.
The nodes are identically placed from left-to-right as well as top-to-bottom. This results in a diagonal (from top-left to bottom-right) of 'self loops', which are commonly used to indicate "the nodes themselves".
The pie-charts can represent a number of things, including edge weights, edge labels as well as other metrics. The node hierarchy is included using squares drawn around the diagonal.
Furthermore, bus nodes have their respective row and column in a shaded background color. This sets apart the buses' "highly integrative" edges from the regular edges between nodes.
PieMap
¶
Bases: Component
A map of piecharts plot component.
This map, or matrix, of pie-charts display the edges between leaf nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rows
|
List[Node]
|
The nodes to be placed on the rows of the matrix. |
required |
cols
|
List[Node]
|
The columns to be placed on the columns of the matrix. |
required |
edges
|
List[Edge]
|
Edges to be displayed between leaf nodes. |
[]
|
style
|
Style
|
Plot style option mapping. |
Style()
|
Note
The pie-charts can represent a number of things, including edge weights, edge labels as well as other metrics. The node hierarchy is included using squares drawn around the diagonal.
Furthermore, bus nodes have their respective row and column in a shaded background color. This sets apart the buses' "highly integrative" edges from the regular edges between nodes.
Source code in ragraph/plot/components/piemap.py
tree
¶
Hierarchy tree plot component¶
This module contains the Tree
component which produces a
Component
for the hierarchy tree of a vertical list of leaf
nodes up to their roots which are put on their left.
Tree
¶
Bases: Component
Hierarchy tree plot component of leaf nodes up to their roots.
Leaf nodes are plotted as a vertical list with their roots on the left side.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
leafs
|
List[Node]
|
List of leaf nodes. |
required |
style
|
Style
|
Plot style mapping. |
Style()
|