You can write code in the data filter to convert data structures, filter data, and perform simple calculations. This topic describes how to use the new DataV asset data filter.

Background information

Compared with the previous data filter, the updated data filter removes global filters that can be shared across DataV projects. Filters can only be used within one project. If you want to use them across projects, you must save the filters as code snippets.

Before you use the upgraded data filter, note the following information:
  • If you have used global filters in your project, the project editor saves them as code snippets on the Code Snippets page.
  • When you edit or create filters in an existing project, the system prompts you to update the data filter. The data filter is automatically updated for new projects.
  • After you update the data filter, the page refreshes, and the data filter is updated only for the current project. The update does not affect other existing projects.

Procedure

  1. Log on to the DataV console.
  2. On the Projects page, click Edit above the project that you created.
  3. In Canvas Editor, click an asset in the Layer column or on the canvas.
    Notice Before searching for asset configurations, make sure that the corresponding assets have been added to your visualization application project. Otherwise, you need to add the assets first. For more information, see Add a widget.
  4. On the right of the canvas editor, click the Data icon.
  5. On the Data tab, select Data Filter and click Add Filter.
    Add Filter
  6. On the Set page, click the The Add icon icon next to Add Filter.
    Set Data Source
  7. In the filter code editor, enter the filter code of the current asset data.
    For more information about how to add a resource group, see Example.
  8. Click Test to view the filter result.
    Test the filter code
    Notice To test the filter code, you must turn on the Filter Debugging switch. However, we recommend that you turn off this switch when the volume of widget data is large.
  9. After the test succeeds, click the Refresh icon on the right side of the Data Response Result to view the display effect of the asset on the visualization application.
    For more information, see Detailed functions.