Created
July 11, 2012 02:43
-
-
Save roundrobin/3087618 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(113,374,147) | |
var fo = g.append("foreignObject") | |
.attr("width", 100) | |
.attr("height", 14) | |
.append("xhtml:body") | |
fo.append('input').attr('id','content') | |
g.append('rect') | |
.attr('width',49) | |
.attr('height',55) | |
.attr('fill','red') | |
.on('click',function(){ | |
console.log($('#content').html(),'Log') | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment