plotly / plotly/plotly.R

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

Offen
#2,240 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
R
Sterne
2.7k
Forks
641
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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 : )

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit dem R-Einstiegspunkt highlight() und dem durch die bereitgestellte R Markdown-Reproduktion ausgelösten Verhalten von selectize.js. Überprüfen Sie, wie mehrere plotly-Figuren den Auswahlstatus gemeinsam nutzen, und machen Sie anschließend die Unterdrückung von Beschriftungen und den Platzhaltertext konfigurierbar, während die Auswahlen zwischen den Figuren unabhängig bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, r
Bereich
data-visualization, frontend
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.