plotly / plotly/react-plotly.js
Axes incorrect when updating layout but not data
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.1k
- Forks
- 138
- Ø Merge
- 3 T. 2 Std.
- Gemergte PRs (30 T.)
- 4
Beschreibung
When updating the layout but passing a constant data object (or a new object but with nested constant objects), the traces stay the same but the axes reset to the defaults as if no data is plotted, causing the graph to be incorrect. The data points can also not be hovered over in this state.
Forcing the plot to redraw (e.g. by clicking 'Reset axes') corrects the plot and creating a deep copy of the data object before passing to the Plot component removes the issue.
Example at https://codesandbox.io/s/agitated-babycat-j9hjb8?file=/src/App.js (issue can be seen when changing text in input)
I have been unable to recreate this with pure plotly.js but I am less familiar with that library, so sorry if the issue is there instead.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit App.js in der verknüpften CodeSandbox und reproduziere das Problem, indem du die Eingabe änderst, während du konstante oder verschachtelte konstante Daten an die Plot-Komponente übergibst. Verfolge den layout-only-Updatepfad der Plot-Komponente und vergleiche ihn mit einer Aktualisierung der Daten durch eine tiefe Kopie; abgeschlossen ist die Aufgabe, wenn die Achsen die geplotteten Wertebereiche beibehalten und Datenpunkte weiterhin per Hover erreichbar sind, ohne auf Reset axes zu klicken.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, react
- Bereich
- data-visualization, frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100