PlotlyDashBackend#

class ansys.tools.visualization_interface.backends.plotly.plotly_dash.PlotlyDashBackend(app: dash.Dash = None)#

Bases: ansys.tools.visualization_interface.backends.plotly.plotly_interface.PlotlyBackend

Plotly Dash interface for visualization.

Overview#

plot

Plot a single object using Plotly and track mesh names for dropdown.

create_dash_layout

Create the Dash layout with optional dropdown for mesh visibility.

show

Render the Plotly scene.

dropdown_manager

Get the dropdown manager for this backend.

Import detail#

from ansys.tools.visualization_interface.backends.plotly.plotly_dash import PlotlyDashBackend

Property detail#

property PlotlyDashBackend.dropdown_manager: ansys.tools.visualization_interface.backends.plotly.widgets.dropdown_manager.DashDropdownManager#

Get the dropdown manager for this backend.

Returns:
DashDropdownManager

The dropdown manager instance.

Method detail#

PlotlyDashBackend.plot(plottable_object, name: str = None, **plotting_options) None#

Plot a single object using Plotly and track mesh names for dropdown.

Parameters:
plottable_objectAny

The object to plot.

namestr, optional

Name of the mesh for labeling in Plotly.

plotting_optionsdict

Additional plotting options.

PlotlyDashBackend.create_dash_layout() dash.html.Div#

Create the Dash layout with optional dropdown for mesh visibility.

Returns:
html.Div

The Dash layout component.

PlotlyDashBackend.show(plottable_object=None, screenshot: str = None, name_filter=None, **kwargs) plotly.graph_objects.Figure | None#

Render the Plotly scene.

Parameters:
plottable_objectAny, optional

Object to show, by default None.

screenshotstr, optional

Path to save a screenshot, by default None.

name_filterbool, optional

Flag to filter the object, by default None.

kwargsdict

Additional options the selected backend accepts.

Returns:
Union[go.Figure, None]

The figure of the plot if in doc building environment. Else, None.