-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrangeY.ts
33 lines (29 loc) · 831 Bytes
/
rangeY.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { MarkComponent as MC } from '../runtime';
import { RangeYMark } from '../spec';
import { RangeShape } from '../shape';
import { MaybeDefaultY } from '../transform';
import {
baseAnnotationChannels,
basePostInference,
basePreInference,
} from './utils';
import { AbstractRange } from './range';
const shape = {
range: RangeShape,
};
export type RangeYOptions = Omit<RangeYMark, 'type'>;
export const RangeY: MC<RangeYOptions> = () => {
return AbstractRange({ extendX: true });
};
RangeY.props = {
defaultShape: 'range',
defaultLabelShape: 'label',
composite: false,
shape,
channels: [
...baseAnnotationChannels({ shapes: Object.keys(shape) }),
{ name: 'y', required: true },
],
preInference: [...basePreInference(), { type: MaybeDefaultY }],
postInference: [...basePostInference()],
};