1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.MaybeStackY = void 0;
|
4 | const stackY_1 = require("./stackY");
|
5 |
|
6 |
|
7 |
|
8 | function exclude(transform) {
|
9 | const { type } = transform;
|
10 | const excludes = ['stackY', 'dodgeX', 'groupX'];
|
11 | return typeof type === 'string' && excludes.includes(type);
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | const MaybeStackY = (options) => {
|
18 | return (I, mark, context) => {
|
19 |
|
20 | const { encode, transform = [] } = mark;
|
21 | if (transform.some(exclude))
|
22 | return [I, mark];
|
23 |
|
24 | const { x, y } = encode;
|
25 | if (x === undefined || y === undefined)
|
26 | return [I, mark];
|
27 | const { series } = options;
|
28 | const groupBy = series ? ['x', 'series'] : 'x';
|
29 | return (0, stackY_1.StackY)({ groupBy })(I, mark, context);
|
30 | };
|
31 | };
|
32 | exports.MaybeStackY = MaybeStackY;
|
33 | exports.MaybeStackY.props = {};
|
34 |
|
\ | No newline at end of file |