plotly / plotly/plotly.js

Chart overflows when URL changes

Abierto
#5,871 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug P3
Lenguaje dominante
JavaScript
Estrellas
18.3k
Forks
2k
Merge medio
2 d 12 h
PR fusionados (30 d)
28

Descripción

Hi all,

Firstly, thanks for the amazing product!
I'm using Plotly in a single page application, which means that the URL changes a lot. Some of these changes are made without changing the contents of the page, or at least without changing the charts rendered with Plotly.

However, Plotly uses the entire URL of the page to generate a clip-path attribute in order to deal with overflowing charts. When the URL changes, the clip path isn't valid any more, and the chart breaks. The interesting thing is, it wouldn't have been an issue if the chart had been configured without window.location.href.

Would it be possible to make this setting configurable? The only workarounds I see are to either reload every time the URL changes, or to change the base tag in the HTML <head>, which seems like it would invite a lot of other problems. If you see any others, I'd love to hear about them.

I tried have a reproducible example in Codepen, but I couldn't easily set a URL on their iframe. Instead, I just invalidate the clip-path to show what happens: https://codepen.io/rubenhelsloot/pen/eYWKQyx. The actual bug happens in Chrome, but not in Firefox. I'm pretty sure that's because Firefox doesn't re-evaluate the SVG when the URL changes, and Chrome does.

Thanks in advance!

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con la reproducción vinculada de CodePen y confirma el fallo de clip-path después de cambiar la URL de la página en Chrome. Rastrea dónde genera Plotly el clip-path a partir de window.location.href y, a continuación, determina cómo se comportaría una alternativa configurable sin romper la gestión del desbordamiento del gráfico. Se considera terminado cuando el gráfico sigue siendo válido después de cambiar la URL y el comportamiento está cubierto por una comprobación reproducible.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
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
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.