All Products
Search
Document Center

DataV:Multiple lines of text

Last Updated:Dec 31, 2024

This topic provides a usage guide for the multiple lines of text widget.

Overview

The multiple lines of text widget is designed to display content spanning several lines, enhancing text information visibility. It supports interactions with other widgets, line breaks, and hyperlink insertion, allowing for customizable formatting and layout.

Scenarios

It is commonly used to present extended text content in visualization applications, including feature introductions, product descriptions, and annotations.

Effect display

  • Static Text

    image

  • Dynamic Text622E89BA-3CBC-425F-A7AF-AA2AD504B4F0

  • Text with Links

    038480D8-8EB2-44C5-B1DD-33D7C5DE14AA

  • Interaction Scenario4B2578E8-C7B0-49B9-A23D-C9A9D08D5DEA

Prerequisites

Add multiple lines of text

  1. Access the DataV console.

  2. In the Workbench> > All Applications> > Data Dashboard, click the target dashboard to enter the canvas editing page.

  3. In the left-side navigation pane under the Widget Library > Information list, click the Multiple Lines of Text widget to add it to the canvas.

You can also use global search to add related widgets.

Integrate business data

After adding the widget, integrate the prepared business data for display. Click the multiple lines of text widget, and on the right-side Data Source tab, select the data to be rendered by this widget. image

  • The data fields received by the multiple lines of text widget are as follows.

    Field

    Description

    value

    The text content displayed by the widget supports some HTML tags (such as <a>, <br>). If not empty, it will overwrite the configuration in the style. If empty, it will use the content in the Style > Basic Style > Paragraph Content configuration item.

    The data structure and effect display of the example multiple lines of text are shown below.

    [
      {
        "value": "DataV-Board (data dashboard) is a data dashboard building tool under the DataV edition, aimed at helping users with different professional backgrounds quickly build professional-level data dashboards through a graphical interface. Whether facing innovative exploration of emerging digital twin scenarios or continuous deepening in traditional data scenarios, DataV-Board is committed to enabling users to efficiently and flexibly complete data viewing, analysis, and expression, solving the last mile problem of data scenarios with data visualization technology."
      }
    ]

    image

  • 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 multiple lines of text

Click the multiple lines of text widget to configure its basic style and interaction on the right-side panel, including advanced configuration and blueprint interaction settings.

Style configuration

On the Style panel, configure the text size, layout, overflow method, and other styles for the multiple lines of text. The related configuration items are as follows.

Note

Click the image icon for a keyword search of configuration items, which supports fuzzy match. For more information, see Search Configuration Items.

The related configuration items are introduced as follows.

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

Basic style configuration

Defines the size, layout, color, and other styles of the text.

image

Interaction configuration

Defines the overflow method of the text. When the text content overflows, the following methods are supported:

  • Scroll: Scroll to play the text content. You can set loop scrolling (scrolling speed needs to be set) or timed scrolling (scrolling duration needs to be set).

  • Ellipsis: Overflow text will be filled with ellipsis. You can set the number of display lines of the text.

Note

If there is a lot of text content and the overflow configuration is not enabled, the overflow text will be truncated and cannot be viewed.

image

Advanced configuration

Define the interaction between multiple lines of text and other widgets. The related configuration items are as follows.

Configuration item

Description

Illustration

Interaction occurrence

Defines the interaction behavior with other widgets to achieve widget filter interaction. For example, when the content of the word cloud widget is updated, the related content will be synchronized and displayed in the multiple lines of text widget.

Click the image icon to define the related interaction occurrence and interaction action.

image

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 access the blueprint editor.

  2. In the layer node list, hover over the multiple lines of text widget and click the image icon to add it to the main canvas.

  3. Configure the blueprint interaction effects for related widgets as needed.

    Below is an example. image

Configuration item introduction

The related interaction occurrences and actions are as follows.

Note

Click the image icon after the corresponding occurrence or action on the right side of 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 for re-rendering. There is no need to request server data again. An example of the data is as follows.

[
  {
    "value": "Text content"
  }
]

Request Data

Request server data again. The data thrown by the input data processing node or layer node will be used as parameters. For example, if the API data source configured for multiple lines of text 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 the specified position. An example of the data 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, unit ms.
        "animationDuration": 1000,
        // Animation curve. Optional values are: linear|easeInOutQuad|easeInOutExpo.
        "animationEasing": "linear"
      }
    }

Switch Visibility

Switch the widget to show or hide. An example of the data 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, on 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 styles in the data processing node on the blueprint editor configuration page.

Case demonstration

This case demonstrates obtaining content from the word cloud widget and displaying it in the multiple lines of text widget.

  1. Add the widget to the canvas.

    1. Access the DataV console.

    2. Select any data dashboard, click Edit to enter the canvas editor.

    3. In the Widget Library > Information list in the left-side navigation pane, click Word Cloud and Multiple Lines of Text to add the widgets to the canvas.

  2. Configure the scrolling style of multiple lines of text.

    Click Multiple Lines of Text on the canvas, and on the Interaction tab of the style panel, set the overflow method to uniform scrolling overflow with a speed of 0.05px/s.

  3. Configure blueprint interaction.

    Scroll and display the text obtained from the word cloud in the multiple lines of text widget using blueprint interaction.

    1. Click the image icon in the upper left corner of the page to enter the blueprint editor.

    2. On the Layer Node tab on the left, hover over the widgetand click the image icon to add the widget to the main canvas.

      Perform this operation sequentially to add both the multiple lines of text and word cloud widgets to the main canvas.

    3. On the Logic Node tab on the left, hover over the serial data processing node and click the image icon to add it to the main canvas.

    4. Connect the widgets as illustrated below to import the corresponding data into the multiple lines of text when the word cloud data updates.

      image

    5. Click the serial data processing node to configure its processing method. image

      return [{"value": data.map(item => item.name).join(',')}];  // Retrieve the name field information in the word cloud widget in sequence.
  4. Click Preview in the upper right corner of the page to preview the display result.

    4B2578E8-C7B0-49B9-A23D-C9A9D08D5DEA