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

SpreadSheet

Previous
S2Event
Next
Interaction

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...

Function description: properties and methods related to form instances. details

const s2 = new PivotSheet()
s2.isPivotMode()
parameterillustratetypeVersion
dommounted container nodestring | HTMLElement
themetheme configurationS2Theme
storesome information storedstore
dataCfgdata configurationS2DataConfig
optionstable configurationS2Options
dataSetTabular Dataset (fields, data, sort)BaseDataSet
facetcurrent viewable rendering areaBaseFacet
tooltiptooltipBaseTooltip
containerg-canvas exampleCanvas
interactioninteractInteraction
hdHD adaptationHdAdapter
onevent subscription(event: S2Event , listener: () => void) => void
emitevent release(event: S2Event , ...args: any[]) => void
getDataSetget dataset(options: S2Options ) => BaseDataSet
isPivotModeIs it a pivot table() => boolean
isHierarchyTreeTypeIs it a tree structure() => boolean
isFrozenRowHeaderWhether it is the state of freezing line header() => boolean
isTableModeIs it a schedule() => boolean
isValueInColsIs the value placed at the beginning of the line() => boolean
clearDrillDownDataClear drill down data(rowNodeId?: string) => void
showTooltipshow tooltip(showOptions: TooltipShowOptions ) => void
showTooltipWithInfoDisplay tooltip, and display some default information(event: CanvasEvent | MouseEvent , data: TooltipData[] , options?: TooltipOptions ) => void
hideTooltiphide tooltip() => void
destroyTooltipdestroy tooltip() => void
registerIconsRegister custom svg icons (according to options.customSVGIcons )() => void
setDataCfgUpdate data configuration(dataCfg: S2DataConfig , reset?: boolean ) => voidThe reset parameter needs to be used in @antv/s2^1.34.0 version
setOptionsUpdate table configuration(options: S2Options , reset?: boolean) => voidThe reset parameter needs to be used in @antv/s2^1.34.0 version
renderRe-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>
destroydestroy form() => void
setThemeCfgUpdate theme configuration (including theme schema, color palette, theme name)(themeCfg: ThemeCfg ) => void
setThemeUpdate theme (only contains theme scheme)(theme: S2Theme ) => void
updatePaginationupdate pagination(pagination: Pagination ) => void
changeSheetSizeModify table canvas size without reloading data(width?: number, height?: number) => void
getLayoutWidthTypeGet the cell width layout type (LayoutWidthType: adaptive(自适应) | colAdaptive(列自适应) | compact(紧凑) )() => LayoutWidthType
getRowNodesGet row header node(level: number) => Node[]
getRowLeafNodesGet the row header leaf node() => Node[]
facet.getColNodesGet column head node(level: number) => Node[]
facet.getColLeafNodesGet the column head leaf node() => Node[]
getCellGet the current cell according to event.target(target: EventTarget ) => S2CellType
getCellTypeGet the current cell type according to event.target(target: EventTarget ) => CellType
getTotalsConfigGet Total Subtotal Configuration(dimension: string) => Total
getCanvasElementGet the <canvas/> HTML element corresponding to the table() => HTMLCanvasElement
updateSortMethodMapUpdate the node sorting method map stored in the store, replace is whether to overwrite the last value(nodeId: string, sortMethod: string, replace?: boolean) => void
getMenuDefaultSelectedKeysGet the key value of the menu item selected in the tooltip(nodeId: string) => string[]
measureTextGet the measurement information of the text in the canvas(text: string , font: TextTheme ) => TextMetrics | null
measureTextWidthGet the measured width of the text in the canvas(text: string , font: TextTheme ) => number | null
measureTextHeightGet the measured height of the text in the canvas(text: string , font: TextTheme ) => number | null

S2MountContainer

type S2MountContainer = string | HTMLElement;

ScrollOffsetConfig

Function description: Scroll offset configuration

interface ScrollOffsetConfig {
offsetX?: {
value: number | undefined;
animate?: boolean;
};
offsetY?: {
value: number | undefined;
animate?: boolean;
};
}

CellType

Function description: cell type

export enum CellType {
DATA_CELL = 'dataCell', // 数值单元格
ROW_CELL = 'rowCell', // 行头单元格
COL_CELL = 'colCell', // 列头单元格
CORNER_CELL = 'cornerCell', // 角头单元格
MERGED_CELL = 'mergedCell', // 合并后的单元格
}

BBox

Functional Description: Box Model

type BBox = {
x: number;
y: number;
minX: number;
minY: number;
maxX: number;
maxY: number;
width: number;
height: number;
};