Title: [BUG]: Some event payload types don't match what's actually emitted · Issue #8147 · plotly/plotly.js · GitHub
Open Graph Title: [BUG]: Some event payload types don't match what's actually emitted · Issue #8147 · plotly/plotly.js
X Title: [BUG]: Some event payload types don't match what's actually emitted · Issue #8147 · plotly/plotly.js
Description: Description Some event types in src/types/core/events.d.ts do not match the payload that plotly.js emits. Steps to reproduce Register gd.on('plotly_beforeplot', (event) => event.data) and call Plotly.newPlot. The code compiles, but event...
Open Graph Description: Description Some event types in src/types/core/events.d.ts do not match the payload that plotly.js emits. Steps to reproduce Register gd.on('plotly_beforeplot', (event) => event.data) and call Plot...
X Description: Description Some event types in src/types/core/events.d.ts do not match the payload that plotly.js emits. Steps to reproduce Register gd.on('plotly_beforeplot', (event) => event.data) an...
Opengraph URL: https://github.com/plotly/plotly.js/issues/8147
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG]: Some event payload types don't match what's actually emitted","articleBody":"### Description\n\nSome event types in `src/types/core/events.d.ts` do not match the payload that plotly.js emits.\n\n### Steps to reproduce\n\n- Register `gd.on('plotly_beforeplot', (event) => event.data)` and call `Plotly.newPlot`. The code compiles, but `event.data` is `undefined`.\n- Register `gd.on('plotly_selected', (event) => event.points)` and clear a selection. The code compiles, but `event` is `undefined`.\n- Register `gd.on('plotly_click', (event) => event.event.clientX)` on a `scatter3d` plot. The code compiles, but `event.event` is `undefined`.\n\n### Notes\n\n- This is a follow-up to #8145\n- Required changes:\n - `plotly_beforeplot`: the payload is the tuple `[data, layout, config]`, but `BeforePlotEvent` is an object.\n - `plotly_selected`: the payload is `undefined` when a selection is cleared, but the callback type does not allow it.\n - `PlotMouseEvent.event`: `gl3d` traces emit no `event`, but the field is required.\n - `PlotHoverEvent.xvals` and `yvals`: only cartesian traces set them, but both fields are required.\n - `LegendClickEvent.node`: the value is an SVG element, but the type is `PlotlyHTMLElement`.\n - Missing optional fields: `xaxes`, `yaxes`, `xvals` and `yvals` on click events, `selections` on `plotly_selected`, `group` and `label` on legend clicks, and `subplotId` on annotation clicks.\n - `parcoords` emits `plotly_hover` and `plotly_unhover` with `{x, y, clientX, clientY, dataIndex, curveNumber}`, with no `points` or `event`.\n- Fixing `plotly_beforeplot` and `plotly_selected` is a changes existing types and could break existing code for some users. This wouldn't be a breaking change because it falls under a bug fix.","author":{"url":"https://github.com/camdecoster","@type":"Person","name":"camdecoster"},"datePublished":"2026-10-27T01:30:19Z","url":"https://github.com/plotly/plotly.js/issues/8147"}
| 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:59a72711-d4aa-3b9c-fe99-174a8b0366b9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC6A:38E318:23E2F07:2D6497C:6B01BB89 |
| html-safe-nonce | f3cf83dfa14b33b13d3d132f6f415e0140d2a1444152be02325946c99168e280 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzZBOjM4RTMxODoyM0UyRjA3OjJENjQ5N0M6NkIwMUJCODkiLCJ2aXNpdG9yX2lkIjoiMjAzMDM0NTg2NDI3MDE2NjkyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3c5b89bbb0cb609ce53bd6e4a07df9416caf781b9d58b39db64b917d67b45a2f |
| hovercard-subject-tag | issue:6051200663 |
| 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/plotly.js/8147/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9d7124abffd48e646426b0dc46b7d22ec3f2f151ebf465fb3b0ccd8919f8bef0/plotly/plotly.js/issues/8147 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9d7124abffd48e646426b0dc46b7d22ec3f2f151ebf465fb3b0ccd8919f8bef0/plotly/plotly.js/issues/8147 |
| og:image:alt | Description Some event types in src/types/core/events.d.ts do not match the payload that plotly.js emits. Steps to reproduce Register gd.on('plotly_beforeplot', (event) => event.data) and call Plot... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | camdecoster |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 45646037 |
| octolytics-dimension-repository_nwo | plotly/plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45646037 |
| octolytics-dimension-repository_network_root_nwo | plotly/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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width