1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.Log = void 0;
|
4 | const continuous_1 = require("./continuous");
|
5 | const utils_1 = require("../utils");
|
6 | const d3_log_1 = require("../tick-methods/d3-log");
|
7 | const d3_log_nice_1 = require("../utils/d3-log-nice");
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | class Log extends continuous_1.Continuous {
|
14 | getDefaultOptions() {
|
15 | return {
|
16 | domain: [1, 10],
|
17 | range: [0, 1],
|
18 | base: 10,
|
19 | interpolate: utils_1.createInterpolateValue,
|
20 | tickMethod: d3_log_1.d3Log,
|
21 | tickCount: 5,
|
22 | };
|
23 | }
|
24 | chooseNice() {
|
25 | return d3_log_nice_1.d3LogNice;
|
26 | }
|
27 | getTickMethodOptions() {
|
28 | const { domain, tickCount, base } = this.options;
|
29 | const min = domain[0];
|
30 | const max = domain[domain.length - 1];
|
31 | return [min, max, tickCount, base];
|
32 | }
|
33 | chooseTransforms() {
|
34 | const { base, domain } = this.options;
|
35 | const shouldReflect = domain[0] < 0;
|
36 | return [(0, utils_1.logs)(base, shouldReflect), (0, utils_1.pows)(base, shouldReflect)];
|
37 | }
|
38 | clone() {
|
39 | return new Log(this.options);
|
40 | }
|
41 | }
|
42 | exports.Log = Log;
|
43 |
|
\ | No newline at end of file |