isaricanalytics.visualisation¶
- isaricanalytics.visualisation.fig_bar_chart(data: DataFrame, title: str = 'Bar Chart', xlabel: str = '', ylabel: str = '', index_column: str = 'index', barmode: str = 'stack', xaxis_tickformat: str = '%m-%Y', base_color_map: dict[str, str] | None = None, height: int = 340) Figure[source]¶
plotly.graph_objs.Figure: Returns a bar chart.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Bar Chart”
Figure title.
- xlabelstr, default=””
Figure x-axis label.
- ylabelstr, default=””
Figure y-axis label.
- index_columnstr, default=”index”
Index column.
- barmodestr, default=”stack”
How bars with the same location coordinate are displayed: possible values are “stack”, “relative”, “group”, “overlay”`. For reference see the Plotly documentation.
- xaxis_tickformatstr, default=”%m-%Y”
x-axis tick format.
- base_color_mapdict, default=None
Map of bar values and colours.
- heightint, default=340
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_bar_line_chart(data: DataFrame, title: str = 'Combined bar line chart', xlabel: str = '', ylabel_left: str = '', ylabel_right: str = '', bar_column: str = '', line_column: str = '', index_column: str = 'index', lower_column: str | None = None, upper_column: str | None = None, bar_color: str | None = None, line_color: str | None = None, height: int = 500) Figure[source]¶
plotly.graph_objs.Figure: Returns a bar-line chart.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Combined bar line chart”
Figure title.
- xlabelstr, default=””
Figure x-axis label.
- ylabelstr, default=””
Figure y-axis label.
- bar_columnstr, default=””
Bar column.
- line_columnstr, default=””
Line column.
- index_columnstr, default=”index”
Index column.
- lower_columnstr, default=None
Lower column.
- upper_columnstr, default=None
Upper column.
- bar_colorstr, default=None
Bar colour.
- line_colorstr, default=None
Line colour.
- heightint, default=500
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_count_chart(data: DataFrame, title: str = 'Count Chart', xlabel: str = 'Count', ylabel: str = 'Variable', base_color_map: dict[str, str] | None = None, height: int = 350) Figure[source]¶
plotly.graph_objs.Figure: Returns a count chart.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Count Chart”
Figure title.
- xlabelstr, default=”Count”
Figure x-axis label.
- ylabelstr, default=”Variable”
Figure y-axis label.
- base_color_mapdict, default=None
Map of bar values and colours.
- heightint, default=350
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_dual_stack_pyramid(data: DataFrame, title: str = 'Dual-Sided Stacked Pyramid Chart', xlabel: str = 'Count', ylabel: str = 'Category', base_color_map: dict[str, str] | None = None, height: int = 430) Figure[source]¶
plotly.graph_objs.Figure: Returns a dual-sided stacked pyramid chart.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Dual-Sided Stacked Pyramid Chart”
Figure title.
- xlabelstr, default=”Count”
Figure x-axis label.
- ylabelstr, default=”Category”
Figure y-axis label.
- base_color_mapdict, default=None
Map of bar values and colours.
- heightint, default=430
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_flowchart(data: DataFrame, height: int = 430) Figure[source]¶
plotly.graph_objs.Figure: Returns a flowchart.- Parameters:
- datapandas.DataFrame
Incoming data.
- heightint, default=430
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_forest_plot(data: DataFrame, title: str = 'Forest Plot', xlabel: str = 'Odds Ratio (95% CI)', ylabel: str = '', reorder: bool = True, labels: Iterable[str] = ['Variable', 'OddsRatio', 'LowerCI', 'UpperCI'], marker: dict[str, Any] | None = None, noeffect_line: bool = True, height: int = 600) Figure[source]¶
plotly.graph_objs.Figure: Returns a forest plot.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Forest Plot”
Figure title.
- xlabelstr, default=”Odds Ratio (95% CI)”
Figure x-axis label.
- ylabelstr, default=””
Figure y-axis label.
- reorderbool, default=True
Sort values.
- labelstyping.Iterable, default=[“Variable”, “OddsRatio”, “LowerCI”, “UpperCI”]
Column of labels.
- markerdict, default=None
Marker properties dict.
- no_effect_linebool, default=True
Add no effect line.
- heightint, default=600
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_frequency_chart(data: DataFrame, title: str = 'Frequency Chart', xlabel: str = 'Proportion', ylabel: str = 'Variable', base_color_map: dict[str, str] | None = None, height: int = 350) Figure[source]¶
plotly.graph_objs.Figure: Returns a frequency chart.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Frequency Chart”
Figure title.
- xlabelstr, default=”Proportion”
Figure x-axis label.
- ylabelstr, default=”Variable”
Figure y-axis label.
- base_color_mapdict
Map of bar values and colours.
- heightint, default=350
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_heatmaps(data: DataFrame, title: str = '', subplot_titles: list[str] | None = None, ylabel: str = '', xlabel: str = '', colorbar_label: str = '', index_column: str = 'index', zmin: float | None = None, zmax: float | None = None, include_annotations: bool = False, base_color_map: dict[str, str] | None = None, height: int = 750) Figure[source]¶
plotly.graph_objs.Figure: Returns a heatmaps chart.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=””
Figure title.
- subplot_titleslist, default=None
Subplot titles.
- xlabelstr, default=””
Figure x-axis label.
- ylabelstr, default=””
Figure y-axis label.
- colorbar_labelstr, default=””
Colour bar label.
- index_columnstr, default=”index”
Index column.
- zminfloat, default=None
zmin.
- zmaxfloat, default=None
zmax.
- include_annotationsbool, default=False
Include annotations.
- base_color_mapdict, default=None
Colour map.
- heightint, default=750
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_kaplan_meier(data: tuple[DataFrame], title: str = 'Kaplan-Meier Plot', xlabel: str = 'Time (days)', ylabel: str = 'Survival Probability', groups: Iterable[str] | None = None, index_column: str = 'index', base_color_map: dict[str, str] | None = None, xlim: Iterable[float | int] | None = None, p_value: float | None = None, height: int = 480) Figure[source]¶
plotly.graph_objs.Figure: Returns a Kaplan-Meier plot.- Parameters:
- datatuple
Incoming data as two Pandas dataframes, the first for the plot, and the second for the risk table.
- titlestr, default=”Kaplan-Meier Plot”
Figure title.
- xlabelstr, default=”Time (days)”
Figure x-axis label.
- ylabelstr, default=”Survival Probability”
Figure y-axis label.
- groupstyping.Iterable, default=None
Groups.
- index_columnstr, default=”index”
Index column.
- base_color_mapdict, default=None
Colour map.
- xlimtyping.Iterable, default=None
xlim.
- p_valuefloat, default=None
p-value.
- heightint, default=480
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_line_chart(data: DataFrame, title: str = 'Line chart', xlabel: str = '', ylabel: str = '', height: int = 480, line_column: str = '', index_column: str = 'index', lower_column: str | None = None, upper_column: str | None = None, line_color: str | None = None) Figure[source]¶
plotly.graph_objs.Figure: Returns a line chart.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Line chart”
Figure title.
- xlabelstr, default=””
Figure x-axis label.
- ylabelstr, default=””
Figure y-axis label.
- heightint, default=480
Figure height.
- line_columnstr, default=””
Line column.
- index_columnstr, default=”index”
Index column.
- lower_columnstr, default=None
Lower column.
- upper_columnstr, default=None
Upper column.
- line_colorstr, default=None
Line colour.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_pie(data: DataFrame, title: str = 'Pie chart', xlabel: str = '', ylabel: str = '', base_color_map: dict[str, str] | None = None, names: str | int | Series | Iterable = '', values: str | int | Series | Iterable = '', height: int = 450)[source]¶
plotly.graph_objs.Figure: Returns a pie chart figure.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Placeholder scatter plot”
Figure title.
- xlabelstr, default=””
Figure x-axis label.
- ylabelstr, default=””
Figure y-axis label.
- base_color_mapdict
Map of sector values and colours.
- namesstr, int, pd.Series, typing.Iterable, default=””
Sector name(s)/label(s).
- valuesstr, int, pd.Series, typing.Iterable, default=””
Sector values.
- heightint, default=450
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_placeholder(data: DataFrame, title: str = 'Placeholder scatter plot', xlabel: str = '', ylabel: str = '', height: int = 450) Figure[source]¶
plotly.graph_objs.Figure: Returns a placeholder scatter plot.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Placeholder scatter plot”
Figure title.
- xlabelstr, default=””
Figure x-axis label.
- ylabelstr, default=””
Figure y-axis label.
- heightint, default=450
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_sankey(data: DataFrame, height: int = 500) Figure[source]¶
plotly.graph_objs.Figure: Returns a Sankey plot.- Parameters:
- datapandas.DataFrame
Incoming data.
- heightint, default=500
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_sunburst(data: DataFrame, title: str = 'Sunburst Chart', path: list[str | int] | Series | Iterable | None = ['level0', 'level1'], values: str | int | Series | Iterable = 'values', base_color_map: dict[str, str] | None = None, height: int = 430) Figure[source]¶
plotly.graph_objs.Figure: Returns a sunburst plot.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Sunburst Chart”
Figure title.
- pathstr, int, pd.Series, typing.Iterable, None, default=[“level0”, “level1”]
Column names defining a hierarhy of sectors, from root to leaves.
- valuesstr, int, pd.Series, typing.Iterable, default=”values”
A column name in the data defining sector values, or a Pandas Series or an iterable containing sector values.
- base_color_mapdict, default=None
Map of sector values/marks and colours.
- heightint, default=430
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_table(data: DataFrame, table_key: str = '', columnwidth: Iterable[float | int] | None = None, height: int = 500) Figure[source]¶
plotly.graph_objs.Figure: Returns a table figure.- Parameters:
- datapandas.DataFrame
Incoming data.
- table_keystr, default=””
Table key.
- columnwidthtyping.Iterable, default=None
An iterable of column widths.
- heightint, default=500
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_text(data: DataFrame, height: int = 430) Figure[source]¶
plotly.graph_objs.Figure: Returns a figure with an annotation.- Parameters:
- datapandas.DataFrame
Incoming data.
- heightint, default=430
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_timelines(data: DataFrame, title: str = 'Timeline', label_col: str = '', group_col: str = '', start_date: str = 'start_date', end_date: str = 'end_date', size_col: str | None = None, min_width: int = 2, max_width: int = 10, height: int = 500) Figure[source]¶
plotly.graph_objs.Figure: Returns a timeline figure.- Parameters:
- datapandas.DataFrame
Incoming data.
- titlestr, default=”Timeline”
Figure title.
- label_colstr, default=””
Label column.
- group_colstr, default=””
Group column.
- start_datestr, default=”start_date”
Start date column.
- end_datestr, default=”end_date”
End date column.
- size_colstr, None, default=None
Size column.
- min_widthint, default=2
Figure minimum width.
- max_widthint, default=10
Figure maximum width.
- heightint, default=500
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.fig_upset(data: tuple[DataFrame], title: str = 'Upset Plot', height: int = 480) Figure[source]¶
plotly.graph_objs.Figure: Returns an upset plot.- Parameters:
- datatuple
Incoming data as two Pandas dataframes, the first for counts, and the second for intersections.
- titlestr, default=”Upset Plot”
Figure title.
- heightint, default=480
Figure height.
- Returns:
- plotly.graph_objs.Figure
The Plotly figure.
- isaricanalytics.visualisation.hex_to_rgb(hex_color: str) tuple[int][source]¶
tuple: Converts a hex colour to an RGB colour tuple.- Parameters:
- hex_colorstr
Hex colour string.
- Returns:
- tuple
RGB colour tuple.
- isaricanalytics.visualisation.hex_to_rgba(hex_color: str, opacity: float) str[source]¶
str: Converts a hex colour to an RGBA (red-green-blue-alpha) colour string.- Parameters:
- hex_colorstr
Hex colour string.
- opacityfloat
Opacity/transparency, a value between 0.0 (fully transparent) and 1.0 (fully opaque).
- Returns:
- str
An RGBA colour string (RGB + opacity/transparency).
- isaricanalytics.visualisation.rgb_to_rgba(rgb_color: tuple[int], alpha: float) str[source]¶
str: Converts an RGB colour tuple and alpha value to an RGBA colour string.- Parameters:
- rgb_colortuple
RGB color tuple.
- alphafloat
Opacity/transparency value between 0.0 (fully transparent) and 1.0 (fully opaque).
- Returns:
- str
RGBA colour string.