Plots are initially displayed with a wrong margin in Chrome
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 18.3k
- Forks
- 2k
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 28
Descripción
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:

Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza reproduciendo el fragmento proporcionado de Plotly.newPlot en Chrome usando el archivo graph.txt adjunto y el diseño responsive de Bootstrap. Inspecciona la ruta del dimensionamiento inicial antes y después de cambiar el tamaño del navegador; se considera terminado cuando el gráfico tiene el ancho y el margen derecho correctos en su primer renderizado sin requerir un cambio de tamaño ni un restyle.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- bootstrap, flask, javascript
- Área
- data-visualization, frontend
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100