BOKEHPlot#
- class pyopenms_viz._bokeh.BOKEHPlot(data: DataFrame, config: BasePlotConfig = None, **kwargs)#
Bases:
BasePlot,ABCBase class for assembling a Bokeh plot
- _add_bounding_box_drawer()#
Add a BoxEditTool to the figure for drawing bounding boxes.
- Parameters:
fig (figure) – The Bokeh figure object to add the BoxEditTool to.
- Returns:
The renderer object that is used to draw the bounding box.
- _add_bounding_vertical_drawer()#
Add a BoxEditTool to the figure for drawing bounding vertical strips.
- Parameters:
fig (figure) – The Bokeh figure object to add the BoxEditTool to.
- Returns:
The renderer object that is used to draw the bounding box.
- _add_legend(legend)#
Add the legend
- _add_tooltips(tooltips, custom_hover_data, fixed_tooltip_for_trace=True)#
Add tooltips to the plot
- _create_figure()#
Creates a figure from scratch
- property _interactive#
Whether the plot is interactive. Must be overridden by subclasses
- _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.
- _modify_y_range(y_range: Tuple[float, float], padding: Tuple[float, float] | None = None)#
Modifies the y-axis range of the plot.
- Parameters:
y_range (Tuple[float, float]) – The desired y-axis range.
padding (Tuple[float, float] | None, optional) – The padding to be applied to the y-axis range, in decimal percent. Defaults to None.
- _update_plot_aes()#
Update the aesthetics of the plot
- generate(tooltips, custom_hover_data, fixed_tooltip_for_trace=True) figure#
Generate the Bokeh plot with optional interactive tooltips.
- Parameters:
tooltips – A list of (label, field) tuples defining the HoverTool tooltips. Example: [(“X”, “@x”), (“Y”, “@y”)].
custom_hover_data – Not currently used by the Bokeh backend. Accepted for API compatibility with other backends.
fixed_tooltip_for_trace (bool) – Not currently used by the Bokeh backend. Accepted for API compatibility with other backends.
- Returns:
The generated Bokeh figure.
- Return type:
figure