[BUG]: `layout.uirevision` doesn't play well with map subplot auto-fit
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 18.3k
- Fork
- 2k
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 28
Mô tả
Description
When a map subplot uses fitbounds, layout.uirevision fails to preserve the user's subsequent pan/zoom across Plotly.react calls. The map snaps back to the auto-fit view even when the uirevision value is unchanged.
Screenshots/Video
https://github.com/user-attachments/assets/48f4da34-d74f-4958-a874-2bd9a3844181
Steps to reproduce
- Be on v4.0 (or the default branch after it gets released)
- Plot a
scattermapwithuirevisionset and no explicitcenter/zoom:Plotly.newPlot(gd, [{ type: 'scattermap', lon: [-75, -74, -73], lat: [40, 41, 42], mode: 'markers' }], { uirevision: 'v1', width: 400, height: 400 }); - Pan the map with the mouse
- Call
Plotly.reactwith the sameuirevision:Plotly.react(gd, gd.data, { uirevision: 'v1', width: 400, height: 400 }); - Note that the map snaps back to the auto-fit view instead of keeping the panned view
Notes
- Discovered while working on #7884. The auto-fit and zoom-button behaviors landed there; this uirevision integration was deferred as out-of-scope.
- This works correctly for cartesian axes (via
autorange) and for map subplots when the user has supplied an explicitcenter/zoomfrom the start. It only fails on the auto-fit path.
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 tái hiện trường hợp scattermap với layout.uirevision không thay đổi, sau đó lần theo đường dẫn tự động điều chỉnh của subplot bản đồ trong Plotly.react. So sánh với hành vi center/zoom rõ ràng hiện có và hành vi autorange của biểu đồ Cartesian. Được xem là hoàn tất khi thao tác pan hoặc zoom của người dùng được giữ nguyên qua các lần gọi Plotly.react khi uirevision không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript
- 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
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 68/100