d3-shape icon indicating copy to clipboard operation
d3-shape copied to clipboard

selected rounding of corners in arc

Open murtada58 opened this issue 2 years ago • 2 comments

Allow rounding of individual corners by passing in an array instead of a number following CSS border radius conventions for which corners get rounded if array has less than 4 numbers and backwards compatible with old method of passing in a single number which will round all 4 corners

murtada58 avatar Mar 16 '22 02:03 murtada58

Nice! A detail: since the original code is coercing rc to a number, you my want to use Array.isArray to detect the new use case, and fall back to rc = +rc if not an array, so as not to introduce a breaking change for users who might be (inadvertently) calling cornerRadius("10").

This would also need documentation and an example.

Fil avatar Mar 16 '22 07:03 Fil

I've updated the readme with an example now, let me know if there is anything else :)

murtada58 avatar Mar 16 '22 14:03 murtada58