ggplotly: problems with facet_grid/axes
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ả
I'm trying to display some block-matrix-like plot, and there are a few regressions when converting from ggplot to ggplotly conversion (ranked by severity):
- degenerated (1 value) discrete axes are implicitly converted into continuous numeric axis centered around
1, original labels not displayed switch="both"andstrip.placement = "outside"options ignored (here it's important because with ggplot I am able to have sort-of 2-level hierarchy for X and Y axes, which ggplotly breaks)- some subplots with missing data are displayed (at 3x3 position), some don't (2x2 position)
- the margins for the X labels are too small (is the text rotation considered when calculating the necessary space?)
space="free"option ignored- within my shiny application the diagonal subplots miss the fill color. It's an important issue, but I cannot make a small reproducible example (screenshot attached).
ggplot2

ggplotly

ggplotly from Shiny app

The code
require(readr)
require(plotly)
require(ggplot2)
peakXpepmod.df <- read_tsv("CAPZA1_example.txt",
col_types = list("pepmod_id"="c", "peak_id"="c", "proteoform_id"="c", "pmgroup_id"="c")) %>%
dplyr::mutate(pepmod_id = factor(pepmod_id),
peak_id = factor(peak_id),
proteoform_id = factor(proteoform_id),
pmgroup_id = factor(pmgroup_id))
p <- ggplot(peakXpepmod.df) +
geom_point(aes(x = pepmod_id, y = peak_id,
color = proteoform_id), shape=15, size=8) +
geom_point(aes(x = pepmod_id, y = peak_id,
shape = pmgroup_id), size=5) +
scale_x_discrete("Pepmods") + scale_y_discrete("Peaks") +
theme( axis.line = element_line(colour = "gray80"),
axis.ticks = element_line(colour = "gray80"),
axis.text.x = element_text(angle = 90, hjust = 1),
strip.background = element_rect(colour="gray"),
strip.placement = "outside") +
facet_grid(proteoform_id ~ pmgroup_id, switch="both", scales = "free", space = "free")
# ggplot
p
# ggplotly
ggplotly(p)
The dataset
CAPZA1_example.txt
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
Tái hiện báo cáo bằng cách chạy ví dụ R được cung cấp với CAPZA1_example.txt, so sánh p với ggplotly(p) và tập trung vào việc chuyển đổi facet_grid. Không có tệp dự án hoặc bài kiểm thử nào được nêu tên; công việc được xem là hoàn tất khi xử lý các hồi quy đã liệt kê liên quan đến trục, dải, subplot bị thiếu, lề, khoảng cách và màu tô, đặc biệt chú ý đến các trường hợp có thể tái hiện.
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
- 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
- 32/100