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

Suggestion: set radius using 'npc' rather than 'pt' #4

Open
zerogetsamgow opened this issue Feb 16, 2024 · 0 comments
Open

Suggestion: set radius using 'npc' rather than 'pt' #4

zerogetsamgow opened this issue Feb 16, 2024 · 0 comments

Comments

@zerogetsamgow
Copy link

Using radius = unit(...,"npc") rather than radius = unit(...,"pt") would result in more stable and intuitive charting.

"npc" is normalised parent coordinates. So, setting radius = radius = unit(...,"npc") creates a column with a perfectly rounded top - the radius is half the width of the column (the `parent').

Better still unit could be set to accept values from 0 to 1 and this value is passed to unit internally to normalize over values of
unit(0/2,"npc") - a rectangle with no rounding - to unit(1/2,"npc") - a column with a perfectly round top. Limiting values in this way prevents columns with "wings" at the top that result from values like unit(>1/2,"npc") or unit("a large number"1/2,"pt").

I am using this approach for a wrapper function we use internally to my organisation to match our style guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant