808 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.MaybeZeroX = void 0;
4const util_1 = require("@antv/util");
5const helper_1 = require("./utils/helper");
6/**
7 * Add zero constant encode for x channel.
8 * This is useful for interval geometry.
9 */
10const MaybeZeroX = () => {
11 return (I, mark) => {
12 const { encode } = mark;
13 const { x } = encode;
14 if (x !== undefined)
15 return [I, mark];
16 return [
17 I,
18 (0, util_1.deepMix)({}, mark, {
19 encode: { x: (0, helper_1.inferredColumn)((0, helper_1.constant)(I, 0)) },
20 scale: { x: { guide: null } },
21 }),
22 ];
23 };
24};
25exports.MaybeZeroX = MaybeZeroX;
26exports.MaybeZeroX.props = {};
27//# sourceMappingURL=maybeZeroX.js.map
\No newline at end of file