d3.tip=function(){function t(t){v=m(t),w=v.createSVGPoint(),document.body.appendChild(x)}function e(){return"n"}function n(){return[0,0]}function r(){return" "}function o(){var t=y();return{top:t.n.y-x.offsetHeight,left:t.n.x-x.offsetWidth/2}}function s(){var t=y();return{top:t.s.y,left:t.s.x-x.offsetWidth/2}}function l(){var t=y();return{top:t.e.y-x.offsetHeight/2,left:t.e.x}}function u(){var t=y();return{top:t.w.y-x.offsetHeight/2,left:t.w.x-x.offsetWidth}}function f(){var t=y();return{top:t.nw.y-x.offsetHeight,left:t.nw.x-x.offsetWidth}}function i(){var t=y();return{top:t.ne.y-x.offsetHeight,left:t.ne.x}}function a(){var t=y();return{top:t.sw.y,left:t.sw.x-x.offsetWidth}}function c(){var t=y();return{top:t.se.y,left:t.e.x}}function d(){var t=document.createElement("div");return t.style.position="absolute",t.style.display="none",t.style.boxSizing="border-box",t}function m(t){if(t=t.node(),"svg"==t.tagName.toLowerCase())return t;for(;t.parentNode;)if(t=t.parentNode,"svg"==t.tagName.toLowerCase())return t;return null}function y(){var t=d3.event.target,e={},n=t.getScreenCTM(),r=t.getBBox(),o=r.width,s=r.height,l=r.x,u=r.y,f=document.body.scrollTop;return scrollLeft=document.body.scrollLeft,document.documentElement&&document.documentElement.scrollTop&&(f=document.documentElement.scrollTop,scrollLeft=document.documentElement.scrollLeft),w.x=l+scrollLeft,w.y=u+f,e.nw=w.matrixTransform(n),w.x+=o,e.ne=w.matrixTransform(n),w.y+=s,e.se=w.matrixTransform(n),w.x-=o,e.sw=w.matrixTransform(n),w.y-=s/2,e.w=w.matrixTransform(n),w.x+=o,e.e=w.matrixTransform(n),w.x-=o/2,w.y-=s/2,e.n=w.matrixTransform(n),w.y+=s,e.s=w.matrixTransform(n),e}var p=e,g=n,h=r,x=d(),v=null,w=null;t.show=function(){var e,n=h.apply(this,arguments),r=g.apply(this,arguments),o=p.apply(this,arguments),s=T.keys(),l=d3.select(x),u=0;for(l.html(n).style("display","block"),u;s.length>u;u++)l.classed(s[u],!1);return e=T.get(o).apply(this),l.classed(o,!0).style({top:e.top+r[0]+"px",left:e.left+r[1]+"px"}),t},t.hide=function(){return x.style.display="none",x.innerHTML="",t},t.attr=function(e,n){return 2>arguments.length?d3.select(x).attr(e):(d3.select(x).attr(e,n),t)},t.style=function(e,n){return 2>arguments.length?d3.select(x).style(e):(d3.select(x).style(e,n),t)},t.direction=function(e){return arguments.length?(p=null==e?e:d3.functor(e),t):p},t.offset=function(e){return arguments.length?(g=null==e?e:d3.functor(e),t):g},t.html=function(e){return arguments.length?(h=null==e?e:d3.functor(e),t):h};var T=d3.map({n:o,s:s,e:l,w:u,nw:f,ne:i,sw:a,se:c});return t};