Help: How to use plotly's config #1244
-
QuestionHow to configure config in ui. plotly? The following code is a demo of configuring config in plotly。 import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(
go.Scatter(
x=[1, 2, 3],
y=[1, 3, 1]))
config={
'modeBarButtonsToRemove': ['zoom', 'pan']
}
fig.show(config=config) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @txhy2018, There's currently no official way to set config options for fig = go.Figure()
fig.add_trace(go.Scatter(x=[1, 2, 3], y=[1, 3, 1]))
plot = ui.plotly(fig)
plot._props['options']['config'] = {'modeBarButtonsToRemove': ['zoom', 'pan']} |
Beta Was this translation helpful? Give feedback.
-
Hi @falkoschindler , Thanks for the amazing NiceGUI package. I really like it and have started transitioning many of my apps to it. I wanted to check on this workaround for setting config options for elements["plot"] = ui.plotly(elements["fig"]).classes("w-full")
elements["plot"]._props["options"]["config"] = {"modeBarButtonsToRemove": ["zoomIn", "zoomOut", "select", "lasso"]} |
Beta Was this translation helpful? Give feedback.
-
I want to enable |
Beta Was this translation helpful? Give feedback.
Hi @txhy2018,
There's currently no official way to set config options for
ui.plotly
, but a workaround: