Button

更新时间:
复制 MD 格式

Add and configure button widgets to trigger actions such as navigation, form submission, and selection in your visualization applications.

Component overview

The button is a control widget that triggers operations such as navigation, submission, and selection or cancellation when clicked. You can customize its color, size, label content, and hyperlink, and configure interactions with other widgets to display linked pages or prompt information.

Scenarios

Use buttons for interface switching, hyperlink navigation, and submission or confirmation actions.

Effect display

  • Static Button

    image

  • Hyperlink Navigation

    screenshot_2025-01-10_18-00-15

  • Interactive Scenario

    screenshot_2025-01-10_18-16-21

Prerequisites

Add button

  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 left-side navigation pane, under the Component Library > Control > Button Class list, click the Button widget to add it to the canvas.

You can also use global search to add related widgets.

Integrate business data

After adding the widget, bind your business data. Click the button and in the right-side Data Source tab, select the data to render. image

  • The button accepts the following data fields.

    Field

    Description

    value

    This data is output when the Click Button Event is triggered. For more information about events, see Blueprint Interaction.

    Example data structure:

    [
      {
        "value": "Submit"
      }
    ]
  • This section describes the core configuration items for the data source.

    Configuration

    Description

    Select Data Source

    Supports various data types, such as CSV files, APIs, and different databases. For more information, see Supported data source types. Edit data fields in a visual table or in code.

    Configure Filter (Optional)

    Customize filter code to transform, filter, display, and perform simple calculations on data. For more information, see Manage data filters.

    Configure Data Mapping

    Map fields from the selected data source to the widget's fields. This enables real-time data 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, this section shows the latest data.

    • 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 write your fields based on the example.

    Other data request configurations:

    • Disable Loading State: If you check this box, the widget's initial loading content does not appear when the widget updates or when you preview the data dashboard.

    • Controlled Mode: If you check this box, the widget does not request data when it initializes. Data requests can only be started by the blueprint editor or by global variable events.

    • Auto Update Request: If you check this box, the platform polls for data updates at the interval you set. If you do not check this box, you must refresh the page manually or use the blueprint editor or global variable events to trigger data updates.

Configure button

Click the button widget to configure its style, global variables, and interactions in the right-side panel.

Style configuration

In the Style panel, configure the text, background, border, and other styles of the button across different states.

Note

Click the image icon to quickly locate configuration items by searching keywords. The search supports fuzzy match. For more information, see Search Configuration Items.

The configuration items are described below.

Configuration Item

Description

Illustration

Global Configuration

Defines the widget's position, transparency, and interaction passthrough in the data dashboard.

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

  • Interaction Passthrough: If you turn this on, mouse events pass through the widget. This is useful when many widgets are on the dashboard and you need to interact with widgets in lower layers.

image

Global Style Configuration

Defines the button's default-state appearance, including text content, text style, background style, and border style.

  • Text Content: The text displayed on the button.

  • Text Style: You can set the font, weight, color, font size, alignment, and font style of the text.

    • Font: Please select a font that is already installed on your system. If the font is not installed on the system, the text will be displayed in the default font. For more font information, see Font Library.

    • Font styles include the following:

      • Normal: Normal style.

      • Italic: Italic style.

      • Oblique: Used to set text that cannot be displayed in italics to an oblique style. For example, some fonts may not have an italic style, so you can use Oblique to tilt the text.

  • Background Style: Set the background color or use a custom image. Click Click Here To Change to select an image, or enter the image URL directly.

    Note

    When selecting an image, you need to first create the image as a design resource for DataV-Board. For more information, see Create Design Resource.

    • Background Image Repeat: When enabled, the background image tiles to fill the button area.

    • Background Image Size: Select a sizing mode such as cover, fill, auto, or stretch. Choose based on your image dimensions to avoid blank space or unintended cropping.

  • Border Style: You can set the line, color, thickness, and border radius of the border.

  • Hyperlink Configuration:

    • Hyperlink: Set a URL. Clicking the button in preview or published mode navigates to this link.

    • Open in New Window: When enabled, the link opens in a new browser window. When disabled, the link opens in the current page.

image

Click Style Configuration

Defines the button's appearance when clicked. For details, see Global style configuration.

image

Hover Style Configuration

Defines the button's appearance on hover. For details, see Global style configuration.

image

Advanced configuration

Configure interactions between the button and other widgets.

Configuration Item

Description

Illustration

Interaction Occurrences

Defines interaction behavior with other widgets for filter-based interaction. Click the image icon to define interaction occurrences and actions.

image

Associate Global Variables

Associate global parameters with the widget to pass values between widgets. Click the image icon to enable and bind the required global variable.

Clicking the button triggers a data request that passes the Value configured in the data source panel by default. For configuration details, see Widget Interaction Configuration.

Blueprint interaction

Use the Blueprint Editor to visually define interaction relationships and behavior logic between widgets.

Procedure

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

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

  3. Configure the blueprint interaction effects of related widgets as needed through the connection method.

    The example is as follows. image

Configuration item description

The interaction occurrences and actions are described below.

Note

Click the image icon next to an occurrence or action in the blueprint configuration panel to view parameter details.

Category

Subcategory

Description

Occurrences

When Data Is Updated

Triggered when the widget data is updated.

When Data Request Status Changes

Triggered when the data request status changes. Status values: Void, Loading, Success, Error.

When Button Is Clicked

Triggered when the button is clicked. The corresponding data item is also output. The data example is as follows.

{
  "value": "Submit"
}

Actions

Import Data

Import pre-processed data into the widget and redraw it without requesting server data again. The data example is as follows.

[
  {
    "value": "Confirm"
  }
]

Request Data

Request server data again. Data from the input processing node or layer node is used as a parameter. For example, if the API data source configured for the button 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

Moves the widget to a specified position. The following code shows a data example.

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

Switch Visibility

Toggles the widget's visibility between shown and hidden. The following code shows a data example.

{
  "animationType": "fade",
  "animationDuration": 1000,
  "animationEasing": "linear"
}
  • animationType: The animation method. You can set this to appear (appear/disappear), fade (fade in/fade out), or slideToUp (fly in/fly out). If not configured, there is no animation.

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

  • animationEasing: The animation curve. You can set this to linear (constant speed), easeInOutQuad (smooth), or easeInOutExpo (slow-fast-slow).

Show

Hide

Update Widget Configuration

Dynamically updates the widget's style configuration.

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

  2. In the data processing node on the blueprint editor's configuration page, change the field values for the corresponding styles as needed.