Loading...
Form parameter configuration
const s2Options = {width: 600,height: 400,hierarchyType: 'grid'}
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
width | number | 600 | table width | |
height | number | 480 | form height | |
debug | boolean | false | Whether to enable debug mode | |
hierarchyType | grid | tree | customTree | grid | The display method of line headers, grid: tiled grid structure, tree: tree structure. customTree: custom tree structure | |
conditions | Conditions | Conditional Mode Configuration | ||
totals | Totals | Subtotal Total Configuration | ||
tooltip | Tooltips | tooltip configuration | ||
interaction | Interaction | Form interaction configuration | ||
pagination | Pagination | paging configuration | ||
frozen | Frozen | Column Header Freezing Configuration | ||
seriesNumber | SeriesNumber | Whether to display the series number | ||
showDefaultHeaderActionIcon | boolean | true | Whether to display the default row and column header operation icons | |
headerActionIcons | HeaderActionIcon[] | false | Customize row and column header action icons (need to set showDefaultHeaderActionIcon to false ) | |
customSVGIcons | CustomSVGIcon[] | false | Custom svg icons | |
style | style | Cell style settings, such as layout type, width and height, margin, whether to hide the value column header, etc. | ||
hd | boolean | true | Whether to enable high-definition screen adaptation to solve the problem of blurred font rendering on high-definition retina screens when switching between multiple screens. see more | |
mergedCellsInfo | MergedCellInfo[][] | Merge cell information | ||
placeholder | string | (meta: Record<string, any>) => string | fill content for empty cells | ||
cornerText | string | Custom corner header text (valid when custom tree hierarchyType: customTree ) | ||
cornerExtraFieldText | string | Customize the text of the virtual value field of the corner header (valid when the value is linked to the line header, replace the two words "value") | ||
dataCell | DataCellCallback | custom cell | ||
cornerCell | Cell Callback | Custom cornerCell | ||
rowCell | Cell Callback | Custom header cell | ||
colCell | Cell Callback | Custom column header cell | ||
cornerHeader | CornerHeaderCallback | custom angle head | ||
layout Hierarchy | Layout Hierarchy | custom hierarchy | ||
layoutArrange | LayoutArrange | custom sort order | ||
layoutCoordinate | layoutCoordinate | custom coordinates | ||
layoutDataPosition | layoutDataPosition | custom data | ||
filterDisplayDataItem | FilterDataItemCallback | filter data | ||
mappingDisplayDataItem | MappingDataItemCallback | Convert data for tooltip display | ||
dataSet | DataSet | custom data set | ||
supportsCSSTransform | boolean | false | After enabling it, CSS transform is supported, which solves the problem that the mouse coordinates respond incorrectly after the parent element is set to transform | |
devicePixelRatio | number | window.devicePixelRatio | Custom Device Pixel Ratio |
Function description: SeriesNumber configuration
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
enable | Whether to display the series number | boolean | false | |
text | custom series number header cell text | string | - |
Function description: Row and column header freeze configuration
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
rowHeader | boolean | true | When the value is number, it identifies the maximum area where the line header is frozen, and the range of values is (0, 1). 0 means that the line header is not frozen. When the value is boolean, true corresponds to freezing the maximum area is 0.5, false corresponds to 0. (only pivot mode works) | |
rowCount | number | 0 | The number of frozen rows, counting from the top (schedules are valid) | |
colCount | number | 0 | The number of frozen columns, counting from the left (schedules are valid) | |
trailingRowCount | number | 0 | Number of frozen rows, counting from the bottom (valid for schedules) | |
trailingColCount | number | 0 | Number of frozen columns, counting from the right (schedules are valid) |
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
linkFields | The mark field is a link style, which is used for external link jumps | string[] | (meta: Node | ViewMeta) => boolean | ||
selectedCellsSpotlight | Whether to enable the selected highlight spotlight effect | boolean | false | |
hoverHighlight | Highlight the current cell, and the corresponding row and column headers when the mouse hovers | boolean | true | |
hoverFocus | After the mouse hovers over the current cell for more than the default 800ms, it will keep the current highlight and display the tooltip. The hovering time is controlled by setting the duration | `boolean\ | {duration: number}` | true |
hiddenColumnFields | It is used to configure the columns that are hidden by default. The pivot table needs to configure the unique id of the column header, and the detail table can be configured with the field field of the column header. | string[] | ||
enableCopy | Whether to allow copying | boolean | false | |
withHeader | Whether to copy data with header information | boolean | false | |
withFormat | Whether to use the field format format to copy | boolean | false | |
customInteractions | Customize interaction details | CustomInteraction[] | ||
scrollSpeedRatio | Used to control the scroll rate, divided into horizontal and vertical directions, the default is 1 | ScrollSpeedRatio | ||
autoResetSheetStyle | Used to control whether to reset the interactive state when clicking the area outside the table and pressing the esc key | boolean | true | |
resize | Used to control whether the resize hotspot is displayed | boolean \ | ResizeInteractionOptions | true |
brushSelection | Whether to allow cells (including row headers, column headers, and value cells) to be selected. Row header, column header selection only supports pivot tables | boolean \ | Brush Selection | true |
multiSelection | Whether to allow multiple selection (including row headers, column headers, and value cells) | boolean | true | |
rangeSelection | Whether to allow quick multiple selection of intervals | boolean | true | |
scrollbarPosition | Used to control whether the scroll bar is displayed on the edge of the content area or the edge of the canvas | `content\ | canvas` | content |
eventListenerOptions | Optional configuration of the event listening function addEventListener , which can control whether the event is triggered from the bubbling phase or the capturing phase | false | ||
selectedCellHighlight | Highlight behavior after grid is selected rowHeader: Whether to highlight the row header where the selected grid is located colHeader: Whether to highlight the column header where the selected grid is located currentRow: Whether to highlight the row where the grid is located currentCol: whether to highlight the column where the grid is located true: Same as {rowHeader: true, colHeader: true} | `boolean | { rowHeader?: boolean, colHeader?: boolean, currentRow?: boolean, currentCol?: boolean }` | |
overscrollBehavior | Controls the behavior of scrolling to bounds, which disables the browser's default scrolling behavior. details | auto | contain | none | null | auto |
Function description: custom interaction, inherit baseEvent: concrete example
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
key | unique identifier for the interaction | string | ✓ | |
interaction | Interaction Constructor | ✓ |
interface ScrollSpeedRatio {horizontal?: number; // 水平滚动速率,默认为 1vertical?: number; // 垂直滚动速率,默认为 1}
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
rowCellVertical | Whether to open the line header vertical resize hot zone | boolean | true | |
cornerCellHorizontal | Whether to enable the resize hotspot in the horizontal direction of the corner head | boolean | true | |
colCellHorizontal | Whether to enable the horizontal resize hotspot of the column header | boolean | true | |
colCellVertical | Whether to enable the column header vertical resize hot zone (this configuration is invalid when the column header is hidden) | boolean | true | |
rowResizeType | It is used to control whether the row height resize will take effect for all Cells at the same time, or only for the current row. Applies to all rows by default | all | current | all | |
disable | It is used to control whether the row height resize is effective or not. View example | (resizeInfo: S2CellType ) => boolean | ||
visible | Customize whether the current cell displays the resize hotspot | (cell: S2CellType ) => boolean |
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
dataCell | Whether to allow numerical cell selection | boolean | true | |
rowCell | Whether to allow row header cell selection (only supports pivot tables) | boolean | false | |
colCell | Whether to allow column header cell selection (only supports pivot tables) | boolean | false |
Type: object
, required , default value: {}
Function description: Configure field marking. Divided into text (text), background (background), histogram (interval), icon (icon).
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
text | text field tag | Condition [] | - | |
background | background field tag | Condition [] | - | |
interval | Histogram Field Markers | Condition [] | - | |
icon | Icon Field Marker | IconCondition | - |
Type: object
, required
Function description: Configure conditional formatting. Including text (text), background (background), histogram (interval).
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
field | 1. Field ID 2. Use regular expressions to match field IDs | string | RegExp | ✓ | |
mapping | role mapping function | function | ✓ |
type MappingFunction = (fieldValue: number | string | null,data: Record<string, any>,node: DataCell | HeaderCell) => {// 仅用于图标字段标记,可选icon?: string;// 背景 | 文本 | 柱状图 | 图标 字段标记颜色填充,必选fill: string;// 仅用于柱状图字段标记,可选isCompare?: boolean;minValue?: number;maxValue?: number;// 仅用于背景字段标记,可选。(当背景颜色较暗,将文本颜色设置为白色。优先级低于 文本字段标记)intelligentReverseTextColor?: boolean;} | null | undefined // 返回值为空时,表示当前字段不显示字段标记样式
Example usage of condition:
const options = {conditions: {text: [{field: "province",mapping: () => ({fill: "rgba(0, 0, 0, .65)",}),},],interval: [{field: "sub_type",mapping: () => {return {fill: "green",};},},],background: [{field: "count",mapping: () => ({fill: "#ff00ff",}),},],},};
Type: object
, required , default value: null
Function description: Configure icon (icon) conditional formatting.
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
field | Field ID | string | ✓ | |
position | The position of the icon relative to the text | left | right | right | |
mapping | mapping function | MappingFunction | ✓ |
Example of icon condition usage:
const options = {conditions: {icon: [{field: "profit",position: "left",mapping: () => {return {icon: "InfoCircle",fill: "red",};},},],},};
object is required , default: null Function description: subtotal total configuration
object is required , default: null Function description: subtotal total configuration
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
showGrandTotals | Whether to display the total | boolean | false | |
showSubTotals | Whether to display subtotals. When configured as an object, always controls whether to always display subtotals when there are less than 2 subdimensions, and does not display by default | boolean | { always: boolean } | false | |
subTotalsDimensions | Summary Dimensions for Subtotals | string[] | [] | |
reverseGrandTotalsLayout | total layout position, default bottom or right | boolean | false | |
reverseSubTotalsLayout | Subtotal layout position, default bottom or right | boolean | false | |
label | total alias | string | ||
subLabel | subtotal alias | string | ||
calcGrandTotals | Custom Calculated Totals | CalcTotals | ||
calcSubTotals | Custom Calculated Subtotals | CalcTotals |
object optional , default: null Function description: calculate subtotal total configuration
parameter | illustrate | type | required | Defaults |
---|---|---|---|---|
aggregation | aggregation method | Aggregation.SUM | Aggregation.MIN | Aggregation.MAX | Aggregation.AVG | ||
calcFunc | custom method | (query: Record<string, any>, arr: Record<string, any>[]) => number |
object optional , default: null function description: tooltip configuration
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
showTooltip | Whether to display tooltip | boolean | true | |
operation | tooltip operation configuration item | Tooltip Operation | - | |
rowCell | Row header cell configuration | BaseTooltipConfig | - | |
colCell | Column header cell configuration | BaseTooltipConfig | - | |
dataCell | Value cell configuration | BaseTooltipConfig | - | |
cornerCell | Corner cell configuration | BaseTooltipConfig | - | |
render | To customize the entire tooltip, you can inherit BaseTooltip and rewrite some methods yourself | RenderTooltip | - | |
content | Customize tooltip content | ReactNode | Element | string or (cell, defaultTooltipShowOptions) => ReactNode | Element | string | - | |
autoAdjustBoundary | Automatically adjust the display position when the tooltip exceeds the boundary, container: the chart area, body: the entire browser window, set to null to disable this function | container | body | body | |
adjustPosition | Customize tooltip position, | (positionInfo: TooltipPositionInfo ) => {x: number, y: number} | ||
getContainer | Customize the tooltip to mount the container, | () => HTMLElement | document.body | |
className | additional container class names, | string | - | |
style | additional container styles, | CSSProperties | - |
object optional , default: null Function description: tooltip basic common configuration
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
showTooltip | Whether to display tooltip | boolean | false | |
operation | tooltip operation configuration item | Tooltip Operation | - | |
content | Customize tooltip content | ReactNode | Element | string | or (cell, defaultTooltipShowOptions) => ReactNode | Element | string | - |
object optional , default: null Function description: tooltip coordinate information
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
position | The default tooltip position coordinate after calculation (default offset + autoAdjustBoundary) | TooltipPosition | ✓ | |
event | Current click event information | event | ✓ |
object optional , default: null function description: tooltip operation configuration item
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
hiddenColumns | Whether to enable hidden columns (leaf nodes are valid) | boolean | false | |
sort | Whether to enable sorting within the group | boolean | false | |
tableSort | Whether to enable sorting of list column headers | boolean | false | |
menus | Custom Action Configuration Items | TooltipOperatorMenu[] | - | |
onClick | Action item click callback function | ({ item, key, keyPath, domEvent }) => void | - |
object is required , default: null Function description: tooltip display configuration
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
position | TooltipPosition | ✓ | tooltip display location | |
data | TooltipData | tooltip data | ||
cellInfos | Record<string, any> | cell information | ||
options | TooltipOptions | Tooltip part configuration | ||
content | ReactNode | string | or (cell, defaultTooltipShowOptions: TooltipShowOptions) => ReactNode | string | Customize tooltip content | ||
event | Event | Current event Event |
object is required , default: null Function description: tooltip coordinates
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
x | number | ✓ | Abscissa | |
the y | number | ✓ | Y-axis |
object optional , default: null function description: tooltip data
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
summaries | TooltipSummaryOptions | List of selected item statistics (differentiated by measure value) | ||
details | ListItem | Data Point Details | ||
headInfo | TooltipHeadInfo | list of axes (row/column headers) | ||
name | string | current cell name | ||
tips | string | Tips/Instructions | ||
infos | string | Prompt information at the bottom (can be used for shortcut key operation prompts) |
object is optional , default: null Function description: tooltip List of selected item statistics (differentiated by measurement value)
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
name | string | ✓ | name | |
value | number | string | ✓ | value | |
selectedData | Record<string, any> | ✓ | currently selected data list |
object optional , default: null function description: tooltip axis (row/column header) list
object optional , default: null function description: tooltip data point detail data
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
name | string | ✓ | name | |
value | string | number | ✓ | value | |
icon | ReactNode | custom icon component |
object is required , default: null Function description: tooltip partial configuration
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
hideSummary | boolean | false | Whether to hide selected item statistics | |
operator | TooltipOperatorOptions | Action Bar Configuration | ||
onlyShowOperator | boolean | false | Whether tooltip only shows action menu items | |
isTotals | boolean | false | Is it a total/subtotal cell | |
onlyShowCellText | boolean | false | Whether to display cell prompt information | |
enableFormat | boolean | false | Whether to enable formatting | |
forceRender | boolean | false | Whether to force the dom to be cleared |
object optional , default: null Function description: tooltip operation bar configuration
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
menus | TooltipOperatorMenu[] | action item list | ||
onClick | ({ item, key, keyPath, domEvent }) => void | Click event, transparently transmit onClick of antd Menu component | ||
selectedKeys | string[] | Initially selected menu item key array, transparently transmit the selectedKeys of the antd Menu component |
object is required , default: null Function description: tooltip list of operation items
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
key | string | ✓ | Uniquely identifies | |
text | ReactNode | string | name | ||
icon | ReactNode | string | custom icon | ||
visible | boolean | (cell) => boolean | true | Whether the operation item is displayed, you can pass in a function to dynamically display it according to the current cell information | |
onClick | ( cell : S2CellType : ) => void | Click event callback (cell is the cell corresponding to the current tooltip) | ||
children | TooltipOperatorMenu | submenu list |
boolean | object required , default: null Function description: Paging configuration
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
pageSize | Quantity per page | number | - | ✓ |
current | current page (starting from 1) | number | 1 | ✓ |
total | Total number of data | number | - |
object is required , default: null Function description: style setting
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
layoutWidthType | adaptive | colAdaptive | compact | Cell Width Layout Typeadaptive : Rows and columns are equal in width, equally dividing the entire Canvas canvas widthcolAdaptive : Equal width of columns, compact layout of line headers, the remaining width of the column equally divided canvas width minus the width of line headerscompact : compact row and column layout, when the indicator dimension is small, it cannot cover the entire canvas | ||
dataCell | DataCell | Value cell configuration | ||
colCell | ColCell | Column header cell configuration | ||
rowCell | RowCell | Row header cell configuration |
object is required , default: null Function description: Numerical cell configuration
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
width | cell width | number | 96 | - |
height | cell height | number | 30 | - |
valuesCfg | cell configuration | { originalValueField?: string, widthPercent?: number[], showOriginalValue?: boolean } | - |
object is required , default: null Function description: Column header cell configuration
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
width | Cell width, which can be dynamically set according to the current column header node (leaf nodes are valid) | number | (colNode: Node) => number | 96 | |
height | Cell height, which can be dynamically set according to the current column header node (leaf nodes are valid) | number | (colNode: Node) => number | 30 | |
widthByField | Set the width according to the measurement value (drag or preset width scene), field corresponds to the field or column header id in s2DataConfig.fields.columns , see details | Record<string, number> | - | |
heightByField | Set the height according to the measurement value (drag or preset height scene), the field corresponds to the field or column header id in s2DataConfig.fields.columns , see details | Record<string, number> | - | |
hideValue | The default value hangs the column header, which will display the column header and the value at the same time, and hide the value to make it more beautiful. (that is, s2DataConfig.fields.values and it is only valid for a single value, and it is recommended to use hidden column headers for multiple values) | boolean | false |
object is required , default: null Function description: row header cell configuration
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
width | The row cell width can be dynamically set according to the current row header node, and the tree structure is also applicable | number | (rowNode: Node) => number | Tiles: 96 , Trees: 120 | |
height | Row cell height, which can be dynamically set according to the current row header node | number | (rowNode: Node) => number | 30 | |
collapseFields | Custom folded nodes for row headers in tree mode. Supports two formats: id ( 'root[&] 行头维度值' ) and dimension field ( 'city' ). The priority is higher than collapseAll and expandDepth , and the priority is the lowest when it is set to null . view demo | Record<string, boolean> | ||
collapseAll | Whether to collapse all line headers by default in tree structure mode. | boolean | false | |
expandDepth | In the tree structure mode, the row header expands the expanded level by default (the level starts from 0), and when it is set to null , the priority is the lowest | number | ||
showTreeLeafNodeAlignDot | In the tree mode, whether the row header leaf nodes display the hierarchical placeholders | boolean | false | |
withByField | Set the width of each line according to field . field corresponds to the field or column header id in s2DataConfig.fields.rows , see details | Record<string, number> | - | |
heightByField | Set the height of each row according to field .1. Pivot table: field corresponds to field or column header id in s2DataConfig.fields.rows .2. Detailed table: field corresponds to the row number, starting from 1 . check the details | Record<string, number> | - |
DataCellCallback = (viewMeta: ViewMeta, s2: Spreadsheet) => G.Group;
Function description: custom value cell, ViewMeta
object is required, default: {} function description: information such as cell data and position
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
spreadsheet | SpreadSheet | Table class instance, which can access any configuration information | ||
id | string | cell unique identifier | ||
x | number | cell x-coordinate | ||
the y | number | cell y coordinate | ||
width | number | cell width | ||
height | number | cell height | ||
data | Record<string, any> | Cell Raw Data Metrics | ||
rowIndex | number | The index of the cell in the row leaf node | ||
colIndex | number | The index of the cell in the column leaf node | ||
valueField | string | metric-id | ||
fieldValue | DataItem | The true value of the metric display | ||
isTotals | boolean | Whether it is a total: true is a total, false is a subtotal | ||
rowQuery | Record<string, any> | Row query condition | ||
colQuery | Record<string, any> | Column query condition | ||
rowId | string | the row id of the cell | ||
colId | string | the column id of the cell |
CellCallback = (node: Node, spreadsheet: SpreadSheet, ...restOptions: unknown[]) => G.Group;
Function description: custom cell
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
node | The currently rendered node node | node | - | ✓ |
spreadsheet | Table class instance, which can access any configuration information | SpreadSheet | - | ✓ |
restOptions | Indeterminate parameters, pass additional information | unknown[] | - |
CornerHeaderCallback = (parent: S2CellType, spreadsheet: SpreadSheet, ...restOptions: unknown[]) => void;
Function description: custom corner head
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
parents | parent cell | S2CellType | - | ✓ |
spreadsheet | Table class instance, which can access any configuration information | SpreadSheet | - | ✓ |
restOptions | Indeterminate parameters, pass additional information | unknown[] | - |
LayoutHierarchy = (spreadsheet: SpreadSheet, node: Node) => LayoutHierarchyReturnType;
Function description: custom hierarchical structure
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
spreadsheet | SpreadSheet | ✓ | Table class instance, which can access any configuration information | |
node | node | ✓ | The currently rendered node node |
interface LayoutHierarchyReturnType {push?: Node[];unshift?: Node[];delete?: boolean;}
LayoutArrange = (spreadsheet: SpreadSheet, parent: Node, field: string, fieldValues: string[]) => string[];
Function description: custom order
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
spreadsheet | SpreadSheet | ✓ | Table class instance, which can access any configuration information | |
node | node | ✓ | The currently rendered node node | |
field | string | ✓ | current field name | |
fieldValues | string[] | ✓ | current field value |
LayoutCoordinate = (spreadsheet: SpreadSheet, rowNode: Node, colNode: Node) => void
Function description: custom coordinates
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
spreadsheet | SpreadSheet | ✓ | Table class instance, which can access any configuration information | |
rowNode | node | ✓ | row node | |
colNode | node | ✓ | column node |
LayoutCellMeta = (spreadsheet: SpreadSheet, getCellData: GetCellMeta) => GetCellMeta
Function description: custom data
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
spreadsheet | SpreadSheet | ✓ | Table class instance, which can access any configuration information | |
getCellData | GetCellMeta | ✓ | Get information such as cell data and position |
type GetCellMeta = (rowIndex?: number, colIndex?: number) => ViewMeta;
Function description: Register a custom operation icon
for the row, column, and corner headers of the table. If the configuration bit is empty, the default action icon
of the pivot table will be displayed.
parameter | type | required | Defaults | Functional description | Version |
---|---|---|---|---|---|
iconNames | string[] | ✓ | The name of the registered icon, or the name of the icon registered by the user through customSVGIcons | ||
belongs to Cell | string[] | ✓ | The cell names that need to add operation icons cornerCell, colCell, rowCell | ||
defaultHide | boolean | (mete: Node, iconName: string) => boolean | Whether to hide by default, if it is true, it will be displayed after hover; if false, it will always be displayed | 1.26.0 supports configuration as a function | ||
displayCondition | (mete: Node, iconName: string) => boolean | Display filter conditions, user-defined which levels or cells need to display icons through this callback function. All icons that return true will be shown to the user. | 1.26.0 returns the iconName and presses a single icon to control the display and hiding | ||
onClick | (headerIconClickParams: HeaderIconClickParams) => void; | ✓ | 1.26.0 | ||
onHover | (headerIconHoverParams: HeaderIconHoverParams) => void; | 1.26.0 |
Function description: After clicking the custom operation icon, the current icon returned by the pivot table is related
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
iconName | The name of the currently clicked icon | string | - | ✓ |
meta | The meta information of the current cell | node | - | ✓ |
event | Current click event information | event | false | ✓ |
Function description: It is used for users to register their own icon
, currently only supports svg
format
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
name | string | ✓ | icon name | |
svg | string | ✓ | Currently supports svg strings in three formats: base64, svg local files, online image URLs |
Function description: basic data format
export interface MultiData {label?: string;values: SimpleData[][];originalValues?: SimpleData[][]}export type SimpleData = string | number;export type DataItem = SimpleDataItem | MultiData;
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
colNodes | all nodes in the column | Node[] | ||
cols Hierarchy | column structure information | Hierarchy | ||
rowNodes | all nodes of the row | Node[] | ||
rows Hierarchy | row structure information | Hierarchy | ✓ | |
rowLeafNodes | All leaf nodes of the row, for Cartesian intersection | Node[] | ||
colLeafNodes | All leaf nodes of the column, for Cartesian intersection | Node[] | ||
getViewMeta | Obtain the information corresponding to the coordinates of [x,y] crossed out | (rowIndex: number, colIndex: number) => ViewMeta | ||
spreadsheet | Table class instance, which can access any configuration information | SpreadSheet |
DataSet = (spreadsheet: SpreadSheet) => BaseDataSet;
Function description: set the default merged cell information
parameter | illustrate | type | Defaults | required |
---|---|---|---|---|
colIndex | the column index of the cell | number | - | |
rowIndex | the row index of the cell | number | - | |
showText | showText: true is set, the meta information of the current grid is displayed as the meta of the merged cell.By default, the first clicked cell is selected. | booelan | - |