plotly / plotly/plotly.js

Using opacityscale with surface results in ordering by addition order, not depth

Đang mở
#4,918 13 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ả

Hi all, been using plotly with R for a while now and really loving it - thanks for assembling such a phenomenal program! I'd like to report a bug found while plotting multiple surface objects, which causes them to layer in the order they're added rather than the "depth" at which they should really render in the figure. See this codepen for code and examples, which are also rendered below as screenshots.

I previously posted in ropensci/plotly, but have since learned enough Javascript to assemble the codepen and the issue persists, making me think it's not an R problem. There's also no discussion of the new "opacityscale" feature there and a lively discussion here, making me hopeful that more people will have some idea how I might fix this if it isn't a bug.

This is great:

image

This is less great (same figure rotated to look from below):

image

It seems that the surface that renders always on "top" is the one that's added last in the data array. If we alter the above code a little bit to render the top layer surface before the middle one, we get some more interesting results:

Plotly.newPlot('graphDivReorderOpac', [data_z1, data_z3, data_z2]); rather than Plotly.newPlot('graphDivReorderOpac', [data_z1, data_z2, data_z3]);

image

image

Apologies for the repetitive code in the codepen - I really did learn just enough JS to make this one and will be hiding behind R wrappers in the future.

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 với CodePen được liên kết và các ví dụ về bề mặt opacityscale, so sánh hai thứ tự trace và kết quả render khi nhìn từ trên xuống và từ dưới lên. Truy vết đường dẫn render bề mặt chịu trách nhiệm cho thứ tự theo độ sâu; hoàn thành khi các bề mặt chồng lấn được render theo độ sâu thay vì theo thứ tự của mảng dữ liệu, đồng thời giữ nguyên ví dụ không có opacityscale đang hoạt động.

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