import { analyzer } from '@antv/data-wizard'; import type { ChartKnowledgeJSON } from '@antv/ckb'; import type { BasicDataPropertyForAdvice, RuleConfig, RuleModule } from '../ruler'; import type { CKBConfig } from './ckb-config'; import type { AdvisorOptions, SmartColorOptions } from './advice-pipeline/interface'; import type { Advice, AdvicesWithLog, DataRows, GraphData as GData } from '../types'; export declare type AdviseParams = ChartAdviseParams | GraphAdviseParams; export declare type ChartAdviseParams = { /** input data to advise */ data: DataRows; /** customized dataprops to advise */ dataProps?: BasicDataPropertyForAdvice[]; /** data fields to focus, apply in `data` and `dataProps` */ fields?: string[]; /** specify data types for fields to focus, Please notice that this will modify the data you provided. It will convert the data according to fieldTypes */ fieldTypes?: (analyzer.TypeSpecifics | '')[]; /** SmartColor mode on/off */ smartColor?: boolean; /** advising options such as purpose, layout preferences */ options?: AdvisorOptions; /** smart color options */ colorOptions?: SmartColorOptions; }; export declare type GraphAdviseParams = { /** input data to advise */ data: GData; /** customized dataprops to advise */ dataProps?: analyzer.GraphProps; /** data fields to focus, apply in `data` and `dataProps` */ fields?: { nodes: string[]; links: string[]; }; /** advising options such as purpose, layout preferences */ options?: { purpose?: AdvisorOptions['purpose']; nodes?: AdvisorOptions; links?: AdvisorOptions; theme?: AdvisorOptions['theme']; nodeColors?: string[]; nodeSizeRange?: number[]; edgeWidthRange?: number[]; extra?: { nodeKey?: string; edgeKey?: string; sourceKey?: string; targetKey?: string; childrenKey?: string; nodeIndexes?: string[] | number[]; nodeColumns?: string[] | number[]; linkIndexes?: string[] | number[]; linkColumns?: string[] | number[]; }; }; }; export declare class Advisor { /** * CKB used for advising */ CKB: Record; /** * rule base used for advising */ ruleBase: Record; ckbCfg: CKBConfig; ruleCfg: RuleConfig; /** * * @param configuration for Advisor, including * * - ckbCfg: ckb configuration: `include`, `exclude`, `custom`. * if not specified, used `@antv/ckb` as default * - ruleCfg: rule base configuration: `include`, `exclude`, `custom`, `options`. * if not specified, used `ruler` as default */ constructor(config?: Partial>); /** * chart advising from input data * @param params paramters for advising */ advise(params: AdviseParams): Advice[]; /** * Advise and return with scoring log. * * @param params * @returns */ adviseWithLog(params: AdviseParams): AdvicesWithLog; advicesForChart(params: ChartAdviseParams, exportLog?: boolean): AdvicesWithLog | Advice[]; advicesForGraph(params: GraphAdviseParams): Advice[]; /** * If shouldRecommendGraph is true, higher priority for relational graph * @param data * @param options * @returns */ private shouldRecommendGraph; /** * processing ckb config and setup ckb used for advising * @param ckbCfg input ckb configuration * @returns ckb: Record */ private processCKBCfg; } export * from './advice-pipeline'; export * from './ckb-config';