-
Notifications
You must be signed in to change notification settings - Fork 290
Open
Description
When I'm making scatter plots (and others), I find myself padding the scale's domain by the pixel radius of my circles to avoid them overlapping with the y-axis. I specify the number of pixels I want to increase on the left and right side of the domain, use the scale's inverse to add or subtract that amount from the domain and use that result to reset it.
I made a convenience function to do this and was curious if you would want a PR if this seems like useful functionality.
The api could be something like:
scaleLinear()
.domain([0, 100])
.range([0, 200])
.padDomain([10, 10])
// new domain is [-5, 105]
[edited for better order of operations in the API example]
aubergene, jimousse, nonmetalhail, aizotov, techniq and 2 more
Metadata
Metadata
Assignees
Labels
No labels