1 | "use strict";
|
2 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7 | };
|
8 | var Sequential_1;
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | exports.Sequential = void 0;
|
11 | const util_1 = require("@antv/util");
|
12 | const d3_ticks_1 = require("../tick-methods/d3-ticks");
|
13 | const utils_1 = require("../utils");
|
14 | const linear_1 = require("./linear");
|
15 | function rangeOf(interpolator) {
|
16 | return [interpolator(0), interpolator(1)];
|
17 | }
|
18 | const normalizeDomain = (domain) => {
|
19 | const [d0, d1] = domain;
|
20 |
|
21 | const normalize = (0, utils_1.compose)((0, utils_1.createInterpolateNumber)(0, 1), (0, utils_1.createNormalize)(d0, d1));
|
22 | return normalize;
|
23 | };
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | let Sequential = Sequential_1 = class Sequential extends linear_1.Linear {
|
31 | getDefaultOptions() {
|
32 | return {
|
33 | domain: [0, 1],
|
34 | unknown: undefined,
|
35 | nice: false,
|
36 | clamp: false,
|
37 | round: false,
|
38 | interpolator: util_1.identity,
|
39 | tickMethod: d3_ticks_1.d3Ticks,
|
40 | tickCount: 5,
|
41 | };
|
42 | }
|
43 | constructor(options) {
|
44 | super(options);
|
45 | }
|
46 | clone() {
|
47 | return new Sequential_1(this.options);
|
48 | }
|
49 | };
|
50 | Sequential = Sequential_1 = __decorate([
|
51 | (0, utils_1.interpolatize)(rangeOf, normalizeDomain)
|
52 | ], Sequential);
|
53 | exports.Sequential = Sequential;
|
54 |
|
\ | No newline at end of file |