India Sketch - SVG, Raphael-JS, Sketcher-JS
HTML
<input type='button' onclick='india.sketch(2000,25);' value='sketch'/>
JavaScript
/*----------------Sketcher JS Code-------------------------------
-------------Code from https://github.com/arpitworld/sketcher----
----------------------------------------------------------------*/
Raphael.el.sketch = function(time,step){
var el = this;
if(typeof(step)=='undefined'){step=1;}
var paper = el.paper;
var len = el.getTotalLength();
var parts = Math.ceil(len/step);
var deltaT = time/parts;
var newel = paper.path(el.attrs.path).hide();
var i = 0;
el.attr({path:newel.getSubpath(0,0)});
for(var counter=0; counter<=parts; counter++){
setTimeout(function(){
var subpath = newel.getSubpath(0,i*step);
el.attr({path:subpath});
i++;
},counter*deltaT);
}
setTimeout(function(){newel.remove()}, Math.ceil(counter*deltaT));
return el
}
/*----------------------------------------------------------------*/
/*-----------Code to draw Path------------------------------------*/
var r = Raphael(0,50,'640','700');
india = r.path("M 158.25000,196.23718 L 156.62500,195.86218 L 155.75000,195.73718 L 155.37500,194.98718 L 154.00000,194.86218 L 153.37500,194.86218 L 153.37500,194.23718 L 153.37500,193.98718 L 151.87500,193.86218 L 151.37500,194.11218 L 151.37500,193.11218 L 149.87500,192.98718 L 149.75000,192.61218 L 148.50000,192.11218 L 147.25000,192.11218 L 147.25000,190.86218 L 145.62500,190.23718 L 145.75000,188.86218 L 145.62500,185.98718 L 145.87500,185.23718 L 145.87500,183.73718 L 145.50000,182.48718 L 145.12500,182.23718 L 145.12500,181.23718 L 144.12500,180.98718 L 144.12500,179.61218 L 142.62500,178.98718 L 142.62500,177.48718 L 142.62500,176.11218 L 142.62500,174.61218 L 142.62500,173.11218 L 142.62500,170.86218 L 142.75000,168.61218 L 143.00000,164.48718 L 143.25000,161.23718 L 143.25000,160.11218 L 142.87500,157.86218 L 143.12500,156.86218 L 143.12500,155.98718 L 144.00000,155.73718 L 144.00000,155.11218 L 144.12500,153.98718 L 144.87500,153.61218 L 145.37500,153.11218 L...