export interface FieldInfo = {
/** name of field */
fieldName: string;
/** field type, eg: time / category / numerical */
type: DataType;
/** field role */
role: ROLE;
/** alias of field */
alias?: string;
/** description of field */
description?: string;
};
export enum DataType {
DATE = 'date',
TIME = 'time',
STRING = 'string',
REGION = 'region',
NUMERICAL = 'numerical',
RATIO = 'ratio',
COUNT = 'count',
FLOAT = 'float',
INT = 'int'
}
export enum ROLE {
DIMENSION = 'dimension',
MEASURE = 'measure'
}
接口参数
getFieldInfo(dataset: Record<string, number | string>[]): FieldInfo[]