Title: Can't disable sunburst default animation · Issue #331 · plotly/react-plotly.js · GitHub
Open Graph Title: Can't disable sunburst default animation · Issue #331 · plotly/react-plotly.js
X Title: Can't disable sunburst default animation · Issue #331 · plotly/react-plotly.js
Description: Using NextJS 13, passing onSunburstClick={() => false} to the Plot component does not disable the default behaviour of clicking in a sunburst node and zooming in to that node. The component I'm creating: import { Content, ContextualHelp,...
Open Graph Description: Using NextJS 13, passing onSunburstClick={() => false} to the Plot component does not disable the default behaviour of clicking in a sunburst node and zooming in to that node. The component I'm cre...
X Description: Using NextJS 13, passing onSunburstClick={() => false} to the Plot component does not disable the default behaviour of clicking in a sunburst node and zooming in to that node. The component I...
Opengraph URL: https://github.com/plotly/react-plotly.js/issues/331
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't disable sunburst default animation","articleBody":"Using NextJS 13, passing `onSunburstClick={() => false}` to the `Plot` component does not disable the default behaviour of clicking in a sunburst node and zooming in to that node.\r\n\r\nThe component I'm creating:\r\n\r\n```jsx\r\nimport {\r\n Content,\r\n ContextualHelp,\r\n Flex,\r\n Heading,\r\n Slider,\r\n} from '@adobe/react-spectrum';\r\nimport plotly, { Font, PlotData } from 'plotly.js';\r\nimport { useState } from 'react';\r\nimport createPlotComponent from 'react-plotly.js/factory';\r\n\r\nconst Plot = createPlotComponent(plotly);\r\n\r\ninterface SunburstPlotData extends Partial\u003cPlotData> {\r\n outsidetextfont?: Partial\u003cFont>;\r\n leaf?: { opacity?: number };\r\n maxdepth?: number;\r\n}\r\n\r\n// NOTE: to access the taxon id:\r\n// e.points[0].customdata\r\n\r\nexport default function TaxonSunburst() {\r\n const [maxDepthValue, setMaxDepthValue] = useState\u003cnumber>(3);\r\n\r\n const data: SunburstPlotData[] = [\r\n {\r\n type: 'sunburst',\r\n // NOTE: this is for the taxon names\r\n labels: [\r\n 'Eve',\r\n 'Cain',\r\n 'Seth',\r\n 'Enos',\r\n 'Noam',\r\n 'Abel',\r\n 'Awan',\r\n 'Enoch',\r\n 'Azura',\r\n ],\r\n // NOTE: this is going to be used for the taxids\r\n customdata: [1, 2, 3, 4, 5, 6, 7, 8, 9],\r\n // NOTE: parent of each taxon\r\n parents: ['', 'Eve', 'Eve', 'Seth', 'Seth', 'Eve', 'Eve', 'Awan', 'Eve'],\r\n // NOTE: paper counts per taxon\r\n values: [10, 14, 12, 10, 2, 6, 6, 4, 4],\r\n outsidetextfont: { size: 20, color: '#377eb8' },\r\n leaf: { opacity: 0.4 },\r\n marker: { line: { width: 2 } },\r\n maxdepth: maxDepthValue,\r\n },\r\n ];\r\n\r\n return (\r\n \u003cFlex\r\n direction=\"column\"\r\n alignItems=\"center\"\r\n marginY=\"size-200\"\r\n maxWidth=\"100%\"\r\n >\r\n \u003cSlider\r\n label=\"Depth\"\r\n minValue={1}\r\n maxValue={3}\r\n value={maxDepthValue}\r\n onChange={setMaxDepthValue}\r\n isFilled\r\n contextualHelp={\r\n \u003cContextualHelp>\r\n \u003cHeading>What is depth?\u003c/Heading>\r\n \u003cContent>\r\n Depth controls the maximum taxonomic level that is shown in the\r\n plot.\r\n \u003c/Content>\r\n \u003c/ContextualHelp>\r\n }\r\n />\r\n \u003cPlot\r\n data={data}\r\n style={{ width: '100%' }}\r\n layout={{ autosize: true }}\r\n useResizeHandler\r\n onSunburstClick={() => false}\r\n />\r\n \u003c/Flex>\r\n );\r\n}\r\n``` \r\n\r\nIn order for SSR to work properly, I'm loading the component like so (from my `pages/index.tsx`):\r\n\r\n```jsx\r\n// ...\r\nimport dynamic from 'next/dynamic';\r\n// ...\r\n\r\nconst TaxonSunburst = dynamic(import('../components/TaxonSunburst'), {\r\n ssr: false,\r\n loading: () => (\r\n \u003cFlex\r\n justifyContent=\"center\"\r\n marginY=\"size-200\"\r\n >\r\n \u003cProgressCircle\r\n aria-label=\"Loading sunburst plot\"\r\n isIndeterminate\r\n />\r\n \u003c/Flex>\r\n ),\r\n});\r\n```\r\n\r\nThe `onClick` event works properly. Also, modifying `onSunburstClick` with something like `onSunburstClick={() => alert(\"test\")}` also works. I would like to disable the default behaviour of the sunburst plots.","author":{"url":"https://github.com/mdoliv","@type":"Person","name":"mdoliv"},"datePublished":"2023-10-28T01:00:25Z","url":"https://github.com/plotly/react-plotly.js/issues/331"}
| 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:e315da3e-f1e0-6f3e-5eb0-30126d119bcc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CDD6:EA09B:518F65:6E0F16:6B00CFC3 |
| html-safe-nonce | 51b295bb8e0cf4f9da4e6e254f2b86b50cd1c69c4ce204bb2ea19f39631dc9e5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREQ2OkVBMDlCOjUxOEY2NTo2RTBGMTY6NkIwMENGQzMiLCJ2aXNpdG9yX2lkIjoiNjgyOTE4ODIzOTQyMTY1NzAyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cfed6e2f87a0d8cee762efbc7acd68b4d73723082d840ec25b172530e8494387 |
| hovercard-subject-tag | issue:1966339932 |
| 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/react-plotly.js/331/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e7cb8c8e01112d94cf2437943038c06a97cae883834cecdec5697a732021a50e/plotly/react-plotly.js/issues/331 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e7cb8c8e01112d94cf2437943038c06a97cae883834cecdec5697a732021a50e/plotly/react-plotly.js/issues/331 |
| og:image:alt | Using NextJS 13, passing onSunburstClick={() => false} to the Plot component does not disable the default behaviour of clicking in a sunburst node and zooming in to that node. The component I'm cre... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mdoliv |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85bbdfe2b6ba16e234513bc6ceff5d848ef8449820c900692a2b4e67061931e5 |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/react-plotly.js git https://github.com/plotly/react-plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 98463844 |
| octolytics-dimension-repository_nwo | plotly/react-plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 98463844 |
| octolytics-dimension-repository_network_root_nwo | plotly/react-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 | 4943239a6d2c591325dad6e5c313e1cafda877f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width