Path Tracing

Basic Example

// setup two nodes and connectvartoolkit=jsPlumbToolkit.newInstance();varrenderer=toolkit.render({container:"myElement"});toolkit.load({data:{nodes:[abunchofnodes.let'spretendtheyhaveIDsfrom1-34],edges:[abunchofedges]}});vartraced=renderer.tracePath({source:1,target:23,overlay:"Arrow"});if(!traced)alert("There was no such path");

In this example we've attempted to trace an arrow overlay along the shortest path from node 1 to node 23, using
the default animation options, which are:

Tracing a specific Path

The two examples given so far do not mandate any specific Path to travel from the source to the target, so the
Toolkit will pick the shortest path (which is controlled by both number of hops and edge cost if you have provided
that for any of your edges). However, you can supply any Path to this method, should you want to.

To get a Path that is not the shortest path you will need to make use of a nodeFilter and/or edgeFilter when you
call getPath on some Toolkit instance, as discussed on this page. An example: