Interaction events enable dynamic communication between widgets in data dashboards, supporting intuitive data exploration and analysis. You can configure interaction events and associate global variables in the advanced panel of each widget.
Scenarios
Without interactions, widgets operate independently and cannot perform filter interactions. Use widget interaction configuration in scenarios such as:
-
Controlling the display or hiding of layers with a switch.
-
Displaying data with different meanings by clicking a TAB tag.
-
Showing detailed data for a selected province on a map in a pivot table.
-
Viewing sales data at various time points using a time selector.
Advanced widget configuration controls what content is displayed on data dashboards.
Related concepts
Interaction Events
Events are user or browser actions on a webpage, such as clicks, mouse movements, keyboard inputs, or data request completions. These events can be monitored and trigger specific code when they occur. By themselves, these behaviors are simply signals that an event has occurred.
Interaction Actions
Actions are the responses of widgets to events. For instance, displaying a chart when a user clicks a button.
Relationship between the Two
Events and actions form a trigger-and-response relationship: events serve as triggers that prompt the execution of corresponding actions.
Action Trigger Conditions
Trigger conditions are the criteria that determine when an action should be executed in response to an event.
Principle explanation
When a user initiates an interaction event, the system checks the action trigger conditions. If met, the receiving object executes the designated interaction action. If not met, the process terminates automatically. If no action trigger conditions are set, the receiving object immediately performs the interaction action.
For example, displaying the column chart widget when the first Tab in a Tab list is clicked illustrates the principle.
Operation flow
Select a widget (trigger object) in the data dashboard and use the advanced panel to set up interaction events, define action trigger conditions, specify interaction actions, and select receiving objects. You can also select global variables as receiving objects to refresh global variables.
Receiving objects can be Layer Widgets or Global Variables.
Prerequisites
-
You are logged on to the DataV console.
-
You have accessed the canvas editor page.
Interaction events
Interaction between widgets
The following example shows how to configure interaction events to toggle the display of a column chart by clicking a Tab.
The relationships between widgets are as follows:
-
Add a Column Chart widget and a Tab List widget from the category to the canvas.
-
Choose the Tab List widget, update its data source, and set the Tabs to "Show" and "Hide".
-
Configure an interaction event for the Tab List to display the column chart when the first tab is clicked.
-
Select the Tab List, navigate to the Advanced panel on the right, and click the Interaction Events icon
to add an interaction event for tab clicks. The Enable Event switch is enabled by default. -
Choose the Event Type and add the When Tab Is Clicked event.
NoteTo view the description of the response parameters for the current event, click the icon
. -
Click the icon
to activate the Action Trigger Conditions switch. -
Click Add Condition to configure the condition
id equals 1, indicating the first tab is clicked. For detailed instructions, see how to use the condition tree.NoteAlternatively, switch to code edit mode and use JavaScript syntax for advanced configuration.
-
Click the Interaction Action icon on the right
, and add an interaction action. -
Select the widget and action to be triggered, setting it to display as a column chart.
NoteTo navigate to the blueprint and view interaction actions, click the
icon. Click the
icon to view the input parameter description for the current action.The configuration for different interaction actions will vary; please refer to the specific context.
-
-
Similarly, associate an interaction occurrence with the Tab List: if the Tab ID is 2, the column chart executes a hide action.
-
To preview the effect, click the Preview button in the upper-right corner. Select the Show tab to display the column chart, or the Hide tab to conceal it.
-
To access the blueprint editor, click the
icon located in the upper left corner of the page. Here, you can examine the interaction relationships that the system has automatically generated. The Single-path Judgment node's condition is specified in the Action Trigger Condition. -
(Optional) Modify the trigger conditions, response actions, and corresponding filters as needed.
Note-
For more complex interactions, please configure them using the blueprint editor.
-
Interaction between widgets and global variables
This example shows how widgets interact with global variables through interaction occurrences. The General Title widget displays content that updates dynamically when tabs are clicked in the Tab List widget, reflecting changes in the global variable.
The blueprint editor can also be utilized to execute this interaction scenario. For detailed instructions, see the demo.
The interaction diagram is as follows:
-
Create a global variable called
contentunder Global Variables. -
Add the Tab List widget from the category, along with the General Title widget, to the canvas.
-
Select the General Title widget and link it to the Global Variable
contentin the data source panel on the right. Apply a filter to format thecontentappropriately for the widget.// The data input parameter represents the value passed in by the content variable. After being processed by the filter, it is given to the widget in the correct format. function filter(data) { return [{ value: data }]; } -
Configure the Tab List to change the value of the global variable when a tab is clicked.
-
Select the Tab List widget. In the right-side Advanced panel, click the Interaction Occurrences icon
to add an interaction occurrence for Tab clicks. The Enable Event switch is activated by default. -
Select Occurrence Type and add the When Tab Is Clicked occurrence.
NoteClick the
icon next to the occurrence to view the response parameter description of the current occurrence. -
Click the Interaction Action icon on the right side of
, and add an interaction action. -
Select the object to respond as the Global Variable
content, with the action set to Import Data. -
Switch to Dynamic Parameter Configuration, create a filter, and add the following code. Process the data from the Tab click event, and import the returned value into the Global Variable
content.// After being processed by the filter, obtain the final value needed by the global variable. function filter(data) { return data.content; }
-
-
To see the preview effect, click Preview in the upper right corner. When you click on various Tabs, the General Title will show the content corresponding to the selected Tab.
Associate global variables (not recommended)
FAQ
After configuring advanced interactions, why can't some connections be deleted in the blueprint editor?
The settings that associate global variables in interactions cannot be deleted in the blueprint editor. You need to shut them down in the advanced panel.
to activate the Action Trigger Conditions switch.
icon. Click the
icon to view the input parameter description for the current action.
icon located in the upper left corner of the page. Here, you can examine the interaction relationships that the system has automatically generated. The Single-path Judgment node's condition is specified in the Action Trigger Condition.