UNPKG

js-polynomial-regression

Version:

A javascript library that predicts dependent variables using polynomial regression.

1 lines 406 kB
!function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=3)}([function(t,n,e){(function(n){var r={};"d3"in n&&(r.d3=n.d3),t.exports=e(6),"d3"in r?n.d3=r.d3:delete n.d3}).call(this,e(5))},function(t,n,e){var r;(r={dev:!1}).tooltip=r.tooltip||{},r.utils=r.utils||{},r.models=r.models||{},r.charts={},r.logs={},r.dom={},"undefined"==typeof d3&&(d3=e(0)),r.dispatch=d3.dispatch("render_start","render_end"),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var n=Array.prototype.slice.call(arguments,1),e=this,r=function(){},i=function(){return e.apply(this instanceof r&&t?this:t,n.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i}),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("total",r.logs.totalTime)})),r.log=function(){if(r.dev&&window.console&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(r.dev&&window.console&&"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.deprecated=function(t,n){console&&console.warn&&console.warn("nvd3 warning: `"+t+"` has been deprecated. ",n||"")},r.render=function(t){t=t||1,r.render.active=!0,r.dispatch.render_start();var n=function(){for(var e,i,o=0;o<t&&(i=r.render.queue[o]);o++)e=i.generate(),typeof i.callback==typeof Function&&i.callback(e);r.render.queue.splice(0,o),r.render.queue.length?setTimeout(n):(r.dispatch.render_end(),r.render.active=!1)};setTimeout(n)},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()},t.exports=r,"undefined"!=typeof window&&(window.nv=r),r.dom.write=function(t){return void 0!==window.fastdom?fastdom.mutate(t):t()},r.dom.read=function(t){return void 0!==window.fastdom?fastdom.measure(t):t()},r.interactiveGuideline=function(){"use strict";var t={left:0,top:0},n=null,e=null,i=d3.scale.linear(),o=d3.dispatch("elementMousemove","elementMouseout","elementClick","elementDblclick","elementMouseDown","elementMouseUp"),a=!0,u=null,l=r.models.tooltip(),s=window.ActiveXObject;function c(f){f.each(function(f){var d=d3.select(this),h=n||960,p=e||400,g=d.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([f]);function v(){var n=d3.mouse(this),e=n[0],r=n[1],a=!0,u=!1;if(s&&(e=d3.event.offsetX,r=d3.event.offsetY,"svg"!==d3.event.target.tagName&&(a=!1),d3.event.target.className.baseVal.match("nv-legend")&&(u=!0)),a&&(e-=t.left,r-=t.top),"mouseout"===d3.event.type||e<0||r<0||e>h||r>p||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||u){if(s&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(l.nvPointerEventsClass)))return;return o.elementMouseout({mouseX:e,mouseY:r}),c.renderGuideLine(null),void l.hidden(!0)}l.hidden(!1);var f=void 0;if("function"==typeof i.rangeBands){var d=d3.bisect(i.range(),e)-1;if(!(i.range()[d]+i.rangeBand()>=e))return o.elementMouseout({mouseX:e,mouseY:r}),c.renderGuideLine(null),void l.hidden(!0);f=i.domain()[d3.bisect(i.range(),e)-1]}else f=i.invert(e);o.elementMousemove({mouseX:e,mouseY:r,pointXValue:f}),"dblclick"===d3.event.type&&o.elementDblclick({mouseX:e,mouseY:r,pointXValue:f}),"click"===d3.event.type&&o.elementClick({mouseX:e,mouseY:r,pointXValue:f}),"mousedown"===d3.event.type&&o.elementMouseDown({mouseX:e,mouseY:r,pointXValue:f}),"mouseup"===d3.event.type&&o.elementMouseUp({mouseX:e,mouseY:r,pointXValue:f})}g.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer").append("g").attr("class","nv-interactiveGuideLine"),u&&(u.on("touchmove",v).on("mousemove",v,!0).on("mouseout",v,!0).on("mousedown",v,!0).on("mouseup",v,!0).on("dblclick",v).on("click",v),c.guideLine=null,c.renderGuideLine=function(t){a&&(c.guideLine&&c.guideLine.attr("x1")===t||r.dom.write(function(){var n=g.select(".nv-interactiveGuideLine").selectAll("line").data(null!=t?[r.utils.NaNtoZero(t)]:[],String);n.enter().append("line").attr("class","nv-guideline").attr("x1",function(t){return t}).attr("x2",function(t){return t}).attr("y1",p).attr("y2",0),n.exit().remove()}))})})}return l.duration(0).hideDelay(0).hidden(!1),c.dispatch=o,c.tooltip=l,c.margin=function(n){return arguments.length?(t.top=void 0!==n.top?n.top:t.top,t.left=void 0!==n.left?n.left:t.left,c):t},c.width=function(t){return arguments.length?(n=t,c):n},c.height=function(t){return arguments.length?(e=t,c):e},c.xScale=function(t){return arguments.length?(i=t,c):i},c.showGuideLine=function(t){return arguments.length?(a=t,c):a},c.svgContainer=function(t){return arguments.length?(u=t,c):u},c},r.interactiveBisect=function(t,n,e){"use strict";if(!(t instanceof Array))return null;var r;r="function"!=typeof e?function(t){return t.x}:e;var i=d3.bisector(function(t,n){return r(t)-n}).left,o=d3.max([0,i(t,n)-1]),a=r(t[o]);if(void 0===a&&(a=o),a===n)return o;var u=d3.min([o+1,t.length-1]),l=r(t[u]);return void 0===l&&(l=u),Math.abs(l-n)>=Math.abs(a-n)?o:u},r.nearestValueIndex=function(t,n,e){"use strict";var r=1/0,i=null;return t.forEach(function(t,o){var a=Math.abs(n-t);null!=t&&a<=r&&a<e&&(r=a,i=o)}),i},r.models.tooltip=function(){"use strict";var t="nvtooltip-"+Math.floor(1e5*Math.random()),n=null,e="w",i=25,o=0,a=null,u=!0,l=200,s=null,c={left:null,top:null},f=!0,d=100,h=!0,p="nv-pointer-events-none",g=function(t,n){return t},v=function(t){return t},m=function(t,n){return t},y=function(t){if(null===t)return"";var n=d3.select(document.createElement("table"));h&&n.selectAll("thead").data([t]).enter().append("thead").append("tr").append("td").attr("colspan",3).append("strong").classed("x-value",!0).html(v(t.value));var e=n.selectAll("tbody").data([t]).enter().append("tbody").selectAll("tr").data(function(t){return t.series}).enter().append("tr").classed("highlight",function(t){return t.highlight});e.append("td").classed("legend-color-guide",!0).append("div").style("background-color",function(t){return t.color}),e.append("td").classed("key",!0).classed("total",function(t){return!!t.total}).html(function(t,n){return m(t.key,n)}),e.append("td").classed("value",!0).html(function(t,n){return g(t.value,n)}),e.filter(function(t,n){return void 0!==t.percent}).append("td").classed("percent",!0).html(function(t,n){return"("+d3.format("%")(t.percent)+")"}),e.selectAll("td").each(function(t){if(t.highlight){var n=d3.scale.linear().domain([0,1]).range(["#fff",t.color]);d3.select(this).style("border-bottom-color",n(.6)).style("border-top-color",n(.6))}});var r=n.node().outerHTML;return void 0!==t.footer&&(r+="<div class='footer'>"+t.footer+"</div>"),r},x=function(){var t={left:null!==d3.event?d3.event.clientX:0,top:null!==d3.event?d3.event.clientY:0};if("none"!=getComputedStyle(document.body).transform){var n=document.body.getBoundingClientRect();t.left-=n.left,t.top-=n.top}return t},b=function(t){if(t&&t.series){if(r.utils.isArray(t.series))return!0;if(r.utils.isObject(t.series))return t.series=[t.series],!0}return!1},k=function(){r.dom.read(function(){var t=x(),n=function(t){var n,r,o,a=s.node().offsetHeight,u=s.node().offsetWidth,l=document.documentElement.clientWidth,c=document.documentElement.clientHeight;switch(e){case"e":n=-u-i,r=-a/2,t.left+n<0&&(n=i),(o=t.top+r)<0&&(r-=o),(o=t.top+r+a)>c&&(r-=o-c);break;case"w":n=i,r=-a/2,t.left+n+u>l&&(n=-u-i),(o=t.top+r)<0&&(r-=o),(o=t.top+r+a)>c&&(r-=o-c);break;case"n":n=-u/2-5,r=i,t.top+r+a>c&&(r=-a-i),(o=t.left+n)<0&&(n-=o),(o=t.left+n+u)>l&&(n-=o-l);break;case"s":n=-u/2,r=-a-i,t.top+r<0&&(r=i),(o=t.left+n)<0&&(n-=o),(o=t.left+n+u)>l&&(n-=o-l);break;case"center":n=-u/2,r=-a/2;break;default:n=0,r=0}return{left:n,top:r}}(t),r=t.left+n.left,o=t.top+n.top;if(u)s.interrupt().transition().delay(l).duration(0).style("opacity",0);else{var a="translate("+c.left+"px, "+c.top+"px)",f="translate("+Math.round(r)+"px, "+Math.round(o)+"px)",h=d3.interpolateString(a,f),p=s.style("opacity")<.1;s.interrupt().transition().duration(p?0:d).styleTween("transform",function(t){return h},"important").styleTween("-webkit-transform",function(t){return h}).style("-ms-transform",f).style("opacity",1)}c.left=r,c.top=o})};function M(){if(f&&b(n))return r.dom.write(function(){s&&s.node()||((s=d3.select(document.body).select("#"+t).data([1])).enter().append("div").attr("class","nvtooltip "+(a||"xy-tooltip")).attr("id",t).style("top",0).style("left",0).style("opacity",0).style("position","fixed").selectAll("div, table, td, tr").classed(p,!0).classed(p,!0),s.exit().remove());var e=y(n);e&&(s.node().innerHTML=e),k()}),M}return M.nvPointerEventsClass=p,M.options=r.utils.optionsFunc.bind(M),M._options=Object.create({},{duration:{get:function(){return d},set:function(t){d=t}},gravity:{get:function(){return e},set:function(t){e=t}},distance:{get:function(){return i},set:function(t){i=t}},snapDistance:{get:function(){return o},set:function(t){o=t}},classes:{get:function(){return a},set:function(t){a=t}},enabled:{get:function(){return f},set:function(t){f=t}},hideDelay:{get:function(){return l},set:function(t){l=t}},contentGenerator:{get:function(){return y},set:function(t){y=t}},valueFormatter:{get:function(){return g},set:function(t){g=t}},headerFormatter:{get:function(){return v},set:function(t){v=t}},keyFormatter:{get:function(){return m},set:function(t){m=t}},headerEnabled:{get:function(){return h},set:function(t){h=t}},position:{get:function(){return x},set:function(t){x=t}},chartContainer:{get:function(){return document.body},set:function(t){r.deprecated("chartContainer","feature removed after 1.8.3")}},fixedTop:{get:function(){return null},set:function(t){r.deprecated("fixedTop","feature removed after 1.8.1")}},offset:{get:function(){return{left:0,top:0}},set:function(t){r.deprecated("offset","use chart.tooltip.distance() instead")}},hidden:{get:function(){return u},set:function(t){u!=t&&(u=!!t,M())}},data:{get:function(){return n},set:function(t){t.point&&(t.value=t.point.x,t.series=t.series||{},t.series.value=t.point.y,t.series.color=t.point.color||t.series.color),n=t}},node:{get:function(){return s.node()},set:function(t){}},id:{get:function(){return t},set:function(t){}}}),r.utils.initOptions(M),M},r.utils.windowSize=function(){var t={width:640,height:480};return window.innerWidth&&window.innerHeight?(t.width=window.innerWidth,t.height=window.innerHeight,t):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(t.width=document.documentElement.offsetWidth,t.height=document.documentElement.offsetHeight,t):document.body&&document.body.offsetWidth?(t.width=document.body.offsetWidth,t.height=document.body.offsetHeight,t):t},r.utils.isArray=Array.isArray,r.utils.isObject=function(t){return null!==t&&"object"==typeof t},r.utils.isFunction=function(t){return"function"==typeof t},r.utils.isDate=function(t){return"[object Date]"===toString.call(t)},r.utils.isNumber=function(t){return!isNaN(t)&&"number"==typeof t},r.utils.windowResize=function(t){return window.addEventListener?window.addEventListener("resize",t):r.log("ERROR: Failed to bind to window.resize with: ",t),{callback:t,clear:function(){window.removeEventListener("resize",t)}}},r.utils.getColor=function(t){if(void 0===t)return r.utils.defaultColor();if(r.utils.isArray(t)){var n=d3.scale.ordinal().range(t);return function(t,e){var r=void 0===e?t:e;return t.color||n(r)}}return t},r.utils.defaultColor=function(){return r.utils.getColor(d3.scale.category20().range())},r.utils.customTheme=function(t,n,e){n=n||function(t){return t.key};var i=(e=e||d3.scale.category20().range()).length;return function(o,a){var u=n(o);return r.utils.isFunction(t[u])?t[u]():void 0!==t[u]?t[u]:(i||(i=e.length),e[i-=1])}},r.utils.pjax=function(t,n){var e=function(e){d3.html(e,function(e){var i=d3.select(n).node();i.parentNode.replaceChild(d3.select(e).select(n).node(),i),r.utils.pjax(t,n)})};d3.selectAll(t).on("click",function(){history.pushState(this.href,this.textContent,this.href),e(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&e(d3.event.state)})},r.utils.calcApproxTextWidth=function(t){if(r.utils.isFunction(t.style)&&r.utils.isFunction(t.text)){var n=parseInt(t.style("font-size").replace("px",""),10),e=t.text().length;return r.utils.NaNtoZero(e*n*.5)}return 0},r.utils.NaNtoZero=function(t){return!r.utils.isNumber(t)||isNaN(t)||null===t||t===1/0||t===-1/0?0:t},d3.selection.prototype.watchTransition=function(t){var n=[this].concat([].slice.call(arguments,1));return t.transition.apply(t,n)},r.utils.renderWatch=function(t,n){if(!(this instanceof r.utils.renderWatch))return new r.utils.renderWatch(t,n);var e=void 0!==n?n:250,i=[],o=this;this.models=function(t){return(t=[].slice.call(arguments,0)).forEach(function(t){var n;t.__rendered=!1,(n=t).dispatch.on("renderEnd",function(t){n.__rendered=!0,o.renderEnd("model")}),i.indexOf(t)<0&&i.push(t)}),this},this.reset=function(t){void 0!==t&&(e=t),i=[]},this.transition=function(t,n,r){if(r=(n=arguments.length>1?[].slice.call(arguments,1):[]).length>1?n.pop():void 0!==e?e:250,t.__rendered=!1,i.indexOf(t)<0&&i.push(t),0===r)return t.__rendered=!0,t.delay=function(){return this},t.duration=function(){return this},t;0===t.length?t.__rendered=!0:t.every(function(t){return!t.length})?t.__rendered=!0:t.__rendered=!1;var a=0;return t.transition().duration(r).each(function(){++a}).each("end",function(e,r){0==--a&&(t.__rendered=!0,o.renderEnd.apply(this,n))})},this.renderEnd=function(){i.every(function(t){return t.__rendered})&&(i.forEach(function(t){t.__rendered=!1}),t.renderEnd.apply(this,arguments))}},r.utils.deepExtend=function(t){var n=arguments.length>1?[].slice.call(arguments,1):[];n.forEach(function(n){for(var e in n){var i=r.utils.isArray(t[e]),o=r.utils.isObject(t[e]),a=r.utils.isObject(n[e]);o&&!i&&a?r.utils.deepExtend(t[e],n[e]):t[e]=n[e]}})},r.utils.state=function(){if(!(this instanceof r.utils.state))return new r.utils.state;var t={},n=function(){},e=function(){return{}},i=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",function(t){n(t,!0)}),this.getter=function(t){return e=t,this},this.setter=function(t,e){return e||(e=function(){}),n=function(n,r){t(n),r&&e()},this},this.init=function(t){i=i||{},r.utils.deepExtend(i,t)},this.update=function(){i&&(n(i,!1),i=null),function(){var n=e();if(JSON.stringify(n)===JSON.stringify(t))return!1;for(var r in n)void 0===t[r]&&(t[r]={}),t[r]=n[r];return!0}.call(this)&&this.dispatch.change(t)}},r.utils.optionsFunc=function(t){return t&&d3.map(t).forEach(function(t,n){r.utils.isFunction(this[t])&&this[t](n)}.bind(this)),this},r.utils.calcTicksX=function(t,n){for(var e=1,i=0;i<n.length;i+=1){var o=n[i]&&n[i].values?n[i].values.length:0;e=o>e?o:e}return r.log("Requested number of ticks: ",t),r.log("Calculated max values to be: ",e),t=(t=t>e?t=e-1:t)<1?1:t,t=Math.floor(t),r.log("Calculating tick count as: ",t),t},r.utils.calcTicksY=function(t,n){return r.utils.calcTicksX(t,n)},r.utils.initOption=function(t,n){t._calls&&t._calls[n]?t[n]=t._calls[n]:(t[n]=function(e){return arguments.length?(t._overrides[n]=!0,t._options[n]=e,t):t._options[n]},t["_"+n]=function(e){return arguments.length?(t._overrides[n]||(t._options[n]=e),t):t._options[n]})},r.utils.initOptions=function(t){t._overrides=t._overrides||{};var n=Object.getOwnPropertyNames(t._options||{}),e=Object.getOwnPropertyNames(t._calls||{});for(var i in n=n.concat(e))r.utils.initOption(t,n[i])},r.utils.inheritOptionsD3=function(t,n,e){t._d3options=e.concat(t._d3options||[]),e.unshift(n),e.unshift(t),d3.rebind.apply(this,e)},r.utils.arrayUnique=function(t){return t.sort().filter(function(n,e){return!e||n!=t[e-1]})},r.utils.symbolMap=d3.map(),r.utils.symbol=function(){var t,n=64;function e(e,i){var o=t.call(this,e,i),a=n.call(this,e,i);return-1!==d3.svg.symbolTypes.indexOf(o)?d3.svg.symbol().type(o).size(a)():r.utils.symbolMap.get(o)(a)}return e.type=function(n){return arguments.length?(t=d3.functor(n),e):t},e.size=function(t){return arguments.length?(n=d3.functor(t),e):n},e},r.utils.inheritOptions=function(t,n){var e=Object.getOwnPropertyNames(n._options||{}),i=Object.getOwnPropertyNames(n._calls||{}),o=n._inherited||[],a=n._d3options||[],u=e.concat(i).concat(o).concat(a);u.unshift(n),u.unshift(t),d3.rebind.apply(this,u),t._inherited=r.utils.arrayUnique(e.concat(i).concat(o).concat(e).concat(t._inherited||[])),t._d3options=r.utils.arrayUnique(a.concat(t._d3options||[]))},r.utils.initSVG=function(t){t.classed({"nvd3-svg":!0})},r.utils.sanitizeHeight=function(t,n){return t||parseInt(n.style("height"),10)||400},r.utils.sanitizeWidth=function(t,n){return t||parseInt(n.style("width"),10)||960},r.utils.availableHeight=function(t,n,e){return Math.max(0,r.utils.sanitizeHeight(t,n)-e.top-e.bottom)},r.utils.availableWidth=function(t,n,e){return Math.max(0,r.utils.sanitizeWidth(t,n)-e.left-e.right)},r.utils.noData=function(t,n){var e=t.options(),i=e.margin(),o=e.noData(),a=null==o?["No Data Available."]:[o],u=r.utils.availableHeight(null,n,i),l=r.utils.availableWidth(null,n,i),s=i.left+l/2,c=i.top+u/2;n.selectAll("g").remove();var f=n.selectAll(".nv-noData").data(a);f.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),f.attr("x",s).attr("y",c).text(function(t){return t})},r.utils.wrapTicks=function(t,n){t.each(function(){for(var t,e=d3.select(this),r=e.text().split(/\s+/).reverse(),i=[],o=0,a=e.attr("y"),u=parseFloat(e.attr("dy")),l=e.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",u+"em");t=r.pop();)i.push(t),l.text(i.join(" ")),l.node().getComputedTextLength()>n&&(i.pop(),l.text(i.join(" ")),i=[t],l=e.append("tspan").attr("x",0).attr("y",a).attr("dy",1.1*++o+u+"em").text(t))})},r.utils.arrayEquals=function(t,n){if(t===n)return!0;if(!t||!n)return!1;if(t.length!=n.length)return!1;for(var e=0,i=t.length;e<i;e++)if(t[e]instanceof Array&&n[e]instanceof Array){if(!r.arrayEquals(t[e],n[e]))return!1}else if(t[e]!=n[e])return!1;return!0},r.models.axis=function(){"use strict";var t,n=d3.svg.axis(),e=d3.scale.linear(),i={top:0,right:0,bottom:0,left:0},o=75,a=60,u=null,l=!0,s=0,c=!0,f=!1,d=!1,h=null,p=0,g=void 0,v=250,m=d3.dispatch("renderEnd");n.scale(e).orient("bottom").tickFormat(function(t){return t});var y=r.utils.renderWatch(m,v);function x(a){return y.reset(),a.each(function(a){var v=d3.select(this);r.utils.initSVG(v);var m=v.selectAll("g.nv-wrap.nv-axis").data([a]),x=(m.enter().append("g").attr("class","nvd3 nv-wrap nv-axis").append("g"),m.select("g"));null!==h?n.ticks(h):"top"!=n.orient()&&"bottom"!=n.orient()||n.ticks(Math.abs(e.range()[1]-e.range()[0])/100),x.watchTransition(y,"axis").call(n),t=t||n.scale();var b=n.tickFormat();null==b&&(b=t.tickFormat());var k,M,w,A=x.selectAll("text.nv-axislabel").data([u||null]);switch(A.exit().remove(),void 0!==g&&x.selectAll("g").select("text").style("font-size",g),n.orient()){case"top":A.enter().append("text").attr("class","nv-axislabel"),w=0,1===e.range().length?w=d?2*e.range()[0]+e.rangeBand():0:2===e.range().length?w=d?e.range()[0]+e.range()[1]+e.rangeBand():e.range()[1]:e.range().length>2&&(w=e.range()[e.range().length-1]+(e.range()[1]-e.range()[0])),A.attr("text-anchor","middle").attr("y",0).attr("x",w/2),l&&((M=m.selectAll("g.nv-axisMaxMin").data(e.domain())).enter().append("g").attr("class",function(t,n){return["nv-axisMaxMin","nv-axisMaxMin-x",0==n?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),M.exit().remove(),M.attr("transform",function(t,n){return"translate("+r.utils.NaNtoZero(e(t))+",0)"}).select("text").attr("dy","-0.5em").attr("y",-n.tickPadding()).attr("text-anchor","middle").text(function(t,n){var e=b(t);return(""+e).match("NaN")?"":e}),M.watchTransition(y,"min-max top").attr("transform",function(t,n){return"translate("+r.utils.NaNtoZero(e.range()[n])+",0)"}));break;case"bottom":k=p+36;var _=30,S=0,C=x.selectAll("g").select("text"),E="";if(s%360){C.attr("transform",""),C.each(function(t,n){var e=this.getBoundingClientRect(),r=e.width;S=e.height,r>_&&(_=r)}),E="rotate("+s+" 0,"+(S/2+n.tickPadding())+")";var N=Math.abs(Math.sin(s*Math.PI/180));k=(N?N*_:_)+30,C.attr("transform",E).style("text-anchor",s%360>0?"start":"end")}else f?C.attr("transform",function(t,n){return"translate(0,"+(n%2==0?"0":"12")+")"}):C.attr("transform","translate(0,0)");A.enter().append("text").attr("class","nv-axislabel"),w=0,1===e.range().length?w=d?2*e.range()[0]+e.rangeBand():0:2===e.range().length?w=d?e.range()[0]+e.range()[1]+e.rangeBand():e.range()[1]:e.range().length>2&&(w=e.range()[e.range().length-1]+(e.range()[1]-e.range()[0])),A.attr("text-anchor","middle").attr("y",k).attr("x",w/2),l&&((M=m.selectAll("g.nv-axisMaxMin").data([e.domain()[0],e.domain()[e.domain().length-1]])).enter().append("g").attr("class",function(t,n){return["nv-axisMaxMin","nv-axisMaxMin-x",0==n?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),M.exit().remove(),M.attr("transform",function(t,n){return"translate("+r.utils.NaNtoZero(e(t)+(d?e.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",n.tickPadding()).attr("transform",E).style("text-anchor",s?s%360>0?"start":"end":"middle").text(function(t,n){var e=b(t);return(""+e).match("NaN")?"":e}),M.watchTransition(y,"min-max bottom").attr("transform",function(t,n){return"translate("+r.utils.NaNtoZero(e(t)+(d?e.rangeBand()/2:0))+",0)"}));break;case"right":A.enter().append("text").attr("class","nv-axislabel"),A.style("text-anchor",c?"middle":"begin").attr("transform",c?"rotate(90)":"").attr("y",c?12-Math.max(i.right,o)-(p||0):-10).attr("x",c?d3.max(e.range())/2:n.tickPadding()),l&&((M=m.selectAll("g.nv-axisMaxMin").data(e.domain())).enter().append("g").attr("class",function(t,n){return["nv-axisMaxMin","nv-axisMaxMin-y",0==n?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),M.exit().remove(),M.attr("transform",function(t,n){return"translate(0,"+r.utils.NaNtoZero(e(t))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",n.tickPadding()).style("text-anchor","start").text(function(t,n){var e=b(t);return(""+e).match("NaN")?"":e}),M.watchTransition(y,"min-max right").attr("transform",function(t,n){return"translate(0,"+r.utils.NaNtoZero(e.range()[n])+")"}).select("text").style("opacity",1));break;case"left":A.enter().append("text").attr("class","nv-axislabel"),A.style("text-anchor",c?"middle":"end").attr("transform",c?"rotate(-90)":"").attr("y",c?25-Math.max(i.left,o)-(p||0):-10).attr("x",c?-d3.max(e.range())/2:-n.tickPadding()),l&&((M=m.selectAll("g.nv-axisMaxMin").data(e.domain())).enter().append("g").attr("class",function(t,n){return["nv-axisMaxMin","nv-axisMaxMin-y",0==n?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),M.exit().remove(),M.attr("transform",function(n,e){return"translate(0,"+r.utils.NaNtoZero(t(n))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-n.tickPadding()).attr("text-anchor","end").text(function(t,n){var e=b(t);return(""+e).match("NaN")?"":e}),M.watchTransition(y,"min-max right").attr("transform",function(t,n){return"translate(0,"+r.utils.NaNtoZero(e.range()[n])+")"}).select("text").style("opacity",1))}if(A.text(function(t){return t}),!l||"left"!==n.orient()&&"right"!==n.orient()||(x.selectAll("g").each(function(t,n){d3.select(this).select("text").attr("opacity",1),(e(t)<e.range()[1]+10||e(t)>e.range()[0]-10)&&((t>1e-10||t<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),e.domain()[0]==e.domain()[1]&&0==e.domain()[0]&&m.selectAll("g.nv-axisMaxMin").style("opacity",function(t,n){return n?0:1})),l&&("top"===n.orient()||"bottom"===n.orient())){var L=[];m.selectAll("g.nv-axisMaxMin").each(function(t,n){try{n?L.push(e(t)-this.getBoundingClientRect().width-4):L.push(e(t)+this.getBoundingClientRect().width+4)}catch(r){n?L.push(e(t)-4):L.push(e(t)+4)}}),x.selectAll("g").each(function(t,n){(e(t)<L[0]||e(t)>L[1])&&(t>1e-10||t<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())})}x.selectAll(".tick").filter(function(t){return!parseFloat(Math.round(1e5*t)/1e6)&&void 0!==t}).classed("zero",!0),t=e.copy()}),y.renderEnd("axis immediate"),x}return x.axis=n,x.dispatch=m,x.options=r.utils.optionsFunc.bind(x),x._options=Object.create({},{axisLabelDistance:{get:function(){return p},set:function(t){p=t}},staggerLabels:{get:function(){return f},set:function(t){f=t}},rotateLabels:{get:function(){return s},set:function(t){s=t}},rotateYLabel:{get:function(){return c},set:function(t){c=t}},showMaxMin:{get:function(){return l},set:function(t){l=t}},axisLabel:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return a},set:function(t){a=t}},ticks:{get:function(){return h},set:function(t){h=t}},width:{get:function(){return o},set:function(t){o=t}},fontSize:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return i},set:function(t){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}},duration:{get:function(){return v},set:function(t){v=t,y.reset(v)}},scale:{get:function(){return e},set:function(t){e=t,n.scale(e),d="function"==typeof e.rangeBands,r.utils.inheritOptionsD3(x,e,["domain","range","rangeBand","rangeBands"])}}}),r.utils.initOptions(x),r.utils.inheritOptionsD3(x,n,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),r.utils.inheritOptionsD3(x,e,["domain","range","rangeBand","rangeBands"]),x},r.models.boxPlot=function(){"use strict";var t,n,e,i,o,a,u={top:0,right:0,bottom:0,left:0},l=960,s=500,c=Math.floor(1e4*Math.random()),f=d3.scale.ordinal(),d=d3.scale.linear(),h=function(t){return t.label},p=function(t){return t.values.Q1},g=function(t){return t.values.Q2},v=function(t){return t.values.Q3},m=function(t){return t.values.whisker_low},y=function(t){return t.values.whisker_high},x=function(t){return t.color},b=function(t){return t.values.outliers},k=function(t,n,e){return t},M=function(t,n,e){return t},w=function(t,n,e){},A=r.utils.defaultColor(),_=null,S=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),C=250,E=null,N=r.utils.renderWatch(S,C);function L(c){return N.reset(),c.each(function(c){var L=l-u.left-u.right,F=s-u.top-u.bottom;_=d3.select(this),r.utils.initSVG(_),f.domain(t||c.map(function(t,n){return h(t,n)})).rangeBands(n||[0,L],.1);var D=[];if(!e){var T=[];c.forEach(function(t,n){var e=p(t),r=v(t),i=m(t),o=y(t),a=b(t);a&&a.forEach(function(t,n){T.push(k(t,n,void 0))}),i&&T.push(i),e&&T.push(e),r&&T.push(r),o&&T.push(o)}),D=[d3.min(T),d3.max(T)]}d.domain(e||D),d.range(i||[F,0]),o=o||f,a=a||d.copy().range([d(0),d(0)]);var W=_.selectAll("g.nv-wrap").data([c]);W.enter().append("g").attr("class","nvd3 nv-wrap"),W.attr("transform","translate("+u.left+","+u.top+")");var O=W.selectAll(".nv-boxplot").data(function(t){return t}),P=O.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);O.attr("class","nv-boxplot").attr("transform",function(t,n,e){return"translate("+(f(h(t,n))+.05*f.rangeBand())+", 0)"}).classed("hover",function(t){return t.hover}),O.watchTransition(N,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay(function(t,n){return n*C/c.length}).attr("transform",function(t,n){return"translate("+(f(h(t,n))+.05*f.rangeBand())+", 0)"}),O.exit().remove(),P.each(function(t,n){var e=d3.select(this);[m,y].forEach(function(r){if(void 0!==r(t)&&null!==r(t)){var i=r===m?"low":"high";e.append("line").style("stroke",x(t)||A(t,n)).attr("class","nv-boxplot-whisker nv-boxplot-"+i),e.append("line").style("stroke",x(t)||A(t,n)).attr("class","nv-boxplot-tick nv-boxplot-"+i)}})});var z=function(){return null===E?.9*f.rangeBand():Math.min(75,.9*f.rangeBand())},B=function(){return.45*f.rangeBand()-z()/2},I=function(){return.45*f.rangeBand()+z()/2};[m,y].forEach(function(t){var n=t===m?"low":"high",e=t===m?p:v;O.select("line.nv-boxplot-whisker.nv-boxplot-"+n).watchTransition(N,"nv-boxplot: boxplots").attr("x1",.45*f.rangeBand()).attr("y1",function(n,e){return d(t(n))}).attr("x2",.45*f.rangeBand()).attr("y2",function(t,n){return d(e(t))}),O.select("line.nv-boxplot-tick.nv-boxplot-"+n).watchTransition(N,"nv-boxplot: boxplots").attr("x1",B).attr("y1",function(n,e){return d(t(n))}).attr("x2",I).attr("y2",function(n,e){return d(t(n))})}),[m,y].forEach(function(t){var n=t===m?"low":"high";P.selectAll(".nv-boxplot-"+n).on("mouseover",function(n,e,r){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:t(n),color:x(n)||A(n,r)},e:d3.event})}).on("mouseout",function(n,e,r){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:t(n),color:x(n)||A(n,r)},e:d3.event})}).on("mousemove",function(t,n){S.elementMousemove({e:d3.event})})}),P.append("rect").attr("class","nv-boxplot-box").on("mouseover",function(t,n){d3.select(this).classed("hover",!0),S.elementMouseover({key:h(t),value:h(t),series:[{key:"Q3",value:v(t),color:x(t)||A(t,n)},{key:"Q2",value:g(t),color:x(t)||A(t,n)},{key:"Q1",value:p(t),color:x(t)||A(t,n)}],data:t,index:n,e:d3.event})}).on("mouseout",function(t,n){d3.select(this).classed("hover",!1),S.elementMouseout({key:h(t),value:h(t),series:[{key:"Q3",value:v(t),color:x(t)||A(t,n)},{key:"Q2",value:g(t),color:x(t)||A(t,n)},{key:"Q1",value:p(t),color:x(t)||A(t,n)}],data:t,index:n,e:d3.event})}).on("mousemove",function(t,n){S.elementMousemove({e:d3.event})}),O.select("rect.nv-boxplot-box").watchTransition(N,"nv-boxplot: boxes").attr("y",function(t,n){return d(v(t))}).attr("width",z).attr("x",B).attr("height",function(t,n){return Math.abs(d(v(t))-d(p(t)))||1}).style("fill",function(t,n){return x(t)||A(t,n)}).style("stroke",function(t,n){return x(t)||A(t,n)}),P.append("line").attr("class","nv-boxplot-median"),O.select("line.nv-boxplot-median").watchTransition(N,"nv-boxplot: boxplots line").attr("x1",B).attr("y1",function(t,n){return d(g(t))}).attr("x2",I).attr("y2",function(t,n){return d(g(t))});var j=O.selectAll(".nv-boxplot-outlier").data(function(t){return b(t)||[]});j.enter().append("circle").style("fill",function(t,n,e){return w(t,n,e)||A(t,e)}).style("stroke",function(t,n,e){return w(t,n,e)||A(t,e)}).style("z-index",9e3).on("mouseover",function(t,n,e){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:M(t,n,e),color:w(t,n,e)||A(t,e)},e:d3.event})}).on("mouseout",function(t,n,e){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:M(t,n,e),color:w(t,n,e)||A(t,e)},e:d3.event})}).on("mousemove",function(t,n){S.elementMousemove({e:d3.event})}),j.attr("class","nv-boxplot-outlier"),j.watchTransition(N,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*f.rangeBand()).attr("cy",function(t,n,e){return d(k(t,n,e))}).attr("r","3"),j.exit().remove(),o=f.copy(),a=d.copy()}),N.renderEnd("nv-boxplot immediate"),L}return L.dispatch=S,L.options=r.utils.optionsFunc.bind(L),L._options=Object.create({},{width:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return s},set:function(t){s=t}},maxBoxWidth:{get:function(){return E},set:function(t){E=t}},x:{get:function(){return h},set:function(t){h=t}},q1:{get:function(){return p},set:function(t){p=t}},q2:{get:function(){return g},set:function(t){g=t}},q3:{get:function(){return v},set:function(t){v=t}},wl:{get:function(){return m},set:function(t){m=t}},wh:{get:function(){return y},set:function(t){y=t}},itemColor:{get:function(){return x},set:function(t){x=t}},outliers:{get:function(){return b},set:function(t){b=t}},outlierValue:{get:function(){return k},set:function(t){k=t}},outlierLabel:{get:function(){return M},set:function(t){M=t}},outlierColor:{get:function(){return w},set:function(t){w=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return t},set:function(n){t=n}},yDomain:{get:function(){return e},set:function(t){e=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=t}},id:{get:function(){return c},set:function(t){c=t}},y:{get:function(){return console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead."),{}},set:function(t){console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead.")}},margin:{get:function(){return u},set:function(t){u.top=void 0!==t.top?t.top:u.top,u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},color:{get:function(){return A},set:function(t){A=r.utils.getColor(t)}},duration:{get:function(){return C},set:function(t){C=t,N.reset(C)}}}),r.utils.initOptions(L),L},r.models.boxPlotChart=function(){"use strict";var t,n,e=r.models.boxPlot(),i=r.models.axis(),o=r.models.axis(),a={top:15,right:10,bottom:50,left:60},u=null,l=null,s=r.utils.getColor(),c=!0,f=!0,d=!1,h=!1,p=r.models.tooltip(),g="No Data Available.",v=d3.dispatch("beforeUpdate","renderEnd"),m=250;i.orient("bottom").showMaxMin(!1).tickFormat(function(t){return t}),o.orient(d?"right":"left").tickFormat(d3.format(",.1f")),p.duration(0);var y=r.utils.renderWatch(v,m);function x(s){return y.reset(),y.models(e),c&&y.models(i),f&&y.models(o),s.each(function(s){var p=d3.select(this);r.utils.initSVG(p);var y=(u||parseInt(p.style("width"))||960)-a.left-a.right,b=(l||parseInt(p.style("height"))||400)-a.top-a.bottom;if(x.update=function(){v.beforeUpdate(),p.transition().duration(m).call(x)},x.container=this,!s||!s.length){var k=p.selectAll(".nv-noData").data([g]);return k.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),k.attr("x",a.left+y/2).attr("y",a.top+b/2).text(function(t){return t}),x}p.selectAll(".nv-noData").remove(),t=e.xScale(),n=e.yScale().clamp(!0);var M=p.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([s]),w=M.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),A=w.append("defs"),_=M.select("g");if(w.append("g").attr("class","nv-x nv-axis"),w.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),w.append("g").attr("class","nv-barsWrap"),_.attr("transform","translate("+a.left+","+a.top+")"),d&&_.select(".nv-y.nv-axis").attr("transform","translate("+y+",0)"),e.width(y).height(b),_.select(".nv-barsWrap").datum(s.filter(function(t){return!t.disabled})).transition().call(e),A.append("clipPath").attr("id","nv-x-label-clip-"+e.id()).append("rect"),_.select("#nv-x-label-clip-"+e.id()+" rect").attr("width",t.rangeBand()*(h?2:1)).attr("height",16).attr("x",-t.rangeBand()/(h?1:2)),c){i.scale(t).ticks(r.utils.calcTicksX(y/100,s)).tickSize(-b,0),_.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),_.select(".nv-x.nv-axis").call(i);var S=_.select(".nv-x.nv-axis").selectAll("g");h&&S.selectAll("text").attr("transform",function(t,n,e){return"translate(0,"+(e%2==0?"5":"17")+")"})}f&&(o.scale(n).ticks(Math.floor(b/36)).tickSize(-y,0),_.select(".nv-y.nv-axis").call(o)),_.select(".nv-zeroLine line").attr("x1",0).attr("x2",y).attr("y1",n(0)).attr("y2",n(0))}),y.renderEnd("nv-boxplot chart immediate"),x}return e.dispatch.on("elementMouseover.tooltip",function(t){p.data(t).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){p.data(t).hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(t){p()}),x.dispatch=v,x.boxplot=e,x.xAxis=i,x.yAxis=o,x.tooltip=p,x.options=r.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return l},set:function(t){l=t}},staggerLabels:{get:function(){return h},set:function(t){h=t}},showXAxis:{get:function(){return c},set:function(t){c=t}},showYAxis:{get:function(){return f},set:function(t){f=t}},tooltipContent:{get:function(){return p},set:function(t){p=t}},noData:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return a},set:function(t){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}},duration:{get:function(){return m},set:function(t){m=t,y.reset(m),e.duration(m),i.duration(m),o.duration(m)}},color:{get:function(){return s},set:function(t){s=r.utils.getColor(t),e.color(s)}},rightAlignYAxis:{get:function(){return d},set:function(t){d=t,o.orient(t?"right":"left")}}}),r.utils.inheritOptions(x,e),r.utils.initOptions(x),x},r.models.bullet=function(){"use strict";var t={top:0,right:0,bottom:0,left:0},n="left",e=!1,i=function(t){return t.ranges},o=function(t){return t.markers?t.markers:[]},a=function(t){return t.markerLines?t.markerLines:[0]},u=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.markerLineLabels?t.markerLineLabels:[]},f=function(t){return t.measureLabels?t.measureLabels:[]},d=[0],h=380,p=30,g=null,v=null,m=r.utils.getColor(["#1f77b4"]),y=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),x=["Maximum","Mean","Minimum"],b=["Max","Avg","Min"],k=1e3;function M(t,n){var e=t.slice();t.sort(function(t,r){var i=e.indexOf(t),o=e.indexOf(r);return d3.descending(n[i],n[o])})}function w(n){return n.each(function(n,v){var w=h-t.left-t.right,A=p-t.top-t.bottom;g=d3.select(this),r.utils.initSVG(g);var _=i.call(this,n,v).slice(),S=o.call(this,n,v).slice(),C=a.call(this,n,v).slice(),E=u.call(this,n,v).slice(),N=l.call(this,n,v).slice(),L=s.call(this,n,v).slice(),F=c.call(this,n,v).slice(),D=f.call(this,n,v).slice();M(N,_),M(L,S),M(F,C),M(D,E),_.sort(d3.descending),S.sort(d3.descending),C.sort(d3.descending),E.sort(d3.descending);var T=d3.scale.linear().domain(d3.extent(d3.merge([d,_]))).range(e?[w,0]:[0,w]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(T.range()),this.__chart__=T,d3.min(_),d3.max(_),_[1];for(var W=g.selectAll("g.nv-wrap.nv-bullet").data([n]),O=W.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet").append("g"),P=W.select("g"),z=(v=0,_.length);v<z;v++){var B="nv-range nv-range"+v;v<=2&&(B=B+" nv-range"+b[v]),O.append("rect").attr("class",B)}O.append("rect").attr("class","nv-measure"),W.attr("transform","translate("+t.left+","+t.top+")");var I=function(t){return Math.abs(T(t)-T(0))},j=function(t){return T(t<0?t:0)};for(v=0,z=_.length;v<z;v++){var R=_[v];P.select("rect.nv-range"+v).datum(R).attr("height",A).transition().duration(k).attr("width",I(R)).attr("x",j(R))}P.select("rect.nv-measure").style("fill",m).attr("height",A/3).attr("y",A/3).on("mouseover",function(){y.elementMouseover({value:E[0],label:D[0]||"Current",color:d3.select(this).style("fill")})}).on("mousemove",function(){y.elementMousemove({value:E[0],label:D[0]||"Current",color:d3.select(this).style("fill")})}).on("mouseout",function(){y.elementMouseout({value:E[0],label:D[0]||"Current",color:d3.select(this).style("fill")})}).transition().duration(k).attr("width",E<0?T(0)-T(E[0]):T(E[0])-T(0)).attr("x",j(E));var V=A/6,H=S.map(function(t,n){return{value:t,label:L[n]}});O.selectAll("path.nv-markerTriangle").data(H).enter().append("path").attr("class","nv-markerTriangle").attr("d","M0,"+V+"L"+V+","+-V+" "+-V+","+-V+"Z").on("mouseover",function(t){y.elementMouseover({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[T(t.value),A/2]})}).on("mousemove",function(t){y.elementMousemove({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,n){y.elementMouseout({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}),P.selectAll("path.nv-markerTriangle").data(H).transition().duration(k).attr("transform",function(t){return"translate("+T(t.value)+","+A/2+")"});var q=C.map(function(t,n){return{value:t,label:F[n]}});O.selectAll("line.nv-markerLine").data(q).enter().append("line").attr("cursor","").attr("class","nv-markerLine").attr("x1",function(t){return T(t.value)}).attr("y1","2").attr("x2",function(t){return T(t.value)}).attr("y2",A-2).on("mouseover",function(t){y.elementMouseover({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill"),pos:[T(t.value),A/2]})}).on("mousemove",function(t){y.elementMousemove({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,n){y.elementMouseout({value:t.value,label:t.label||"Previous",color:d3.select(this).style("fill")})}),P.selectAll("line.nv-markerLine").data(q).transition().duration(k).attr("x1",function(t){return T(t.value)}).attr("x2",function(t){return T(t.value)}),W.selectAll(".nv-range").on("mouseover",function(t,n){var e=N[n]||x[n];y.elementMouseover({value:t,label:e,color:d3.select(this).style("fill")})}).on("mousemove",function(){y.elementMousemove({value:E[0],label:D[0]||"Previous",color:d3.select(this).style("fill")})}).on("mouseout",function(t,n){var e=N[n]||x[n];y.elementMouseout({value:t,label:e,color:d3.select(this).style("fill")})})}),w}return w.dispatch=y,w.options=r.utils.optionsFunc.bind(w),w._options=Object.create({},{ranges:{get:function(){return i},set:function(t){i=t}},markers:{get:function(){return o},set:function(t){o=t}},measures:{get:function(){return u},set:function(t){u=t}},forceX:{get:function(){return d},set:function(t){d=t}},width:{get:function(){return h},set:function(t){h=t}},height:{get:function(){return p},set:function(t){p=t}},tickFormat:{get:function(){return v},set:function(t){v=t}},duration:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return t},set:function(n){t.top=void 0!==n.top?n.top:t.top,t.right=void 0!==n.right?n.right:t.right,t.bottom=void 0!==n.bottom?n.bottom:t.bottom,t.left=void 0!==n.left?n.left:t.left}},orient:{get:function(){return n},set:function(t){e="right"==(n=t)||"bottom"==n}},color:{get:function(){return m},set:function(t){m=r.utils.getColor(t)}}}),r.utils.initOptions(w),w},r.models.bulletChart=function(){"use strict";var t=r.models.bullet(),n=r.models.tooltip(),e="left",i=!1,o={top:5,right:40,bottom:20,left:120},a=function(t){return t.ranges},u=function(t){return t.markers?t.markers:[]},l=function(t){return t.measures},s=null,c=55,f=null,d=null,h=null,p=d3.dispatch();function g(n){return n.each(function(e,h){var p=d3.select(this);r.utils.initSVG(p);var v=r.utils.availableWidth(s,p,o),m=c-o.top-o.bottom;if(g.update=function(){g(n)},g.container=this,!e||!a.call(this,e,h))return r.utils.noData(g,p),g;p.selectAll(".nv-noData").remove();var y=a.call(this,e,h).slice().sort(d3.descending),x=u.call(this,e,h).slice().sort(d3.descending),b=l.call(this,e,h).slice().sort(d3.descending),k=p.selectAll("g.nv-wrap.nv-bulletChart").data([e]),M=k.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart").append("g"),w=k.select("g");M.append("g").attr("class","nv-bulletWrap"),M.append("g").attr("class","nv-titles"),k.attr("transform","translate("+o.left+","+o.top+")");var A=d3.scale.linear().domain([0,Math.max(y[0],x[0]||0,b[0])]).range(i?[v,0]:[0,v]),_=this.__chart__||d3.scale.linear().domain([0,1/0]).range(A.range());this.__chart__=A;var S=M.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(c-o.top-o.bottom)/2+")");S.append("text").attr("class","nv-title").text(function(t){return t.title}),S.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(t){return t.subtitle}),t.width(v).height(m);var C=w.select(".nv-bulletWrap");d3.transition(C).call(t);var E=f||A.tickFormat(v/100),N=w.selectAll("g.nv-tick").data(A.ticks(d||v/50),function(t){return this.textContent||E(t)}),L=N.enter().append("g").attr("class","nv-tick").attr("transform",function(t){return"translate("+_(t)+",0)"}).style("opacity",1e-6);L.append("line").attr("y1",m).attr("y2",7*m/6),L.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",7*m/6).text(E);var F=d3.transition(N).transition().duration(t.duration()).attr("transform",function(t){return"translate("+A(t)+",0)"}).style("opacity",1);F.select("line").attr("y1",m).attr("y2",7*m/6),F.select("text").attr("y",7*m/6),d3.transition(N.exit()).transition().duration(t.duration()).attr("transform",function(t){return"translate("+A(t)+",0)"}).style("opacity",1e-6).remove()}),d3.timer.flush(),g}return n.duration(0).headerEnabled(!1),t.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:t.label,value:t.value,color:t.color},n.data(t).hidden(!1)}),t.dispatch.on("elementMouseout.tooltip",function(t){n.hidden(!0)}),t.dispatch.on("elementMousemove.tooltip",function(t){n()}),g.bullet=t,g.dispatch=p,g.tooltip=n,g.options=r.utils.optionsFunc.bind(g),g._options=Object.create({},{ranges:{get:function(){return a},set:function(t){a=t}},markers:{get:function(){return u},set:function(t){u=t}},measures:{get:function(){return l},set:function(t){l=t}},width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return c},set:function(t){c=t}},tickFormat:{get:function(){return f},set:function(t){f=t}},ticks:{get:function(){return d},set:function(t){d=t}},noData:{get:function(){return h},set:function(t){h=t}},margin:{get:function(){return o},set:function(t){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}},orient:{get:function(){return e},set:function(t){i="right"==(e=t)||"bottom"==e}}}),r.utils.inheritOptions(g,t),r.utils.initOptions(g),g},r.models.candlestickBar=function(){"use strict";var t,n,e,i,o,a={top:0,right:0,bottom:0,left:0},u=null,l=null,s=Math.floor(1e4*Math.random()),c=d3.scale.linear(),f=d3.scale.linear(),d=function(t){return t.x},h=function(t){return t.y},p=function(t){return t.open},g=function(t){return t.close},v=function(t){return t.high},m=function(t){return t.low},y=[],x=[],b=!1,k=!0,M=r.utils.defaultColor(),w=!1,A=d3.dispatch("stateChange","changeState","renderEnd","chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove");function _(M){return M.each(function(M){t=d3.select(this);var w=r.utils.availableWidth(u,t,a),_=r.utils.availableHeight(l,t,a);r.utils.initSVG(t);var S=w/M[0].values.length*.45;c.domain(n||d3.extent(M[0].values.map(d).concat(y))),b?c.range(i||[.5*w/M[0].values.length,w*(M[0].values.length-.5)/M[0].values.length]):c.range(i||[5+S/2,w-S/2-5]),f.domain(e||[d3.min(M[0].values.map(m).concat(x)),d3.max(M[0].values.map(v).concat(x))]).range(o||[_,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])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+.01*f.domain()[0],f.domain()[1]-.01*f.domain()[1]]):f.domain([-1,1]));var C=d3.select(this).selectAll("g.nv-wrap.nv-candlestickBar").data([M[0].values]),E=C.enter().append("g").attr("class","nvd3 nv-wrap nv-candlestickBar"),N=E.append("defs"),L=E.append("g"),F=C.select("g");L.append("g").attr("class","nv-ticks"),C.attr("transform","translate("+a.left+","+a.top+")"),t.on("click",function(t,n){A.chartClick({data:t,index:n,pos:d3.event,id:s})}),N.append("clipPath").attr("id","nv-chart-clip-path-"+s).append("rect"),C.select("#nv-chart-clip-path-"+s+" rect").attr("width",w).attr("height",_),F.attr("clip-path",k?"url(#nv-chart-clip-path-"+s+")":"");var D=C.select(".nv-ticks").selectAll(".nv-tick").data(function(t){return t});D.exit().remove();var T=D.enter().append("g");D.attr("class",function(t,n,e){return(p(t,n)>g(t,n)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+e+"-"+n}),T.append("line").attr("class","nv-candlestick-lines").attr("transform",function(t,n){return"translate("+c(d(t,n))+",0)"}).attr("x1",0).attr("y1",function(t,n){return f(v(t,n))}).attr("x2",0).attr("y2",function(t,n){return f(m(t,n))}),T.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",function(t,n){return"translate("+(c(d(t,n))-S/2)+","+(f(h(t,n))-(p(t,n)>g(t,n)?f(g(t,n))-f(p(t,n)):0))+")"}).attr("x",0).attr("y",0).attr("width",S).attr("height",function(t,n){var e=p(t,n),r=g(t,n);return e>r?f(r)-f(e):f(e)-f(r)}),D.select(".nv-candlestick-lines").transition().attr("transform",function(t,n){return"translate("+c(d(t,n))+",0)"}).attr("x1",0).attr("y1",function(t,n){return f(v(t,n))}).attr("x2",0).attr("y2",function(t,n){return f(m(t,n))}),D.select(".nv-candlestick-rects").transition().attr("transform",function(t,n){return"translate("+(c(d(t,n))-S/2)+","+(f(h(t,n))-(p(t,n)>g(t,n)?f(g(t,n))-f(p(t,n)):0))+")"}).attr("x",0).attr("y",0).attr("width",S).attr("height",function(t,n){var e=p(t,n),r=g(t,n);return e>r?f(r)-f(e):f(e)-f(r)})}),_}return _.highlightPoint=function(n,e){_.clearHighlights(),t.select(".nv-candlestickBar .nv-tick-0-"+n).classed("hover",e)},_.clearHighlights=function(){t.select(".nv-candlestickBar .nv-tick.hov