UNPKG

1.4 kBTypeScriptView Raw
1import ScaleController from './scale';
2type AttrOption = {
3 field?: string | Record<any, any>;
4 range?: any[];
5};
6export type GroupAttr = 'color' | 'size' | 'shape';
7export type Attr = GroupAttr | 'x' | 'y';
8type AttrsRange = {
9 [key: string]: any;
10};
11export declare const ATTRS: string[];
12declare class AttrController {
13 private scaleController;
14 private options;
15 attrs: any;
16 attrsRange: any;
17 constructor(scaleController: ScaleController, attrsRange: AttrsRange);
18 parseOption(option: AttrOption, attrName: Attr): AttrOption | {
19 type: string;
20 field?: undefined;
21 range?: undefined;
22 } | {
23 field: AttrOption & string;
24 type: string;
25 range?: undefined;
26 } | {
27 type: string;
28 field: AttrOption & number;
29 range?: undefined;
30 } | {
31 field: any;
32 range: any;
33 type?: undefined;
34 };
35 getAttrOptions(props: any, justifyContentCenter: boolean): {};
36 getDefaultAttrValues(): {
37 color: any;
38 shape: any;
39 };
40 getGroupScales(): any[];
41 private createAttr;
42 create(options: any): void;
43 update(nextOptions: any): void;
44 getAttr(attrName: string): any;
45 getAttrs(): any;
46 isGroupAttr(attrName: GroupAttr): boolean;
47 getAttrsByLinear(): {
48 linearAttrs: any[];
49 nonlinearAttrs: any[];
50 };
51}
52export default AttrController;