graphdb-workbench
Version:
The web application for GraphDB APIs
1 lines • 188 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{227:function(t,e,n){var r,o;r=[n(214)],void 0===(o=function(){var t,e,n,r;return(r=window.nv||{}).version="1.1.10b",r.dev=!0,window.nv=r,r.tooltip={},r.utils={},r.models={},r.charts={},r.graphs=[],r.logs={},r.dispatch=d3.dispatch("render_start","render_end"),r.dev&&(r.dispatch.on("render_start",(function(t){r.logs.startTime=+new Date})),r.dispatch.on("render_end",(function(t){r.logs.endTime=+new Date,r.logs.totalTime=r.logs.endTime-r.logs.startTime}))),r.log=function(){if(r.dev&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(r.dev&&"function"==typeof console.log&&Function.prototype.bind){var t=Function.prototype.bind.call(console.log,console);t.apply(console,arguments)}return arguments[arguments.length-1]},r.render=function(t){t=t||1,r.render.active=!0,r.dispatch.render_start(),setTimeout((function(){for(var e,n,o=0;o<t&&(n=r.render.queue[o]);o++)e=n.generate(),typeof n.callback==typeof Function&&n.callback(e),r.graphs.push(e);r.render.queue.splice(0,o),r.render.queue.length?setTimeout(arguments.callee,0):(r.render.active=!1,r.dispatch.render_end())}),0)},r.render.active=!1,r.render.queue=[],r.addGraph=function(t){typeof arguments[0]==typeof Function&&(t={generate:arguments[0],callback:arguments[1]}),r.render.queue.push(t),r.render.active||r.render()},r.identity=function(t){return t},r.strip=function(t){return t.replace(/(\s|&)/g,"")},d3.time.monthEnd=function(t){return new Date(t.getFullYear(),t.getMonth(),0)},d3.time.monthEnds=(t=d3.time.monthEnd,e=function(t){var e,n;t.setUTCDate(t.getUTCDate()+1),t.setDate((e=t.getMonth()+1,n=t.getFullYear(),new Date(n,e+1,0).getDate()))},n=function(t){return t.getMonth()},function(r,o,a){var i=t(r),l=[];if(i<r&&e(i),a>1)for(;i<o;){var s=new Date(+i);n(s)%a==0&&l.push(s),e(i)}else for(;i<o;)l.push(new Date(+i)),e(i);return l}),r.interactiveGuideline=function(){"use strict";var t=r.models.tooltip(),e=null,n=null,o={left:0,top:0},a=d3.scale.linear(),i=(d3.scale.linear(),d3.dispatch("elementMousemove","elementMouseout")),l=!0,s=null,c=-1!==navigator.userAgent.indexOf("MSIE");function u(d){d.each((function(d){var p=d3.select(this),f=e||960,h=n||400,g=p.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([d]);function v(){var e=d3.mouse(this),n=e[0],r=e[1],l=!0,s=!1;if(c&&(n=d3.event.offsetX,r=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(l=!1),d3.event.target.className.baseVal.match("nv-legend")&&(s=!0)),l&&(n-=o.left,r-=o.top),n<0||r<0||n>f||r>h||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||s){if(c&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&d3.event.relatedTarget.className.match(t.nvPointerEventsClass))return;return i.elementMouseout({mouseX:n,mouseY:r}),void u.renderGuideLine(null)}var d=a.invert(n);i.elementMousemove({mouseX:n,mouseY:r,pointXValue:d})}g.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer").append("g").attr("class","nv-interactiveGuideLine"),s&&(s.on("mousemove",v,!0).on("mouseout",v,!0),u.renderGuideLine=function(t){if(l){var e=g.select(".nv-interactiveGuideLine").selectAll("line").data(null!=t?[r.utils.NaNtoZero(t)]:[],String);e.enter().append("line").attr("class","nv-guideline").attr("x1",(function(t){return t})).attr("x2",(function(t){return t})).attr("y1",h).attr("y2",0),e.exit().remove()}})}))}return u.dispatch=i,u.tooltip=t,u.margin=function(t){return arguments.length?(o.top=void 0!==t.top?t.top:o.top,o.left=void 0!==t.left?t.left:o.left,u):o},u.width=function(t){return arguments.length?(e=t,u):e},u.height=function(t){return arguments.length?(n=t,u):n},u.xScale=function(t){return arguments.length?(a=t,u):a},u.showGuideLine=function(t){return arguments.length?(l=t,u):l},u.svgContainer=function(t){return arguments.length?(s=t,u):s},u},r.interactiveBisect=function(t,e,n){"use strict";if(!t instanceof Array)return null;"function"!=typeof n&&(n=function(t,e){return t.x});var r=d3.bisector(n).left,o=d3.max([0,r(t,e)-1]),a=n(t[o],o);if(void 0===a&&(a=o),a===e)return o;var i=d3.min([o+1,t.length-1]),l=n(t[i],i);return void 0===l&&(l=i),Math.abs(l-e)>=Math.abs(a-e)?o:i},function(){"use strict";window.nv.tooltip={},window.nv.models.tooltip=function(){var t=null,e=null,n="w",o=50,a=25,i=null,l=null,s=null,c={left:null,top:null},u=!0,d="nvtooltip-"+Math.floor(1e5*Math.random()),p="nv-pointer-events-none",f=function(t,e){return t},h=function(t){return t},g=function(e){if(null!=t)return t;if(null==e)return"";var n="<table><thead><tr><td colspan='3'><strong class='x-value'>"+h(e.value)+"</strong></td></tr></thead><tbody>";return e.series instanceof Array&&e.series.forEach((function(t,e){n+="<tr>",n+="<td class='legend-color-guide'><div style='background-color: "+t.color+";'></div></td>",n+="<td class='key'>"+t.key+":</td>",n+="<td class='value'>"+f(t.value,e)+"</td></tr>"})),n+="</tbody></table>"},v=function(t){return!!(t&&t.series&&t.series.length>0)};function m(){if(u&&v(e)){!function(){if(s){var t=d3.select(s);"svg"!==t.node().tagName&&(t=t.select("svg"));var e=t.node()?t.attr("viewBox"):null;if(e){e=e.split(" ");var n=parseInt(t.style("width"))/e[2];c.left=c.left*n,c.top=c.top*n}}}();var t=c.left,f=null!=i?i:c.top,h=function(t){var e,n=(e=s?d3.select(s):d3.select("body")).select(".nvtooltip");return null===n.node()&&(n=e.append("div").attr("class","nvtooltip "+(l||"xy-tooltip")).attr("id",d)),n.node().innerHTML=t,n.style("top",0).style("left",0).style("opacity",0),n.selectAll("div, table, td, tr").classed(p,!0),n.classed(p,!0),n.node()}(g(e));if(s){var x=s.getElementsByTagName("svg")[0],y=(x?x.getBoundingClientRect():s.getBoundingClientRect(),{left:0,top:0});if(x){var b=x.getBoundingClientRect(),k=s.getBoundingClientRect();y.top=Math.abs(b.top-k.top),y.left=Math.abs(b.left-k.left)}t+=s.offsetLeft+y.left-2*s.scrollLeft,f+=s.offsetTop+y.top-2*s.scrollTop}return a&&a>0&&(f=Math.floor(f/a)*a),r.tooltip.calcTooltipPosition([t,f],n,o,h),m}}return m.nvPointerEventsClass=p,m.content=function(e){return arguments.length?(t=e,m):t},m.contentGenerator=function(t){return arguments.length?("function"==typeof t&&(g=t),m):g},m.data=function(t){return arguments.length?(e=t,m):e},m.gravity=function(t){return arguments.length?(n=t,m):n},m.distance=function(t){return arguments.length?(o=t,m):o},m.snapDistance=function(t){return arguments.length?(a=t,m):a},m.classes=function(t){return arguments.length?(l=t,m):l},m.chartContainer=function(t){return arguments.length?(s=t,m):s},m.position=function(t){return arguments.length?(c.left=void 0!==t.left?t.left:c.left,c.top=void 0!==t.top?t.top:c.top,m):c},m.fixedTop=function(t){return arguments.length?(i=t,m):i},m.enabled=function(t){return arguments.length?(u=t,m):u},m.valueFormatter=function(t){return arguments.length?("function"==typeof t&&(f=t),m):f},m.headerFormatter=function(t){return arguments.length?("function"==typeof t&&(h=t),m):h},m.id=function(){return d},m},r.tooltip.show=function(t,e,n,o,a,i){var l=document.createElement("div");l.className="nvtooltip "+(i||"xy-tooltip");var s=a;a&&!a.tagName.match(/g|svg/i)||(s=document.getElementsByTagName("body")[0]),l.style.left=0,l.style.top=0,l.style.opacity=0,l.innerHTML=e,s.appendChild(l),a&&(t[0]=t[0]-a.scrollLeft,t[1]=t[1]-a.scrollTop),r.tooltip.calcTooltipPosition(t,n,o,l)},r.tooltip.findFirstNonSVGParent=function(t){for(;null!==t.tagName.match(/^g|svg$/i);)t=t.parentNode;return t},r.tooltip.findTotalOffsetTop=function(t,e){var n=e;do{isNaN(t.offsetTop)||(n+=t.offsetTop)}while(t=t.offsetParent);return n},r.tooltip.findTotalOffsetLeft=function(t,e){var n=e;do{isNaN(t.offsetLeft)||(n+=t.offsetLeft)}while(t=t.offsetParent);return n},r.tooltip.calcTooltipPosition=function(t,e,n,o){var a,i,l=parseInt(o.offsetHeight),s=parseInt(o.offsetWidth),c=r.utils.windowSize().width,u=r.utils.windowSize().height,d=window.pageYOffset,p=window.pageXOffset;u=window.innerWidth>=document.body.scrollWidth?u:u-16,c=window.innerHeight>=document.body.scrollHeight?c:c-16,n=n||20;var f=function(t){return r.tooltip.findTotalOffsetTop(t,i)},h=function(t){return r.tooltip.findTotalOffsetLeft(t,a)};switch(e=e||"s"){case"e":a=t[0]-s-n,i=t[1]-l/2;var g=h(o),v=f(o);g<p&&(a=t[0]+n>p?t[0]+n:p-g+a),v<d&&(i=d-v+i),v+l>d+u&&(i=d+u-v+i-l);break;case"w":a=t[0]+n,i=t[1]-l/2,g=h(o),v=f(o),g+s>c&&(a=t[0]-s-n),v<d&&(i=d+5),v+l>d+u&&(i=d+u-v+i-l);break;case"n":a=t[0]-s/2-5,i=t[1]+n,g=h(o),v=f(o),g<p&&(a=p+5),g+s>c&&(a=a-s/2+5),v+l>d+u&&(i=d+u-v+i-l);break;case"s":a=t[0]-s/2,i=t[1]-l-n,g=h(o),v=f(o),g<p&&(a=p+5),g+s>c&&(a=a-s/2+5),d>v&&(i=d);break;case"none":a=t[0],i=t[1]-n,g=h(o),v=f(o)}return o.style.left=a+"px",o.style.top=i+"px",o.style.opacity=1,o.style.position="absolute",o},r.tooltip.cleanup=function(){for(var t=document.getElementsByClassName("nvtooltip"),e=[];t.length;)e.push(t[0]),t[0].style.transitionDelay="0 !important",t[0].style.opacity=0,t[0].className="nvtooltip-pending-removal";setTimeout((function(){for(;e.length;){var t=e.pop();t.parentNode.removeChild(t)}}),500)}}(),r.utils.windowSize=function(){var t={width:640,height:480};return document.body&&document.body.offsetWidth&&(t.width=document.body.offsetWidth,t.height=document.body.offsetHeight),"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth&&(t.width=document.documentElement.offsetWidth,t.height=document.documentElement.offsetHeight),window.innerWidth&&window.innerHeight&&(t.width=window.innerWidth,t.height=window.innerHeight),t},r.utils.windowResize=function(t){if(void 0!==t){var e=window.onresize;window.onresize=function(n){"function"==typeof e&&e(n),t(n)}}},r.utils.getColor=function(t){return arguments.length?"[object Array]"===Object.prototype.toString.call(t)?function(e,n){return e.color||t[n%t.length]}:t:r.utils.defaultColor()},r.utils.defaultColor=function(){var t=d3.scale.category20().range();return function(e,n){return e.color||t[n%t.length]}},r.utils.customTheme=function(t,e,n){e=e||function(t){return t.key};var r=(n=n||d3.scale.category20().range()).length;return function(o,a){var i=e(o);return r||(r=n.length),void 0!==t[i]?"function"==typeof t[i]?t[i]():t[i]:n[--r]}},r.utils.pjax=function(t,e){function n(n){d3.html(n,(function(n){var o=d3.select(e).node();o.parentNode.replaceChild(d3.select(n).select(e).node(),o),r.utils.pjax(t,e)}))}d3.selectAll(t).on("click",(function(){history.pushState(this.href,this.textContent,this.href),n(this.href),d3.event.preventDefault()})),d3.select(window).on("popstate",(function(){d3.event.state&&n(d3.event.state)}))},r.utils.calcApproxTextWidth=function(t){if(t instanceof d3.selection){var e=parseInt(t.style("font-size").replace("px",""));return t.text().length*e*.5}return 0},r.utils.NaNtoZero=function(t){return"number"!=typeof t||isNaN(t)||null===t||t===1/0?0:t},r.utils.optionsFunc=function(t){return t&&d3.map(t).forEach(function(t,e){"function"==typeof this[t]&&this[t](e)}.bind(this)),this},r.models.axis=function(){"use strict";var t,e=d3.svg.axis(),n={top:0,right:0,bottom:0,left:0},o=75,a=60,i=d3.scale.linear(),l=null,s=!0,c=!0,u=0,d=!0,p=!1,f=!1,h=null;function g(r){return r.each((function(r){var a=d3.select(this).selectAll("g.nv-wrap.nv-axis").data([r]),g=(a.enter().append("g").attr("class","nvd3 nv-wrap nv-axis").append("g"),a.select("g"));null!==h?e.ticks(h):"top"!=e.orient()&&"bottom"!=e.orient()||e.ticks(Math.abs(i.range()[1]-i.range()[0])/100),g.transition().call(e),t=t||e.scale();var v=e.tickFormat();null==v&&(v=t.tickFormat());var m=g.selectAll("text.nv-axislabel").data([l||null]);switch(m.exit().remove(),e.orient()){case"top":m.enter().append("text").attr("class","nv-axislabel");var x=2==i.range().length?i.range()[1]:i.range()[i.range().length-1]+(i.range()[1]-i.range()[0]);m.attr("text-anchor","middle").attr("y",0).attr("x",x/2),s&&((A=a.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class","nv-axisMaxMin").append("text"),A.exit().remove(),A.attr("transform",(function(t,e){return"translate("+i(t)+",0)"})).select("text").attr("dy","0em").attr("y",-e.tickPadding()).attr("text-anchor","middle").text((function(t,e){var n=v(t);return(""+n).match("NaN")?"":n})),A.transition().attr("transform",(function(t,e){return"translate("+i.range()[e]+",0)"})));break;case"bottom":var y=36,b=30,k=g.selectAll("g").select("text");if(u%360){k.each((function(t,e){var n=this.getBBox().width;n>b&&(b=n)}));var w=Math.abs(Math.sin(u*Math.PI/180));y=(w?w*b:b)+30,k.attr("transform",(function(t,e,n){return"rotate("+u+" 0,0)"})).style("text-anchor",u%360>0?"start":"end")}m.enter().append("text").attr("class","nv-axislabel"),x=2==i.range().length?i.range()[1]:i.range()[i.range().length-1]+(i.range()[1]-i.range()[0]),m.attr("text-anchor","middle").attr("y",y).attr("x",x/2),s&&((A=a.selectAll("g.nv-axisMaxMin").data([i.domain()[0],i.domain()[i.domain().length-1]])).enter().append("g").attr("class","nv-axisMaxMin").append("text"),A.exit().remove(),A.attr("transform",(function(t,e){return"translate("+(i(t)+(f?i.rangeBand()/2:0))+",0)"})).select("text").attr("dy",".71em").attr("y",e.tickPadding()).attr("transform",(function(t,e,n){return"rotate("+u+" 0,0)"})).style("text-anchor",u?u%360>0?"start":"end":"middle").text((function(t,e){var n=v(t);return(""+n).match("NaN")?"":n})),A.transition().attr("transform",(function(t,e){return"translate("+(i(t)+(f?i.rangeBand()/2:0))+",0)"}))),p&&k.attr("transform",(function(t,e){return"translate(0,"+(e%2==0?"0":"12")+")"}));break;case"right":m.enter().append("text").attr("class","nv-axislabel"),m.style("text-anchor",d?"middle":"begin").attr("transform",d?"rotate(90)":"").attr("y",d?12-Math.max(n.right,o):-10).attr("x",d?i.range()[0]/2:e.tickPadding()),s&&((A=a.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),A.exit().remove(),A.attr("transform",(function(t,e){return"translate(0,"+i(t)+")"})).select("text").attr("dy",".32em").attr("y",0).attr("x",e.tickPadding()).style("text-anchor","start").text((function(t,e){var n=v(t);return(""+n).match("NaN")?"":n})),A.transition().attr("transform",(function(t,e){return"translate(0,"+i.range()[e]+")"})).select("text").style("opacity",1));break;case"left":var A;m.enter().append("text").attr("class","nv-axislabel"),m.style("text-anchor",d?"middle":"end").attr("transform",d?"rotate(-90)":"").attr("y",d?12-Math.max(n.left,o):-10).attr("x",d?-i.range()[0]/2:-e.tickPadding()),s&&((A=a.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),A.exit().remove(),A.attr("transform",(function(e,n){return"translate(0,"+t(e)+")"})).select("text").attr("dy",".32em").attr("y",0).attr("x",-e.tickPadding()).attr("text-anchor","end").text((function(t,e){var n=v(t);return(""+n).match("NaN")?"":n})),A.transition().attr("transform",(function(t,e){return"translate(0,"+i.range()[e]+")"})).select("text").style("opacity",1))}if(m.text((function(t){return t})),!s||"left"!==e.orient()&&"right"!==e.orient()||(g.selectAll("g").each((function(t,e){d3.select(this).select("text").attr("opacity",1),(i(t)<i.range()[1]+10||i(t)>i.range()[0]-10)&&((t>1e-10||t<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))})),i.domain()[0]==i.domain()[1]&&0==i.domain()[0]&&a.selectAll("g.nv-axisMaxMin").style("opacity",(function(t,e){return e?0:1}))),s&&("top"===e.orient()||"bottom"===e.orient())){var C=[];a.selectAll("g.nv-axisMaxMin").each((function(t,e){try{e?C.push(i(t)-this.getBBox().width-4):C.push(i(t)+this.getBBox().width+4)}catch(n){e?C.push(i(t)-4):C.push(i(t)+4)}})),g.selectAll("g").each((function(t,e){(i(t)<C[0]||i(t)>C[1])&&(t>1e-10||t<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())}))}c&&g.selectAll(".tick").filter((function(t){return!parseFloat(Math.round(1e5*t.__data__)/1e6)&&void 0!==t.__data__})).classed("zero",!0),t=i.copy()})),g}return e.scale(i).orient("bottom").tickFormat((function(t){return t})),g.axis=e,d3.rebind(g,e,"orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"),d3.rebind(g,i,"domain","range","rangeBand","rangeBands"),g.options=r.utils.optionsFunc.bind(g),g.margin=function(t){return arguments.length?(n.top=void 0!==t.top?t.top:n.top,n.right=void 0!==t.right?t.right:n.right,n.bottom=void 0!==t.bottom?t.bottom:n.bottom,n.left=void 0!==t.left?t.left:n.left,g):n},g.width=function(t){return arguments.length?(o=t,g):o},g.ticks=function(t){return arguments.length?(h=t,g):h},g.height=function(t){return arguments.length?(a=t,g):a},g.axisLabel=function(t){return arguments.length?(l=t,g):l},g.showMaxMin=function(t){return arguments.length?(s=t,g):s},g.highlightZero=function(t){return arguments.length?(c=t,g):c},g.scale=function(t){return arguments.length?(i=t,e.scale(i),f="function"==typeof i.rangeBands,d3.rebind(g,i,"domain","range","rangeBand","rangeBands"),g):i},g.rotateYLabel=function(t){return arguments.length?(d=t,g):d},g.rotateLabels=function(t){return arguments.length?(u=t,g):u},g.staggerLabels=function(t){return arguments.length?(p=t,g):p},g},r.models.bullet=function(){"use strict";var t={top:0,right:0,bottom:0,left:0},e="left",n=!1,o=function(t){return t.ranges},a=function(t){return t.markers},i=function(t){return t.measures},l=function(t){return t.rangeLabels?t.rangeLabels:[]},s=function(t){return t.markerLabels?t.markerLabels:[]},c=function(t){return t.measureLabels?t.measureLabels:[]},u=[0],d=380,p=30,f=null,h=r.utils.getColor(["#1f77b4"]),g=d3.dispatch("elementMouseover","elementMouseout");function v(e){return e.each((function(e,r){var f=d-t.left-t.right,v=p-t.top-t.bottom,m=d3.select(this),x=o.call(this,e,r).slice().sort(d3.descending),y=a.call(this,e,r).slice().sort(d3.descending),b=i.call(this,e,r).slice().sort(d3.descending),k=l.call(this,e,r).slice(),w=s.call(this,e,r).slice(),A=c.call(this,e,r).slice(),C=d3.scale.linear().domain(d3.extent(d3.merge([u,x]))).range(n?[f,0]:[0,f]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(C.range()),this.__chart__=C;var S=d3.min(x),M=d3.max(x),D=x[1],I=m.selectAll("g.nv-wrap.nv-bullet").data([e]),W=I.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet").append("g"),F=I.select("g");W.append("rect").attr("class","nv-range nv-rangeMax"),W.append("rect").attr("class","nv-range nv-rangeAvg"),W.append("rect").attr("class","nv-range nv-rangeMin"),W.append("rect").attr("class","nv-measure"),W.append("path").attr("class","nv-markerTriangle"),I.attr("transform","translate("+t.left+","+t.top+")");var L=function(t){return Math.abs(C(t)-C(0))},z=function(t){return C(t<0?t:0)};F.select("rect.nv-rangeMax").attr("height",v).attr("width",L(M>0?M:S)).attr("x",z(M>0?M:S)).datum(M>0?M:S),F.select("rect.nv-rangeAvg").attr("height",v).attr("width",L(D)).attr("x",z(D)).datum(D),F.select("rect.nv-rangeMin").attr("height",v).attr("width",L(M)).attr("x",z(M)).attr("width",L(M>0?S:M)).attr("x",z(M>0?S:M)).datum(M>0?S:M),F.select("rect.nv-measure").style("fill",h).attr("height",v/3).attr("y",v/3).attr("width",b<0?C(0)-C(b[0]):C(b[0])-C(0)).attr("x",z(b)).on("mouseover",(function(){g.elementMouseover({value:b[0],label:A[0]||"Current",pos:[C(b[0]),v/2]})})).on("mouseout",(function(){g.elementMouseout({value:b[0],label:A[0]||"Current"})}));var N=v/6;y[0]?F.selectAll("path.nv-markerTriangle").attr("transform",(function(t){return"translate("+C(y[0])+","+v/2+")"})).attr("d","M0,"+N+"L"+N+","+-N+" "+-N+","+-N+"Z").on("mouseover",(function(){g.elementMouseover({value:y[0],label:w[0]||"Previous",pos:[C(y[0]),v/2]})})).on("mouseout",(function(){g.elementMouseout({value:y[0],label:w[0]||"Previous"})})):F.selectAll("path.nv-markerTriangle").remove(),I.selectAll(".nv-range").on("mouseover",(function(t,e){var n=k[e]||(e?1==e?"Mean":"Minimum":"Maximum");g.elementMouseover({value:t,label:n,pos:[C(t),v/2]})})).on("mouseout",(function(t,e){var n=k[e]||(e?1==e?"Mean":"Minimum":"Maximum");g.elementMouseout({value:t,label:n})}))})),v}return v.dispatch=g,v.options=r.utils.optionsFunc.bind(v),v.orient=function(t){return arguments.length?(n="right"==(e=t)||"bottom"==e,v):e},v.ranges=function(t){return arguments.length?(o=t,v):o},v.markers=function(t){return arguments.length?(a=t,v):a},v.measures=function(t){return arguments.length?(i=t,v):i},v.forceX=function(t){return arguments.length?(u=t,v):u},v.width=function(t){return arguments.length?(d=t,v):d},v.height=function(t){return arguments.length?(p=t,v):p},v.margin=function(e){return arguments.length?(t.top=void 0!==e.top?e.top:t.top,t.right=void 0!==e.right?e.right:t.right,t.bottom=void 0!==e.bottom?e.bottom:t.bottom,t.left=void 0!==e.left?e.left:t.left,v):t},v.tickFormat=function(t){return arguments.length?(f=t,v):f},v.color=function(t){return arguments.length?(h=r.utils.getColor(t),v):h},v},r.models.bulletChart=function(){"use strict";var t=r.models.bullet(),e="left",n=!1,o={top:5,right:40,bottom:20,left:120},a=function(t){return t.ranges},i=function(t){return t.markers},l=function(t){return t.measures},s=null,c=55,u=null,d=!0,p=function(t,e,n,r,o){return"<h3>"+e+"</h3><p>"+n+"</p>"},f="No Data Available.",h=d3.dispatch("tooltipShow","tooltipHide"),g=function(t,e){var n=t.pos[0]+(e.offsetLeft||0)+o.left,a=t.pos[1]+(e.offsetTop||0)+o.top,i=p(t.key,t.label,t.value,t,v);r.tooltip.show([n,a],i,t.value<0?"e":"w",null,e)};function v(e){return e.each((function(r,p){var m=d3.select(this),x=(s||parseInt(m.style("width"))||960)-o.left-o.right,y=c-o.top-o.bottom,b=this;if(v.update=function(){v(e)},v.container=this,!r||!a.call(this,r,p)){var k=m.selectAll(".nv-noData").data([f]);return k.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),k.attr("x",o.left+x/2).attr("y",18+o.top+y/2).text((function(t){return t})),v}m.selectAll(".nv-noData").remove();var w=a.call(this,r,p).slice().sort(d3.descending),A=i.call(this,r,p).slice().sort(d3.descending),C=l.call(this,r,p).slice().sort(d3.descending),S=m.selectAll("g.nv-wrap.nv-bulletChart").data([r]),M=S.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart").append("g"),D=S.select("g");M.append("g").attr("class","nv-bulletWrap"),M.append("g").attr("class","nv-titles"),S.attr("transform","translate("+o.left+","+o.top+")");var I=d3.scale.linear().domain([0,Math.max(w[0],A[0],C[0])]).range(n?[x,0]:[0,x]),W=this.__chart__||d3.scale.linear().domain([0,1/0]).range(I.range());this.__chart__=I;var F=M.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(c-o.top-o.bottom)/2+")");F.append("text").attr("class","nv-title").text((function(t){return t.title})),F.append("text").attr("class","nv-subtitle").attr("dy","1em").text((function(t){return t.subtitle})),t.width(x).height(y);var L=D.select(".nv-bulletWrap");d3.transition(L).call(t);var z=u||I.tickFormat(x/100),N=D.selectAll("g.nv-tick").data(I.ticks(x/50),(function(t){return this.textContent||z(t)})),B=N.enter().append("g").attr("class","nv-tick").attr("transform",(function(t){return"translate("+W(t)+",0)"})).style("opacity",1e-6);B.append("line").attr("y1",y).attr("y2",7*y/6),B.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*y/6).text(z);var P=d3.transition(N).attr("transform",(function(t){return"translate("+I(t)+",0)"})).style("opacity",1);P.select("line").attr("y1",y).attr("y2",7*y/6),P.select("text").attr("y",7*y/6),d3.transition(N.exit()).attr("transform",(function(t){return"translate("+I(t)+",0)"})).style("opacity",1e-6).remove(),h.on("tooltipShow",(function(t){t.key=r.title,d&&g(t,b.parentNode)}))})),d3.timer.flush(),v}return t.dispatch.on("elementMouseover.tooltip",(function(t){h.tooltipShow(t)})),t.dispatch.on("elementMouseout.tooltip",(function(t){h.tooltipHide(t)})),h.on("tooltipHide",(function(){d&&r.tooltip.cleanup()})),v.dispatch=h,v.bullet=t,d3.rebind(v,t,"color"),v.options=r.utils.optionsFunc.bind(v),v.orient=function(t){return arguments.length?(n="right"==(e=t)||"bottom"==e,v):e},v.ranges=function(t){return arguments.length?(a=t,v):a},v.markers=function(t){return arguments.length?(i=t,v):i},v.measures=function(t){return arguments.length?(l=t,v):l},v.width=function(t){return arguments.length?(s=t,v):s},v.height=function(t){return arguments.length?(c=t,v):c},v.margin=function(t){return arguments.length?(o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left,v):o},v.tickFormat=function(t){return arguments.length?(u=t,v):u},v.tooltips=function(t){return arguments.length?(d=t,v):d},v.tooltipContent=function(t){return arguments.length?(p=t,v):p},v.noData=function(t){return arguments.length?(f=t,v):f},v},r.models.cumulativeLineChart=function(){"use strict";var t,e,n=r.models.line(),o=r.models.axis(),a=r.models.axis(),i=r.models.legend(),l=r.models.legend(),s=r.interactiveGuideline(),c={top:30,right:30,bottom:50,left:60},u=r.utils.defaultColor(),d=null,p=null,f=!0,h=!0,g=!0,v=!1,m=!0,x=!0,y=!1,b=!0,k=function(t,e,n,r,o){return"<h3>"+t+"</h3><p>"+n+" at "+e+"</p>"},w=n.id(),A={index:0,rescaleY:b},C=null,S="No Data Available.",M=function(t){return t.average},D=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),I=250;o.orient("bottom").tickPadding(7),a.orient(v?"right":"left"),l.updateState(!1);var W=d3.scale.linear(),F={i:0,x:0},L=function(t,e){var i=t.pos[0]+(e.offsetLeft||0),l=t.pos[1]+(e.offsetTop||0),s=o.tickFormat()(n.x()(t.point,t.pointIndex)),c=a.tickFormat()(n.y()(t.point,t.pointIndex)),u=k(t.series.key,s,c,t,z);r.tooltip.show([i,l],u,null,null,e)};function z(k){return k.each((function(k){var N,B=d3.select(this).classed("nv-chart-"+w,!0),P=this,H=(d||parseInt(B.style("width"))||960)-c.left-c.right,T=(p||parseInt(B.style("height"))||400)-c.top-c.bottom;if(z.update=function(){B.transition().duration(I).call(z)},z.container=this,A.disabled=k.map((function(t){return!!t.disabled})),!C)for(N in C={},A)A[N]instanceof Array?C[N]=A[N].slice(0):C[N]=A[N];var R=d3.behavior.drag().on("dragstart",(function(t,e){d3.select(z.container).style("cursor","ew-resize")})).on("drag",(function(t,e){F.x=d3.event.x,F.i=Math.round(W.invert(F.x)),Q()})).on("dragend",(function(t,e){d3.select(z.container).style("cursor","auto"),A.index=F.i,D.stateChange(A)}));if(!(k&&k.length&&k.filter((function(t){return t.values.length})).length)){var Y=B.selectAll(".nv-noData").data([S]);return Y.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),Y.attr("x",c.left+H/2).attr("y",c.top+T/2).text((function(t){return t})),z}if(B.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale(),b)n.yDomain(null);else{var E=k.filter((function(t){return!t.disabled})).map((function(t,e){var r=d3.extent(t.values,n.y());return r[0]<-.95&&(r[0]=-.95),[(r[0]-r[1])/(1+r[1]),(r[1]-r[0])/(1+r[0])]})),V=[d3.min(E,(function(t){return t[0]})),d3.max(E,(function(t){return t[1]}))];n.yDomain(V)}W.domain([0,k[0].values.length-1]).range([0,H]).clamp(!0),k=function(t,e){return e.map((function(e,r){if(!e.values)return e;var o=n.y()(e.values[t],t);return o<-.95?(e.tempDisabled=!0,e):(e.tempDisabled=!1,e.values=e.values.map((function(t,e){return t.display={y:(n.y()(t,e)-o)/(1+o)},t})),e)}))}(F.i,k);var X=y?"none":"all",_=B.selectAll("g.nv-wrap.nv-cumulativeLine").data([k]),Z=_.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),G=_.select("g");if(Z.append("g").attr("class","nv-interactive"),Z.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),Z.append("g").attr("class","nv-y nv-axis"),Z.append("g").attr("class","nv-background"),Z.append("g").attr("class","nv-linesWrap").style("pointer-events",X),Z.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),Z.append("g").attr("class","nv-legendWrap"),Z.append("g").attr("class","nv-controlsWrap"),f&&(i.width(H),G.select(".nv-legendWrap").datum(k).call(i),c.top!=i.height()&&(c.top=i.height(),T=(p||parseInt(B.style("height"))||400)-c.top-c.bottom),G.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")),x){var O=[{key:"Re-scale y-axis",disabled:!b}];l.width(140).color(["#444","#444","#444"]),G.select(".nv-controlsWrap").datum(O).attr("transform","translate(0,"+-c.top+")").call(l)}_.attr("transform","translate("+c.left+","+c.top+")"),v&&G.select(".nv-y.nv-axis").attr("transform","translate("+H+",0)");var U=k.filter((function(t){return t.tempDisabled}));_.select(".tempDisabled").remove(),U.length&&_.append("text").attr("class","tempDisabled").attr("x",H/2).attr("y","-.71em").style("text-anchor","end").text(U.map((function(t){return t.key})).join(", ")+" values cannot be calculated for this time period."),y&&(s.width(H).height(T).margin({left:c.left,top:c.top}).svgContainer(B).xScale(t),_.select(".nv-interactive").call(s)),Z.select(".nv-background").append("rect"),G.select(".nv-background rect").attr("width",H).attr("height",T),n.y((function(t){return t.display.y})).width(H).height(T).color(k.map((function(t,e){return t.color||u(t,e)})).filter((function(t,e){return!k[e].disabled&&!k[e].tempDisabled})));var K=G.select(".nv-linesWrap").datum(k.filter((function(t){return!t.disabled&&!t.tempDisabled})));K.call(n),k.forEach((function(t,e){t.seriesIndex=e}));var j=k.filter((function(t){return!t.disabled&&!!M(t)})),$=G.select(".nv-avgLinesWrap").selectAll("line").data(j,(function(t){return t.key})),q=function(t){var n=e(M(t));return n<0?0:n>T?T:n};$.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",(function(t,e){return n.color()(t,t.seriesIndex)})).attr("x1",0).attr("x2",H).attr("y1",q).attr("y2",q),$.style("stroke-opacity",(function(t){var n=e(M(t));return n<0||n>T?0:1})).attr("x1",0).attr("x2",H).attr("y1",q).attr("y2",q),$.exit().remove();var J=K.selectAll(".nv-indexLine").data([F]);function Q(){J.data([F]);var t=z.transitionDuration();z.transitionDuration(0),z.update(),z.transitionDuration(t)}J.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(R),J.attr("transform",(function(t){return"translate("+W(t.i)+",0)"})).attr("height",T),h&&(o.scale(t).ticks(Math.min(k[0].values.length,H/70)).tickSize(-T,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+e.range()[0]+")"),d3.transition(G.select(".nv-x.nv-axis")).call(o)),g&&(a.scale(e).ticks(T/36).tickSize(-H,0),d3.transition(G.select(".nv-y.nv-axis")).call(a)),G.select(".nv-background rect").on("click",(function(){F.x=d3.mouse(this)[0],F.i=Math.round(W.invert(F.x)),A.index=F.i,D.stateChange(A),Q()})),n.dispatch.on("elementClick",(function(t){F.i=t.pointIndex,F.x=W(F.i),A.index=F.i,D.stateChange(A),Q()})),l.dispatch.on("legendClick",(function(t,e){t.disabled=!t.disabled,b=!t.disabled,A.rescaleY=b,D.stateChange(A),z.update()})),i.dispatch.on("stateChange",(function(t){A.disabled=t.disabled,D.stateChange(A),z.update()})),s.dispatch.on("elementMousemove",(function(t){n.clearHighlights();var e,i,l,d=[];k.filter((function(t,e){return t.seriesIndex=e,!t.disabled})).forEach((function(o,a){i=r.interactiveBisect(o.values,t.pointXValue,z.x()),n.highlightPoint(a,i,!0);var s=o.values[i];void 0!==s&&(void 0===e&&(e=s),void 0===l&&(l=z.xScale()(z.x()(s,i))),d.push({key:o.key,value:z.y()(s,i),color:u(o,o.seriesIndex)}))}));var p=o.tickFormat()(z.x()(e,i));s.tooltip.position({left:l+c.left,top:t.mouseY+c.top}).chartContainer(P.parentNode).enabled(m).valueFormatter((function(t,e){return a.tickFormat()(t)})).data({value:p,series:d})(),s.renderGuideLine(l)})),s.dispatch.on("elementMouseout",(function(t){D.tooltipHide(),n.clearHighlights()})),D.on("tooltipShow",(function(t){m&&L(t,P.parentNode)})),D.on("changeState",(function(t){void 0!==t.disabled&&(k.forEach((function(e,n){e.disabled=t.disabled[n]})),A.disabled=t.disabled),void 0!==t.index&&(F.i=t.index,F.x=W(F.i),A.index=t.index,J.data([F])),void 0!==t.rescaleY&&(b=t.rescaleY),z.update()}))})),z}return n.dispatch.on("elementMouseover.tooltip",(function(t){t.pos=[t.pos[0]+c.left,t.pos[1]+c.top],D.tooltipShow(t)})),n.dispatch.on("elementMouseout.tooltip",(function(t){D.tooltipHide(t)})),D.on("tooltipHide",(function(){m&&r.tooltip.cleanup()})),z.dispatch=D,z.lines=n,z.legend=i,z.xAxis=o,z.yAxis=a,z.interactiveLayer=s,d3.rebind(z,n,"defined","isArea","x","y","xScale","yScale","size","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","useVoronoi","id"),z.options=r.utils.optionsFunc.bind(z),z.margin=function(t){return arguments.length?(c.top=void 0!==t.top?t.top:c.top,c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left,z):c},z.width=function(t){return arguments.length?(d=t,z):d},z.height=function(t){return arguments.length?(p=t,z):p},z.color=function(t){return arguments.length?(u=r.utils.getColor(t),i.color(u),z):u},z.rescaleY=function(t){return arguments.length?b=t:b},z.showControls=function(t){return arguments.length?(x=t,z):x},z.useInteractiveGuideline=function(t){return arguments.length?(y=t,!0===t&&(z.interactive(!1),z.useVoronoi(!1)),z):y},z.showLegend=function(t){return arguments.length?(f=t,z):f},z.showXAxis=function(t){return arguments.length?(h=t,z):h},z.showYAxis=function(t){return arguments.length?(g=t,z):g},z.rightAlignYAxis=function(t){return arguments.length?(v=t,a.orient(t?"right":"left"),z):v},z.tooltips=function(t){return arguments.length?(m=t,z):m},z.tooltipContent=function(t){return arguments.length?(k=t,z):k},z.state=function(t){return arguments.length?(A=t,z):A},z.defaultState=function(t){return arguments.length?(C=t,z):C},z.noData=function(t){return arguments.length?(S=t,z):S},z.average=function(t){return arguments.length?(M=t,z):M},z.transitionDuration=function(t){return arguments.length?(I=t,z):I},z},r.models.discreteBar=function(){"use strict";var t,e,n,o,a,i,l={top:0,right:0,bottom:0,left:0},s=960,c=500,u=Math.floor(1e4*Math.random()),d=d3.scale.ordinal(),p=d3.scale.linear(),f=function(t){return t.x},h=function(t){return t.y},g=[0],v=r.utils.defaultColor(),m=!1,x=d3.format(",.2f"),y=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),b="discreteBar";function k(r){return r.each((function(r){var u=s-l.left-l.right,k=c-l.top-l.bottom,w=d3.select(this);r=r.map((function(t,e){return t.values=t.values.map((function(t){return t.series=e,t})),t}));var A=t&&e?[]:r.map((function(t){return t.values.map((function(t,e){return{x:f(t,e),y:h(t,e),y0:t.y0}}))}));d.domain(t||d3.merge(A).map((function(t){return t.x}))).rangeBands(n||[0,u],.1),p.domain(e||d3.extent(d3.merge(A).map((function(t){return t.y})).concat(g))),m?p.range(o||[k-(p.domain()[0]<0?12:0),p.domain()[1]>0?12:0]):p.range(o||[k,0]),a=a||d,i=i||p.copy().range([p(0),p(0)]);var C=w.selectAll("g.nv-wrap.nv-discretebar").data([r]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar").append("g");C.select("g"),S.append("g").attr("class","nv-groups"),C.attr("transform","translate("+l.left+","+l.top+")");var M=C.select(".nv-groups").selectAll(".nv-group").data((function(t){return t}),(function(t){return t.key}));M.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),M.exit().transition().style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),M.attr("class",(function(t,e){return"nv-group nv-series-"+e})).classed("hover",(function(t){return t.hover})),M.transition().style("stroke-opacity",1).style("fill-opacity",.75);var D=M.selectAll("g.nv-bar").data((function(t){return t.values}));D.exit().remove();var I=D.enter().append("g").attr("transform",(function(t,e,n){return"translate("+(d(f(t,e))+.05*d.rangeBand())+", "+p(0)+")"})).on("mouseover",(function(t,e){d3.select(this).classed("hover",!0),y.elementMouseover({value:h(t,e),point:t,series:r[t.series],pos:[d(f(t,e))+d.rangeBand()*(t.series+.5)/r.length,p(h(t,e))],pointIndex:e,seriesIndex:t.series,e:d3.event})})).on("mouseout",(function(t,e){d3.select(this).classed("hover",!1),y.elementMouseout({value:h(t,e),point:t,series:r[t.series],pointIndex:e,seriesIndex:t.series,e:d3.event})})).on("click",(function(t,e){y.elementClick({value:h(t,e),point:t,series:r[t.series],pos:[d(f(t,e))+d.rangeBand()*(t.series+.5)/r.length,p(h(t,e))],pointIndex:e,seriesIndex:t.series,e:d3.event}),d3.event.stopPropagation()})).on("dblclick",(function(t,e){y.elementDblClick({value:h(t,e),point:t,series:r[t.series],pos:[d(f(t,e))+d.rangeBand()*(t.series+.5)/r.length,p(h(t,e))],pointIndex:e,seriesIndex:t.series,e:d3.event}),d3.event.stopPropagation()}));I.append("rect").attr("height",0).attr("width",.9*d.rangeBand()/r.length),m?(I.append("text").attr("text-anchor","middle"),D.select("text").text((function(t,e){return x(h(t,e))})).transition().attr("x",.9*d.rangeBand()/2).attr("y",(function(t,e){return h(t,e)<0?p(h(t,e))-p(0)+12:-4}))):D.selectAll("text").remove(),D.attr("class",(function(t,e){return h(t,e)<0?"nv-bar negative":"nv-bar positive"})).style("fill",(function(t,e){return t.color||v(t,e)})).style("stroke",(function(t,e){return t.color||v(t,e)})).select("rect").attr("class",b).transition().attr("width",.9*d.rangeBand()/r.length),D.transition().attr("transform",(function(t,e){return"translate("+(d(f(t,e))+.05*d.rangeBand())+", "+(h(t,e)<0?p(0):p(0)-p(h(t,e))<1?p(0)-1:p(h(t,e)))+")"})).select("rect").attr("height",(function(t,n){return Math.max(Math.abs(p(h(t,n))-p(e&&e[0]||0))||1)})),a=d.copy(),i=p.copy()})),k}return k.dispatch=y,k.options=r.utils.optionsFunc.bind(k),k.x=function(t){return arguments.length?(f=t,k):f},k.y=function(t){return arguments.length?(h=t,k):h},k.margin=function(t){return arguments.length?(l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left,k):l},k.width=function(t){return arguments.length?(s=t,k):s},k.height=function(t){return arguments.length?(c=t,k):c},k.xScale=function(t){return arguments.length?(d=t,k):d},k.yScale=function(t){return arguments.length?(p=t,k):p},k.xDomain=function(e){return arguments.length?(t=e,k):t},k.yDomain=function(t){return arguments.length?(e=t,k):e},k.xRange=function(t){return arguments.length?(n=t,k):n},k.yRange=function(t){return arguments.length?(o=t,k):o},k.forceY=function(t){return arguments.length?(g=t,k):g},k.color=function(t){return arguments.length?(v=r.utils.getColor(t),k):v},k.id=function(t){return arguments.length?(u=t,k):u},k.showValues=function(t){return arguments.length?(m=t,k):m},k.valueFormat=function(t){return arguments.length?(x=t,k):x},k.rectClass=function(t){return arguments.length?(b=t,k):b},k},r.models.discreteBarChart=function(){"use strict";var t,e,n=r.models.discreteBar(),o=r.models.axis(),a=r.models.axis(),i={top:15,right:10,bottom:50,left:60},l=null,s=null,c=r.utils.getColor(),u=!0,d=!0,p=!1,f=!1,h=!0,g=function(t,e,n,r,o){return"<h3>"+e+"</h3><p>"+n+"</p>"},v="No Data Available.",m=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate"),x=250;o.orient("bottom").highlightZero(!1).showMaxMin(!1).tickFormat((function(t){return t})),a.orient(p?"right":"left").tickFormat(d3.format(",.1f"));var y=function(t,e){var i=t.pos[0]+(e.offsetLeft||0),l=t.pos[1]+(e.offsetTop||0),s=o.tickFormat()(n.x()(t.point,t.pointIndex)),c=a.tickFormat()(n.y()(t.point,t.pointIndex)),u=g(t.series.key,s,c,t,b);r.tooltip.show([i,l],u,t.value<0?"n":"s",null,e)};function b(r){return r.each((function(r){var c=d3.select(this),g=this,k=(l||parseInt(c.style("width"))||960)-i.left-i.right,w=(s||parseInt(c.style("height"))||400)-i.top-i.bottom;if(b.update=function(){m.beforeUpdate(),c.transition().duration(x).call(b)},b.container=this,!(r&&r.length&&r.filter((function(t){return t.values.length})).length)){var A=c.selectAll(".nv-noData").data([v]);return A.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),A.attr("x",i.left+k/2).attr("y",i.top+w/2).text((function(t){return t})),b}c.selectAll(".nv-noData").remove(),t=n.xScale(),e=n.yScale().clamp(!0);var C=c.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([r]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),M=S.append("defs"),D=C.select("g");if(S.append("g").attr("class","nv-x nv-axis"),S.append("g").attr("class","nv-y nv-axis"),S.append("g").attr("class","nv-barsWrap"),D.attr("transform","translate("+i.left+","+i.top+")"),p&&D.select(".nv-y.nv-axis").attr("transform","translate("+k+",0)"),n.width(k).height(w),D.select(".nv-barsWrap").datum(r.filter((function(t){return!t.disabled}))).transition().call(n),M.append("clipPath").attr("id","nv-x-label-clip-"+n.id()).append("rect"),D.select("#nv-x-label-clip-"+n.id()+" rect").attr("width",t.rangeBand()*(f?2:1)).attr("height",16).attr("x",-t.rangeBand()/(f?1:2)),u){o.scale(t).ticks(k/100).tickSize(-w,0),D.select(".nv-x.nv-axis").attr("transform","translate(0,"+(e.range()[0]+(n.showValues()&&e.domain()[0]<0?16:0))+")"),D.select(".nv-x.nv-axis").transition().call(o);var I=D.select(".nv-x.nv-axis").selectAll("g");f&&I.selectAll("text").attr("transform",(function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"}))}d&&(a.scale(e).ticks(w/36).tickSize(-k,0),D.select(".nv-y.nv-axis").transition().call(a)),m.on("tooltipShow",(function(t){h&&y(t,g.parentNode)}))})),b}return n.dispatch.on("elementMouseover.tooltip",(function(t){t.pos=[t.pos[0]+i.left,t.pos[1]+i.top],m.tooltipShow(t)})),n.dispatch.on("elementMouseout.tooltip",(function(t){m.tooltipHide(t)})),m.on("tooltipHide",(function(){h&&r.tooltip.cleanup()})),b.dispatch=m,b.discretebar=n,b.xAxis=o,b.yAxis=a,d3.rebind(b,n,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","id","showValues","valueFormat"),b.options=r.utils.optionsFunc.bind(b),b.margin=function(t){return arguments.length?(i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left,b):i},b.width=function(t){return arguments.length?(l=t,b):l},b.height=function(t){return arguments.length?(s=t,b):s},b.color=function(t){return arguments.length?(c=r.utils.getColor(t),n.color(c),b):c},b.showXAxis=function(t){return arguments.length?(u=t,b):u},b.showYAxis=function(t){return arguments.length?(d=t,b):d},b.rightAlignYAxis=function(t){return arguments.length?(p=t,a.orient(t?"right":"left"),b):p},b.staggerLabels=function(t){return arguments.length?(f=t,b):f},b.tooltips=function(t){return arguments.length?(h=t,b):h},b.tooltipContent=function(t){return arguments.length?(g=t,b):g},b.noData=function(t){return arguments.length?(v=t,b):v},b.transitionDuration=function(t){return arguments.length?(x=t,b):x},b},r.models.distribution=function(){"use strict";var t,e={top:0,right:0,bottom:0,left:0},n=400,o=8,a="x",i=function(t){return t[a]},l=r.utils.defaultColor(),s=d3.scale.linear();function c(n){return n.each((function(n){"x"===a?(e.left,e.right):(e.top,e.bottom);var r="x"==a?"y":"x",c=d3.select(this);t=t||s;var u=c.selectAll("g.nv-distribution").data([n]),d=(u.enter().append("g").attr("class","nvd3 nv-distribution").append("g"),u.select("g"));u.attr("transform","translate("+e.left+","+e.top+")");var p=d.selectAll("g.nv-dist").data((function(t){return t}),(function(t){return t.key}));p.enter().append("g"),p.attr("class",(function(t,e){return"nv-dist nv-series-"+e})).style("stroke",(function(t,e){return l(t,e)}));var f=p.selectAll("line.nv-dist"+a).data((function(t){return t.values}));f.enter().append("line").attr(a+"1",(function(e,n){return t(i(e,n))})).attr(a+"2",(function(e,n){return t(i(e,n))})),p.exit().selectAll("line.nv-dist"+a).transition().attr(a+"1",(function(t,e){return s(i(t,e))})).attr(a+"2",(function(t,e){return s(i(t,e))})).style("stroke-opacity",0).remove(),f.attr("class",(function(t,e){return"nv-dist"+a+" nv-dist"+a+"-"+e})).attr(r+"1",0).attr(r+"2",o),f.transition().attr(a+"1",(function(t,e){return s(i(t,e))})).attr(a+"2",(function(t,e){return s(i(t,e))})),t=s.copy()})),c}return c.options=r.utils.optionsFunc.bind(c),c.margin=function(t){return arguments.length?(e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left,c):e},c.width=function(t){return arguments.length?(n=t,c):n},c.axis=function(t){return arguments.length?(a=t,c):a},c.size=function(t){return arguments.length?(o=t,c):o},c.getData=function(t){return arguments.length?(i=d3.functor(t),c):i},c.scale=function(t){return arguments.length?(s=t,c):s},c.color=function(t){return arguments.length?(l=r.utils.getColor(t),c):l},c},r.models.historicalBar=function(){"use strict";var t,e,n,o,a={top:0,right:0,bottom:0,left:0},i=960,l=500,s=Math.floor(1e4*Math.random()),c=d3.scale.linear(),u=d3.scale.linear(),d=function(t){return t.x},p=function(t){return t.y},f=[],h=[0],g=!1,v=!0,m=r.utils.defaultColor(),x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),y=!0;function b(k){return k.each((function(b){var k=i-a.left-a.right,w=l-a.top-a.bottom,A=d3.select(this);c.domain(t||d3.extent(b[0].values.map(d).concat(f))),g?c.range(n||[.5*k/b[0].values.length,k*(b[0].values.length-.5)/b[0].values.length]):c.range(n||[0,k]),u.domain(e||d3.extent(b[0].values.map(p).concat(h))).range(o||[w,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),u.domain()[0]===u.domain()[1]&&(u.domain()[0]?u.domain([u.domain()[0]+.01*u.domain()[0],u.domain()[1]-.01*u.domain()[1]]):u.domain([-1,1]));var C=A.selectAll("g.nv-wrap.nv-historicalBar-"+s).data([b[0].values]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+s),M=S.append("defs"),D=S.append("g"),I=C.select("g");D.append("g").attr("class","nv-bars"),C.attr("transform","translate("+a.left+","+a.top+")"),A.on("click",(function(t,e){x.chartClick({data:t,index:e,pos:d3.event,id:s})})),M.append("clipPath").attr("id","nv-chart-clip-path-"+s).append("rect"),C.select("#nv-chart-clip-path-"+s+" rect").attr("width",k).attr("height",w),I.attr("clip-path",v?"url(#nv-chart-clip-path-"+s+")":"");var W=C.select(".nv-bars").selectAll(".nv-bar").data((function(t){return t}),(function(t,e){return d(t,e)}));W.exit().remove(),W.enter().append("rect").attr("x",0).attr("y",(function(t,e){return r.utils.NaNtoZero(u(Math.max(0,p(t,e))))})).attr("height",(function(t,e){return r.utils.NaNtoZero(Math.abs(u(p(t,e))-u(0)))})).attr("transform",(function(t,e){return"translate("+(c(d(t,e))-k/b[0].values.length*.45)+",0)"})).on("mouseover",(function(t,e){y&&(d3.select(this).classed("hover",!0),x.elementMouseover({point:t,series:b[0],pos:[c(d(t,e)),u(p(t,e))],pointIndex:e,seriesIndex:0,e:d3.event}))})).on("mouseout",(function(t,e){y&&(d3.select(this).classed("hover",!1),x.elementMouseout({point:t,series:b[0],pointIndex:e,seriesIndex:0,e:d3.event}))})).on("click",(function(t,e){y&&(x.elementClick({value:p(t,e),data:t,index:e,pos:[c(d(t,e)),u(p(t,e))],e:d3.event,id:s}),d3.event.stopPropagation())})).on("dblclick",(function(t,e){y&&(x.elementDblClick({value:p(t,e),data:t,index:e,pos:[c(d(t,e)),u(p(t,e))],e:d3.event,id:s}),d3.event.stopPropagation())})),W.attr("fill",(function(t,e){return m(t,e)})).attr("class",(function(t,e,n){return(p(t,e)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+n+"-"+e})).transition().attr("transform",(function(t,e){return"translate("+(c(d(t,e))-k/b[0].values.length*.45)+",0)"})).attr("width",k/b[0].values.length*.9),W.transition().attr("y",(function(t,e){var n=p(t,e)<0?u(0):u(0)-u(p(t,e))<1?u(0)-1:u(p(t,e));return r.utils.NaNtoZero(n)})).attr("height",(function(t,e){return r.utils.NaNtoZero(Math.max(Math.abs(u(p(t,e))-u(0)),1))}))})),b}return b.highlightPoint=function(t,e){d3.select(".nv-historicalBar-"+s).select(".nv-bars .nv-bar-0-"+t).classed("hover",e)},b.clearHighlights=function(){d3.select(".nv-historicalBar-"+s).select(".nv-bars .nv-bar.hover").classed("hover",!1)},b.dispatch=x,b.options=r.utils.optionsFunc.bind(b),b.x=function(t){return arguments.length?(d=t,b):d},b.y=function(t){return arguments.length?(p=t,b):p},b.margin=function(t){return arguments.length?(a.top=void 0!==t.top?t.top:a.top,a.right=void 0!==t.right?t.right:a.right,a.bottom=void 0!==t.bottom?t.bottom:a.bottom,a.left=void 0!==t.left?t.left:a.left,b):a},b.width=function(t){return arguments.length?(i=t,b):i},b.height=function(t){return arguments.length?(l=t,b):l},b.xScale=function(t){return arguments.length?(c=t,b):c},b.yScale=function(t){return arguments.length?(u=t,b):u},b.xDomain=function(e){return arguments.length?(t=e,b):t},b.yDomain=function(t){return arguments.length?(e=t,b):e},b.xRange=function(t){return arguments.length?(n=t,b):n},b.yRange=function(t){return arguments.length?(o=t,b):o},b.forceX=function(t){return arguments.length?(f=t,b):f},b.forceY=function(t){return arguments.length?(h=t,b):h},b.padData=function(t){return arguments.length?(g=t,b):g},b.clipEdge=function(t){return arguments.length?(v=t,b):v},b.color=function(t){return arguments.length?(m=r.utils.getColor(t),b):m},b.id=function(t){return arguments.length?(s=t,b):s},b.interactive=function(t){return arguments.length?(y=!1,b):y},b},r.models.historicalBarChart=function(){"use strict";var t,e,n=r.models.historicalBar(),o=r.models.axis(),a=r.models.axis(),i=r.models.legend(),l={top:30,right:90,bottom:50,left:90},s=r.utils.defaultColor(),c=null,u=null,d=!1,p=!0,f=!0,h=!1,g=!0,v=function(t,e,n,r,o){return"<h3>"+t+"</h3><p>"+n+" at "+e+"</p>"},m={},x=null,y="No Data Available.",b=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),k=250;o.orient("bottom").tickPadding(7),a.orient(h?"right":"left");var w=function(t,e){if(e){var i=d3.select(e).select("svg"),l=i.node()?i.attr("viewBox"):null;if(l){l=l.split(" ");var s=parseInt(i.style("width"))/l[2];t.pos[0]=t.pos[0]*s,t.pos[1]=t.pos[1]*s}}var c=t.pos[0]+(e.offsetLeft||0),u=t.pos[1]+(e.offsetTop||0),d=o.tickFormat()(n.x()(t.point,t.pointIndex)),p=a.tickFormat()(n.y()(t.point,t.poi