Plotly
Displays a Plotly figure.
Examples
Basic Example
The following example demonstrate some of the available functionality for display_plotly
import plotly.graph_objects as go
from abstra.forms import display_plotly
figure = go.Figure(
data=[go.Bar(x=[1, 2, 3], y=[1, 3, 2])],
layout=go.Layout(title=go.layout.Title(text="Bar chart example")),
)
display_plotly(figure)
Parameters
Name | Description | Type |
---|---|---|
fig | The figure to display to the user | "Figure" |
label | The label to display to the user | str |
end_program | Whether the program should end after the widget is shown. Defaults to False. | bool |
full_width | Whether the input should use full screen width. Defaults to False. | bool |
button_text | What text to display on the button when the widget is not part of a Page. Defaults to 'Next'. | str |