uirevision property doesn't keep the viewpoint consistent
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
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?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先运行 issue 中的最小 Python Dash 复现代码,并观察更改下拉菜单后的 3D 散点图。调查布局设置 uirevision 如何影响各次 callback 之间的 3D 视角;完成的标准是 callback 后视角保持一致,同时不破坏所演示的绘图行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- data-visualization, web-dev
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100
