Animation deletes traces
Chưa có ai nhận issue này.
- 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ả
Below is a minimal example, where using a slider to show different traces will delete another trace.
The example plots a grid of points and uses a slider to interactively display selected rows, however, the original grid plot disappears as soon as the slider is moved.
This looks like a bug to me. If it’s not, how can I prevent that trace from disappearing?
import numpy as np
import plotly.graph_objects as go
# generate grid
N = 10
x, y = np.meshgrid(np.linspace(0, 1, N), np.linspace(0, 1, N))
z = np.zeros((N, N))
# plot
fig = go.Figure(
# all points (THIS DISAPPEARS!)
data=[go.Scatter3d(x=x.flatten(), y=y.flatten(), z=z.flatten())],
# single rows animated via slider
frames=[go.Frame(data=[go.Scatter3d(x=x[i], y=y[i], z=z[i])], name=f"{i}") for i in range(N)],
layout_sliders=[dict(steps=[dict(method='animate', args=[[f"{k}"]], label=f"{k}") for k in range(N)])])
fig.write_html('plot.html')
fig.show()
Two other weird things (potential bugs), which might be unrelated:
- Setting a marker size on the first trace also changes the marker size of the animated traces. Should that be the case?!
- The interactively opened plot behaves differently from opening the saved html plot (the second one starts playing the animation right away, the first one doesn’t).
I have also posted this in the community forum but without any reactions so far.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- 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 ví dụ Python tối thiểu và so sánh kết quả tương tác của fig.show() với plot.html đã lưu. Điều tra các frame của animation và hành vi của slider, bao gồm grid trace bị biến mất, kích thước marker dùng chung và hành vi autoplay khác nhau; công việc được xem là hoàn tất khi các hành vi quan sát được đã được giải thích và bug đã được xác nhận được sửa mà không làm hỏng các trace khác.
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
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 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
- 45/100