plotly / plotly/plotly.py

uirevision property doesn't keep the viewpoint consistent

Đang mở
#3,951 8 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug P3 sev-3
Ngôn ngữ chính
Python
Star
18.8k
Fork
2.8k
Merge trung bình
16 giờ 26 phút
Pull request đã merge (30 ngày)
21

Mô tả

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)

This is what i'm observing:
unexpected behavior

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?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách chạy bản tái hiện Python Dash tối thiểu trong issue và quan sát biểu đồ phân tán 3D sau khi thay đổi dropdown. Điều tra cách thiết lập layout uirevision ảnh hưởng đến góc nhìn 3D qua các callback; công việc được xem là hoàn tất khi góc nhìn vẫn nhất quán sau callback mà không làm hỏng hành vi của biểu đồ được minh họa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
data-visualization, web-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.