I'm trying to round off values for the d3 scale() function. The nice() function works well for the ending domain value. However, I'm trying to find a way to round off the beginning domain value.
For example,
Say my y values are the following: [-80, 20, 197]
d3.scale() -> [-50, 0, 50, 100, 150]
d3.scale().nice() -> [-50, 0, 50, 100, 150, 200]
However what I would like it to be would be this:
[-100, -50, 0, 50, 100, 150, 200]
Does anyone know if there is an implementation for this? None of the examples I see for d3 really deal with negative numbers.
Thanks
- Jeff