plotly / plotly/plotly.js

enable tonexty without fallback to tozeroy

Ouverte
#5,538 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

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

Description

In our use case, we are plotting quantiles of a data set, with lower and upper bound as well as the median. For convenience, we need to fill in the area between the upper and lower bound shown.

The way we have solved this is by setting fill_type=tonexty on all traces and fill_color=gray on the top four traces, but fill_color=None on the bottom trace.

It looks like this:

scatter all visible

The problem is if a user disables the bottom trace, the tonexty fill of the second-to-last trace falls back to tozeroy:

scatter one hidden

This makes no sense in our case. The expected/intended behavior is:

scatter one hidden expected

We have tried/considered several methods:

  1. Creating a stackgroup; this does allow a fill 'inside' the group only, but requires the trace values to be stacked, which they fundamentally aren't; hiding a trace in that case moves the traces above, which is incorrect.
  2. Disabling the trace toggle; this hides the problem of course, but it also disables a useful feature
  3. Dynamically changing the fill_colors when a trace is hidden; this might work, but I can't find an event to hook into, and since we are using Dash, doing this kind of hacking between Python and clientside callbacks is nontrivial at best.

The best solution would be a fill_type that fills to next but falls back to no fill.

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 reproduire l’exemple de quantile-trace décrit dans l’issue et examinez le comportement de fill_type=tonexty lorsque la trace précédente est masquée. Examinez le comportement de fill existant dans Plotly.js et déterminez comment un fallback sans remplissage doit être représenté ; le travail est considéré comme terminé lorsque le cas de la trace masquée préserve la zone entre les limites restantes sans revenir à tozeroy.

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

Évaluation

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

Recevez les nouvelles issues par e-mail

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