plotly / plotly/plotly.js

Plots are initially displayed with a wrong margin in Chrome

Đang mở
#5,312 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 P3
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ả

I'm working on a web-app that should run in desktop and mobile. I've tested the app in Firefox and Chrome and noticed that the width (or right margin) of the plot is wrongly initialized.

The problem: The plot is too big when the page is initially loaded. After resizing the browser (responsive layout), the plot is updated and suddenly fits the screen properly.
I've added a restyle call to my script and that improves things a bit, but not completely.

  <div id="progress-plot"></div>
  <script>
    var graph = {{progress_plot | safe}};
    var config = {responsive: true, displayModeBar: false, showTips: true}
    Plotly.newPlot('progress-plot', graph.data, graph.layout, config);
    Plotly.restyle('progress-plot', graph.layout);
  </script>

The app is a Flask app (the snippet is from a jinja2 page) and I'm using Bootstrap for the front-end.

I've attached a file with the contents of graph.
graph.txt

Here are some screenshots:
image
After slightly resizing the page:
image

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 đoạn mã Plotly.newPlot được cung cấp trong Chrome, sử dụng graph.txt đính kèm và bố cục Bootstrap responsive. Kiểm tra đường đi của quá trình xác định kích thước ban đầu trước và sau khi trình duyệt được thay đổi kích thước; hoàn tất khi biểu đồ có chiều rộng và lề phải chính xác ngay ở lần render đầu tiên mà không cần resize hoặc restyle.

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

Đánh giá

Công nghệ
bootstrap, flask, javascript
Lĩnh vực
data-visualization, frontend
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
42/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.