-
Notifications
You must be signed in to change notification settings - Fork 185
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
Rounded corners on rect, but only for some corners #2054
Comments
Thinking about this has sent me into a rabbit hole. Two issues:
But there might be future use cases (some we already have in mind) where the element we create is completely different: what if, for example, if we want bars that follow a radial coordinate system (#133). (Or even, marks that are rendered with the same visual logic but using canvas instead of SVG…) So, while we can implement this with a simple test like [1] I'd want an explicit rh: 0 to opt-in to a svg:path, in order to make it possible to transition from rh=0 to rh=5 without discontinuity. |
Hmm, one possibility is an ry2 option that rounds the corners corresponding to the y2 edge. Then you could have similar options ry1, rx1, rx2 for the other sides — but you’d have to define which side takes precedence since the sides would compete for the corners. Another possibility is separate radii for each corner, like CSS does for Complicated! |
I'm going to give up on that one, because a clean generalization with all the possibilities is just too much work — too many "corner" cases, for a limited usage. Instead let's create examples to show how to use a render transform? For instance: https://observablehq.com/@observablehq/dog-eared-bars (although the implementation is not optimal since it creates rects then discards them… I find it easier that way). |
As originally suggested in #1201, this is a common request, and the workaround isn’t always feasible (for example with diverging bars).
The text was updated successfully, but these errors were encountered: