whatstk.graph.figures package¶
Submodules¶
whatstk.graph.figures.boxplot module¶
Boxplot figures.
Functions:
|
Visualize boxplot. |
- whatstk.graph.figures.boxplot.fig_boxplot_msglen(df: DataFrame, username_to_color: Dict[str, str] | None = None, title: str = '', xlabel: str | None = None) Figure [source]¶
Visualize boxplot.
- Parameters:
df (pandas.DataFrame) – Chat data.
username_to_color (dict, optional) –
title (str, optional) – Title for plot. Defaults to “”.
xlabel (str, optional) – x-axis label title. Defaults to None.
- Returns:
plotly.graph_objs.Figure
whatstk.graph.figures.heatmap module¶
Heatmap plot figures.
Functions:
|
Generate heatmap figure from NxN matrix. |
- whatstk.graph.figures.heatmap.fig_heatmap(df_matrix: DataFrame, title: str = '') Figure [source]¶
Generate heatmap figure from NxN matrix.
- Parameters:
df_matrix (pandas.DataFrame) – Matrix as DataFrame. Index values and column values must be equal.
title (str) – Title of plot. Defaults to “”.
- Returns:
plotly.graph_objs.Figure
whatstk.graph.figures.sankey module¶
Sankey plot figures.
Functions:
|
Generate sankey image. |
- whatstk.graph.figures.sankey.fig_sankey(label: List[str], color: List[str], source: List[str], target: List[str], value: List[int], title: str = '') Figure [source]¶
Generate sankey image.
- Parameters:
label (list) – List with node labels.
color (list) – List with node colors.
source (list) – List with link source id.
target (list) – List with linke target id.
value (list) – List with link value.
title (str, optional) – Title. Defaults to “”.
- Returns:
plotly.graph_objs.Figure
whatstk.graph.figures.scatter module¶
Scatter plot figures.
Functions:
|
Obtain Figure to plot using plotly. |
- whatstk.graph.figures.scatter.fig_scatter_time(user_data: DataFrame, username_to_color: Dict[str, str] | None = None, title: str = '', xlabel: str | None = None) Figure [source]¶
Obtain Figure to plot using plotly.
user_data
must be a pandas.DataFrame with timestamps as index and a column for each user. You can easily generate suitableuser_data
using the functionget_interventions_count
(disclaimer: not compatible withdate_mode='hourweekday'
).- Parameters:
user_data (pandas.DataFrame) – Input data. Shape nrows x ncols, where nrows = number of timestaps and ncols = number of users.
username_to_color (dict, optional) –
title (str, optional) – Title of figure. Defaults to “”.
xlabel (str, optional) – x-axis label title. Defaults to None.
- Returns:
plotly.graph_objs.Figure
See also
whatstk.graph.figures.utils module¶
Utils for library plots.
Functions:
|
Get palette of n_colors color hexadecimal codes. |
Module contents¶
Build Plotly compatible Figures.