Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6890
Breakdown of the fix:
ax._depth
is not calculated properly in thestandoff
conditional:plotly.js/src/plots/cartesian/axes.js
Lines 2647 to 2651 in 5025fbc
Lots of positioning calculations rely on that
getLabelLevelBbox()
which, bypassing the cache, is this:The issue being the
else
branch, where we have no ticklabels on which to loop. We shouldn't return0
asnull
-0
is a legitimate coordinate and will fool consumers. Instead, if we accept that an empty bounding box still has a position, but with a width and height of 0, we can calculate said position (where the ticklabel would be) and return a bounding box with no width or height. That's what I do in the fix usingmakeLabelFns()
, and it seems to work well.plotly.js/src/plots/cartesian/axes.js
Lines 2900 to 2902 in 236e9a3
Let's see if these initial commits past the tests. Probably get rid of the mocks?