@visactor/vmind
Version:
<div align="center"> <a href="https://github.com/VisActor#gh-light-mode-only" target="_blank"> <img alt="VisActor Logo" width="200" src="https://github.com/VisActor/.github/blob/main/profile/logo_500_200_light.svg"/> </a> <a href="https://githu
91 lines (90 loc) • 3.27 kB
TypeScript
import type { BasemapOption, ChartGeneratorCtx, ChartTheme, ChartType, ClusterDataView, DataItem, DataTable, FieldInfo, OuterPackages, TimeType, Usage, VMindOptions } from '../types';
import type { Insight } from '../atom/dataInsight/type';
import type { DataInsightOptions } from '../atom/dataInsight/type';
declare class VMind {
private options;
private _FPS;
private llm;
private dataQuerySchedule;
private text2DataTableSchedule;
private text2ChartSchedule;
private dataInsightSchedule;
private data2ChartSchedule;
constructor(options: VMindOptions);
updateOptions(options?: VMindOptions): void;
parseCSVData(csvString: string): {
fieldInfo: FieldInfo[];
dataset: DataItem[];
};
getFieldInfo(dataset: DataItem[]): FieldInfo[];
dataQuery(userPrompt: string, dataset: DataTable, fieldInfo?: FieldInfo[]): Promise<{
dataTable: DataTable;
fieldInfo: FieldInfo[];
usage: Usage;
error: string;
}>;
text2Data(text: string, userPrompt?: string, options?: {
fieldInfo?: FieldInfo[];
hierarchicalClustering?: boolean;
clusterThreshold?: number;
}): Promise<{
extractDataTable: DataTable;
dataTable: DataTable;
fieldInfo: FieldInfo[];
extractFieldInfo: FieldInfo[];
usage: Usage;
clusterResult: ClusterDataView[];
}>;
text2Chart(text: string, userPrompt?: string, options?: {
fieldInfo?: FieldInfo[];
chartTypeList?: ChartType[];
colorPalette?: string[];
animationDuration?: number;
enableDataQuery?: boolean;
theme?: ChartTheme | string;
basemapOption?: BasemapOption;
}): Promise<{
spec: any;
command: string;
chartAdvistorRes: {
chartType: ChartType;
spec: any;
score: number;
}[];
cell: import("../types").Cell;
vizSchema: import("../types").VizSchema;
time: {
totalTime: number;
frameArr: any[];
};
dataTable: DataTable;
fieldInfo: FieldInfo[];
usage: Usage;
error: string;
}>;
generateChart(userPrompt?: string, fieldInfo?: FieldInfo[], dataset?: DataTable, options?: {
image?: string;
chartTypeList?: ChartType[];
colorPalette?: string[];
animationDuration?: number;
enableDataQuery?: boolean;
theme?: ChartTheme | string;
basemapOption?: BasemapOption;
}): Promise<ChartGeneratorCtx>;
getInsights(spec: any, options?: DataInsightOptions): Promise<{
insights: Insight[];
usage: Usage;
error: string;
newSpec: any;
}>;
updateSpecByInsights(spec: any, insights: Insight[], options?: {
chartType?: ChartType;
}): Promise<{
error: string;
newSpec: any;
}>;
fillSpecWithData(spec: any, dataset: DataTable, cell?: any): any;
exportVideo(spec: any, time: TimeType, outerPackages: OuterPackages, mode?: 'node' | 'desktop-browser'): Promise<ArrayBufferLike>;
exportGIF(spec: any, time: TimeType, outerPackages: OuterPackages, mode?: 'node' | 'desktop-browser'): Promise<ArrayBufferLike>;
}
export default VMind;