lineY.js 911 B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.LineY = void 0;
  4. const utils_1 = require("./utils");
  5. const LineY = () => {
  6. return (index, scale, value, coordinate) => {
  7. const { y: Y } = value;
  8. const P = Array.from(index, (i) => {
  9. const p1 = [0, Y[i]];
  10. const p2 = [1, Y[i]];
  11. return [p1, p2].map((d) => coordinate.map(d));
  12. });
  13. return [index, P];
  14. };
  15. };
  16. exports.LineY = LineY;
  17. const shapes = ['line'];
  18. exports.LineY.props = {
  19. defaultShape: 'line',
  20. defaultLabelShape: 'label',
  21. composite: false,
  22. channels: [
  23. ...(0, utils_1.baseAnnotationChannels)({ shapes }),
  24. { name: 'y', required: true },
  25. ],
  26. preInference: [...(0, utils_1.basePreInference)(), { type: 'maybeTupleY' }],
  27. postInference: [...(0, utils_1.basePostInference)()],
  28. };
  29. //# sourceMappingURL=lineY.js.map