Plots are initially displayed with a wrong margin in Chrome
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 18.3k
- Fork
- 2k
- Merge medio
- 2g 12h
- PR unite (30g)
- 28
Descrizione
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:

Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo lo snippet Plotly.newPlot fornito in Chrome usando il file graph.txt allegato e il layout responsive di Bootstrap. Ispeziona il percorso di dimensionamento iniziale prima e dopo il ridimensionamento del browser; il lavoro è completato quando il grafico ha la larghezza e il margine destro corretti al primo rendering, senza richiedere un ridimensionamento o un restyle.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- bootstrap, flask, javascript
- Ambito
- data-visualization, frontend
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100