Skip to content

Instantly share code, notes, and snippets.

@danharr
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danharr/6216155e73d119b05c17 to your computer and use it in GitHub Desktop.
Save danharr/6216155e73d119b05c17 to your computer and use it in GitHub Desktop.
lightning
{"description":"lightning","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"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,"thumbnail":"http://i.imgur.com/ycE4MwC.png","inline-console":true}
viz = d3.select("svg");
viz.append("rect").attr("height",699).attr("width",924).attr("x",50).attr("y",50).style("fill","#000000")
var p = [];
x=0;
for (i = 0; i < 51; i++) {
z=Math.floor(Math.random()*14);
x=z+x;
p.push([x+z]);
}
z = d3.merge(p);
viz.append("defs").append("filter").attr("id","blur").attr("x",0).attr("y",0)
.append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",4);
var line = d3.svg.line()
//.interpolate("basis")
.y(function(d,i) { return 55 + i*7; })
.x(function(d) { return 312 + d; });
var path = viz.append("path")
.datum(z)
.attr("class", "line")
.style("fill","none")
.style("stroke","#fff714")
.style("stroke-width",4.24)
.attr("d", line)
.attr("filter","url(#blur)");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment