All Products
Search
Document Center

DataV:Key-Value Table

Last Updated:Feb 17, 2025

This topic provides a guide on using the key-value table widget.

Component overview

The key-value table is a widget that displays data in a two-column format, with keys on the left and their corresponding values on the right. It is designed for clear and efficient data presentation within visualization applications, facilitating quick information retrieval and comprehension.

Note

Note: The key-value table is limited to two columns and cannot be expanded with additional columns.

Scenarios

This widget is ideal for showcasing simple key-value pairs, such as user registration details.

Effect display

For instance, user registration information is neatly organized in a key-value table format.

image

Prerequisites

  • A data dashboard is available that supports creation using a template, a blank canvas.

  • Business data is ready for use. For more information, see Data Source.

Add Key-Value Table

  1. Access the DataV console.

  2. Navigate to Workbench > > All Applications > > Data Dashboard and select the desired dashboard to access the canvas editing page.

  3. In the left-side navigation pane, under the Component Library > Table section, click the Key-value Table widget to add it to the canvas.

You can also use global search to find and add widgets.

Connect business data

Once the widget is added, connect your prepared business data for display. Click the key-value table, and in the right-side Data Source tab, select the data for the widget. image

  • Below is an introduction to the data fields accepted by the key-value table.

    Field

    Description

    Explanation

    label

    (Optional) The table header content of the first column.

    Only when the Style > Table Header > First Row As Table Header is enabled, the label and value fields represent the table header.

    value

    (Optional) The table header content of the second column.

    Custom field

    Defines the main data of the table. The format is {"Key of the first column":"Value of the second column",...}. The data can be customized and distributed in the corresponding rows and columns of the table according to the actual data order.

    The key-value table only supports two columns and cannot add new columns. You can increase the number of rows in the key-value table by configuring custom fields.

    The data structure for a sample key-value table is as follows.

    [
      {
        "label": "Supports two data formats",
        "value": "This is the first type"
      },
      {
        "key0": "value0",
        "key1": "value1",
        "key2": "value2",
        "key3": "value3"
      }
    ]
  • The key configuration items for the data source are as follows.

    Configuration Item

    Description

    Select Data Source

    Supports integrating various types of data such as CSV files, APIs, and various databases. For more information, see Data Source. You can edit data fields using a visual table or code.

    Configure Filter (Optional)

    Used to customize filter code to achieve data structure transformation, filtering, display, and simple calculations. For more information, see Manage Data Filters.

    Configure Data Mapping

    Used to map fields from the selected data source to the corresponding fields of the widget to achieve real-time data matching. Click the image icon to configure field styles.

    View Response Results

    Used to display the data integrated into the widget in real-time. When the widget data source changes, the latest data will be displayed here.

    • Click the data response result to view the code of the data fields written.

    • Click to view the example to see the array type and code example received by the data source. You can refer to the example to write related fields.

    Other data request configurations:

    • Disable Loading State: When selected, the loading content during widget initialization will not be displayed when updating or previewing the data dashboard.

    • Controlled Mode: When selected, the widget will not request data in the initialization state. At this time, data requests can only be initiated through the blueprint editor or global variable events.

    • Automatic Update Request: When selected, the platform will dynamically poll and update data according to the polling time you set. If not selected, you need to manually refresh the page or trigger a request to update data through the blueprint editor and global variable events.

Configure Key-Value Table

Click the key-value table widget to configure its basic styles, interaction occurrences, and advanced settings, along with blueprint interaction configurations, in the right-side panel.

Style configuration

In the Style panel, configure the font, color, carousel animation, and other styles for the key-value table. The configuration items are outlined below.

Note

Tip: Click the image icon to quickly find configuration items using keyword search, which supports fuzzy matching. For more information, see Search Configuration Items.

Configuration item

Description

Illustration

Global configuration

Defines the position distribution, transparency, and interaction penetration of the widget in the data dashboard.

  • Opacity: The smaller the value, the more transparent the widget. The value range is within 0~1.

  • Interaction Penetration: When enabled, the mouse can penetrate this widget to avoid the widget blocking the interaction between the mouse and the underlying widget when there are many widgets on the dashboard.

image

Overall style configuration of table and cell

Defines the adaptive effect of the table, the thickness of the border lines, color, font style, and cell pitch size.

  • Adaptive: When enabled, the platform will automatically adjust the table size according to the widget size to avoid inappropriate table size, incomplete display, or small size.

  • Border line thickness: When the border line thickness is set to 0, it means no border.

  • Text font: Please select the font that has been added to your system. If the selected font is not added to the system, the title will be displayed in the default font.

  • Cell pitch: The distance between the text in the cell and the upper, lower, left, and right borders of the cell. The value range is 0~50, and the unit is px.

    Note

    When the Adaptive configuration item is enabled and the table does not overflow, the Vertical Pitch only applies to the table header. Other rows will adapt to the height.

image

Table header configuration

Defines the font style (size, thickness, etc.) and background color of the table header.

When the First Row As Table Header configuration item is enabled, the platform will set the first row as the table header. When disabled, the key-value table will have no table header.

image

Column style configuration

Defines the width ratio of the two columns of the key-value table, the line separator between columns, and the text style (font size, color, thickness, etc.), background color, and alignment of each column.

  • Width Percentage%: Indicates the proportion of the width of the first column in the key-value table. For example, if configured as 60, it means the first column accounts for 60% and the second column accounts for 40%.

  • Line separator thickness: When configured as 0, it means there is no line separator between the two columns.

  • Column background color: Only when the Row style configuration Distinguish Odd And Even Rows configuration item is disabled, the custom column background color will take effect.

image

Row style configuration

Defines the line separator between rows of the key-value table and the style of odd and even rows.

  • Line separator thickness: When configured as 0, it means there is no line separator between the two rows.

  • Distinguish Odd And Even Rows: When enabled, you can define the background color of odd and even rows as needed. When disabled, odd and even rows will not be distinguished.

image

Advanced configuration

Define the interactions between the key-value table and other widgets. The configuration items are introduced below.

Configuration item

Description

Illustration

Interaction occurrence

Defines the interaction behavior with other widgets to achieve widget filter interaction. Click the image icon to define related interaction occurrences and interaction actions.

image

Blueprint interaction

Use the blueprint editor to visually define the interaction relationships and behavior logic between widgets.

Procedure

  1. On the canvas editing page, click the image icon at the top menu bar's left side to enter the blueprint editor.

  2. In the layer node list, hover over the key-value table widget and click the image icon to add the widget to the main canvas.

  3. As needed, configure the interaction effects between related widgets using the connection method.

    The following is an example. image

Configuration item introduction

The interaction occurrences and actions are detailed below.

Note

Tip: Click the image icon next to an occurrence or action in the blueprint configuration interface for a detailed introduction of related parameters.

Category

Subcategory

Description

Occurrence

When Data Is Updated

This occurrence is thrown when the widget data is updated.

When Request Status Changes

This occurrence is thrown when the request status changes. Status values include Void, Loading, Success, Error.

Action

Import Data

After processing the data according to the widget rendering format, import it into the widget and re-render it. There is no need to request server-side data again. The data example is as follows.

Request Data

Re-request server-side data. The data thrown by the upstream data processing node or layer node will be used as a parameter. For example, if the API data source configured for the key-value table is https://api.test, and the data passed to the Request Data action is { id: '1'}, the final request will be https://api.test?id=1.

Shift

Move the widget to a specified position. The data example is as follows.

    {
      // Movement method. Absolute positioning: to, relative positioning: by. Default value: to.
        "positionType": "to",
      // Specified position. x-coordinate, y-coordinate.
      "attr": {
        "x": 0,
        "y": 0
      },
      // Animation method.
      "animation": {
        "enable": false,
        // Animation delay.
        "animationDuration": 1000,
        // Animation curve. Optional values are: linear|easeInOutQuad|easeInOutExpo.
        "animationEasing": "linear"
      }
    }

Switch Visibility

Switch the widget to show or hide. The data example is as follows.

{
  "animationType": "fade",
  "animationDuration": 1000,
  "animationEasing": "linear"
}
  • animationType: Animation method. It can be configured as appear (appear/disappear), fade (fade in/fade out), slideToUp (fly in/fly out). If not configured, it means no animation.

  • animationDuration: Animation delay, default is 1000ms.

  • animationEasing: Animation curve. It can be configured as linear (uniform speed), easeInOutQuad (smooth), easeInOutExpo (slow-fast-slow).

Show

Hide

Update Widget Configuration

Dynamically update the style configuration of the widget.

  1. First, in the Style panel of the widget, click Copy Configuration To Clipboard to obtain the configuration data of the widget.

  2. As needed, change the field values of the corresponding style in the data processing node on the blueprint editor configuration page.