plotly / plotly/plotly.R

selectize.js default behavior: remove label and allow for placeholder

Đang mở
#2,240 0 bình luận 1 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ả

I would like to create an R Markdown document with > 1 plotly figure where points can be highlighted with the selectize.js widget. Here a reproducible example

---
title: Test
output: html_document
---

# wt vs mpg

```{r, message=FALSE, warning=FALSE}
library(plotly)
myData <- highlight_key(mtcars, ~rownames(mtcars))
myFig <- plot_ly(myData, x = ~wt, y = ~mpg) 
highlight(myFig, selectize = TRUE)
```

# disp vs mpg

```{r, message=FALSE}
myData <- highlight_key(mtcars, ~rownames(mtcars))
myFig <- plot_ly(myData, x = ~disp, y = ~mpg) 
highlight(myFig, selectize = TRUE)
```

selectize_label

Two Design improvements would be nice

  1. No label above selectize widget
  2. Placeholder text in the <input> field of the widget

For the first problem I found a workaround using highlight_key(..., group = " "). However I need to define for each plot a new "invisible" group identifier otherwise the highlighting of the plots will be linked (i.e. if I highlight a car in one plot it will be highlighted in all plots). At the moment I use group = " ", group = " ", group = " ", and so on but this is stupid.

A workaround for the placeholder text was already described on Stack Overflow. But it does not work out of the box if there are multiple plotly figures in one R Markdown document.

Optimal solution would be to have two additional arguments in the highlight() function

  • label = NULL makes sure that no label is plotted
  • placeholder = "" to define the placeholder in the selectize box.

Let me know what you think of it : )

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 với điểm vào highlight() của R và hành vi của selectize.js được thực thi bởi bản tái hiện R Markdown được cung cấp. Xác minh cách nhiều biểu đồ plotly chia sẻ trạng thái lựa chọn, sau đó cho phép cấu hình việc ẩn nhãn và văn bản placeholder, đồng thời vẫn giữ các lựa chọn độc lập giữa các biểu đồ.

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, frontend
Loại issue
Tính năng
Độ 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
45/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.