The page carousel widget belongs to the Interact category. It allows you to rotate web pages in your DataV project. You can configure the attributes of a page on the Data tab, including the page ID, name, and URL. This topic describes the configuration items of the page carousel widget.

Parameter

settings
  • Search for Configurations: In the right-side panel of Canvas Editor, click the Settings tab, and click Search for Configurations in the upper-right corner. Enter the required configuration item in the search box, and click the search icon to quickly locate the configuration item. Fuzzy match is supported. For more information, see Search for widget configuration items.
  • Size: indicates the size of a widget, including its pixel width and height. You can click the Proportional resizing icon to proportionally adjust the width and height of a widget. After you click this icon again, you can adjust the width and height as needed.
  • Position: the position of a widget, which is indicated by pixel X and Y coordinates. X-coordinate indicates the pixel distance between the upper-left corner of the widget and the left border of the canvas. Y-coordinate indicates the pixel distance between the upper-left corner of the widget and the upper border of the canvas.
  • Rotation Angle: the angle of a rotation that uses the center point of a widget as the rotation point. The unit is degrees (°). You can use one of the following methods to control the rotation angle of a widget:
    • Directly enter the degrees in the Rotation Angle spin box or click the plus sign (+) or minus sign (-) to increase or decrease the value in the Rotation Angle spin box.
    • Drag the black dot in the Rotation control icon icon.
    • Click the Horizontal flip icon to horizontally flip a widget.
    • Click the Vertical flip icon to vertically flip a widget.
  • Opacity: the opacity of a widget. Valid values: 0 and 1. If this parameter is set to 0, the widget is hidden. If this parameter is set to 1, the widget is completely displayed. Default value: 1.
  • Carousel: specifies whether to enable automatic carousel of multiple pages.
  • Intervals (s): the interval to rotate the pages. This parameter appears only when you turn on Carousel.

Data

The Data tab of the page carousel widget contains Data Interface (All Pages) and Data Interface (Current Page).

  • Data Interface (All Pages)data

    The following figure shows sample data:

    [
      {
        "id": 0,
        "serieName": "Project 1",
        "url": "https://m.aliyun.com/?utm_content=se_1435405"
      },
      {
        "id": 1,
        "serieName": "Project 2",
        "url": " https://hd.m.aliyun.com/act/detail-datav.html"
      },
      {
        "id": 2,
        "serieName": "Project 3",
        "url": " https://tianchi.aliyun.com/markets/tianchi/outsource/ai/mobile"
      }
    ]
    Table 1. Parameters
    Log field Description
    id The ID of a page in the widget.
    serieName The name of a page in the widget.
    url The URL of a page in the widget.
  • Data Interface (Current Page)data2

    id: the ID of a page in the widget.

    • When static data is used, this id can only define the pages that are displayed when the carousel page is initialized. It needs to correspond to the page id in the Data Interface (Current Page).
    • If the widget uses a dynamic data source, such as a database or API, the value of the id parameter can be dynamically obtained from an interaction widget, such as a timeline and tab list. You can change an element in the interaction widget to rotate to a specific page. The format of the id value returned by the dynamic data must be consistent with this id and correspond to the page id in the Data Interface (Current Page).

    We recommend that you configure a dynamic data source. For more information, see Widget interaction and Configure a callback ID for a ticker board.

Table 2. Parameters
Parameter Description
Controlled Mode If you turn on the switch, data is not requested when a widget is initialized. Data requests are triggered only based on callback IDs or the method configured in Blueprint Editor. If you turn off the switch, data requests are automatically triggered. By default, the switch is turned off.
Auto Data Request After you select the Auto Data Request check box, you can enable dynamic polling, and manually specify the polling interval. If you do not select this check box, data is not automatically requested. You must manually refresh the page to request data or use Blueprint Editor or callback ID events to trigger data requests.
Data Source In the right-side panel of Canvas Editor, click the Data tab. Click Set next to Static Data. In the Configure Datasource panel, select a data source from the Data Source Type drop-down list. Enter code for data query in the code editor, click Preview Data Response to preview the response of the data source, and then view the response. For more information, see Configure widget data.
Data Filter If you select the Data Filter check box, you can convert the data structure, filter data, and perform simple calculations. If you click the plus sign (+) next to Add Filter, you can configure the script for the data filter in the editor that appears. For more information, see Use the data filter.
Data Response Result The response to a data request. If the data source changes, you can click the Refresh icon icon next to Data Response Result to view the data response in real time.

Interaction

This widget does not support interaction events.

Configure interactions in Blueprint Editor

  1. In Canvas Editor, right-click a widget in the Layer panel and select Add to Blueprint Editor.
  2. Click the Blueprint Editor icon icon in the upper-left corner of the page.
  3. In the blueprint editor, click Page Carousel in the Added Nodes pane. You can configure the widget parameters on the canvas. Events and actions supported by a button
    • Event
      Event Description
      On Completion of Data Interface (All Pages) Request The event is triggered with the processed JSON data after a data interface request is responded and processed by a filter. For more information about specific data examples, see the Data Response Result section on the Data tab of the canvas editor.
      On Completion of Data Interface (Current Page) Request The event is triggered with the processed JSON data after a data interface request is responded and processed by a filter. For more information about specific data examples, see the Data Response Result section on the Data tab of the canvas editor.
      On Failure of Data Interface (All Pages) Request When a data interface request fails (the request may be caused by network problems or interface errors, etc.), the event is returned and processed by the filter, and the processed JSON-formatted data is also thrown. For more information about specific data examples, see the Data Response Result section on the Data tab of the canvas editor.
      On Failure of Data Interface (Current Page) Request When a data interface request fails (the request may be caused by network problems or interface errors, etc.), the event is returned and processed by the filter, and the processed JSON-formatted data is also thrown. For more information about specific data examples, see the Data Response Result section on the Data tab of the canvas editor.
    • Action
      Action Description
      Request Data Interface (All Pages) This action is performed to request the server data again. The data sent by an upstream data processing node or layer node is used as a parameter. For example, the page carousel widget uses the API data source http://api.test, and the data passed to the Request Data Interface (All Pages) action is { id: '1'}. As a result, the http://api.test? id=1 API is called to request data.
      Request Data Interface (Current Page) This action takes parameters passed by an upstream data processing node or widget and requests data of the current page from the server. For example, the page carousel widget uses the API data source http://api.test, and the data passed to the Request Data Interface (Current Page) action is { id: '1'}. As a result, the http://api.test? id=1 API is called to request data.
      Import Data Interface (All Pages) After data of a widget is processed in accordance with its drawing format, the widget is imported for redrawing. You do not need to request server data again. For more information about specific data examples, see the Data Response Result section on the Data tab of the canvas editor.
      Import Data Interface (Current Page) After data of a widget is processed in accordance with its drawing format, the widget is imported for redrawing. You do not need to request server data again. For more information about specific data examples, see the Data Response Result section on the Data tab of the canvas editor.
      Obtain Current Page Information. Returns the values of parameters such as the id and url of the current page.
      Update Widget Configurations Style configurations of widgets are dynamically updated. Before this action is executed, you must click the widget in Canvas Editor, click the Settings tab in the right-side panel, and click Copy Configurations to... to obtain widget configurations. After that, change the style field for the data processing node in Blueprint Editor.
      Show A widget is shown without the need to specify parameters.
      Hide A widget is hidden without the need to specify parameters.
      Hide/Show A widget is hidden or shown.
      Move A widget is moved to a specified location. The following example shows the reference data.
          {
            // The positioning type. to indicates absolute positioning, whereas by indicates relative positioning. The default value is to. 
              "positionType": "to",
            // The location, which is indicated by the x and y coordinates. 
            "attr": {
              "x": 0,
              "y": 0
            },
            // The animation type. 
            "animation": {
              "enable": false,
              // The duration in which animation is displayed. 
              "animationDuration": 1000,
              // The animation curve, which can be set to linear|easeInOutQuad|easeInOutExpo. 
              "animationEasing": "linear"
            }
          }