import type { WorksheetSpec } from "../../worksheet"; import type { IChart, IViewField } from '../../interfaces'; export interface AdaptedChart { /** Absent when the worksheet renderer cannot draw the chart; `error` says why. */ spec?: WorksheetSpec; error?: string; /** The chart has nothing on its shelves to draw yet, which is no fault of the chart. */ empty?: boolean; /** Parts of the chart that were left out or approximated. */ notes: string[]; /** The fields the worksheet queries, split the way the editor's workflow builder takes them. */ viewDimensions: IViewField[]; viewMeasures: IViewField[]; } /** * Maps a stored chart to the worksheet renderer's input. The chart stays the source of * truth; nothing here is saved. * * Shelf rule, per axis, after the editor has put dimensions before measures: * - with measures, every dimension is a header level and each measure is a value axis; * - without measures, the last dimension is the position inside a pane: one slot per * member when nominal or ordinal, a linear axis when quantitative, a time axis when temporal. * * Two mark types read the shelves differently. A pie has no axes: every dimension on rows and * columns is a header, one pie is drawn per cell, and the measure comes from the angle shelf. * A box plot has one axis, its measure, so its dimensions are all headers too. */ export declare function chartToWorksheet(chart: IChart): AdaptedChart;