Skip to content
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

Clarification for the SVG relative length normalized diagonal may be helpful #35712

Closed
herrstrietzel opened this issue Sep 3, 2024 · 2 comments · Fixed by #36023
Closed

Clarification for the SVG relative length normalized diagonal may be helpful #35712

herrstrietzel opened this issue Sep 3, 2024 · 2 comments · Fixed by #36023
Labels
Content:SVG SVG docs help wanted If you know something about this topic, we would love your help!

Comments

@herrstrietzel
Copy link

herrstrietzel commented Sep 3, 2024

MDN URL

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/r

What specific section or headline is this issue about?

"When the value is set as a percentage, it refers to the normalized diagonal of the current SVG viewport."

What information was incorrect, unhelpful, or incomplete?

I think it's helpful what "normalized diagonal" actually means and how it's calculated.

To my own surprise the W3C SVG (2 draft) spec (albeit containing suggested enhancements which may probably never be implemented) provides a very concise explanation:

For any other length value expressed as a percentage of the SVG viewport, the percentage must be calculated as a percentage of the normalized diagonal of the ‘viewBox’ applied to that viewport. If no ‘viewBox’ is specified, then the normalized diagonal of the SVG viewport must be used. The normalized diagonal length must be calculated with sqrt((width)**2 + (height)**2)/sqrt(2)

So including the calculation sqrt((width)**2 + (height)**2)/sqrt(2) might be a good idea.

What did you expect to see?

The revised paragraph may look something like this:

When the value is set as a percentage, it refers to the normalized diagonal of the current SVG viewport. The normalized diagonal is calculated like this sqrt((width)**2 + (height)**2)/sqrt(2)

Do you have any supporting links, references, or citations?

https://svgwg.org/svg2-draft/coords.html#Units

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@herrstrietzel herrstrietzel added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Sep 3, 2024
@github-actions github-actions bot added the Content:SVG SVG docs label Sep 3, 2024
@Josh-Cena

This comment was marked as outdated.

@Josh-Cena Josh-Cena added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Sep 3, 2024
@herrstrietzel
Copy link
Author

A simple solution may also to link to the respective spec https://svgwg.org/svg2-draft/coords.html#Units in the specs footer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:SVG SVG docs help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants