Created
July 10, 2012 06:07
-
-
Save roundrobin/3081467 to your computer and use it in GitHub Desktop.
just another inlet to tributary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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