plotly / plotly/plotly.js

`alignmentgroup` & `offsetgroup` restyle bug

Offen
#6,415 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug P3
Vorherrschende Sprache
JavaScript
Sterne
18.3k
Forks
2k
Ø Merge
2 T. 12 Std.
Gemergte PRs (30 T.)
28

Beschreibung

    @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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduzieren Sie das Problem im zz-scatter-grouping-vs-defaults-Mock mit den beschriebenen Plotly.restyle-Aufrufen für alignmentgroup und offsetgroup, einschließlich des Löschens und Zuweisens von Gruppen. Verfolgen Sie das Gruppierungsverhalten ausgehend von diesen Einstiegspunkten. Erledigt bedeutet, dass das Löschen oder Ändern von Gruppen nicht dazu führt, dass Traces verschwinden, in eine andere Gruppe verschoben werden oder von der Reihenfolge der Restyles abhängen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.