ragraph.plot
¶
RaGraph plotting module¶
Style
¶
Style(
convention: Optional[Convention] = None,
boxsize: Optional[int] = None,
config: Optional[Dict[str, Any]] = None,
highlight_annotation: Optional[str] = None,
highlight_color: Optional[str] = None,
labels: Optional[
Union[LabelsStyle, Dict[str, Any]]
] = None,
layout: Optional[Union[Layout, Dict[str, Any]]] = None,
palettes: Optional[Palettes] = None,
piemap: Optional[
Union[PieMapStyle, Dict[str, Any]]
] = None,
tree: Optional[Union[TreeStyle, Dict[str, Any]]] = None,
legend: Optional[
Union[LegendStyle, Dict[str, Any]]
] = None,
show_legend: Optional[bool] = None,
chord: Optional[
Union[ChordStyle, Dict[str, Any]]
] = None,
row_col_numbers: Optional[bool] = None,
xstep: Optional[str] = None,
ystep: Optional[str] = None,
)
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
¶
chord() -> ChordStyle
config
¶
convention
¶
convention() -> 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
¶
labels() -> LabelsStyle
legend
¶
legend() -> LegendStyle
piemap
¶
piemap() -> PieMapStyle
row_col_numbers
¶
show_legend
¶
xstep
¶
delta_dsm
¶
dmm
¶
dmm(
rows: List[Node],
cols: List[Node],
edges: List[Edge],
style: Style = Style(),
sort: bool = True,
row_node_kinds: Optional[List[str]] = None,
row_sort_args: Dict[str, Any] = dict(),
col_node_kinds: Optional[List[str]] = None,
col_sort_args: Dict[str, Any] = dict(),
show: bool = False,
) -> Figure
Get a domain-mapping-matrix (DMM) plot of a Graph object.
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. |
required |
style
|
Style
|
Plot style option mapping. |
Style()
|
sort
|
bool
|
Boolean to indicate whether the rows and cols should be sorted following the hierarchical structure. |
True
|
row_node_kinds
|
Optional[List[str]]
|
The node kinds displayed on the rows. |
None
|
col_node_kinds
|
Optional[List[str]]
|
The node kinds displayed on the columns. |
None
|
show
|
bool
|
Boolean to display the figure. |
False
|
Returns:
Type | Description |
---|---|
Figure
|
Domain-mapping matrix figure. |
Source code in ragraph/plot/__init__.py
dsm
¶
dsm(
leafs: List[Node],
edges: List[Edge],
style: Style = Style(),
sort: bool = True,
sort_args: Dict[str, Any] = dict(),
node_kind: Optional[str] = None,
show: bool = False,
) -> Figure
Get a DSM plot of a Graph object.
Arguments leafs: The nodes to be placed on the rows and columns of the matrix.. edges: Edges to be displayed between leaf nodes. style: Plot style option mapping. sort: Boolean to indicate whether the rows and cols should be sorted following the hierarchical structure. node_kind: The node kind to be displayed. show: Boolean to display the figure.
Source code in ragraph/plot/__init__.py
mdm
¶
mdm(
leafs: List[Node],
edges: List[Edge],
style: Style = Style(),
sort: bool = True,
sort_args: Dict[str, Any] = dict(),
node_kinds: Optional[List[str]] = None,
show: bool = False,
) -> Figure
Get a Multi-Domain Matrix (MDM) plot of a Graph object.
Arguments leafs: The nodes to be placed on the rows and columns of the matrix.. edges: Edges to be displayed between leaf nodes. style: Plot style option mapping. sort: Boolean to indicate whether the rows and cols should be sorted following the hierarchical structure. node_kinds: The node kinds displayed within the matrix. show: Boolean to display the figure.