You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the documentation it says that elements can also be provided as a dictionary of lists (Alternatively, a dictionary with the format { 'nodes':[], 'edges':[]} is allowed at initialization, but arrays remain the recommended format)":
elements (list|dict; optional): A list of dictionaries representing the elements of the networks. 1. Each dictionary describes an element, and specifies its purpose. -group(string): Either 'nodes' or 'edges'. If not given, it's automatically inferred. -data(dictionary): Element specific data. -id(string): Reference to the element, useful for selectors and edges. Randomly assigned if not given. -label(string): Optional name for the element, useful whendata(label)is given to a style'scontentorlabel. It is only a convention. -parent(string): Only for nodes. Optional reference to another node. Needed to create compound nodes. -source(string): Only for edges. The id of the source node, which is where the edge starts. -target(string): Only for edges. The id of the target node, where the edge ends. -position(dictionary): Only for nodes. The position of the node. -x(number): The x-coordinate of the node. -y(number): The y-coordinate of the node. -selected(boolean): If the element is selected upon initialisation. -selectable(boolean): If the element can be selected. -locked(boolean): Only for nodes. If the position is immutable. -grabbable(boolean): Only for nodes. If the node can be grabbed and moved by the user. -classes(string): Space separated string of class names of the element. Those classes can be selected by a style selector. 2. Theofficial Cytoscape.js documentation offers an extensive overview and examples of element declaration. Alternatively, a dictionary with the format { 'nodes':[], 'edges':[]} is allowed at initialization, but arrays remain the recommended format.
Besides, each dictionary can also have an attribute "nodes" or "edges". Either way, this would be make the content of elements much more explicit. Right now functions get_edge_dicts and get_node_dicts are implemented to 'find' which elements in elements are edges and which are nodes. Using the approach from above would make these functions obsolete + the app would probably run faster.
The text was updated successfully, but these errors were encountered:
In the documentation it says that elements can also be provided as a dictionary of lists (Alternatively, a dictionary with the format { 'nodes':[], 'edges':[]} is allowed at initialization, but arrays remain the recommended format)":
Besides, each dictionary can also have an attribute
"nodes"
or"edges"
. Either way, this would be make the content of elements much more explicit. Right now functionsget_edge_dicts
andget_node_dicts
are implemented to 'find' which elements in elements are edges and which are nodes. Using the approach from above would make these functions obsolete + the app would probably run faster.The text was updated successfully, but these errors were encountered: