plotly / plotly/plotly.js

Scroll zoom does not work properly when minimum and maximum range is enabled

Offen
#7,440 2 Kommentare 3 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

Scroll zoom does not work as expected when minimum and maximum range is enabled. Graphical side effects are constantly visible while zooming in/out.

See the provided example of the scatter plot chart:

  • Scrolling zoom (mouse wheel) is enabled (with scrollZoom property).
  • Minimum and maximum range is set (with minallowed and maxallowed properties).
  • (The grids and axes are visualised for better understanding the issue.)

https://codepen.io/zabka5/full/XJbYrZV

Use the mouse wheel to zoom out beyond allowed range.
The plotted trace is zoomed out even beyond the range. After a while, the plotting is "corrected" to the right zoom level. The effect is stronger if you zoom out faster. What is interesting, the axes and the grids are always scaled correctly. It means that plotting of the grid lines is always aware of the range limits but plotting the trace not.

The same effect can be reproduced while zooming IN relatively fast, even if the plot is "in the range". Then, the plotted trace exceeds the area defined by the X and Y axes and then i.e. the bigger than expected, but after a while, plotting is corrected. With this attached example, it is hard to observe this scenario. (Maybe bigger amount of data or slowness of the refreshing of the plot plays a role - with my custom environment, I can see it constantly).

The observed flickering is very annoying and shows a serious weakness in this function.

I have checked the different versions of the plotly library. The issue is easy to reproduce from the very first version introducing the minimum and maximum range, i.e. version v2.26.0 #6547

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 mit der bereitgestellten CodePen-Reproduktion und der in v2.26.0 (#6547) eingeführten Implementierung des Minimum-/Maximum-Bereichs. Vergleiche die Trace-Darstellung mit den korrekt skalierten Achsen und Gittern während schneller Scroll-Zoom-Ereignisse. Als erledigt gilt es, wenn der Trace innerhalb des zulässigen Bereichs bleibt, ohne zu flackern oder später korrigiert zu werden.

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
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
52/100

Neue Issues direkt in Ihr Postfach

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