-
Notifications
You must be signed in to change notification settings - Fork 185
fix frameanchor bottom #1061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix frameanchor bottom #1061
Conversation
fa9320b
to
4e8dffa
Compare
), | ||
Plot.text(["Count of penguins\ngrouped by species\n and colored by sex"], { | ||
frameAnchor: "bottom-right", | ||
dx: -3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the image, wouldn't it be nicer if dx was a positive number to avoid the overlap with the bar?
i guess that's a bit fiddly, could we right align the text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when i download the svg and remove .plot tspan { white-space: pre; }
it fixes the text anchor end issue.
i'm not seeing line-height or dx on the text marks in the svg though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line-height becomes the various tspan elements' y attributes; and dx is factored in the x attribute of the text element.
Apparently the faulty views are caused by the pretty formatting of the svg with beautify.html in
Line 19 in 86789eb
const actual = beautify.html(root.outerHTML, {indent_size: 2}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This side-effect of testing will be fixed after #1062.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it's looking good. Thanks @enjalot for catching this!
…tain tspans. These result in unreliable positioning. See #1061 (comment)
…tain tspans. (#1062) These result in unreliable positioning. See #1061 (comment)
…ame, not one line below closes #1043
4e8dffa
to
4fcf7dd
Compare
…o ignore them from the domain as well.
This PR broke the alignment of labels on scatterplots. Here is a frameAnchor of top: The frameAnchor of bottom is supposed to be symmetric, with the baseline of the text touching the anchor: This PR shifts the bottom anchor by 1.29 lines, resulting in dots that are significantly farther away than intended by the anchor: Perhaps the problem in #1043 is specific to multiline text. I will investigate but we should revert this and apply a different fix. |
…tain tspans. (#1062) These result in unreliable positioning. See observablehq/plot#1061 (comment)
…tain tspans. (#1062) These result in unreliable positioning. See observablehq/plot#1061 (comment)
…tain tspans. (#1062) These result in unreliable positioning. See observablehq/plot#1061 (comment)
closes #1043