plotly / plotly/plotly.R

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

Ouverte
#2,240 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
R
Étoiles
2.7k
Forks
641
Métriques de merge des PR
Aucune PR mergée en 30 j

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

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par le point d’entrée highlight() de R et le comportement de selectize.js mis en œuvre par la reproduction R Markdown fournie. Vérifiez comment plusieurs figures plotly partagent l’état de sélection, puis rendez configurables la suppression des libellés et le texte d’espace réservé, tout en maintenant les sélections indépendantes entre les figures.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, r
Domaine
data-visualization, frontend
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.