1 | import { calBase } from '../util/math';
|
2 | import pretty from '../util/pretty';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export default function calculatePowTicks(cfg) {
|
9 | var exponent = cfg.exponent, tickCount = cfg.tickCount;
|
10 | var max = Math.ceil(calBase(exponent, cfg.max));
|
11 | var min = Math.floor(calBase(exponent, cfg.min));
|
12 | var ticks = pretty(min, max, tickCount).ticks;
|
13 | return ticks.map(function (tick) {
|
14 | var factor = tick >= 0 ? 1 : -1;
|
15 | return Math.pow(tick, exponent) * factor;
|
16 | });
|
17 | }
|
18 |
|
\ | No newline at end of file |