I am trying to draw a simple path with animation from start to end of a path using the Raphaël.js library at this Demo.
var canvas = Raphael('canvas', 900, 648);
var pathString = "M 200,200 L200,10 L100,10";
$('#start').click(function(e) {
var line = canvas.path(pathString).attr({ stroke: "#000" });
line.animate({ },5000);
});
but not sure how to use the animate() function here. How can I achieve this?
There may be a better way to do this, but here is the best I can find:
getSubpathallows retrieving a segment of a path. By implementing a custom property which can be animated, we can control the path based on the value of this property:https://jsfiddle.net/r40k0kjv/5/