plotly / plotly/plotly.js

Scatter 3D dragmode turntable loses the camera.eye on JavaScript reload

Offen
#6,359 4 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

Scatter 3D dragmode "orbit" and "turntable" moves camera.eye but it is not reflected to layout.schene.camera.eye of the frame. It will be saved just after mouse click event or wheel, through relayoutCallback > scene.saveLayout .
https://github.com/plotly/plotly.js/blob/35fb5b918e3dbdc3cc6e3b9735c8003008376020/src/plots/gl3d/scene.js#L240

If replot, react, animate and so on, happens during mouse move and mouse up, replot uses layout.schene.camera.eye saved BEFORE and overwrite.

It can reploduced in https://halueda.github.io/wavy-orbitals/ .
Its color is chaneged once a second and you can only rotate 3d-axis if mouse move is in 1 second, during color change.

To solve this, there seems two ways.

  1. every mouse move event do scene.saveLayout. It may cause performance impact.
  2. replot function do scene.saveLayout if the plot is 3d.

Perhaps more genral way should be used. For example, mouse moving event set into something like pending events and replot-api executes all pending events prior to real replot. As well as, scene.saveLayout clears the pending event.

This issue can be related to:
#5500
#5005
#5560

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

Beginne bei src/plots/gl3d/scene.js um Zeile 240 und reproduziere den Verlust des Kamerastatus im verlinkten Beispiel wavy-orbitals, während Farbaktualisierungen Replots auslösen. Verfolge relayoutCallback, scene.saveLayout und den Replot-Pfad. Als abgeschlossen gilt die Aufgabe, wenn Änderungen an camera.eye der Orbit- oder Turntable-Kamera Replot, React oder Animation während der Mausbewegung überstehen, ohne die aktuelle Ansicht zu überschreiben.

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.