Skip to content

Instantly share code, notes, and snippets.

@roundrobin
Created July 10, 2012 05:47
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 roundrobin/3081400 to your computer and use it in GitHub Desktop.
Save roundrobin/3081400 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,options){
var elem = this.svg.append('circle').attr('r',r)
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,{fill:"#358885", cx:267,cy: 222})
b.circle(54,{fill:"#358885", cx:375,cy: 222})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment