Title: Data and layout changes are lost while the plot is initializing · Issue #373 · plotly/angular-plotly.js · GitHub
Open Graph Title: Data and layout changes are lost while the plot is initializing · Issue #373 · plotly/angular-plotly.js
X Title: Data and layout changes are lost while the plot is initializing · Issue #373 · plotly/angular-plotly.js
Description: 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 ...
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/plotly/angular-plotly.js/issues/373
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Data and layout changes are lost while the plot is initializing","articleBody":"### Description\n\n`PlotlyComponent` drops `[data]` and `[layout]` changes that arrive before `Plotly.newPlot` resolves. The chart keeps showing the initial input until another change happens later.\n\nThe 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.\n\n### Cause\n\n`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.\n\n### Steps to reproduce\n\n1. Load plotly.js through `PlotlyViaCDNModule`.\n2. Render `\u003cplotly-plot [data]=\"data\">\u003c/plotly-plot>` with `data = []`.\n3. Set `data` to a new array before the CDN script finishes loading (for example, from a fast HTTP response or a `setTimeout(..., 0)`).\n\nExpected: the chart shows the new data.\nActual: the chart stays empty until `data` or `layout` changes again.\n\n### Affected versions\n\n`v20`, `v21`, and `master` (same code in `ngDoCheck`).","author":{"url":"https://github.com/RaphaelFakhri","@type":"Person","name":"RaphaelFakhri"},"datePublished":"2026-10-24T16:18:45Z","url":"https://github.com/plotly/angular-plotly.js/issues/373"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c0268057-d5ff-657e-2031-1589d534f832 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DFA6:213839:3ADC504:4B2F13F:6B01F6BA |
| html-safe-nonce | ebd8cbe1baff0f150b5053c872c9dca831544b610b767deda7024d1e5f1e1560 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERkE2OjIxMzgzOTozQURDNTA0OjRCMkYxM0Y6NkIwMUY2QkEiLCJ2aXNpdG9yX2lkIjoiNjMyMjYxMzk0MDgyODM3MDYxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 30bbec71013c5c18b73abb53aa04f78a6544af22302c0281bc6385b257a7d3d4 |
| hovercard-subject-tag | issue:6014993409 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/angular-plotly.js/373/issue_layout |
| twitter:image | https://opengraph.githubassets.com/165768bc203f97c74687b2d808a44ae97e3527bb28a53ea30e55f4a6b425b70c/plotly/angular-plotly.js/issues/373 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/165768bc203f97c74687b2d808a44ae97e3527bb28a53ea30e55f4a6b425b70c/plotly/angular-plotly.js/issues/373 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RaphaelFakhri |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/angular-plotly.js git https://github.com/plotly/angular-plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 125262347 |
| octolytics-dimension-repository_nwo | plotly/angular-plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 125262347 |
| octolytics-dimension-repository_network_root_nwo | plotly/angular-plotly.js |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width