Tab list

更新时间:
复制 MD 格式

Use the tab list widget to group related information into switchable tabs on a data dashboard.

Widget overview

A tab list consists of multiple tabs that you can configure to interact with other widgets, grouping related information and enabling quick switching between views or functional areas.

Scenarios

The tab list is commonly used for information organization, content categorization, and data display. Examples:

  • Information organization: Group related content using tabs, such as "Personal Information" and "Account Settings".

  • Content categorization: Use tabs to distinguish between content categories, such as "Electronics" and "Home Goods" on an e-commerce platform.

  • Data display: Show different data views using tabs, such as "Elementary School Distribution in a Region" and "High School Distribution in a Region".

Demonstration

  • Different tabs in a tab list display different charts.

    CA6A8B79-114E-48B2-8945-F0D345B490D7

  • The tab list widget provides multiple built-in quick styles.image

Prerequisites

Add a tab list

  1. Access the DataV console.

  2. On the Workbench page, in the Data Dashboards area, hover over the target dashboard and click Edit. The canvas editor opens.

  3. In the navigation pane on the left, follow the steps in the figure to add the Tab list widget to the canvas.image

    Note

    The platform provides multiple built-in tab list styles, also known as quick styles, that you can use directly. To select a style, hover over the image icon on the widget. If the quick styles do not meet your requirements, you can customize the widget style after you add it. For more information, see Style configuration.

You can also use the global search feature to add the widget.

Connect to business data

After you add the widget, connect it to your business data. Click the tab list, and then on the Data Source tab on the right, select the data for the widget.image

  • The tab list widget accepts the following data fields.

    Field

    Description

    id

    The ID of a tab. The General > Initial Selection setting in the Style panel uses this value to define which tab is selected at initialization.

    content

    The name of a tab.

    imgSrc

    The URL of the icon for a tab. After you configure an icon, you can modify its size, position, and other properties under General > Icon in the Style panel.

    The following code shows a sample data structure for a tab list and the resulting display.

    [
      {
        "id": 1,
        "content": "Sales Data",
        "imgSrc": "&#xe8fc"
      },
      {
        "id": 2,
        "content": "Customer Data",
        "imgSrc": "&#xe7b1"
      },
      {
        "id": 3,
        "content": "Market Data",
        "imgSrc": "&#xe7b1"
      },
      {
        "id": 4,
        "content": "Production Data",
        "imgSrc": "&#xe7b1"
      }
    ]

    image

  • Core data source configuration items:

    Configuration Item

    Description

    Select Data Source

    The tab list widget supports various data source types, such as CSV files, APIs, and different databases. For more information, see Supported data source types. You can edit data fields using a visual table or code.

    Configure Filter (Optional)

    Defines custom filter code for data transformation, filtering, display, and simple calculations. For more information, see Manage data filters.

    Configure Data Mapping

    Maps fields from the data source to the widget fields for real-time matching. Click the image icon to configure field styles.

    View Response Result

    Displays the data connected to the widget in real time. When the widget's data source changes, the latest data is shown here.

    • Click the data response result to view the data field code.

    • Click View Example to see the array type and sample code that the data source accepts. You can use the example as a reference to write your fields.

    Other data request configurations:

    • Disable Loading State: If selected, the widget's loading indicator is hidden during updates and dashboard previews.

    • Controlled Mode: If selected, the widget does not request data at initialization. Data requests can only be triggered through the Blueprint editor or global variable events.

    • Automatic Update Requests: If selected, the platform polls for data updates at the interval you set. Otherwise, manually refresh the page or trigger updates through the Blueprint editor or global variable events.

Configuration: Tab List

Click the tab list widget to configure styles, advanced settings such as global variables and interaction events, and Blueprint interactions in the right panel.

Style configuration

On the Style panel, configure styles for the tab list, such as text size, background, and animation effects.

Note

You can also click the image icon to quickly find a configuration item by searching for keywords. The search supports fuzzy matching. For more information, see Search for configuration items.

Configuration Item

Description

Figure

Global Configuration

Defines the widget's position, transparency, and interaction penetration on the data dashboard.

  • Opacity: The smaller the value, the more transparent the widget. The value ranges from 0 to 1.

  • Interaction Penetration: If enabled, the mouse passes through this widget, preventing it from blocking interactions with underlying widgets.

image

General Configurations

Defines the overall display style of the tab list, including the background and border of the tab container, and the size and arrangement of the tabs.

  • Initial Selection: Sets which tab is selected at initialization. Enter the tab ID, which you can find on the data source panel.

  • Custom Size: If enabled, you can customize the size of each tab. If disabled, adaptive sizing is used.

  • Global Style: Sets the background, border style, and tab spacing for the tab list. You can upload a local image to use as the background.

  • Icon: You can create icons on iconfont and then enter the Unicode font file (.woff) of the icon project here to add the icons to the tab list.

image

Unselected Configuration

Defines the display style for unselected tabs.

  • Default Style: The default font size, background color, and other styles for unselected tabs.

  • Hover Style: The style that appears when you hover the mouse over an unselected tab.

Note

You can upload a local image to use as the background.

image

Selected Configuration

Defines the display style for the selected tab.

  • Selected Decoration Bar: Sets whether to add a decorative line when a tab is selected.image

  • Default Style: The default font size, background color, and other styles for the selected tab.

  • Hover Style: The style that appears when you hover the mouse over the selected tab.

Note

You can upload a local image to use as the background.

image

Interaction Configuration

Sets the carousel interval for the tab list and the position of the tooltip relative to each tab.

image

Advanced Configuration

On this tab, define interactions and data transfer relationships between the tab list and other widgets.

Configuration Item

Description

Figure

Interaction Event

Defines interaction behaviors with other widgets to enable widget linkage. For example, you can use a tab list and a line chart to show a company's business performance. By clicking different tabs, you can display fluctuations in sales data, customer data, market data, and production data.

Click the image icon to define the interaction events and actions.

image

Associate Global Variables

You can associate global parameters in the widget to pass parameters between widgets for interaction. For an introduction to global variables, see Global Variables.

Click the image icon to enable the corresponding instruction. When you click a tab, a data request is triggered, a temporary variable is thrown, and the tab content is dynamically loaded. By default, the id and content values from the data are thrown. For more information, see Widget interaction configuration.

Blueprint interaction

Use the Blueprint editor to define interaction logic between widgets in a visual, node-based way.

Procedure

  1. On the canvas editor page, click the image icon on the left side of the top menu bar to open the Blueprint editor.

  2. In the layer node list, hover over the tab list widget and click the image icon to add the widget to the main canvas.

  3. Connect the nodes to configure the desired Blueprint interaction effects for the widgets.

    The following figure shows an example.image

Configuration item descriptions

The following table describes interaction events and actions.

Note

You can also click the image icon next to an event or action on the right side of the Blueprint configuration interface to view detailed parameter descriptions.

Category

Subcategory

Description

Event

When data is updated

Triggers when the component data is updated.

When data request status changes

Triggers when the data request status changes. The status can be Loading, Success, or Error.

When a tab is clicked

Triggers when a tab is clicked. The event passes the data item of the corresponding tab. Example:

{
  "id": "1",
  "content": "Tab 1"
}

Action

Import data

Processes and imports data to redraw the component without re-requesting from the server. Example:

[
  {
    "id": "1",
    "content": "Tab 1",
    "imgSrc": "https://img.alicdn.com/imgextra/i3/O1CN016hZVyj29jgY7SqaJn_!!6000000008104-55-tps-200-200.svg"
  }
]

Request data

Re-requests data from the server-side. Data from upstream converters or layer nodes is used as parameters. For example, if the API data source for the tab list is set to https://api.test and the data passed to the Request data action is { id: '1'}, the final request URL is https://api.test?id=1.

Set selected item

Selects one or more tab options. The data can be an array or a single object. Example:

{
  "id": "1"
}

Enable carousel

Enables automatic carousel for the tab list. Example:

{
  "duration": 2000  // Carousel interval in milliseconds (ms).
}

Disable carousel

Disables the carousel for the tab list. No parameters are required.

Move

Moves the component to a specified position. Example:

    {
      // The move method. 'to' for absolute positioning and 'by' for relative positioning. Default: 'to'.
        "positionType": "to",
      // The target position. x-coordinate, y-coordinate.
      "attr": {
        "x": 0,
        "y": 0
      },
      // The animation method.
      "animation": {
        "enable": false,
        // The animation duration.
        "animationDuration": 1000,
        // The animation curve. Options: linear, easeInOutQuad, or easeInOutExpo.
        "animationEasing": "linear"
      }
    }

Toggle visibility

Toggles the component between visible and hidden. Example:

{
  "animationType": "fade",
  "animationDuration": 1000,
  "animationEasing": "linear"
}
  • animationType: The animation method. Options are appear, fade, or slideToUp. If this parameter is not set, no animation is used.

  • animationDuration: The animation duration. The default value is 1000 ms.

  • animationEasing: The animation curve. Options are linear (constant speed), easeInOutQuad (smooth), or easeInOutExpo (slow-fast-slow).

Show

Hide

Update component configuration

Dynamically updates the style configuration of the component.

  1. In the component's Style panel, click Copy Configuration to Clipboard to get the component's configuration data.

  2. In the data processing node on the Blueprint Editor page, change the field values for the style as needed.

Demo

Use a tab list to control a group's carousel and visibility, creating a dynamic display effect.

  1. Access the DataV console.

  2. Select any data dashboard and click Edit to open the canvas editor.

  3. Add a column chart, a line chart, a doughnut chart, and two Tab list widgets to the canvas.

  4. Group the column chart, line chart, and doughnut chart. Set the trigger method for the carousel container to Event Trigger.

  5. Click one of the tab list widgets. On the data source panel, modify the static data and change the widget's name to Show/Hide.

    [
      {
        "id": 1,
        "content": "Show"
      },
      {
        "id": 2,
        "content": "Hide"
      }
    ]
  6. Click the other tab list widget and change its name to Carousel Control.

  7. Click the image icon in the upper-left corner of the page to open the Blueprint page.

  8. On the Layer Node tab, add the carousel container, the Show/Hide widget, and the Carousel Control widget to the main canvas.

  9. On the Logic Node tab, add one serial data processing node and two conditional nodes to the main canvas.

  10. Connect the widgets.image.png

  11. Configure the processing methods.

    • Show

      return data.id == 1;
    • Hide

      return data.id == 2;
    • Serial Data Processing

      return {
        index: data.id - 1
      };
  12. Click Preview in the upper-right corner of the page to preview the result.tab(2).gif