Skip to main content

Plotly

Displays a Plotly figure.

Examples

Basic Example

The following example demonstrate some of the available functionality for display_plotly

from abstra.forms import display_plotly
import plotly.graph_objects as go

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

NameDescriptionType
figThe figure to display to the userPlotlyFigure
labelThe label to display to the userstr
end_programWhether the program should end after the widget is shown. Defaults to False.bool
full_widthWhether the input should use full screen width. Defaults to False.bool
button_textWhat text to display on the button when the widget is not part of a Page. Defaults to 'Next'.str