selectedpoints for curvenumber > 0 invisible when using scattergl
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, r
- Lĩnh vực
- data-visualization
Hướng nghiên cứu
Bắt đầu với bản tái hiện Shiny tối thiểu trong issue và so sánh scatter với scattergl trong khi thay đổi curve_number và selectedpoints. Theo dõi đường dẫn restyle của plotlyProxyInvoke đối với các trace khác không; issue được hoàn tất khi các điểm được chọn vẫn hiển thị đối với mọi đường cong, khớp với hành vi của scatter.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I'm not sure if this is an issue with the R library (latest CRAN version 4.12.0) or plotly.js however, when setting selectedpoints on a scattergl trace for curvenumbers > 0, the points turn invisible - for curvenumber 0 it works as it should. If you look closely, you can see that the points were faded out before they are selected and when selected they disappear.
Using a scatter trace instead everything works as expected.
library(shiny)
library(plotly)
DF <- data.frame(
x = rep(1:10, 3),
y = c(
seq(1, 5, length.out = 10),
seq(1, 7, length.out = 10),
seq(1, 10, length.out = 10)
),
grp = rep(LETTERS[1:3], each = 10)
)
ui <- fluidPage(
plotlyOutput("my_plot"),
selectInput("plot_type", "Plot Type", choices = c("scatter", "scattergl"), selected = "scatter"),
numericInput(
inputId = "point_number",
label = "Point Number",
value = 0,
min = 0,
max = 9
),
numericInput(
inputId = "curve_number",
label = "Curve Number",
value = 0,
min = 0,
max = 2
)
)
server <- function(input, output, session) {
my_plot_proxy <- plotlyProxy(
outputId = "my_plot"
)
observe({
plotlyProxyInvoke(my_plot_proxy, "restyle", list(selectedpoints = -1)) # deselect all points for all traces
plotlyProxyInvoke(my_plot_proxy, "restyle", list(selectedpoints = list(I(input$point_number))), input$curve_number)
})
output$my_plot <- renderPlotly({
plot_ly(data = DF, type = input$plot_type, mode = "lines+markers", x = ~x, y = ~y, name = ~grp)
})
}
shinyApp(ui, server)
- 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
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.
Issue khác của plotly/plotly.R
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Data gets dropped in add_trace and consequently points have the wrong color if NA is present Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
-
save_image Error Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
Tất cả issue của plotly/plotly.R
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
r-lib/pkgdepends#485 · 3 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
beginners blocker
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
enviPathR Đang mởBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
Bioconductor/BiocContributions#207 · 6 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
datacarpentry/semester-biology#1255 ·