plotly / plotly/plotly.js

[BUG]: `layout.uirevision` doesn't play well with map subplot auto-fit

Đang mở
#7,907 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

bug good for agent P2 plotly-internal size: 3
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 scattermap with uirevision set and no explicit center/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.react with the same uirevision:
    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 explicit center/zoom from the start. It only fails on the auto-fit path.

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 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

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.