Skip to content

Commit 220c8e0

Browse files
committed
Add changes to documentation
Now reflects new return values for `serialize()`
1 parent 4cfa338 commit 220c8e0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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

170171
Here'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
```

0 commit comments

Comments
 (0)