You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
446 B
12 lines
446 B
import { logs, pows } from './log';
|
|
export const d3LogNice = (a, b, _, base) => {
|
|
const shouldReflect = a < 0;
|
|
const log = logs(base, shouldReflect);
|
|
const pow = pows(base, shouldReflect);
|
|
const r = a > b;
|
|
const min = r ? b : a;
|
|
const max = r ? a : b;
|
|
const niceDomain = [pow(Math.floor(log(min))), pow(Math.ceil(log(max)))];
|
|
return r ? niceDomain.reverse() : niceDomain;
|
|
};
|
|
//# sourceMappingURL=d3-log-nice.js.map
|