Using block interfaces

更新时间:
复制 MD 格式

This topic describes how to configure data, event, and action interfaces for a block and use the blueprint editor to transfer data into and out of the block.

Background information

This topic uses the block requirements defined in Block example to demonstrate how to configure and use block interfaces in the block editor.

Configure block interfaces in the block editor

  1. Create a block. For more information, see Create a blank block.

  2. Click the new blank block to open the block editor.

  3. In the block editor, add the list carousel, ECharts rose chart, and vertical capsule column chart widgets.

    添加组件
  4. Select all three widgets. Right-click the selection and choose Export to Blueprint Editor.

    导出到蓝图编辑器
  5. Click the 数据接口设置图标 icon in the upper-right corner of the block editor. On the Data Interface Settings tab, configure the data interface as shown in the following figure. For more information about how to configure data interfaces in a block, see Data interface configuration.

  6. Click the 事件接口图标 icon in the upper-right corner of the block editor. On the Event Settings tab, configure the event interface as shown in the following figure. For more information about how to configure event interfaces in a block, see Event interface configuration.

    事件配置示例样式
  7. Click the 动作图标 icon in the upper-right corner of the block editor. On the Action Settings tab, configure the action interface as shown in the following figure. For more information about how to configure action interfaces in a block, see Action interface configuration.

    动作配置样式面板
  8. After you configure the interfaces for the block, click the 蓝图编辑器入口 icon in the upper-left corner of the block editor to open the blueprint editor.

  9. Drag the three block interfaces to the blueprint editor canvas. Each block interface corresponds to the content that you defined in the previous steps.

    拖入画布
  10. Connect the block interface nodes to the corresponding widget nodes in the blueprint editor to configure the required business logic. The business logic for this example is shown in the following figure. For more information about how to configure blueprint connections, see Features.

    完成蓝图连线

Configure block interfaces in the canvas editor

  1. In the block editor, after you configure the interfaces and internal blueprint logic for the example block, preview and test the interfaces. If the tests are successful, publish the block. For more information, see Preview a block and Publish a block.

  2. Go to the My Visualizations page in the console. Click a visualization application to open the canvas editor.

  3. Click Asset List to open the All Assets list. Select the Block module. The block list shows all published blocks.

  4. On the canvas editor page, click the 资产列表 icon in the upper-left corner to expand the All Assets area.

  5. In the All Assets area, click Block in the navigation pane on the left. The list shows all published blocks. Click the example block to add it to the canvas editor.

  6. Click the block on the canvas. In the configuration panel on the right, select the Data tab. The Data tab displays all configuration information for the block's data interface. You can modify the data content of the block on this tab. For more information, see Configure asset data and Set an asset data source.

    查看区块数据接口内容
  7. Click the Interaction tab. The Interaction tab displays all configuration information for the block's event interface. You can modify the block's interaction events on this tab. For more information, see How to configure the callback ID for a ticker board widget.

    交互面板事件信息查看
  8. On the canvas, select the target block. Right-click the block and choose Export to Blueprint Editor.

    导出区块到蓝图编辑器
  9. Click the 蓝图图标 icon in the upper-left corner of the canvas editor to open the blueprint editor.

  10. Drag the example block node to the blueprint editor canvas to view all of the block's event and action interfaces. Other widgets can call these interfaces. To do this, connect the nodes and configure the logic in the blueprint editor. For more information, see Features.

    区块动作信息面板