lineX.js 911 B

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