1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.d3LogNice = void 0;
|
4 | const log_1 = require("./log");
|
5 | const d3LogNice = (a, b, _, base) => {
|
6 | const shouldReflect = a < 0;
|
7 | const log = (0, log_1.logs)(base, shouldReflect);
|
8 | const pow = (0, log_1.pows)(base, shouldReflect);
|
9 | const r = a > b;
|
10 | const min = r ? b : a;
|
11 | const max = r ? a : b;
|
12 | const niceDomain = [pow(Math.floor(log(min))), pow(Math.ceil(log(max)))];
|
13 | return r ? niceDomain.reverse() : niceDomain;
|
14 | };
|
15 | exports.d3LogNice = d3LogNice;
|
16 |
|
\ | No newline at end of file |