plotly / plotly/plotly.R

3D scatter plot not drawn by z-axis order when alpha != 1

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

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

Ngôn ngữ chính
R
Star
2.7k
Fork
641
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

When creating a 3D scatter plot, the dots should be drawn in the order of depth, so drawing the furthest dot first, to get the right occlusion. This works well when alpha = 1, but when alpha < 1 the dots seem to be drawn in order of categories instead.

Here's a simple example. If you rotate it so the green dot is at the forefront, it is nevertheless occluded by the blue dot:

library(plotly)
plot_ly(data = data.frame(x = c(1, 1),
                          y = c(1, 2), 
                          z = c(1, 1), 
                          class = c("A", "B")),
        x = ~x, 
        y = ~y, 
        z = ~z, 
        color = ~class,
        alpha = 0.9)

Capture

This especially problematic when you have a lot of dots, and a cluster of nearby dots is completely hidden by a faraway cluster of dots of a different color.

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] plotly_4.10.0 ggplot2_3.3.5

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7         pillar_1.6.4       compiler_4.0.3     later_1.3.0        RColorBrewer_1.1-2 tools_4.0.3        digest_0.6.28     
 [8] viridisLite_0.4.0  jsonlite_1.7.2     lifecycle_1.0.1    tibble_3.1.5       gtable_0.3.0       pkgconfig_2.0.3    rlang_0.4.11      
[15] shiny_1.7.1        DBI_1.1.1          crosstalk_1.1.1    yaml_2.2.1         fastmap_1.1.0      httr_1.4.2         withr_2.4.2       
[22] dplyr_1.0.7        htmlwidgets_1.5.4  generics_0.1.0     vctrs_0.3.8        grid_4.0.3         tidyselect_1.1.1   data.table_1.14.2 
[29] glue_1.4.2         R6_2.5.1           fansi_0.5.0        farver_2.1.0       tidyr_1.1.4        purrr_0.3.4        magrittr_2.0.1    
[36] scales_1.1.1       promises_1.2.0.1   ellipsis_0.3.2     htmltools_0.5.2    assertthat_0.2.1   mime_0.12          colorspace_2.0-2  
[43] xtable_1.8-4       httpuv_1.6.3       utf8_1.2.2         lazyeval_0.2.2     munsell_0.5.0      crayon_1.4.1   

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

Tái tạo ví dụ scatter 3D plot_ly được cung cấp với alpha = 0.9 và xoay nó để so sánh thứ tự theo chiều sâu với alpha = 1. Truy vết đường dẫn kết xuất cho việc sắp xếp theo trục z và việc vẽ dựa trên danh mục, sau đó xác minh rằng các điểm trong suốt bị che khuất bởi chiều sâu chứ không phải bởi danh mụ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ệ
d3js, javascript, r
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.