BasePlot#
- class pyopenms_viz._core.BasePlot(data: DataFrame, config: BasePlotConfig = None, **kwargs)#
 Bases:
ABCThis class shows functions which must be implemented by all backends
- __init__(data: DataFrame, config: BasePlotConfig = None, **kwargs)#
 
- __repr__()#
 Return repr(self).
- __weakref__#
 list of weak references to the object
- _check_and_aggregate_duplicates()#
 Check if duplicate data is present and aggregate if specified. Properly handles data types and only aggregates relevent columns
- _copy_config_attributes()#
 Copy attributes from config to plot object
- property _interactive: bool#
 Whether the plot is interactive. Must be overridden by subclasses
- abstract property _kind: str#
 The kind of plot to assemble. Must be overridden by subclasses.
- abstract _modify_x_range(x_range: Tuple[float, float], padding: Tuple[float, float] | None = None)#
 Modify the x-axis range.
- Parameters:
 x_range (Tuple[float, float]) – The desired x-axis range.
padding (Tuple[float, float] | None, optional) – The padding to be applied to the x-axis range, in decimal percent. Defaults to None.
- abstract _modify_y_range(y_range: Tuple[float, float], padding: Tuple[float, float] | None = None)#
 Modify the y-axis range.
- Parameters:
 y_range (Tuple[float, float]) – The desired y-axis range.
padding (Tuple[float, float] | None, optional) – The padding to be applied to the x-axis range, in decimal percent. Defaults to None.
- _update_from_config(config) None#
 Updates the plot configuration based on the provided config object.
- Parameters:
 config (Config) – The configuration object containing the plot settings.
- Returns:
 None
- _verify_column(colname: str | int, name: str) str#
 fetch data from column name
- Parameters:
 colname (str | int) – column name of data to fetch or the index of the column to fetch
name (str) – name of the column e.g. x, y, z for error message
- Returns:
 pandas series or None
- Return type:
 pd.Series
- Raises:
 ValueError – if colname is None
KeyError – if colname is not in data
ValueError – if colname is not numeric
- property current_color: str#
 Get the current color for the plot.
- Returns:
 The current color.
- Return type:
 str
- property current_type: str#
 Get the current type for the plot.
- Returns:
 The current type.
- Return type:
 str
- abstract generate(tooltips, custom_hover_data)#
 Generate the plot
- property known_columns: List[str]#
 List of known columns in the data, if there are duplicates outside of these columns they will be grouped in aggregation if specified
- load_config(**kwargs)#
 Load the configuration settings for the plot.
- abstract plot() None#
 Create the plot
- update_config() None#
 Update the _config object based on the provided kwargs. This means that the _config will store an accurate representation of the parameters