Plots are initially displayed with a wrong margin in Chrome
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.3k
- Forks
- 2k
- Ø Merge
- 2 T. 12 Std.
- Gemergte PRs (30 T.)
- 28
Beschreibung
I'm working on a web-app that should run in desktop and mobile. I've tested the app in Firefox and Chrome and noticed that the width (or right margin) of the plot is wrongly initialized.
The problem: The plot is too big when the page is initially loaded. After resizing the browser (responsive layout), the plot is updated and suddenly fits the screen properly.
I've added a restyle call to my script and that improves things a bit, but not completely.
<div id="progress-plot"></div>
<script>
var graph = {{progress_plot | safe}};
var config = {responsive: true, displayModeBar: false, showTips: true}
Plotly.newPlot('progress-plot', graph.data, graph.layout, config);
Plotly.restyle('progress-plot', graph.layout);
</script>
The app is a Flask app (the snippet is from a jinja2 page) and I'm using Bootstrap for the front-end.
I've attached a file with the contents of graph.
graph.txt
Here are some screenshots:

After slightly resizing the page:

Beitragsleitfaden
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 damit, den bereitgestellten Plotly.newPlot-Schnipsel in Chrome mit der angehängten graph.txt und dem responsiven Bootstrap-Layout zu reproduzieren. Untersuche den Pfad der anfänglichen Größenbestimmung vor und nach einer Größenänderung des Browsers; abgeschlossen ist die Untersuchung, wenn der Plot bei seinem ersten Rendern die korrekte Breite und den korrekten rechten Rand hat, ohne dass eine Größenänderung oder ein Restyle erforderlich ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- bootstrap, flask, javascript
- 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
- 42/100