DashDropdownManager#

class ansys.tools.visualization_interface.backends.plotly.widgets.dropdown_manager.DashDropdownManager(fig: plotly.graph_objects.Figure)#

Class to manage dropdown menus in a Plotly figure.

This class allows adding dropdown menus to a Plotly figure for controlling mesh visibility and other properties.

Parameters:
figgo.Figure

The Plotly figure to which dropdowns will be added.

Overview#

add_mesh_name

Add a mesh name to track for dropdown functionality.

get_mesh_names

Get the list of tracked mesh names.

get_visibility_args_for_meshes

Get visibility arguments for showing only specified meshes.

clear

Clear all tracked mesh names.

Import detail#

from ansys.tools.visualization_interface.backends.plotly.widgets.dropdown_manager import DashDropdownManager

Method detail#

DashDropdownManager.add_mesh_name(name: str) None#

Add a mesh name to track for dropdown functionality.

Parameters:
namestr

The name of the mesh to track.

DashDropdownManager.get_mesh_names() List[str]#

Get the list of tracked mesh names.

Returns:
List[str]

List of mesh names.

DashDropdownManager.get_visibility_args_for_meshes(visible_mesh_names: List[str]) Dict[str, Any]#

Get visibility arguments for showing only specified meshes.

Parameters:
visible_mesh_namesList[str]

List of mesh names that should be visible.

Returns:
Dict[str, Any]

Arguments for restyle method to set mesh visibility.

DashDropdownManager.clear() None#

Clear all tracked mesh names.