From 58974042044d53309d914eacc0e0abeca972e63e Mon Sep 17 00:00:00 2001 From: geremy Date: Sun, 4 Jan 2015 16:27:13 -0800 Subject: drawing scale lines --- python/examples/futureHouse/waveViz.js | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'python') diff --git a/python/examples/futureHouse/waveViz.js b/python/examples/futureHouse/waveViz.js index 02094a5..5e59a18 100644 --- a/python/examples/futureHouse/waveViz.js +++ b/python/examples/futureHouse/waveViz.js @@ -60,25 +60,16 @@ $(function () { ctx.strokeStyle = '#ffffff'; ctx.stroke(); + var gradients = 5; + for (var z = -1; z < gradients; z++) { - for (var z = 0; z < 5; z++) { + ctx.beginPath(); + ctx.moveTo(10, hOffset - (hOffset / 2 * ((z+1) / gradients)) ); + ctx.lineTo(w, hOffset - (hOffset / 2 * ((z+1) / gradients)) ); + ctx.strokeStyle = '#ff0000'; + ctx.stroke(); } - // 0 line - - ctx.beginPath(); - ctx.moveTo(10, hOffset); - ctx.lineTo(w, hOffset); - ctx.strokeStyle = '#ff0000'; - ctx.stroke(); - - // 1 line - - ctx.beginPath(); - ctx.moveTo(10, hOffset / 2); - ctx.lineTo(w, hOffset / 2); - ctx.strokeStyle = '#ff0000'; - ctx.stroke(); requestAnimationFrame(loop); } -- cgit v1.2.3