Data and layout changes are lost while the plot is initializing
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- angular, typescript
- Área
- frontend
Línea de trabajo
Empieza por PlotlyComponent.ngDoCheck y la ruta de inicialización que llama a Plotly.newPlot; el issue señala el diff consumido y la actualización que falta mientras plotlyInstance es undefined. Sigue cómo se resuelve la inicialización y cómo se aplican las actualizaciones; después, añade cobertura para los casos en que los datos o el diseño cambien antes de que se resuelva newPlot. El objetivo es que el gráfico muestre las entradas más recientes después de la inicialización sin necesitar otro cambio.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
PlotlyComponent drops [data] and [layout] changes that arrive before Plotly.newPlot resolves. The chart keeps showing the initial input until another change happens later.
The window is easy to hit with PlotlyViaCDNModule or PlotlyViaWindowModule, where newPlot waits for plotly.js to load, and with traces whose newPlot is asynchronous. A typical case is a chart that starts with [data]="[]" and receives data from an HTTP request that completes before plotly.js finishes loading.
Cause
ngDoCheck detects the change, which consumes the differ's diff, but only calls updatePlot() when plotlyInstance is set. During initialization plotlyInstance is still undefined, so the update is skipped. newPlot was already called with the old input, so the newer input is never drawn.
Steps to reproduce
- Load plotly.js through
PlotlyViaCDNModule. - Render
<plotly-plot [data]="data"></plotly-plot>withdata = []. - Set
datato a new array before the CDN script finishes loading (for example, from a fast HTTP response or asetTimeout(..., 0)).
Expected: the chart shows the new data.
Actual: the chart stays empty until data or layout changes again.
Affected versions
v20, v21, and master (same code in ngDoCheck).
- Lenguaje dominante
- TypeScript
- Estrellas
- 242
- Forks
- 81
- Merge medio
- 23 h 52 min
- PR fusionados (30 d)
- 5
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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.
Más de plotly/angular-plotly.js
-
Feature request: please add migration guidePosiblemente ocupada @andrefarzat la tomó hace 21 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
plotly/angular-plotly.js#285 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
event handlers are not typedPosiblemente ocupada @andrefarzat la tomó hace 21 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
plotly/angular-plotly.js#283 ·
Los mantenedores suelen responder en 1 día
-
Angular 20 standalone applicationPosiblemente ocupada @andrefarzat la tomó hace 21 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
plotly/angular-plotly.js#281 · 8 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
Angular 19 specs won't runAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
plotly/angular-plotly.js#278 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
plotly/angular-plotly.js#276 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de plotly/angular-plotly.js
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
riverqueue/river#1576 ·
Los mantenedores suelen responder en 1 día
-
[bug] A prompt queued during a run is assessed without its textPosiblemente ocupada @jwiegley la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DevMortimer/pi-warden#211 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
mattermost/compass-design#191 ·
Los mantenedores suelen responder en 1 día
-
Add unit tests for the organization admin role checkPosiblemente ocupada @SaffuSafwan la tomó hoy. Abiertoarea/core good first issue help wanted
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
elmohq/elmo#1095 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
HorusGoul/trizum#559 · 1 comentario ·
Los mantenedores suelen responder en 1 día