BoxPlotExplorer
Explorer that produces an interactive box plot for one or two numeric columns.
A box plot summarises a numeric distribution through five key statistics: the lower quartile (Q1), median (Q2), upper quartile (Q3), and the lower and upper whiskers that extend to the most extreme non-outlier values. Points lying beyond the whiskers are drawn individually as outliers.
When a single column is selected the explorer renders one box for the whole column. When two columns are provided the second column is treated as a grouping variable, producing one box per distinct category, which makes it easy to compare how the distribution of the numeric column varies across groups.
Use this explorer to quickly spot skewness, spread, and outliers in numeric data, or to compare distributions across categorical groups (e.g. comparing a target variable across different classes).
Parameters
- horizontal : boolean, default=
False - If True, the box plot will be horizontal; otherwise vertical.
- points : string, default=
outliers - One of 'all', 'outliers', or 'False'. Determines which points are shown.
Methods
get_results(self, exploration_path: str, options: Dict[str, Any]) -> Dict[str, Any]
BoxPlotExplorerLoad and return the saved box plot for the frontend.
Parameters
- exploration_path : str
- Path to the JSON file saved by
save_notebook. - options : Dict[str, Any]
- Rendering options from the frontend (unused).
Returns
- Dict[str, Any]
- Dictionary with keys
"data"(JSON-serialized Plotly figure),"type"("plotly_json"), and"config"(empty dict).
launch_exploration(self, dataset: 'DashAIDataset', explorer_info: DashAI.back.dependencies.database.models.Explorer)
BoxPlotExplorerGenerate a Plotly box plot for one or two selected numeric columns.
Parameters
- dataset : DashAIDataset
- Dataset containing the selected numeric columns.
- explorer_info : Explorer
- Explorer record with column names and optional display name.
Returns
- plotly.graph_objects.Figure
- An interactive box plot figure.
save_notebook(self, notebook_info: DashAI.back.dependencies.database.models.Notebook, explorer_info: DashAI.back.dependencies.database.models.Explorer, save_path: 'Path', result: Any) -> str
BoxPlotExplorerSave the box plot figure to a JSON file on disk.
Parameters
- notebook_info : Notebook
- The notebook database record (unused).
- explorer_info : Explorer
- The explorer record used for filename generation.
- save_path : Path
- Directory where the file will be saved.
- result : Any
- The Plotly figure returned by
launch_exploration.
Returns
- str
- The path of the saved JSON file as a POSIX string.
get_metadata(cls) -> Dict[str, Any]
BaseExplorerGet metadata for the explorer, used by the DashAI frontend.
Returns
- Dict[str, Any]
- Dictionary containing display name, description, image preview path, category, icon, color, allowed dtypes, restricted dtypes, and input cardinality constraints.
get_schema(cls) -> dict
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
prepare_dataset(self, loaded_dataset: 'DashAIDataset', columns: List[Dict[str, Any]]) -> 'DashAIDataset'
BaseExplorerPrepare the dataset by selecting only the columns needed for this exploration.
Parameters
- loaded_dataset : DashAIDataset
- The full dataset loaded from storage.
- columns : List[Dict[str, Any]]
- List of column descriptor dicts, each containing at least
"columnName". Optional keys:"id","valueType","dataType".
Returns
- DashAIDataset
- Dataset restricted to the requested columns.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.
Parameters
- raw_data : dict
- A dictionary with the data provided by the user to initialize the model.
Returns
- dict
- A validated dictionary with the necessary objects.
validate_columns(cls, explorer_info: DashAI.back.dependencies.database.models.Explorer, column_spec: Dict[str, Dict[str, str]]) -> bool
BaseExplorerValidate that the selected columns satisfy the explorer's constraints.
Parameters
- explorer_info : Explorer
- The database record for the explorer instance, including the selected columns.
- column_spec : Dict[str, Dict[str, str]]
- A mapping from column name to a dict with at least a
"type"key describing the column's data type.
Returns
- bool
- True if all column constraints are satisfied, False otherwise.
validate_parameters(cls, params: Dict[str, Any]) -> bool
BaseExplorerValidate explorer parameters against the explorer's schema.
Parameters
- params : Dict[str, Any]
- The configuration parameters to validate.
Returns
- BaseExplorerSchema
- The validated and parsed schema instance. Subclasses that override this method may return a bool to indicate pass/fail without returning the model instance.