Skip to content

Instantly share code, notes, and snippets.

@DeBraid
Last active August 29, 2015 14:10
Show Gist options
  • Save DeBraid/f44ce287dedb72bf9614 to your computer and use it in GitHub Desktop.
Save DeBraid/f44ce287dedb72bf9614 to your computer and use it in GitHub Desktop.
droplet
{"description":"droplet","endpoint":"","display":"svg","public":true,"require":[{"name":"superformula","url":"http://d3js.org/d3.superformula.v0.min.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"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/rtFNPTT.png"}
var svg = d3.select("svg");
var dropPath = 'M 243.44676,222.01677 C 243.44676,288.9638 189.17548,343.23508 122.22845,343.23508 C 55.281426,343.23508 1.0101458,288.9638 1.0101458,222.01677 C 1.0101458,155.06975 40.150976,142.95572 122.22845,0.79337431 C 203.60619,141.74374 243.44676,155.06975 243.44676,222.01677 z';
var data = d3.range(45).map(function(){ return Math.random()/3; });
svg.selectAll('g.drop').data(data)
.enter().append('g')
.attr({
'class': 'drop',
transform: function(d, i){ return 'translate('+[Math.random()*564, Math.random()*450]+') scale('+d+')'; }
})
.append('path').attr({d: dropPath})
.style({
stroke: 'skyblue',
'stroke-width': '3px',
fill: 'aliceblue',
'fill-opacity': 0.0360000000000001
});
svg {
background-color:#0E0E0E;
}
.time_controls {
display:none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment