plotly / plotly/plotly.R

Version 4.10.0 bug displaying hover text in output

Ouverte
#2,080 2 commentaires 0 réactions 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

With version 4.10.0, there appears to be a bug that causes hover text to display in the output figure for bar plots. It seems that this is somehow related to the size of the bars and the window in which the figure is displayed. Adding textposition = "none" to the plot_ly() call seems to resolve this issue, however this was not required with the previous version (4.9.1).

Reproducible example using code from Text Mining with R:

library(tidyverse)
library(plotly)
library(tidytext)
library(janeaustenr)

austen_bigrams <- austen_books() %>%
  unnest_tokens(bigram, text, token = "ngrams", n = 2)

bigrams_separated <- austen_bigrams %>%
  separate(bigram, c("word1", "word2"), sep = " ")

bigrams_filtered <- bigrams_separated %>%
  filter(!word1 %in% stop_words$word) %>%
  filter(!word2 %in% stop_words$word)

# new bigram counts:
bigram_counts <- bigrams_filtered %>% 
  count(word1, word2, sort = TRUE)

bigrams_united <- bigrams_filtered %>%
  unite(bigram, word1, word2, sep = " ")

bigram_tf_idf <- bigrams_united %>%
  count(book, bigram) %>%
  bind_tf_idf(bigram, book, n) %>%
  arrange(desc(tf_idf)) %>%
  group_by(book) %>%
  slice_max(tf_idf, n = 10) %>%
  mutate(bigram = fct_reorder(bigram, tf_idf))

bigram_tf_idf %>%
  do(p = plot_ly(., x = ~tf_idf, y = ~bigram, color = ~book, type = "bar", hoverinfo = "text", text = ~paste(bigram, "<br> tf-idf: ", tf_idf))) %>%
  subplot(nrows = 3, shareX = FALSE, shareY = FALSE)

Snippet of the resulting figure:

plotly_bug

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

Exécutez l’exemple R reproductible utilisant plot_ly() et subplot(), puis comparez la sortie du graphique en barres dans les versions 4.10.0 et 4.9.1. Déterminez pourquoi un texte apparaît au survol dans la figure malgré hoverinfo = "text" ; l’issue est considérée comme terminée lorsque le comportement de survol attendu fonctionne sans ajouter textposition = "none".

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

Évaluation

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

Recevez les nouvelles issues par e-mail

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