UnitGraph icon indicating copy to clipboard operation
UnitGraph copied to clipboard

Depth by length; compareEdge option; options to trace

Open lpw opened this issue 7 years ago • 0 comments

Allow search by length as well as distance via the option

{ byLength: true } 

Add a compareEdge option as well as the compare option for nodes:

{ compareEdge: function( edge ) {} }

and a compareNode option which more strictly checks each node than compare:

{ compareNode: function( node ) {} }

And allow graph's trace to take options like graph's closest already does:

graph.trace( node1, node2, options )

taking care to ensure backwards compatibility (compare behaves as before, and trace can still take just direction).

Ensured all existing tests still pass, added new tests.

Didn't presume to update the README but could be done too.

... see the build failed - could backport to less es6y javascript if important to keep it so.

lpw avatar Mar 20 '17 22:03 lpw