source: node_modules/d3-scale/src/nice.js@ e4c61dd

Last change on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Prototype 1.1

  • Property mode set to 100644
File size: 345 bytes
Line 
1export default function nice(domain, interval) {
2 domain = domain.slice();
3
4 var i0 = 0,
5 i1 = domain.length - 1,
6 x0 = domain[i0],
7 x1 = domain[i1],
8 t;
9
10 if (x1 < x0) {
11 t = i0, i0 = i1, i1 = t;
12 t = x0, x0 = x1, x1 = t;
13 }
14
15 domain[i0] = interval.floor(x0);
16 domain[i1] = interval.ceil(x1);
17 return domain;
18}
Note: See TracBrowser for help on using the repository browser.