1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.MaybeTuple = void 0;
|
4 | const util_1 = require("@antv/util");
|
5 | const helper_1 = require("./utils/helper");
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | const MaybeTuple = () => {
|
11 | return (I, mark) => {
|
12 | const { data } = mark;
|
13 | if (!Array.isArray(data) || data.some(helper_1.isObject))
|
14 | return [I, mark];
|
15 | const position = Array.isArray(data[0]) ? data : [data];
|
16 | const X = position.map((d) => d[0]);
|
17 | const Y = position.map((d) => d[1]);
|
18 | return [I, (0, util_1.deepMix)({}, mark, { encode: { x: (0, helper_1.column)(X), y: (0, helper_1.column)(Y) } })];
|
19 | };
|
20 | };
|
21 | exports.MaybeTuple = MaybeTuple;
|
22 | exports.MaybeTuple.props = {};
|
23 |
|
\ | No newline at end of file |