Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created July 10, 2012 06:07
Show Gist options
  • Save roundrobin/3081466 to your computer and use it in GitHub Desktop.
Save roundrobin/3081466 to your computer and use it in GitHub Desktop.
just another inlet to tributary
var Baushaus = function(){
this.svg = g;
}
Baushaus.prototype.mergeOptions = function(element, options){ for(option in options){ element.attr(option,options[option]); } };
Baushaus.prototype.circle = function(r,x,y,options){
var elem = this.svg.append('circle').attr('r',r);
elem.attr('cx',x)
elem.attr('cy',y)
if(options) this.mergeOptions(elem,options);
return elem;
};
Baushaus.prototype.rect = function(w,h,options){ return this.svg.append('rect').attr('width',w).attr('height',h) };
Baushaus.prototype.square = function(s,options){ return this.svg.append('rect').attr('width',s).attr('height',s)};
var b = new Baushaus();
b.circle(54,167,147)
b.circle(73,300,147)
b.circle(73,215,279)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment