plotly / plotly/plotly.js

`alignmentgroup` & `offsetgroup` restyle bug

Ouverte
#6,415 0 commentaires 0 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

    @archmoj this looks great! There's one piece I don't understand: if I load `zz-scatter-grouping-vs-defaults`, then clear all the `alignmentgroup` attrs - `Plotly.restyle(gd,'alignmentgroup',null)` - then the traces in the upper right subplot disappear. They also disappear if I set the `alignmentgroup` for just those two traces to `'bottom'` to match the ones below - `Plotly.restyle(gd,'alignmentgroup','bottom', [3,9])`.

If I also clear offsetgroup they come back, and if I set the offsetgroup for those two to something explicit they get their own group.

So I guess the odd case is when alignmentgroup is either all null or all the same but one trace, in a different subplot from the others, doesn't have an offsetgroup.

There's a related case that's clearly broken: in the same mock, if I just clear offsetgroup for the last trace it stays where it was. But if I first give it a new offsetgroup (so it correctly gets new space) and THEN clear it, it gets pushed into the next group!

Plotly.restyle(gd, 'offsetgroup', null, 11) // clear the group for the last trace, this is OK
Screenshot 2022-12-20 at 19 24 03
Plotly.restyle(gd, 'offsetgroup', '3', 11) // put it in a new group
Plotly.restyle(gd, 'offsetgroup', null, 11) // clear its group
Screenshot 2022-12-20 at 19 18 43

I don't think this is unique to scatter, I can get a similar history-dependent errors from bars from setting / clearing the offsetgroup of the FIRST bar in the bottom right subplot (ie replace the 11 with 4 in those commands). Maybe we just treat null as its own offsetgroup if there are other traces with an offsetgroup on the same axis?

Originally posted by @alexcjohnson in https://github.com/plotly/plotly.js/issues/6381#issuecomment-1360562317

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

Reproduisez le problème dans le mock zz-scatter-grouping-vs-defaults avec les appels Plotly.restyle décrits pour alignmentgroup et offsetgroup, en incluant à la fois la suppression et l’attribution de groupes. Suivez le comportement du groupement à partir de ces points d’entrée. C’est terminé lorsque la suppression ou la modification de groupes ne fait pas disparaître les traces, ne les déplace pas dans un autre groupe et ne dépend pas de l’ordre des restyles.

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é
4/5
Temps estimé
3-5 jours
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.