selectize.js default behavior: remove label and allow for placeholder
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 2.7k
- Forks
- 641
- PR merge metrics
- No merged PRs in 30d
Description
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)
```
Two Design improvements would be nice
- No label above selectize widget
- 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 = NULLmakes sure that no label is plottedplaceholder = ""to define the placeholder in the selectize box.
Let me know what you think of it : )
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the R highlight() entry point and the selectize.js behavior exercised by the provided R Markdown reproduction. Verify how multiple plotly figures share selection state, then make label suppression and placeholder text configurable while keeping selections independent across figures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, r
- Domain
- data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100