Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created January 28, 2013 07:20
Show Gist options
  • Save roundrobin/4653614 to your computer and use it in GitHub Desktop.
Save roundrobin/4653614 to your computer and use it in GitHub Desktop.
Pattern grid - tube2
{"description":"Pattern grid - tube2","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}},"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"fullscreen":false,"thumbnail":"http://i.imgur.com/yFi4VeI.png"}
var pattern_size = 53;
var defs = d3.select('svg').append('defs')
var pattern = defs.append('pattern')
.attr('id','pattern1')
.attr('pattermTransform','')
.attr('height',pattern_size)
.attr('width',pattern_size)
.attr('patternUnits','userSpaceOnUse')
var r = pattern_size/2;
var gr = pattern.append("svg:g")
.attr("transform","translate("+[0,0]+")")
.attr("class","group");
gr.append("svg:circle")
.attr("r",r)
.attr("cx",0)
.attr("cy",0)
.attr("fill","#29529C");
gr.append("svg:circle")
.attr("r",r)
.attr("cx",0)
.attr("cy",51)
.attr("fill","#29529C");
gr.append("svg:circle")
.attr("r",r)
.attr("cx",pattern_size)
.attr("cy",26)
.attr("fill","#29529C");
var gr = pattern.append("svg:g")
.attr("transform","translate("+[6,0]+")")
.attr("class","group");
var col2 = '#EEDD15';
gr.append("svg:circle")
.attr("r",r)
.attr("cx",0)
.attr("cy",0)
.attr("fill",col2)
.attr("fill-opacity",0.5);
gr.append("svg:circle")
.attr("r",r)
.attr("cx",0)
.attr("cy",51)
.attr("fill",col2)
.attr("fill-opacity",0.5);
gr.append("svg:circle")
.attr("r",r)
.attr("cx",pattern_size)
.attr("cy",26)
.attr("fill",col2)
.attr("fill-opacity",0.5);
d3.select('svg').append('rect')
.attr('height',tributary.sh)
.attr('width',tributary.sw)
.attr('fill','url(#pattern1)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment