File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ Serializes the graph. Returns an object with the following properties.
166166 * ` links ` An array of objects representing edges, each with the following properties.
167167 * ` source ` The node identifier string of the source node (** u** ).
168168 * ` target ` The node identifier string of the target node (** v** ).
169+ * ` weight ` The weight of the edge between the source and target nodes.
169170
170171Here's example code for serializing a graph.
171172
@@ -186,8 +187,8 @@ The following will be the value of `serialized`.
186187 { "id" : " c" }
187188 ],
188189 "links" : [
189- { "source" : " a" , "target" : " b" },
190- { "source" : " b" , "target" : " c" }
190+ { "source" : " a" , "target" : " b" , "weight" : 1 },
191+ { "source" : " b" , "target" : " c" , "weight" : 1 }
191192 ]
192193}
193194```
You can’t perform that action at this time.
0 commit comments