[ Launch Inlet ]
Gist #4403141 [ Launch Inlet ]
Gist #4403136 [ Launch Inlet ]
Gist #3200444
-
-
Save roundrobin/4403199 to your computer and use it in GitHub Desktop.
Another Inlet
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
{"description":"Another Inlet","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}},"tab":"edit","display_percent":0.49531249999999993,"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,"hidepanel":false} |
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 svg = d3.select("svg"); | |
function Tooltip(x, y, width, height, appendTo, contentElements, onclickCallback){ | |
this.x = x; | |
this.y = y; | |
this.paddingX = 10; | |
this.paddingY = 10; | |
this.onclickCallback = onclickCallback; | |
this.appendTo = appendTo.append("g") | |
.attr("class","tooltip-container") | |
.attr("transform","translate("+[this.x,this.y]+")");; | |
this.dimensions = {"width":width, "height":height}; | |
this.contentFill = contentElements; | |
//this.reponsiveTypes = ["fitToWidth","wrapText"]; | |
this.bgRect = this.appendTo.append("svg:rect") | |
.attr("width", this.dimensions["width"]) | |
.attr("height", this.dimensions["height"]) | |
.attr("rx",20) | |
.attr("ry",20) | |
.attr("x",0) | |
.attr("y",0) | |
.attr("fill","#201F24") | |
.classed("bgRect",true); | |
this.arrow = this.appendTo.append('svg:path') | |
.attr("fill","#201F24") | |
.attr("d","m0,0 l35,0 l-17.5,20Z") | |
.attr("fill","#201F24") | |
.attr("transform","translate("+[(this.dimensions["width"]/2)-8,this.dimensions["height"]]+")"); | |
this.content = contentElements(this.appendTo)() | |
.attr("transform","translate("+[this.paddingX,this.paddingY]+")"); | |
} | |
Tooltip.prototype.render = function(){ | |
}; | |
Tooltip.prototype.show = function(){ | |
}; | |
Tooltip.prototype.destroy = function(){ | |
}; | |
Tooltip.prototype.hide = function(){ | |
}; | |
var content = function(appendTo){ | |
return function(){ | |
return appendTo.append('svg:text') | |
.text(function(d,i){ return "Hello World";}) | |
.attr("fill", "#FFFFFF") | |
.attr("x", 0) | |
.attr("y", 40) | |
.attr("font-size", 29) | |
.attr("font-family", "Arial") | |
.attr("text-anchor", "start"); | |
} | |
} | |
var x = new Tooltip(189,100,200,100,svg,content); | |
var y = new Tooltip(192,316,413,100,svg,content); | |
var x = new Tooltip(425,100,200,100,svg,content); | |
var y = new Tooltip(192,515,413,100,svg,content); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment