SpreadSheet
Previous
S2Event
Next
Interaction
Loading...
Function description: properties and methods related to form instances. details
const s2 = new PivotSheet()s2.isPivotMode()
parameter | illustrate | type | Version |
---|---|---|---|
dom | mounted container node | string | HTMLElement | |
theme | theme configuration | S2Theme | |
store | some information stored | store | |
dataCfg | data configuration | S2DataConfig | |
options | table configuration | S2Options | |
dataSet | Tabular Dataset (fields, data, sort) | BaseDataSet | |
facet | current viewable rendering area | BaseFacet | |
tooltip | tooltip | BaseTooltip | |
container | g-canvas example | Canvas | |
interaction | interact | Interaction | |
hd | HD adaptation | HdAdapter | |
on | event subscription | (event: S2Event , listener: () => void) => void | |
emit | event release | (event: S2Event , ...args: any[]) => void | |
getDataSet | get dataset | (options: S2Options ) => BaseDataSet | |
isPivotMode | Is it a pivot table | () => boolean | |
isHierarchyTreeType | Is it a tree structure | () => boolean | |
isFrozenRowHeader | Whether it is the state of freezing line header | () => boolean | |
isTableMode | Is it a schedule | () => boolean | |
isValueInCols | Is the value placed at the beginning of the line | () => boolean | |
clearDrillDownData | Clear drill down data | (rowNodeId?: string) => void | |
showTooltip | show tooltip | (showOptions: TooltipShowOptions ) => void | |
showTooltipWithInfo | Display tooltip, and display some default information | (event: CanvasEvent | MouseEvent , data: TooltipData[] , options?: TooltipOptions ) => void | |
hideTooltip | hide tooltip | () => void | |
destroyTooltip | destroy tooltip | () => void | |
registerIcons | Register custom svg icons (according to options.customSVGIcons ) | () => void | |
setDataCfg | Update data configuration | (dataCfg: S2DataConfig , reset?: boolean ) => void | The reset parameter needs to be used in @antv/s2^1.34.0 version |
setOptions | Update table configuration | (options: S2Options , reset?: boolean) => void | The reset parameter needs to be used in @antv/s2^1.34.0 version |
render | Re-render the table, if reloadData = true, the data will be recalculated, rebuildDataSet = true, rebuild the data set, reBuildHiddenColumnsDetail = true rebuild hidden column information | (reloadData?: boolean, { rebuildDataSet?: boolean; reBuildHiddenColumnsDetail?: boolean }) => Promise<void> | |
destroy | destroy form | () => void | |
setThemeCfg | Update theme configuration (including theme schema, color palette, theme name) | (themeCfg: ThemeCfg ) => void | |
setTheme | Update theme (only contains theme scheme) | (theme: S2Theme ) => void | |
updatePagination | update pagination | (pagination: Pagination ) => void | |
changeSheetSize | Modify table canvas size without reloading data | (width?: number, height?: number) => void | |
getLayoutWidthType | Get the cell width layout type (LayoutWidthType: adaptive(自适应) | colAdaptive(列自适应) | compact(紧凑) ) | () => LayoutWidthType | |
getRowNodes | Get row header node | (level: number) => Node[] | |
getRowLeafNodes | Get the row header leaf node | () => Node[] | |
facet.getColNodes | Get column head node | (level: number) => Node[] | |
facet.getColLeafNodes | Get the column head leaf node | () => Node[] | |
getCell | Get the current cell according to event.target | (target: EventTarget ) => S2CellType | |
getCellType | Get the current cell type according to event.target | (target: EventTarget ) => CellType | |
getTotalsConfig | Get Total Subtotal Configuration | (dimension: string) => Total | |
getCanvasElement | Get the <canvas/> HTML element corresponding to the table | () => HTMLCanvasElement | |
updateSortMethodMap | Update the node sorting method map stored in the store, replace is whether to overwrite the last value | (nodeId: string, sortMethod: string, replace?: boolean) => void | |
getMenuDefaultSelectedKeys | Get the key value of the menu item selected in the tooltip | (nodeId: string) => string[] | |
measureText | Get the measurement information of the text in the canvas | (text: string , font: TextTheme ) => TextMetrics | null | |
measureTextWidth | Get the measured width of the text in the canvas | (text: string , font: TextTheme ) => number | null | |
measureTextHeight | Get the measured height of the text in the canvas | (text: string , font: TextTheme ) => number | null |
type S2MountContainer = string | HTMLElement;
Function description: Scroll offset configuration
interface ScrollOffsetConfig {offsetX?: {value: number | undefined;animate?: boolean;};offsetY?: {value: number | undefined;animate?: boolean;};}
Function description: cell type
export enum CellType {DATA_CELL = 'dataCell', // 数值单元格ROW_CELL = 'rowCell', // 行头单元格COL_CELL = 'colCell', // 列头单元格CORNER_CELL = 'cornerCell', // 角头单元格MERGED_CELL = 'mergedCell', // 合并后的单元格}
Functional Description: Box Model
type BBox = {x: number;y: number;minX: number;minY: number;maxX: number;maxY: number;width: number;height: number;};