plotly / plotly/plotly.js

boxplots with q1/median/q3 signature always show fences as min/max on hover

Ouverte
#6,212 2 commentaires 4 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

bug P3
Langage dominant
JavaScript
Étoiles
18.3k
Forks
2k
Merge moyen
2 j 12 h
PR mergées (30 j)
28

Description

Like many who requested the boxplot with q1/median/q3 signature, I have a situation where I am pre-computing these statistics (along with lower and upper fence) from a very large database and then feeding these values to plotly.

I am also pre-computing outliers and adding those as a separate trace.

When using the boxplot with q1/median/q3 signature, we do not have the flexibility to label the fences correctly in the case of outliers.

See the example below (codepen):

image

Here there are no low outliers, so the lower fence is correctly labeled as "min" in the hover. However, the upper fence is labeled as "max" even though there are outliers.

This is confusing to users who wonder why something is labeled as the max when there are points outside of the fence. If I chose not to add the outliers trace, which is probably what most people do who are using this boxplot signature, it would be even more misleading because there would be no hint about whether the underlying data these fences were computed from really have min and max values at the fences, which could lead to some incorrect and bad conclusions about the data.

Fences are not necessarily the min and max, and when using the q1/median/q3 signature, the boxplot has no way of knowing which is the case.

This could be addressed with any of the following:

  1. Allow the ability to override the hover text for this signature
  2. Add an outliers argument to this signature as some have proposed here
  3. Add min/max to the signature – these wouldn't be plotted, but if min < lowerfence, then the hover text for lowerfence would be "lowerfence" (otherwise "min") and similar logic for upperfence/max
  4. Always make the hover text for the lower and upper fences as "lowerfence" and "upperfence" regardless of whether they represent the min/max
  5. Remove the boxplot with q1/median/q3 signature option because it produces a plot that currently by default has statistically incorrect hover info

Personally I lean toward (3).

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 la signature boxplot q1/median/q3 et reproduisez les libellés au survol à l’aide de l’exemple CodePen lié. Examinez comment la signature représente les fences et les outliers, puis déterminez quel comportement d’API proposé est approprié ; le travail est terminé lorsque les libellés des fences n’impliquent plus min/max lorsque cela ne peut pas être connu, et que le comportement de l’exemple est couvert par des tests.

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

Évaluation

Stack technique
javascript
Domaine
data-visualization
Type d'issue
Bug
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

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