This topic describes the chart style and configuration panel of the relationship network.
Chart Style
A relationship network is a widget that represents the relationships between objects in the form of dots and lines. You can customize the styles of points, lines, and labels, configure multiple series of nodes, and display complex network relationships in visual applications in the form of dots and lines.
Settings 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 asset 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.
Background Color: the background color of the widget. For more information, see color picker description.
force-directed map
Parameter
Description
Margins
The distance between the force-directed map and each edge of the widget. Unit: pixels.
Charge strength, attraction /repulsion
The attraction or repulsion between the charges, the larger the value, the more dense the charge.
charge distance
The distance between the charges.
Gravity
The gravity of each charge. The greater the gravity, the denser the charge.
friction factor
The friction factor between the charges ranges from 0 to 1.
Text Label Configuration
Parameter
Description
Font Color
The color of the text label.
Font Size
The font size of the text label.
Font weight
The font weight of the text label.
Centered Font
Turn on the switch and the text label is centered relative to the charge node.
Connection line configuration
Parameter
Description
Connection line color
The color of the connector.
Connection line thickness
The thickness of the connector.
Connection Line Length
The length of the connection line.
Minimum Connection Line
The minimum value of the connection line.
Connection Line Maximum Value
The maximum value of the connection line.
Node default configuration
Parameter
Description
Label Category Name
The name of the label category.
Node Radius
The default radius size of the node.
Node Fill Color
The default fill color of the node.
Node Stroke Color
The default outline color of the node.
Node Stroke weight
The default stroke weight of the node.
Custom Node Attributes: Click the or icon to add or remove a node. Click the or icon to configure the arrangement styles of multiple custom node series. Click the icon to copy the configurations of the selected node series and add a node series with the same configurations.
Parameter
Description
Label Category Name
You can manually enter a label name. If the label name does not exist in the type field value of the widget data, the default configuration of the node is used.
Node Radius
The radius size of the nodes under this category.
Fill Color
The fill color of nodes under this category.
Stroke Color
The outline color of the nodes under this category.
Stroke weight
The stroke weight of the nodes under this category.
Data Panel
Configuration field description
Parameter | Description |
nodes | Specify the node. Each element in a JSON array is a JSON struct that contains the following fields:
|
links | Set the connection line. Contains the following fields:
|
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 icon next to Data Response Result to view the data response in real time. |
Interaction Panel
This widget does not support interaction events.
Configure interactions in Blueprint Editor
- 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.
In Blueprint Editor, click Network Diagram in the Added Nodes pane. You can view the relationship network parameters in the canvas, as shown in the following figure.
Event
Event
Description
When the data interface request is completed
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 of the Data tab in the right-side configuration panel of the canvas editor.
When a data interface request fails
The event that is returned when a data interface request fails (the request may be due to network problems or interface errors) and is processed by the filter. The event also throws the processed JSON data. For more information about specific data examples, see the Data Response Result section of the Data tab in the right-side configuration panel of the canvas editor.
Action
Policy Action
Description
Request Data Interface
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, relationship network the API data source is
https://api.test
and the data transferred to the request data interface is{ id: '1'}
, the final request interface ishttps://api.test?id=1
.Import data
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 of the Data tab in the right-side configuration panel of the canvas editor.
Update component configurations
Style configurations of widgets are dynamically updated. In the Configuration panel, click Copy Configuration to Clipboard to obtain the configuration data of the component. After that, change the style field for the data processing node in Blueprint Editor.
Display
The following example shows the widget.
return{ "animationType": "", "animationDuration": 1000, "animationEasing": "linear" }
Hide
The following example shows how to hide a widget:
return{ "animationType": "", "animationDuration": 1000, "animationEasing": "linear" }
Switch to the implicit state
The following example shows whether to show or hide a widget.
return { "animationIn": { "animationType": "", "animationDuration": 1000, "animationEasing": "linear" }, "animationOut": { "animationType": "", "animationDuration": 1000, "animationEasing": "linear" } }
Move
A widget is moved to a specified location. Examples of reference data are as follows.
return{ // 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" } }