/_.md
Created
July 14, 2014 21:29
Revisions
-
emunsing revised this gist
Jul 14, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ [ <a href="http://tributary.io/inlet/5bf22058ce477084bbf7">Launch: Tributary inlet</a> ] 5bf22058ce477084bbf7 by emunsing<br> -
emunsing created this gist
Jul 14, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ {"description":"Tributary inlet","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"ajax-caching":true} This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ var mySvg = d3.select("svg"); var cx = tributary.sw/2; var cy = tributary.sh/2; var outr = 200; var outer = mySvg.append("circle") .attr({ cx: cx, cy: cy, r : outr, fill:"none", stroke:"#03c100", "stroke-width": 4 }); var electron = mySvg.append("circle") .attr({ cx: cx+outr, cy: cy, r: 15, fill: "#000000" }) var myCoords = mySvg.append("text") .attr("transform","translate("+[0,20]+")") .text("Hello World!"); var myDrag = d3.behavior.drag() .on("drag",function(){ var mx = d3.mouse(this)[0]; var my = d3.mouse(this)[1]; var omega = Math.atan2(mx-cx,my-cy); myCoords.text("Woot!"); var nx = outr.Math.sin(omega); var ny = outr.Math.cos(omega); electron.attr({cx: cx+ nx, cy:cy + ny}); }) electron.call(myDrag);