( domain: [number, number], count = 5 )
| 156 | }; |
| 157 | |
| 158 | export const niceNumericDomain = ( |
| 159 | domain: [number, number], |
| 160 | count = 5 |
| 161 | ): [number, number] => { |
| 162 | const [min, max] = domain; |
| 163 | const step = tickStep(min, max, count); |
| 164 | |
| 165 | if (step === 0) { |
| 166 | return expandDegenerateDomain(domain); |
| 167 | } |
| 168 | |
| 169 | return [Math.floor(min / step) * step, Math.ceil(max / step) * step]; |
| 170 | }; |
no test coverage detected