linkView.sendToken(token, [duration], [callback])
Send a token along the link. token
is an SVG element that will be animated along the link path for duration
milliseconds (default is 1000ms). callback
will be called once the token reaches the end of the link path. Example:
// Send an SVG circle token along the link.
paper.findViewByModel(link).sendToken(V('circle', { r: 7, fill: 'green' }).node)
Note that in the code above, we use the Vectorizer mini-library to create the SVG circle element.
Please see the Petri Net simulator demo for a full working example.