maybeSeries.js 741 B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.MaybeSeries = void 0;
  4. const util_1 = require("@antv/util");
  5. const helper_1 = require("./utils/helper");
  6. /**
  7. * Assume color channel is series channel.
  8. */
  9. const MaybeSeries = () => {
  10. return (I, mark) => {
  11. const { encode } = mark;
  12. const { series, color } = encode;
  13. if (series !== undefined || color === undefined)
  14. return [I, mark];
  15. const [C, fc] = (0, helper_1.columnOf)(encode, 'color');
  16. return [I, (0, util_1.deepMix)({}, mark, { encode: { series: (0, helper_1.column)(C, fc) } })];
  17. };
  18. };
  19. exports.MaybeSeries = MaybeSeries;
  20. exports.MaybeSeries.props = {};
  21. //# sourceMappingURL=maybeSeries.js.map