|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
422 bytes
|
| Line | |
|---|
| 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.default = nice;
|
|---|
| 7 | function nice(domain, interval) {
|
|---|
| 8 | domain = domain.slice();
|
|---|
| 9 | var i0 = 0,
|
|---|
| 10 | i1 = domain.length - 1,
|
|---|
| 11 | x0 = domain[i0],
|
|---|
| 12 | x1 = domain[i1],
|
|---|
| 13 | t;
|
|---|
| 14 | if (x1 < x0) {
|
|---|
| 15 | t = i0, i0 = i1, i1 = t;
|
|---|
| 16 | t = x0, x0 = x1, x1 = t;
|
|---|
| 17 | }
|
|---|
| 18 | domain[i0] = interval.floor(x0);
|
|---|
| 19 | domain[i1] = interval.ceil(x1);
|
|---|
| 20 | return domain;
|
|---|
| 21 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.