logo

S2

  • Manual
  • API
  • Examples
  • Playground
  • ChangeLog
  • Productsantv logo arrow
  • 2.x
  • Common Configuration
    • S2DataConfig
    • S2Options
      Updated
    • S2Theme
      Updated
    • S2Event
  • Basic Class
    • SpreadSheet
    • Interaction
      Updated
    • Store
    • BaseCell
      Updated
    • BaseDataSet
    • Node
    • BaseTooltip
    • BaseFacet
      Updated
    • Hierarchy
      New
    • BaseBBox
      New
    • CellData
      New
  • Components
    • table component
    • DrillDown
    • Switcher
    • Advanced Sort
    • Export
      Updated
  • Graphic style
  • 透视组合图拓展 S2Options

table component

Previous
CellData
Next
DrillDown

Resources

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-互动图形解决方案
xtechLiven Experience technology
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

React table component

Out-of-the-box component <SheetComponent /> based on React packaged by @antv/s2

SpreadsheetProps

Function description: The props parameter of the React SheetComponent component

ParameterDescriptionTypeDefaultRequired
sheetTypeForm type:
1. pivot: pivot table
2. table: detail table
3. gridAnalysis: grid analysis table
4. strategy: trend analysis table
pivot | table | gridAnalysis | strategy | pivot
spreadsheetcustom table(container: HTMLElement | string, dataCfg: S2DataConfig, options: SheetComponentOptions) => [SpreadSheet](/ docs/api/basic-class/spreadsheet)
dataCfgPivot table data mapping related configuration itemsS2DataConfig✓
optionspivot table property configuration itemSheetComponentOptions✓
partDrillDownAttributes related to dimension drilldownPartDrillDown
adaptiveWhether to adapt to the window size`boolean{ width?: boolean, height?: boolean, getContainer: () => HTMLElement }`false
themeCfgCustom pivot table theme stylesThemeCfg
loadingControls the loading state of the tableboolean
onRangeSortCallback event triggered when sorting within a group(params: SortParam[] ) => void;
onRowCellHoverRow header mouse hover event(data: TargetCellInfo) => void
onRowCellClickrow head mouse click event(data: TargetCellInfo) => void
onRowCellDoubleClickMouse double-click event at row head(data: TargetCellInfo) => void
onRowCellMouseDownrow header mouse down event(data: TargetCellInfo) => void
onRowCellMouseUpRow cell mouse release event(data: TargetCellInfo) => void
onRowCellMouseMoveRow cell mouse movement event(data: TargetCellInfo) => void
onRowCellCollapsedNode expand/collapse event callback({ isCollapsed: boolean, collapseFields: Record<string, boolean>, node: Node ) => void;
onRowCellAllCollapsedEvent callback for all nodes expanded/collapsed(isCollapsed: boolean ) => void;
onRowCellScrollrow header cell scroll event({position: CellScrollPosition} ) => void;
onColCellHoverColumn header mouse hover event(data: TargetCellInfo) => void
onColCellClickColumn head mouse click event(data: TargetCellInfo) => void
onColCellDoubleClickMouse double-click event of column header(data: TargetCellInfo) => void
onColCellMouseDownColumn header mouse down event(data: TargetCellInfo) => void
onColCellMouseUpColumn header mouse release event(data: TargetCellInfo) => void
onColCellMouseMoveColumn head mouse move event(data: TargetCellInfo) => void
onColCellExpandedAfter the hidden column header is enabled (tooltip.operation.hiddenColumns = true), the event callback for column header expansion(collapseAll: boolean ) => void;
onColCellHiddenAfter the hidden column header is enabled (tooltip.operation.hiddenColumns = true), the event callback for the hidden column header({data: { currentHiddenColumnsInfo:HiddenColumnsInfo;hiddenColumnsDetail:HiddenColumnsInfo;} ) => void;
onDataCellHovermouse hover event of numeric cell(data: TargetCellInfo) => void
onDataCellClickMouse click event of numeric cell(data: TargetCellInfo) => void
onDataCellDoubleClickValue cell double click event(data: TargetCellInfo) => void
onDataCellMouseDownMouse down event of numeric cell(data: TargetCellInfo) => void
onDataCellMouseUpNumeric cell mouse release event(data: TargetCellInfo) => void
onDataCellMouseMoveNumeric cell mouse movement event(data: TargetCellInfo) => void
onDataCellBrushSelectionValue cell brush selection event( dataCells: DataCell[] ) => void
onDataCellSelectMoveNumerical cell keyboard direction key move event(metas: CellMeta[]) => void
onCornerCellHovercorner mouse hover event(data: TargetCellInfo) => void
onCornerCellClickCorner mouse click event(data: TargetCellInfo) => void
onCornerCellDoubleClickCorner cell double click event(data: TargetCellInfo) => void
onCornerCellMouseUpcorner mouse down event(data: TargetCellInfo) => void
onCornerCellMouseUpcorner mouse release event(data: TargetCellInfo) => void
onCornerCellMouseMovecorner mouse movement event(data: TargetCellInfo) => void
onMergedCellsHoverMouseover event of merged cells(data: TargetCellInfo) => void
onMergedCellsClickMouse click event of merged cells(data: TargetCellInfo) => void
onMergedCellDoubleClickMouse double-click event for merged cells(data: TargetCellInfo) => void
onMergedCellsMouseDownMerged cell press event(data: TargetCellInfo) => void
onMergedCellsMouseUpMerged cell release event(data: TargetCellInfo) => void
onMergedCellsMouseMovemerged cell move event(data: TargetCellInfo) => void
onRangeSortA callback event is triggered when sorting within a group (for now only pivot tables are supported)(params: SortParam[] ) => void;
onRangeSortedA callback event is triggered when the sorting in the group ends (for now, only pivot tables are supported)(event: CanvasEvent ) => void;
onRangeFilterTrigger callback event when filtering(data: { filterKey: string; filteredValues: string[] } ) => void;
onRangeFilteredTrigger callback event after filtering(data: DataType[] ) => void;
onLayoutCellRenderThe header layout cell mount completed eventcell: S2CellType
onLayoutAfterHeaderLayoutHeader layout structure preparation completion event(layoutResult: LayoutResult ) => void;
onLayoutPaginationpagination event({ pageSize: number; pageCount: number; total: number; current: number;} ) => void;
onLayoutCellScrollCell scroll event (Deprecated, please use onScroll instead)({position: CellScrollPosition} ) => void;
onLayoutAfterCollapseRowsEvent callback after collapsing row headers in tree mode({collapseFields: Record<string, boolean>, meta: Node ) => void;
onBeforeRenderEvent before start of render() => void;
onAfterRenderrender completed event() => void;
onMountedTable loading complete event, you can get the table instance details(spreadsheet: SpreadSheet) => void;
onDestroyform destruction event() => void;
onLayoutResizeThe overall changeSize event of the table(params: ResizeParams) => void;
onLayoutResizeSeriesWidthTable serial number row width event(params: ResizeParams) => void;
onLayoutResizeRowWidthrow header cell width change event(params: ResizeParams) => void;
onLayoutResizeRowHeightRow header cell height change event(params: ResizeParams) => void;
onLayoutResizeColWidthColumn header cell width change event(params: ResizeParams) => void;
onLayoutResizeColHeightColumn header cell height change event(params: ResizeParams) => void;
onLayoutResizeTreeWidthThe overall width change event of the tree line header(params: ResizeParams) => void;
onLayoutResizeMouseDownmouse down event of resize hotspot( event: MouseEvent, resizeInfo?: ResizeInfo) => void;
onLayoutResizeMouseUpmouse release event of resize hotspot( event: MouseEvent, resizeInfo?: ResizeInfo) => void;
onLayoutResizeMouseMovemouse move event of resize hotspot( event: MouseEvent, resizeInfo?: ResizeInfo) => void;
onKeyBoardDownkeyboard down event(event: KeyboardEvent) => void
onKeyBoardUpkeyboard release event(event: KeyboardEvent) => void
onCopiedcopy event(data: string) => void
onActionIconHoverLine header operation icon hover event(event: CanvasEvent) => void
onActionIconClickAction icon click event(event: CanvasEvent) => void
onContextMenuRight cell click event(data: TargetCellInfo) => void
onMouseHovertable mouse hover event(event: CanvasEvent) => void
onMouseUptable mouse release event(event: CanvasEvent) => void
onSelectedcell selected event(cells: ( Cell[] ) => void
onResetInteractive state reset event(event: KeyboardEvent) => void
onLinkFieldJumpLink field jump event (cellData: @antv/s2 1.37.0 new)(data: { key: string; cellData: Node; record: Data }) => void
onScrollcell scroll event (including row header and value cells)({position: CellScrollPosition} ) => void;
onColCellBrushSelectionBatch select the column header cells within the brush selection range. During the brush selection process, the brush selection range prompt mask will be displayed. After the brush selection is completed, a tooltip will pop up to display the brushed cell information (only supports pivot tables)(cells: ColCell[]) => void;
onRowCellBrushSelectionBatch select the row header cells within the brush selection range. During the brush selection process, the brush selection range prompt mask will be displayed. After the brush selection is completed, a tooltip will pop up to display the brushed cell information (only supports pivot tables)( cells: RowCell[]) => void;

SheetComponentOptions

The options of React components are inherited from S2Options, there are two differences

  • The content of tooltip has changed from Element | string to ReactNode, which can be any jsx element
  • The paging configuration has changed from the paging configuration of S2 to the paging configuration of antd, that is, the api transparent transmission of the antd paging component is supported
import type { Pagination, S2Options } from '@antv/s2';
import type { PaginationProps as AntdPaginationProps } from 'antd';
type SheetComponentOptions = S2Options<
React.ReactNode,
Pagination & AntdPaginationProps
>;

Vue table component

Out-of-the-box component <SheetComponent /> of Vue 3.0 based on @antv/s2 layer encapsulation

props

Function description: The props of the Vue SheetComponent component, such as <SheetComponent :sheetType="pivot" />

ParameterDescriptionTypeDefaultRequired
sheetTypeForm type:
1. pivot: pivot table
2. table: detailed table
`pivottable`pivot
dataCfgpivot table data mapping configuration itemS2DataConfig✓
optionspivot table property configuration itemSheetComponentOptions✓
adaptiveWhether to adapt to the window size`boolean{ width?: boolean, height?: boolean, getContainer: () => HTMLElement }`false
showPaginationwhether to show the default paginationboolean
themeCfgCustom pivot table theme stylesThemeCfg
loadingControls the loading state of the tableboolean
onRangeSortCallback event triggered when sorting within a group(params: SortParam[] ) => void;
onRowCellHoverRow header mouse hover event(data: TargetCellInfo) => void
onRowCellClickrow head mouse click event(data: TargetCellInfo) => void
onRowCellDoubleClickMouse double-click event at row head(data: TargetCellInfo) => void
onRowCellMouseDownrow header mouse down event(data: TargetCellInfo) => void
onRowCellMouseUpRow cell mouse release event(data: TargetCellInfo) => void
onRowCellMouseMoveRow cell mouse movement event(data: TargetCellInfo) => void
onRowCellCollapsedNode expand/collapse event callback({ isCollapsed: boolean, collapseFields: Record<string, boolean>, node: Node ) => void;
onRowCellAllCollapsedEvent callback for all nodes expanded/collapsed(isCollapsed: boolean ) => void;
onRowCellScrollrow header cell scroll event({position: CellScrollPosition} ) => void;
onColCellHoverColumn header mouse hover event(data: TargetCellInfo) => void
onColCellClickColumn head mouse click event(data: TargetCellInfo) => void
onColCellDoubleClickMouse double-click event of column header(data: TargetCellInfo) => void
onColCellMouseDownColumn header mouse down event(data: TargetCellInfo) => void
onColCellMouseUpColumn header mouse release event(data: TargetCellInfo) => void
onColCellMouseMoveColumn head mouse move event(data: TargetCellInfo) => void
onColCellExpandedAfter the hidden column header is enabled (tooltip.operation.hiddenColumns = true), the event callback for column header expansion(collapseAll: boolean ) => void;
onColCellHiddenAfter the hidden column header is enabled (tooltip.operation.hiddenColumns = true), the event callback for the hidden column header({data: { currentHiddenColumnsInfo:HiddenColumnsInfo;hiddenColumnsDetail:HiddenColumnsInfo;} ) => void;
onDataCellHovermouse hover event of numeric cell(data: TargetCellInfo) => void
onDataCellClickMouse click event of numeric cell(data: TargetCellInfo) => void
onDataCellDoubleClickValue cell double click event(data: TargetCellInfo) => void
onDataCellMouseDownMouse down event of numeric cell(data: TargetCellInfo) => void
onDataCellMouseUpNumeric cell mouse release event(data: TargetCellInfo) => void
onDataCellMouseMoveNumeric cell mouse movement event(data: TargetCellInfo) => void
onDataCellBrushSelectionValue cell brush selection event( dataCells: DataCell[] ) => void
onDataCellSelectMoveNumerical cell keyboard direction key move event(metas: CellMeta[]) => void
onCornerCellHovercorner mouse hover event(data: TargetCellInfo) => void
onCornerCellClickCorner mouse click event(data: TargetCellInfo) => void
onCornerCellDoubleClickCorner cell double click event(data: TargetCellInfo) => void
onCornerCellMouseUpcorner mouse down event(data: TargetCellInfo) => void
onCornerCellMouseUpcorner mouse release event(data: TargetCellInfo) => void
onCornerCellMouseMovecorner mouse movement event(data: TargetCellInfo) => void
onMergedCellsHoverMouseover event of merged cells(data: TargetCellInfo) => void
onMergedCellsClickMouse click event of merged cells(data: TargetCellInfo) => void
onMergedCellDoubleClickMouse double-click event for merged cells(data: TargetCellInfo) => void
onMergedCellsMouseDownMerged cell press event(data: TargetCellInfo) => void
onMergedCellsMouseUpMerged cell release event(data: TargetCellInfo) => void
onMergedCellsMouseMovemerged cell move event(data: TargetCellInfo) => void
onRangeSortA callback event is triggered when sorting within a group (for now only pivot tables are supported)(params: SortParam[] ) => void;
onRangeSortedA callback event is triggered when the sorting in the group ends (for now, only pivot tables are supported)(event: CanvasEvent ) => void;
onRangeFilterTrigger callback event when filtering(data: { filterKey: string; filteredValues: string[] } ) => void;
onRangeFilteredTrigger callback event after filtering(data: DataType[] ) => void;
onLayoutCellRenderThe header layout cell mount completed eventcell: S2CellType
onLayoutAfterHeaderLayoutHeader layout structure preparation completion event(layoutResult: LayoutResult ) => void;
onLayoutPaginationpagination event({ pageSize: number; pageCount: number; total: number; current: number;} ) => void;
onLayoutCellScrollCell scroll event (Deprecated, please use onScroll instead)({position: CellScrollPosition} ) => void;
onLayoutAfterCollapseRowsEvent callback after collapsing row headers in tree mode({collapseFields: Record<string, boolean>, meta: Node ) => void;
onBeforeRenderEvent before start of render() => void;
onAfterRenderrender completed event() => void;
onMountedTable loading complete event, you can get the table instance details(spreadsheet: SpreadSheet) => void;
onDestroyform destruction event() => void;
onLayoutResizeThe overall changeSize event of the table(params: ResizeParams) => void;
onLayoutResizeSeriesWidthTable serial number row width event(params: ResizeParams) => void;
onLayoutResizeRowWidthrow header cell width change event(params: ResizeParams) => void;
onLayoutResizeRowHeightRow header cell height change event(params: ResizeParams) => void;
onLayoutResizeColWidthColumn header cell width change event(params: ResizeParams) => void;
onLayoutResizeColHeightColumn header cell height change event(params: ResizeParams) => void;
onLayoutResizeTreeWidthThe overall width change event of the tree line header(params: ResizeParams) => void;
onLayoutResizeMouseDownmouse down event of resize hotspot( event: MouseEvent, resizeInfo?: ResizeInfo) => void;
onLayoutResizeMouseUpmouse release event of resize hotspot( event: MouseEvent, resizeInfo?: ResizeInfo) => void;
onLayoutResizeMouseMovemouse move event of resize hotspot( event: MouseEvent, resizeInfo?: ResizeInfo) => void;
onKeyBoardDownkeyboard down event(event: KeyboardEvent) => void
onKeyBoardUpkeyboard release event(event: KeyboardEvent) => void
onCopiedcopy event(data: string) => void
onActionIconHoverLine header operation icon hover event(event: CanvasEvent) => void
onActionIconClickAction icon click event(event: CanvasEvent) => void
onContextMenuRight cell click event(data: TargetCellInfo) => void
onMouseHovertable mouse hover event(event: CanvasEvent) => void
onMouseUptable mouse release event(event: CanvasEvent) => void
onSelectedcell selected event(cells: ( Cell[] ) => void
onResetInteractive state reset event(event: KeyboardEvent) => void
onLinkFieldJumpLink field jump event (cellData: @antv/s2 1.37.0 new)(data: { key: string; cellData: Node; record: Data }) => void
onScrollcell scroll event (including row header and value cells)({position: CellScrollPosition} ) => void;
onColCellBrushSelectionBatch select the column header cells within the brush selection range. During the brush selection process, the brush selection range prompt mask will be displayed. After the brush selection is completed, a tooltip will pop up to display the brushed cell information (only supports pivot tables)(cells: ColCell[]) => void;
onRowCellBrushSelectionBatch select the row header cells within the brush selection range. During the brush selection process, the brush selection range prompt mask will be displayed. After the brush selection is completed, a tooltip will pop up to display the brushed cell information (only supports pivot tables)( cells: RowCell[]) => void;

SheetComponentOptions

The options of React components are inherited from S2Options, there are two differences

  • The content of tooltip has changed from Element | string to ReactNode, which can be any jsx element
  • The paging configuration has changed from the paging configuration of S2 to the paging configuration of antd, that is, the api transparent transmission of the antd paging component is supported
import type { Pagination, S2Options } from '@antv/s2';
import type { PaginationProps as AntdPaginationProps } from 'antd';
type SheetComponentOptions = S2Options<
React.ReactNode,
Pagination & AntdPaginationProps
>;

Vue table component

Out-of-the-box component <SheetComponent /> of Vue 3.0 based on @antv/s2 layer encapsulation

props

Function description: The props of the Vue SheetComponent component, such as <SheetComponent :sheetType="pivot" />

ParameterDescriptionTypeDefaultRequired
sheetTypeForm type:
1. pivot: pivot table
2. table: detailed table
`pivottable`pivot
dataCfgpivot table data mapping configuration itemS2DataConfig✓
optionspivot table property configuration itemSheetComponentOptions✓
adaptiveWhether to adapt to the window size`boolean{ width?: boolean, height?: boolean, getContainer: () => HTMLElement }`false
showPaginationWhether to display the default pagination
(only if the pagination attribute is configured in options)
boolean | {
onShowSizeChange?: (pageSize: number) => void,< br>onChange?: (current: number) => void
}
false
themeCfgcustom table theme styleThemeCfg
loadingControls the loading state of the tableboolean

events

Function description: events of Vue SheetComponent, <SheetComponent @rowCellClick="handleRowCellClick" />

ParameterDescriptionTypeDefaultRequired
spreadsheetcustom table(container: HTMLElement | string, dataCfg: S2DataConfig, options: SheetComponentOptions) => [SpreadSheet] (/docs/api/basic-class/spreadsheet)
rangeSortCallback event triggered when sorting within a group(params: SortParam[] ) => void;
rowCellClickrow head mouse click event(data: TargetCellInfo) => void
rowCellHoverrow header mouse hover event(data: TargetCellInfo) => void
rowCellClickrow head mouse click event(data: TargetCellInfo) => void
rowCellDoubleClickDouble click event of row header(data: TargetCellInfo) => void
rowCellMouseDownrow head mouse down event(data: TargetCellInfo) => void
rowCellMouseUprow head mouse release event(data: TargetCellInfo) => void
rowCellMouseMoverow head mouse move event(data: TargetCellInfo) => void
rowCellCollapseTreeRowsClick the row header to collapse and expand the button in the tree structure(params: {id: number; isCollapsed: boolean; node: Node}) = > void
rowCellScrollrow header cell scroll event({position: CellScrollPosition} ) => void;
rowCellCollapsedNode expand/collapse event callback({ isCollapsed: boolean, collapseFields: Record<string, boolean>, node: Node ) => void;
rowCellAllCollapsedEvent callback for all expanded/collapsed nodes(isCollapsed: boolean ) => void;
colCellHoverColumn header mouse hover event(data: TargetCellInfo) => void
colCellClickColumn head mouse click event(data: TargetCellInfo) => void
colCellDoubleClickMouse double-click event of column header(data: TargetCellInfo) => void
colCellMouseDownColumn head mouse down event(data: TargetCellInfo) => void
colCellMouseUpColumn header mouse release event(data: TargetCellInfo) => void
colCellMouseMoveColumn head mouse move event(data: TargetCellInfo) => void
colCellExpandedAfter enabling hidden column headers (tooltip.operation.hiddenColumns = true), the event callback for column header expansion({collapseAll: boolean ) => void;
colCellHiddenAfter the hidden column header is enabled (tooltip.operation.hiddenColumns = true), the event callback for the hidden column header({data: { currentHiddenColumnsInfo:HiddenColumnsInfo;hiddenColumnsDetail:HiddenColumnsInfo;} ) => void;
dataCellHovermouse hover event of numeric cell(data: TargetCellInfo) => void
dataCellClickmouse click event of numeric cell(data: TargetCellInfo) => void
dataCellDoubleClickNumerical cell double click event(data: TargetCellInfo) => void
dataCellMouseDownmouse down event of numeric cell(data: TargetCellInfo) => void
dataCellMouseUpNumeric cell mouse release event(data: TargetCellInfo) => void
dataCellMouseMoveNumeric cell mouse move event(data: TargetCellInfo) => void
dataCellBrushSelectionValue cell brush selection event(brushRangeDataCells: ( DataCell[] ) => void
dataCellScrollNumeric cell scroll event({position: CellScrollPosition} ) => void;
cornerCellHovercorner mouse hover event(data: TargetCellInfo) => void
cornerCellClickcorner mouse click event(data: TargetCellInfo) => void
cornerCellDoubleClickCorner mouse double click event(data: TargetCellInfo) => void
cornerCellMouseUpcorner mouse down event(data: TargetCellInfo) => void
cornerCellMouseUpcorner mouse release event(data: TargetCellInfo) => void
cornerCellMouseMovecorner mouse movement event(data: TargetCellInfo) => void
mergedCellsHovermerged cell mouse hover event(data: TargetCellInfo) => void
mergedCellsClickmouse click event of merged cells(data: TargetCellInfo) => void
mergedCellDoubleClickMouse double click event of merged cell(data: TargetCellInfo) => void
mergedCellsMouseDownmerged cell down event(data: TargetCellInfo) => void
mergedCellsMouseUpmerged cell release event(data: TargetCellInfo) => void
mergedCellsMouseMovemerged cell move event(data: TargetCellInfo) => void
rangeSortA callback event is triggered when sorting within a group (for now, only pivot tables are supported)(params: SortParam[] ) => void;
rangeSortedA callback event is triggered when the sorting in the group ends (for now, only pivot tables are supported)(event: CanvasEvent ) => void;
rangeFiltertrigger callback event when filtering(data: { filterKey: string; filteredValues: string[] } ) => void;
rangeFilteredTrigger callback event after filtering(data: DataType[] ) => void;
layoutAfterHeaderLayoutHeader layout structure preparation completion event(layoutResult: LayoutResult ) => void;
layoutPaginationpagination event({ pageSize: number; pageCount: number; total: number; current: number;} ) => void;
layoutCellScrollCell scroll event (Deprecated, please use onScroll instead)({position: CellScrollPosition} ) => void;
beforeRenderevent before start render() => void;
afterRenderrender completed event() => void;
mountedtable loading complete event, you can get the table instance details(spreadsheet: SpreadSheet) => void;
destroytable destruction event() => void;
layoutResizechangeSize event of the table(params: ResizeParams) => void;
layoutResizeSeriesWidthtable serial number row width event(params: ResizeParams) => void;
layoutResizeRowWidthrow header cell width change event(params: ResizeParams) => void;
layoutResizeRowHeightrow header cell height change event(params: ResizeParams) => void;
layoutResizeColWidthColumn header cell width change event(params: ResizeParams) => void;
layoutResizeColHeightColumn header cell height change event(params: ResizeParams) => void;
layoutResizeTreeWidthThe overall width change event of the tree line header(params: ResizeParams) => void;
layoutResizeMouseDownmouse down event of resize hotspot( event: MouseEvent, resizeInfo?: ResizeInfo) => void;
layoutResizeMouseUpresize hot zone mouse release event( event:MouseEvent, resizeInfo?: ResizeInfo) => void;
layoutResizeMouseMovemouse move event in resize hotspot( event:MouseEvent, resizeInfo?: ResizeInfo) => void;
keyBoardDownkeyboard down event(event: KeyboardEvent) => void
keyBoardUpkeyboard release event(event: KeyboardEvent) => void
copiedcopy event(data: string) => void
actionIconHoverHover event of the line header operation icon(event: CanvasEvent) => void
actionIconClickaction icon click event(event: CanvasEvent) => void
contextMenuRight cell click event(data: TargetCellInfo) => void
mouseHovertable mouse hover event(event: CanvasEvent) => void
mouseUptable mouse up event(event: CanvasEvent) => void
selectedcell selected event( cells: (Cell[] ) => void
resetinteraction state reset event(event: KeyboardEvent) => void
linkFieldJumpLink field jump event (cellData: @antv/s2 1.37.0 new)(data: { key: string; cellData: Node; record: Data }) => void
scrollcell scroll event (including row header and value cells)({position: CellScrollPosition} ) => void;
colCellBrushSelectionBatch select the column header cells within the brush selection range. During the brush selection process, the brush selection range prompt mask will be displayed. After the brush selection is completed, a tooltip will pop up to display the brushed cell information (only supports pivot tables)(cells: ColCell[]) => void;
rowCellBrushSelectionBatch select the row header cells within the brush selection range. During the brush selection process, a prompt mask for the brush selection range will be displayed. After the brush selection is completed, a tooltip will pop up to display the brushed cell information (only supports pivot tables)( cells: RowCell[]) => void;

SheetComponentOptions

The options of Vue components are inherited from S2Options, there is a little difference

  • The paging configuration has changed from the paging configuration of S2 to the paging configuration of antd-vue, that is, the api transparent transmission of the antd-vue paging component is supported
import type { Pagination, S2Options } from '@antv/s2';
import type { PaginationProps } from 'ant-design-vue';
type SheetComponentOptions = S2Options<
Element | string,
Pagination & PaginationProps
>;

public object

TargetCellInfo

Function description: The return information of the interactive callback function.

ParameterDescriptionTypeDefaultRequired
targetinteraction objectS2CellType
eventeventEvent
viewMetacurrent node informationNode

SortParam

Function description: sorting configuration

parameterillustratetypeDefaultsrequired
sortFieldIdMeasure Id, the Id to be sortedstring-✓
sortMethodsort byASC | DESC | asc | desc-
sortBycustom sorted liststring[]-
sortByMeasureSort by metric value (numeric value) (for pivot tables)string-
queryFilter criteria, narrow the sort range such as: {city:'白山'}Record<string, string>-
typeSorting within the group is used to display the icon (for pivot tables)string-
sortFuncFunction for custom sorting(params: SortFuncParam ) => string[]-

SortFuncParam

Function description: Custom sorting function parameters

parameterillustratetypeDefaultsrequired
sortFieldIdMeasure Id, the Id to be sortedstring-✓
sortMethodsort byASC | DESC | asc | desc-
sortBycustom sorted liststring[]-
sortByMeasureSort by metric value (numeric value) (for pivot tables)string-
queryFilter criteria, narrow the sort range such as: {city:'白山'}Record<string, string>-
typeSorting within the group is used to display icons (applicable to pivot tables)string-
dataList of currently sorted dataArray<string | Record<string, any>>-

CellScrollPosition

Function description: The position information of cell scrolling.

ParameterDescriptionTypeDefaultRequired
scrollXHorizontal scroll offset (relative to the length of the scrollbar track)number
scrollYvertical scroll offset (relative to the length of the scrollbar track)number

HiddenColumnsInfo

Function description: After enabling Hide Column Header, hide the node information of the column header

ParameterDescriptionTypeDefaultRequired
hideColumnNodesCurrently hidden node informationNode[]
displaySiblingNodeInformation about neighboring nodes displayed{ prev:Node;next: Node }

ResizeParams

Function description: table resize (drag to change cell row height and column width) and cell style information

ParameterDescriptionTypeDefaultRequired
inforesize configuration informationResizeInfo
stylestyle-related configuration in optionsstyle

ResizeInfo

Function description: Table resize (drag to change cell row height and column width) configuration information

ParameterDescriptionTypeDefaultRequired
themeresize hotspot configurationResizeArea
typeresize directionHorizontal | Vertical
offsetXhorizontal offsetnumber
offsetYvertical offsetnumber
widthdrag widthnumber
heightdragnumber
sizehot zone sizenumber
effectThe area affected by the drag changeField | Cell | Tree | Series
isResizeAreaWhether it belongs to resize hot areaboolean
idfield idstring
metacell node information corresponding to the resize hot zoneNode
resizedWidthWidth after draggingnumber
resizedHeightHeight after draggingnumber

ViewMeta

object is required, default: {} function description: information such as cell data and position

parametertyperequiredDefaultsFunctional description
spreadsheetSpreadSheetTable class instance, which can access any configuration information
idstringcell unique identifier
xnumbercell x-coordinate
the ynumbercell y coordinate
widthnumbercell width
heightnumbercell height
dataRecord<string, any>Cell Raw Data Metrics
rowIndexnumberThe index of the cell in the row leaf node
colIndexnumberThe index of the cell in the column leaf node
valueFieldstringmetric-id
fieldValueDataItemThe true value of the metric display
isTotalsbooleanWhether it is a total: true is a total, false is a subtotal
rowQueryRecord<string, any>Row query condition
colQueryRecord<string, any>Column query condition
rowIdstringthe row id of the cell
colIdstringthe column id of the cell