yomix.plotting.legend

This module provides tools for creating interactive buttons that allow users to select and manipulate subsets of data in visualizations.

Functions

setup_legend(pb_plot, obs_string, obs_numerical, source_rotmatrix_etc, resize_width_input)

Creates a complex utility designed for a Bokeh plot that allows dynamic creation and manipulation of a legend based on selected attributes (columns) from the plot’s data.

Parameters:
  • pb_plot – This is the main Bokeh plot object to which various interactive components, such as legends, text inputs, and color mappings, will be added.

  • obs_string – A list of strings representing categorical (string) variables in the dataset that will be used for creating color categories or grouping.

  • obs_numerical – A list of strings representing numerical (float or int) variables in the dataset that can be used for color mapping based on continuous values.

  • source_rotmatrix_etc (int) – It appears to be used for managing the width of the legend and updating this value dynamically.

  • resize_width_input – Represents the width of the plot, likely related to resizing behavior.

Returns:

The function returns a tuple containing three Bokeh widgets.

Return type:

tuple