The network is based on Vis.js version 9.0.4 (). Therefore, Drugst.One supports all options available for Vis.js networks as describes on the official Vis.js webpage. The nodes and edges can be defined in the parameter "network" while the styles for nodes and edges should be defined in the parameter "groups" under the keys "nodeGroups" and "edgeGroups", respectively. Each group (nodeGroups and edgeGroups) is defined by a key and an object. A minimal example of how the groups could look like is shown in "groups".
While the node and edge styles are defined in the "group" parameter, the network parameter in the Drugst.One component serves as data input for the network. The network has the two attributes "nodes" and "edges", which each expect a list with objects for nodes and edges, respectively.
Here some of the required and some of the optional parameters for the node and edge objects are described. Since Drugst.One is using Vis.js, valid node and edge parameters in Vis.js can also be used in Drugst.One in addition to the parameters describes here.
The "nodes" attributes expects a list with objects for each node. Each node
must have an unique 'id', which is the only required parameter. The "id" is
the node identifier and will be displayed as node name in the network.
For genes/proteins, the 'id' attribute is the gene identifier in the selected
"identifier" space. For example, if the "identifier" is "symbol", valid ids
are "PTEN", "MYC", "TP53" and so forth. Drugst.One will attempt to map each
node to a gene/protein entity in its database and fetch corresponding known
information from the database. If it cannot be mapped, it will still display
the node with all attributes that are passed in the node object. However, this
node will not be available for selection and thus for the analysis tasks.
Other nodes which do not represent genes/proteins will still have to have an "id" attribute. In this case, the "id" will still be used to display the name of the node in the network.
In addition to the "id", each should have a "group" that it is assigned. The node will inherit all styles defined in the group. Note that the group assigned to a node must exist in the nodeGroups, otherwise an error will be thrown.
The "edges" attribute expects a list of edge objects, each containing the keys "from" and "to". The values for these keys must the node "id" values of the source and the target node. By default, the network is undirected. In this case, the values of "from" and "to" are exchangeable.
In addition to the required parameters, each node can also have a "group". The value of the "group" must be a key of an "edgeGroup". If the "edgeGroup" does not exist, an error will be thrown. The edge will inherit all styles defined in the edge group.