| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
I left some syntax and refactoring comments, but this looks good.
Sorry, something went wrong.
Co-authored-by: Cameron DeCoster <cameron.decoster@gmail.com>
|
@emilykl Whereas this is potentially a breaking change for users, I'm wondering if you are going to revert this PR and introduce this change in v4? |
Sorry, something went wrong.
|
IMO the previous behavior was a bug, and it's unlikely anyone depends on it, so I think including it now is the right call. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #2001
Adds a step during bar calc to add extra padding to axis range if bar has outside text labels.
Note: The first commit in this PR is just formatting changes. Use this diff to skip the first commit and see only the meaningful changes.
Codepen here! https://codepen.io/emilykl-code/pen/JoXQqLL
This is a stopgap fix for the fact that text labels are not taken into account during autorange calculations (see #2000).
Unfortunately, as discussed in that issue, modifying autorange to account for text labels is a significant amount of work, so I've opted for a more limited fix to address the issue identified in #2001.
Changes in this PR:
Screenshots
Before:

After:

hist_stacked mock (with cliponaxis: false removed) Before:

hist_stacked mock (with cliponaxis: false removed) After:

Steps for testing
Use the following mock:
{ "data": [ { "type": "bar", "orientation": "v", "x": ["A", "B", "C"], "y": [100, 250, -95], "base": [100, 100, 100], "texttemplate": "%{y}<br>units", "textposition": "outside", }, ], "layout": { } }Verify that it looks like the "before" picture on master and the "after" picture on this branch.
Other variations to test:
You can also load the hist_stacked mock in the devtools as another test case.