Better support for trellis displays
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ả
There are a few different ways to do a trellis display currently, but these are all a bit esoteric
one_plot <- function(d) {
plot_ly(d, x = ~wt, y = ~mpg)
}
mtcars %>%
group_by(vs) %>%
do(plot = one_plot(.)) %>%
subplot(nrows = NROW(.))
plot_ly(mtcars, x = ~wt, y = ~mpg, color = ~factor(vs), yaxis = ~paste0("y", vs + 1)) %>%
subplot(nrows = 2)
plot_ly(mtcars, x = ~wt, y = ~mpg, split = ~factor(vs), yaxis = ~paste0("y", vs + 1)) %>%
subplot(nrows = 2)
#726 implements a trellis argument, which essentially maps that variable to sensible trace anchors, then uses subplot()'s machinery to populate axis objects. The problem is, we have guarantee a subplot is returned if we want a sensible result for:
plot_ly(mtcars, x = ~wt, y = ~mpg, trellis = ~vs)
Thus, we lose the ability to specify the number of rows in that subplot
It'd be better to have trellis() function:
trellis <- function(p, formula, ...) {
# do some stuff here
subplot(p, ...)
}
Ideally, the trellising would work a lot like ggplot2 facets (trellising variables should not appear in legends, and appear as annotations instead). This is what we do in ggplotly() via clever use of showlegend and legendgroup.
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
Trước tiên, hãy xem xét đối số trellis được đề xuất trong #726 và cơ chế subplot() hiện có. Một giải pháp hoàn chỉnh cần cung cấp một hàm trellis() duy trì quyền kiểm soát các hàng subplot và hỗ trợ hành vi tương tự ggplot2, bao gồm việc giữ các biến trellising ngoài chú giải và hiển thị chúng dưới dạng chú thích.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- r
- Lĩnh vực
- data-visualization
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100