Title: Add more consistent padding config to components · Issue #985 · plotly/plotly.js · GitHub
Open Graph Title: Add more consistent padding config to components · Issue #985 · plotly/plotly.js
X Title: Add more consistent padding config to components · Issue #985 · plotly/plotly.js
Description: The problem: components are positioned in fractional coordinates, but axis labels take up a fixed amount of space relative to the screen. This makes it effectively impossible to create a consistent amount of padding between the plot and ...
Open Graph Description: The problem: components are positioned in fractional coordinates, but axis labels take up a fixed amount of space relative to the screen. This makes it effectively impossible to create a consistent...
X Description: The problem: components are positioned in fractional coordinates, but axis labels take up a fixed amount of space relative to the screen. This makes it effectively impossible to create a consistent...
Opengraph URL: https://github.com/plotly/plotly.js/issues/985
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add more consistent padding config to components","articleBody":"**The problem**: components are positioned in fractional coordinates, but axis labels take up a fixed amount of space relative to the screen. This makes it effectively impossible to create a consistent amount of padding between the plot and the labels when the plot size is changed. At the moment there seems to be some `xpad` and `ypad` attributes, but I think it needs to be more complete and consistent.\n\n**A solution**: I propose adding a common `padding: {t: ..., r: ..., b: ..., l: ...}` attribute to most components. Ideally the logic could be hoisted up a level and DRYd up, but realistically, I feel like all components might just have to implement this positioning themselves. The result though is that it would be possible to carefully and precisely align components. This approach is consistent with what most people would probably expect based on html experience and is backward compatible if it defaults to zeros. Together with fractional positioning, I feel like you could at least get _way_ closer to a satisfying layout.\n\n**Note**: I'm running into this quite a bit as I try to align multiple components in an aesthetically pleasing way and trying to line up a slider with buttons is turning out to be particularly painful. Padding would instantly solve this.\n\n**Example**: With identical config (apart from the size) that uses fractional padding to clear the axis labels, the small plot has a nice amount of space between the axis and the controls; the large plot has way too much space. http://codepen.io/rsreusser/pen/NRgbJy?editors=0010\n\n\u003cimg width=\"799\" alt=\"screen shot 2016-09-27 at 23 28 13\" src=\"https://cloud.githubusercontent.com/assets/572717/18899871/22b5aaa6-850a-11e6-8d57-5154d00758d1.png\">\n","author":{"url":"https://github.com/rreusser","@type":"Person","name":"rreusser"},"datePublished":"2016-09-28T03:28:00Z","url":"https://github.com/plotly/plotly.js/issues/985"}
| 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:9409d769-d972-0e9c-c333-ea273ef54d79 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C8DC:2454CC:3F710C4:506F8C0:6B021A67 |
| html-safe-nonce | 9c5f1809c9e830433df40a8ba00674b8df6ee33021ae8705dc8e35a47c84fde6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOERDOjI0NTRDQzozRjcxMEM0OjUwNkY4QzA6NkIwMjFBNjciLCJ2aXNpdG9yX2lkIjoiMzMxNzU1NDQyNjIzOTEzMDIxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5473006a2635c502fcbed531a3536ecdd02bb4bc9165987bc99156ee1b9917ad |
| hovercard-subject-tag | issue:179671962 |
| 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/985/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ad5249fd6fa6f4df2c84afeb5eedab20714d58564c50339973030c4857744722/plotly/plotly.js/issues/985 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ad5249fd6fa6f4df2c84afeb5eedab20714d58564c50339973030c4857744722/plotly/plotly.js/issues/985 |
| og:image:alt | The problem: components are positioned in fractional coordinates, but axis labels take up a fixed amount of space relative to the screen. This makes it effectively impossible to create a consistent... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rreusser |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width