Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3fc

Package Overview
Dependencies
Maintainers
2
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3fc - npm Package Compare versions

Comparing version 0.2.5 to 0.3.3

_SpecRunner.html

6

dist/d3fc.min.js

@@ -1,5 +0,5 @@

/*! d3fc 21-06-2015 */
/*! d3fc 16-07-2015 */
!function(){"use strict";var a=null;a=(1,eval)("this"),a.fc={annotation:{},chart:{},indicator:{algorithm:{calculator:{}},renderer:{}},scale:{discontinuity:{}},series:{},svg:{},tool:{},util:{}}}(),function(a,b){"use strict";b.annotation.gridline=function(){var c=a.time.scale(),d=a.scale.linear(),e=10,f=10,g=function(g){g.each(function(){var g=a.select(this),h=b.util.simpleDataJoin(g,"x",c.ticks(e));h.enter().append("line").attr("class","gridline"),h.select("line").attr({x1:c,x2:c,y1:d.range()[0],y2:d.range()[1]});var i=b.util.simpleDataJoin(g,"y",d.ticks(f));i.enter().append("line").attr("class","gridline"),i.select("line").attr({x1:c.range()[0],x2:c.range()[1],y1:d,y2:d})})};return g.xScale=function(a){return arguments.length?(c=a,g):c},g.yScale=function(a){return arguments.length?(d=a,g):d},g.xTicks=function(a){return arguments.length?(e=a,g):e},g.yTicks=function(a){return arguments.length?(f=a,g):f},g}}(d3,fc),function(a,b){"use strict";b.annotation.line=function(){var c=a.time.scale(),d=a.scale.linear(),e=b.util.fn.identity,f=b.util.fn.index,g=e,h=b.util.fn.noop,i="horizontal",j=b.util.dataJoin().selector("g.annotation").element("g").attrs({"class":"annotation"}),k=function(b){b.each(function(b){function f(a){return a.rangeExtent?a.rangeExtent():a.range()}var k,l,m,n,o,p,q={x:-5,y:-5};switch(i){case"horizontal":m=function(a,b){return"translate("+a+", "+b+")"},n="x2",l=c,k=d,o="left-handle",p="right-handle";break;case"vertical":m=function(a,b){return"translate("+b+", "+a+")"},n="y2",l=d,k=c,q.transform="rotate(-90)",o="bottom-handle",p="top-handle";break;default:throw new Error("Invalid orientation")}var r=f(l),s=function(a){var b=k(e(a));return m(r[0],b)},t=r[1]-r[0],u=a.select(this),v=j(u,b),w=v.enter().attr("transform",s);w.append("line").attr(n,t),w.append("g").classed(o,!0),w.append("g").classed(p,!0).attr("transform",m(t,0)).append("text").attr(q),v.attr("transform",s),v.select("line").attr(n,t),v.select("g."+p).attr("transform",m(t,0)),v.select("text").text(g),h(v)})};return k.xScale=function(a){return arguments.length?(c=a,k):c},k.yScale=function(a){return arguments.length?(d=a,k):d},k.value=function(b){return arguments.length?(e=a.functor(b),k):e},k.keyValue=function(b){return arguments.length?(f=a.functor(b),k):f},k.label=function(b){return arguments.length?(g=a.functor(b),k):g},k.decorate=function(a){return arguments.length?(h=a,k):h},k.orient=function(a){return arguments.length?(i=a,k):i},k}}(d3,fc),function(a,b){"use strict";b.chart.linearTimeSeries=function(){var c=20,d=b.series.line(),e=b.scale.dateTime(),f=a.scale.linear(),g=a.svg.axis().scale(e).orient("bottom"),h=a.svg.axis().scale(f).orient("left"),i=function(b){b.each(function(b){var i=a.select(this),j={position:"absolute",top:0,right:0,bottom:c,left:0},k=i.selectAll("rect.background").data([b]);k.enter().append("rect").attr("class","background").layout(j);var l=i.selectAll("svg.plot-area").data([b]);l.enter().append("svg").attr({"class":"plot-area",overflow:"hidden"}).layout(j);var m=i.selectAll("g.x-axis").data([b]);m.enter().append("g").attr("class","axis x-axis").layout({position:"absolute",left:0,bottom:0,right:0,height:c});var n=i.selectAll("g.y-axis").data([b]);n.enter().append("g").attr("class","axis y-axis").layout({position:"absolute",top:0,right:0,bottom:c}),i.layout(),e.range([0,m.layout("width")]),f.range([n.layout("height"),0]),m.call(g),n.call(h),d.xScale(e).yScale(f),l.call(d)})};return b.util.rebind(i,e,{xDiscontinuityProvider:"discontinuityProvider",xDomain:"domain",xNice:"nice"}),b.util.rebind(i,f,{yDomain:"domain",yNice:"nice"}),b.util.rebind(i,g,{xTicks:"ticks",xTickValues:"tickValues",xTickSize:"tickSize",xInnerTickSize:"innerTickSize",xOuterTickSize:"outerTickSize",xTickPadding:"tickPadding",xTickFormat:"tickFormat",xOrient:"orient"}),b.util.rebind(i,h,{yTicks:"ticks",yTickValues:"tickValues",yTickSize:"tickSize",yInnerTickSize:"innerTickSize",yOuterTickSize:"outerTickSize",yTickPadding:"tickPadding",yTickFormat:"tickFormat",yOrient:"orient"}),i.xScale=function(){return e},i.yScale=function(){return f},i.plotArea=function(a){return arguments.length?(d=a,i):d},i.xAxisHeight=function(a){return arguments.length?(c=a,i):c},i}}(d3,fc),function(a,b){"use strict";b.chart.sparkline=function(){function c(b){function c(a){return b.filter(function(b){return e(b)===a})[0]}var d=j.xValue(),e=j.yValue(),f=a.max(b,e),g=a.min(b,e);return[{x:d(b[0]),y:e(b[0])},{x:d(c(f)),y:f},{x:d(c(g)),y:g},{x:d(b[b.length-1]),y:e(b[b.length-1])}]}var d=b.scale.dateTime(),e=a.scale.linear(),f=2,g=b.series.line(),h=b.series.point().xValue(function(a){return a.x}).yValue(function(a){return a.y}).decorate(function(a){a.attr("class",function(a,b){switch(b){case 0:return"open";case 1:return"high";case 2:return"low";case 3:return"close"}})}),i=b.series.multi().series([g,h]).mapping(function(a){switch(a){case h:return c(this);default:return this}}),j=function(c){h.radius(f),c.each(function(c){var g=a.select(this),h=b.util.innerDimensions(this),j=f;d.range([j,h.width-j]),e.range([h.height-j,j]),i.xScale(d).yScale(e),g.call(i)})};return b.util.rebind(j,d,{xDiscontinuityProvider:"discontinuityProvider",xDomain:"domain"}),b.util.rebind(j,e,{yDomain:"domain"}),b.util.rebind(j,g,"xValue","yValue"),j.xScale=function(){return d},j.yScale=function(){return e},j.radius=function(a){return arguments.length?(f=a,j):f},j}}(d3,fc),function(a){"use strict";a.dataGenerator=function(){var a=.1,b=.1,c=100,d=1e5,e=new Date,f=50,g=.3,h=function(a){return!(0===a.getDay()||6===a.getDay())},i=function(a,b,c){for(var d,g=[],h=0,i=0;g.length<a;)d=b.slice(i,i+f),g.push({date:new Date(e.getTime()),open:d[0],high:Math.max.apply({},d),low:Math.min.apply({},d),close:d[f-1],volume:c[h]}),i+=f,h+=1,e.setUTCDate(e.getUTCDate()+1);return g},j=function(j){var l=new Date(e.getTime());l.setUTCDate(e.getUTCDate()+j);var m=315569e5,n=(l.getTime()-e.getTime())/m,o=k(n,j*f,a,b,c),p=k(n,j,0,b,d);return p=p.map(function(a){var b=Math.min(0,Math.max(g,1)),c=1+b*(1-2*Math.random());return Math.floor(a*c)}),c=o[o.length-1],d=p[p.length-1],i(j,o,p).filter(function(a){return!h||h(a.date)})},k=function(a,b,c,d,e){var f,g,h=d3.random.normal(),i=a/b,j=new Array(b+1);for(g=1;g<j.length;g+=1)f=h(),f*=Math.sqrt(i),f*=d,f+=(c-d*d/2)*i,j[g]=Math.exp(f);for(j[0]=e,g=1;g<j.length;g+=1)j[g]=j[g-1]*j[g];return j};return j.mu=function(b){return arguments.length?(a=b,j):a},j.sigma=function(a){return arguments.length?(b=a,j):b},j.startPrice=function(a){return arguments.length?(c=a,j):c},j.startVolume=function(a){return arguments.length?(d=a,j):d},j.startDate=function(a){return arguments.length?(e=a,j):e},j.stepsPerDay=function(a){return arguments.length?(f=a,j):f},j.volumeNoiseFactor=function(a){return arguments.length?(g=a,j):g},j.filter=function(a){return arguments.length?(h=a,j):h},j}}(fc),function(a,b){"use strict";b.indicator.algorithm.bollingerBands=function(){var c=b.indicator.algorithm.calculator.bollingerBands().value(function(a){return a.close}),d=b.indicator.algorithm.merge().algorithm(c).merge(function(a,b){a.bollingerBands=b}),e=function(a){return d(a)};return e.root=function(a){return a.bollingerBands},a.rebind(e,d,"merge"),a.rebind(e,c,"windowSize","value","multiplier"),e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.bollingerBands=function(){var c=2,d=b.indicator.algorithm.calculator.slidingWindow().undefinedValue({upper:void 0,average:void 0,lower:void 0}).accumulator(function(b){var d=a.mean(b),e=a.deviation(b);return{upper:d+c*e,average:d,lower:d-c*e}}),e=function(a){return d(a)};return e.multiplier=function(a){return arguments.length?(c=a,e):c},a.rebind(e,d,"windowSize","value"),e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.exponentialMovingAverage=function(){var a=9,c=b.util.fn.identity,d=function(b){var d,e=2/(a+1),f=0;return b.map(function(b,g){if(a-1>g)return void(f+=c(b,g));if(g===a-1){f+=c(b,g);var h=f/a;return d=h,h}var i=c(b,g)*e+(1-e)*d;return d=i,i})};return d.windowSize=function(b){return arguments.length?(a=b,d):a},d.value=function(a){return arguments.length?(c=a,d):c},d}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.macd=function(){var c=b.util.fn.identity,d=b.indicator.algorithm.calculator.exponentialMovingAverage().windowSize(12),e=b.indicator.algorithm.calculator.exponentialMovingAverage().windowSize(29),f=b.indicator.algorithm.calculator.exponentialMovingAverage().windowSize(9),g=b.indicator.algorithm.calculator.undefinedInputAdapter().algorithm(f),h=function(b){d.value(c),e.value(c);var f=a.zip(d(b),e(b)).map(function(a){return void 0!==a[0]&&void 0!==a[1]?a[0]-a[1]:void 0}),h=g(f),i=a.zip(f,h).map(function(a){return{macd:a[0],signal:a[1],divergence:void 0!==a[0]&&void 0!==a[1]?a[0]-a[1]:void 0}});return i};return h.value=function(a){return arguments.length?(c=a,h):c},b.util.rebind(h,d,{fastPeriod:"windowSize"}),b.util.rebind(h,e,{slowPeriod:"windowSize"}),b.util.rebind(h,f,{signalPeriod:"windowSize"}),h}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.percentageChange=function(){var c=a.functor(0),d=b.util.fn.identity,e=function(a){if(0===a.length)return[];var b=d(a[c(a)]);return a.map(function(a,c){return(d(a,c)-b)/b})};return e.baseIndex=function(b){return arguments.length?(c=a.functor(b),e):c},e.value=function(a){return arguments.length?(d=a,e):d},e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.relativeStrengthIndex=function(){var c=function(a,b){return a.open},d=function(a,b){return a.close},e=function(a){for(var b=1/a.length,c=a[0],d=1,e=a.length;e>d;d++)c=b*a[d]+(1-b)*c;return c},f=b.indicator.algorithm.calculator.slidingWindow().windowSize(14).accumulator(function(a){for(var b=[],f=[],g=0,h=a.length;h>g;g++){var i=a[g],j=c(i),k=d(i);b.push(j>k?j-k:0),f.push(k>j?k-j:0)}var l=e(b);if(0===l)return 100;var m=e(f)/l;return 100-100/(1+m)}),g=function(a){return f(a)};return g.openValue=function(a){return arguments.length?(c=a,g):c},g.closeValue=function(a){return arguments.length?(d=a,g):d},a.rebind(g,f,"windowSize"),g}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.slidingWindow=function(){var c=a.functor(void 0),d=a.functor(10),e=b.util.fn.noop,f=b.util.fn.identity,g=function(a){var b=d.apply(this,arguments),g=a.slice(0,b).map(f);return a.map(function(a,d){return b-1>d?c(a,d):(d>=b&&(g.shift(),g.push(f(a,d))),e(g))})};return g.undefinedValue=function(b){return arguments.length?(c=a.functor(b),g):c},g.windowSize=function(b){return arguments.length?(d=a.functor(b),g):d},g.accumulator=function(a){return arguments.length?(e=a,g):e},g.value=function(a){return arguments.length?(f=a,g):f},g}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.undefinedInputAdapter=function(){function c(a){return Array.apply(null,new Array(a)).map(e)}var d=b.indicator.algorithm.calculator.slidingWindow().accumulator(a.mean),e=a.functor(void 0),f=function(a){return void 0===a},g=function(a){for(var b=0;f(a[b])&&b<a.length;)b++;var e=a.slice(b);return c(b).concat(d(e))};return g.algorithm=function(a){return arguments.length?(d=a,g):d},g.undefinedValue=function(b){return arguments.length?(e=a.functor(b),g):e},g.defined=function(a){return arguments.length?(f=a,g):f},g}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.exponentialMovingAverage=function(){var c=b.indicator.algorithm.calculator.slidingWindow().accumulator(a.mean).value(function(a){return a.close}),d=b.indicator.algorithm.merge().algorithm(c).merge(function(a,b){a.exponentialMovingAverage=b}),e=function(a){return d(a)};return a.rebind(e,d,"merge"),a.rebind(e,c,"windowSize","value"),e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.macd=function(){var c=b.indicator.algorithm.calculator.macd().value(function(a){return a.close}),d=b.indicator.algorithm.merge().algorithm(c).merge(function(a,b){a.macd=b}),e=function(a){return d(a)};return a.rebind(e,d,"merge"),a.rebind(e,c,"fastPeriod","slowPeriod","signalPeriod","value"),e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.merge=function(){var c=b.util.fn.noop,d=b.indicator.algorithm.calculator.slidingWindow(),e=function(b){return a.zip(b,d(b)).forEach(function(a){c(a[0],a[1])})};return e.algorithm=function(a){return arguments.length?(d=a,e):d},e.merge=function(a){return arguments.length?(c=a,e):c},e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.movingAverage=function(){var c=b.indicator.algorithm.calculator.slidingWindow().accumulator(a.mean).value(function(a){return a.close}),d=b.indicator.algorithm.merge().algorithm(c).merge(function(a,b){a.movingAverage=b}),e=function(a){return d(a)};return a.rebind(e,d,"merge"),a.rebind(e,c,"windowSize","undefinedValue","value"),e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.relativeStrengthIndex=function(){var c=b.indicator.algorithm.calculator.relativeStrengthIndex(),d=b.indicator.algorithm.merge().algorithm(c).merge(function(a,b){a.rsi=b}),e=function(a){return d(a)};return a.rebind(e,d,"merge"),a.rebind(e,c,"windowSize","openValue","closeValue"),e}}(d3,fc),function(a,b){"use strict";b.indicator.renderer.bollingerBands=function(){var c=a.time.scale(),d=a.scale.linear(),e=function(a,b){return a.close},f=function(a,b){return a.date},g=function(a){return a.bollingerBands},h=b.series.area().y0Value(function(a,b){return g(a).upper}).y1Value(function(a,b){return g(a).lower}),i=b.series.line().yValue(function(a,b){return g(a).upper}),j=b.series.line().yValue(function(a,b){return g(a).average}),k=b.series.line().yValue(function(a,b){return g(a).lower}),l=function(e){var g=b.series.multi().xScale(c).yScale(d).series([h,i,k,j]);h.xValue(f),i.xValue(f),j.xValue(f),k.xValue(f),e.each(function(b){a.select(this).data([b]).call(g)})};return l.xScale=function(a){return arguments.length?(c=a,l):c},l.yScale=function(a){return arguments.length?(d=a,l):d},l.xValue=function(a){return arguments.length?(f=a,l):f},l.yValue=function(a){return arguments.length?(e=a,l):e},l.root=function(a){return arguments.length?(g=a,l):g},l}}(d3,fc),function(a,b){"use strict";b.indicator.renderer.macd=function(){var c=a.time.scale(),d=a.scale.linear(),e=function(a){return a.date},f=function(a){return a.macd},g=b.series.line(),h=b.series.line(),i=b.series.bar(),j=b.series.multi(),k=function(b){g.xValue(e).yValue(function(a,b){return f(a).macd}).decorate(function(a){a.classed("macd",!0)}),h.xValue(e).yValue(function(a,b){return f(a).signal}).decorate(function(a){a.classed("signal",!0)}),i.xValue(e).yValue(function(a,b){return f(a).divergence}),j.xScale(c).yScale(d).series([i,g,h]),b.each(function(b){a.select(this).append("g").classed("macd-indicator",!0).call(j)})};return k.xScale=function(a){return arguments.length?(c=a,k):c},k.xValue=function(a){return arguments.length?(e=a,k):e},k.yScale=function(a){return arguments.length?(d=a,k):d},k.root=function(a){return arguments.length?(f=a,k):f},k}}(d3,fc),function(a,b){"use strict";b.indicator.renderer.relativeStrengthIndex=function(){var c=a.time.scale(),d=a.scale.linear(),e=70,f=30,g=b.annotation.line(),h=b.series.line().yValue(function(a,b){return a.rsi}),i=function(b){g.xScale(c).yScale(d),h.xScale(c).yScale(d),b.each(function(b){var c=a.select(this),d=c.selectAll("g.annotations").data([[e,50,f]]);d.enter().append("g").attr("class","annotations"),d.call(g);var i=c.selectAll("g.indicator").data([b]);i.enter().append("g").attr("class","indicator"),i.call(h)})};return i.xScale=function(a){return arguments.length?(c=a,i):c},i.yScale=function(a){return arguments.length?(d=a,i):d},i.upperValue=function(a){return arguments.length?(e=a,i):e},i.lowerValue=function(a){return arguments.length?(f=a,i):f},a.rebind(i,h,"yValue","xValue"),i}}(d3,fc),function(a,b,c){"use strict";a.selection.prototype.layout=function(a,c){var d=b.layout(),e=arguments.length;if(2===e)"string"!=typeof a?(d.width(a).height(c),this.call(d)):this.attr("layout-css",a+":"+c);else if(1===e){if("string"==typeof a)return Number(this.attr("layout-"+a));var f=a,g=Object.keys(f).map(function(a){return a+":"+f[a]}).join(";");this.attr("layout-css",g)}else 0===e&&this.call(d);return this},b.layout=function(){function a(a){if(!a)return{};var b=a.split(";"),c={};return b.forEach(function(a){var b=a.split(":");if(2===b.length){var d=b[0].trim(),e=b[1].trim();c[d]=isNaN(e)?e:Number(e)}}),c}function d(b){function c(){for(var a=[],c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];1===e.nodeType&&e.getAttribute("layout-css")&&a.push(d(e))}return a}return{style:a(b.getAttribute("layout-css")),children:c(b),element:b,layout:{width:void 0,height:void 0,top:0,left:0}}}function e(a){a.element.setAttribute("layout-width",a.layout.width),a.element.setAttribute("layout-height",a.layout.height),a.element.nodeName.match(/(?:svg|rect)/i)?(a.element.setAttribute("width",a.layout.width),a.element.setAttribute("height",a.layout.height),a.element.setAttribute("x",a.layout.left),a.element.setAttribute("y",a.layout.top)):a.element.setAttribute("transform","translate("+a.layout.left+", "+a.layout.top+")"),a.children.forEach(e)}var f=-1,g=-1,h=function(a){a.each(function(a){var h=b.util.innerDimensions(this),i=d(this);i.style.width=-1!==f?f:h.width,i.style.height=-1!==g?g:h.height,c.computeLayout(i),e(i)})};return h.width=function(a){return arguments.length?(f=a,h):f},h.height=function(a){return arguments.length?(g=a,h):g},h}}(d3,fc,computeLayout),function(a,b){"use strict";function c(d,e){function f(a){var b=d.domain(),c=d.range(),f=e.distance(b[0],b[1]),g=e.distance(b[0],a),h=g/f,i=h*(c[1]-c[0])+c[0];return i}return arguments.length||(d=a.time.scale(),e=b.scale.discontinuity.identity()),f.invert=function(a){var b=d.domain(),c=d.range(),f=(a-c[0])/(c[1]-c[0]),g=e.distance(b[0],b[1]),h=f*g;return e.offset(b[0],h)},f.domain=function(a){if(!arguments.length)return d.domain();var b=e.clampUp(a[0]),c=e.clampDown(a[1]);return d.domain([b,c]),f},f.nice=function(){d.nice();var a=d.domain(),b=e.clampUp(a[0]),c=e.clampDown(a[1]);return d.domain([b,c]),f},f.ticks=function(){var a=d.ticks.apply(this,arguments);return b.scale.dateTime.tickTransformer(a,e,f.domain())},f.copy=function(){return c(d.copy(),e.copy())},f.discontinuityProvider=function(a){return arguments.length?(e=a,f):e},a.rebind(f,d,"range","rangeRound","interpolate","clamp","tickFormat")}b.scale.dateTime=function(){return c()},b.scale.dateTime.tickTransformer=function(a,b,c){var d=a.map(function(d,e){if(e<a.length-1)return b.clampUp(d);var f=b.clampUp(d);return f<c[1]?f:b.clampDown(d)}),e=d.reduce(function(a,b){return 0===a.filter(function(a){return a.getTime()===b.getTime()}).length&&a.push(b),a},[]);return e}}(d3,fc),function(a,b){"use strict";b.scale.discontinuity.identity=function(){var a={};return a.distance=function(a,b){return b.getTime()-a.getTime()},a.offset=function(a,b){return new Date(a.getTime()+b)},a.clampUp=b.util.fn.identity,a.clampDown=b.util.fn.identity,a.copy=function(){return a},a}}(d3,fc),function(a,b){"use strict";b.scale.discontinuity.skipWeekends=function(){function b(a){return 0===a.getDay()||6===a.getDay()}var c=864e5,d=5*c,e=7*c,f={};return f.clampDown=function(c){if(b(c)){var d=0===c.getDay()?2:1,e=a.time.day.ceil(c);return a.time.day.offset(e,-d)}return c},f.clampUp=function(c){if(b(c)){var d=0===c.getDay()?1:2,e=a.time.day.floor(c);return a.time.day.offset(e,d)}return c},f.distance=function(b,c){b=f.clampUp(b),c=f.clampDown(c);var g=a.time.saturday.ceil(b);if(g>c)return c.getTime()-b.getTime();var h=g.getTime()-b.getTime(),i=a.time.saturday.ceil(c),j=i.getTime()-c.getTime(),k=(i.getTime()-g.getTime())/e;return k*d+h-j},f.offset=function(c,e){var g=b(c)?f.clampUp(c):c,h=e,i=a.time.saturday.ceil(g);if(h-=i.getTime()-g.getTime(),0>h)return new Date(g.getTime()+e);g=a.time.day.offset(i,2);var j=Math.floor(h/d);return g=a.time.day.offset(g,7*j),h-=j*d,g=new Date(g.getTime()+h)},f.copy=function(){return f},f}}(d3,fc),function(a,b){"use strict";b.series.area=function(){var c=b.util.fn.noop,d=a.time.scale(),e=a.scale.linear(),f=a.functor(0),g=function(a,b){return a.close},h=function(a,b){return a.date},i=function(a,b){return d(h(a,b))},j=function(a,b){return e(f(a,b))},k=function(a,b){return e(g(a,b))},l=a.svg.area().defined(function(a,b){return!isNaN(j(a,b))&&!isNaN(k(a,b))}).x(i).y0(j).y1(k),m=function(b){b.each(function(b){var d=a.select(this).selectAll("path.area").data([b]);d.enter().append("path").attr("class","area"),d.attr("d",l),c(d)})};return m.decorate=function(a){return arguments.length?(c=a,m):c},m.xScale=function(a){return arguments.length?(d=a,m):d},m.yScale=function(a){return arguments.length?(e=a,m):e},m.xValue=function(a){return arguments.length?(h=a,m):h},m.y0Value=function(b){return arguments.length?(f=a.functor(b),m):f},m.yValue=m.y1Value=function(a){return arguments.length?(g=a,m):g},a.rebind(m,l,"interpolate","tension")}}(d3,fc),function(a,b){"use strict";b.series.axis=function(){var c=a.svg.axis(),d=a.functor(0),e=b.util.fn.noop,f=a.time.scale(),g=a.scale.linear(),h=function(i){i.each(function(i){var j=a.select(this),k=b.util.simpleDataJoin(j,"axis-adapter",[i]);switch(k.enter().attr("class","axis axis-adapter"),h.orient()){case"top":case"bottom":k.attr("transform","translate(0,"+g(d(i))+")"),c.scale(f);break;case"left":case"right":k.attr("transform","translate("+f(d(i))+",0)"),c.scale(g);break;default:throw new Error("Invalid orientation")}k.call(c),e(k)})};return h.baseline=function(b){return arguments.length?(d=a.functor(b),h):d},h.decorate=function(a){return arguments.length?(e=a,h):e},h.xScale=function(a){return arguments.length?(f=a,h):f},h.yScale=function(a){return arguments.length?(g=a,h):g},a.rebind(h,c,"orient","ticks","tickValues","tickSize","innerTickSize","outerTickSize","tickPadding","tickFormat")}}(d3,fc),function(a,b){"use strict";b.series.bar=function(){var c=b.util.fn.noop,d=a.time.scale(),e=a.scale.linear(),f=function(a,b){return a.close},g=function(a,b){return a.date},h=a.functor(0),i=b.util.fractionalBarWidth(.75),j=function(a,b){return d(g(a,b))},k=function(d){d.each(function(d){var k=a.select(this),l=d.filter(function(a,b){return void 0!==h(a,b)&&void 0!==f(a,b)&&void 0!==g(a,b)}),m=b.util.simpleDataJoin(k,"bar",l,g),n=i(l.map(j)),o=b.svg.bar().x(0).y(0).width(n).height(0),p=function(a,b){return j(a,b)},q=function(a,b){return e(f(a,b))},r=function(a,b){return e(h(a,b))};m.enter().attr("transform",function(a,b){return"translate("+p(a,b)+", "+r(a,b)+")"}).append("path").attr("d",function(a){return o([a])}),m.each(function(b,c){o.height(r(b,c)-q(b,c));var d=a.select(this);a.transition(d).attr("transform","translate("+p(b,c)+", "+q(b,c)+")").select("path").attr("d",o([b]))}),c(m)})};return k.decorate=function(a){return arguments.length?(c=a,k):c},k.xScale=function(a){return arguments.length?(d=a,k):d},k.yScale=function(a){return arguments.length?(e=a,k):e},k.xValue=function(a){return arguments.length?(g=a,k):g},k.y0Value=function(b){return arguments.length?(h=a.functor(b),k):h},k.yValue=k.y1Value=function(a){return arguments.length?(f=a,k):f},k.barWidth=function(b){return arguments.length?(i=a.functor(b),k):i},k}}(d3,fc),function(a,b){"use strict";b.series.candlestick=function(){var c=b.util.fn.noop,d=a.time.scale(),e=a.scale.linear(),f=function(a,b){return a.date},g=function(a,b){return a.open},h=function(a,b){return a.high},i=function(a,b){return a.low},j=function(a,b){return a.close},k=b.util.fractionalBarWidth(.75),l=function(a,b){return d(f(a,b))},m=function(d){d.each(function(d){var m=a.select(this),n=b.util.simpleDataJoin(m,"candlestick",d,f);n.enter().append("path");var o=b.svg.candlestick().width(k(d.map(l)));n.each(function(b,c){var d=j(b,c),f=g(b,c),k=l(b,c),m=e(f),n=e(h(b,c)),p=e(i(b,c)),q=e(d),r=a.select(this).classed({up:d>f,down:f>d}).attr("transform","translate("+k+", "+n+")");o.x(a.functor(0)).open(function(){return m-n}).high(function(){return n-n}).low(function(){return p-n}).close(function(){return q-n}),r.select("path").attr("d",o([b]))}),c(n)})};return m.decorate=function(a){return arguments.length?(c=a,m):c},m.xScale=function(a){return arguments.length?(d=a,m):d},m.yScale=function(a){return arguments.length?(e=a,m):e},m.xValue=function(a){return arguments.length?(f=a,m):f},m.yOpenValue=function(a){return arguments.length?(g=a,m):g},m.yHighValue=function(a){return arguments.length?(h=a,m):h},m.yLowValue=function(a){return arguments.length?(i=a,m):i},m.yValue=m.yCloseValue=function(a){return arguments.length?(j=a,m):j},m.barWidth=function(b){return arguments.length?(k=a.functor(b),m):k},m}}(d3,fc),function(a,b){"use strict";b.series.cycle=function(){var c=b.util.fn.noop,d=a.scale.linear(),e=a.scale.linear(),f=function(a,b){return a.date.getDay()},g=a.scale.linear(),h=b.series.line(),i=b.util.fractionalBarWidth(.75),j=function(j){j.each(function(j){var k=a.select(this),l=a.nest().key(f).map(j),m=Object.keys(l),n=i(m.map(d)),o=n/2,p=b.util.simpleDataJoin(k,"cycle",m);p.each(function(b,c){var f=a.select(this);f.attr("transform","translate("+d(b)+", 0)"),(g.rangeBands||g.range)([-o,o]),h.xScale(g).yScale(e),a.select(this).datum(l[b]).call(h)}),c(p)})};return j.decorate=function(a){return arguments.length?(c=a,j):c},j.xScale=function(a){return arguments.length?(d=a,j):d},j.yScale=function(a){return arguments.length?(e=a,j):e},j.xValue=function(a){return arguments.length?(f=a,j):f},j.subScale=function(a){return arguments.length?(g=a,j):g},j.subSeries=function(a){return arguments.length?(h=a,j):h},j.barWidth=function(b){return arguments.length?(i=a.functor(b),j):i},j}}(d3,fc),function(a,b){"use strict";b.series.line=function(){var c=b.util.fn.noop,d=a.time.scale(),e=a.scale.linear(),f=function(a,b){return a.close},g=function(a,b){return a.date},h=function(a,b){return d(g(a,b))},i=function(a,b){return e(f(a,b))},j=a.svg.line().defined(function(a,b){return!isNaN(i(a,b))}).x(h).y(i),k=function(b){b.each(function(b){var d=a.select(this).selectAll("path.line").data([b]);d.enter().append("path").attr("class","line"),d.attr("d",j),c(d)})};return k.decorate=function(a){return arguments.length?(c=a,k):c},k.xScale=function(a){return arguments.length?(d=a,k):d},k.yScale=function(a){return arguments.length?(e=a,k):e},k.xValue=function(a){return arguments.length?(g=a,k):g},k.yValue=function(a){return arguments.length?(f=a,k):f},a.rebind(k,j,"interpolate","tension")}}(d3,fc),function(a,b){"use strict";b.series.multi=function(){var c=a.time.scale(),d=a.scale.linear(),e=[],f=b.util.fn.context,g=b.util.fn.index,h=b.util.dataJoin().children(!0).selector("g.multi").element("g").attrs({"class":"multi"}).key(function(a,b){var c=this.__series__||a;return g.call(this,c,b)}),i=function(b){b.each(function(b){h(this,e).each(function(e,g){this.__series__=e,(e.xScale||e.x).call(e,c),(e.yScale||e.y).call(e,d),a.select(this).datum(f.call(b,e,g)).call(e)})})};return i.xScale=function(a){return arguments.length?(c=a,i):c},i.yScale=function(a){return arguments.length?(d=a,i):d},i.series=function(a){return arguments.length?(e=a,i):e},i.mapping=function(a){return arguments.length?(f=a,i):f},i.key=function(a){return arguments.length?(g=a,i):g},i}}(d3,fc),function(a,b){"use strict";b.series.ohlc=function(c){var d=b.util.fn.noop,e=a.time.scale(),f=a.scale.linear(),g=function(a,b){return a.date},h=function(a,b){return a.open},i=function(a,b){return a.high},j=function(a,b){return a.low},k=function(a,b){return a.close},l=b.util.fractionalBarWidth(.75),m=function(a,b){return e(g(a,b))},n=function(c){c.each(function(c){var e=a.select(this),n=b.util.simpleDataJoin(e,"ohlc",c,g);n.enter().append("path");var o=b.svg.ohlc().width(l(c.map(m)));n.each(function(b,c){var d=k(b,c),e=h(b,c),g=m(b,c),l=f(e),n=f(i(b,c)),p=f(j(b,c)),q=f(d),r=a.select(this).classed({up:d>e,down:e>d}).attr("transform","translate("+g+", "+n+")");o.x(a.functor(0)).open(function(){return l-n}).high(function(){return n-n}).low(function(){return p-n}).close(function(){return q-n}),r.select("path").attr("d",o([b]))}),d(n)})};return n.decorate=function(a){return arguments.length?(d=a,n):d},n.xScale=function(a){return arguments.length?(e=a,n):e},n.yScale=function(a){return arguments.length?(f=a,n):f},n.xValue=function(a){return arguments.length?(g=a,n):g},n.yOpenValue=function(a){return arguments.length?(h=a,n):h},n.yHighValue=function(a){return arguments.length?(i=a,n):i},n.yLowValue=function(a){return arguments.length?(j=a,n):j},n.yValue=n.yCloseValue=function(a){return arguments.length?(k=a,n):k},n.barWidth=function(b){return arguments.length?(l=a.functor(b),n):l},n}}(d3,fc),function(a,b){"use strict";b.series.point=function(){var c=b.util.fn.noop,d=a.time.scale(),e=a.scale.linear(),f=function(a,b){return a.close},g=function(a,b){return a.date},h=a.functor(5),i=function(i){i.each(function(i){var j=a.select(this),k=b.util.simpleDataJoin(j,"point",i,g);k.enter().append("circle"),k.attr("transform",function(a,b){var c=d(g(a,b)),h=e(f(a,b));return"translate("+c+", "+h+")"}),k.select("circle").attr("r",h),c(k)})};return i.decorate=function(a){return arguments.length?(c=a,i):c},i.xScale=function(a){return arguments.length?(d=a,i):d},i.yScale=function(a){return arguments.length?(e=a,i):e},i.xValue=function(a){return arguments.length?(g=a,i):g},i.yValue=function(a){return arguments.length?(f=a,i):f},i.radius=function(a){return arguments.length?(h=a,i):h},i}}(d3,fc),function(a,b){"use strict";b.series.stackedBar=function(){var c=b.util.fn.noop,d=b.util.fractionalBarWidth(.75),e=a.time.scale(),f=a.scale.linear(),g=function(a,b){return a.y0},h=a.layout.stack(),i=function(d){var i=b.series.bar().xScale(e).yScale(f).xValue(h.x()).yValue(function(a){return g(a)+h.y()(a)}).y0Value(g);d.each(function(b){var d=h(b),e=a.select(this),f=d.map(h.values()),g=e.selectAll("g.stacked-bar").data(f).enter().append("g").attr("class","stacked-bar").call(i);c(g)})};return i.decorate=function(a){return arguments.length?(c=a,i):c},i.barWidth=function(a){return arguments.length?(d=a,i):d},i.xScale=function(a){return arguments.length?(e=a,i):e},i.yScale=function(a){return arguments.length?(f=a,i):f},i.y0Value=function(a){return arguments.length?(g=a,i):g},b.util.rebind(i,h,{xValue:"x",yValue:"y",out:"out",offset:"offset",values:"values",order:"order"})}}(d3,fc),function(a,b){"use strict";b.svg.bar=function(){var b=function(a,b){return a.x},c=function(a,b){return a.y},d=function(a,b){return a.height},e=a.functor(3),f=function(a){return a.map(function(a,f){var g=b(a,f),h=c(a,f),i=d(a,f),j=e(a,f),k=j/2,l="M"+(g-k)+","+h+"h"+j+"V"+i+"h"+-j+"z";return l}).join("")};return f.x=function(c){return arguments.length?(b=a.functor(c),f):b},f.y=function(b){return arguments.length?(c=a.functor(b),f):c},f.width=function(b){return arguments.length?(e=a.functor(b),f):e},f.height=function(b){return arguments.length?(d=a.functor(b),f):d},f}}(d3,fc),function(a,b){"use strict";b.svg.candlestick=function(){var b=function(a,b){return a.date},c=function(a,b){return a.open},d=function(a,b){return a.high},e=function(a,b){return a.low},f=function(a,b){return a.close},g=a.functor(3),h=function(a){return a.map(function(a,h){var i=b(a,h),j=c(a,h),k=d(a,h),l=e(a,h),m=f(a,h),n=g(a,h),o="M"+(i-n/2)+","+j+"h"+n+"V"+m+"h"+-n+"V"+j+"z",p="M"+i+","+Math.min(m,j)+"V"+k,q="M"+i+","+Math.max(m,j)+"V"+l;return o+p+q}).join("")};return h.x=function(a){return arguments.length?(b=a,h):b},h.open=function(a){return arguments.length?(c=a,h):c},h.high=function(a){return arguments.length?(d=a,h):d},h.low=function(a){return arguments.length?(e=a,h):e},h.close=function(a){return arguments.length?(f=a,h):f},h.width=function(b){return arguments.length?(g=a.functor(b),h):g},h}}(d3,fc),function(a,b){"use strict";b.svg.ohlc=function(){var b=function(a,b){return a.date},c=function(a,b){return a.open},d=function(a,b){return a.high},e=function(a,b){return a.low},f=function(a,b){return a.close},g=a.functor(3),h=function(a){return a.map(function(a,h){var i=b(a,h),j=c(a,h),k=d(a,h),l=e(a,h),m=f(a,h),n=g(a,h)/2,o="M"+i+","+l,p="V"+k,q="M"+i+","+j+"h"+-n,r="M"+i+","+m+"h"+n;return o+p+q+r}).join("")};return h.x=function(a){return arguments.length?(b=a,
h):b},h.open=function(a){return arguments.length?(c=a,h):c},h.high=function(a){return arguments.length?(d=a,h):d},h.low=function(a){return arguments.length?(e=a,h):e},h.close=function(a){return arguments.length?(f=a,h):f},h.width=function(b){return arguments.length?(g=a.functor(b),h):g},h}}(d3,fc),function(a,b){"use strict";b.tool.crosshair=function(){function c(a){return a.rangeExtent?a.rangeExtent():a.range()}function d(b){return a.scale.identity().range(c(b))}function e(){var b=a.mouse(this),c=a.select(this).on("mousemove.crosshair",f).on("mouseleave.crosshair",g),d=k.apply(this,b),e=c.datum();e.push(d),c.call(r),h.trackingstart.apply(this,arguments)}function f(){var b=a.mouse(this),c=a.select(this),d=k.apply(this,b),e=c.datum();e[e.length-1]=d,c.call(r),h.trackingmove.apply(this,arguments)}function g(){var b=a.select(this),c=b.datum();c.pop(),b.call(r).on("mousemove.crosshair",null).on("mouseleave.crosshair",null),h.trackingend.apply(this,arguments)}var h=a.dispatch("trackingstart","trackingmove","trackingend"),i=a.time.scale(),j=a.scale.linear(),k=function(a,c){return b.util.noSnap(i,j)(a,c)},l=b.util.fn.noop,m=function(a){return a.xInDomainUnits?i(a.x):a.x},n=function(a){return a.yInDomainUnits?j(a.y):a.y},o=b.util.dataJoin().children(!0).selector("g.crosshair").element("g").attrs({"class":"crosshair"}),p=b.annotation.line().value(n).label(function(a){return a.y}),q=b.annotation.line().orient("vertical").value(m).label(function(a){return a.x}),r=function(f){f.each(function(f){var g=a.select(this).style("pointer-events","all").on("mouseenter.crosshair",e),h=g.selectAll("rect").data([f]);h.enter().append("rect").style("visibility","hidden"),g.select("rect").attr("x",c(i)[0]).attr("y",c(j)[1]).attr("width",c(i)[1]).attr("height",c(j)[0]);var k=o(g,f),r=function(a){return"translate("+m(a)+", "+n(a)+")"};k.enter().style("pointer-events","none").append("g").classed("trackball",!0).attr("transform",r).append("circle").attr("r",5),k.select("g.trackball").attr("transform",r);var s=b.series.multi().series([p,q]).xScale(d(i)).yScale(d(j)).mapping(function(){return[this]});k.call(s),l(k)})};return r.xScale=function(a){return arguments.length?(i=a,r):i},r.yScale=function(a){return arguments.length?(j=a,r):j},r.snap=function(a){return arguments.length?(k=a,r):k},r.decorate=function(a){return arguments.length?(l=a,r):l},a.rebind(r,h,"on"),b.util.rebind(r,p,{yLabel:"label"}),b.util.rebind(r,q,{xLabel:"label"}),r}}(d3,fc),function(a,b){"use strict";b.tool.fibonacciFan=function(){function c(){var b=a.select(this),c=b.datum()[0];if("DONE"!==c.state){var d=a.mouse(this),e=k.apply(this,d);if("SELECT_SOURCE"===c.state)c.source=c.target=e;else{if("SELECT_TARGET"!==c.state)throw new Error("Unknown state "+c.state);c.target=e}}}function d(){var b=a.select(this).on("click.fan",g).on("mousemove.fan",e).on("mouseleave.fan",f),d=b.datum();null==d[0]&&d.push({state:"SELECT_SOURCE"}),c.call(this),b.call(o)}function e(){var b=a.select(this);c.call(this),b.call(o)}function f(){var b=a.select(this),c=b.datum();null!=c[0]&&"SELECT_SOURCE"===c[0].state&&c.pop(),b.on("click.fan",null).on("mousemove.fan",null).on("mouseleave.fan",null)}function g(){var b=a.select(this),d=b.datum()[0];switch(d.state){case"SELECT_SOURCE":c.call(this),h.fansource.apply(this,arguments),d.state="SELECT_TARGET";break;case"SELECT_TARGET":c.call(this),h.fantarget.apply(this,arguments),d.state="DONE";break;case"DONE":h.fanclear.apply(this,arguments),d.state="SELECT_SOURCE",c.call(this);break;default:throw new Error("Unknown state "+d.state)}b.call(o)}var h=a.dispatch("fansource","fantarget","fanclear"),i=a.time.scale(),j=a.scale.linear(),k=function(a,c){return b.util.noSnap(i,j)(a,c)},l=b.util.fn.noop,m=function(a){return a.xInDomainUnits?i(a.x):a.x},n=function(a){return a.yInDomainUnits?j(a.y):a.y},o=function(c){c.each(function(c){var e=a.select(this).style("pointer-events","all").on("mouseenter.fan",d),f=e.selectAll("rect").data([c]);f.enter().append("rect").style("visibility","hidden"),e.select("rect").attr("x",i.range()[0]).attr("y",j.range()[1]).attr("width",i.range()[1]).attr("height",j.range()[0]);var g=b.util.simpleDataJoin(e,"fan",c);g.each(function(a){if(a.x=i.range()[1],a.ay=a.by=a.cy=n(a.target),m(a.source)!==m(a.target)){if("DONE"===a.state&&m(a.source)>m(a.target)){var b=a.source;a.source=a.target,a.target=b}var c=(n(a.target)-n(a.source))/(m(a.target)-m(a.source)),d=a.x-m(a.source),e=c*d;a.ay=.618*e+n(a.source),a.by=.5*e+n(a.source),a.cy=.382*e+n(a.source)}});var h=g.enter();h.append("line").attr("class","trend"),h.append("line").attr("class","a"),h.append("line").attr("class","b"),h.append("line").attr("class","c"),h.append("polygon").attr("class","area"),g.select("line.trend").attr("x1",function(a){return m(a.source)}).attr("y1",function(a){return n(a.source)}).attr("x2",function(a){return m(a.target)}).attr("y2",function(a){return n(a.target)}),g.select("line.a").attr("x1",function(a){return m(a.source)}).attr("y1",function(a){return n(a.source)}).attr("x2",function(a){return a.x}).attr("y2",function(a){return a.ay}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}),g.select("line.b").attr("x1",function(a){return m(a.source)}).attr("y1",function(a){return n(a.source)}).attr("x2",function(a){return a.x}).attr("y2",function(a){return a.by}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}),g.select("line.c").attr("x1",function(a){return m(a.source)}).attr("y1",function(a){return n(a.source)}).attr("x2",function(a){return a.x}).attr("y2",function(a){return a.cy}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}),g.select("polygon.area").attr("points",function(a){return m(a.source)+","+n(a.source)+" "+a.x+","+a.ay+" "+a.x+","+a.cy}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}),l(g)})};return o.xScale=function(a){return arguments.length?(i=a,o):i},o.yScale=function(a){return arguments.length?(j=a,o):j},o.snap=function(a){return arguments.length?(k=a,o):k},o.decorate=function(a){return arguments.length?(l=a,o):l},a.rebind(o,h,"on"),o}}(d3,fc),function(a,b){"use strict";b.tool.measure=function(){function c(){var b=a.select(this),c=b.datum()[0];if("DONE"!==c.state){var d=a.mouse(this),e=k.apply(this,d);if("SELECT_SOURCE"===c.state)c.source=c.target=e;else{if("SELECT_TARGET"!==c.state)throw new Error("Unknown state "+c.state);c.target=e}}}function d(){var b=a.select(this).on("click.measure",g).on("mousemove.measure",e).on("mouseleave.measure",f),d=b.datum();null==d[0]&&d.push({state:"SELECT_SOURCE"}),c.call(this),b.call(r)}function e(){var b=a.select(this);c.call(this),b.call(r)}function f(){var b=a.select(this),c=b.datum();null!=c[0]&&"SELECT_SOURCE"===c[0].state&&c.pop(),b.on("click.measure",null).on("mousemove.measure",null).on("mouseleave.measure",null)}function g(){var b=a.select(this),d=b.datum()[0];switch(d.state){case"SELECT_SOURCE":c.call(this),h.measuresource.apply(this,arguments),d.state="SELECT_TARGET";break;case"SELECT_TARGET":c.call(this),h.measuretarget.apply(this,arguments),d.state="DONE";break;case"DONE":h.measureclear.apply(this,arguments),d.state="SELECT_SOURCE",c.call(this);break;default:throw new Error("Unknown state "+d.state)}b.call(r)}var h=a.dispatch("measuresource","measuretarget","measureclear"),i=a.time.scale(),j=a.scale.linear(),k=function(a,c){return b.util.noSnap(i,j)(a,c)},l=b.util.fn.noop,m=a.functor(""),n=a.functor(""),o=a.functor(2),p=function(a){return a.xInDomainUnits?i(a.x):a.x},q=function(a){return a.yInDomainUnits?j(a.y):a.y},r=function(c){c.each(function(c){var e=a.select(this).style("pointer-events","all").on("mouseenter.measure",d),f=e.selectAll("rect").data([c]);f.enter().append("rect").style("visibility","hidden"),e.select("rect").attr("x",i.range()[0]).attr("y",j.range()[1]).attr("width",i.range()[1]).attr("height",j.range()[0]);var g=b.util.simpleDataJoin(e,"measure",c),h=g.enter();h.append("line").attr("class","tangent"),h.append("line").attr("class","horizontal"),h.append("line").attr("class","vertical"),h.append("text").attr("class","horizontal"),h.append("text").attr("class","vertical"),g.select("line.tangent").attr("x1",function(a){return p(a.source)}).attr("y1",function(a){return q(a.source)}).attr("x2",function(a){return p(a.target)}).attr("y2",function(a){return q(a.target)}),g.select("line.horizontal").attr("x1",function(a){return p(a.source)}).attr("y1",function(a){return q(a.source)}).attr("x2",function(a){return p(a.target)}).attr("y2",function(a){return q(a.source)}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}),g.select("line.vertical").attr("x1",function(a){return p(a.target)}).attr("y1",function(a){return q(a.target)}).attr("x2",function(a){return p(a.target)}).attr("y2",function(a){return q(a.source)}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"});var k=o.apply(this,arguments);g.select("text.horizontal").attr("x",function(a){return p(a.source)+(p(a.target)-p(a.source))/2}).attr("y",function(a){return q(a.source)-k}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}).text(m),g.select("text.vertical").attr("x",function(a){return p(a.target)+k}).attr("y",function(a){return q(a.source)+(q(a.target)-q(a.source))/2}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}).text(n),l(g)})};return r.xScale=function(a){return arguments.length?(i=a,r):i},r.yScale=function(a){return arguments.length?(j=a,r):j},r.snap=function(a){return arguments.length?(k=a,r):k},r.decorate=function(a){return arguments.length?(l=a,r):l},r.xLabel=function(b){return arguments.length?(m=a.functor(b),r):m},r.yLabel=function(b){return arguments.length?(n=a.functor(b),r):n},r.padding=function(b){return arguments.length?(o=a.functor(b),r):o},a.rebind(r,h,"on"),r}}(d3,fc),function(a,b){"use strict";var c=1e-6;b.util.dataJoin=function(){var d="g",e=!1,f="g",g={},h=b.util.fn.index,i=function(b,i){b instanceof a.selection||(b=a.select(b));var j=b.selectAll(d);e&&(j=j.filter(function(){return this.parentNode===b.node()}));var k=j.data(i,h),l=k.enter().append(f).attr(g).style("opacity",c),m=a.transition(k.exit()).style("opacity",c).remove();return k=a.transition(k).style("opacity",1),k.enter=a.functor(l),k.exit=a.functor(m),k};return i.selector=function(a){return arguments.length?(d=a,i):d},i.children=function(a){return arguments.length?(e=a,i):e},i.element=function(a){return arguments.length?(f=a,i):f},i.attrs=function(a){return arguments.length?(g=a,i):g},i.key=function(a){return arguments.length?(h=a,i):h},i}}(d3,fc),function(a,b){"use strict";b.util.extent=function(b,c){return Array.isArray(b[0])||(b=[b]),Array.isArray(c)||(c=[c]),"function"!=typeof c[0]&&(c=c.map(function(a){return function(b){return b[a]}})),[a.min(b,function(b){return a.min(b,function(b){return a.min(c.map(function(a){return a(b)}))})}),a.max(b,function(b){return a.max(b,function(b){return a.max(c.map(function(a){return a(b)}))})})]}}(d3,fc),function(a,b){"use strict";b.util.fn={context:function(){return this},identity:function(a){return a},index:function(a,b){return b},noop:function(a){}}}(d3,fc),function(a,b){"use strict";b.util.fractionalBarWidth=function(b){return function(c){if(c.length<=1)return 10;c.sort();var d=a.pairs(c).map(function(a){return Math.abs(a[0]-a[1])}),e=a.min(d);return b*e}}}(d3,fc),function(a,b){"use strict";b.util.innerDimensions=function(a){var b=getComputedStyle(a);return{width:parseFloat(b.width)-parseFloat(b.paddingLeft)-parseFloat(b.paddingRight),height:parseFloat(b.height)-parseFloat(b.paddingTop)-parseFloat(b.paddingBottom)}}}(d3,fc),function(a,b){"use strict";b.util.rebind=function(b,c,d){return"object"!=typeof d?a.rebind.apply(a,arguments):(Object.keys(d).forEach(function(a){var e=c[d[a]];if("function"!=typeof e)throw new Error("The method "+d[a]+" does not exist on the source object");b[a]=function(){var a=e.apply(c,arguments);return a===c?b:a}}),b)}}(d3,fc),function(a,b){"use strict";b.util.simpleDataJoin=function(c,d,e,f){var g=1e-6,h=c.selectAll("g."+d).data(e,f||b.util.fn.index),i=h.enter().append("g").classed(d,!0).style("opacity",g),j=a.transition(h.exit()).style("opacity",g).remove();return h=a.transition(h).style("opacity",1),h.enter=a.functor(i),h.exit=a.functor(j),h}}(d3,fc),function(a,b){"use strict";b.util.noSnap=function(a,b){return function(c,d){var e={xInDomainUnits:!1,x:c,yInDomainUnits:!1,y:d};return a.invert&&(e.xInDomainUnits=!0,e.x=a.invert(c)),b.invert&&(e.yInDomainUnits=!0,e.y=b.invert(d)),e}},b.util.pointSnap=function(a,b,c,d,e,f){return f=f||function(a,b,c,d){var e=a-c,f=b-d;return Math.sqrt(e*e+f*f)},function(g,h){var i=e.map(function(e){var i=f(g,h,a(c(e)),b(d(e)));return[i,e]}).reduce(function(a,b){return a[0]>b[0]?b:a},[Number.MAX_VALUE,null])[1];return{datum:i,x:i?c(i):g,xInDomainUnits:Boolean(i),y:i?d(i):h,yInDomainUnits:Boolean(i)}}},b.util.seriesPointSnapXOnly=function(a,c){function d(a,b,c,d){var e=a-c;return Math.abs(e)}return b.util.seriesPointSnap(a,c,d)},b.util.seriesPointSnapYOnly=function(a,c){function d(a,b,c,d){var e=b-d;return Math.abs(e)}return b.util.seriesPointSnap(a,c,d)},b.util.seriesPointSnap=function(a,c,d){return function(e,f){var g=a.xScale(),h=a.yScale(),i=a.xValue(),j=(a.yValue||a.yCloseValue).call(a);return b.util.pointSnap(g,h,i,j,c,d)(e,f)}}}(d3,fc);
!function(){"use strict";var a="0.3.3",b=null;b=(1,eval)("this"),b.fc={annotation:{},chart:{},data:{feed:{},random:{}},indicator:{algorithm:{calculator:{}},renderer:{}},scale:{discontinuity:{}},series:{stacked:{}},svg:{},tool:{},util:{},version:a}}(),function(a,b){"use strict";b.annotation.band=function(){function c(a){return a.rangeExtent?a.rangeExtent():a.range()}var d,e,f,g,h=a.time.scale(),i=a.scale.linear(),j=function(){return c(h)[0]},k=function(){return c(h)[1]},l=function(){return c(i)[0]},m=function(){return c(i)[1]},n=b.util.fn.noop,o=b.util.dataJoin().selector("g.annotation").element("g").attrs({"class":"annotation"}),p=function(c){c.each(function(c,d){var e=a.select(this),f=o(e,c);f.enter().append("path").classed("band",!0);var g=b.svg.bar().align("right").x(j).y(l).height(function(){return m.apply(this,arguments)-l.apply(this,arguments)}).width(function(){return k.apply(this,arguments)-j.apply(this,arguments)});f.select("path").attr("d",function(a,b){return g.call(this,[a],b)}),n(f,c,d)})};return p.xScale=function(a){return arguments.length?(h=a,p):h},p.yScale=function(a){return arguments.length?(i=a,p):i},p.decorate=function(a){return arguments.length?(n=a,p):n},p.x0=function(b){return arguments.length?(d=a.functor(b),j=function(){return h(d.apply(this,arguments))},p):d},p.x1=function(b){return arguments.length?(e=a.functor(b),k=function(){return h(e.apply(this,arguments))},p):e},p.y0=function(b){return arguments.length?(f=a.functor(b),l=function(){return i(f.apply(this,arguments))},p):f},p.y1=function(b){return arguments.length?(g=a.functor(b),m=function(){return i(g.apply(this,arguments))},p):g},p}}(d3,fc),function(a,b){"use strict";b.annotation.gridline=function(){var c=a.time.scale(),d=a.scale.linear(),e=10,f=10,g=b.util.fn.noop,h=b.util.fn.noop,i=b.util.dataJoin().selector("line.x").element("line").attrs({"class":"x gridline"}),j=b.util.dataJoin().selector("line.y").element("line").attrs({"class":"y gridline"}),k=function(a){a.each(function(a,b){var k=c.ticks(e),l=i(this,k);l.attr({x1:c,x2:c,y1:d.range()[0],y2:d.range()[1]}),g(l,k,b);var m=d.ticks(f),n=j(this,m);n.attr({x1:c.range()[0],x2:c.range()[1],y1:d,y2:d}),h(n,m,b)})};return k.xScale=function(a){return arguments.length?(c=a,k):c},k.yScale=function(a){return arguments.length?(d=a,k):d},k.xTicks=function(a){return arguments.length?(e=a,k):e},k.yTicks=function(a){return arguments.length?(f=a,k):f},k.yDecorate=function(a){return arguments.length?(h=a,k):h},k.xDecorate=function(a){return arguments.length?(g=a,k):g},k}}(d3,fc),function(a,b){"use strict";b.annotation.line=function(){var c=a.time.scale(),d=a.scale.linear(),e=b.util.fn.identity,f=b.util.fn.index,g=e,h=b.util.fn.noop,i="horizontal",j=b.util.dataJoin().selector("g.annotation").element("g").attrs({"class":"annotation"}),k=function(b){b.each(function(b,f){function k(a){return a.rangeExtent?a.rangeExtent():a.range()}var l,m,n,o,p,q,r={x:-5,y:-5};switch(i){case"horizontal":n=function(a,b){return"translate("+a+", "+b+")"},o="x2",m=c,l=d,p="left-handle",q="right-handle";break;case"vertical":n=function(a,b){return"translate("+b+", "+a+")"},o="y2",m=d,l=c,r.transform="rotate(-90)",p="bottom-handle",q="top-handle";break;default:throw new Error("Invalid orientation")}var s=k(m),t=function(a){var b=l(e(a));return n(s[0],b)},u=s[1]-s[0],v=a.select(this),w=j(v,b),x=w.enter().attr("transform",t);x.append("line").attr(o,u),x.append("g").classed(p,!0),x.append("g").classed(q,!0).attr("transform",n(u,0)).append("text").attr(r),w.attr("transform",t),w.select("line").attr(o,u),w.select("g."+q).attr("transform",n(u,0)),w.select("text").text(g),h(w,b,f)})};return k.xScale=function(a){return arguments.length?(c=a,k):c},k.yScale=function(a){return arguments.length?(d=a,k):d},k.value=function(b){return arguments.length?(e=a.functor(b),k):e},k.keyValue=function(b){return arguments.length?(f=a.functor(b),k):f},k.label=function(b){return arguments.length?(g=a.functor(b),k):g},k.decorate=function(a){return arguments.length?(h=a,k):h},k.orient=function(a){return arguments.length?(i=a,k):i},k}}(d3,fc),function(a,b){"use strict";b.chart.legend=function(){var c=b.util.fn.noop,d=b.util.fn.noop,e=[["datum",function(a){return a.datum}]],f=b.util.dataJoin().selector("table.legend").element("table").attrs({"class":"legend"}),g=b.util.dataJoin().selector("tr.row").element("tr").attrs({"class":"row"}),h=function(b){b.each(function(b,h){var i=a.select(this),j=e.map(function(c,d){return{datum:b,header:a.functor(c[0]),value:a.functor(c[1])}}),k=f(i,[j]),l=g(k),m=l.enter();m.append("th"),m.append("td"),l.select("th").html(function(a,b){return a.header.call(this,a.datum,b)}),l.select("td").html(function(a,b){return a.value.call(this,a.datum,b)}),c(k,b,h),d(l,b,h)})};return h.items=function(a){return arguments.length?(e=a,h):e},h.rowDecorate=function(a){return arguments.length?(d=a,h):d},h.tableDecorate=function(a){return arguments.length?(c=a,h):c},h}}(d3,fc),function(a,b){"use strict";b.chart.linearTimeSeries=function(){var c=20,d=b.series.line(),e=b.scale.dateTime(),f=a.scale.linear(),g=a.svg.axis().scale(e).orient("bottom"),h=a.svg.axis().scale(f).orient("left"),i=function(b){b.each(function(b){var i=a.select(this),j={position:"absolute",top:0,right:0,bottom:c,left:0},k=i.selectAll("rect.background").data([b]);k.enter().append("rect").attr("class","background").layout(j);var l=i.selectAll("svg.plot-area").data([b]);l.enter().append("svg").attr({"class":"plot-area"}).layout(j);var m=i.selectAll("g.x-axis").data([b]);m.enter().append("g").attr("class","axis x-axis").layout({position:"absolute",left:0,bottom:0,right:0,height:c});var n=i.selectAll("g.y-axis").data([b]);n.enter().append("g").attr("class","axis y-axis").layout({position:"absolute",top:0,right:0,bottom:c}),i.layout(),e.range([0,m.layout("width")]),f.range([n.layout("height"),0]),m.call(g),n.call(h),d.xScale(e).yScale(f),l.call(d)})};return b.util.rebind(i,e,{xDiscontinuityProvider:"discontinuityProvider",xDomain:"domain",xNice:"nice"}),b.util.rebind(i,f,{yDomain:"domain",yNice:"nice"}),b.util.rebind(i,g,{xTicks:"ticks",xTickValues:"tickValues",xTickSize:"tickSize",xInnerTickSize:"innerTickSize",xOuterTickSize:"outerTickSize",xTickPadding:"tickPadding",xTickFormat:"tickFormat",xOrient:"orient"}),b.util.rebind(i,h,{yTicks:"ticks",yTickValues:"tickValues",yTickSize:"tickSize",yInnerTickSize:"innerTickSize",yOuterTickSize:"outerTickSize",yTickPadding:"tickPadding",yTickFormat:"tickFormat",yOrient:"orient"}),i.xScale=function(){return e},i.yScale=function(){return f},i.plotArea=function(a){return arguments.length?(d=a,i):d},i.xAxisHeight=function(a){return arguments.length?(c=a,i):c},i}}(d3,fc),function(a,b){"use strict";b.chart.sparkline=function(){function c(b){function c(a){return b.filter(function(b){return e(b)===a})[0]}var d=j.xValue(),e=j.yValue(),f=a.max(b,e),g=a.min(b,e);return[{x:d(b[0]),y:e(b[0])},{x:d(c(f)),y:f},{x:d(c(g)),y:g},{x:d(b[b.length-1]),y:e(b[b.length-1])}]}var d=b.scale.dateTime(),e=a.scale.linear(),f=2,g=b.series.line(),h=b.series.point().xValue(function(a){return a.x}).yValue(function(a){return a.y}).decorate(function(a){a.attr("class",function(a,b){switch(b){case 0:return"open";case 1:return"high";case 2:return"low";case 3:return"close"}})}),i=b.series.multi().series([g,h]).mapping(function(a){switch(a){case h:return c(this);default:return this}}),j=function(c){h.radius(f),c.each(function(c){var g=a.select(this),h=b.util.innerDimensions(this),j=f;d.range([j,h.width-j]),e.range([h.height-j,j]),i.xScale(d).yScale(e),g.call(i)})};return b.util.rebind(j,d,{xDiscontinuityProvider:"discontinuityProvider",xDomain:"domain"}),b.util.rebind(j,e,{yDomain:"domain"}),b.util.rebind(j,g,"xValue","yValue"),j.xScale=function(){return d},j.yScale=function(){return e},j.radius=function(a){return arguments.length?(f=a,j):f},j}}(d3,fc),function(a){"use strict";a.data.feed.coinbase=function(){var a="BTC-USD",b=null,c=null,d=null,e=function(e){var f=[];null!=b&&f.push("start="+b.toISOString()),null!=c&&f.push("end="+c.toISOString()),null!=d&&f.push("granularity="+d);var g="https://api.exchange.coinbase.com/products/"+a+"/candles?"+f.join("&");d3.json(g,function(a,b){return a?void e(a):(b=b.map(function(a){return{date:new Date(1e3*a[0]),open:a[3],high:a[2],low:a[1],close:a[4],volume:a[5]}}),void e(a,b))})};return e.product=function(b){return arguments.length?(a=b,e):a},e.start=function(a){return arguments.length?(b=a,e):b},e.end=function(a){return arguments.length?(c=a,e):c},e.granularity=function(a){return arguments.length?(d=a,e):d},e}}(fc),function(a){"use strict";a.data.random.financial=function(){var b=.1,c=.1,d=100,e=1e5,f=new Date,g=50,h=.3,i=function(a){return!(0===a.getDay()||6===a.getDay())},j=function(a,b,c){for(var d,e=[],h=0,i=0;e.length<a;)d=b.slice(i,i+g),e.push({date:new Date(f.getTime()),open:d[0],high:Math.max.apply({},d),low:Math.min.apply({},d),close:d[g-1],volume:c[h]}),i+=g,h+=1,f.setUTCDate(f.getUTCDate()+1);return e},k=function(k){var l=new Date(f.getTime());l.setUTCDate(f.getUTCDate()+k);var m=315569e5,n=(l.getTime()-f.getTime())/m,o=a.data.random.walk(n,k*g,b,c,d),p=a.data.random.walk(n,k,0,c,e);return p=p.map(function(a){var b=Math.min(0,Math.max(h,1)),c=1+b*(1-2*Math.random());return Math.floor(a*c)}),d=o[o.length-1],e=p[p.length-1],j(k,o,p).filter(function(a){return!i||i(a.date)})};return k.mu=function(a){return arguments.length?(b=a,k):b},k.sigma=function(a){return arguments.length?(c=a,k):c},k.startPrice=function(a){return arguments.length?(d=a,k):d},k.startVolume=function(a){return arguments.length?(e=a,k):e},k.startDate=function(a){return arguments.length?(f=a,k):f},k.stepsPerDay=function(a){return arguments.length?(g=a,k):g},k.volumeNoiseFactor=function(a){return arguments.length?(h=a,k):h},k.filter=function(a){return arguments.length?(i=a,k):i},k}}(fc),function(a,b){"use strict";b.data.random.walk=function(b,c,d,e,f){var g,h,i=a.random.normal(),j=b/c,k=new Array(c+1);for(h=1;h<k.length;h+=1)g=i(),g*=Math.sqrt(j),g*=e,g+=(d-e*e/2)*j,k[h]=Math.exp(g);for(k[0]=f,h=1;h<k.length;h+=1)k[h]=k[h-1]*k[h];return k}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.bollingerBands=function(){var c=b.indicator.algorithm.calculator.bollingerBands().value(function(a){return a.close}),d=b.indicator.algorithm.merge().algorithm(c).merge(function(a,b){a.bollingerBands=b}),e=function(a){return d(a)};return e.root=function(a){return a.bollingerBands},a.rebind(e,d,"merge"),a.rebind(e,c,"windowSize","value","multiplier"),e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.bollingerBands=function(){var c=2,d=b.indicator.algorithm.calculator.slidingWindow().undefinedValue({upper:void 0,average:void 0,lower:void 0}).accumulator(function(b){var d=a.mean(b),e=a.deviation(b);return{upper:d+c*e,average:d,lower:d-c*e}}),e=function(a){return d(a)};return e.multiplier=function(a){return arguments.length?(c=a,e):c},a.rebind(e,d,"windowSize","value"),e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.exponentialMovingAverage=function(){var a=9,c=b.util.fn.identity,d=function(b){var d,e=2/(a+1),f=0;return b.map(function(b,g){if(a-1>g)return void(f+=c(b,g));if(g===a-1){f+=c(b,g);var h=f/a;return d=h,h}var i=c(b,g)*e+(1-e)*d;return d=i,i})};return d.windowSize=function(b){return arguments.length?(a=b,d):a},d.value=function(a){return arguments.length?(c=a,d):c},d}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.macd=function(){var c=b.util.fn.identity,d=b.indicator.algorithm.calculator.exponentialMovingAverage().windowSize(12),e=b.indicator.algorithm.calculator.exponentialMovingAverage().windowSize(29),f=b.indicator.algorithm.calculator.exponentialMovingAverage().windowSize(9),g=b.indicator.algorithm.calculator.undefinedInputAdapter().algorithm(f),h=function(b){d.value(c),e.value(c);var f=a.zip(d(b),e(b)).map(function(a){return void 0!==a[0]&&void 0!==a[1]?a[0]-a[1]:void 0}),h=g(f),i=a.zip(f,h).map(function(a){return{macd:a[0],signal:a[1],divergence:void 0!==a[0]&&void 0!==a[1]?a[0]-a[1]:void 0}});return i};return h.value=function(a){return arguments.length?(c=a,h):c},b.util.rebind(h,d,{fastPeriod:"windowSize"}),b.util.rebind(h,e,{slowPeriod:"windowSize"}),b.util.rebind(h,f,{signalPeriod:"windowSize"}),h}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.percentageChange=function(){var c=a.functor(0),d=b.util.fn.identity,e=function(a){if(0===a.length)return[];var b=d(a[c(a)]);return a.map(function(a,c){return(d(a,c)-b)/b})};return e.baseIndex=function(b){return arguments.length?(c=a.functor(b),e):c},e.value=function(a){return arguments.length?(d=a,e):d},e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.relativeStrengthIndex=function(){var c=function(a,b){return a.open},d=function(a,b){return a.close},e=function(a){for(var b=1/a.length,c=a[0],d=1,e=a.length;e>d;d++)c=b*a[d]+(1-b)*c;return c},f=b.indicator.algorithm.calculator.slidingWindow().windowSize(14).accumulator(function(a){for(var b=[],f=[],g=0,h=a.length;h>g;g++){var i=a[g],j=c(i),k=d(i);b.push(j>k?j-k:0),f.push(k>j?k-j:0)}var l=e(b);if(0===l)return 100;var m=e(f)/l;return 100-100/(1+m)}),g=function(a){return f(a)};return g.openValue=function(a){return arguments.length?(c=a,g):c},g.closeValue=function(a){return arguments.length?(d=a,g):d},a.rebind(g,f,"windowSize"),g}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.slidingWindow=function(){var c=a.functor(void 0),d=a.functor(10),e=b.util.fn.noop,f=b.util.fn.identity,g=function(a){var b=d.apply(this,arguments),g=a.slice(0,b).map(f);return a.map(function(a,d){return b-1>d?c(a,d):(d>=b&&(g.shift(),g.push(f(a,d))),e(g))})};return g.undefinedValue=function(b){return arguments.length?(c=a.functor(b),g):c},g.windowSize=function(b){return arguments.length?(d=a.functor(b),g):d},g.accumulator=function(a){return arguments.length?(e=a,g):e},g.value=function(a){return arguments.length?(f=a,g):f},g}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.calculator.undefinedInputAdapter=function(){function c(a){return Array.apply(null,new Array(a)).map(e)}var d=b.indicator.algorithm.calculator.slidingWindow().accumulator(a.mean),e=a.functor(void 0),f=function(a){return void 0===a},g=function(a){for(var b=0;f(a[b])&&b<a.length;)b++;var e=a.slice(b);return c(b).concat(d(e))};return g.algorithm=function(a){return arguments.length?(d=a,g):d},g.undefinedValue=function(b){return arguments.length?(e=a.functor(b),g):e},g.defined=function(a){return arguments.length?(f=a,g):f},g}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.exponentialMovingAverage=function(){var c=b.indicator.algorithm.calculator.slidingWindow().accumulator(a.mean).value(function(a){return a.close}),d=b.indicator.algorithm.merge().algorithm(c).merge(function(a,b){a.exponentialMovingAverage=b}),e=function(a){return d(a)};return a.rebind(e,d,"merge"),a.rebind(e,c,"windowSize","value"),e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.macd=function(){var c=b.indicator.algorithm.calculator.macd().value(function(a){return a.close}),d=b.indicator.algorithm.merge().algorithm(c).merge(function(a,b){a.macd=b}),e=function(a){return d(a)};return a.rebind(e,d,"merge"),a.rebind(e,c,"fastPeriod","slowPeriod","signalPeriod","value"),e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.merge=function(){var c=b.util.fn.noop,d=b.indicator.algorithm.calculator.slidingWindow(),e=function(b){return a.zip(b,d(b)).forEach(function(a){c(a[0],a[1])})};return e.algorithm=function(a){return arguments.length?(d=a,e):d},e.merge=function(a){return arguments.length?(c=a,e):c},e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.movingAverage=function(){var c=b.indicator.algorithm.calculator.slidingWindow().accumulator(a.mean).value(function(a){return a.close}),d=b.indicator.algorithm.merge().algorithm(c).merge(function(a,b){a.movingAverage=b}),e=function(a){return d(a)};return a.rebind(e,d,"merge"),a.rebind(e,c,"windowSize","undefinedValue","value"),e}}(d3,fc),function(a,b){"use strict";b.indicator.algorithm.relativeStrengthIndex=function(){var c=b.indicator.algorithm.calculator.relativeStrengthIndex(),d=b.indicator.algorithm.merge().algorithm(c).merge(function(a,b){a.rsi=b}),e=function(a){return d(a)};return a.rebind(e,d,"merge"),a.rebind(e,c,"windowSize","openValue","closeValue"),e}}(d3,fc),function(a,b){"use strict";b.indicator.renderer.bollingerBands=function(){var c=a.time.scale(),d=a.scale.linear(),e=function(a,b){return a.close},f=function(a,b){return a.date},g=function(a){return a.bollingerBands},h=b.series.area().y0Value(function(a,b){return g(a).upper}).y1Value(function(a,b){return g(a).lower}),i=b.series.line().yValue(function(a,b){return g(a).upper}),j=b.series.line().yValue(function(a,b){return g(a).average}),k=b.series.line().yValue(function(a,b){return g(a).lower}),l=function(a){var e=b.series.multi().xScale(c).yScale(d).series([h,i,k,j]).decorate(function(a){a.enter().attr("class",function(a,b){return"multi "+["area","upper","lower","average"][b]})});h.xValue(f),i.xValue(f),j.xValue(f),k.xValue(f),a.call(e)};return l.xScale=function(a){return arguments.length?(c=a,l):c},l.yScale=function(a){return arguments.length?(d=a,l):d},l.xValue=function(a){return arguments.length?(f=a,l):f},l.yValue=function(a){return arguments.length?(e=a,l):e},l.root=function(a){return arguments.length?(g=a,l):g},l}}(d3,fc),function(a,b){"use strict";b.indicator.renderer.macd=function(){var c=a.time.scale(),d=a.scale.linear(),e=function(a){return a.date},f=function(a){return a.macd},g=b.series.line(),h=b.series.line(),i=b.series.bar(),j=b.series.multi(),k=function(a){g.xValue(e).yValue(function(a,b){return f(a).macd}),h.xValue(e).yValue(function(a,b){return f(a).signal}),i.xValue(e).yValue(function(a,b){return f(a).divergence}),j.xScale(c).yScale(d).series([i,g,h]).decorate(function(a){a.enter().attr("class",function(a,b){return["divergence","macd","signal"][b]})}),a.call(j)};return k.xScale=function(a){return arguments.length?(c=a,k):c},k.xValue=function(a){return arguments.length?(e=a,k):e},k.yScale=function(a){return arguments.length?(d=a,k):d},k.root=function(a){return arguments.length?(f=a,k):f},k}}(d3,fc),function(a,b){"use strict";b.indicator.renderer.relativeStrengthIndex=function(){var c=a.time.scale(),d=a.scale.linear(),e=70,f=30,g=b.annotation.line(),h=b.series.line().yValue(function(a,b){return a.rsi}),i=function(b){g.xScale(c).yScale(d),h.xScale(c).yScale(d),b.each(function(b){var c=a.select(this),d=c.selectAll("g.annotations").data([[e,50,f]]);d.enter().append("g").attr("class","annotations"),d.call(g);var i=c.selectAll("g.indicator").data([b]);i.enter().append("g").attr("class","indicator"),i.call(h)})};return i.xScale=function(a){return arguments.length?(c=a,i):c},i.yScale=function(a){return arguments.length?(d=a,i):d},i.upperValue=function(a){return arguments.length?(e=a,i):e},i.lowerValue=function(a){return arguments.length?(f=a,i):f},a.rebind(i,h,"yValue","xValue"),i}}(d3,fc),function(a,b,c){"use strict";a.selection.prototype.layout=function(a,c){var d=b.layout(),e=arguments.length;if(2===e)"string"!=typeof a?(d.width(a).height(c),this.call(d)):this.attr("layout-css",a+":"+c);else if(1===e){if("string"==typeof a)return Number(this.attr("layout-"+a));var f=a,g=Object.keys(f).map(function(a){return a+":"+f[a]}).join(";");this.attr("layout-css",g)}else 0===e&&this.call(d);return this},b.layout=function(){function a(a){if(!a)return{};var b=a.split(";"),c={};return b.forEach(function(a){var b=a.split(":");if(2===b.length){var d=b[0].trim(),e=b[1].trim();c[d]=isNaN(e)?e:Number(e)}}),c}function d(b){function c(){for(var a=[],c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];1===e.nodeType&&e.getAttribute("layout-css")&&a.push(d(e))}return a}return{style:a(b.getAttribute("layout-css")),children:c(b),element:b,layout:{width:void 0,height:void 0,top:0,left:0}}}function e(a){a.element.setAttribute("layout-width",a.layout.width),a.element.setAttribute("layout-height",a.layout.height),a.element.nodeName.match(/(?:svg|rect)/i)?(a.element.setAttribute("width",a.layout.width),a.element.setAttribute("height",a.layout.height),a.element.setAttribute("x",a.layout.left),a.element.setAttribute("y",a.layout.top)):a.element.setAttribute("transform","translate("+a.layout.left+", "+a.layout.top+")"),a.children.forEach(e)}var f=-1,g=-1,h=function(a){a.each(function(a){var h=b.util.innerDimensions(this),i=d(this);i.style.width=-1!==f?f:h.width,i.style.height=-1!==g?g:h.height,c.computeLayout(i),e(i)})};return h.width=function(a){return arguments.length?(f=a,h):f},h.height=function(a){return arguments.length?(g=a,h):g},h}}(d3,fc,computeLayout),function(a,b){"use strict";function c(d,e){function f(a){var b=d.domain(),c=d.range(),f=e.distance(b[0],b[1]),g=e.distance(b[0],a),h=g/f,i=h*(c[1]-c[0])+c[0];return i}return arguments.length||(d=a.time.scale(),e=b.scale.discontinuity.identity()),f.invert=function(a){var b=d.domain(),c=d.range(),f=(a-c[0])/(c[1]-c[0]),g=e.distance(b[0],b[1]),h=f*g;return e.offset(b[0],h)},f.domain=function(a){if(!arguments.length)return d.domain();var b=e.clampUp(a[0]),c=e.clampDown(a[1]);return d.domain([b,c]),f},f.nice=function(){d.nice();var a=d.domain(),b=e.clampUp(a[0]),c=e.clampDown(a[1]);return d.domain([b,c]),f},f.ticks=function(){var a=d.ticks.apply(this,arguments);return b.scale.dateTime.tickTransformer(a,e,f.domain())},f.copy=function(){return c(d.copy(),e.copy())},f.discontinuityProvider=function(a){return arguments.length?(e=a,f):e},a.rebind(f,d,"range","rangeRound","interpolate","clamp","tickFormat")}b.scale.dateTime=function(){return c()},b.scale.dateTime.tickTransformer=function(a,b,c){var d=a.map(function(d,e){if(e<a.length-1)return b.clampUp(d);var f=b.clampUp(d);return f<c[1]?f:b.clampDown(d)}),e=d.reduce(function(a,b){return 0===a.filter(function(a){return a.getTime()===b.getTime()}).length&&a.push(b),a},[]);return e}}(d3,fc),function(a,b){"use strict";b.scale.discontinuity.identity=function(){var a={};return a.distance=function(a,b){return b.getTime()-a.getTime()},a.offset=function(a,b){return new Date(a.getTime()+b)},a.clampUp=b.util.fn.identity,a.clampDown=b.util.fn.identity,a.copy=function(){return a},a}}(d3,fc),function(a,b){"use strict";b.scale.discontinuity.skipWeekends=function(){function b(a){return 0===a.getDay()||6===a.getDay()}var c=864e5,d=5*c,e=7*c,f={};return f.clampDown=function(c){if(b(c)){var d=0===c.getDay()?2:1,e=a.time.day.ceil(c);return a.time.day.offset(e,-d)}return c},f.clampUp=function(c){if(b(c)){var d=0===c.getDay()?1:2,e=a.time.day.floor(c);return a.time.day.offset(e,d)}return c},f.distance=function(b,c){b=f.clampUp(b),c=f.clampDown(c);var g=a.time.saturday.ceil(b);if(g>c)return c.getTime()-b.getTime();var h=g.getTime()-b.getTime(),i=a.time.saturday.ceil(c),j=i.getTime()-c.getTime(),k=(i.getTime()-g.getTime())/e;return k*d+h-j},f.offset=function(c,e){var g=b(c)?f.clampUp(c):c,h=e,i=a.time.saturday.ceil(g);if(h-=i.getTime()-g.getTime(),0>h)return new Date(g.getTime()+e);g=a.time.day.offset(i,2);var j=Math.floor(h/d);return g=a.time.day.offset(g,7*j),h-=j*d,g=new Date(g.getTime()+h)},f.copy=function(){return f},f}}(d3,fc),function(a,b){"use strict";b.series.area=function(){var c=b.util.fn.noop,d=a.time.scale(),e=a.scale.linear(),f=a.functor(0),g=function(a,b){return a.close},h=function(a,b){return a.date},i=function(a,b){return d(h(a,b))},j=function(a,b){return e(f(a,b))},k=function(a,b){return e(g(a,b))},l=a.svg.area().defined(function(a,b){return!isNaN(j(a,b))&&!isNaN(k(a,b))}).x(i).y0(j).y1(k),m=b.util.dataJoin().selector("path.area").element("path").attrs({"class":"area"}),n=function(a){a.each(function(a,b){var d=m(this,[a]);d.attr("d",l),c(d,a,b)})};return n.decorate=function(a){return arguments.length?(c=a,n):c},n.xScale=function(a){return arguments.length?(d=a,n):d},n.yScale=function(a){return arguments.length?(e=a,n):e},n.xValue=function(a){return arguments.length?(h=a,n):h},n.y0Value=function(b){return arguments.length?(f=a.functor(b),n):f},n.yValue=n.y1Value=function(a){return arguments.length?(g=a,n):g},a.rebind(n,l,"interpolate","tension")}}(d3,fc),function(a,b){"use strict";b.series.axis=function(){var c=a.svg.axis(),d=a.functor(0),e=b.util.fn.noop,f=a.time.scale(),g=a.scale.linear(),h=b.util.dataJoin().selector("g.axis-adapter").element("g").attrs({"class":"axis axis-adapter"}),i=function(a){a.each(function(a,b){var j=h(this,[a]);switch(i.orient()){case"top":case"bottom":j.attr("transform","translate(0,"+g(d(a))+")"),c.scale(f);break;case"left":case"right":j.attr("transform","translate("+f(d(a))+",0)"),c.scale(g);break;default:throw new Error("Invalid orientation")}j.call(c),e(j,a,b)})};return i.baseline=function(b){return arguments.length?(d=a.functor(b),i):d},i.decorate=function(a){return arguments.length?(e=a,i):e},i.xScale=function(a){return arguments.length?(f=a,i):f},i.yScale=function(a){return arguments.length?(g=a,i):g},a.rebind(i,c,"orient","ticks","tickValues","tickSize","innerTickSize","outerTickSize","tickPadding","tickFormat")}}(d3,fc),function(a,b){"use strict";b.series.bar=function(){var c=b.util.fn.noop,d=a.time.scale(),e=a.scale.linear(),f=function(a,b){return a.close},g=function(a,b){return a.date},h=a.functor(0),i=b.util.fractionalBarWidth(.75),j=b.util.dataJoin().selector("g.bar").element("g").attrs({"class":"bar"}),k=function(a,b){return d(g(a,b))},l=function(d){d.each(function(d,l){var m=d.filter(function(a,b){return void 0!==h(a,b)&&void 0!==f(a,b)&&void 0!==g(a,b)}),n=j.key(g)(this,m),o=i(m.map(k)),p=b.svg.bar().x(0).y(0).width(o).height(0),q=function(a,b){return k(a,b)},r=function(a,b){return e(f(a,b))},s=function(a,b){return e(h(a,b))};n.enter().attr("transform",function(a,b){return"translate("+q(a,b)+", "+s(a,b)+")"}).append("path").attr("d",function(a){return p([a])}),n.each(function(b,c){p.height(s(b,c)-r(b,c));var d=a.select(this);a.transition(d).attr("transform","translate("+q(b,c)+", "+r(b,c)+")").select("path").attr("d",p([b]))}),c(n,m,l)})};return l.decorate=function(a){return arguments.length?(c=a,l):c},l.xScale=function(a){return arguments.length?(d=a,l):d},l.yScale=function(a){return arguments.length?(e=a,l):e},l.xValue=function(a){return arguments.length?(g=a,l):g},l.y0Value=function(b){return arguments.length?(h=a.functor(b),l):h},l.yValue=l.y1Value=function(a){return arguments.length?(f=a,l):f},l.barWidth=function(b){return arguments.length?(i=a.functor(b),l):i},l}}(d3,fc),function(a,b){"use strict";b.series.candlestick=function(){var c=b.util.fn.noop,d=a.time.scale(),e=a.scale.linear(),f=function(a,b){return a.date},g=function(a,b){return a.open},h=function(a,b){return a.high},i=function(a,b){return a.low},j=function(a,b){return a.close},k=b.util.fractionalBarWidth(.75),l=b.util.dataJoin().selector("g.candlestick").element("g").attrs({"class":"candlestick"}),m=function(a,b){return d(f(a,b))},n=function(d){d.each(function(d,n){var o=l.key(f)(this,d);o.enter().append("path");var p=b.svg.candlestick().width(k(d.map(m)));o.each(function(b,c){var d=j(b,c),f=g(b,c),k=m(b,c),l=e(f),n=e(h(b,c)),o=e(i(b,c)),q=e(d),r=a.select(this).classed({up:d>f,down:f>d}).attr("transform","translate("+k+", "+n+")");p.x(a.functor(0)).open(function(){return l-n}).high(function(){return n-n}).low(function(){return o-n}).close(function(){return q-n}),r.select("path").attr("d",p([b]))}),c(o,d,n)})};return n.decorate=function(a){return arguments.length?(c=a,n):c},n.xScale=function(a){return arguments.length?(d=a,n):d},n.yScale=function(a){return arguments.length?(e=a,n):e},n.xValue=function(a){return arguments.length?(f=a,n):f},n.yOpenValue=function(a){return arguments.length?(g=a,n):g},n.yHighValue=function(a){return arguments.length?(h=a,n):h},n.yLowValue=function(a){return arguments.length?(i=a,n):i},n.yValue=n.yCloseValue=function(a){return arguments.length?(j=a,n):j},n.barWidth=function(b){return arguments.length?(k=a.functor(b),n):k},n}}(d3,fc),function(a,b){"use strict";b.series.cycle=function(){var c=b.util.fn.noop,d=a.scale.linear(),e=a.scale.linear(),f=function(a,b){return a.date.getDay()},g=a.scale.linear(),h=b.series.line(),i=b.util.fractionalBarWidth(.75),j=b.util.dataJoin().selector("g.cycle").element("g").attrs({"class":"cycle"}),k=function(b){b.each(function(b,k){var l=a.nest().key(f).map(b),m=Object.keys(l),n=i(m.map(d)),o=n/2,p=j(this,m);p.each(function(b,c){var f=a.select(this);f.attr("transform","translate("+d(b)+", 0)"),(g.rangeBands||g.range)([-o,o]),h.xScale(g).yScale(e),a.select(this).datum(l[b]).call(h)}),c(p,m,k)})};return k.decorate=function(a){return arguments.length?(c=a,k):c},k.xScale=function(a){return arguments.length?(d=a,k):d},k.yScale=function(a){return arguments.length?(e=a,k):e},k.xValue=function(a){return arguments.length?(f=a,k):f},k.subScale=function(a){return arguments.length?(g=a,k):g},k.subSeries=function(a){return arguments.length?(h=a,k):h},k.barWidth=function(b){return arguments.length?(i=a.functor(b),k):i},k}}(d3,fc),function(a,b){"use strict";b.series.line=function(){var c=b.util.fn.noop,d=a.time.scale(),e=a.scale.linear(),f=function(a,b){return a.close},g=function(a,b){return a.date},h=function(a,b){return d(g(a,b))},i=function(a,b){return e(f(a,b))},j=a.svg.line().defined(function(a,b){return!isNaN(i(a,b))}).x(h).y(i),k=b.util.dataJoin().selector("path.line").element("path").attrs({"class":"line"}),l=function(a){a.each(function(a,b){var d=k(this,[a]);d.attr("d",j),c(d,a,b)})};return l.decorate=function(a){return arguments.length?(c=a,l):c},l.xScale=function(a){return arguments.length?(d=a,l):d},l.yScale=function(a){return arguments.length?(e=a,l):e},l.xValue=function(a){return arguments.length?(g=a,l):g},l.yValue=function(a){return arguments.length?(f=a,l):f},a.rebind(l,j,"interpolate","tension")}}(d3,fc),function(a,b){"use strict";b.series.multi=function(){var c=a.time.scale(),d=a.scale.linear(),e=[],f=b.util.fn.context,g=b.util.fn.index,h=b.util.fn.noop,i=b.util.dataJoin().selector("g.multi").children(!0).attrs({"class":"multi"}).element("g").key(function(a,b){var c=this.__series__||a;return g.call(this,c,b)}),j=function(b){b.each(function(b){var g=i(this,e);g.each(function(e,g){this.__series__=e,(e.xScale||e.x).call(e,c),(e.yScale||e.y).call(e,d),a.select(this).datum(f.call(b,e,g)).call(e)}),h(g)})};return j.xScale=function(a){return arguments.length?(c=a,j):c},j.yScale=function(a){return arguments.length?(d=a,j):d},j.series=function(a){return arguments.length?(e=a,j):e},j.mapping=function(a){return arguments.length?(f=a,j):f},j.key=function(a){return arguments.length?(g=a,j):g},j.decorate=function(a){return arguments.length?(h=a,j):h},j}}(d3,fc),function(a,b){"use strict";b.series.ohlc=function(c){var d=b.util.fn.noop,e=a.time.scale(),f=a.scale.linear(),g=function(a,b){return a.date},h=function(a,b){return a.open},i=function(a,b){return a.high},j=function(a,b){return a.low},k=function(a,b){return a.close},l=b.util.fractionalBarWidth(.75),m=function(a,b){return e(g(a,b))},n=b.util.dataJoin().selector("g.ohlc").element("g").attrs({"class":"ohlc"}),o=function(c){c.each(function(c,e){var o=n.key(g)(this,c);o.enter().append("path");var p=b.svg.ohlc().width(l(c.map(m)));o.each(function(b,c){var d=k(b,c),e=h(b,c),g=m(b,c),l=f(e),n=f(i(b,c)),o=f(j(b,c)),q=f(d),r=a.select(this).classed({up:d>e,down:e>d}).attr("transform","translate("+g+", "+n+")");p.x(a.functor(0)).open(function(){return l-n}).high(function(){return n-n}).low(function(){return o-n}).close(function(){return q-n}),r.select("path").attr("d",p([b]))}),d(o,c,e)})};return o.decorate=function(a){return arguments.length?(d=a,o):d},o.xScale=function(a){return arguments.length?(e=a,o):e},o.yScale=function(a){return arguments.length?(f=a,o):f},o.xValue=function(a){return arguments.length?(g=a,o):g},o.yOpenValue=function(a){return arguments.length?(h=a,o):h},o.yHighValue=function(a){return arguments.length?(i=a,o):i},o.yLowValue=function(a){return arguments.length?(j=a,o):j},o.yValue=o.yCloseValue=function(a){return arguments.length?(k=a,o):k},o.barWidth=function(b){return arguments.length?(l=a.functor(b),
o):l},o}}(d3,fc),function(a,b){"use strict";b.series.point=function(){var c=b.util.fn.noop,d=a.time.scale(),e=a.scale.linear(),f=function(a,b){return a.close},g=function(a,b){return a.date},h=a.functor(5),i=b.util.dataJoin().selector("g.point").element("g").attrs({"class":"point"}),j=function(a){a.each(function(a,b){var j=i.key(g)(this,a);j.enter().append("circle"),j.attr("transform",function(a,b){var c=d(g(a,b)),h=e(f(a,b));return"translate("+c+", "+h+")"}),j.select("circle").attr("r",h),c(j,a,b)})};return j.decorate=function(a){return arguments.length?(c=a,j):c},j.xScale=function(a){return arguments.length?(d=a,j):d},j.yScale=function(a){return arguments.length?(e=a,j):e},j.xValue=function(a){return arguments.length?(g=a,j):g},j.yValue=function(a){return arguments.length?(f=a,j):f},j.radius=function(a){return arguments.length?(h=a,j):h},j}}(d3,fc),function(a,b){"use strict";b.series.stacked.area=function(){var a=b.series.area().yValue(function(a){return a.y0+a.y}).y0Value(function(a){return a.y0}),c=b.series.stacked.stack().series(a),d=function(a){a.call(c)};return b.util.rebind(d,a,{decorate:"decorate",xScale:"xScale",yScale:"yScale",xValue:"xValue",y0Value:"y0Value",y1Value:"y1Value",yValue:"yValue"})}}(d3,fc),function(a,b){"use strict";b.series.stacked.bar=function(){var a=b.series.bar().yValue(function(a){return a.y0+a.y}).y0Value(function(a){return a.y0}),c=b.series.stacked.stack().series(a),d=function(a){a.call(c)};return b.util.rebind(d,a,{decorate:"decorate",xScale:"xScale",yScale:"yScale",xValue:"xValue",y0Value:"y0Value",y1Value:"y1Value",yValue:"yValue",barWidth:"barWidth"})}}(d3,fc),function(a,b){"use strict";b.series.stacked.line=function(){var a=b.series.line().yValue(function(a){return a.y0+a.y}),c=b.series.stacked.stack().series(a),d=function(a){a.call(c)};return b.util.rebind(d,a,{decorate:"decorate",xScale:"xScale",yScale:"yScale",xValue:"xValue",yValue:"yValue"})}}(d3,fc),function(a,b){"use strict";b.series.stacked.stack=function(){var c=b.util.fn.noop,d=function(d){d.each(function(d){var e=a.select(this),f=b.util.dataJoin().selector("g.stacked").element("g").attrs({"class":"stacked"});f(e,d).call(c)})};return d.series=function(a){return arguments.length?(c=a,d):c},d}}(d3,fc),function(a,b){"use strict";b.svg.bar=function(){var b=function(a,b){return a.x},c=function(a,b){return a.y},d="center",e=function(a,b){return a.height},f=a.functor(3),g=function(a,g){return a.map(function(a,h){var i,j=b.call(this,a,g||h),k=c.call(this,a,g||h),l=e.call(this,a,g||h),m=f.call(this,a,g||h);switch(d){case"left":i=m;break;case"right":i=0;break;case"center":i=m/2;break;default:throw new Error("Invalid alignment")}var n="M"+(j-i)+","+k+"h"+m+"V"+l+"h"+-m+"z";return n},this).join("")};return g.x=function(c){return arguments.length?(b=a.functor(c),g):b},g.y=function(b){return arguments.length?(c=a.functor(b),g):c},g.width=function(b){return arguments.length?(f=a.functor(b),g):f},g.align=function(a){return arguments.length?(d=a,g):d},g.height=function(b){return arguments.length?(e=a.functor(b),g):e},g}}(d3,fc),function(a,b){"use strict";b.svg.candlestick=function(){var b=function(a,b){return a.date},c=function(a,b){return a.open},d=function(a,b){return a.high},e=function(a,b){return a.low},f=function(a,b){return a.close},g=a.functor(3),h=function(a){return a.map(function(a,h){var i=b(a,h),j=c(a,h),k=d(a,h),l=e(a,h),m=f(a,h),n=g(a,h),o="M"+(i-n/2)+","+j+"h"+n+"V"+m+"h"+-n+"V"+j+"z",p="M"+i+","+Math.min(m,j)+"V"+k,q="M"+i+","+Math.max(m,j)+"V"+l;return o+p+q}).join("")};return h.x=function(a){return arguments.length?(b=a,h):b},h.open=function(a){return arguments.length?(c=a,h):c},h.high=function(a){return arguments.length?(d=a,h):d},h.low=function(a){return arguments.length?(e=a,h):e},h.close=function(a){return arguments.length?(f=a,h):f},h.width=function(b){return arguments.length?(g=a.functor(b),h):g},h}}(d3,fc),function(a,b){"use strict";b.svg.ohlc=function(){var b=function(a,b){return a.date},c=function(a,b){return a.open},d=function(a,b){return a.high},e=function(a,b){return a.low},f=function(a,b){return a.close},g=a.functor(3),h=function(a){return a.map(function(a,h){var i=b(a,h),j=c(a,h),k=d(a,h),l=e(a,h),m=f(a,h),n=g(a,h)/2,o="M"+i+","+l,p="V"+k,q="M"+i+","+j+"h"+-n,r="M"+i+","+m+"h"+n;return o+p+q+r}).join("")};return h.x=function(a){return arguments.length?(b=a,h):b},h.open=function(a){return arguments.length?(c=a,h):c},h.high=function(a){return arguments.length?(d=a,h):d},h.low=function(a){return arguments.length?(e=a,h):e},h.close=function(a){return arguments.length?(f=a,h):f},h.width=function(b){return arguments.length?(g=a.functor(b),h):g},h}}(d3,fc),function(a,b){"use strict";b.tool.crosshair=function(){function c(a){return a.rangeExtent?a.rangeExtent():a.range()}function d(b){return a.scale.identity().range(c(b))}function e(){var b=a.mouse(this),c=a.select(this),d=k.apply(this,b),e=c.datum();e.push(d),c.call(r),h.trackingstart.apply(this,arguments)}function f(){var b=a.mouse(this),c=a.select(this),d=k.apply(this,b),e=c.datum();e[e.length-1]=d,c.call(r),h.trackingmove.apply(this,arguments)}function g(){var b=a.select(this),c=b.datum();c.pop(),b.call(r),h.trackingend.apply(this,arguments)}var h=a.dispatch("trackingstart","trackingmove","trackingend"),i=a.time.scale(),j=a.scale.linear(),k=function(a,c){return b.util.noSnap(i,j)(a,c)},l=b.util.fn.noop,m=function(a){return a.xInDomainUnits?i(a.x):a.x},n=function(a){return a.yInDomainUnits?j(a.y):a.y},o=b.util.dataJoin().children(!0).selector("g.crosshair").element("g").attrs({"class":"crosshair"}),p=b.annotation.line().value(n).label(function(a){return a.y}),q=b.annotation.line().orient("vertical").value(m).label(function(a){return a.x}),r=function(h){h.each(function(h,k){var r=a.select(this).style("pointer-events","all").on("mouseenter.crosshair",e).on("mousemove.crosshair",f).on("mouseleave.crosshair",g),s=r.selectAll("rect").data([h]);s.enter().append("rect").style("visibility","hidden"),r.select("rect").attr("x",c(i)[0]).attr("y",c(j)[1]).attr("width",c(i)[1]).attr("height",c(j)[0]);var t=o(r,h),u=function(a){return"translate("+m(a)+", "+n(a)+")"};t.enter().style("pointer-events","none").append("g").classed("trackball",!0).attr("transform",u).append("circle").attr("r",5),t.select("g.trackball").attr("transform",u);var v=b.series.multi().series([p,q]).xScale(d(i)).yScale(d(j)).mapping(function(){return[this]});t.call(v),l(t,h,k)})};return r.xScale=function(a){return arguments.length?(i=a,r):i},r.yScale=function(a){return arguments.length?(j=a,r):j},r.snap=function(a){return arguments.length?(k=a,r):k},r.decorate=function(a){return arguments.length?(l=a,r):l},a.rebind(r,h,"on"),b.util.rebind(r,p,{yLabel:"label"}),b.util.rebind(r,q,{xLabel:"label"}),r}}(d3,fc),function(a,b){"use strict";b.tool.fibonacciFan=function(){function c(){var b=a.select(this),c=b.datum()[0];if("DONE"!==c.state){var d=a.mouse(this),e=k.apply(this,d);if("SELECT_SOURCE"===c.state)c.source=c.target=e;else{if("SELECT_TARGET"!==c.state)throw new Error("Unknown state "+c.state);c.target=e}}}function d(){var b=a.select(this).on("click.fan",g).on("mousemove.fan",e).on("mouseleave.fan",f),d=b.datum();null==d[0]&&d.push({state:"SELECT_SOURCE"}),c.call(this),b.call(p)}function e(){var b=a.select(this);c.call(this),b.call(p)}function f(){var b=a.select(this),c=b.datum();null!=c[0]&&"SELECT_SOURCE"===c[0].state&&c.pop(),b.on("click.fan",null).on("mousemove.fan",null).on("mouseleave.fan",null)}function g(){var b=a.select(this),d=b.datum()[0];switch(d.state){case"SELECT_SOURCE":c.call(this),h.fansource.apply(this,arguments),d.state="SELECT_TARGET";break;case"SELECT_TARGET":c.call(this),h.fantarget.apply(this,arguments),d.state="DONE";break;case"DONE":h.fanclear.apply(this,arguments),d.state="SELECT_SOURCE",c.call(this);break;default:throw new Error("Unknown state "+d.state)}b.call(p)}var h=a.dispatch("fansource","fantarget","fanclear"),i=a.time.scale(),j=a.scale.linear(),k=function(a,c){return b.util.noSnap(i,j)(a,c)},l=b.util.fn.noop,m=function(a){return a.xInDomainUnits?i(a.x):a.x},n=function(a){return a.yInDomainUnits?j(a.y):a.y},o=b.util.dataJoin().selector("g.fan").element("g").attrs({"class":"fan"}),p=function(b){b.each(function(b,c){var e=a.select(this).style("pointer-events","all").on("mouseenter.fan",d),f=e.selectAll("rect").data([b]);f.enter().append("rect").style("visibility","hidden"),e.select("rect").attr("x",i.range()[0]).attr("y",j.range()[1]).attr("width",i.range()[1]).attr("height",j.range()[0]);var g=o(e,b);g.each(function(a){if(a.x=i.range()[1],a.ay=a.by=a.cy=n(a.target),m(a.source)!==m(a.target)){if("DONE"===a.state&&m(a.source)>m(a.target)){var b=a.source;a.source=a.target,a.target=b}var c=(n(a.target)-n(a.source))/(m(a.target)-m(a.source)),d=a.x-m(a.source),e=c*d;a.ay=.618*e+n(a.source),a.by=.5*e+n(a.source),a.cy=.382*e+n(a.source)}});var h=g.enter();h.append("line").attr("class","trend"),h.append("line").attr("class","a"),h.append("line").attr("class","b"),h.append("line").attr("class","c"),h.append("polygon").attr("class","area"),g.select("line.trend").attr("x1",function(a){return m(a.source)}).attr("y1",function(a){return n(a.source)}).attr("x2",function(a){return m(a.target)}).attr("y2",function(a){return n(a.target)}),g.select("line.a").attr("x1",function(a){return m(a.source)}).attr("y1",function(a){return n(a.source)}).attr("x2",function(a){return a.x}).attr("y2",function(a){return a.ay}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}),g.select("line.b").attr("x1",function(a){return m(a.source)}).attr("y1",function(a){return n(a.source)}).attr("x2",function(a){return a.x}).attr("y2",function(a){return a.by}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}),g.select("line.c").attr("x1",function(a){return m(a.source)}).attr("y1",function(a){return n(a.source)}).attr("x2",function(a){return a.x}).attr("y2",function(a){return a.cy}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}),g.select("polygon.area").attr("points",function(a){return m(a.source)+","+n(a.source)+" "+a.x+","+a.ay+" "+a.x+","+a.cy}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}),l(g,b,c)})};return p.xScale=function(a){return arguments.length?(i=a,p):i},p.yScale=function(a){return arguments.length?(j=a,p):j},p.snap=function(a){return arguments.length?(k=a,p):k},p.decorate=function(a){return arguments.length?(l=a,p):l},a.rebind(p,h,"on"),p}}(d3,fc),function(a,b){"use strict";b.tool.measure=function(){function c(){var b=a.select(this),c=b.datum()[0];if("DONE"!==c.state){var d=a.mouse(this),e=k.apply(this,d);if("SELECT_SOURCE"===c.state)c.source=c.target=e;else{if("SELECT_TARGET"!==c.state)throw new Error("Unknown state "+c.state);c.target=e}}}function d(){var b=a.select(this).on("click.measure",g).on("mousemove.measure",e).on("mouseleave.measure",f),d=b.datum();null==d[0]&&d.push({state:"SELECT_SOURCE"}),c.call(this),b.call(s)}function e(){var b=a.select(this);c.call(this),b.call(s)}function f(){var b=a.select(this),c=b.datum();null!=c[0]&&"SELECT_SOURCE"===c[0].state&&c.pop(),b.on("click.measure",null).on("mousemove.measure",null).on("mouseleave.measure",null)}function g(){var b=a.select(this),d=b.datum()[0];switch(d.state){case"SELECT_SOURCE":c.call(this),h.measuresource.apply(this,arguments),d.state="SELECT_TARGET";break;case"SELECT_TARGET":c.call(this),h.measuretarget.apply(this,arguments),d.state="DONE";break;case"DONE":h.measureclear.apply(this,arguments),d.state="SELECT_SOURCE",c.call(this);break;default:throw new Error("Unknown state "+d.state)}b.call(s)}var h=a.dispatch("measuresource","measuretarget","measureclear"),i=a.time.scale(),j=a.scale.linear(),k=function(a,c){return b.util.noSnap(i,j)(a,c)},l=b.util.fn.noop,m=a.functor(""),n=a.functor(""),o=a.functor(2),p=function(a){return a.xInDomainUnits?i(a.x):a.x},q=function(a){return a.yInDomainUnits?j(a.y):a.y},r=b.util.dataJoin().selector("g.measure").element("g").attrs({"class":"measure"}),s=function(b){b.each(function(b,c){var e=a.select(this).style("pointer-events","all").on("mouseenter.measure",d),f=e.selectAll("rect").data([b]);f.enter().append("rect").style("visibility","hidden"),e.select("rect").attr("x",i.range()[0]).attr("y",j.range()[1]).attr("width",i.range()[1]).attr("height",j.range()[0]);var g=r(e,b),h=g.enter();h.append("line").attr("class","tangent"),h.append("line").attr("class","horizontal"),h.append("line").attr("class","vertical"),h.append("text").attr("class","horizontal"),h.append("text").attr("class","vertical"),g.select("line.tangent").attr("x1",function(a){return p(a.source)}).attr("y1",function(a){return q(a.source)}).attr("x2",function(a){return p(a.target)}).attr("y2",function(a){return q(a.target)}),g.select("line.horizontal").attr("x1",function(a){return p(a.source)}).attr("y1",function(a){return q(a.source)}).attr("x2",function(a){return p(a.target)}).attr("y2",function(a){return q(a.source)}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}),g.select("line.vertical").attr("x1",function(a){return p(a.target)}).attr("y1",function(a){return q(a.target)}).attr("x2",function(a){return p(a.target)}).attr("y2",function(a){return q(a.source)}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"});var k=o.apply(this,arguments);g.select("text.horizontal").attr("x",function(a){return p(a.source)+(p(a.target)-p(a.source))/2}).attr("y",function(a){return q(a.source)-k}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}).text(m),g.select("text.vertical").attr("x",function(a){return p(a.target)+k}).attr("y",function(a){return q(a.source)+(q(a.target)-q(a.source))/2}).style("visibility",function(a){return"DONE"!==a.state?"hidden":"visible"}).text(n),l(g,b,c)})};return s.xScale=function(a){return arguments.length?(i=a,s):i},s.yScale=function(a){return arguments.length?(j=a,s):j},s.snap=function(a){return arguments.length?(k=a,s):k},s.decorate=function(a){return arguments.length?(l=a,s):l},s.xLabel=function(b){return arguments.length?(m=a.functor(b),s):m},s.yLabel=function(b){return arguments.length?(n=a.functor(b),s):n},s.padding=function(b){return arguments.length?(o=a.functor(b),s):o},a.rebind(s,h,"on"),s}}(d3,fc),function(a,b){"use strict";var c=1e-6;b.util.dataJoin=function(){var d="g",e=!1,f="g",g={},h=b.util.fn.index,i=function(i,j){var k=j||b.util.fn.identity;i.selectAll&&i.node||(i=a.select(i));var l=i.selectAll(d);e&&(l=l.filter(function(){return this.parentNode===i.node()}));var m=l.data(k,h),n=m.enter().append(f).attr(g).style("opacity",c),o=a.transition(m.exit()).style("opacity",c).remove();return m=a.transition(m).style("opacity",1),m.enter=a.functor(n),m.exit=a.functor(o),m};return i.selector=function(a){return arguments.length?(d=a,i):d},i.children=function(a){return arguments.length?(e=a,i):e},i.element=function(a){return arguments.length?(f=a,i):f},i.attrs=function(a){if(!arguments.length)return g;if(1===arguments.length)g=arguments[0];else if(2===arguments.length){var b=arguments[0],c=arguments[1];g[b]=c}return i},i.key=function(a){return arguments.length?(h=a,i):h},i}}(d3,fc),function(a,b){"use strict";b.util.extent=function(b,c){return Array.isArray(b[0])||(b=[b]),Array.isArray(c)||(c=[c]),"function"!=typeof c[0]&&(c=c.map(function(a){return function(b){return b[a]}})),[a.min(b,function(b){return a.min(b,function(b){return a.min(c.map(function(a){return a(b)}))})}),a.max(b,function(b){return a.max(b,function(b){return a.max(c.map(function(a){return a(b)}))})})]}}(d3,fc),function(a,b){"use strict";b.util.fn={context:function(){return this},identity:function(a){return a},index:function(a,b){return b},noop:function(a){}}}(d3,fc),function(a,b){"use strict";b.util.fractionalBarWidth=function(b){return function(c){if(c.length<=1)return 10;c.sort();var d=a.pairs(c).map(function(a){return Math.abs(a[0]-a[1])}),e=a.min(d);return b*e}}}(d3,fc),function(a,b){"use strict";b.util.innerDimensions=function(a){var b=getComputedStyle(a);return{width:parseFloat(b.width)-parseFloat(b.paddingLeft)-parseFloat(b.paddingRight),height:parseFloat(b.height)-parseFloat(b.paddingTop)-parseFloat(b.paddingBottom)}}}(d3,fc),function(a,b){"use strict";b.util.rebind=function(b,c,d){return"object"!=typeof d?a.rebind.apply(a,arguments):(Object.keys(d).forEach(function(a){var e=c[d[a]];if("function"!=typeof e)throw new Error("The method "+d[a]+" does not exist on the source object");b[a]=function(){var a=e.apply(c,arguments);return a===c?b:a}}),b)}}(d3,fc),function(a,b){"use strict";b.util.noSnap=function(a,b){return function(c,d){var e={xInDomainUnits:!1,x:c,yInDomainUnits:!1,y:d};return a.invert&&(e.xInDomainUnits=!0,e.x=a.invert(c)),b.invert&&(e.yInDomainUnits=!0,e.y=b.invert(d)),e}},b.util.pointSnap=function(a,b,c,d,e,f){return f=f||function(a,b,c,d){var e=a-c,f=b-d;return Math.sqrt(e*e+f*f)},function(g,h){var i=e.map(function(e){var i=f(g,h,a(c(e)),b(d(e)));return[i,e]}).reduce(function(a,b){return a[0]>b[0]?b:a},[Number.MAX_VALUE,null])[1];return{datum:i,x:i?c(i):g,xInDomainUnits:Boolean(i),y:i?d(i):h,yInDomainUnits:Boolean(i)}}},b.util.seriesPointSnapXOnly=function(a,c){function d(a,b,c,d){var e=a-c;return Math.abs(e)}return b.util.seriesPointSnap(a,c,d)},b.util.seriesPointSnapYOnly=function(a,c){function d(a,b,c,d){var e=b-d;return Math.abs(e)}return b.util.seriesPointSnap(a,c,d)},b.util.seriesPointSnap=function(a,c,d){return function(e,f){var g=a.xScale(),h=a.yScale(),i=a.xValue(),j=(a.yValue||a.yCloseValue).call(a);return b.util.pointSnap(g,h,i,j,c,d)(e,f)}}}(d3,fc);
//# sourceMappingURL=d3fc.min.js.map

@@ -1,32 +0,9 @@

Releases can be found on [npm](https://www.npmjs.com/package/d3fc).
Releases can be found on [npm](https://www.npmjs.com/package/d3fc) and [github](https://github.com/ScottLogic/d3fc/releases).
#Release Process (for devs)
##Pre-requisites
As well as the standard development instructions -
* Setup [npm author info](https://docs.npmjs.com/getting-started/publishing-npm-packages) and ensure you're listed as a [collaborator on the repository](https://www.npmjs.com/package/d3fc).
##Process
```bash
read -p "Version:" version
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
```
git clean -fd
git fetch upstream
git checkout master
git reset --hard upstream/master
# n.b. don't tag at this point, we need to bump the version in the source
npm version $version --no-git-tag-version
grunt clean build
git add --all
git commit -m "Release version $version"
git tag -a $version -m "Release version $version"
git push upstream $version master
npm publish
```
This will take care of getting the latest version of `upstream/master`, updating the package.json, committing, tagging and pushing back to `upstream/master`. Travis will then take care of building the packages and pushing to npm and github.

@@ -23,3 +23,2 @@ /* global module */

visualTestSiteFiles: [
// Index page
{

@@ -31,3 +30,2 @@ expand: true,

},
// Test fixtures
{

@@ -47,2 +45,10 @@ expand: true,

'<%= meta.visualTestJsFiles %>'
],
siteFiles: [
{
expand: true,
cwd: 'site/src',
src: ['**/*.md', '*.md', '**/*.hbs', '*.hbs', '!_*/*'],
dest: 'site/dist'
}
]

@@ -52,10 +58,21 @@ },

assemble: {
options: {
assets: 'visual-tests/dist/assets',
partials: 'visual-tests/src/site/templates/includes/*.hbs',
layoutdir: 'visual-tests/src/site/templates/layouts',
layout: 'test.hbs'
},
visualTests: {
options: {
assets: 'visual-tests/dist/assets',
partials: 'visual-tests/src/site/templates/includes/*.hbs',
layoutdir: 'visual-tests/src/site/templates/layouts',
layout: 'test.hbs'
},
files: '<%= meta.visualTestSiteFiles %>'
},
site: {
options: {
assets: 'site/dist',
data: ['package.json', 'site/src/_config.yml'],
partials: 'site/src/_includes/*.hbs',
layoutdir: 'site/src/_layouts',
layout: 'default',
layoutext: '.hbs'
},
files: '<%= meta.siteFiles %>'
}

@@ -71,2 +88,13 @@ },

dest: 'dist/<%= pkg.name %>.js'
},
site: {
src: [
'node_modules/d3/d3.js',
'node_modules/css-layout/src/Layout.js',
'dist/d3fc.js',
'node_modules/jquery/dist/jquery.js',
'node_modules/bootstrap/js/collapse.js',
'site/src/lib/init.js',
],
dest: 'site/dist/scripts.js'
}

@@ -77,6 +105,14 @@ },

options: {
base: 'visual-tests/dist',
useAvailablePort: true
},
dev: { },
dev: {
options: {
base: 'visual-tests/dist'
}
},
site: {
options: {
base: 'site/dist'
}
},
keepalive: {

@@ -141,2 +177,12 @@ options: {

]
},
site: {
files: [
{
expand: true,
cwd: 'site/src/',
src: ['**/*', '!_*', '!**/*.hbs', '!**/*.md', '!**/*.yml'],
dest: 'site/dist/',
}
]
}

@@ -154,2 +200,7 @@ },

}
},
site: {
files: {
'site/dist/scripts.js': 'site/dist/scripts.js'
}
}

@@ -193,4 +244,12 @@ },

},
site: {
files: [
'Gruntfile.js',
'site/src/**/*'
],
tasks: ['site:dev']
},
options: {
livereload: true
livereload: true,
atBegin: true
}

@@ -248,5 +307,2 @@ },

src: ['dist/*.js'],
},
testDebug: {
src: ['dist/*.js'],
options: {

@@ -260,3 +316,4 @@ keepRunner: true

dist: ['dist/*', '!dist/README.md'],
visualTests: ['visual-tests/dist']
visualTests: ['visual-tests/dist'],
site: ['site/dist']
},

@@ -266,4 +323,12 @@

defaults: {
src: ['src/fc.js']
src: ['dist/d3fc.js']
}
},
less: {
site: {
files: {
"site/dist/styles.css": "site/src/style/styles.less"
}
}
}

@@ -279,10 +344,13 @@ });

grunt.registerTask('build:visual-tests', ['check', 'clean:visualTests', 'copy:visualTests', 'assemble:visualTests']);
grunt.registerTask('build:components', ['check', 'clean:dist', 'version', 'concat:dist', 'uglify:dist', 'concat_css:all', 'cssmin:dist', 'jasmine:test']);
grunt.registerTask('build:components', ['check', 'clean:dist', 'concat:dist', 'version', 'uglify:dist', 'concat_css:all', 'cssmin:dist', 'jasmine:test']);
grunt.registerTask('build', ['build:components', 'build:visual-tests']);
grunt.registerTask('dev:serve', ['build', 'connect:dev', 'watch']);
grunt.registerTask('dev:serve', ['connect:dev', 'watch:components']);
grunt.registerTask('dev', ['build', 'watch']);
grunt.registerTask('ci', ['default']);
grunt.registerTask('ci', ['default', 'site']);
grunt.registerTask('test', ['jasmine:test', 'build:visual-tests']);
grunt.registerTask('serve', ['connect:keepalive']);
grunt.registerTask('site:dev', ['clean:site', 'copy:site', 'concat:site', 'less:site', 'assemble:site']);
grunt.registerTask('site:serve', ['connect:site', 'watch:site']);
grunt.registerTask('site', ['site:dev', 'uglify:site']);
grunt.registerTask('default', ['build']);
};
{
"name": "d3fc",
"version": "0.2.5",
"version": "0.3.3",
"description": "A set of re-useable components for building financial charts with D3",

@@ -23,3 +23,3 @@ "author": "Scott Logic",

"assemble": "^0.4.42",
"bootstrap": "^3.3.2",
"bootstrap": "^3.3.5",
"grunt": "^0.4.5",

@@ -34,2 +34,3 @@ "grunt-concat-css": "^0.3.1",

"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-less": "^1.0.1",
"grunt-contrib-uglify": "^0.6.0",

@@ -40,2 +41,3 @@ "grunt-contrib-watch": "^0.6.1",

"jquery": "^1.11.2",
"l": "0.0.1",
"matchdep": "^0.3.0",

@@ -45,4 +47,6 @@ "seedrandom": "^2.4.0"

"scripts": {
"test": "grunt ci"
"test": "grunt ci",
"preversion": "git fetch upstream master && git checkout FETCH_HEAD",
"postversion": "git push --tags upstream HEAD:master"
}
}

@@ -9,43 +9,48 @@ # d3fc [![Build Status](https://travis-ci.org/ScottLogic/d3fc.svg?branch=master)](https://travis-ci.org/ScottLogic/d3fc)

npm install d3fc
```
npm install d3fc
```
Once installed, you can reference the d3fc JavaScript, CSS and dependencies within an HTML page as follows:
<script src="node_modules/d3fc/node_modules/d3/d3.js"></script>
<script src="node_modules/d3fc/node_modules/css-layout/src/Layout.js"></script>
<script src="node_modules/d3fc/dist/d3fc.js"></script>
```html
<script src="node_modules/d3fc/node_modules/d3/d3.js"></script>
<script src="node_modules/d3fc/node_modules/css-layout/src/Layout.js"></script>
<script src="node_modules/d3fc/dist/d3fc.js"></script>
<link href="node_modules/d3fc/dist/d3fc.css" rel="stylesheet"/>
<link href="node_modules/d3fc/dist/d3fc.css" rel="stylesheet"/>
```
If you want a quick verification that everything has installed correctly, the following code will render a simple time series chart:
<div id="chart"></div>
<script type="text/javascript">
var data = fc.dataGenerator()(50);
```html
<div id="chart"></div>
<script type="text/javascript">
var data = fc.data.random.financial()(50);
var chart = fc.charts.linearTimeSeries()
.xDomain(fc.utilities.extent(data, 'date'))
.xTicks(5)
.yDomain(fc.utilities.extent(data, ['high', 'low']))
.yNice()
.yTicks(5);
var chart = fc.chart.linearTimeSeries()
.xDomain(fc.util.extent(data, 'date'))
.xTicks(5)
.yDomain(fc.util.extent(data, ['high', 'low']))
.yNice()
.yTicks(5);
var gridlines = fc.scale.gridlines();
var candlestick = fc.series.candlestick();
var movingAverage = fc.indicators.movingAverage();
var gridlines = fc.annotation.gridline();
var candlestick = fc.series.candlestick();
var multi = fc.series.multi()
.series([gridlines, candlestick, movingAverage]);
chart.plotArea(multi);
var multi = fc.series.multi()
.series([gridlines, candlestick]);
chart.plotArea(multi);
d3.select("#chart")
.append('svg')
.style({
height: '250px',
width: '600px'
})
.datum(data)
.call(chart);
d3.select('#chart')
.append('svg')
.style({
height: '250px',
width: '600px'
})
.datum(data)
.call(chart);
</script>
</script>
```

@@ -52,0 +57,0 @@ To find out more about the various components, visit the [project webpage](http://scottlogic.github.io/d3fc/).

@@ -11,17 +11,23 @@ (function(d3, fc) {

var gridlines = function(selection) {
var xDecorate = fc.util.fn.noop,
yDecorate = fc.util.fn.noop;
selection.each(function() {
var xLineDataJoin = fc.util.dataJoin()
.selector('line.x')
.element('line')
.attrs({'class': 'x gridline'});
var container = d3.select(this);
var yLineDataJoin = fc.util.dataJoin()
.selector('line.y')
.element('line')
.attrs({'class': 'y gridline'});
var xLines = fc.util.simpleDataJoin(container, 'x',
xScale.ticks(xTicks));
var gridlines = function(selection) {
xLines.enter()
.append('line')
.attr('class', 'gridline');
selection.each(function(data, index) {
xLines.select('line')
.attr({
var xData = xScale.ticks(xTicks);
var xLines = xLineDataJoin(this, xData);
xLines.attr({
'x1': xScale,

@@ -33,11 +39,8 @@ 'x2': xScale,

var yLines = fc.util.simpleDataJoin(container, 'y',
yScale.ticks(yTicks));
xDecorate(xLines, xData, index);
yLines.enter()
.append('line')
.attr('class', 'gridline');
var yData = yScale.ticks(yTicks);
var yLines = yLineDataJoin(this, yData);
yLines.select('line')
.attr({
yLines.attr({
'x1': xScale.range()[0],

@@ -49,2 +52,3 @@ 'x2': xScale.range()[1],

yDecorate(yLines, yData, index);

@@ -82,2 +86,16 @@ });

};
gridlines.yDecorate = function(x) {
if (!arguments.length) {
return yDecorate;
}
yDecorate = x;
return gridlines;
};
gridlines.xDecorate = function(x) {
if (!arguments.length) {
return xDecorate;
}
xDecorate = x;
return gridlines;
};

@@ -84,0 +102,0 @@

@@ -20,3 +20,3 @@ (function(d3, fc) {

var line = function(selection) {
selection.each(function(data) {
selection.each(function(data, index) {

@@ -103,3 +103,3 @@ // the value scale which the annotation 'value' relates to, the crossScale

decorate(g);
decorate(g, data, index);
});

@@ -106,0 +106,0 @@ };

@@ -23,3 +23,3 @@ (function(d3, fc) {

var legend = function(selection) {
selection.each(function(data) {
selection.each(function(data, index) {
var container = d3.select(this);

@@ -53,4 +53,4 @@

tableDecorate(table);
rowDecorate(trUpdate);
tableDecorate(table, data, index);
rowDecorate(trUpdate, data, index);
});

@@ -57,0 +57,0 @@ };

@@ -43,4 +43,3 @@ (function(d3, fc) {

.attr({
'class': 'plot-area',
'overflow': 'hidden'
'class': 'plot-area'
})

@@ -47,0 +46,0 @@ .layout(plotAreaLayout);

@@ -5,3 +5,3 @@ (function() {

// Needs to be defined like this so that the grunt task can update it
var version = '0.2.5';
var version = 'development';

@@ -17,2 +17,6 @@ // Crazyness to get a strict mode compliant reference to the global object

chart: {},
data: {
feed: {},
random: {}
},
indicator: {

@@ -27,3 +31,5 @@ algorithm: {

},
series: {},
series: {
stacked: {}
},
svg: {},

@@ -30,0 +36,0 @@ tool: {},

@@ -40,3 +40,9 @@ (function(d3, fc) {

.yScale(yScale)
.series([area, upperLine, lowerLine, averageLine]);
.series([area, upperLine, lowerLine, averageLine])
.decorate(function(g) {
g.enter()
.attr('class', function(d, i) {
return 'multi ' + ['area', 'upper', 'lower', 'average'][i];
});
});

@@ -48,7 +54,3 @@ area.xValue(xValue);

selection.each(function(data) {
d3.select(this)
.data([data])
.call(multi);
});
selection.call(multi);
};

@@ -55,0 +57,0 @@

@@ -17,31 +17,22 @@ (function(d3, fc) {

macdLine
.xValue(xValue)
.yValue(function(d, i) { return root(d).macd; })
.decorate(function(path) {
path.classed('macd', true);
});
macdLine.xValue(xValue)
.yValue(function(d, i) { return root(d).macd; });
signalLine
.xValue(xValue)
.yValue(function(d, i) { return root(d).signal; })
.decorate(function(path) {
path.classed('signal', true);
});
signalLine.xValue(xValue)
.yValue(function(d, i) { return root(d).signal; });
divergenceBar
.xValue(xValue)
divergenceBar.xValue(xValue)
.yValue(function(d, i) { return root(d).divergence; });
multiSeries
.xScale(xScale)
multiSeries.xScale(xScale)
.yScale(yScale)
.series([divergenceBar, macdLine, signalLine]);
.series([divergenceBar, macdLine, signalLine])
.decorate(function(g) {
g.enter()
.attr('class', function(d, i) {
return ['divergence', 'macd', 'signal'][i];
});
});
selection.each(function(data) {
d3.select(this)
.append('g')
.classed('macd-indicator', true)
.call(multiSeries);
});
selection.call(multiSeries);
};

@@ -48,0 +39,0 @@

@@ -26,17 +26,15 @@ (function(d3, fc) {

var dataJoin = fc.util.dataJoin()
.selector('path.area')
.element('path')
.attrs({'class': 'area'});
var area = function(selection) {
selection.each(function(data) {
selection.each(function(data, index) {
var path = d3.select(this)
.selectAll('path.area')
.data([data]);
path.enter()
.append('path')
.attr('class', 'area');
var path = dataJoin(this, [data]);
path.attr('d', areaData);
decorate(path);
decorate(path, data, index);
});

@@ -43,0 +41,0 @@ };

@@ -15,13 +15,13 @@ (function(d3, fc) {

var dataJoin = fc.util.dataJoin()
.selector('g.axis-adapter')
.element('g')
.attrs({'class': 'axis axis-adapter'});
var axisAdapter = function(selection) {
selection.each(function(data) {
selection.each(function(data, index) {
var container = d3.select(this);
var g = dataJoin(this, [data]);
var g = fc.util.simpleDataJoin(container, 'axis-adapter', [data]);
g.enter()
.attr('class', 'axis axis-adapter');
switch (axisAdapter.orient()) {

@@ -46,3 +46,3 @@ case 'top':

decorate(g);
decorate(g, data, index);
});

@@ -49,0 +49,0 @@ };

@@ -14,7 +14,11 @@ (function(d3, fc) {

var dataJoin = fc.util.dataJoin()
.selector('g.bar')
.element('g')
.attrs({'class': 'bar'});
var xValueScaled = function(d, i) { return xScale(xValue(d, i)); };
var bar = function(selection) {
selection.each(function(data) {
var container = d3.select(this);
selection.each(function(data, index) {

@@ -27,3 +31,3 @@ var filteredData = data.filter(function(d, i) {

var g = fc.util.simpleDataJoin(container, 'bar', filteredData, xValue);
var g = dataJoin.key(xValue)(this, filteredData);

@@ -59,3 +63,3 @@ var width = barWidth(filteredData.map(xValueScaled));

decorate(g);
decorate(g, filteredData, index);
});

@@ -62,0 +66,0 @@ };

@@ -16,2 +16,7 @@ (function(d3, fc) {

var dataJoin = fc.util.dataJoin()
.selector('g.candlestick')
.element('g')
.attrs({'class': 'candlestick'});
var xValueScaled = function(d, i) { return xScale(xValue(d, i)); };

@@ -21,8 +26,6 @@

selection.each(function(data) {
selection.each(function(data, index) {
var container = d3.select(this);
var g = dataJoin.key(xValue)(this, data);
var g = fc.util.simpleDataJoin(container, 'candlestick', data, xValue);
g.enter()

@@ -61,3 +64,3 @@ .append('path');

decorate(g);
decorate(g, data, index);
});

@@ -64,0 +67,0 @@ };

@@ -14,8 +14,11 @@ (function(d3, fc) {

var dataJoin = fc.util.dataJoin()
.selector('g.cycle')
.element('g')
.attrs({'class': 'cycle'});
var cycle = function(selection) {
selection.each(function(data) {
selection.each(function(data, index) {
var container = d3.select(this);
var dataByX = d3.nest()

@@ -30,3 +33,3 @@ .key(xValue)

var g = fc.util.simpleDataJoin(container, 'cycle', xValues);
var g = dataJoin(this, xValues);

@@ -50,3 +53,3 @@ g.each(function(d, i) {

decorate(g);
decorate(g, xValues, index);
});

@@ -53,0 +56,0 @@ };

@@ -23,17 +23,15 @@ (function(d3, fc) {

var dataJoin = fc.util.dataJoin()
.selector('path.line')
.element('path')
.attrs({'class': 'line'});
var line = function(selection) {
selection.each(function(data) {
selection.each(function(data, index) {
var path = d3.select(this)
.selectAll('path.line')
.data([data]);
path.enter()
.append('path')
.attr('class', 'line');
var path = dataJoin(this, [data]);
path.attr('d', lineData);
decorate(path);
decorate(path, data, index);
});

@@ -40,0 +38,0 @@ };

@@ -17,9 +17,10 @@ (function(d3, fc) {

mapping = fc.util.fn.context,
key = fc.util.fn.index;
key = fc.util.fn.index,
decorate = fc.util.fn.noop;
var dataJoin = fc.util.dataJoin()
.selector('g.multi')
.children(true)
.selector('g.multi')
.attrs({'class': 'multi'})
.element('g')
.attrs({'class': 'multi'})
.key(function(d, i) {

@@ -41,18 +42,20 @@ // This function is invoked twice, the first pass is to pull the key

dataJoin(this, series)
.each(function(series, i) {
var g = dataJoin(this, series);
// We must always assign the series to the node, as the order
// may have changed. N.B. in such a case the output is most
// likely garbage (containers should not be re-used) but by
// doing this we at least make it debuggable garbage :)
this.__series__ = series;
g.each(function(series, i) {
// We must always assign the series to the node, as the order
// may have changed. N.B. in such a case the output is most
// likely garbage (containers should not be re-used) but by
// doing this we at least make it debuggable garbage :)
this.__series__ = series;
(series.xScale || series.x).call(series, xScale);
(series.yScale || series.y).call(series, yScale);
(series.xScale || series.x).call(series, xScale);
(series.yScale || series.y).call(series, yScale);
d3.select(this)
.datum(mapping.call(data, series, i))
.call(series);
});
d3.select(this)
.datum(mapping.call(data, series, i))
.call(series);
});
decorate(g);
});

@@ -96,2 +99,9 @@ };

};
multi.decorate = function(x) {
if (!arguments.length) {
return decorate;
}
decorate = x;
return multi;
};

@@ -98,0 +108,0 @@ return multi;

@@ -18,9 +18,12 @@ (function(d3, fc) {

var dataJoin = fc.util.dataJoin()
.selector('g.ohlc')
.element('g')
.attrs({'class': 'ohlc'});
var ohlc = function(selection) {
selection.each(function(data) {
selection.each(function(data, index) {
var container = d3.select(this);
var g = dataJoin.key(xValue)(this, data);
var g = fc.util.simpleDataJoin(container, 'ohlc', data, xValue);
g.enter()

@@ -58,3 +61,3 @@ .append('path');

decorate(g);
decorate(g, data, index);
});

@@ -61,0 +64,0 @@ };

@@ -13,10 +13,13 @@ (function(d3, fc) {

var dataJoin = fc.util.dataJoin()
.selector('g.point')
.element('g')
.attrs({'class': 'point'});
var point = function(selection) {
selection.each(function(data) {
selection.each(function(data, index) {
var container = d3.select(this);
var g = dataJoin.key(xValue)(this, data);
var g = fc.util.simpleDataJoin(container, 'point', data, xValue);
g.enter()

@@ -34,3 +37,3 @@ .append('circle');

decorate(g);
decorate(g, data, index);
});

@@ -37,0 +40,0 @@ };

@@ -11,17 +11,32 @@ (function(d3, fc) {

y = function(d, i) { return d.y; },
align = 'center',
height = function(d, i) { return d.height; },
width = d3.functor(3);
var bar = function(data) {
var bar = function(data, index) {
return data.map(function(d, i) {
var xValue = x(d, i),
yValue = y(d, i),
barHeight = height(d, i),
barWidth = width(d, i);
var xValue = x.call(this, d, index || i),
yValue = y.call(this, d, index || i),
barHeight = height.call(this, d, index || i),
barWidth = width.call(this, d, index || i);
var halfWidth = barWidth / 2;
var offset;
switch (align) {
case 'left':
offset = barWidth;
break;
case 'right':
offset = 0;
break;
case 'center':
offset = barWidth / 2;
break;
default:
throw new Error('Invalid alignment');
}
// Move to the start location
var body = 'M' + (xValue - halfWidth) + ',' + yValue +
var body = 'M' + (xValue - offset) + ',' + yValue +
// Draw the width

@@ -36,3 +51,3 @@ 'h' + barWidth +

return body;
})
}, this)
.join('');

@@ -62,2 +77,9 @@ };

};
bar.align = function(x) {
if (!arguments.length) {
return align;
}
align = x;
return bar;
};
bar.height = function(x) {

@@ -64,0 +86,0 @@ if (!arguments.length) {

@@ -50,7 +50,9 @@ (function(d3, fc) {

selection.each(function(data) {
selection.each(function(data, index) {
var container = d3.select(this)
.style('pointer-events', 'all')
.on('mouseenter.crosshair', mouseenter);
.on('mouseenter.crosshair', mouseenter)
.on('mousemove.crosshair', mousemove)
.on('mouseleave.crosshair', mouseleave);

@@ -96,3 +98,3 @@ var overlay = container.selectAll('rect')

decorate(crosshair);
decorate(crosshair, data, index);
});

@@ -103,5 +105,3 @@ };

var mouse = d3.mouse(this);
var container = d3.select(this)
.on('mousemove.crosshair', mousemove)
.on('mouseleave.crosshair', mouseleave);
var container = d3.select(this);
var snapped = snap.apply(this, mouse);

@@ -128,5 +128,3 @@ var data = container.datum();

data.pop();
container.call(crosshair)
.on('mousemove.crosshair', null)
.on('mouseleave.crosshair', null);
container.call(crosshair);
event.trackingend.apply(this, arguments);

@@ -133,0 +131,0 @@ }

@@ -17,5 +17,10 @@ (function(d3, fc) {

var dataJoin = fc.util.dataJoin()
.selector('g.fan')
.element('g')
.attrs({'class': 'fan'});
var fan = function(selection) {
selection.each(function(data) {
selection.each(function(data, index) {

@@ -39,3 +44,3 @@ var container = d3.select(this)

var g = fc.util.simpleDataJoin(container, 'fan', data);
var g = dataJoin(container, data);

@@ -111,3 +116,3 @@ g.each(function(d) {

decorate(g);
decorate(g, data, index);
});

@@ -114,0 +119,0 @@ };

@@ -20,5 +20,10 @@ (function(d3, fc) {

var dataJoin = fc.util.dataJoin()
.selector('g.measure')
.element('g')
.attrs({'class': 'measure'});
var measure = function(selection) {
selection.each(function(data) {
selection.each(function(data, index) {

@@ -42,3 +47,3 @@ var container = d3.select(this)

var g = fc.util.simpleDataJoin(container, 'measure', data);
var g = dataJoin(container, data);

@@ -91,3 +96,3 @@ var enter = g.enter();

decorate(g);
decorate(g, data, index);
});

@@ -94,0 +99,0 @@ };

@@ -30,3 +30,4 @@ (function(d3, fc) {

if (!(container instanceof d3.selection)) {
// Can't use instanceof d3.selection (see #458)
if (!(container.selectAll && container.node)) {
container = d3.select(container);

@@ -94,3 +95,12 @@ }

}
attrs = x;
if (arguments.length === 1) {
attrs = arguments[0];
} else if (arguments.length === 2) {
var key = arguments[0];
var value = arguments[1];
attrs[key] = value;
}
return dataJoin;

@@ -97,0 +107,0 @@ };

@@ -22,4 +22,5 @@ (function(d3, fc) {

// the data join also invokes the x value accessor,
// therefore it is invoked twice for each data point
// the data join also invokes
// the x value accessor, therefore it is invoked two times
// for each data point
expect(xValueSpy.calls.count()).toEqual(data.length * 2);

@@ -26,0 +27,0 @@ this.utils.verifyAccessorCalls(xValueSpy, data);

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

/*!
* Bootstrap v3.3.4 (http://getbootstrap.com)
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Licensed under the MIT license
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.4",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.4",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.4",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.4",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.4",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.4",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in").attr("aria-hidden",!1),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a('<div class="modal-backdrop '+e+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.3.4",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m<p.top?"bottom":"right"==h&&k.right+l>p.width?"left":"left"==h&&k.left-l<p.left?"right":h,f.removeClass(n).addClass(h)}var q=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(q,h);var r=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",r).emulateTransitionEnd(c.TRANSITION_DURATION):r()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.4",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.4",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.4",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});
if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.4",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a(document.body).height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.5",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),
d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.5",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);

@@ -1,1 +0,1 @@

!function(a,b){function c(c,j,k){var n=[];j=1==j?{entropy:!0}:j||{};var s=g(f(j.entropy?[c,i(a)]:null==c?h():c,3),n),t=new d(n),u=function(){for(var a=t.g(m),b=p,c=0;q>a;)a=(a+c)*l,b*=l,c=t.g(1);for(;a>=r;)a/=2,b/=2,c>>>=1;return(a+c)/b};return u.int32=function(){return 0|t.g(4)},u.quick=function(){return t.g(4)/(4*(1<<30))},u["double"]=u,g(i(t.S),a),(j.pass||k||function(a,c,d,f){return f&&(f.S&&e(f,t),a.state=function(){return e(t,{})}),d?(b[o]=a,c):a})(u,s,"global"in j?j.global:this==b,j.state)}function d(a){var b,c=a.length,d=this,e=0,f=d.i=d.j=0,g=d.S=[];for(c||(a=[c++]);l>e;)g[e]=e++;for(e=0;l>e;e++)g[e]=g[f=s&f+a[e%c]+(b=g[e])],g[f]=b;(d.g=function(a){for(var b,c=0,e=d.i,f=d.j,g=d.S;a--;)b=g[e=s&e+1],c=c*l+g[s&(g[e]=g[f=s&f+b])+(g[f]=b)];return d.i=e,d.j=f,c})(l)}function e(a,b){return b.i=a.i,b.j=a.j,b.S=a.S.slice(),b}function f(a,b){var c,d=[],e=typeof a;if(b&&"object"==e)for(c in a)try{d.push(f(a[c],b-1))}catch(g){}return d.length?d:"string"==e?a:a+"\0"}function g(a,b){for(var c,d=a+"",e=0;e<d.length;)b[s&e]=s&(c^=19*b[s&e])+d.charCodeAt(e++);return i(b)}function h(){try{if(j)return i(j.randomBytes(l));var b=new Uint8Array(l);return(k.crypto||k.msCrypto).getRandomValues(b),i(b)}catch(c){var d=k.navigator,e=d&&d.plugins;return[+new Date,k,e,k.screen,i(a)]}}function i(a){return String.fromCharCode.apply(0,a)}var j,k=this,l=256,m=6,n=52,o="random",p=b.pow(l,m),q=b.pow(2,n),r=2*q,s=l-1;if(b["seed"+o]=c,g(b.random(),a),"object"==typeof module&&module.exports){module.exports=c;try{j=require("crypto")}catch(t){}}else"function"==typeof define&&define.amd&&define(function(){return c})}([],Math);
!function(a,b){function c(c,j,k){var n=[];j=1==j?{entropy:!0}:j||{};var s=g(f(j.entropy?[c,i(a)]:null==c?h():c,3),n),t=new d(n),u=function(){for(var a=t.g(m),b=p,c=0;q>a;)a=(a+c)*l,b*=l,c=t.g(1);for(;a>=r;)a/=2,b/=2,c>>>=1;return(a+c)/b};return u.int32=function(){return 0|t.g(4)},u.quick=function(){return t.g(4)/4294967296},u["double"]=u,g(i(t.S),a),(j.pass||k||function(a,c,d,f){return f&&(f.S&&e(f,t),a.state=function(){return e(t,{})}),d?(b[o]=a,c):a})(u,s,"global"in j?j.global:this==b,j.state)}function d(a){var b,c=a.length,d=this,e=0,f=d.i=d.j=0,g=d.S=[];for(c||(a=[c++]);l>e;)g[e]=e++;for(e=0;l>e;e++)g[e]=g[f=s&f+a[e%c]+(b=g[e])],g[f]=b;(d.g=function(a){for(var b,c=0,e=d.i,f=d.j,g=d.S;a--;)b=g[e=s&e+1],c=c*l+g[s&(g[e]=g[f=s&f+b])+(g[f]=b)];return d.i=e,d.j=f,c})(l)}function e(a,b){return b.i=a.i,b.j=a.j,b.S=a.S.slice(),b}function f(a,b){var c,d=[],e=typeof a;if(b&&"object"==e)for(c in a)try{d.push(f(a[c],b-1))}catch(g){}return d.length?d:"string"==e?a:a+"\0"}function g(a,b){for(var c,d=a+"",e=0;e<d.length;)b[s&e]=s&(c^=19*b[s&e])+d.charCodeAt(e++);return i(b)}function h(){try{if(j)return i(j.randomBytes(l));var b=new Uint8Array(l);return(k.crypto||k.msCrypto).getRandomValues(b),i(b)}catch(c){var d=k.navigator,e=d&&d.plugins;return[+new Date,k,e,k.screen,i(a)]}}function i(a){return String.fromCharCode.apply(0,a)}var j,k=this,l=256,m=6,n=52,o="random",p=b.pow(l,m),q=b.pow(2,n),r=2*q,s=l-1;if(b["seed"+o]=c,g(b.random(),a),"object"==typeof module&&module.exports){module.exports=c;try{j=require("crypto")}catch(t){}}else"function"==typeof define&&define.amd&&define(function(){return c})}([],Math);
(function(d3, fc) {
'use strict';
var dataGenerator = fc.dataGenerator()
var dataGenerator = fc.data.random.financial()
.startDate(new Date(2014, 1, 1));

@@ -6,0 +6,0 @@ var data = dataGenerator(50);

@@ -13,3 +13,3 @@ (function(d3, fc) {

// var stock = sparkline.attr('data-ticker');
var data = fc.dataGenerator()(50);
var data = fc.data.random.financial()(50);

@@ -16,0 +16,0 @@ var chart = fc.chart.sparkline()

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1)).startPrice(95)(40);
var data2 = fc.dataGenerator().startDate(new Date(2014, 1, 1)).startPrice(100)(40);
var data3 = fc.dataGenerator().startDate(new Date(2014, 1, 1)).startPrice(105)(40);
var data4 = fc.dataGenerator().startDate(new Date(2014, 1, 1)).startPrice(105)(40);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1)).startPrice(95)(40);
var data2 = fc.data.random.financial().startDate(new Date(2014, 1, 1)).startPrice(100)(40);
var data3 = fc.data.random.financial().startDate(new Date(2014, 1, 1)).startPrice(105)(40);
var data4 = fc.data.random.financial().startDate(new Date(2014, 1, 1)).startPrice(105)(40);

@@ -9,0 +9,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var generator = fc.dataGenerator().startDate(new Date(2014, 1, 1));
var generator = fc.data.random.financial().startDate(new Date(2014, 1, 1));
var data = generator(20);

@@ -6,0 +6,0 @@

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator()
var data = fc.data.random.financial()
.startDate(new Date(2014, 1, 1))

@@ -6,0 +6,0 @@ .filter(function() { return true; })

@@ -9,3 +9,3 @@ (function(d3, fc) {

var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -12,0 +12,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 425, height = 400;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))
.filter(d3.functor(true))

@@ -6,0 +6,0 @@ (50);

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

@@ -5,4 +5,4 @@ (function(d3, fc) {

var data = [
fc.dataGenerator().startDate(new Date(2014, 1, 1))(50),
fc.dataGenerator().startDate(new Date(2013, 12, 15))(50)
fc.data.random.financial().startDate(new Date(2014, 1, 1))(50),
fc.data.random.financial().startDate(new Date(2013, 12, 15))(50)
];

@@ -9,0 +9,0 @@

(function(d3, fc) {
'use strict';
var dataGenerator = fc.dataGenerator()
var dataGenerator = fc.data.random.financial()
.startDate(new Date(2014, 1, 1));

@@ -6,0 +6,0 @@ var data = dataGenerator(50);

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

@@ -11,3 +11,3 @@ (function(d3, fc) {

d3.csv('stackedBarData.csv', function(error, data) {
function renderChart(data, offset, yDomain) {
/* Build series objects for each series in the data set.

@@ -36,4 +36,10 @@ Assumption: first data object holds all series keys. */

series.crosshair = [];
var stackLayout = d3.layout.stack()
.offset(offset)
.x(function(d) { return d.state; })
.y(function(d) { return d.value; });
var stackedData = stackLayout(series.map(function(d) { return d.data; }));
stackedData.crosshair = [];
// Collect the X values.

@@ -50,14 +56,13 @@ var xCategories = data.map(function(d) { return d.State; });

var y = d3.scale.linear()
.domain([0, 40000000])
.domain(yDomain)
.nice()
.range([height, 0]);
var stack = fc.series.stackedBar()
.values(function(d) { return d.data; })
var stackedBar = fc.series.stacked.bar()
.xScale(x)
.yScale(y)
.xValue(function(d) { return d.state; })
.yValue(function(d) { return d.value; })
.decorate(function(sel) {
sel.attr('fill', function(d, i) {
return color(i);
});
.decorate(function(sel, data, index) {
sel.select('path')
.style('fill', color(index));
});

@@ -78,12 +83,3 @@

function runningTotal(arr) {
var total = 0, result = [];
for (var i = 0, l = arr.length; i < l; i++) {
total += arr[i];
result.push(total);
}
return result;
}
function pixelSnap(xPixel, yPixel) {
function pixelSnap(stackedData, xPixel, yPixel) {
// find the nearest x location

@@ -97,4 +93,6 @@ var nearestXIndex = findClosest(x.range(), function(arr, index) {

var keys = Object.keys(datum).filter(function(p) { return p !== 'State'; });
var yValues = keys.map(function(d) { return +datum[d]; });
var yPixels = runningTotal(yValues).map(y);
var yPixels = stackedData.map(function(d) {
var datum = d[nearestXIndex];
return y(datum.y0 + datum.y);
});

@@ -106,2 +104,3 @@ // find the nearest y index

var nearestYProperty = keys[nearestYIndex];
return {

@@ -126,3 +125,3 @@ datum: {

.yLabel(function(d) { return d.datum.yProperty + ' : ' + d.datum.yValue; })
.snap(pixelSnap);
.snap(pixelSnap.bind(null, stackedData));

@@ -133,6 +132,6 @@ // Add it to the chart

.yScale(y)
.series([stack, crosshair])
.series([stackedBar, crosshair])
.mapping(function(series) {
switch (series) {
case stack:
case stackedBar:
return this;

@@ -144,6 +143,21 @@ case crosshair:

container.datum(series)
container.datum(stackedData)
.call(multi);
}
var csvData;
d3.csv('stackedBarData.csv', function(error, data) {
csvData = data;
var zeroRadio = document.getElementById('zero');
zeroRadio.addEventListener('click', renderChart.bind(null, csvData, 'zero', [0, 40000000]));
zeroRadio.setAttribute('checked', true);
document.getElementById('expand')
.addEventListener('click', renderChart.bind(null, csvData, 'expand', [0, 1]));
renderChart(data, 'zero', [0, 40000000]);
});
})(d3, fc);

@@ -5,3 +5,3 @@ (function(d3, fc) {

var form = document.forms['crosshair-1-form'];
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);
data.crosshair = [];

@@ -8,0 +8,0 @@

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);
data.crosshair = [];

@@ -6,0 +6,0 @@

@@ -5,3 +5,3 @@ (function(d3, fc) {

var form = document.forms['fan-form'];
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);
data.fibonacciFan = [];

@@ -8,0 +8,0 @@

@@ -5,3 +5,3 @@ (function(d3, fc) {

var form = document.forms['measure-1-form'];
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);
data.measure = [];

@@ -8,0 +8,0 @@

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);
data.measure = [];

@@ -6,0 +6,0 @@

@@ -13,3 +13,3 @@ (function(d3, fc) {

var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -16,0 +16,0 @@ // Calculate the scale domain

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var dataGenerator = fc.dataGenerator()
var dataGenerator = fc.data.random.financial()
.startDate(new Date(2014, 1, 1));

@@ -6,0 +6,0 @@ var data = dataGenerator(50);

@@ -13,3 +13,3 @@ (function(d3, fc) {

// var stock = sparkline.attr('data-ticker');
var data = fc.dataGenerator()(50);
var data = fc.data.random.financial()(50);

@@ -16,0 +16,0 @@ var chart = fc.chart.sparkline()

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1)).startPrice(95)(40);
var data2 = fc.dataGenerator().startDate(new Date(2014, 1, 1)).startPrice(100)(40);
var data3 = fc.dataGenerator().startDate(new Date(2014, 1, 1)).startPrice(105)(40);
var data4 = fc.dataGenerator().startDate(new Date(2014, 1, 1)).startPrice(105)(40);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1)).startPrice(95)(40);
var data2 = fc.data.random.financial().startDate(new Date(2014, 1, 1)).startPrice(100)(40);
var data3 = fc.data.random.financial().startDate(new Date(2014, 1, 1)).startPrice(105)(40);
var data4 = fc.data.random.financial().startDate(new Date(2014, 1, 1)).startPrice(105)(40);

@@ -9,0 +9,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var generator = fc.dataGenerator().startDate(new Date(2014, 1, 1));
var generator = fc.data.random.financial().startDate(new Date(2014, 1, 1));
var data = generator(20);

@@ -6,0 +6,0 @@

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator()
var data = fc.data.random.financial()
.startDate(new Date(2014, 1, 1))

@@ -6,0 +6,0 @@ .filter(function() { return true; })

@@ -9,3 +9,3 @@ (function(d3, fc) {

var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -12,0 +12,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 425, height = 400;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))
.filter(d3.functor(true))

@@ -6,0 +6,0 @@ (50);

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

@@ -5,4 +5,4 @@ (function(d3, fc) {

var data = [
fc.dataGenerator().startDate(new Date(2014, 1, 1))(50),
fc.dataGenerator().startDate(new Date(2013, 12, 15))(50)
fc.data.random.financial().startDate(new Date(2014, 1, 1))(50),
fc.data.random.financial().startDate(new Date(2013, 12, 15))(50)
];

@@ -9,0 +9,0 @@

(function(d3, fc) {
'use strict';
var dataGenerator = fc.dataGenerator()
var dataGenerator = fc.data.random.financial()
.startDate(new Date(2014, 1, 1));

@@ -6,0 +6,0 @@ var data = dataGenerator(50);

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -6,0 +6,0 @@ var width = 600, height = 250;

@@ -11,3 +11,3 @@ (function(d3, fc) {

d3.csv('stackedBarData.csv', function(error, data) {
function renderChart(data, offset, yDomain) {
/* Build series objects for each series in the data set.

@@ -36,4 +36,10 @@ Assumption: first data object holds all series keys. */

series.crosshair = [];
var stackLayout = d3.layout.stack()
.offset(offset)
.x(function(d) { return d.state; })
.y(function(d) { return d.value; });
var stackedData = stackLayout(series.map(function(d) { return d.data; }));
stackedData.crosshair = [];
// Collect the X values.

@@ -50,14 +56,13 @@ var xCategories = data.map(function(d) { return d.State; });

var y = d3.scale.linear()
.domain([0, 40000000])
.domain(yDomain)
.nice()
.range([height, 0]);
var stack = fc.series.stackedBar()
.values(function(d) { return d.data; })
var stackedBar = fc.series.stacked.bar()
.xScale(x)
.yScale(y)
.xValue(function(d) { return d.state; })
.yValue(function(d) { return d.value; })
.decorate(function(sel) {
sel.attr('fill', function(d, i) {
return color(i);
});
.decorate(function(sel, data, index) {
sel.select('path')
.style('fill', color(index));
});

@@ -78,12 +83,3 @@

function runningTotal(arr) {
var total = 0, result = [];
for (var i = 0, l = arr.length; i < l; i++) {
total += arr[i];
result.push(total);
}
return result;
}
function pixelSnap(xPixel, yPixel) {
function pixelSnap(stackedData, xPixel, yPixel) {
// find the nearest x location

@@ -97,4 +93,6 @@ var nearestXIndex = findClosest(x.range(), function(arr, index) {

var keys = Object.keys(datum).filter(function(p) { return p !== 'State'; });
var yValues = keys.map(function(d) { return +datum[d]; });
var yPixels = runningTotal(yValues).map(y);
var yPixels = stackedData.map(function(d) {
var datum = d[nearestXIndex];
return y(datum.y0 + datum.y);
});

@@ -106,2 +104,3 @@ // find the nearest y index

var nearestYProperty = keys[nearestYIndex];
return {

@@ -126,3 +125,3 @@ datum: {

.yLabel(function(d) { return d.datum.yProperty + ' : ' + d.datum.yValue; })
.snap(pixelSnap);
.snap(pixelSnap.bind(null, stackedData));

@@ -133,6 +132,6 @@ // Add it to the chart

.yScale(y)
.series([stack, crosshair])
.series([stackedBar, crosshair])
.mapping(function(series) {
switch (series) {
case stack:
case stackedBar:
return this;

@@ -144,6 +143,21 @@ case crosshair:

container.datum(series)
container.datum(stackedData)
.call(multi);
}
var csvData;
d3.csv('stackedBarData.csv', function(error, data) {
csvData = data;
var zeroRadio = document.getElementById('zero');
zeroRadio.addEventListener('click', renderChart.bind(null, csvData, 'zero', [0, 40000000]));
zeroRadio.setAttribute('checked', true);
document.getElementById('expand')
.addEventListener('click', renderChart.bind(null, csvData, 'expand', [0, 1]));
renderChart(data, 'zero', [0, 40000000]);
});
})(d3, fc);

@@ -5,3 +5,3 @@ (function(d3, fc) {

var form = document.forms['crosshair-1-form'];
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);
data.crosshair = [];

@@ -8,0 +8,0 @@

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);
data.crosshair = [];

@@ -6,0 +6,0 @@

@@ -5,3 +5,3 @@ (function(d3, fc) {

var form = document.forms['fan-form'];
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);
data.fibonacciFan = [];

@@ -8,0 +8,0 @@

@@ -5,3 +5,3 @@ (function(d3, fc) {

var form = document.forms['measure-1-form'];
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);
data.measure = [];

@@ -8,0 +8,0 @@

(function(d3, fc) {
'use strict';
var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);
data.measure = [];

@@ -6,0 +6,0 @@

@@ -13,3 +13,3 @@ (function(d3, fc) {

var data = fc.dataGenerator().startDate(new Date(2014, 1, 1))(50);
var data = fc.data.random.financial().startDate(new Date(2014, 1, 1))(50);

@@ -16,0 +16,0 @@ // Calculate the scale domain

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc