vuecore.engines.plotly.plot_builder module

Contents

vuecore.engines.plotly.plot_builder module#

vuecore.engines.plotly.plot_builder.build_plot(data: DataFrame, config: Any, px_function: Callable, theming_function: Callable, theming_params: List[str], preprocess: Callable | None = None) Figure[source]#

Base function to build Plotly figures with common patterns.

The function follows these steps: 1. Get all parameters from the config model 2. Create the dictionary of arguments for the plot function 3. Apply preprocessing 4. Create the base figure 5. Apply theme and additional styling

Parameters:
  • data (pd.DataFrame) – The DataFrame containing the plot data.

  • config (Any) – The Pydantic model with all plot configurations.

  • px_function (Callable) – The Plotly Express function to use (e.g., px.bar, px.scatter, etc).

  • theming_function (Callable) – The theming function to apply to the figure.

  • theming_params (List[str]) – List of parameter names handled by the theming function.

  • preprocess (Callable, Optional) – Optional preprocessing function for special features.

Returns:

A styled Plotly figure object.

Return type:

go.Figure