Title: `alignmentgroup` & `offsetgroup` restyle bug · Issue #6415 · plotly/plotly.js · GitHub
Open Graph Title: `alignmentgroup` & `offsetgroup` restyle bug · Issue #6415 · plotly/plotly.js
X Title: `alignmentgroup` & `offsetgroup` restyle bug · Issue #6415 · plotly/plotly.js
Description: @archmoj this looks great! There's one piece I don't understand: if I load `zz-scatter-grouping-vs-defaults`, then clear all the `alignmentgroup` attrs - `Plotly.restyle(gd,'alignmentgroup',null)` - then the traces in the upper right sub...
Open Graph Description: @archmoj this looks great! There's one piece I don't understand: if I load `zz-scatter-grouping-vs-defaults`, then clear all the `alignmentgroup` attrs - `Plotly.restyle(gd,'alignmentgroup',null)` ...
X Description: @archmoj this looks great! There's one piece I don't understand: if I load `zz-scatter-grouping-vs-defaults`, then clear all the `alignmentgroup` attrs - `Plotly.restyle(gd,'alignmentgr...
Opengraph URL: https://github.com/plotly/plotly.js/issues/6415
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`alignmentgroup` & `offsetgroup` restyle bug","articleBody":" @archmoj this looks great! There's one piece I don't understand: if I load `zz-scatter-grouping-vs-defaults`, then clear all the `alignmentgroup` attrs - `Plotly.restyle(gd,'alignmentgroup',null)` - then the traces in the upper right subplot disappear. They also disappear if I set the `alignmentgroup` for just those two traces to `'bottom'` to match the ones below - `Plotly.restyle(gd,'alignmentgroup','bottom', [3,9])`.\r\n\r\nIf I also clear `offsetgroup` they come back, and if I set the `offsetgroup` for those two to something explicit they get their own group.\r\n\r\nSo I guess the odd case is when `alignmentgroup` is either all `null` or all the same but one trace, in a different subplot from the others, doesn't have an `offsetgroup`.\r\n\r\nThere's a related case that's clearly broken: in the same mock, if I just clear `offsetgroup` for the last trace it stays where it was. But if I first give it a new `offsetgroup` (so it correctly gets new space) and THEN clear it, it gets pushed into the next group!\r\n```js\r\nPlotly.restyle(gd, 'offsetgroup', null, 11) // clear the group for the last trace, this is OK\r\n```\r\n\u003cimg width=\"483\" alt=\"Screenshot 2022-12-20 at 19 24 03\" src=\"https://user-images.githubusercontent.com/2678795/208792202-61086219-8a89-4404-a931-cad26985eb41.png\">\r\n\r\n```js\r\nPlotly.restyle(gd, 'offsetgroup', '3', 11) // put it in a new group\r\nPlotly.restyle(gd, 'offsetgroup', null, 11) // clear its group\r\n```\r\n\u003cimg width=\"493\" alt=\"Screenshot 2022-12-20 at 19 18 43\" src=\"https://user-images.githubusercontent.com/2678795/208792108-9f98013d-b3c3-4e32-89b7-d5a5bcb8ab7b.png\">\r\n\r\nI don't think this is unique to scatter, I can get a similar history-dependent errors from bars from setting / clearing the `offsetgroup` of the FIRST bar in the bottom right subplot (ie replace the 11 with 4 in those commands). Maybe we just treat `null` as its own `offsetgroup` if there are other traces with an `offsetgroup` on the same axis?\r\n\r\n_Originally posted by @alexcjohnson in https://github.com/plotly/plotly.js/issues/6381#issuecomment-1360562317_\r\n ","author":{"url":"https://github.com/archmoj","@type":"Person","name":"archmoj"},"datePublished":"2022-12-21T14:33:01Z","url":"https://github.com/plotly/plotly.js/issues/6415"}
| 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:b1ecadfb-1577-5163-1979-58ff2e4af4f7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 865A:14ECB:2B5955E:3721D6B:6B01AE9E |
| html-safe-nonce | 6e1b85ae055a77da39067853274b8fe218bd786e821b1738b138b1dcc817e5fa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjVBOjE0RUNCOjJCNTk1NUU6MzcyMUQ2Qjo2QjAxQUU5RSIsInZpc2l0b3JfaWQiOiI0MTQxNDI4MDYyNDEzNzYyMjA2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 49e67a3d8e1b022906a758be2444fc9758f85a552d72e265b19c3502bbbbc6cc |
| hovercard-subject-tag | issue:1506397090 |
| 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/6415/issue_layout |
| twitter:image | https://opengraph.githubassets.com/097d1815eee43adb97c147930e95d30e654157e44be5b653be010e2b94e25105/plotly/plotly.js/issues/6415 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/097d1815eee43adb97c147930e95d30e654157e44be5b653be010e2b94e25105/plotly/plotly.js/issues/6415 |
| og:image:alt | @archmoj this looks great! There's one piece I don't understand: if I load `zz-scatter-grouping-vs-defaults`, then clear all the `alignmentgroup` attrs - `Plotly.restyle(gd,'alignmentgroup',null)` ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | archmoj |
| 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