sda.dashboard.utils.figure_utils#
Plotly Figure Utilities.
Helper functions for creating and manipulating Plotly figures.
Functions#
|
Get Plotly theme template from configuration. |
|
Apply theme to a Plotly figure. |
Module Contents#
- sda.dashboard.utils.figure_utils.get_plotly_theme_template(theme_mode='light')#
Get Plotly theme template from configuration.
- Parameters:
theme_mode (
str, default"light") – The theme mode to use (e.g. “light”, “dark”).- Returns:
A mapping suitable for
plotly.graph_objects.Figure.update_layout().- Return type:
See also
apply_theme_to_figure()Apply the theme to an existing
plotly.graph_objects.Figure.
- sda.dashboard.utils.figure_utils.apply_theme_to_figure(fig, theme='light')#
Apply theme to a Plotly figure.
- Parameters:
fig (
plotly.graph_objects.Figure) – Aplotly.graph_objects.Figureinstance to update.theme (
str, default"light") – Theme key to apply.
- Returns:
The same figure instance, updated in-place.
- Return type:
plotly.graph_objects.Figure
See also
get_plotly_theme_template()Retrieve the theme layout mapping.