autoHeight factors in the auto and manual margins. - #1058
Merged
Merged
Conversation
Fil
force-pushed
the
fil/autoheight-margins
branch
from
September 27, 2022 10:34
a073a1e to
b5efb4f
Compare
Fil
force-pushed
the
fil/autoheight-margins
branch
2 times, most recently
from
September 27, 2022 15:00
2e75707 to
d9da57e
Compare
enjalot
approved these changes
Sep 27, 2022
mbostock
requested changes
Sep 27, 2022
Contributor
Author
|
🙏 it's easier to read this way! |
mbostock
reviewed
Nov 27, 2022
Comment on lines
+16
to
+20
| marginTopAuto = Math.max((xAxis === "top" ? 30 : 0) + facetMarginTop, yAxis || fyAxis ? 20 : 0.5 - offset), | ||
| marginBottomAuto = Math.max((xAxis === "bottom" ? 30 : 0) + facetMarginBottom, yAxis || fyAxis ? 20 : 0.5 + offset), |
Member
There was a problem hiding this comment.
We shouldn’t implement it this way; it allows a user to change the behavior of Plot by specifying these undocumented marginTopAuto and marginBottomAuto options. Instead we’ll have to restructure the code so that these are local variables to the function.
Co-authored-by: Mike Bostock <mbostock@gmail.com>
mbostock
force-pushed
the
fil/autoheight-margins
branch
from
November 27, 2022 17:16
b40202f to
ff478a3
Compare
mbostock
approved these changes
Nov 27, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See https://observablehq.com/@observablehq/plot-band-scale-bug-1045
fixes #1045
Note: this is the least disruptive I could do; but it becomes a bit complicated to understand, as we need to compute what the default margins would have been, and add the difference.
(includes #1059, in order to pass CI)
See also #837