-
Notifications
You must be signed in to change notification settings - Fork 125
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
Consider using text-anchor for right-aligned strings #247
Comments
I agree, that seems like a good change! Any takers? I think CSS should be fine here, although we do need to make sure that SVG supports all the relevant CSS constructs (I don't know that SVGs have "full" CSS support). |
|
This was proposed by `@nagisa` in jonhoo#247, I just applied the suggestions, tested that the result was as expected. I tried the suggestion of `dominant-baseline="hanging"`, but it will need further work to make it usefull as applying instead will just increase the size of the css without reducing enough in the SVG. Co-authored-by: Simonas Kazlauskas <git@kazlauskas.me> Fixes jonhoo#247
This was proposed by `@nagisa` in jonhoo#247, I just applied the suggestions, tested that the result was as expected. I tried the suggestion of `dominant-baseline="hanging"`, but it will need further work to make it usefull as applying instead will just increase the size of the css without reducing enough in the SVG. Co-authored-by: Simonas Kazlauskas <git@kazlauskas.me> Fixes jonhoo#247
I’ve used a somewhat modified version of the
inferno
crate to construct flamegraphs for a blog post of mine. I have made a couple of changes that I think some contributor here may be interested in implementing properly in the project proper.The flamegraph has two strings that are expected to be aligned to the right side of the image: the “Search”/“Reset search” at the top and “Matched: 42%” at the bottom. Right now they are aligned by giving the 100px of “space” from the side, which can fail to fit the string if the font size is increased or a wider font is used.
Instead consider using a
text-anchor: end
and placing the text node at a constant location where the strings should end:I have used CSS here to specify this attribute, but specifying it as a proper SVG attribute may make more sense if these flamegraphs are intended to work without CSS present.
The text was updated successfully, but these errors were encountered: