sgio.plot_sg_plotly#
- sgio.plot_sg_plotly(sg: StructureGene, *, mesh_style: str = 'regions', mesh_color: str = 'rgba(30,30,30,0.9)', mesh_width: float = 1.5, show_origin: bool = True, fig: Any | None = None, output_html: str | Path | None = None, title: str = '') Any#
Plot one structure-gene cross-section with Plotly.
This is the single-section Plotly entry point. It returns the native Plotly figure, which callers can continue to customize or write to HTML. Use
plot_sg_2d_plotly()when composing geometry with model overlays in an existing figure is the primary concern.- Parameters:
sg (StructureGene) – Structure gene containing a two-dimensional section mesh.
mesh_style ({'regions', 'boundary', 'wireframe'}, optional) – Mesh rendering style. Default is
'regions'.mesh_color (str, optional) – Plotly color for mesh lines.
mesh_width (float, optional) – Mesh line width in pixels. Default is
1.5.show_origin (bool, optional) – Whether to mark the section origin. Default is
True.fig (plotly.graph_objects.Figure, optional) – Existing figure to draw on.
output_html (str or pathlib.Path, optional) – Optional output HTML file.
title (str, optional) – Figure title when a new figure is created.
- Returns:
Figure containing the section mesh.
- Return type:
plotly.graph_objects.Figure
- Raises:
TypeError – If
sgis not aStructureGene.ValueError – If
sghas no mesh.