1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var math_1 = require("../util/math");
|
4 | var pretty_1 = require("../util/pretty");
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | function calculatePowTicks(cfg) {
|
11 | var exponent = cfg.exponent, tickCount = cfg.tickCount;
|
12 | var max = Math.ceil(math_1.calBase(exponent, cfg.max));
|
13 | var min = Math.floor(math_1.calBase(exponent, cfg.min));
|
14 | var ticks = pretty_1.default(min, max, tickCount).ticks;
|
15 | return ticks.map(function (tick) {
|
16 | var factor = tick >= 0 ? 1 : -1;
|
17 | return Math.pow(tick, exponent) * factor;
|
18 | });
|
19 | }
|
20 | exports.default = calculatePowTicks;
|
21 |
|
\ | No newline at end of file |