UNPKG

593 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.d3LogNice = void 0;
4const log_1 = require("./log");
5const 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};
15exports.d3LogNice = d3LogNice;
16//# sourceMappingURL=d3-log-nice.js.map
\No newline at end of file