Skip to content

Instantly share code, notes, and snippets.

@veltman
Last active August 29, 2015 13:57
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 veltman/9500853 to your computer and use it in GitHub Desktop.
Save veltman/9500853 to your computer and use it in GitHub Desktop.
Bad.js for @brittanystoroz, circa 2008
function showTooltip(value) {
tooltip.remove().clear();
//fill info box
tooltip.push(r.text(550,371,value.country+" - "+sports[value.sportId].name).attr({"font-family": "myriad-pro", "font-weight": 700, "font-size": 12, fill: "#222", "text-anchor": "start"}));
tooltip.push(r.text(522,390,value.name).attr({"font-family": "myriad-pro", "font-weight": 700, "font-size": 20, fill: "#222", "text-anchor": "start"}));
tooltip.push(r.text(567,414,"Weight").attr({"font-family": "myriad-pro", "font-size": 14, fill: "#222", "text-anchor": "middle"}));
tooltip.push(r.text(657,414,"Height").attr({"font-family": "myriad-pro", "font-size": 14, fill: "#222", "text-anchor": "middle"}));
tooltip.push(r.text(747,414,"Age").attr({"font-family": "myriad-pro", "font-size": 14, fill: "#222", "text-anchor": "middle"}));
tooltip.push(r.text(567,434,value.weightText).attr({"font-family": "myriad-pro", "font-size": 24, fill: "#444", "text-anchor": "middle"}));
tooltip.push(r.text(657,434,value.heightText).attr({"font-family": "myriad-pro", "font-size": 24, fill: "#444", "text-anchor": "middle"}));
tooltip.push(r.text(747,434,value.age).attr({"font-family": "myriad-pro", "font-size": 24, fill: "#444", "text-anchor": "middle"}));
if (value.flag != '') {
tooltip.push(r.image(value.flag,522,364,23,15));
}
$.each(value.medals, function(i,val) {
tooltip.push(r.circle(val.xPos,464,7).attr({fill: val.fillColor, "stroke": "#ccc", "stroke-width": 2}));
});
if (value.photo != '') {
tooltip.push(r.image('loading-circle-small.gif',466,408.5,16,16));
tooltip.push(r.image(value.photo,432,364,84,105));
tooltip.push(r.rect(431,363,86,107).attr({fill: "none","stroke-width": 1, stroke: "#000"}));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment