plotly_relayout does not always fire
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 will try and create a reprex if needed however I'm still trying to pin down an exact cause of this, for now I'll include relevant snippets.
In one of my projects I have been using the drawing capabilities of plotly.js:
plotly::plot_ly(.......) %>%
plotly::config(modeBarButtonsToAdd = list("drawclosedpath", "drawrect", "eraseshape")) %>%
plotly::config(displayModeBar = TRUE)
I am listening to the plotly relayout event:
observeEvent(plotly::event_data("plotly_relayout", session = session$rootScope()), {
relayout <- plotly::event_data("plotly_relayout", session = session$rootScope())
dplyr::glimpse(relayout)
#.... rest of the code omitted
})
The issue I am seeing is not all of the drawing events are triggering a shiny event. I have used the websocket viewer of Firefox developer console and the socket contains gaps where the relayout even should be. Hover events are being produced as the mouse is moved for the drawing of the shape however.
I'm seeing series of errors in the browser console:

Specifically for the rectangle draw:

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
Bắt đầu với observer plotly::event_data("plotly_relayout") và đầu ra websocket trong console dành cho nhà phát triển của Firefox, so sánh các thao tác vẽ với các thông báo socket và những lỗi trình duyệt được báo cáo. Công việc được xem là hoàn tất khi có một trường hợp có thể tái hiện xác định được lý do các sự kiện vẽ hình chữ nhật hoặc các sự kiện vẽ khác không kích hoạt sự kiện Shiny.
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, 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
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100