plotly / plotly/plotly.py

Figure margin edit makes scrollZoom glitch / lag

Offen
#4,223 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug P3 performance
Vorherrschende Sprache
Python
Sterne
18.8k
Forks
2.8k
Ø Merge
16 Std. 26 Min.
Gemergte PRs (30 T.)
21

Beschreibung

Updating layout to change margin size works well
Enabling scrollzoom works well
Doing both at the same time gives you an interactive plot that is very laggy to scroll zoom in
Seems worse with more points
Seems related to https://github.com/plotly/plotly.js/issues/3729

I encountered this issue on Dash first, but realised it exists in pure Plotly as well
Plotly v 5.14.1 on Python 3.9.13

Minimal example (remove update_layout line to see behavior improve)

import plotly.express as px
df = px.data.gapminder()
fig = px.scatter(df, x='pop', y='gdpPercap')
fig.update_layout(margin=dict(l=0, r=0, t=0, b=0))
fig.show(config=dict({'scrollZoom': True}))

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

Führen Sie das bereitgestellte minimale Python-Beispiel mit Plotly 5.14.1 aus und vergleichen Sie das Scroll-Zoom-Verhalten mit und ohne die Änderung am update_layout-Margin, insbesondere wenn die Anzahl der Punkte zunimmt. Verwenden Sie das beschriebene Verhalten und das zugehörige Issue #3729 als Ausgangspunkte für die Untersuchung; als erledigt gilt die Untersuchung, wenn das Bearbeiten des Margins keine merkliche Verzögerung beim Scroll-Zoom mehr verursacht.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
32/100

Neue Issues direkt in Ihr Postfach

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