!!!###!!!title=ListTable-columns-sparkline——VisActor/VTable option documents!!!###!!!!!!###!!!description=VisActor/VTable option documents. This chapter mainly introduces VTable configuration items and their usage to quickly generate the required tables.!!!###!!!

ListTable-columns-sparkline.cellType = 'sparkline'

Specify the column type as 'sparkline', cellType can be omitted and defaults to 'text'

ListTable-columns-sparkline.headerType = 'text'

Specify header type, optional: 'text'|'link'|'image'|'video'|'checkbox', default 'text'.

ListTable-columns-sparkline.field

string

Required Specify the header field, corresponding to the data source attribute

ListTable-columns-sparkline.fieldFormat

FieldFormat

Configure data formatting

type FieldFormat = (record: any) => any;

ListTable-columns-sparkline.width

number
string

Specifies the column width, which can be a specific value, 'auto', or a percentage like '20%'. If 'auto' is specified, the column width will be automatically adjusted according to the length of the entire column text; If a percentage is specified, the current column width will be adjusted according to the total table width;

ListTable-columns-sparkline.maxWidth

number
string

Limit the maximum column width of this column

ListTable-columns-sparkline.minWidth

number
string

Limit the minimum column width of this column

ListTable-columns-sparkline.title

string

Header name

ListTable-columns-sparkline.headerStyle

IStyleOption
Function

Header cell style, configuration options are slightly different depending on the headerType. The configuration options for each headerStyle can be referred to:

  • When headerType is 'text', it corresponds to headerStyle
  • When headerType is 'link', it corresponds to headerStyle
  • When headerType is 'image', it corresponds to headerStyle
  • When headerType is 'video', it corresponds to headerStyle

ListTable-columns-sparkline.style

*

Body cell style, type declaration:

style?: IStyleOption | ((styleArg: StylePropertyFunctionArg) => IStyleOption);

The type declaration for the callback function argument StylePropertyFunctionArg is as follows:

interface StylePropertyFunctionArg {
  row: number;
  col: number;
  /** Table instance */
  table: TableAPI;
  /** If format exists, the formatted or calculated value */
  value: string;
  /** Original value */
  dataValue: string;
  /** Specific to ProgressBarType, represents the proportion of the current value in the overall data range */
  percentile?: number;
  /** Path information of cell header */
  cellHeaderPaths: ICellHeaderPaths;
}

The type structure of IStyleOption is as follows:

Click to expand

ListTable-columns-sparkline.headerIcon

string
Object
Array

Header cell icon configuration. Available configuration types are:

string | ColumnIconOption | (string | ColumnIconOption)[];

For the specific configuration of ColumnIconOption, refer to the definition

ListTable-columns-sparkline.icon

string
Object
Array
Funciton

Body cell icon configuration.

icon?:
    | string
    | ColumnIconOption
    | (string | ColumnIconOption)[]
    | ((args: CellInfo) => string | ColumnIconOption | (string | ColumnIconOption)[]);
Click to expand

ListTable-columns-sparkline.sort

boolean
Function

Whether to support sorting, or define a function to specify sorting rules

ListTable-columns-sparkline.showSort

boolean

Whether to display the sort icon, no real sorting logic. If the sort field is set, this can be omitted

ListTable-columns-sparkline.disableHover

boolean

This column does not support hover interaction behavior

ListTable-columns-sparkline.disableSelect

boolean

This column does not support selection

ListTable-columns-sparkline.disableHeaderHover

boolean

This header column does not support hover interaction behavior

ListTable-columns-sparkline.disableHeaderSelect

boolean

This header column does not support selection

ListTable-columns-sparkline.description

string

The description of the header when hover, which will be displayed in the form of a tooltip

ListTable-columns-sparkline.dropDownMenu

Array

The drop-down menu item configuration. The drop-down menu item can be a first-level menu item or a second-level menu item, as long as there is a configuration. The specific type is MenuListItem[].

ListTable-columns-sparkline.headerCustomRender

Function
Object

Custom rendering of header cell, in function or object form. The type is: ICustomRenderFuc | ICustomRenderObj.

demo link tutorial link

The definition of ICustomRenderFuc is:

 type ICustomRenderFuc = (args: CustomRenderFunctionArg) => ICustomRenderObj;

The type declaration for callback function argument CustomRenderFunctionArg is:

interface CustomRenderFunctionArg {
  row: number;
  col: number;
  table: TableAPI;
  /**Formatted value */
  value: string|number;
  /**Original value */
  dataValue: string|number;
  rect?: RectProps;
}

The definition of ICustomRenderObj is as follows:

export type ICustomRenderObj = {
  /** Configured type collection */
  elements: ICustomRenderElements;
  /** Desired cell height */
  expectedHeight: number;
  /** Expected cell width */
  expectedWidth: number;
  /**
   * Do you still need to render content by default? Only if the configuration is true, it will be drawn. By default, it will not be drawn.
   */
  renderDefault?: boolean;
};

Detailed configuration instructions are as follows:

Click to expand

ListTable-columns-sparkline.headerCustomLayout

Function

Custom layout element definition for header cell, suitable for complex layout cell content.

(args: CustomRenderFunctionArg) => ICustomLayoutObj;

The type declaration for callback function argument CustomRenderFunctionArg is:

interface CustomRenderFunctionArg {
  row: number;
  col: number;
  table: TableAPI;
  /**Formatted value */
  value: string|number;
  /**Original value */
  dataValue: string|number;
  rect?: RectProps;
}

The ICustomLayoutObj type is defined as follows

export type ICustomLayoutObj = {
  rootContainer: Container | any;
  /**
   * Do you still need to render content by default? Only if the configuration is true, it will be drawn. By default, it will not be drawn.
   */
  renderDefault?: boolean;
  /**
   * Whether to also enable padding in style
   */
  enableCellPadding?: boolean;
};

Detailed configuration instructions are as follows:

Click to expand

ListTable-columns-sparkline.customRender

Function
Object

Custom rendering for body cell header cell, in function or object form. The type is: ICustomRenderFuc | ICustomRenderObj.

demo link tutorial link

The definition of ICustomRenderFuc is:

 type ICustomRenderFuc = (args: CustomRenderFunctionArg) => ICustomRenderObj;

The type declaration for callback function argument CustomRenderFunctionArg is:

interface CustomRenderFunctionArg {
  row: number;
  col: number;
  table: TableAPI;
  /**Formatted value */
  value: string|number;
  /**Original value */
  dataValue: string|number;
  rect?: RectProps;
}

The definition of ICustomRenderObj is as follows:

export type ICustomRenderObj = {
  /** Configured type collection */
  elements: ICustomRenderElements;
  /** Desired cell height */
  expectedHeight: number;
  /** Expected cell width */
  expectedWidth: number;
  /**
   * Do you still need to render content by default? Only if the configuration is true, it will be drawn. By default, it will not be drawn.
   */
  renderDefault?: boolean;
};

Detailed configuration instructions are as follows:

Click to expand

ListTable-columns-sparkline.customLayout

Function

Custom layout element definition for body cell, suitable for complex layout content.

(args: CustomRenderFunctionArg) => ICustomLayoutObj;

The type declaration for callback function argument CustomRenderFunctionArg is:

interface CustomRenderFunctionArg {
  row: number;
  col: number;
  table: TableAPI;
  /**Formatted value */
  value: string|number;
  /**Original value */
  dataValue: string|number;
  rect?: RectProps;
}

The ICustomLayoutObj type is defined as follows

export type ICustomLayoutObj = {
  rootContainer: Container | any;
  /**
   * Do you still need to render content by default? Only if the configuration is true, it will be drawn. By default, it will not be drawn.
   */
  renderDefault?: boolean;
  /**
   * Whether to also enable padding in style
   */
  enableCellPadding?: boolean;
};

Detailed configuration instructions are as follows:

Click to expand

ListTable-columns-sparkline.dragHeader

boolean

Whether the header can be dragged

ListTable-columns-sparkline.columnWidthComputeMode

string

Column width calculation mode: 'normal' | 'only-header' | 'only-body', only-header considers only the header content only-body considers only the body content normal can display all content

ListTable-columns-sparkline.disableColumnResize

boolean

Whether to disable column width adjustment. If it is a transposed table or a pivot table with row-oriented indicators, this configuration does not take effect.

ListTable-columns-sparkline.tree

boolean

Whether to display this column as a tree structure, which needs to be combined with the records data structure to be implemented, the nodes that need to be expanded are configured with children to accommodate sub-node data. For example:

{
    "department": "Human Resources Department",
    "monthly_expense": "$45000",
    "children": [
      {
        "group": "Recruiting Group",
        "monthly_expense": "$25000",
        "children": [
          {
            "name": "John Smith",
            "position": "Recruiting Manager",
            "salary": "$8000"
          },
      }
    ]
}

ListTable-columns-sparkline.editor

string
Object
Function

Configure the column cell editor

editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);

Among them, IEditor is the editor interface defined in @visactor/vtable-editors. For details, please refer to the source code: https://github.com/VisActor/VTable/blob/main/packages/vtable-editors/src/types.ts .

ListTable-columns-sparkline.headerEditor

string
Object
Function

Configure the display title of this column header

headerEditor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);

ListTable-columns-sparkline.columns

Array

Configure arrays with upper columns, nesting structures to describe column grouping relationships.

ListTable-columns-sparkline.hideColumnsSubHeader

Whether to hide the header title of the subtable header. The default value is not hidden.

ListTable-columns-sparkline.aggregation(Aggregation | CustomAggregation | Array)

*

Not required.

Data aggregation summary configuration to analyze the column data.

Global options can also be configured to configure aggregation rules for each column.

Please refer to the tutorial document

ListTable-columns-sparkline.sparklineSpec(SparklineSpec | Function)

*

Sparkline type exclusive configuration item

Configure the specific spec configuration item of the mini chart

sparklineSpec?: SparklineSpec | ((arg0: CellInfo) => SparklineSpec);

Specific sparklineSpec configuration items: TODO

Click to expand