uirevision property doesn't keep the viewpoint consistent
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 18.8k
- Fork
- 2.8k
- Merge medio
- 16h 26m
- PR unite (30g)
- 21
Descrizione
The following is the copy-paste of a question I opened on stackoverflow, it looks like to be a bug, so here i go:
I'm trying to keep the viewpoint consistent in my plotly-dash web app after every callback. This should be straightforward according to many already answered questions. The following line of code should do the magic:
fig.update_layout(uirevision='constant')
Unfortunately for me, it looks like that this is not the case for 3D scatter plots, here is a very brief piece of code that should allow to reproduce my problem:
import plotly.express as px
df = px.data.iris()
import dash
from dash import dcc
from dash import html
from dash import Input, Output
app = dash.Dash()
app.layout = html.Div([
dcc.Dropdown(['option1', 'option2', 'option3'], 'axis', id='x-dropdown', clearable=False),
dcc.Graph(id='main-plot')
])
@app.callback(
Output('main-plot', 'figure'),
Input('x-dropdown', 'value'))
def update_figure(x_selector):
fig = px.scatter_3d(df, x='sepal_length', y='sepal_width', z='petal_width', color='species')
fig.update_layout(uirevision='constant')
return fig
app.run_server(debug=True, use_reloader=False)
I can tell that the uirevision is doing something since the viewpoint is not completely reset after the callback, but it is still very imprecise. Is there something I'm missing or is this the expected behavior?
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia eseguendo la riproduzione minima in Python Dash presente nell’issue e osserva il grafico a dispersione 3D dopo aver modificato il menu a discesa. Analizza in che modo l’impostazione di layout uirevision influisce sul punto di vista 3D tra i callback; il lavoro è completo quando il punto di vista rimane coerente dopo il callback senza interrompere il comportamento del grafico mostrato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- data-visualization, web-dev
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100
