import { VisSpecWithHistory } from '../models/visSpecHistory'; import type { FeatureCollection } from 'geojson'; import { DraggableFieldState, Filters, IAggregator, IChart, IFilterRule, IMutField, ISegmentKey, IGeographicData, ISortMode, IViewField, IVisSpec, IVisualConfigNew, IVisualLayout, Specification, ICoordMode, IGeoUrl, ICreateField, ISemanticType, IPaintMapV2, IDefaultConfig } from '../interfaces'; import { DATE_TIME_DRILL_LEVELS, DATE_TIME_FEATURE_LEVELS } from '../constants'; import { KVTuple } from '../models/utils'; import { INestNode } from '../components/pivotTable/interface'; export declare class VizSpecStore { instanceID: string; visList: VisSpecWithHistory[]; private pristineInitialCharts; visIndex: number; createdVis: number; editingFilterIdx: number | null; meta: IMutField[]; segmentKey: ISegmentKey; showInsightBoard: boolean; showDataBoard: boolean; showAutoVizPanel: boolean; vizEmbededMenu: { show: boolean; position: [number, number]; }; showDataConfig: boolean; showCodeExportPanel: boolean; showVisualConfigPanel: boolean; showGeoJSONConfigPanel: boolean; removeConfirmIdx: number | null; filters: Filters; tableCollapsedHeaderMap: Map; selectedMarkObject: Record; showLogSettingPanel: boolean; showBinSettingPanel: boolean; showRenamePanel: boolean; createField: ICreateField | undefined; localGeoJSON: FeatureCollection | undefined; showErrorResolutionPanel: number; showPainterPanel: boolean; lastErrorMessage: string; showAskvizFeedbackIndex: number | undefined; lastSpec: string; editingComputedFieldFid: string | undefined; defaultConfig: IDefaultConfig | undefined; /** fields highlighted in the field list (Tableau-style multi-select feeding Auto Viz); UI state, not part of the undo timeline */ selectedFieldIds: string[]; onMetaChange?: (fid: string, diffMeta: Partial) => void; constructor(meta: IMutField[], options?: { empty?: boolean; onMetaChange?: (fid: string, diffMeta: Partial) => void; defaultConfig?: IDefaultConfig; initialSegment?: ISegmentKey; }); get visLength(): number; get vizList(): IChart[]; get currentVis(): IChart; get currentEncodings(): DraggableFieldState; get viewFilters(): import("../interfaces").IFilterField[]; get dimensions(): IViewField[]; get measures(): IViewField[]; get rows(): IViewField[]; get columns(): IViewField[]; get sort(): ISortMode; get sortedEncoding(): "none" | "row" | "column"; get allFields(): IViewField[]; get config(): IVisualConfigNew; get layout(): { geoJson?: FeatureCollection | undefined; showTableSummary: boolean; format: { numberFormat?: string | undefined; timeFormat?: string | undefined; normalizedNumberFormat?: string | undefined; }; primaryColor?: string | undefined; colorPalette?: string | undefined; scale?: import("../interfaces").IConfigScaleSet | undefined; resolve: { x?: boolean | undefined; y?: boolean | undefined; color?: boolean | undefined; opacity?: boolean | undefined; shape?: boolean | undefined; size?: boolean | undefined; }; size: { mode: "auto" | "fixed" | "full"; width: number; height: number; }; useSvg?: boolean | undefined; geojson?: FeatureCollection | undefined; geoKey?: string | undefined; geoUrl?: IGeoUrl | undefined; geoMapTileUrl?: string | undefined; interactiveScale: boolean; stack: import("../interfaces").IStackMode; showActions: boolean; zeroScale: boolean; background?: string | undefined; scaleIncludeUnmatchedChoropleth?: boolean | undefined; showAllGeoshapeInChoropleth?: boolean | undefined; renderer?: "vega-lite" | "observable-plot" | undefined; }; get allEncodings(): Record; get viewEncodings(): Partial>; get viewEncodingFields(): IViewField[]; get viewDimensions(): IViewField[]; get viewMeasures(): IViewField[]; get workflow(): import("../interfaces").IDataQueryWorkflowStep[]; get limit(): number; get canUndo(): boolean; get canRedo(): boolean; get chatMessages(): import("../interfaces").IChatMessage[]; get paintFields(): { readonly type: "error"; readonly key: "count"; readonly x?: undefined; readonly y?: undefined; readonly color?: undefined; readonly shape?: undefined; readonly size?: undefined; readonly opacity?: undefined; } | { readonly type: "error"; readonly key: "temporal"; readonly x?: undefined; readonly y?: undefined; readonly color?: undefined; readonly shape?: undefined; readonly size?: undefined; readonly opacity?: undefined; } | { readonly type: "new"; readonly x: IViewField; readonly y: IViewField; readonly key?: undefined; readonly color?: undefined; readonly shape?: undefined; readonly size?: undefined; readonly opacity?: undefined; } | { readonly type: "agg"; readonly x: IViewField; readonly y: IViewField; readonly color: IViewField | undefined; readonly shape: IViewField | undefined; readonly size: IViewField | undefined; readonly opacity: IViewField | undefined; readonly key?: undefined; }; get paintInfo(): { readonly type: "error"; readonly key: "count"; readonly x?: undefined; readonly y?: undefined; readonly color?: undefined; readonly shape?: undefined; readonly size?: undefined; readonly opacity?: undefined; } | { readonly type: "error"; readonly key: "temporal"; readonly x?: undefined; readonly y?: undefined; readonly color?: undefined; readonly shape?: undefined; readonly size?: undefined; readonly opacity?: undefined; } | { readonly type: "new"; readonly x: IViewField; readonly y: IViewField; readonly key?: undefined; readonly color?: undefined; readonly shape?: undefined; readonly size?: undefined; readonly opacity?: undefined; } | { readonly type: "agg"; readonly x: IViewField; readonly y: IViewField; readonly color: IViewField | undefined; readonly shape: IViewField | undefined; readonly size: IViewField | undefined; readonly opacity: IViewField | undefined; readonly key?: undefined; } | { readonly type: "exist"; readonly item: any; readonly new: { readonly type: "error"; readonly key: "count"; readonly x?: undefined; readonly y?: undefined; readonly color?: undefined; readonly shape?: undefined; readonly size?: undefined; readonly opacity?: undefined; } | { readonly type: "error"; readonly key: "temporal"; readonly x?: undefined; readonly y?: undefined; readonly color?: undefined; readonly shape?: undefined; readonly size?: undefined; readonly opacity?: undefined; } | { readonly type: "new"; readonly x: IViewField; readonly y: IViewField; readonly key?: undefined; readonly color?: undefined; readonly shape?: undefined; readonly size?: undefined; readonly opacity?: undefined; } | { readonly type: "agg"; readonly x: IViewField; readonly y: IViewField; readonly color: IViewField | undefined; readonly shape: IViewField | undefined; readonly size: IViewField | undefined; readonly opacity: IViewField | undefined; readonly key?: undefined; }; }; private appendFilter; undo(): void; redo(): void; setVisName(index: number, name: string): void; setMeta(meta: IMutField[]): void; setOnMetaChange(onMetaChange?: (fid: string, diffMeta: Partial) => void): void; setDefaultConfig(defaultConfig?: IDefaultConfig): void; resetVisualization(name?: string): void; addVisualization(defaultName?: string | ((index: number) => string)): void; removeVisualization(index: number): void; duplicateVisualization(index: number): void; setFilterEditing(index: number): void; closeFilterEditing(): void; setSegmentKey(sk: ISegmentKey): void; setVisualConfig(...args: KVTuple): void; setCoordSystem(mode: ICoordMode): void; setVisualLayout(...args: KVTuple): any; setVisualLayout(...args: KVTuple[]): any; reorderField(stateKey: keyof DraggableFieldState, sourceIndex: number, destinationIndex: number): void; moveField(sourceKey: keyof DraggableFieldState, sourceIndex: number, destinationKey: keyof DraggableFieldState, destinationIndex: number): void; modFilter(index: number, sourceKey: keyof Omit, sourceIndex: number): void; removeField(sourceKey: keyof DraggableFieldState, sourceIndex: number): void; writeFilter(index: number, rule: IFilterRule | null): void; transpose(): void; createBinField(stateKey: keyof Omit, index: number, binType: 'bin' | 'binCount', binNumber?: number): string; createLogField(stateKey: keyof Omit, index: number, scaleType: 'log10' | 'log2' | 'log', logNumber?: number): void; renameFieldInChart(stateKey: keyof Omit, index: number, newName: string): void; createDateTimeDrilledField(stateKey: keyof Omit, index: number, drillLevel: (typeof DATE_TIME_DRILL_LEVELS)[number], name: string, format: string, offset: number | undefined): void; createDateFeatureField(stateKey: keyof Omit, index: number, drillLevel: (typeof DATE_TIME_FEATURE_LEVELS)[number], name: string, format: string, offset: number | undefined): void; setFieldAggregator(stateKey: keyof Omit, index: number, aggName: IAggregator): void; setFilterAggregator(index: number, aggName: IAggregator | ''): void; applyDefaultSort(sortType?: ISortMode): void; exportCurrentChart(): string; exportAllCharts(): string[]; exportCode(): IChart[]; importCode(data: IChart[] | IVisSpec[]): void; appendRaw(data: string): void; importRaw(data: string[]): void; appendFromCode(data: IVisSpec | IChart): void; setAskvizFeedback(show: boolean): void; /** replace the current chart and RESET its history (used by controlled `spec` prop syncing) */ replaceNow(chart: IChart): void; /** replace the current chart as an undoable/redoable timeline action (used by Auto Viz) */ applyChart(chart: IChart): void; selectVisualization(index: number): void; setShowDataConfig(show: boolean): void; setShowInsightBoard(show: boolean): void; setShowDataBoard(show: boolean): void; setShowAutoVizPanel(show: boolean): void; /** plain click: make this the only selected field; clicking the sole selected field deselects it */ selectField(fid: string): void; /** ctrl/cmd click: toggle this field in the selection */ toggleFieldSelection(fid: string): void; clearFieldSelection(): void; showEmbededMenu(position: [number, number]): void; setShowCodeExportPanel(show: boolean): void; setShowVisualConfigPanel(show: boolean): void; closeEmbededMenu(): void; setFilters(props: Filters): void; updateCurrentDatasetMetas(fid: string, diffMeta: Partial): void; openRemoveConfirmModal(index: number): void; closeRemoveConfirmModal(): void; setGeographicData(data: IGeographicData, geoKey: string, geoUrl?: IGeoUrl): void; clearGeographicData(): void; changeSemanticType(stateKey: keyof Omit, index: number, semanticType: ISemanticType): void; updatePaint(paintMap: IPaintMapV2 | null, name: string): void; updateGeoKey(key: string): void; updateTableCollapsedHeader(node: INestNode): void; resetTableCollapsedHeader(): void; setShowGeoJSONConfigPanel(show: boolean): void; setShowBinSettingPanel(show: boolean): void; setShowLogSettingPanel(show: boolean): void; setShowRenamePanel(show: boolean): void; setCreateField(field: ICreateField): void; updateSelectedMarkObject(newMarkObj: Record): void; updateShowErrorResolutionPanel(errCode: number, msg?: string): void; setShowPainter(show: boolean): void; updateLastSpec(spec: string): void; setComputedFieldFid(fid?: string): void; upsertComputedField(fid: string, name: string, sql: string): void; removeComputedField(sourceKey: keyof DraggableFieldState, sourceIndex: number): void; replaceWithNLPQuery(query: string, response: string): void; } /** @deprecated Superseded by `normalize()` with a {@link TerseSpec}; will be removed in the next major version. */ export declare function renderSpec(spec: Specification, meta: IMutField[], name: string, visId: string): IChart;