plotly / plotly/react-plotly.js
Coloraxis not properly updated
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
In this codepen example, I have a simple scatterplot with a single data point, and a "coloraxis" marker.
When the datapoint's marker is updated, the coloraxis is not properly updated. Specifically, when the datapoint marker color is incremented or decremented, the coloraxis does not rescale as you'd expect.
For example, when the chart is initialized, the datapoint's color is initialized to 5. The color axis values range from 4-6, as you'd expect:

The Data.color++ and Data.color-- buttons increment and decrement the datapoint's color value. But this results in the coloraxis expanding to encompass the datapoint's color value from previous renders. Here, I've incremented and decremented the color a bunch of times, and the color axis' values now range from 0-12:

If I force the component to unload and reload (by passing a new React key param to the <Plot/> each time render is called), the issue is fixed. (Also, if I download the plot as a PNG, that PNG looks correct.)
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 dem verknüpften CodePen-Beispiel und verfolge den React Plot-Aktualisierungspfad für Änderungen an der Markerfarbe des Datenpunkts. Verwende wiederholt die Steuerelemente Data.color++ und Data.color--; fertig ist die Aufgabe, wenn die coloraxis auf den aktuellen Wert statt auf Werte aus vorherigen Renderings skaliert wird und die heruntergeladene PNG-Datei weiterhin korrekt ist.
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