1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.JitterY = void 0;
|
4 | const util_1 = require("@antv/util");
|
5 | const helper_1 = require("./utils/helper");
|
6 | const jitter_1 = require("./jitter");
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | const JitterY = (options = {}) => {
|
12 | const { padding = 0, random = Math.random } = options;
|
13 | return (I, mark) => {
|
14 | const { encode, scale } = mark;
|
15 | const { y: scaleY } = scale;
|
16 | const [Y] = (0, helper_1.columnOf)(encode, 'y');
|
17 | const rangeY = (0, jitter_1.rangeOf)(Y, scaleY, padding);
|
18 | const DY = I.map(() => (0, jitter_1.interpolate)(random(), ...rangeY));
|
19 | return [
|
20 | I,
|
21 | (0, util_1.deepMix)({ scale: { y: { padding: 0.5 } } }, mark, {
|
22 | encode: { dy: (0, helper_1.column)(DY) },
|
23 | }),
|
24 | ];
|
25 | };
|
26 | };
|
27 | exports.JitterY = JitterY;
|
28 | exports.JitterY.props = {};
|
29 |
|
\ | No newline at end of file |