Title: Implement `scaleanchor` domain constraints on matching axes · Issue #3539 · plotly/plotly.js · GitHub
Open Graph Title: Implement `scaleanchor` domain constraints on matching axes · Issue #3539 · plotly/plotly.js
X Title: Implement `scaleanchor` domain constraints on matching axes · Issue #3539 · plotly/plotly.js
Description: follow-up issue from #3506 where matches and scaleanchor constraints on the same axes are disallowed. Pasting some of @alexcjohnson 's comment on the topic here: #3506 (comment) yeah, that one has some problems... looks like after a zoom...
Open Graph Description: follow-up issue from #3506 where matches and scaleanchor constraints on the same axes are disallowed. Pasting some of @alexcjohnson 's comment on the topic here: #3506 (comment) yeah, that one has ...
X Description: follow-up issue from #3506 where matches and scaleanchor constraints on the same axes are disallowed. Pasting some of @alexcjohnson 's comment on the topic here: #3506 (comment) yeah, that one ...
Opengraph URL: https://github.com/plotly/plotly.js/issues/3539
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Implement `scaleanchor` domain constraints on matching axes","articleBody":"follow-up issue from https://github.com/plotly/plotly.js/pull/3506 where `matches` and `scaleanchor` constraints on the same axes are disallowed.\r\n\r\nPasting some of @alexcjohnson 's comment on the topic here:\r\n\r\n-----------\r\n\r\nhttps://github.com/plotly/plotly.js/pull/3506#issuecomment-459966778\r\n\r\nyeah, that one has some problems... looks like after a zoom/pan it manages to satisfy all the constraints (the very shrunken subplots I think are correct), but initially or after an autorange it does not.\r\n\r\n\r\nHere's a more extreme example. Kind of a pathological case, where each subplot has x&y matching, and the x of each subplot is supposed to scale with the y of the previous... this is the case I think compounds height/width differences, so it should be expected that either the first or last subplot gets its data very compressed if you stretch it to a very non-square size. Right now it appears to apply all the `scaleanchor` constraints, but all the `matches` constraints except the last are lost.\r\n\u003cimg width=\"462\" alt=\"screen shot 2019-02-02 at 8 22 00 am\" src=\"https://user-images.githubusercontent.com/2678795/52164706-a332bb80-26c3-11e9-8171-58872d2154e1.png\">\r\n```js\r\nPlotly.newPlot(gd,[\r\n {y:[1,2]},\r\n {y:[1,2],xaxis:'x2',yaxis:'y2'},\r\n {y:[1,2],xaxis:'x3',yaxis:'y3'},\r\n {y:[1,2],xaxis:'x4',yaxis:'y4'}\r\n], {\r\n yaxis: {matches: 'x'},\r\n xaxis2: {scaleanchor: 'y'},\r\n yaxis2: {matches: 'x2'},\r\n xaxis3: {scaleanchor: 'y2'},\r\n yaxis3: {matches: 'x3'},\r\n xaxis4: {scaleanchor: 'y3'},\r\n yaxis4: {matches: 'x4'},\r\n grid: {rows: 2, columns: 2, pattern: 'independent'},\r\n width: 500,\r\n height: 400\r\n})\r\n```\r\n\r\nI haven't looked at your code in detail yet, but in order to satisfy this kind of chained constraints seems to me it may be necessary to generate `scaleanchor` constraints based on each `matches` constraint (using `gs._w` and `gs._h`) and use that to run through the `scaleanchor` algorithm, and only after that apply the `matches` constraints explicitly.\r\n\r\n-----\r\n\r\nFrom a private slack convo:\r\n\r\nalso re: matches and scaleanchor constraints with different target axes - the mock I set up has two separate constraints on each axis (except the ends of the chain). My comment “the only allowed values of scaleanchor would be ‘x’ or nothing.” was about a single constraint, ie the constraint defined within one axis’s attributes. If you’ve already said `yaxis.matches: 'x'`it wouldn’t make sense to say `yaxis.scaleanchor: 'x2'` because that would be setting up a completely different constraint. But it should still be OK to say `xaxis2.scaleanchor: 'y'`. After you’ve already provided `matches` it seemed to me the only purpose of `scaleanchor` is “do you also want to constrain the scale along with the matching constraint”","author":{"url":"https://github.com/etpinard","@type":"Person","name":"etpinard"},"datePublished":"2019-02-12T18:32:17Z","url":"https://github.com/plotly/plotly.js/issues/3539"}
| 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:2a0f8cd3-de2a-72de-a690-ac12b02ebfb4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E92C:3E4205:226C6B5:2E08523:6B0193EF |
| html-safe-nonce | dca170984b8740e1fa0b9421f4d632365647a2e47e33c854e8af5448ecc68a26 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTJDOjNFNDIwNToyMjZDNkI1OjJFMDg1MjM6NkIwMTkzRUYiLCJ2aXNpdG9yX2lkIjoiNjQwNTYzOTIzMjA3MjgxNTU5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 47fa17e1f44f8709a84fe810acc892227184168c794c163616e85c3b7da497e7 |
| hovercard-subject-tag | issue:409440742 |
| 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/3539/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f8ef7cb4849b4fbd62c17386a5605e4d56fce4a0a55ba27f2a7a0137372b251a/plotly/plotly.js/issues/3539 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f8ef7cb4849b4fbd62c17386a5605e4d56fce4a0a55ba27f2a7a0137372b251a/plotly/plotly.js/issues/3539 |
| og:image:alt | follow-up issue from #3506 where matches and scaleanchor constraints on the same axes are disallowed. Pasting some of @alexcjohnson 's comment on the topic here: #3506 (comment) yeah, that one has ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | etpinard |
| 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