Skip to content

Instantly share code, notes, and snippets.

@heavysixer
Created March 16, 2016 16:23
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 heavysixer/65e0ac8e993d474e19a3 to your computer and use it in GitHub Desktop.
Save heavysixer/65e0ac8e993d474e19a3 to your computer and use it in GitHub Desktop.
test
{"description":"test","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,"tab":"edit","display_percent":0.7,"thumbnail":"http://i.imgur.com/Z4ghHZY.png","fullscreen":false,"ajax-caching":true}
var steps =[];
var offset = 1;
var size = 100;
for(var x=0; x < (size/offset); x++){
steps.push(x);
}
var origin = [300,300];
var svg = d3.select("svg")
svg.selectAll('rect').data(steps).enter()
.append("rect")
.attr({
'shape-rendering': 'auto',
x: function(d,i){
var diff = origin[0] + ((offset*i)/2);
return diff;
},
y: function(d,i){
return origin[1] + ((offset*i)/2);
},
width: function(d,i){
return size - (i*offset)
},
height: function(d,i){
return size - (i*offset)
},
stroke: "#ff0000",
'stroke-width': offset +'px',
fill:'none'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment