ragraph.plot.generic
¶
RaGraph generic plotting classes¶
ChordStyle
¶
Bases: Mapping
RaGraph chord style mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
radius |
Optional[Union[int, float]]
|
Radius of the Chord plot. |
None
|
padding |
Optional[Union[int, float]]
|
Padding to apply around the Chord plot. |
None
|
gap_size |
Optional[float]
|
Gap size between the nodes in the Chord plot. |
None
|
ribbon_gap |
Optional[float]
|
Gap size between the outside arc (circle) and ribbons. |
None
|
ribbon_stiffness |
Optional[float]
|
Tweaks the curvature of the ribbons (0.0 straight, 1.0 delayed curve). |
None
|
arc_thickness |
Optional[float]
|
Thickness of the outside arc (circle). |
None
|
bg_color |
Optional[str]
|
Background color of the Chord plot. |
None
|
bg_transparency |
Optional[float]
|
Background color transparency of the Chord plot. |
None
|
fontsize |
Optional[float]
|
Chord plot font size. |
None
|
fontfactor |
Optional[float]
|
Font factor to calculate the padding with. |
None
|
fontfamily |
Optional[str]
|
Chord plot font family. |
None
|
Source code in ragraph/plot/generic.py
Component
¶
|
Bases: Mapping
Plot component. The basic building block to create compound Plotly figures with.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
width |
Optional[float]
|
Width in pixels. |
None
|
height |
Optional[float]
|
Height in pixels. |
None
|
traces |
Optional[List[BaseTraceType]]
|
Traces to plot in this domain. |
None
|
shapes |
Optional[List[Dict[str, Any]]]
|
SVG shapes from this component. |
None
|
xaxis |
Optional[Union[XAxis, Dict[str, Any]]]
|
Plotly X-axis options. |
None
|
yaxis |
Optional[Union[YAxis, Dict[str, Any]]]
|
Plotly Y-axis options. |
None
|
Source code in ragraph/plot/generic.py
FieldPalette
¶
LabelsStyle
¶
|
Bases: Mapping
Labels plot component style mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fontcolor |
Optional[str]
|
Font color used for labels. |
None
|
fontfamily |
Optional[str]
|
Font family used for labels. |
None
|
fontsize |
Optional[int]
|
Fontsize used for labels. |
None
|
fontaspectratio |
Optional[float]
|
Font width per fontsize ratio. |
None
|
textorientation |
Optional[str]
|
Orientation of label text, one of "horizontal", "vertical". |
None
|
xaxis |
Optional[Union[XAxis, Dict[str, Any]]]
|
Plotly X-axis settings. |
None
|
yaxis |
Optional[Union[YAxis, Dict[str, Any]]]
|
Plotly Y-axis settings. |
None
|
Source code in ragraph/plot/generic.py
LegendStyle
¶
|
Bases: Mapping
Legend plot component style mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fontcolor |
Optional[str]
|
Font color used for labels. |
None
|
fontfamily |
Optional[str]
|
Font family used for labels. |
None
|
fontsize |
Optional[int]
|
Fontsize used for labels. |
None
|
fontaspectratio |
Optional[float]
|
Font width per fontsize ratio. |
None
|
height |
Optional[int]
|
Height of the swatch plot in number of box sizes when plotting a numerical legend. |
None
|
n_ticks |
Optional[int]
|
Number of ticks in the swatch plot when plotting a numerical legend. |
None
|
xaxis |
Optional[Union[XAxis, Dict[str, Any]]]
|
Plotly X-axis settings. |
None
|
yaxis |
Optional[Union[YAxis, Dict[str, Any]]]
|
Plotly Y-axis settings. |
None
|
Source code in ragraph/plot/generic.py
Palettes
¶
|
Bases: Mapping
Plot palettes mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
categorical |
Optional[List[str]]
|
Categorical data color palette. |
None
|
continuous |
Optional[List[str]]
|
Continuous (numeric) data color palette. |
None
|
fields |
Optional[Dict[str, FieldPalette]]
|
Palette override dictionary per display field. |
None
|
domains |
Optional[Dict[str, Tuple[float, float]]]
|
Value domains to interpolate palettes between per field as a tuple of (lower, upper) bounds. Only used for continuous fields. |
None
|
Source code in ragraph/plot/generic.py
categorical
¶
continuous
¶
domains
¶
Value domains to interpolate palettes between per field as a tuple of (lower, upper), bounds. Only used for continuous fields.
fields
¶
|
get_categorical_color
¶
Get a color from a categorical palette.
Source code in ragraph/plot/generic.py
get_categorical_palette
¶
Get a categorical color (palette). Might be an overridden color, colorlist, or the default palette for the given field.
Source code in ragraph/plot/generic.py
get_continuous_color
¶
Get a color from the continuous palette by its interpolated index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
float
|
Value to get an interpolated color for. |
required |
lower |
float
|
Lower bound value (overridden if selected field is in domains). |
required |
upper |
float
|
Upper bound value (overridden if selected field is in domains). |
required |
field |
Optional[str]
|
Optional field to fetch the palette for. |
None
|
Source code in ragraph/plot/generic.py
get_continuous_palette
¶
Get a continuous color palette.
Source code in ragraph/plot/generic.py
PieMapStyle
¶
|
Bases: Mapping
Piechart map's plot component style mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
busarea |
Optional[SVG]
|
Bus area SVG mapping. Used for styling the bus area. |
None
|
display |
Optional[str]
|
What to display. One of 'kinds', 'labels', 'weight labels', 'weights'. |
None
|
fields |
Optional[List[str]]
|
The fields to plot (the selection of kinds, labels, or weights). Leave set to |
None
|
gridline |
Optional[Line]
|
Grid line options mapping. |
None
|
highlight_col_annotation |
Optional[str]
|
Annotation that signals what columns should be highlighted. Value should be True-ish. |
None
|
highlight_col_color |
Optional[str]
|
Default color to use for column highlights. |
None
|
highlight_row_annotation |
Optional[str]
|
Annotation that signals what rows should be highlighted. Value should be True-ish. |
None
|
highlight_row_color |
Optional[str]
|
Default color to use for row highlights. |
None
|
inherit |
Optional[bool]
|
Whether to display edges between descendants of the axis nodes. |
None
|
kindline |
Optional[Line]
|
Node kind separation lines options mapping. |
None
|
mode |
Optional[str]
|
How to divide the pie-charts per category: 'equal' or 'relative'. 'equal' divides the piechart evenly. 'relative' divides the piechart according to category value. |
None
|
radius |
Optional[float]
|
The piechart radius between 0.0 and 0.5. |
None
|
scale_weight |
Optional[str]
|
Edge weight label that should contain values between 0.0 and 1.0 to scale the radius with. |
None
|
customhoverkeys |
Optional[List[str]]
|
List of keys for information to be displayed on hover. |
None
|
xaxis |
Optional[Dict[str, Any]]
|
Plotly X-axis settings. |
None
|
yaxis |
Optional[Dict[str, Any]]
|
Plotly Y-axis settings. |
None
|
Note
The display
argument determines what is going to be plotted as piecharts in the plot area.
The fields
argument is a filter on the possible values for that display mode. The mode
argument then tunes how the wedges that make up the piecharts should be distributed. Most of
the time, 'equal' gives the most predictable and clear results.
Source code in ragraph/plot/generic.py
busarea
¶
customhoverkeys
¶
display
¶
fields
¶
The fields to plot (the selection of kinds, labels, or weights). Leave set
to None
to display all the available fields automatically.
gridline
¶
highlight_col_annotation
¶
Annotation that signals what columns should be highlighted. Value should be True-ish.
highlight_col_color
¶
highlight_row_annotation
¶
Annotation that signals what rows should be highlighted. Value should be True-ish.
highlight_row_color
¶
inherit
¶
kindline
¶
mode
¶
How to divide the piecharts per field. Either 'equal' or 'relative'. 'equal' divides the piecharts evenly. 'relative' divides the piechart according to field value.
radius
¶
scale_weight
¶
xaxis
¶
Style
¶
|
Bases: Mapping
RaGraph plot style mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
convention |
Optional[Convention]
|
Convention to use when drawing edges. |
None
|
boxsize |
Optional[int]
|
Size in pixels per row or column. |
None
|
config |
Optional[Dict[str, Any]]
|
Plotly Figure.show() config. |
None
|
highlight_annotation |
Optional[str]
|
Annotation key of instances that should be highlighted.
Value should be True-ish. Set key to |
None
|
highlight_color |
Optional[str]
|
Default color to use for highlights. |
None
|
labels |
Optional[Union[LabelsStyle, Dict[str, Any]]]
|
Labels plot style. |
None
|
layout |
Optional[Union[Layout, Dict[str, Any]]]
|
Layout options. |
None
|
palettes |
Optional[Palettes]
|
Plot palettes options. |
None
|
piemap |
Optional[Union[PieMapStyle, Dict[str, Any]]]
|
Piechart map plot style. |
None
|
tree |
Optional[Union[TreeStyle, Dict[str, Any]]]
|
Tree plot style. |
None
|
legend |
Optional[Union[LegendStyle, Dict[str, Any]]]
|
Legend plot style. |
None
|
show_legend |
Optional[bool]
|
Bool to display legend. |
None
|
chord |
Optional[Union[ChordStyle, Dict[str, Any]]]
|
Chord plot style. |
None
|
row_col_numbers |
Optional[bool]
|
Bool to display row and column numbers. |
None
|
xstep |
Optional[str]
|
Axis increment per row or column in plots (usually 1). |
None
|
ystep |
Optional[str]
|
Axis increment per row or column in plots (usually 1). |
None
|
Source code in ragraph/plot/generic.py
boxsize
¶
chord
¶
|
config
¶
convention
¶
|
highlight_annotation
¶
Annotation key of instances that should be highlighted.
Value should be True-ish. Set key to None
to disable.
highlight_color
¶
labels
¶
|
layout
¶
legend
¶
|
palettes
¶
piemap
¶
|
row_col_numbers
¶
show_legend
¶
tree
¶
xstep
¶
TreeStyle
¶
Bases: Mapping
RaGraph tree plot component style mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
line |
Optional[Union[Line, Dict[str, Any]]]
|
Line style mapping for hierarchy tree lines. |
None
|
xaxis |
Optional[Union[XAxis, Dict[str, Any]]]
|
Plotly X-axis settings. |
None
|
yaxis |
Optional[Union[YAxis, Dict[str, Any]]]
|
Plotly Y-axis settings. |
None
|