Skip to content

Commit

Permalink
Adding the edge parameter to anonymous function
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasamaduro committed Nov 10, 2017
1 parent 17791a7 commit 2081816
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions documentation/md/collection/dijkstra.md
Expand Up @@ -19,10 +19,10 @@ If no weight function is defined, a constant weight of 1 is used for each edge.
## Examples

```js
var dijkstra = cy.elements().dijkstra('#e', function(){
return this.data('weight');
var dijkstra = cy.elements().dijkstra('#e', function(edge){
return edge.data('weight');
});

var pathToJ = dijkstra.pathTo( cy.$('#j') );
var distToJ = dijkstra.distanceTo( cy.$('#j') );
```
```

0 comments on commit 2081816

Please sign in to comment.