// Generated by CoffeeScript 1.10.0 (function() { var A, alphas, canvas, color, context, j, points, results; points = [[480, 30], [800, 250], [780, 250], [480, 470], [260, 250], [160, 280]]; A = 10; alphas = (function() { results = []; for (var j = 0; 0 <= A ? j <= A : j >= A; 0 <= A ? j++ : j--){ results.push(j); } return results; }).apply(this).map(function(d) { return d / A; }); color = function(alpha) { switch (alpha) { case 0: return 'green'; case 0.5: return 'blue'; case 1: return 'red'; default: return '#CCC'; } }; canvas = document.querySelectorAll('canvas')[0]; context = canvas.getContext('2d'); alphas.forEach(function(alpha, i) { var line; line = d3_shape.line().context(context).interpolate('catmull-rom', alpha); context.beginPath(); line(points); context.lineWidth = 1; context.strokeStyle = color(alpha); return context.stroke(); }); }).call(this);