plotly / plotly/plotly.R

ggplotly not working with control chart library ggQC

Đang mở
#2,177 0 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ả

Brief description of the problem:

Adding some lines and labels using the ggQC library causes a hard fail.

This code works with ggplotly:

      min_date = as.Date(min(lots_df_filtered()$DATE))
      max_date = as.Date(max(lots_df_filtered()$DATE))
      if (!is.na(min_date)) {
        num_days = length(seq(from = min_date, to = max_date, by = 'day')) - 1
        date_breaks <- if(num_days <= 31) 'day' else 'week'
        XmR_Plot <- 
            ggplot(lots_df_filtered(), aes(x = as.Date(DATE), y = YRS_YIELD)) +
            geom_point(alpha = .5) + geom_line() +
            labs(title=paste0(input$mfg_step_name, ' Lot Yield Control Chart')) +
            scale_x_date(date_breaks=date_breaks) +
            theme_ipsum_ps() +
            theme(axis.text.x = element_text(angle = 60, vjust = 0.5, hjust=1),
                  axis.title.x=element_blank()) 
        output$lot_time_series <- renderPlotly(ggplotly(XmR_Plot))
      }`

Produces a nice chart as so:

image

The following code results in an error (alpha must be of length 1 or the same length as x):

      min_date = as.Date(min(lots_df_filtered()$DATE))
      max_date = as.Date(max(lots_df_filtered()$DATE))
      if (!is.na(min_date)) {
        num_days = length(seq(from = min_date, to = max_date, by = 'day')) - 1
        date_breaks <- if(num_days <= 31) 'day' else 'week'
        XmR_Plot <- 
            ggplot(lots_df_filtered(), aes(x = as.Date(DATE), y = YRS_YIELD)) +
            geom_point(alpha = .5) + geom_line() +
            stat_QC(method = "XmR",      
                    auto.label = T, 
                    label.digits = 2,   
                    show.1n2.sigma = T   
                    ) +
            labs(title=paste0(input$mfg_step_name, ' Lot Yield Control Chart')) +
            scale_x_date(date_breaks=date_breaks) +
            theme_ipsum_ps() +
            theme(axis.text.x = element_text(angle = 60, vjust = 0.5, hjust=1),
                  axis.title.x=element_blank()) 
        output$lot_time_series <- renderPlotly(ggplotly(XmR_Plot))
      }

Here is what the ggplot looks like when I do not use ggplotly and do use ggCC:

image

Could this be related to the ggplotly argument layerData? Any help is appreciated.

thx

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 chạy bản tái hiện R được cung cấp với ggplotly, ggplot2 và ggQC, so sánh biểu đồ hoạt động được với phiên bản sử dụng stat_QC(). Điều tra lỗi “alpha must be of length 1 or the same length as x” đã được báo cáo và xác nhận rằng các layer của biểu đồ kiểm soát được render thông qua ggplotly mà không xảy ra lỗi nghiêm trọ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ệ
r
Lĩnh vực
data-visualization
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 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.