UNPKG

728 BTypeScriptView Raw
1/**
2 * 几何标记对象的数据调整类型。
3 */
4export type AdjustType =
5 // 堆叠
6 | 'stack'
7 // 分组
8 | 'dodge'
9 // 对称
10 | 'symmetric';
11
12export interface AdjustCommonProps<TAdjustType extends AdjustType> {
13 /**
14 * 调整类型。
15 */
16 type: TAdjustType;
17
18 readonly adjustNames?: string[];
19 readonly xField?: string;
20 readonly yField?: string;
21}
22
23export type StackAdjustProps = AdjustCommonProps<'stack'>;
24
25export interface DodgeAdjustProps extends AdjustCommonProps<'dodge'> {
26 readonly marginRatio?: number;
27 readonly dodgeRatio?: number;
28}
29
30export type SymmetricAdjustProps = AdjustCommonProps<'symmetric'>;
31
32export type AdjustProps = StackAdjustProps | DodgeAdjustProps | SymmetricAdjustProps;