This topic describes the style and configuration options of the Navigation menu bar widget.
The Navigation menu bar widget is not compatible with mobile displays. For information about future updates, visit the official DataV website.
Chart style
The Navigation menu bar is a control widget that submits user input to the backend for processing. You can customize various styles, such as the menu layout, submenu style, option icons, background color, and text.
Configuration panel
- 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 Configurations.
- Size: indicates the size of a widget, including its pixel width and height. You can click the
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
icon. - Click the
icon to horizontally flip a widget. - Click the
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.
Menu
Menu Layout: The layout of the navigation menu. Options include Inline, Vertical, and Horizontal.
Parameter
Description
Default Display
The number of navigation menu bar options to display by default. This uses the value of the id field from the data. This configuration is available only when Menu Layout is set to Inline.
Option Height
The height of each option in the navigation bar, in px. This configuration is available only when Menu Layout is set to Inline or Vertical.
Submenu Width
The width of the submenu in the navigation bar, in px. This configuration is available only when Menu Layout is set to Vertical or Horizontal.
Submenu Height
The height of the submenu in the navigation bar, in px. This configuration is available only when Menu Layout is set to Vertical or Horizontal.
Option Right Margin
The margin to the right of the option, in px. This configuration is available only when Menu Layout is set to Inline.
Option Margin
The margin of the option, including the left and right margins, in px. This configuration is available only when Menu Layout is set to Vertical or Horizontal.
Option Icon
Set a custom icon for the selected option in the navigation bar. You can set the icon's link, size, and distance from the left and right borders, in px.
NoteYou can create icons on the www.iconfont.cn website. Enter the Unicode font file (.woff) generated by your icon project here to use the custom icon in DataV.
Text Style
Set the font style, weight, size, and color of the option text. This includes the default color, the color when you hover over the option, and the color when the option is selected.
Background Color
Set the background color of the option. This includes the default background color, the background color when you hover over the option, and the background color when the option is selected.
Rightwards Arrow
Set the right margin, size, and color of the rightwards arrow. This configuration is available only when Menu Layout is set to Inline or Vertical.
Data panel
Field description
Field |
Description |
|
A unique identifier for the navigation bar option. |
|
The value that is displayed for the navigation bar option. |
|
The icon for the navigation bar option. |
|
Nested data for the subset. |
| 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 asset 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 |
Interaction panel
To enable the interaction feature, select Enable next to When a leaf node is clicked or When a node is clicked. The Navigation menu bar widget provides interaction configurations that allow you to change the menu content, trigger data requests, and expose callback values. These values can be configured and used in other widgets. By default, the item and itemPath values from the Data panel are exposed. For more information about the configuration, see Configure a callback ID for a widget.
Blueprint editor interaction configuration
- In Canvas Editor, right-click a widget in the Layer panel and select Add to Blueprint Editor.
- Click the
icon in the upper-left corner of the page. On the blueprint editor configuration page, click the Navigation menu bar widget in the import node bar. The widget's configuration parameters appear on the canvas, as shown in the following figure.
Events
Event
Description
On Data API Request Completion
The event is triggered after a data API request is successfully returned and processed by the filter. This event exposes the processed data in JSON format. For a data example, see the Data Response section on the Data tab in the canvas editor's configuration panel.
When a data API request fails
The event is triggered when a data API request fails due to network issues or API errors. This event exposes the error response, processed by the filter, in JSON format. For a data example, see the Data Response section on the Data tab in the canvas editor's configuration panel.
When a leaf node is clicked
The event is triggered when a leaf node is clicked. The data item corresponding to the clicked node is also exposed.
When a node is clicked
The event is triggered when a node is clicked. The data item corresponding to the clicked node is also exposed.
Actions
Action
Description
Request data API
Sends another request for server-side data. Data from input data processing nodes or layer nodes is passed as a parameter. For example, if the API data source for the navigation menu is
https://api.testand the data passed to the Request data API action is{ id: '1'}, the final API request ishttps://api.test?id=1.Import data API
Processes data in the component's drawing format, then imports the data to redraw the component. This action does not request new data from the server. For a data example, see the Data Response area on the Data tab in the component configuration pane in the canvas editor.
Set selected item
Sets the selected item in the navigation menu.
Clear selected item
Clears the selected item in the navigation menu.
Update component configuration
Dynamically updates the component's style configuration. First, get the component configuration data by clicking Copy Configuration to Clipboard in the component's Configuration pane. Then, change the field values for the styles as needed in the data processing node on the blueprint editor's configuration page.
Show
Shows the component. The following code shows a data example.
return { "animationType": "", "animationDuration": 1000, "animationEasing": "linear" };Hide
Hides the component. The following code shows a data example.
return { "animationType": "", "animationDuration": 1000, "animationEasing": "linear" };Toggle visibility
Toggles the component between visible and hidden. The following code shows a data example.
return { "animationIn": { "animationType": "", "animationDuration": 1000, "animationEasing": "linear" }, "animationOut": { "animationType": "", "animationDuration": 1000, "animationEasing": "linear" } };Move
Moves the component to a specified position. The following code shows a data example.
return { // Move type. Absolute positioning: to. Relative positioning: by. Default value: to. "positionType": "to", // The specified position. x-coordinate, y-coordinate. "attr": { "x": 0, "y": 0 }, // The animation method. "animation": { "enable": false, // Animation duration. "animationDuration": 1000, // Animation curve. Valid values: linear|easeInOutQuad|easeInOutExpo. "animationEasing": "linear" } };