PlotlyBackend#

class ansys.tools.visualization_interface.backends.plotly.plotly_interface.PlotlyBackend#

Bases: ansys.tools.visualization_interface.backends._base.BaseBackend

Plotly interface for visualization.

Overview#

plot_iter

Plot multiple objects using Plotly.

plot

Plot a single object using Plotly.

show

Render the Plotly scene.

layout

Get the current layout of the Plotly figure.

Import detail#

from ansys.tools.visualization_interface.backends.plotly.plotly_interface import PlotlyBackend

Property detail#

property PlotlyBackend.layout: Any#

Get the current layout of the Plotly figure.

Returns:
Any

The current layout of the Plotly figure.

Method detail#

PlotlyBackend.plot_iter(plotting_list: Iterable[Any]) None#

Plot multiple objects using Plotly.

Parameters:
plotting_listIterable[Any]

An iterable of objects to plot.

PlotlyBackend.plot(plottable_object: pyvista.PolyData | pyvista.MultiBlock | ansys.tools.visualization_interface.types.mesh_object_plot.MeshObjectPlot | plotly.graph_objects.Mesh3d, name: str = None, **plotting_options) None#

Plot a single object using Plotly.

Parameters:
plottable_objectUnion[PolyData, pv.MultiBlock, MeshObjectPlot, go.Mesh3d]

The object to plot. Can be a PyVista PolyData, MultiBlock, a MeshObjectPlot, or a Plotly Mesh3d.

plotting_optionsdict

Additional plotting options.

namestr, optional

Name of the mesh for labeling in Plotly. Overrides the name from MeshObjectPlot if provided.

PlotlyBackend.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.