maybeZeroY.js 602 B

12345678910111213141516171819202122
  1. import { deepMix } from '@antv/util';
  2. import { inferredColumn, constant } from './utils/helper';
  3. /**
  4. * Add zero constant encode for y channel.
  5. */
  6. export const MaybeZeroY = () => {
  7. return (I, mark) => {
  8. const { encode } = mark;
  9. const { y } = encode;
  10. if (y !== undefined)
  11. return [I, mark];
  12. return [
  13. I,
  14. deepMix({}, mark, {
  15. encode: { y: inferredColumn(constant(I, 0)) },
  16. scale: { y: { guide: null } },
  17. }),
  18. ];
  19. };
  20. };
  21. MaybeZeroY.props = {};
  22. //# sourceMappingURL=maybeZeroY.js.map