API

Style
style

object is required , default: null Function description: style setting

parametertyperequiredDefaultsFunctional description
layoutWidthTypeadaptive | colAdaptive | compactCell Width Layout Type
adaptive : Rows and columns are equal in width, equally dividing the entire Canvas canvas width
colAdaptive : Equal width of columns, compact layout of line headers, the remaining width of the column equally divided canvas width minus the width of line headers
compact : compact row and column layout, when the indicator dimension is small, it cannot cover the entire canvas
dataCellDataCellValue cell configuration
colCellColCellColumn header cell configuration
rowCellRowCellRow header cell configuration

DataCell

object is required , default: null Function description: Numerical cell configuration

parameterillustratetypeDefaultsrequired
widthcell widthnumber96-
heightcell heightnumber30-
valuesCfgcell configuration{ originalValueField?: string, widthPercent?: number[], showOriginalValue?: boolean }-

ColCell

object is required , default: null Function description: Column header cell configuration

parameterillustratetypeDefaultsrequired
widthCell width, which can be dynamically set according to the current column header node (leaf nodes are valid)number | (colNode: Node) => number96
heightCell height, which can be dynamically set according to the current column header node (leaf nodes are valid)number | (colNode: Node) => number30
widthByFieldSet 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 detailsRecord<string, number>-
heightByFieldSet 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 detailsRecord<string, number>-
hideValueThe 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)booleanfalse

RowCell

object is required , default: null Function description: row header cell configuration

parameterillustratetypeDefaultsrequired
widthThe row cell width can be dynamically set according to the current row header node, and the tree structure is also applicablenumber | (rowNode: Node) => numberTiles: 96 , Trees: 120
heightRow cell height, which can be dynamically set according to the current row header nodenumber | (rowNode: Node) => number30
collapseFieldsCustom 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>
collapseAllWhether to collapse all line headers by default in tree structure mode.booleanfalse
expandDepthIn 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 lowestnumber
showTreeLeafNodeAlignDotIn the tree mode, whether the row header leaf nodes display the hierarchical placeholdersbooleanfalse
withByFieldSet the width of each line according to field . field corresponds to the field or column header id in s2DataConfig.fields.rows , see detailsRecord<string, number>-
heightByFieldSet 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>-