diff --git a/client/galaxy/scripts/apps/analysis.js b/client/galaxy/scripts/apps/analysis.js index e5d7fb4b94c..4c452c67d27 100644 --- a/client/galaxy/scripts/apps/analysis.js +++ b/client/galaxy/scripts/apps/analysis.js @@ -17,13 +17,13 @@ import Workflows from "mvc/workflow/workflow"; import HistoryImport from "components/HistoryImport.vue"; import HistoryView from "components/HistoryView.vue"; import HistoryList from "mvc/history/history-list"; +import PluginList from "components/PluginList.vue"; import ToolFormComposite from "mvc/tool/tool-form-composite"; import QueryStringParsing from "utils/query-string-parsing"; import Utils from "utils/utils"; import Ui from "mvc/ui/ui-misc"; import DatasetError from "mvc/dataset/dataset-error"; import DatasetEditAttributes from "mvc/dataset/dataset-edit-attributes"; -import Visualization from "mvc/visualization/visualization-view"; import Citations from "components/Citations.vue"; import DisplayStructure from "components/DisplayStructured.vue"; import Vue from "vue"; @@ -57,9 +57,9 @@ window.app = function app(options, bootstrapped) { "(/)pages(/)create(/)": "show_pages_create", "(/)pages(/)edit(/)": "show_pages_edit", "(/)pages(/)(:action_id)": "show_pages", + "(/)visualizations(/)": "show_plugins", "(/)visualizations(/)edit(/)": "show_visualizations_edit", "(/)visualizations/show/(:visualization_id)": "show_visualizations_client", - "(/)visualizations/dataset_id=(:dataset_id)": "show_visualizations_selector", "(/)visualizations/(:action_id)": "show_visualizations", "(/)workflows/import_workflow": "show_import_workflow", "(/)workflows/run(/)": "show_run", @@ -101,14 +101,11 @@ window.app = function app(options, bootstrapped) { var model = new UserPreferences.Model({ user_id: Galaxy.params.id }); - this.page.display(new FormWrapper.View(_.extend( - model.get(form_id), - {active_tab: "user"} - ))); + this.page.display(new FormWrapper.View(_.extend(model.get(form_id), { active_tab: "user" }))); }, show_visualizations: function(action_id) { - var activeTab = action_id=="list_published"?"shared":"visualization"; + var activeTab = action_id == "list_published" ? "shared" : "visualization"; this.page.display( new GridShared.View({ action_id: action_id, @@ -129,14 +126,6 @@ window.app = function app(options, bootstrapped) { ); }, - show_visualizations_selector: function(dataset_id) { - this.page.display( - new Visualization.View({ - dataset_id: dataset_id - }) - ); - }, - show_workflows_published: function() { this.page.display( new GridView({ @@ -215,7 +204,7 @@ window.app = function app(options, bootstrapped) { }, show_pages: function(action_id) { - var activeTab = action_id=="list_published"?"shared":"user"; + var activeTab = action_id == "list_published" ? "shared" : "user"; this.page.display( new GridShared.View({ action_id: action_id, @@ -246,6 +235,13 @@ window.app = function app(options, bootstrapped) { ); }, + show_plugins: function() { + var pluginListInstance = Vue.extend(PluginList); + var vm = document.createElement("div"); + this.page.display(vm); + new pluginListInstance().$mount(vm); + }, + show_workflows: function() { this.page.display(new Workflows.View()); }, @@ -331,10 +327,7 @@ window.app = function app(options, bootstrapped) { Utils.get({ url: `${Galaxy.root}api/workflows/${Utils.getQueryString("id")}/download?style=run`, success: response => { - this.page.display(new ToolFormComposite.View(_.extend( - response, - {active_tab: "workflow"} - ))); + this.page.display(new ToolFormComposite.View(_.extend(response, { active_tab: "workflow" }))); }, error: response => { var error_msg = response.err_msg || "Error occurred while loading the resource."; diff --git a/client/galaxy/scripts/components/HistoryImport.vue b/client/galaxy/scripts/components/HistoryImport.vue index e40da1c7ab5..d44063bdc42 100644 --- a/client/galaxy/scripts/components/HistoryImport.vue +++ b/client/galaxy/scripts/components/HistoryImport.vue @@ -7,7 +7,7 @@
-
+
{{ errormessage }}
@@ -57,7 +57,7 @@ export default { }; diff --git a/client/galaxy/scripts/components/PluginList.vue b/client/galaxy/scripts/components/PluginList.vue new file mode 100644 index 00000000000..e30094e061e --- /dev/null +++ b/client/galaxy/scripts/components/PluginList.vue @@ -0,0 +1,136 @@ + + + diff --git a/client/galaxy/scripts/layout/menu.js b/client/galaxy/scripts/layout/menu.js index 8af6fd22d16..6b41b82a345 100644 --- a/client/galaxy/scripts/layout/menu.js +++ b/client/galaxy/scripts/layout/menu.js @@ -42,6 +42,33 @@ var Collection = Backbone.Collection.extend({ url: "workflows/list" }); + // + // Visualization tab. + // + this.add({ + id: "visualization", + title: _l("Visualize"), + url: "visualizations/list", + tooltip: _l("Visualize datasets"), + disabled: !Galaxy.user.id, + menu: [ + { + title: _l("Create Visualization"), + url: "visualizations" + }, + { + title: _l("Interactive Environments"), + url: "visualization/gie_list", + target: "galaxy_main" + }, + { + title: _l("Saved Visualizations"), + url: "visualizations/list", + target: "_frame" + } + ] + }); + // // 'Shared Items' or Libraries tab. // @@ -74,34 +101,6 @@ var Collection = Backbone.Collection.extend({ ] }); - // - // Visualization tab. - // - this.add({ - id: "visualization", - title: _l("Visualization"), - url: "visualizations/list", - tooltip: _l("Visualize datasets"), - disabled: !Galaxy.user.id, - menu: [ - { - title: _l("New Track Browser"), - url: "visualization/trackster", - target: "_frame" - }, - { - title: _l("Saved Visualizations"), - url: "visualizations/list", - target: "_frame" - }, - { - title: _l("Interactive Environments"), - url: "visualization/gie_list", - target: "galaxy_main" - } - ] - }); - // // Webhooks // @@ -272,20 +271,25 @@ var Collection = Backbone.Collection.extend({ target: "_top", divider: true }, - { - title: _l("Saved Histories"), - url: "histories/list", - target: "_top" - }, { title: _l("Saved Datasets"), url: "datasets/list", target: "_top" }, + { + title: _l("Saved Histories"), + url: "histories/list", + target: "_top" + }, { title: _l("Saved Pages"), url: "pages/list", target: "_top" + }, + { + title: _l("Saved Visualizations"), + url: "visualizations/list", + target: "_top" } ] }; @@ -340,13 +344,13 @@ var Tab = Backbone.View.extend({ .attr("title", this.model.get("tooltip")) .tooltip("destroy"); this.model.get("tooltip") && this.$toggle.tooltip({ placement: "bottom" }); - if(!this.model.get("menu")){ + if (!this.model.get("menu")) { this.$dropdown .removeClass() .addClass("dropdown") .addClass(this.model.get("disabled") && "disabled") .addClass(this.model.get("active") && "active"); - }; + } if (this.model.get("menu") && this.model.get("show_menu")) { this.$menu.show(); $("#dd-helper") diff --git a/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js b/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js index cc38029959c..48d4cc2bd6a 100644 --- a/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js +++ b/client/galaxy/scripts/mvc/dataset/dataset-li-edit.js @@ -261,7 +261,7 @@ var DatasetListItemEdit = _super.extend( } if (visualizations.length >= 1) { - var url = Galaxy.root + "visualizations/dataset_id=" + this.model.get("id"); + var url = Galaxy.root + "plugins?dataset_id=" + this.model.get("id"); return $("") .addClass("visualization-link icon-btn") .attr("href", url) diff --git a/client/galaxy/scripts/mvc/form/form-parameters.js b/client/galaxy/scripts/mvc/form/form-parameters.js index bda898a9322..5c7a9abd89e 100644 --- a/client/galaxy/scripts/mvc/form/form-parameters.js +++ b/client/galaxy/scripts/mvc/form/form-parameters.js @@ -84,23 +84,10 @@ export default Backbone.Model.extend({ } // identify display type - var SelectClass = Ui.Select; - switch (input_def.display) { - case "checkboxes": - SelectClass = Ui.Checkbox; - break; - case "radio": - SelectClass = Ui.Radio; - break; - case "radiobutton": - SelectClass = Ui.RadioButton; - break; - } - - // create select field - return new SelectClass.View({ + return new Ui.TextSelect({ id: `field-${input_def.id}`, data: data, + display: input_def.display, error_text: input_def.error_text || "No options available", readonly: input_def.readonly, multiple: input_def.multiple, diff --git a/client/galaxy/scripts/mvc/form/form-wrapper.js b/client/galaxy/scripts/mvc/form/form-wrapper.js index 49247a8f8c0..5109b7f6aec 100644 --- a/client/galaxy/scripts/mvc/form/form-wrapper.js +++ b/client/galaxy/scripts/mvc/form/form-wrapper.js @@ -6,7 +6,7 @@ var View = Backbone.View.extend({ this.model = new Backbone.Model(options); this.url = this.model.get("url"); this.redirect = this.model.get("redirect"); - if (options && options.active_tab){ + if (options && options.active_tab) { this.active_tab = options.active_tab; } this.setElement("
"); diff --git a/client/galaxy/scripts/mvc/grid/grid-shared.js b/client/galaxy/scripts/mvc/grid/grid-shared.js index 170ad392ba6..09829e25c1e 100644 --- a/client/galaxy/scripts/mvc/grid/grid-shared.js +++ b/client/galaxy/scripts/mvc/grid/grid-shared.js @@ -9,7 +9,7 @@ var View = Backbone.View.extend({ this.model = new Backbone.Model(options); this.item = this.model.get("item"); this.title = this.model.get("plural"); - if (options && options.active_tab){ + if (options && options.active_tab) { this.active_tab = options.active_tab; } $.ajax({ diff --git a/client/galaxy/scripts/mvc/history/history-list.js b/client/galaxy/scripts/mvc/history/history-list.js index 4a470694915..9b4a01b5403 100644 --- a/client/galaxy/scripts/mvc/history/history-list.js +++ b/client/galaxy/scripts/mvc/history/history-list.js @@ -107,10 +107,9 @@ var View = Backbone.View.extend({ var self = this; LoadingIndicator.markViewAsLoading(this); - if(options.action_id == "list_published"){ + if (options.action_id == "list_published") { this.active_tab = "shared"; - } - else if (options.action_id = "list"){ + } else if ((options.action_id = "list")) { this.active_tab = "user"; } this.model = new Backbone.Model(); diff --git a/client/galaxy/scripts/mvc/tool/tool-form-composite.js b/client/galaxy/scripts/mvc/tool/tool-form-composite.js index a2123487dcc..45ac7882d83 100644 --- a/client/galaxy/scripts/mvc/tool/tool-form-composite.js +++ b/client/galaxy/scripts/mvc/tool/tool-form-composite.js @@ -15,7 +15,7 @@ var View = Backbone.View.extend({ this.modal = parent.Galaxy.modal || new Modal.View(); this.model = (options && options.model) || new Backbone.Model(options); this.deferred = new Deferred(); - if (options && options.active_tab){ + if (options && options.active_tab) { this.active_tab = options.active_tab; } this.setElement( @@ -303,17 +303,17 @@ var View = Backbone.View.extend({ }); this._append(this.$steps, this.history_form.$el); }, - + /** Render Workflow Options */ _renderResourceParameters: function() { this.workflow_resource_parameters_form = null; - if(!_.isEmpty(this.model.get('workflow_resource_parameters'))){ + if (!_.isEmpty(this.model.get("workflow_resource_parameters"))) { this.workflow_resource_parameters_form = new Form({ - cls : 'ui-portlet-narrow', - title : 'Workflow Resource Options', - inputs : this.model.get('workflow_resource_parameters') + cls: "ui-portlet-narrow", + title: "Workflow Resource Options", + inputs: this.model.get("workflow_resource_parameters") }); - this._append( this.$steps, this.workflow_resource_parameters_form.$el ); + this._append(this.$steps, this.workflow_resource_parameters_form.$el); } }, @@ -538,7 +538,9 @@ var View = Backbone.View.extend({ var job_def = { new_history_name: history_form_data["new_history|name"] ? history_form_data["new_history|name"] : null, history_id: !history_form_data["new_history|name"] ? this.model.get("history_id") : null, - resource_params: this.workflow_resource_parameters_form ? this.workflow_resource_parameters_form.data.create() : {}, + resource_params: this.workflow_resource_parameters_form + ? this.workflow_resource_parameters_form.data.create() + : {}, replacement_params: this.wp_form ? this.wp_form.data.create() : {}, parameters: {}, // Tool form will submit flat maps for each parameter diff --git a/client/galaxy/scripts/mvc/ui/ui-buttons.js b/client/galaxy/scripts/mvc/ui/ui-buttons.js index 75dc7033f3b..b496778bfb8 100644 --- a/client/galaxy/scripts/mvc/ui/ui-buttons.js +++ b/client/galaxy/scripts/mvc/ui/ui-buttons.js @@ -14,7 +14,8 @@ var ButtonDefault = Backbone.View.extend({ wait_text: "Sending...", wait_cls: "btn btn-info", disabled: false, - percentage: -1 + percentage: -1, + visible: true }).set(options); this.setElement( $("'),i=r('
');if(i.append('x'),t.scale_height_enabled&&t.data.max_height_obsMaximum Observed "+a+'
";if(i.append(l),"score"!==t.data.height_calc&&"aa"===t.data.alphabet&&t.data.probs_arr){var c=null,f=null,h="",d="";"default"===t.colorscheme?c="checked":f="checked",e.help&&(h='help',d='help');var p='
Color Scheme
";i.append(p)}if(t.data.ali_map){var g=null,v=null,m="",y="";0===t.display_ali_map?g="checked":v="checked",e.help&&(m='help',y='help');var _='
Coordinates
";i.append(_)}var b=r('
');return t.zoom_enabled&&b.append(''),i.children().length>0&&(b.append(''),b.append(i)),n.append(b),n}},function(t,e){"use strict";t.exports=function(t,e){e=e||{},this.value=t,this.width=parseInt(e.width,10)||100,"W"===this.value&&(this.width+=30*this.width/100),this.height=parseInt(e.height,10)||100,this.color=e.color||"#000000",this.fontSize=e.fontSize||138,this.scaled=function(){},this.draw=function(t,e,n,r,i,o){var s=e/this.height,u=n/this.width,a=t.font;t.transform(u,0,0,s,r,i),t.fillStyle=o||this.color,t.textAlign="center",t.font="bold "+this.fontSize+"px Arial",t.fillText(this.value,0,0),t.setTransform(1,0,0,1,0,0),t.fillStyle="#000000",t.font=a}}},function(t,e,n){"use strict";function r(t,e,n,r,i){var o=s(t).find("#canv_"+r);return o.length||(s(t).append(''),o=s(t).find("#canv_"+r)),s(o).attr("width",n).attr("height",e),o[0]}var i=n(86),o=n(85),s=n(5);t.exports=function(t){if(this.data){var e=(t=t||{}).zoom||this.zoom,n=t.target||1,s=(t.scaled,this.dom_element.parent().attr("width")),u=1,a=null,l=null,c=0;if(this.previous_target=n,t.start&&(this.start=t.start),t.end&&(this.end=t.end),e<=.1?e=.1:e>=1&&(e=1),this.zoom=e,a=this.end||this.data.heightArr.length,l=(l=(l=this.start||1)>(a=(a=a>this.data.heightArr.length?this.data.heightArr.length:a)1?l:1,this.y=this.height-20,this.max_width=this.column_width*(a-l+1),s>this.max_width&&(e=1,this.zoom_enabled=!1),this.zoom=e,this.zoomed_column=this.column_width*e,this.total_width=this.zoomed_column*(a-l+1),e<1)for(;this.total_width=1)););n>this.total_width&&(n=this.total_width),this.dom_element.attr({width:this.total_width+"px"}).css({width:this.total_width+"px"}),this.canvas_width=this.total_width;var f=Math.ceil(this.total_width/this.canvas_width);for(this.columns_per_canvas=Math.ceil(this.canvas_width/this.zoomed_column),this.previous_zoom!==this.zoom&&(this.dom_element.find("canvas").remove(),this.previous_zoom=this.zoom,this.rendered=[]),this.canvases=[],this.contexts=[],c=0;ca&&(d=a);var p=(d-h+1)*this.zoomed_column;p>u&&(u=p);var g=u*c,v=g+p;if(ng-g/2)if(this.canvases[c]=r(this.dom_element,this.height,p,c,u),this.contexts[c]=this.canvases[c].getContext("2d"),this.contexts[c].setTransform(1,0,0,1,0,0),this.contexts[c].clearRect(0,0,p,this.height),this.contexts[c].fillStyle="#ffffff",this.contexts[c].fillRect(0,0,v,this.height),this.zoomed_column>12){var m=parseInt(10*e,10);m=m>10?10:m,this.debug&&o.call(this,h,d,c,1),i.call(this,h,d,c,m)}else o.call(this,h,d,c)}!this.scrollme&&this.options.scroller&&(this.scrollme=new EasyScroller(this.dom_element[0],{scrollingX:1,scrollingY:0,eventTarget:this.called_on})),1!==n&&this.scrollme.reflow()}}},function(t,e,n){"use strict";function r(t,e,n,r,i,o,s,u){var a="#ffffff";u?(i>.1?a="#d7301f":i>.05?a="#fc8d59":i>.03&&(a="#fdcc8a"),t.fillStyle=a,t.fillRect(e,n+15,r,10),a="#ffffff",o>9?a="#d7301f":o>7?a="#fc8d59":o>4&&(a="#fdcc8a"),t.fillStyle=a,t.fillRect(e,n+30,r,10)):n+=30,a="#ffffff",s<.75?a="#2171b5":s<.85?a="#6baed6":s<.95&&(a="#bdd7e7"),t.fillStyle=a,t.fillRect(e,n,r,10)}var i=n(44),o=n(46),s=n(45);t.exports=function(t,e,n,u){var a=0,l=t,c=null,f=0,h=Math.abs(this.data.max_height)+Math.abs(this.data.min_height_obs),d=Math.round(100*Math.abs(this.data.max_height)/h),p=(Math.round(this.info_content_height*d/100),this.info_content_height,10);for(f=t;f<=e;f++){if(this.data.mmline&&1===this.data.mmline[f-1])this.contexts[n].fillStyle="#cccccc",this.contexts[n].fillRect(a,10,this.zoomed_column,this.height-40);else{var g=this.data.heightArr[f-1],v=0,m=(g.length,0);for(var m in g){var y=[m,g[m]];if(y[1]>.01){var _,b=parseFloat(y[1])/this.data.max_height,x=a,w=(this.info_content_height-2)*b,S=this.info_content_height-2-v-w;_="dynamic"===this.colorscheme?this.colors.getColor(y[0],{pos:f-1}):"consensus"===this.colorscheme?this.cmap[f-1][y[0]]||"#7a7a7a":this.colors[y[0]],u?(this.contexts[n].strokeStyle=_,this.contexts[n].strokeRect(x,S,this.zoomed_column,w)):(this.contexts[n].fillStyle=_,this.contexts[n].fillRect(x,S,this.zoomed_column,w)),v+=w}}}this.zoom<.2?p=20:this.zoom<.3&&(p=10),this.options.positionMarker&&f%p==0&&(this.options.show_probs&&o(this.contexts[n],a+this.zoomed_column,this.height-30,parseFloat(this.height),"#dddddd"),o(this.contexts[n],a+this.zoomed_column,0,5),c=this.display_ali_map?this.data.ali_map[f-1]:l,s(this.contexts[n],a-2,10,this.zoomed_column,c,10,!0)),this.options.show_probs&&r(this.contexts[n],a,this.height-42,this.zoomed_column,this.data.insert_probs[f-1],this.data.insert_lengths[f-1],this.data.delete_probs[f-1],this.show_inserts),this.options.show_probs&&(this.show_inserts?i(this.contexts[n],this.height-45,this.total_width):i(this.contexts[n],this.height-15,this.total_width)),this.options.border&&i(this.contexts[n],0,this.total_width),a+=this.zoomed_column,l++}}},function(t,e,n){"use strict";function r(t,e,n,r,o,s,u){var a=n-4,l="#ffffff",c="#555555";u&&(a=n-35),o<.75?(l="#2171b5",c="#ffffff"):o<.85?l="#6baed6":o<.95&&(l="#bdd7e7"),i(t,e,a,o,s,r,l,c)}function i(t,e,n,r,i,o,s,u){t.font=i+"px Arial",t.fillStyle=s,t.fillRect(e,n-10,o,14),t.textAlign="center",t.fillStyle=u,t.fillText(r,e+o/2,n)}function o(t,e){var n=e.ralign?e.x+t.zoomed_column:e.x,r=e.ralign?e.x+2:e.x;l(t.contexts[e.context_num],n,t.height-30,-30-t.height,"#dddddd"),l(t.contexts[e.context_num],n,0,5),c(t.contexts[e.context_num],r,10,t.zoomed_column,e.column_num,e.fontsize,e.ralign)}function s(t,e,n,r,o,s){var u="#ffffff",a="#555555";o>.1?(u="#d7301f",a="#ffffff"):o>.05?u="#fc8d59":o>.03&&(u="#fdcc8a"),i(t,e,n-20,o,s,r,u,a),o>.03&&l(t,e+r,n-30,-30-n,u)}function u(t,e,n,r,o,s){var u="#ffffff",a="#555555";o>9?(u="#d7301f",a="#ffffff"):o>7?u="#fc8d59":o>4&&(u="#fdcc8a"),i(t,e,n,o,s,r,u,a)}var a=n(44),l=n(46),c=n(45);t.exports=function(t,e,n,i){var c=0,f=t,h=null,d=0,p=Math.abs(this.data.max_height),g=isNaN(this.data.min_height_obs)?0:parseInt(this.data.min_height_obs,10),v=p+Math.abs(g),m=Math.round(100*Math.abs(this.data.max_height)/v),y=Math.round(this.info_content_height*m/100);this.info_content_height;for(this.info_content_height,this.info_content_height,e+3<=this.end&&(e+=3),d=t;d<=e;d++){if(this.data.mmline&&1===this.data.mmline[d-1])this.contexts[n].fillStyle="#cccccc",this.contexts[n].fillRect(c,10,this.zoomed_column,this.height-40);else{var _=this.data.heightArr[d-1],b=[];if(_){var x=0,w=(_.length,0),S=null;for(var w in _){var k=[w,_[w]],j=c+this.zoomed_column/2,O=null;if(k[1]>.01){O=parseFloat(k[1])/this.data.max_height;var E=this.info_content_height-2-x,M=(this.info_content_height-2)*O;b[w]=[M,this.zoomed_column,j,E],x+=M}}for(var w in _)b[w]&&this.letters[w]&&(S="dynamic"===this.colorscheme?this.colors.getColor(w,{pos:d-1}):"consensus"===this.colorscheme?this.cmap[d-1][w]||"#7a7a7a":null,this.letters[w].draw(this.contexts[n],b[w][0],b[w][1],b[w][2],b[w][3],S))}}h=this.display_ali_map?this.data.ali_map[d-1]:f,this.options.show_divider&&(this.zoom<.7?d%this.options.divider_step==0&&o(this,{context_num:n,x:c,fontsize:10,column_num:h,ralign:!0}):o(this,{context_num:n,x:c,fontsize:i,column_num:h})),this.options.show_probs&&(r(this.contexts[n],c,this.height,this.zoomed_column,this.data.delete_probs[d-1],i,this.show_inserts),l(this.contexts[n],c,this.height-15,5),this.show_inserts&&(s(this.contexts[n],c,this.height,this.zoomed_column,this.data.insert_probs[d-1],i),u(this.contexts[n],c,this.height-5,this.zoomed_column,this.data.insert_lengths[d-1],i),l(this.contexts[n],c,this.height-45,5),l(this.contexts[n],c,this.height-30,5))),c+=this.zoomed_column,f++}this.options.show_probs&&(this.show_inserts&&(a(this.contexts[n],this.height-30,this.total_width),a(this.contexts[n],this.height-45,this.total_width)),a(this.contexts[n],this.height-15,this.total_width)),this.options.border&&a(this.contexts[n],0,this.total_width)}},function(t,e){"use strict";var n=window.HTMLCanvasElement&&window.HTMLCanvasElement.prototype,r=window.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),i=r&&window.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=(r||o)&&window.atob&&window.ArrayBuffer&&window.Uint8Array&&function(t){var e,n,s,u,a,l;for(e=t.split(",")[0].indexOf("base64")>=0?atob(t.split(",")[1]):decodeURIComponent(t.split(",")[1]),n=new ArrayBuffer(e.length),s=new Uint8Array(n),u=0;u.8?"#6464ff":n>.6?"#9da5ff":n>.4?"#cccccc":"#ffffff"}},function(t,e){"use strict";t.exports={A:" #FF83FA",C:" #40E0D0",G:" #FF83FA",R:" #FF83FA",T:" #40E0D0",U:" #40E0D0",Y:" #40E0D0"}},function(t,e){"use strict";t.exports.stat=function(t){this.defaultColor="#ffffff",this.type="static",this.map=t,this.getColor=function(t){return void 0!==this.map[t]?this.map[t]:this.defaultColor}},t.exports.dyn=function(t,e){this.type="dyn",this.opt=e,void 0!==t.init?(t.init.call(this),this.getColor=t.run,this.reset=t.init):this.getColor=t}},function(t,e){"use strict";t.exports={A:"#5858a7",R:"#6b6b94",N:"#64649b",D:"#2121de",C:"#9d9d62",Q:"#8c8c73",E:"#0000ff",G:"#4949b6",H:"#60609f",I:"#ecec13",L:"#b2b24d",K:"#4747b8",M:"#82827d",F:"#c2c23d",P:"#2323dc",S:"#4949b6",T:"#9d9d62",W:"#c0c03f",Y:"#d3d32c",V:"#ffff00",B:"#4343bc",X:"#797986",Z:"#4747b8"}},function(t,e){"use strict";t.exports={A:"#ccff00",R:"#0000ff",N:"#cc00ff",D:"#ff0000",C:"#ffff00",Q:"#ff00cc",E:"#ff0066",G:"#ff9900",H:"#0066ff",I:"#66ff00",L:"#33ff00",K:"#6600ff",M:"#00ff00",F:"#00ff66",P:"#ffcc00",S:"#ff3300",T:"#ff6600",W:"#00ccff",Y:"#00ffcc",V:"#99ff00",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e){"use strict";t.exports={A:"#2cd3d3",R:"#708f8f",N:"#ff0000",D:"#e81717",C:"#a85757",Q:"#3fc0c0",E:"#778888",G:"#ff0000",H:"#708f8f",I:"#00ffff",L:"#1ce3e3",K:"#7e8181",M:"#1ee1e1",F:"#1ee1e1",P:"#f60909",S:"#e11e1e",T:"#738c8c",W:"#738c8c",Y:"#9d6262",V:"#07f8f8",B:"#f30c0c",X:"#7c8383",Z:"#5ba4a4"}},function(t,e){"use strict";t.exports={A:"#ffafaf",R:"#6464ff",N:"#00ff00",D:"#ff0000",C:"#ffff00",Q:"#00ff00",E:"#ff0000",G:"#ff00ff",H:"#6464ff",I:"#ffafaf",L:"#ffafaf",K:"#6464ff",M:"#ffafaf",F:"#ffc800",P:"#ff00ff",S:"#00ff00",T:"#00ff00",W:"#ffc800",Y:"#ffc800",V:"#ffafaf",B:"#fff",X:"#fff",Z:"#fff"}},function(t,e,n){var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};(function(){function n(t){return function(e,n,r,i){n=S(n,i,4);var o=!A(e)&&w.keys(e),s=(o||e).length,u=t>0?0:s-1;return arguments.length<3&&(r=e[o?o[u]:u],u+=t),function(e,n,r,i,o,s){for(;o>=0&&o0?0:i-1;o>=0&&o0?s=o>=0?o:Math.max(o+u,s):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(p.call(r,s,u),w.isNaN))>=0?o+s:-1;for(o=t>0?s:u-1;o>=0&&o=0&&e<=M};w.each=w.forEach=function(t,e,n){var r,i;if(e=S(e,n),A(t))for(r=0,i=t.length;r=0},w.invoke=function(t,e){var n=p.call(arguments,2),r=w.isFunction(e);return w.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},w.pluck=function(t,e){return w.map(t,w.property(e))},w.where=function(t,e){return w.filter(t,w.matcher(e))},w.findWhere=function(t,e){return w.find(t,w.matcher(e))},w.max=function(t,e,n){var r,i,o=-1/0,s=-1/0;if(null==e&&null!=t)for(var u=0,a=(t=A(t)?t:w.values(t)).length;uo&&(o=r);else e=k(e,n),w.each(t,function(t,n,r){((i=e(t,n,r))>s||i===-1/0&&o===-1/0)&&(o=t,s=i)});return o},w.min=function(t,e,n){var r,i,o=1/0,s=1/0;if(null==e&&null!=t)for(var u=0,a=(t=A(t)?t:w.values(t)).length;ur||void 0===n)return 1;if(ne?(s&&(clearTimeout(s),s=null),u=l,o=t.apply(r,i),s||(r=i=null)):s||!1===n.trailing||(s=setTimeout(a,c)),o}},w.debounce=function(t,e,n){var r,i,o,s,u,a=function a(){var l=w.now()-s;l=0?r=setTimeout(a,e-l):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,s=w.now();var l=n&&!r;return r||(r=setTimeout(a,e)),l&&(u=t.apply(o,i),o=i=null),u}},w.wrap=function(t,e){return w.partial(e,t)},w.negate=function(t){return function(){return!t.apply(this,arguments)}},w.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},w.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},w.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},w.once=w.partial(w.before,2);var N=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];w.keys=function(t){if(!w.isObject(t))return[];if(y)return y(t);var e=[];for(var n in t)w.has(t,n)&&e.push(n);return N&&u(t,e),e},w.allKeys=function(t){if(!w.isObject(t))return[];var e=[];for(var n in t)e.push(n);return N&&u(t,e),e},w.values=function(t){for(var e=w.keys(t),n=e.length,r=Array(n),i=0;i":">",'"':""","'":"'","`":"`"},q=w.invert(R),F=function(t){var e=function(e){return t[e]},n="(?:"+w.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};w.escape=F(R),w.unescape=F(q),w.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),w.isFunction(r)?r.call(t):r};var P=0;w.uniqueId=function(t){var e=++P+"";return t?t+e:e},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var B=/(.)^/,W={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,H=function(t){return"\\"+W[t]};w.template=function(t,e,n){!e&&n&&(e=n),e=w.defaults({},e,w.templateSettings);var r=RegExp([(e.escape||B).source,(e.interpolate||B).source,(e.evaluate||B).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,s,u){return o+=t.slice(i,u).replace(D,H),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(o+="';\n"+s+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var s=new Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var u=function(t){return s.call(this,t,w)},a=e.variable||"obj";return u.source="function("+a+"){\n"+o+"}",u},w.chain=function(t){var e=w(t);return e._chain=!0,e};var U=function(t,e){return t._chain?w(e).chain():e};w.mixin=function(t){w.each(w.functions(t),function(e){var n=w[e]=t[e];w.prototype[e]=function(){var t=[this._wrapped];return d.apply(t,arguments),U(this,n.apply(w,t))}})},w.mixin(w),w.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=c[t];w.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],U(this,n)}}),w.each(["concat","join","slice"],function(t){var e=c[t];w.prototype[t]=function(){return U(this,e.apply(this._wrapped,arguments))}}),w.prototype.value=function(){return this._wrapped},w.prototype.valueOf=w.prototype.toJSON=w.prototype.value,w.prototype.toString=function(){return""+this._wrapped},void 0===(r=function(){return w}.apply(e,[]))||(t.exports=r)}).call(void 0)},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.version=e.io=e.$=e.boneView=e.view=e.selcol=e.selection=e.utils=e.menu=e.model=e.msa=void 0;var o=n(8);Object.defineProperty(e,"selection",{enumerable:!0,get:function(){return i(o).default}});var s=n(9);Object.defineProperty(e,"selcol",{enumerable:!0,get:function(){return i(s).default}});var u=n(2);Object.defineProperty(e,"view",{enumerable:!0,get:function(){return i(u).default}});var a=n(4);Object.defineProperty(e,"boneView",{enumerable:!0,get:function(){return i(a).default}});var l=n(5);Object.defineProperty(e,"$",{enumerable:!0,get:function(){return i(l).default}});var c=i(n(125)),f=r(n(51)),h=r(n(113)),d=r(n(37)),p=n(10);e.default=function(){var t=function(t){return c.default.apply(this,t)};return t.prototype=c.default.prototype,new t(arguments)},e.msa=c.default,e.model=f,e.menu=h,e.utils=d;var g={xhr:n(21),fasta:p.fasta,clustal:p.clustal,gff:p.gff};e.io=g;var v;v="1.0.3",e.version=v},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(121)),o=r(n(119)),s=r(n(123)),u=r(n(124)),a=r(n(115)),l=r(n(122)),c=r(n(118)),f=r(n(117)),h=r(n(120)),d=r(n(116)),p=r(n(114)),g=n(4).extend({initialize:function(t){if(!t.msa)throw new Error("No msa instance provided. Please provide .msa");if(this.msa=t.msa,this.msa.g.menuconfig=new p.default(t.menu),this.addView("10_import",new i.default({model:this.msa.seqs,g:this.msa.g,msa:this.msa})),this.addView("15_ordering",new l.default({model:this.msa.seqs,g:this.msa.g})),this.addView("20_filter",new o.default({model:this.msa.seqs,g:this.msa.g})),this.addView("30_selection",new s.default({model:this.msa.seqs,g:this.msa.g})),this.addView("40_vis",new u.default({model:this.msa.seqs,g:this.msa.g})),this.addView("50_color",new a.default({model:this.msa.seqs,g:this.msa.g})),this.addView("70_extra",new c.default({model:this.msa.seqs,g:this.msa.g,msa:this.msa})),this.addView("80_export",new f.default({model:this.msa.seqs,g:this.msa.g,msa:this.msa})),this.addView("90_help",new h.default({g:this.msa.g})),this.msa.g.config.get("debug"))return this.addView("95_debug",new d.default({g:this.msa.g}))},render:function(){return this.renderSubviews(),this.el.setAttribute("class","smenubar"),this.el.appendChild(document.createElement("p"))}});e.default=g},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(112);Object.defineProperty(e,"defaultmenu",{enumerable:!0,get:function(){return r(i).default}});var o=n(6);Object.defineProperty(e,"menubuilder",{enumerable:!0,get:function(){return r(o).default}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1).Model,i=r.extend({constructor:function(t,e){return"small"==t&&(t=this.small),r.apply(this,[t])},small:{menuFontsize:"12px"},defaults:{menuFontsize:"14px",menuItemFontsize:"14px",menuItemLineHeight:"14px",menuMarginLeft:"3px",menuPadding:"3px 4px 3px 4px"}});e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(n(6)),i=n(7),o=r.default.extend({initialize:function(t){return this.g=t.g,this.el.style.display="inline-block",this.listenTo(this.g.colorscheme,"change",function(){return this.render()})},render:function(){var t=this.setName("Color scheme");this.removeAllNodes();for(var e,n=this.getColorschemes(),r=0;rt.model.getMaxLength()||isNaN(e)?void alert("invalid column"):t.g.zoomer.setLeftOffset(e)}),this.el.appendChild(this.buildDOM()),this}}));e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(n(6)).default.extend({initialize:function(t){return this.g=t.g,this.el.style.display="inline-block"},render:function(){var t=this;return this.setName("Filter"),this.addNode("Hide columns by threshold",function(e){var n=prompt("Enter threshold (in percent)",20);n/=100;for(var r=t.model.getMaxLength(),i=[],o=t.g.stats.scale(t.g.stats.conservation()),s=r-1,u=0;0=s;0=r;0e&&n.push(i)}return t.g.columns.set("hidden",n)}),this.addNode("Hide seqs by identity",function(){var e=prompt("Enter threshold (in percent)",20);return e/=100,t.model.each(function(t){if(t.get("identity")=0)return t.set("hidden",!0)})}),this.addNode("Hide seqs by gaps",function(){var e=prompt("Enter threshold (in percent)",40);return t.model.each(function(t,n){if(t.get("seq").reduce(function(t,e){return"-"===e?++t:void 0},0)>e)return t.set("hidden",!0)})}),this.addNode("Reset",function(){return t.g.columns.set("hidden",[]),t.model.each(function(t){if(t.get("hidden"))return t.set("hidden",!1)})}),this.el.appendChild(this.buildDOM()),this}});e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(n(6)).default.extend({initialize:function(t){return this.g=t.g},render:function(){return this.setName("Help"),this.addNode("About the project",function(){return window.open("https://github.com/wilzbach/msa")}),this.addNode("Report issues",function(){return window.open("https://github.com/wilzbach/msa/issues")}),this.addNode("User manual",function(){return window.open("https://github.com/wilzbach/msa/wiki/User-manual")}),this.el.style.display="inline-block",this.el.appendChild(this.buildDOM()),this}});e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(n(6)),i=n(14),o=r.default.extend({initialize:function(t){return this.g=t.g,this.el.style.display="inline-block",this.msa=t.msa},render:function(){var t=this,e=this.msa,n=i.mk("input");n.type="file",n.style.display="none",n.multiple=!0,n.addEventListener("change",function(){var t=n.files||[];return e.u.file.importFiles(t)}),this.el.appendChild(n);var r="(Fasta, Clustal, GFF, Jalview features, Newick)";return this.setName("Import"),this.addNode("URL",function(e){var n=prompt("URL "+r,"http://rostlab.org/~goldberg/clustalw2-I20140818-215249-0556-53699878-pg.clustalw");if(n.length>5)return t.msa.u.file.importURL(n,function(){})}),this.addNode("From file "+r,function(){return n.click()}),this.addNode("Drag & Drop",function(){return alert("Yep. Just drag & drop your file "+r)}),this.el.appendChild(this.buildDOM()),this}});e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(n(6)),i=n(7),o="↑",s="↓",u=r.default.extend({initialize:function(t){return this.g=t.g,this.order="ID",this.el.style.display="inline-block"},setOrder:function(t){return this.order=t,this.render()},render:function(){this.setName("Sorting"),this.removeAllNodes();for(var t,e=this.getComparators(),n=0;n0?1:r<0?-1:0},precode:n}),e.push({text:"Identity "+s,comparator:function(e,n){var r=t.ident[e.id]-t.ident[n.id];return r>0?-1:r<0?1:0},precode:n}),e.push({text:"Gaps "+o,comparator:function(e,n){var r=t.gaps[e.id]-t.gaps[n.id];return r>0?1:r<0?-1:0},precode:r}),e.push({text:"Gaps "+s,comparator:function(e,n){var r=t.gaps[e.id]-t.gaps[n.id];return r<0?1:r>0?-1:0},precode:r}),e.push({text:"Consensus to top",comparator:function(t){return!t.get("ref")}}),e}});e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(n(6)).default.extend({initialize:function(t){return this.g=t.g,this.el.style.display="inline-block"},render:function(){var t=this;return this.setName("Selection"),this.addNode("Find Motif (supports RegEx)",function(){var e=prompt("your search","D");return t.g.user.set("searchText",e)}),this.addNode("Invert columns",function(){return t.g.selcol.invertCol(function(){var e=[],n=t.model.getMaxLength(),r=0;if(0<=n)for(;r<=n;)e.push(r++);else for(;r>=n;)e.push(r--);return e}())}),this.addNode("Invert rows",function(){return t.g.selcol.invertRow(t.model.pluck("id"))}),this.addNode("Reset",function(){return t.g.selcol.reset()}),this.el.appendChild(this.buildDOM()),this}});e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(n(6)),i=n(7),o=r.default.extend({initialize:function(t){return this.g=t.g,this.el.style.display="inline-block",this.listenTo(this.g.vis,"change",this.render)},render:function(){var t=this;this.removeAllNodes(),this.setName("Vis.elements");for(var e,n=this.getVisElements(),r=0;r=0&&(f="grey"),void 0!==f&&null!==f&&(this.ctx.fillStyle=f,this.ctx.fillRect(a,i,t,e)),a+=t}}return this._drawSelection()},_drawSelection:function(){var t=this;if(!(this.dragStart.length>0)||this.prolongSelection){var e=this.g.zoomer.get("boxRectWidth"),n=this.g.zoomer.get("boxRectHeight"),r=n*this.model.length;this.ctx.fillStyle="#666666",this.ctx.globalAlpha=.9;for(var i=this.g.selcol.length,o=function(i){var o=t.g.selcol.at(i);if(!o)return"continue";var s=void 0,u=void 0;"column"===o.get("type")?t.ctx.fillRect(e*o.get("xStart"),0,e*(o.get("xEnd")-o.get("xStart")+1),r):"row"===o.get("type")?(s=t.model.filter(function(t){return t.get("id")===o.get("seqId")})[0],u=t.model.indexOf(s),t.ctx.fillRect(0,n*u,e*s.get("seq").length,n)):"pos"===o.get("type")&&(s=t.model.filter(function(t){return t.get("id")===o.get("seqId")})[0],u=t.model.indexOf(s),t.ctx.fillRect(e*o.get("xStart"),n*u,e*(o.get("xEnd")-o.get("xStart")+1),n))},s=0;s\t \t
\t
\t \t
\t \t
\t
\t \t \t \t
\t
\t'),render:function(){var t=this.model.getSizeRange(),e={value:this.model.getSize(),min:t[0],max:t[1],step:this.model.step||1};return this.$el.html(this.template(e)),this.isVisible?this.show():this.hide(),this},updateSlider:function(t){var e=t.target,n=parseInt(o(e).val());this.model.setSize(n)},clickButton:function(t){var e=t.target,n=o(e).data("action");return this.model[n],"function"==typeof this.model[n]&&this.model[n](),this},hide:function(){this.isVisible=!1,this.$el.find(".msa-scale-minimised").removeClass(this.toggleClass),this.$el.find(".msa-scale-maximised").addClass(this.toggleClass)},show:function(){this.isVisible=!1,this.$el.find(".msa-scale-minimised").addClass(this.toggleClass),this.$el.find(".msa-scale-maximised").removeClass(this.toggleClass)}});e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),i=n(4),o=n(14),s=(n(7),i.extend({initialize:function(t){return this.g=t.g,this.listenTo(this.g.user,"change:searchText",function(t,e){return this.search(e),this.render()}),this.sel=[],this.selPos=0},events:{scroll:"_sendScrollEvent"},render:function(){this.renderSubviews(),this.el.className="biojs_msa_searchresult";var t=this.g.user.get("searchText");return void 0!==t&&null!==t&&t.length>0&&(0===this.sel.length?this.el.textContent="no selection found":(this.resultBox=o.mk("div"),this.resultBox.className="biojs_msa_searchresult_ovbox",this.updateResult(),this.el.appendChild(this.resultBox),this.el.appendChild(this.buildBtns()))),this},updateResult:function(){var t="search pattern: "+this.g.user.get("searchText");t+=", selection: "+(this.selPos+1);var e=this.sel[this.selPos];return t+=" (",t+=e.get("xStart")+" - "+e.get("xEnd"),t+=", id: "+e.get("seqId"),t+=")",this.resultBox.textContent=t},buildBtns:function(){var t=this,e=o.mk("button");e.textContent="Prev",e.addEventListener("click",function(){return t.moveSel(-1)});var n=o.mk("button");n.textContent="Next",n.addEventListener("click",function(){return t.moveSel(1)});var r=o.mk("button");r.textContent="All",r.addEventListener("click",function(){return t.g.selcol.reset(t.sel)});var i=o.mk("div");return i.appendChild(e),i.appendChild(n),i.appendChild(r),i.className="biojs_msa_searchresult_row",i},moveSel:function(t){var e=this.selPos+t;return e<0||e>=this.sel.length?-1:(this.focus(e),this.selPos=e,this.updateResult())},focus:function(t){var e=this.sel[t],n=e.get("xStart");return this.g.zoomer.setLeftOffset(n),this.g.selcol.reset([e])},search:function(t){var e,n=new RegExp(t,"gi"),i=[],o=e=100042;return this.model.each(function(t){var e=t.get("seq");return function(){for(var s,u=[];s=n.exec(e);){var a=s.index,l={xStart:a,xEnd:a+s[0].length-1,seqId:t.get("id")};i.push(new r.possel(l)),u.push(o=Math.min(a,o))}return u}()}),this.g.selcol.reset(i),o===e&&(o=0),this.g.zoomer.setLeftOffset(o),this.sel=i}}));e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=r(n(126)),s=r(n(138)),u=r(n(127)),a=r(n(129)),l=r(n(128)),c=n(4).extend({initialize:function(t){return this.g=t.g,this.draw(),this.listenTo(this.g.stats,"reset",function(){return this.rerender()}),this.listenTo(this.model,"change:hidden",(0,i.debounce)(this.rerender,10)),this.listenTo(this.model,"sort",this.rerender),this.listenTo(this.model,"add",function(){}),this.listenTo(this.g.vis,"change:sequences",this.rerender),this.listenTo(this.g.vis,"change:overviewbox",this.rerender),this.listenTo(this.g.visorder,"change",this.rerender),this.listenTo(this.g.zoomer,"change:columnWidth",this.rerender),this.listenTo(this.g.vis,"change:scaleslider",this.rerender),this},draw:function(){if(this.removeViews(),this.g.vis.get("overviewbox")){var t=new u.default({model:this.model,g:this.g});t.ordering=this.g.visorder.get("overviewBox"),this.addView("overviewBox",t)}var e=new s.default({model:this.model,g:this.g});e.ordering=this.g.visorder.get("headerBox"),this.addView("headerBox",e);var n=new a.default({model:this.model,g:this.g});n.ordering=this.g.visorder.get("searchBox"),this.addView("searchbox",n);var r=new o.default({model:this.model,g:this.g});if(r.ordering=this.g.visorder.get("alignmentBody"),this.addView("body",r),this.g.vis.get("scaleslider")){var i=new l.default({model:this.g.scale,g:this.g});i.ordering=this.g.visorder.get("scaleSlider"),this.addView("scaleSlider",i)}return this},render:function(t){return this.renderSubviews(),this.el.className="biojs_msa_stage",this},rerender:function(){if(!this.g.config.get("manualRendering"))return this.draw(),this.render()}});e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0)for(var a,l=0;l=0)return u++;var i=n-u;return r.indexOf(n)>=0&&(0===i||r.indexOf(n-1)<0)?e._renderSelection({n:n,k:i,selection:r,mPrevSel:o,mNextSel:s,xZero:t.xZero,yZero:t.yZero,model:t.model}):void 0}())},c=0;0=a;0=l)&&o.indexOf(c)>=0;r=y;0=0||(void 0!==s&&null!==s&&s.indexOf(b)>=0||(this.ctx.moveTo(e+m,n),this.ctx.lineTo(m+f+e,n)),void 0!==u&&null!==u&&u.indexOf(b)>=0||(this.ctx.moveTo(m+e,h+n),this.ctx.lineTo(m+f+e,h+n)),m+=f)}return this.ctx.moveTo(e,n),this.ctx.lineTo(e,h+n),this.ctx.moveTo(e+d,n),this.ctx.lineTo(e+d,h+n),this.ctx.stroke(),this.ctx.strokeStyle=v,this.ctx.lineWidth=g},_getPrevNextSelection:function(t){var e=t.collection.prev(t),n=t.collection.next(t),r=void 0,i=void 0;return void 0!==e&&null!==e&&(r=this._getSelection(e)),void 0!==n&&null!==n&&(i=this._getSelection(n)),[r,i]}}),e.default=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},s=n(3),u=r(n(131)),a=r(n(133)),l=r(n(135)),c=r(n(132)),f=n(4),h=n(47),d=n(5),p=f.extend({tagName:"canvas",initialize:function(t){return this.g=t.g,this.listenTo(this.g.zoomer,"change:_alignmentScrollLeft change:_alignmentScrollTop",function(t,e,n){if(null==(void 0!==n&&null!==n?n.origin:void 0)||"canvasseq"!==n.origin)return this.render()}),this.listenTo(this.g.columns,"change:hidden",this.render),this.listenTo(this.g.zoomer,"change:alignmentWidth change:alignmentHeight",this.render),this.listenTo(this.g.colorscheme,"change",this.render),this.listenTo(this.g.selcol,"reset add",this.render),this.listenTo(this.model,"reset add",this.render),this.el.style.display="inline-block",this.el.style.overflowX="hidden",this.el.style.overflowY="hidden",this.el.className="biojs_msa_seqblock",this.ctx=this.el.getContext("2d"),this.cache=new u.default(this.g),this.coordsCache=new c.default(this.g,this.model),this.listenTo(this.g.zoomer,"change:residueFont",function(){return this.cache=new u.default(this.g),this.render()}),this.sel=new a.default(this.g,this.ctx),this._setColor(),this.throttleTime=0,this.throttleCounts=0,null!=document.documentElement.style.webkitAppearance?this.throttledDraw=function(){var t=+new Date;if(this.draw(),this.throttleTime+=+new Date-t,this.throttleCounts++,this.throttleCounts>15)return Math.ceil(this.throttleTime/this.throttleCounts),this.throttledDraw=this.draw}:this.throttledDraw=(0,s.throttle)(this.throttledDraw,30),this.manageEvents()},throttledDraw:function(){var t=+new Date;if(this.draw(),this.throttleTime+=+new Date-t,this.throttleCounts++,this.throttleCounts>15){var e=Math.ceil(this.throttleTime/this.throttleCounts);return e*=1.2,e=Math.max(20,e),this.throttledDraw=_.throttle(this.draw,e)}},manageEvents:function(){var t={mousedown:"_onmousedown",touchstart:"_ontouchstart"};return this.g.config.get("registerMouseClicks")&&(t.dblclick="_onclick"),this.g.config.get("registerMouseHover")&&(t.mousein="_onmousein",t.mouseout="_onmouseout"),t.mousewheel="_onmousewheel",t.DOMMouseScroll="_onmousewheel",this.delegateEvents(t),this.listenTo(this.g.config,"change:registerMouseHover",this.manageEvents),this.listenTo(this.g.config,"change:registerMouseClick",this.manageEvents),this.dragStart=[]},_setColor:function(){return this.color=this.g.colorscheme.getSelectedScheme()},draw:function(){if(this.el.width=this.el.width,null!=this.seqDrawer&&this.model.length>0)return this.seqDrawer.drawLetters(),this.seqDrawer.drawRows(this.sel._appendSelection,this.sel),this.seqDrawer.drawRows(this.drawFeatures,this)},drawFeatures:function(t){var e=this,n=this.g.zoomer.get("columnWidth"),r=this.g.zoomer.get("rowHeight");if(t.model.attributes.height>1){var i=function(){var i=e.ctx;return t.model.attributes.features.each(function(e){i.fillStyle=e.attributes.fillColor||"red";var o=e.attributes.xEnd-e.attributes.xStart+1,s=(e.attributes.row+1)*r;return i.fillRect(e.attributes.xStart*n+t.xZero,s+t.yZero,n*o,r)}),i.fillStyle="black",i.font=e.g.zoomer.get("residueFont")+"px mono",i.textBaseline="middle",i.textAlign="center",{v:t.model.attributes.features.each(function(e){var o=e.attributes.xEnd-e.attributes.xStart+1,s=(e.attributes.row+1)*r;return i.fillText(e.attributes.text,t.xZero+e.attributes.xStart*n+o/2*n,t.yZero+.5*r+s)})}}();if("object"===(void 0===i?"undefined":o(i)))return i.v}},render:function(){return this.el.setAttribute("height",this.g.zoomer.get("alignmentHeight")+"px"),this.el.setAttribute("width",this.g.zoomer.getAlignmentWidth()+"px"),this.g.zoomer._checkScrolling(this._checkScrolling([this.g.zoomer.get("_alignmentScrollLeft"),this.g.zoomer.get("_alignmentScrollTop")]),{header:"canvasseq"}),this._setColor(),this.seqDrawer=new l.default(this.g,this.ctx,this.model,{width:this.el.width,height:this.el.height,color:this.color,cache:this.cache}),this.throttledDraw(),this},_onmousemove:function(t,e){if(0!==this.dragStart.length){var n=h.abs(t),r=[n[0]-this.dragStart[0],n[1]-this.dragStart[1]],i=this.g.zoomer.get("canvasEventScale");e&&(i=3);for(var o=0;o<=1;o++)r[o]=r[o]*i;for(var s=[this.dragStartScroll[0]-r[0],this.dragStartScroll[1]-r[1]],u=0;u<=1;u++)s[u]=Math.round(s[u]);var a=this._checkScrolling(s);this.g.zoomer._checkScrolling(a,{origin:"canvasseq"});for(var l=0;l<=1;l++)a[l]!==s[l]&&(0===a[l]?(this.dragStart[l]=n[l],this.dragStartScroll[l]=0):this.dragStart[l]=n[l]-a[l]);return this.throttledDraw(),null!=t.preventDefault?(t.preventDefault(),t.stopPropagation()):void 0}},_ontouchmove:function(t){return this._onmousemove(t.changedTouches[0],!0),t.preventDefault(),t.stopPropagation()},_onmousedown:function(t){var e=this;return this.dragStart=h.abs(t),this.dragStartScroll=[this.g.zoomer.get("_alignmentScrollLeft"),this.g.zoomer.get("_alignmentScrollTop")],d(document.body).on("mousemove.overmove",function(t){return e._onmousemove(t)}),d(document.body).on("mouseup.overup",function(){return e._cleanup()}),t.preventDefault()},_ontouchstart:function(t){var e=this;return this.dragStart=h.abs(t.changedTouches[0]),this.dragStartScroll=[this.g.zoomer.get("_alignmentScrollLeft"),this.g.zoomer.get("_alignmentScrollTop")],d(document.body).on("touchmove.overtmove",function(t){return e._ontouchmove(t)}),d(document.body).on("touchend.overtend touchleave.overtleave touchcancel.overtcanel",function(t){return e._touchCleanup(t)})},_onmousewinout:function(t){if(t.toElement===document.body.parentNode)return this._cleanup()},_cleanup:function(){return this.dragStart=[],d(document.body).off(".overmove"),d(document.body).off(".overup"),d(document.body).off(".overout")},_touchCleanup:function(t){return t.changedTouches.length>0&&this._onmousemove(t.changedTouches[0],!0),this.dragStart=[],d(document.body).off(".overtmove"),d(document.body).off(".overtend"),d(document.body).off(".overtleave"),d(document.body).off(".overtcancel")},_onmousewheel:function(t){var e=h.wheelDelta(t);return this.g.zoomer.set("_alignmentScrollLeft",this.g.zoomer.get("_alignmentScrollLeft")+e[0]),this.g.zoomer.set("_alignmentScrollTop",this.g.zoomer.get("_alignmentScrollTop")+e[1]),t.preventDefault()},_onclick:function(t){var e=this._getClickPos(t);return void 0!==e&&null!==e&&(null!=e.feature?this.g.trigger("feature:click",e):this.g.trigger("residue:click",e)),this.throttledDraw()},_onmousein:function(t){var e=this._getClickPos(t);return void 0!==e&&null!==e&&(null!=e.feature?this.g.trigger("feature:mousein",e):this.g.trigger("residue:mousein",e)),this.throttledDraw()},_onmouseout:function(t){var e=this._getClickPos(t);return void 0!==e&&null!==e&&(null!=e.feature?this.g.trigger("feature:mouseout",e):this.g.trigger("residue:mouseout",e)),this.throttledDraw()},_getClickPos:function(t){var e=h.rel(t);e[0]+=this.g.zoomer.get("_alignmentScrollLeft");var n=Math.floor(e[0]/this.g.zoomer.get("columnWidth")),r=this.seqDrawer._getSeqForYClick(e[1]),o=i(r,2),s=o[0],u=o[1];n+=this.g.columns.calcHiddenColumns(n),s+=this.model.calcHiddenSeqs(s),n=Math.max(0,n),s=Math.max(0,s);var a=this.model.at(s).get("id");if(!(u>0))return{seqId:a,rowPos:n,evt:t};var l=this.model.at(s).get("features").getFeatureOnRow(u-1,n);return 0!==l.length?{seqId:a,feature:l[0],rowPos:n,evt:t}:void 0},_checkScrolling:function(t){for(var e=[this.coordsCache.maxScrollWidth,this.coordsCache.maxScrollHeight],n=0;n<=1;n++)t[n]>e[n]&&(t[n]=e[n]),t[n]<0&&(t[n]=0);return t}});e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,u=t[Symbol.iterator]();!(r=(s=u.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i={updateConfig:function(){this.rectWidth=this.g.zoomer.get("columnWidth"),this.rectHeight=this.g.zoomer.get("rowHeight")},drawLetters:function(){return this.updateConfig(),this.ctx.globalAlpha=this.g.colorscheme.get("opacity"),this.drawSeqs(function(t){return this.drawSeq(t,this._drawRect)}),this.ctx.globalAlpha=1,this.rectWidth>=this.g.zoomer.get("minLetterDrawSize")&&this.drawSeqs(function(t){return this.drawSeq(t,this._drawLetter)}),this},drawSeqs:function(t,e){var n=this.g.columns.get("hidden");e=e||this;for(var i=this.getStartSeq(),o=r(i,2),s=o[0],u=o[1],a=s;athis.height))break}},drawRows:function(t,e){return this.drawSeqs(function(n){return this.drawRow(n,t,e)})},drawRow:function(t,e,n){var r=this.g.zoomer.get("columnWidth"),i=Math.max(0,Math.abs(Math.ceil(-this.g.zoomer.get("_alignmentScrollLeft")/r))),o=-Math.abs(-this.g.zoomer.get("_alignmentScrollLeft")%r)-i*r,s=t.yPos;return e.call(n,{model:t.model,xZero:o,yZero:s,hidden:t.hidden})},getStartSeq:function(){for(var t=Math.max(0,Math.floor(this.g.zoomer.get("_alignmentScrollTop")/this.rectHeight))+1,e=0,n=0;el))break}},_drawRect:function(t,e){var n=t.color.getColor(e.c,{pos:e.x,y:e.y});if(void 0!==n&&null!==n)return t.ctx.fillStyle=n,t.ctx.fillRect(e.xPos,e.yPos,e.rectWidth,e.rectHeight)},_drawLetter:function(t,e){return t.ctx.drawImage(t.cache.getFontTile(e.c,e.rectWidth,e.rectHeight),e.xPos,e.yPos,e.rectWidth,e.rectHeight)}},o=function(t,e,n,r){return this.g=t,this.ctx=e,this.model=n,this.width=r.width,this.height=r.height,this.color=r.color,this.cache=r.cache,this.rectHeight=this.g.zoomer.get("rowHeight"),this.rectWidth=this.g.zoomer.get("columnWidth"),this};(0,n(3).extend)(o.prototype,i),e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});"function"==typeof Symbol&&Symbol.iterator;var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(12)),i=n(2),o=n(7),s=i.extend({className:"biojs_msa_conserv",initialize:function(t){this.g=t.g,this.listenTo(this.g.zoomer,"change:stepSize change:labelWidth change:columnWidth",this.render),this.listenTo(this.g.vis,"change:labels change:metacell",this.render),this.listenTo(this.g.columns,"change:scaling",this.render),this.listenTo(this.g.stats,"reset",this.render);var e=_.extend({},{fillColor:["#660","#ff0"],strokeColor:"#330",maxHeight:20,rectStyler:function(t,e){return t}},this.g.conservationConfig);return this.fillColor=e.fillColor,this.strokeColor=e.strokeColor,this.maxHeight=e.maxHeight,this.rectStyler=e.rectStyler,this.manageEvents()},colorer:function(t){var e=this,n=function(){return"none"};if("string"==typeof t)n=function(){return t};else if(Array.isArray(t)){t.length;var r="undefined"!=typeof d3&&!!d3.scale,i="undefined"!=typeof d3_scale;r||i?function(){var i=(r?d3.scale.linear():d3_scale.scaleLinear()).domain([0,e.maxHeight]).range(t);n=function(t){return i(t.height)}}():n=function(e){return t[0]}}return n},render:function(){var t=this.g.stats.scale(this.g.stats.conservation());o.removeAllChilds(this.el);var e=this.model.getMaxLength(),n=this.g.zoomer.get("columnWidth"),i=this.maxHeight,s=n*(e-this.g.columns.get("hidden").length),u=r.base({height:i,width:s});u.style.display="inline-block",u.style.cursor="pointer";for(var a=(this.rectData,this.colorer(this.fillColor)),l=this.colorer(this.strokeColor),c=this.rectStyler,f=this.g.zoomer.get("stepSize"),h=this.g.columns.get("hidden"),d=0,p=0;p=0)p+=f;else{s=n*f;for(var g=0,v=f-1,m=0;0=v;0=o;0=0)c+=u;else{i=n*u;for(var f=0,h=u-1,d=0;0=h;0=o;0=0)this.markerHidden(l,u,n),u+=n;else{var l=document.createElement("span");l.className="msa-col-header",l.style.width=e+"px",l.style.display="inline-block",l.textContent=(u+1)%r==0?u+1:(u+1)%n==0?".":" ",l.rowPos=u,s.appendChild(l)}return this.el.appendChild(s),this},markerHidden:function(t,e,n){for(var i=this,o=this.g.columns.get("hidden").slice(0),u=Math.max(0,e-n),a=!0,l=u;u=e;u=0;if(!a){var c=this.model.getMaxLength(),f=0,h=-1;for(e=e;(e=c)&&(h>=0||(h=o.indexOf(e)),o.indexOf(e)>=0);e0?this.el.style.fontWeight="bold":this.el.style.fontWeight="normal"}});e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(7),o=r.extend({initialize:function(t){return this.seq=t.seq,this.g=t.g,this.manageEvents()},manageEvents:function(){var t={};return this.g.config.get("registerMouseClicks")&&(t.click="_onclick"),this.g.config.get("registerMouseHover")&&(t.mousein="_onmousein",t.mouseout="_onmouseout"),this.delegateEvents(t),this.listenTo(this.g.config,"change:registerMouseHover",this.manageEvents),this.listenTo(this.g.config,"change:registerMouseClick",this.manageEvents),this.listenTo(this.g.vis,"change:labelName change:labelId change:labelPartition change:labelCheckbox",this.render),this.listenTo(this.g.zoomer,"change:labelIdLength change:labelNameLength change:labelPartLength change:labelCheckLength",this.render),this.listenTo(this.g.zoomer,"change:labelFontSize change:labelLineHeight change:labelWidth change:rowHeight",this.render)},render:function(){if(i.removeAllChilds(this.el),this.el.style.width=this.g.zoomer.getLabelWidth()+"px",this.el.setAttribute("class","biojs_msa_labels"),this.g.vis.get("labelCheckbox")){var t=document.createElement("input");t.setAttribute("type","checkbox"),t.value=this.model.get("id"),t.name="seq",t.style.width=this.g.zoomer.get("labelCheckLength")+"px",this.el.appendChild(t)}if(this.g.vis.get("labelId")){var e=document.createElement("span"),n=this.model.get("id");isNaN(n)||n++,e.textContent=n,e.style.width=this.g.zoomer.get("labelIdLength")+"px",e.style.display="inline-block",this.el.appendChild(e)}if(this.g.vis.get("labelPartition")){var r=document.createElement("span");r.style.width=this.g.zoomer.get("labelPartLength")+"px",r.textContent=this.model.get("partition"),r.style.display="inline-block",this.el.appendChild(e),this.el.appendChild(r)}if(this.g.vis.get("labelName")){var o=document.createElement("span");o.textContent=this.model.get("name"),this.model.get("ref")&&this.g.config.get("hasRef")&&(o.style.fontWeight="bold"),o.style.width=this.g.zoomer.get("labelNameLength")+"px",this.el.appendChild(o)}return this.el.style.overflow=scroll,this.el.style.fontSize=this.g.zoomer.get("labelFontsize")+"px",this},_onclick:function(t){var e=this.model.get("id");return this.g.trigger("row:click",{seqId:e,evt:t})},_onmousein:function(t){var e=this.model.get("id");return this.g.trigger("row:mouseout",{seqId:e,evt:t})},_onmouseout:function(t){var e=this.model.get("id");return this.g.trigger("row:mouseout",{seqId:e,evt:t})}});e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),i=function(t){return t&&t.__esModule?t:{default:t}}(n(6)),o=n(3),s=n(2),u=n(7),a=s.extend({className:"biojs_msa_metaview",initialize:function(t){return this.g=t.g,this.listenTo(this.g.vis,"change:metacell",this.render),this.listenTo(this.g.zoomer,"change:metaWidth",this.render)},events:{click:"_onclick",mousein:"_onmousein",mouseout:"_onmouseout"},render:function(){u.removeAllChilds(this.el),this.el.style.display="inline-block";var t=this.g.zoomer.getMetaWidth();if(this.el.style.width=t-10,this.el.style.paddingRight=5,this.el.style.paddingLeft=5,this.el.style.fontSize=this.g.zoomer.get("labelFontsize")-2+"px",this.g.vis.get("metaGaps")){var e=this.model.get("seq"),n=(0,o.reduce)(e,function(t,e){return"-"===e?++t:void 0},0);n=(100*n/e.length).toFixed(0)+"%";var s=document.createElement("span");s.textContent=n,s.style.display="inline-block",s.style.width=35,this.el.appendChild(s)}if(this.g.vis.get("metaIdentity")){var a=this.g.stats.identity()[this.model.id],l=document.createElement("span");this.model.get("ref")&&this.g.config.get("hasRef")?l.textContent="ref.":void 0!==a&&null!==a&&(l.textContent=a.toFixed(2)),l.style.display="inline-block",l.style.width=40,this.el.appendChild(l)}if(this.g.vis.get("metaLinks")&&this.model.attributes.ids){var c=r.seqs.buildLinks(this.model.attributes.ids);if(Object.keys(c).length>0){var f=new i.default({name:"↗"});c.forEach(function(t,e){return f.addNode(e,function(e){return window.open(t)})});var h=f.buildDOM();return h.style.cursor="pointer",this.el.appendChild(h)}}},_onclick:function(t){return this.g.trigger("meta:click",{seqId:this.model.get("id",{evt:t})})},_onmousein:function(t){return this.g.trigger("meta:mousein",{seqId:this.model.get("id",{evt:t})})},_onmouseout:function(t){return this.g.trigger("meta:mouseout",{seqId:this.model.get("id",{evt:t})})}});e.default=a},function(t,e){(function(e){"use strict";"undefined"!=typeof window?t.exports=window:void 0!==e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(e,function(){return this}())},function(t,e,n){"use strict";var r=n(52);t.exports=function(t,e,n){if(!r(e))throw new TypeError("iterator must be a function");arguments.length<3&&(n=this),"[object Array]"===i.call(t)?function(t,e,n){for(var r=0,i=t.length;r=0&&m.splice(e,1)}function u(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function a(t){var e=document.createElement("link");return e.rel="stylesheet",o(t,e),e}function l(t,e){var n,r,i;if(e.singleton){var o=v++;n=g||(g=u(e)),r=c.bind(null,n,o,!1),i=c.bind(null,n,o,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=a(e),r=function(t,e){var n=e.css,r=e.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var i=new Blob([n],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}.bind(null,n),i=function(){s(n),n.href&&URL.revokeObjectURL(n.href)}):(n=u(e),r=function(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),i=function(){s(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}function c(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=y(e,i);else{var o=document.createTextNode(i),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(o,s[e]):t.appendChild(o)}}var f={},h=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}},d=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),p=h(function(){return document.head||document.getElementsByTagName("head")[0]}),g=null,v=0,m=[];t.exports=function(t,e){void 0===(e=e||{}).singleton&&(e.singleton=d()),void 0===e.insertAt&&(e.insertAt="bottom");var n=i(t);return r(n,e),function(t){for(var o=[],s=0;st?1:n>=t?0:NaN}function h(n){return null===n?NaN:+n}function p(n){return!isNaN(n)}function g(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}n.ascending=s,n.descending=function(n,t){return tn?1:t>=n?0:NaN},n.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ir&&(e=r)}else{for(;++i=r){e=r;break}for(;++ir&&(e=r)}return e},n.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ie&&(e=r)}else{for(;++i=r){e=r;break}for(;++ie&&(e=r)}return e},n.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u=r){e=i=r;break}for(;++ur&&(e=r),i=r){e=i=r;break}for(;++ur&&(e=r),i1)return o/(l-1)},n.deviation=function(){var t=n.variance.apply(this,arguments);return t?Math.sqrt(t):t};var v=g(s);function d(n){return n.length}n.bisectLeft=v.left,n.bisect=n.bisectRight=v.right,n.bisector=function(n){return g(1===n.length?function(t,e){return s(n(t),e)}:n)},n.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,u<2&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},n.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},n.pairs=function(n){for(var t=0,e=n.length-1,r=n[0],i=new Array(e<0?0:e);t=0;)for(t=(r=n[i]).length;--t>=0;)e[--o]=r[t];return e};var y=Math.abs;function m(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function M(){this._=Object.create(null)}n.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e==1/0)throw new Error("infinite range");var r,i=[],u=function(n){var t=1;for(;n*t%1;)t*=10;return t}(y(e)),o=-1;if(n*=u,t*=u,(e*=u)<0)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)=i.length)return e?e.call(r,u):t?u.sort(t):u;for(var l,c,f,s,h=-1,p=u.length,g=i[a++],v=new M;++h=i.length)return t;var r=[],o=u[e++];return t.forEach(function(t,i){r.push({key:t,values:n(i,e)})}),o?r.sort(function(n,t){return o(n.key,t.key)}):r}(o(n.map,t,0),0)},r.key=function(n){return i.push(n),r},r.sortKeys=function(n){return u[i.length-1]=n,r},r.sortValues=function(n){return t=n,r},r.rollup=function(n){return e=n,r},r},n.set=function(n){var t=new C;if(n)for(var e=0,r=n.length;e=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},n.event=null,n.requote=function(n){return n.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,O={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]};function I(n){return O(n,X),n}var Y=function(n,t){return t.querySelector(n)},Z=function(n,t){return t.querySelectorAll(n)},V=function(n,t){var e=n.matches||n[q(n,"matchesSelector")];return(V=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(Y=function(n,t){return Sizzle(n,t)[0]||null},Z=Sizzle,V=Sizzle.matchesSelector),n.selection=function(){return n.select(r.documentElement)};var X=n.selection.prototype=[];function $(n){return"function"==typeof n?n:function(){return Y(n,this)}}function B(n){return"function"==typeof n?n:function(){return Z(n,this)}}X.select=function(n){var t,e,r,i,u=[];n=$(n);for(var o=-1,a=this.length;++o=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),J.hasOwnProperty(e)?{space:J[e],local:n}:n}},X.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=n.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(G(e,t[e]));return this}return this.each(G(t,e))},X.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=nn(n)).length,i=-1;if(t=e.classList){for(;++i=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},X.sort=function(n){n=function(n){arguments.length||(n=s);return function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}.apply(this,arguments);for(var t=-1,e=this.length;++t0&&(t=t.slice(0,o));var l=gn.get(t);function c(){var n=this[u];n&&(this.removeEventListener(t,n,n.$),delete this[u])}return l&&(t=l,a=dn),o?r?function(){var n=a(r,e(arguments));c.call(this),this.addEventListener(t,this[u]=n,n.$=i),n._=r}:c:r?R:function(){var e,r=new RegExp("^__on([^.]+)"+n.requote(t)+"$");for(var i in this)if(e=i.match(r)){var u=this[i];this.removeEventListener(e[1],u,u.$),delete this[i]}}}n.selection.enter=sn,n.selection.enter.prototype=hn,hn.append=X.append,hn.empty=X.empty,hn.node=X.node,hn.call=X.call,hn.size=X.size,hn.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++a=r&&(r=t+1);!(o=a[r])&&++r0?1:n<0?-1:0}function qn(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function Tn(n){return n>1?0:n<-1?kn:Math.acos(n)}function Rn(n){return n>1?An:n<-1?-An:Math.asin(n)}function Dn(n){return((n=Math.exp(n))+1/n)/2}function Pn(n){return(n=Math.sin(n/2))*n}var Un=Math.SQRT2;n.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(h0&&(t=t.transition().duration(v)),t.call(_.event)}function E(){c&&c.domain(l.range().map(function(n){return(n-h.x)/h.k}).map(l.invert)),s&&s.domain(f.range().map(function(n){return(n-h.y)/h.k}).map(f.invert))}function A(n){d++||n({type:"zoomstart"})}function C(n){E(),n({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function z(n){--d||(n({type:"zoomend"}),e=null)}function L(){var t=this,e=b.of(t,arguments),r=0,i=n.select(u(t)).on(m,function(){r=1,k(n.mouse(t),o),C(e)}).on(M,function(){i.on(m,null).on(M,null),a(r),z(e)}),o=w(n.mouse(t)),a=Mn(t);oa.call(t),A(e)}function q(){var t,e=this,r=b.of(e,arguments),i={},u=0,o=".zoom-"+n.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,f=[],s=n.select(e),p=Mn(e);function g(){var r=n.touches(e);return t=h.k,r.forEach(function(n){n.identifier in i&&(i[n.identifier]=w(n))}),r}function v(){var t=n.event.target;n.select(t).on(l,d).on(c,m),f.push(t);for(var r=n.event.changedTouches,o=0,s=r.length;o1){y=p[0];var M=p[1],x=y[0]-M[0],b=y[1]-M[1];u=x*x+b*b}}function d(){var o,l,c,f,s=n.touches(e);oa.call(e);for(var h=0,p=s.length;h360?n-=360:n<0&&(n+=360),n<60?r+(i-r)*n/60:n<180?i:n<240?r+(i-r)*(240-n)/60:r}(n))}return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:t<0?0:t>1?1:t,r=2*(e=e<0?0:e>1?1:e)-(i=e<=.5?e*(1+t):e+t-e*t),new ut(u(n+120),u(n),u(n-120))}function Vn(t,e,r){return this instanceof Vn?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof Vn?new Vn(t.h,t.c,t.l):tt(t instanceof Bn?t.l:(t=ht((t=n.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Vn(t,e,r)}Yn.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new In(this.h,this.s,this.l/n)},Yn.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new In(this.h,this.s,n*this.l)},Yn.rgb=function(){return Zn(this.h,this.s,this.l)},n.hcl=Vn;var Xn=Vn.prototype=new On;function $n(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new Bn(e,Math.cos(n*=Cn)*t,Math.sin(n)*t)}function Bn(n,t,e){return this instanceof Bn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof Bn?new Bn(n.l,n.a,n.b):n instanceof Vn?$n(n.h,n.c,n.l):ht((n=ut(n)).r,n.g,n.b):new Bn(n,t,e)}Xn.brighter=function(n){return new Vn(this.h,this.c,Math.min(100,this.l+Wn*(arguments.length?n:1)))},Xn.darker=function(n){return new Vn(this.h,this.c,Math.max(0,this.l-Wn*(arguments.length?n:1)))},Xn.rgb=function(){return $n(this.h,this.c,this.l).rgb()},n.lab=Bn;var Wn=18,Jn=.95047,Gn=1,Kn=1.08883,Qn=Bn.prototype=new On;function nt(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return new ut(it(3.2404542*(i=et(i)*Jn)-1.5371385*(r=et(r)*Gn)-.4985314*(u=et(u)*Kn)),it(-.969266*i+1.8760108*r+.041556*u),it(.0556434*i-.2040259*r+1.0572252*u))}function tt(n,t,e){return n>0?new Vn(Math.atan2(e,t)*zn,Math.sqrt(t*t+e*e),n):new Vn(NaN,NaN,n)}function et(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function rt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function it(n){return Math.round(255*(n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ut(n,t,e){return this instanceof ut?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof ut?new ut(n.r,n.g,n.b):ft(""+n,ut,Zn):new ut(n,t,e)}function ot(n){return new ut(n>>16,n>>8&255,255&n)}function at(n){return ot(n)+""}Qn.brighter=function(n){return new Bn(Math.min(100,this.l+Wn*(arguments.length?n:1)),this.a,this.b)},Qn.darker=function(n){return new Bn(Math.max(0,this.l-Wn*(arguments.length?n:1)),this.a,this.b)},Qn.rgb=function(){return nt(this.l,this.a,this.b)},n.rgb=ut;var lt=ut.prototype=new On;function ct(n){return n<16?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function ft(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(gt(i[0]),gt(i[1]),gt(i[2]))}return(u=vt.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o|=o>>4,a=240&u,a|=a>>4,l=15&u,l|=l<<4):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function st(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=l<.5?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(t0&&l<1?0:r),new In(r,i,l)}function ht(n,t,e){var r=rt((.4124564*(n=pt(n))+.3575761*(t=pt(t))+.1804375*(e=pt(e)))/Jn),i=rt((.2126729*n+.7151522*t+.072175*e)/Gn);return Bn(116*i-16,500*(r-i),200*(i-rt((.0193339*n+.119192*t+.9503041*e)/Kn)))}function pt(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function gt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}lt.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&t=200&&t<300||304===t){try{n=i.call(o,c)}catch(n){return void a.error.call(o,n)}a.load.call(o,n)}else a.error.call(o,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=s:c.onreadystatechange=function(){c.readyState>3&&s()},c.onprogress=function(t){var e=n.event;n.event=t;try{a.progress.call(o,c)}finally{n.event=e}},o.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?l[n]:(null==t?delete l[n]:l[n]=t+"",o)},o.mimeType=function(n){return arguments.length?(r=null==n?null:n+"",o):r},o.responseType=function(n){return arguments.length?(f=n,o):f},o.response=function(n){return i=n,o},["get","post"].forEach(function(n){o[n]=function(){return o.send.apply(o,[n].concat(e(arguments)))}}),o.send=function(n,e,i){if(2===arguments.length&&"function"==typeof e&&(i=e,e=null),c.open(n,t,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var u in l)c.setRequestHeader(u,l[u]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=f&&(c.responseType=f),null!=i&&o.on("error",i).on("load",function(n){i(null,n)}),a.beforesend.call(o,c),c.send(null==e?null:e),o},o.abort=function(){return c.abort(),o},n.rebind(o,a,"on"),null==u?o:o.get(function(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}(u))}vt.forEach(function(n,t){vt.set(n,ot(t))}),n.functor=dt,n.xhr=yt(z),n.dsv=function(n,t){var e=new RegExp('["'+n+"\n]"),r=n.charCodeAt(0);function i(n,e,r){arguments.length<3&&(r=e,e=null);var i=mt(n,t,null==e?u:o(e),r);return i.row=function(n){return arguments.length?i.response(null==(e=n)?u:o(n)):e},i}function u(n){return i.parse(n.responseText)}function o(n){return function(t){return i.parse(t.responseText,n)}}function a(t){return t.map(l).join(n)}function l(n){return e.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}return i.parse=function(n,t){var e;return i.parseRows(n,function(n,r){if(e)return e(n,r-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");e=t?function(n,e){return t(i(n),e)}:i})},i.parseRows=function(n,t){var e,i,u={},o={},a=[],l=n.length,c=0,f=0;function s(){if(c>=l)return o;if(i)return i=!1,u;var t=c;if(34===n.charCodeAt(t)){for(var e=t;e++24?(isFinite(t)&&(clearTimeout(_t),_t=setTimeout(kt,t)),bt=0):(bt=1,wt(kt))}function Nt(){for(var n=Date.now(),t=Mt;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Et(){for(var n,t=Mt,e=1/0;t;)t.c?(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}});n.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=n.round(t,At(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Ct[8+r/3]};var zt=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Lt=n.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(t,e){return(t=n.round(t,At(t,e))).toFixed(Math.max(0,Math.min(20,At(t*(1+1e-15),e))))}});function qt(n){return n+""}var Tt=n.time={},Rt=Date;function Dt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Dt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Pt.setUTCDate.apply(this._,arguments)},setDay:function(){Pt.setUTCDay.apply(this._,arguments)},setFullYear:function(){Pt.setUTCFullYear.apply(this._,arguments)},setHours:function(){Pt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Pt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Pt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Pt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Pt.setUTCSeconds.apply(this._,arguments)},setTime:function(){Pt.setTime.apply(this._,arguments)}};var Pt=Date.prototype;function Ut(n,t,e){function r(t){var e=n(t),r=u(e,1);return t-e1)for(;o68?1900:2e3),e+i[0].length):-1}function Jt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Gt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Kt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function Qt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function ne(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function te(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ee(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function re(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ie(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=y(t)/60|0,i=y(t)%60;return e+It(r,"0",2)+It(i,"0",2)}function ue(n,t,e){Ot.lastIndex=0;var r=Ot.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function oe(n){for(var t=n.length,e=-1;++e0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),u.push(n.substring(e-=a,e+a)),!((l+=a+1)>t));)a=i[o=(o+1)%i.length];return u.reverse().join(r)}:z;return function(t){var r=zt.exec(t),i=r[1]||" ",a=r[2]||">",l=r[3]||"-",c=r[4]||"",f=r[5],s=+r[6],h=r[7],p=r[8],g=r[9],v=1,d="",y="",m=!1,M=!0;switch(p&&(p=+p.substring(1)),(f||"0"===i&&"="===a)&&(f=i="0",a="="),g){case"n":h=!0,g="g";break;case"%":v=100,y="%",g="f";break;case"p":v=100,y="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(d="0"+g.toLowerCase());case"c":M=!1;case"d":m=!0,p=0;break;case"s":v=-1,g="r"}"$"===c&&(d=u[0],y=u[1]),"r"!=g||p||(g="g"),null!=p&&("g"==g?p=Math.max(1,Math.min(21,p)):"e"!=g&&"f"!=g||(p=Math.max(0,Math.min(20,p)))),g=Lt.get(g)||qt;var x=f&&h;return function(t){var r=y;if(m&&t%1)return"";var u=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===l?"":l;if(v<0){var c=n.formatPrefix(t,p);t=c.scale(t),r=c.symbol+y}else t*=v;var b,_,w=(t=g(t,p)).lastIndexOf(".");if(w<0){var S=M?t.lastIndexOf("e"):-1;S<0?(b=t,_=""):(b=t.substring(0,S),_=t.substring(S))}else b=t.substring(0,w),_=e+t.substring(w+1);!f&&h&&(b=o(b,1/0));var k=d.length+b.length+_.length+(x?0:u.length),N=k"===a?N+u+t:"^"===a?N.substring(0,k>>=1)+u+t+N.substring(k):u+(x?t:N+t))+r}}}(t),timeFormat:function(t){var e=t.dateTime,r=t.date,i=t.time,u=t.periods,o=t.days,a=t.shortDays,l=t.months,c=t.shortMonths;function f(n){var t=n.length;function e(e){for(var r,i,u,o=[],a=-1,l=0;++a=c)return-1;if(37===(i=t.charCodeAt(a++))){if(o=t.charAt(a++),!(u=_[o in Ft?t.charAt(a++):o])||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}f.utc=function(n){var t=f(n);function e(n){try{var e=new(Rt=Dt);return e._=n,t(e)}finally{Rt=Date}}return e.parse=function(n){try{Rt=Dt;var e=t.parse(n);return e&&e._}finally{Rt=Date}},e.toString=t.toString,e},f.multi=f.utc.multi=oe;var h=n.map(),p=Yt(o),g=Zt(o),v=Yt(a),d=Zt(a),y=Yt(l),m=Zt(l),M=Yt(c),x=Zt(c);u.forEach(function(n,t){h.set(n.toLowerCase(),t)});var b={a:function(n){return a[n.getDay()]},A:function(n){return o[n.getDay()]},b:function(n){return c[n.getMonth()]},B:function(n){return l[n.getMonth()]},c:f(e),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+Tt.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return u[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(Tt.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(Tt.mondayOfYear(n),t,2)},x:f(r),X:f(i),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:ie,"%":function(){return"%"}},_={a:function(n,t,e){v.lastIndex=0;var r=v.exec(t.slice(e));return r?(n.w=d.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(n,t,e){p.lastIndex=0;var r=p.exec(t.slice(e));return r?(n.w=g.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(n,t,e){M.lastIndex=0;var r=M.exec(t.slice(e));return r?(n.m=x.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(n,t,e){y.lastIndex=0;var r=y.exec(t.slice(e));return r?(n.m=m.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(n,t,e){return s(n,b.c.toString(),t,e)},d:Kt,e:Kt,H:ne,I:ne,j:Qt,L:re,m:Gt,M:te,p:function(n,t,e){var r=h.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)},S:ee,U:Xt,w:Vt,W:$t,x:function(n,t,e){return s(n,b.x.toString(),t,e)},X:function(n,t,e){return s(n,b.X.toString(),t,e)},y:Wt,Y:Bt,Z:Jt,"%":ue};return f}(t)}};var ae=n.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function le(){}n.format=ae.numberFormat,n.geo={},le.prototype={s:0,t:0,add:function(n){fe(n,this.t,ce),fe(ce.s,this.s,this),this.s?this.t+=ce.t:this.s=ce.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ce=new le;function fe(n,t,e){var r=e.s=n+t,i=r-n,u=r-i;e.t=n-u+(t-i)}function se(n,t){n&&pe.hasOwnProperty(n.type)&&pe[n.type](n,t)}n.geo.stream=function(n,t){n&&he.hasOwnProperty(n.type)?he[n.type](n,t):se(n,t)};var he={Feature:function(n,t){se(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r=0?1:-1,a=o*u,l=Math.cos(t),c=Math.sin(t),f=i*c,s=r*l+f*Math.cos(a),h=f*o*Math.sin(a);Ae.add(Math.atan2(h,s)),e=n,r=l,i=c}Ce.point=function(o,a){Ce.point=u,e=(n=o)*Cn,r=Math.cos(a=(t=a)*Cn/2+kn/4),i=Math.sin(a)},Ce.lineEnd=function(){u(n,t)}}function Le(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function qe(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function Te(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Re(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function De(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Pe(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function Ue(n){return[Math.atan2(n[1],n[0]),Rn(n[2])]}function je(n,t){return y(n[0]-t[0])wn?i=90:c<-wn&&(e=-90),s[0]=t,s[1]=r}};function p(n,u){f.push(s=[t=n,r=n]),ui&&(i=u)}function g(n,o){var a=Le([n*Cn,o*Cn]);if(l){var c=Te(l,a),f=Te([c[1],-c[0],0],c);Pe(f),f=Ue(f);var s=n-u,h=s>0?1:-1,g=f[0]*zn*h,v=y(s)>180;if(v^(h*ui&&(i=d);else if(v^(h*u<(g=(g+360)%360-180)&&gi&&(i=o);v?nb(t,r)&&(r=n):b(n,r)>b(t,r)&&(t=n):r>=t?(nr&&(r=n)):n>u?b(t,n)>b(t,r)&&(r=n):b(n,r)>b(t,r)&&(t=n)}else p(n,o);l=a,u=n}function v(){h.point=g}function d(){s[0]=t,s[1]=r,h.point=p,l=null}function m(n,t){if(l){var e=n-u;c+=y(e)>180?e+(e>0?360:-360):e}else o=n,a=t;Ce.point(n,t),g(n,t)}function M(){Ce.lineStart()}function x(){m(o,a),Ce.lineEnd(),y(c)>wn&&(t=-(r=180)),s[0]=t,s[1]=r,l=null}function b(n,t){return(t-=n)<0?t+360:t}function _(n,t){return n[0]-t[0]}function w(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nb(v[0],v[1])&&(v[1]=p[1]),b(p[0],v[1])>b(v[0],v[1])&&(v[0]=p[0])):a.push(v=p);for(var l,c,p,g=-1/0,v=(o=0,a[c=a.length-1]);o<=c;v=p,++o)p=a[o],(l=b(v[1],p[0]))>g&&(g=l,t=p[0],r=v[1])}return f=s=null,t===1/0||e===1/0?[[NaN,NaN],[NaN,NaN]]:[[t,e],[r,i]]}}(),n.geo.centroid=function(t){ye=me=Me=xe=be=_e=we=Se=ke=Ne=Ee=0,n.geo.stream(t,Fe);var e=ke,r=Ne,i=Ee,u=e*e+r*r+i*i;return u=0;--a)i.point((s=f[a])[0],s[1]);else r(p.x,p.p.x,-1,i);p=p.p}f=(p=p.o).z,g=!g}while(!p.v);i.lineEnd()}}}function Be(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r=0?1:-1,w=_*b,S=w>kn,k=g*M;if(Ae.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Nn:b,S^h>=e^y>=e){var N=Te(Le(s),Le(n));Pe(N);var E=Te(i,N);Pe(E);var A=(S^b>=0?-1:1)*Rn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(u<-wn||u0){for(M||(o.polygonStart(),M=!0),o.lineStart();++u1&&2&t&&e.push(e.pop().concat(e.shift())),a.push(e.filter(Ge))}return f}}function Ge(n){return n.length>1}function Ke(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:R,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Qe(n,t){return((n=n.x)[0]<0?n[1]-An-wn:An-n[1])-((t=t.x)[0]<0?t[1]-An-wn:An-t[1])}var nr=Je(Xe,function(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?kn:-kn,l=y(u-e);y(l-kn)0?An:-An),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&l>=kn&&(y(e-i)wn?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}(e,r,u,o),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=u,r=o),i=a},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}},function(n,t,e,r){var i;if(null==n)i=e*An,r.point(-kn,i),r.point(0,i),r.point(kn,i),r.point(kn,0),r.point(kn,-i),r.point(0,-i),r.point(-kn,-i),r.point(-kn,0),r.point(-kn,i);else if(y(n[0]-t[0])>wn){var u=n[0]0)){if(u/=h,h<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=e-l,h||!(u<0)){if(u/=h,h<0){if(u>s)return;u>f&&(f=u)}else if(h>0){if(u0)){if(u/=p,p<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=r-c,p||!(u<0)){if(u/=p,p<0){if(u>s)return;u>f&&(f=u)}else if(p>0){if(u0&&(i.a={x:l+f*h,y:c+f*p}),s<1&&(i.b={x:l+s*h,y:c+s*p}),i}}}}}}var er=1e9;function rr(t,e,r,i){return function(l){var c,f,s,h,p,g,v,d,y,m,M,x=l,b=Ke(),_=tr(t,e,r,i),w={point:N,lineStart:function(){w.point=E,f&&f.push(s=[]);m=!0,y=!1,v=d=NaN},lineEnd:function(){c&&(E(h,p),g&&y&&b.rejoin(),c.push(b.buffer()));w.point=N,y&&l.lineEnd()},polygonStart:function(){l=b,c=[],f=[],M=!0},polygonEnd:function(){l=x,c=n.merge(c);var e=function(n){for(var t=0,e=f.length,r=n[1],i=0;ir&&qn(c,u,n)>0&&++t:u[1]<=r&&qn(c,u,n)<0&&--t,c=u;return 0!==t}([t,i]),r=M&&e,u=c.length;(r||u)&&(l.polygonStart(),r&&(l.lineStart(),S(null,null,1,l),l.lineEnd()),u&&$e(c,o,e,S,l),l.polygonEnd()),c=f=s=null}};function S(n,o,l,c){var f=0,s=0;if(null==n||(f=u(n,l))!==(s=u(o,l))||a(n,o)<0^l>0)do{c.point(0===f||3===f?t:r,f>1?i:e)}while((f=(f+l+4)%4)!==s);else c.point(o[0],o[1])}function k(n,u){return t<=n&&n<=r&&e<=u&&u<=i}function N(n,t){k(n,t)&&l.point(n,t)}function E(n,t){var e=k(n=Math.max(-er,Math.min(er,n)),t=Math.max(-er,Math.min(er,t)));if(f&&s.push([n,t]),m)h=n,p=t,g=e,m=!1,e&&(l.lineStart(),l.point(n,t));else if(e&&y)l.point(n,t);else{var r={a:{x:v,y:d},b:{x:n,y:t}};_(r)?(y||(l.lineStart(),l.point(r.a.x,r.a.y)),l.point(r.b.x,r.b.y),e||l.lineEnd(),M=!1):e&&(l.lineStart(),l.point(n,t),M=!1)}v=n,d=t,y=e}return w};function u(n,i){return y(n[0]-t)0?0:3:y(n[0]-r)0?2:1:y(n[1]-e)0?1:0:i>0?3:2}function o(n,t){return a(n.x,t.x)}function a(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}}function ir(n){var t=0,e=kn/3,r=Nr(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*kn/180,e=n[1]*kn/180):[t/kn*180,e/kn*180]},i}function ur(n,t){var e=Math.sin(n),r=(e+Math.sin(t))/2,i=1+e*(2*r-e),u=Math.sqrt(i)/r;function o(n,t){var e=Math.sqrt(i-2*r*Math.sin(t))/r;return[e*Math.sin(n*=r),u-e*Math.cos(n)]}return o.invert=function(n,t){var e=u-t;return[Math.atan2(n,e)/r,Rn((i-(n*n+e*e)*r*r)/(2*r))]},o}n.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),(i=u(n)).valid=!0,i},extent:function(a){return arguments.length?(u=rr(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(n.geo.conicEqualArea=function(){return ir(ur)}).raw=ur,n.geo.albers=function(){return n.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},n.geo.albersUsa=function(){var t,e,r,i,u=n.geo.albers(),o=n.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=n.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};function c(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}return c.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?o:i>=.166&&i<.234&&r>=-.214&&r<-.115?a:u).invert(n)},c.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},c.precision=function(n){return arguments.length?(u.precision(n),o.precision(n),a.precision(n),c):u.precision()},c.scale=function(n){return arguments.length?(u.scale(n),o.scale(.35*n),a.scale(n),c.translate(u.translate())):u.scale()},c.translate=function(n){if(!arguments.length)return u.translate();var t=u.scale(),f=+n[0],s=+n[1];return e=u.translate(n).clipExtent([[f-.455*t,s-.238*t],[f+.455*t,s+.238*t]]).stream(l).point,r=o.translate([f-.307*t,s+.201*t]).clipExtent([[f-.425*t+wn,s+.12*t+wn],[f-.214*t-wn,s+.234*t-wn]]).stream(l).point,i=a.translate([f-.205*t,s+.212*t]).clipExtent([[f-.214*t+wn,s+.166*t+wn],[f-.115*t-wn,s+.234*t-wn]]).stream(l).point,c},c.scale(1070)};var or,ar,lr,cr,fr,sr,hr={point:R,lineStart:R,lineEnd:R,polygonStart:function(){ar=0,hr.lineStart=pr},polygonEnd:function(){hr.lineStart=hr.lineEnd=hr.point=R,or+=y(ar/2)}};function pr(){var n,t,e,r;function i(n,t){ar+=r*n-e*t,e=n,r=t}hr.point=function(u,o){hr.point=i,n=e=u,t=r=o},hr.lineEnd=function(){i(n,t)}}var gr={point:function(n,t){nfr&&(fr=n);tsr&&(sr=t)},lineStart:R,lineEnd:R,polygonStart:R,polygonEnd:R};function vr(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}var dr,yr={point:mr,lineStart:Mr,lineEnd:xr,polygonStart:function(){yr.lineStart=br},polygonEnd:function(){yr.point=mr,yr.lineStart=Mr,yr.lineEnd=xr}};function mr(n,t){Me+=n,xe+=t,++be}function Mr(){var n,t;function e(e,r){var i=e-n,u=r-t,o=Math.sqrt(i*i+u*u);_e+=o*(n+e)/2,we+=o*(t+r)/2,Se+=o,mr(n=e,t=r)}yr.point=function(r,i){yr.point=e,mr(n=r,t=i)}}function xr(){yr.point=mr}function br(){var n,t,e,r;function i(n,t){var i=n-e,u=t-r,o=Math.sqrt(i*i+u*u);_e+=o*(e+n)/2,we+=o*(r+t)/2,Se+=o,ke+=(o=r*n-e*t)*(e+n),Ne+=o*(r+t),Ee+=3*o,mr(e=n,r=t)}yr.point=function(u,o){yr.point=i,mr(n=e=u,t=r=o)},yr.lineEnd=function(){i(n,t)}}function _r(n){var t=.5,e=Math.cos(30*Cn),r=16;function i(t){return(r?function(t){var e,i,o,a,l,c,f,s,h,p,g,v,d={point:y,lineStart:m,lineEnd:x,polygonStart:function(){t.polygonStart(),d.lineStart=b},polygonEnd:function(){t.polygonEnd(),d.lineStart=m}};function y(e,r){e=n(e,r),t.point(e[0],e[1])}function m(){s=NaN,d.point=M,t.lineStart()}function M(e,i){var o=Le([e,i]),a=n(e,i);u(s,h,f,p,g,v,s=a[0],h=a[1],f=e,p=o[0],g=o[1],v=o[2],r,t),t.point(s,h)}function x(){d.point=y,t.lineEnd()}function b(){m(),d.point=_,d.lineEnd=w}function _(n,t){M(e=n,t),i=s,o=h,a=p,l=g,c=v,d.point=M}function w(){u(s,h,f,p,g,v,i,o,e,a,l,c,r,t),d.lineEnd=x,x()}return d}:function(t){return Sr(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})})(t)}function u(r,i,o,a,l,c,f,s,h,p,g,v,d,m){var M=f-r,x=s-i,b=M*M+x*x;if(b>4*t&&d--){var _=a+p,w=l+g,S=c+v,k=Math.sqrt(_*_+w*w+S*S),N=Math.asin(S/=k),E=y(y(S)-1)t||y((M*L+x*q)/b-.5)>.3||a*p+l*g+c*v0&&16,i):Math.sqrt(t)},i}function wr(n){this.stream=n}function Sr(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function kr(n){return Nr(function(){return n})()}function Nr(t){var e,r,i,u,o,a,l=_r(function(n,t){return[(n=e(n,t))[0]*c+u,o-n[1]*c]}),c=150,f=480,s=250,h=0,p=0,g=0,v=0,d=0,m=nr,M=z,x=null,b=null;function _(n){return[(n=i(n[0]*Cn,n[1]*Cn))[0]*c+u,o-n[1]*c]}function w(n){return(n=i.invert((n[0]-u)/c,(o-n[1])/c))&&[n[0]*zn,n[1]*zn]}function S(){i=Ve(r=zr(g,v,d),e);var n=e(h,p);return u=f-n[0]*c,o=s+n[1]*c,k()}function k(){return a&&(a.valid=!1,a=null),_}return _.stream=function(n){return a&&(a.valid=!1),(a=Er(m(r,l(M(n))))).valid=!0,a},_.clipAngle=function(n){return arguments.length?(m=null==n?(x=n,nr):function(n){var t=Math.cos(n),e=t>0,r=y(t)>wn;return Je(i,function(n){var t,a,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=i(s,h),d=e?v?0:o(s,h):v?o(s+(s<0?kn:-kn),h):0;if(!t&&(c=l=v)&&n.lineStart(),v!==l&&(p=u(t,g),(je(t,p)||je(g,p))&&(g[0]+=wn,g[1]+=wn,v=i(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=u(g,t),n.point(p[0],p[1])):(p=u(t,g),n.point(p[0],p[1]),n.lineEnd()),t=p;else if(r&&t&&e^v){var y;d&a||!(y=u(g,t,!0))||(f=0,e?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||t&&je(t,g)||n.point(g[0],g[1]),t=g,l=v,a=d},lineEnd:function(){l&&n.lineEnd(),t=null},clean:function(){return f|(c&&l)<<1}}},Rr(n,6*Cn),e?[0,-n]:[-kn,n-kn]);function i(n,e){return Math.cos(n)*Math.cos(e)>t}function u(n,e,r){var i=[1,0,0],u=Te(Le(n),Le(e)),o=qe(u,u),a=u[0],l=o-a*a;if(!l)return!r&&n;var c=t*o/l,f=-t*a/l,s=Te(i,u),h=De(i,c);Re(h,De(u,f));var p=s,g=qe(h,p),v=qe(p,p),d=g*g-v*(qe(h,h)-1);if(!(d<0)){var m=Math.sqrt(d),M=De(p,(-g-m)/v);if(Re(M,h),M=Ue(M),!r)return M;var x,b=n[0],_=e[0],w=n[1],S=e[1];_0^M[1]<(y(M[0]-b)kn^(b<=M[0]&&M[0]<=_)){var E=De(p,(-g+m)/v);return Re(E,h),[M,Ue(E)]}}}function o(t,r){var i=e?n:kn-n,u=0;return t<-i?u|=1:t>i&&(u|=2),r<-i?u|=4:r>i&&(u|=8),u}}((x=+n)*Cn),k()):x},_.clipExtent=function(n){return arguments.length?(b=n,M=n?rr(n[0][0],n[0][1],n[1][0],n[1][1]):z,k()):b},_.scale=function(n){return arguments.length?(c=+n,S()):c},_.translate=function(n){return arguments.length?(f=+n[0],s=+n[1],S()):[f,s]},_.center=function(n){return arguments.length?(h=n[0]%360*Cn,p=n[1]%360*Cn,S()):[h*zn,p*zn]},_.rotate=function(n){return arguments.length?(g=n[0]%360*Cn,v=n[1]%360*Cn,d=n.length>2?n[2]%360*Cn:0,S()):[g*zn,v*zn,d*zn]},n.rebind(_,l,"precision"),function(){return e=t.apply(this,arguments),_.invert=e.invert&&w,S()}}function Er(n){return Sr(n,function(t,e){n.point(t*Cn,e*Cn)})}function Ar(n,t){return[n,t]}function Cr(n,t){return[n>kn?n-Nn:n<-kn?n+Nn:n,t]}function zr(n,t,e){return n?t||e?Ve(qr(n),Tr(t,e)):qr(n):t||e?Tr(t,e):Cr}function Lr(n){return function(t,e){return[(t+=n)>kn?t-Nn:t<-kn?t+Nn:t,e]}}function qr(n){var t=Lr(n);return t.invert=Lr(-n),t}function Tr(n,t){var e=Math.cos(n),r=Math.sin(n),i=Math.cos(t),u=Math.sin(t);function o(n,t){var o=Math.cos(t),a=Math.cos(n)*o,l=Math.sin(n)*o,c=Math.sin(t),f=c*e+a*r;return[Math.atan2(l*i-f*u,a*e-c*r),Rn(f*i+l*u)]}return o.invert=function(n,t){var o=Math.cos(t),a=Math.cos(n)*o,l=Math.sin(n)*o,c=Math.sin(t),f=c*i-l*u;return[Math.atan2(l*i+c*u,a*e+f*r),Rn(f*e-a*r)]},o}function Rr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=Dr(e,i),u=Dr(e,u),(o>0?iu)&&(i+=o*Nn)):(i=n+o*Nn,u=n-.5*l);for(var c,f=i;o>0?f>u:f2?n[2]*Cn:0),t.invert=function(t){return(t=n.invert(t[0]*Cn,t[1]*Cn))[0]*=zn,t[1]*=zn,t},t},Cr.invert=Ar,n.geo.circle=function(){var n,t,e=[0,0],r=6;function i(){var n="function"==typeof e?e.apply(this,arguments):e,r=zr(-n[0]*Cn,-n[1]*Cn,0).invert,i=[];return t(null,null,1,{point:function(n,t){i.push(n=r(n,t)),n[0]*=zn,n[1]*=zn}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(n){return arguments.length?(e=n,i):e},i.angle=function(e){return arguments.length?(t=Rr((n=+e)*Cn,r*Cn),i):n},i.precision=function(e){return arguments.length?(t=Rr(n*Cn,(r=+e)*Cn),i):r},i.angle(90)},n.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Cn,i=n[1]*Cn,u=t[1]*Cn,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},n.geo.graticule=function(){var t,e,r,i,u,o,a,l,c,f,s,h,p=10,g=p,v=90,d=360,m=2.5;function M(){return{type:"MultiLineString",coordinates:x()}}function x(){return n.range(Math.ceil(i/v)*v,r,v).map(s).concat(n.range(Math.ceil(l/d)*d,a,d).map(h)).concat(n.range(Math.ceil(e/p)*p,t,p).filter(function(n){return y(n%v)>wn}).map(c)).concat(n.range(Math.ceil(o/g)*g,u,g).filter(function(n){return y(n%d)>wn}).map(f))}return M.lines=function(){return x().map(function(n){return{type:"LineString",coordinates:n}})},M.outline=function(){return{type:"Polygon",coordinates:[s(i).concat(h(a).slice(1),s(r).reverse().slice(1),h(l).reverse().slice(1))]}},M.extent=function(n){return arguments.length?M.majorExtent(n).minorExtent(n):M.minorExtent()},M.majorExtent=function(n){return arguments.length?(i=+n[0][0],r=+n[1][0],l=+n[0][1],a=+n[1][1],i>r&&(n=i,i=r,r=n),l>a&&(n=l,l=a,a=n),M.precision(m)):[[i,l],[r,a]]},M.minorExtent=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],u=+n[1][1],e>t&&(n=e,e=t,t=n),o>u&&(n=o,o=u,u=n),M.precision(m)):[[e,o],[t,u]]},M.step=function(n){return arguments.length?M.majorStep(n).minorStep(n):M.minorStep()},M.majorStep=function(n){return arguments.length?(v=+n[0],d=+n[1],M):[v,d]},M.minorStep=function(n){return arguments.length?(p=+n[0],g=+n[1],M):[p,g]},M.precision=function(n){return arguments.length?(m=+n,c=Pr(o,u,90),f=Ur(e,t,m),s=Pr(l,a,90),h=Ur(i,r,m),M):m},M.majorExtent([[-180,-90+wn],[180,90-wn]]).minorExtent([[-180,-80-wn],[180,80+wn]])},n.geo.greatArc=function(){var t,e,r=jr,i=Fr;function u(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}return u.distance=function(){return n.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},u.source=function(n){return arguments.length?(r=n,t="function"==typeof n?null:n,u):r},u.target=function(n){return arguments.length?(i=n,e="function"==typeof n?null:n,u):i},u.precision=function(){return arguments.length?u:0},u},n.geo.interpolate=function(n,t){return e=n[0]*Cn,r=n[1]*Cn,i=t[0]*Cn,u=t[1]*Cn,o=Math.cos(r),a=Math.sin(r),l=Math.cos(u),c=Math.sin(u),f=o*Math.cos(e),s=o*Math.sin(e),h=l*Math.cos(i),p=l*Math.sin(i),g=2*Math.asin(Math.sqrt(Pn(u-r)+o*l*Pn(i-e))),v=1/Math.sin(g),(d=g?function(n){var t=Math.sin(n*=g)*v,e=Math.sin(g-n)*v,r=e*f+t*h,i=e*s+t*p,u=e*a+t*c;return[Math.atan2(i,r)*zn,Math.atan2(u,Math.sqrt(r*r+i*i))*zn]}:function(){return[e*zn,r*zn]}).distance=g,d;var e,r,i,u,o,a,l,c,f,s,h,p,g,v,d},n.geo.length=function(t){return dr=0,n.geo.stream(t,Hr),dr};var Hr={sphere:R,point:R,lineStart:function(){var n,t,e;function r(r,i){var u=Math.sin(i*=Cn),o=Math.cos(i),a=y((r*=Cn)-n),l=Math.cos(a);dr+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=e*u-t*o*l)*a),t*u+e*o*l),n=r,t=u,e=o}Hr.point=function(i,u){n=i*Cn,t=Math.sin(u*=Cn),e=Math.cos(u),Hr.point=r},Hr.lineEnd=function(){Hr.point=Hr.lineEnd=R}},lineEnd:R,polygonStart:R,polygonEnd:R};function Or(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}var Ir=Or(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(n.geo.azimuthalEqualArea=function(){return kr(Ir)}).raw=Ir;var Yr=Or(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},z);function Zr(n,t){var e=Math.cos(n),r=function(n){return Math.tan(kn/4+n/2)},i=n===t?Math.sin(n):Math.log(e/Math.cos(t))/Math.log(r(t)/r(n)),u=e*Math.pow(r(n),i)/i;if(!i)return $r;function o(n,t){u>0?t<-An+wn&&(t=-An+wn):t>An-wn&&(t=An-wn);var e=u/Math.pow(r(t),i);return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}return o.invert=function(n,t){var e=u-t,r=Ln(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(u/r,1/i))-An]},o}function Vr(n,t){var e=Math.cos(n),r=n===t?Math.sin(n):(e-Math.cos(t))/(t-n),i=e/r+n;if(y(r)1&&qn(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function ti(n,t){return n[0]-t[0]||n[1]-t[1]}(n.geo.stereographic=function(){return kr(Jr)}).raw=Jr,Gr.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-An]},(n.geo.transverseMercator=function(){var n=Br(Gr),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):[(n=t())[1],-n[0]]},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):[(n=e())[0],n[1],n[2]-90]},e([0,0,90])}).raw=Gr,n.geom={},n.geom.hull=function(n){var t=Kr,e=Qr;if(arguments.length)return r(n);function r(n){if(n.length<3)return[];var r,i=dt(t),u=dt(e),o=n.length,a=[],l=[];for(r=0;r=0;--r)p.push(n[a[c[r]][2]]);for(r=+s;rwn)a=a.L;else{if(!((i=u-mi(a,o))>wn)){r>-wn?(t=a.P,e=a):i>-wn?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=pi(n);if(li.insert(t,l),t||e){if(t===e)return _i(t),e=pi(t.site),li.insert(l,e),l.edge=e.edge=ki(t.site,l.site),bi(t),void bi(e);if(e){_i(t),_i(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};Ni(e.edge,c,g,x),l.edge=ki(c,n,null,x),e.edge=ki(n,g,null,x),bi(t),bi(e)}else l.edge=ki(t.site,l.site)}}function yi(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-1/0;var a=(e=o.site).x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function mi(n,t){var e=n.N;if(e)return yi(e,t);var r=n.site;return r.y===t?r.x:1/0}function Mi(n){this.site=n,this.edges=[]}function xi(n,t){return t.angle-n.angle}function bi(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,i=n.site,u=e.site;if(r!==u){var o=i.x,a=i.y,l=r.x-o,c=r.y-a,f=u.x-o,s=2*(l*(d=u.y-a)-c*f);if(!(s>=-Sn)){var h=l*l+c*c,p=f*f+d*d,g=(d*h-c*p)/s,v=(l*p-f*h)/s,d=v+a,y=hi.pop()||new function(){Ci(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=n,y.site=i,y.x=g+o,y.y=d+Math.sqrt(g*g+v*v),y.cy=d,n.circle=y;for(var m=null,M=fi._;M;)if(y.y=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.y1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.y=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.xwn||y(i-e)>wn)&&(a.splice(o,0,new Ei((m=u.site,M=f,x=y(r-s)wn?{x:s,y:y(t-s)wn?{x:y(e-g)wn?{x:h,y:y(t-h)wn?{x:y(e-p)=e&&c.x<=i&&c.y>=r&&c.y<=o?[[e,o],[i,o],[i,r],[e,r]]:[]).point=n[a]}),t}function a(n){return n.map(function(n,t){return{x:Math.round(r(n,t)/wn)*wn,y:Math.round(i(n,t)/wn)*wn,i:t}})}return o.links=function(n){return Ti(a(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},o.triangles=function(n){var t=[];return Ti(a(n)).cells.forEach(function(e,r){for(var i,u,o,a,l=e.site,c=e.edges.sort(xi),f=-1,s=c.length,h=c[s-1].edge,p=h.l===l?h.r:h.l;++fu&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:Hi(e,r)})),u=Yi.lastIndex;return uv&&(v=l.x),l.y>d&&(d=l.y),c.push(l.x),f.push(l.y);else for(s=0;sv&&(v=x),b>d&&(d=b),c.push(x),f.push(b)}var _=v-p,w=d-g;function S(n,t,e,r,i,u,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,c=n.y;if(null!=l)if(y(l-e)+y(c-r)<.01)k(n,t,e,r,i,u,o,a);else{var f=n.point;n.x=n.y=n.point=null,k(n,f,l,c,i,u,o,a),k(n,t,e,r,i,u,o,a)}else n.x=e,n.y=r,n.point=t}else k(n,t,e,r,i,u,o,a)}function k(n,t,e,r,i,u,o,a){var l=.5*(i+o),c=.5*(u+a),f=e>=l,s=r>=c,h=s<<1|f;n.leaf=!1,f?i=l:o=l,s?u=c:a=c,S(n=n.nodes[h]||(n.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(n){S(N,n,+m(n,++s),+M(n,s),p,g,v,d)}}),t,e,r,i,u,o,a)}_>w?d=g+_:v=p+w;var N={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(n){S(N,n,+m(n,++s),+M(n,s),p,g,v,d)}};if(N.visit=function(n){!function n(t,e,r,i,u,o){if(!t(e,r,i,u,o)){var a=.5*(r+u),l=.5*(i+o),c=e.nodes;c[0]&&n(t,c[0],r,i,a,l),c[1]&&n(t,c[1],a,i,u,l),c[2]&&n(t,c[2],r,l,a,o),c[3]&&n(t,c[3],a,l,u,o)}}(n,N,p,g,v,d)},N.find=function(n){return function(n,t,e,r,i,u,o){var a,l=1/0;return function n(c,f,s,h,p){if(!(f>u||s>o||h=b)<<1|t>=x,w=_+4;_=0&&!(r=n.interpolators[i](t,e)););return r}function Vi(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;e=1)return 1;var t=n*n,e=t*n;return 4*(n<.5?e:3*(n-t)+e-.75)}function nu(n){return 1-Math.cos(n*An)}function tu(n){return Math.pow(2,10*(n-1))}function eu(n){return 1-Math.sqrt(1-n*n)}function ru(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function iu(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function uu(n){var t,e,r,i=[n.a,n.b],u=[n.c,n.d],o=au(i),a=ou(i,u),l=au(((t=u)[0]+=(r=-a)*(e=i)[0],t[1]+=r*e[1],t))||0;i[0]*u[1]=0?n.slice(0,r):n,u=r>=0?n.slice(r+1):"in";return i=$i.get(i)||Xi,u=Bi.get(u)||z,e=u(i.apply(null,t.call(arguments,1))),function(n){return n<=0?0:n>=1?1:e(n)}},n.interpolateHcl=function(t,e){t=n.hcl(t),e=n.hcl(e);var r=t.h,i=t.c,u=t.l,o=e.h-r,a=e.c-i,l=e.l-u;isNaN(a)&&(a=0,i=isNaN(i)?e.c:i);isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360);return function(n){return $n(r+o*n,i+a*n,u+l*n)+""}},n.interpolateHsl=function(t,e){t=n.hsl(t),e=n.hsl(e);var r=t.h,i=t.s,u=t.l,o=e.h-r,a=e.s-i,l=e.l-u;isNaN(a)&&(a=0,i=isNaN(i)?e.s:i);isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360);return function(n){return Zn(r+o*n,i+a*n,u+l*n)+""}},n.interpolateLab=function(t,e){t=n.lab(t),e=n.lab(e);var r=t.l,i=t.a,u=t.b,o=e.l-r,a=e.a-i,l=e.b-u;return function(n){return nt(r+o*n,i+a*n,u+l*n)+""}},n.interpolateRound=iu,n.transform=function(t){var e=r.createElementNS(n.ns.prefix.svg,"g");return(n.transform=function(n){if(null!=n){e.setAttribute("transform",n);var t=e.transform.baseVal.consolidate()}return new uu(t?t.matrix:lu)})(t)},uu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var lu={a:1,b:0,c:0,d:1,e:0,f:0};function cu(n){return n.length?n.pop()+",":""}function fu(t,e){var r=[],i=[];return t=n.transform(t),e=n.transform(e),function(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push("translate(",null,",",null,")");r.push({i:i-4,x:Hi(n[0],t[0])},{i:i-2,x:Hi(n[1],t[1])})}else(t[0]||t[1])&&e.push("translate("+t+")")}(t.translate,e.translate,r,i),function(n,t,e,r){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(cu(e)+"rotate(",null,")")-2,x:Hi(n,t)})):t&&e.push(cu(e)+"rotate("+t+")")}(t.rotate,e.rotate,r,i),function(n,t,e,r){n!==t?r.push({i:e.push(cu(e)+"skewX(",null,")")-2,x:Hi(n,t)}):t&&e.push(cu(e)+"skewX("+t+")")}(t.skew,e.skew,r,i),function(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(cu(e)+"scale(",null,",",null,")");r.push({i:i-4,x:Hi(n[0],t[0])},{i:i-2,x:Hi(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(cu(e)+"scale("+t+")")}(t.scale,e.scale,r,i),t=e=null,function(n){for(var t,e=-1,u=i.length;++e0?r=n:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:r=0})):n>0&&(l.start({type:"start",alpha:r=n}),t=St(a.tick)),a):r},a.start=function(){var n,t,e,r=y.length,l=m.length,f=c[0],g=c[1];for(n=0;n=0;)e.push(i[r])}function Su(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++o=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;e&&(u.value=0),u.children=c}else e&&(u.value=+e.call(r,u,u.depth)||0),delete u.children;return Su(i,function(t){var r,i;n&&(r=t.children)&&r.sort(n),e&&(i=t.parent)&&(i.value+=t.value)}),a}return r.sort=function(t){return arguments.length?(n=t,r):n},r.children=function(n){return arguments.length?(t=n,r):t},r.value=function(n){return arguments.length?(e=n,r):e},r.revalue=function(n){return e&&(wu(n,function(n){n.children&&(n.value=0)}),Su(n,function(n){var t;n.children||(n.value=+e.call(r,n,n.depth)||0),(t=n.parent)&&(t.value+=n.value)})),n},r},n.layout.partition=function(){var t=n.layout.hierarchy(),e=[1,1];function r(n,r){var i=t.call(this,n,r);return function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++ca&&(a=r),o.push(r)}for(e=0;ei&&(r=e,i=t);return r}function ju(n){return n.reduce(Fu,0)}function Fu(n,t){return n+t[1]}function Hu(n,t){return Ou(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Ou(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function Iu(t){return[n.min(t),n.max(t)]}function Yu(n,t){return n.value-t.value}function Zu(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Vu(n,t){n._pack_next=t,t._pack_prev=n}function Xu(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function $u(n){if((t=n.children)&&(l=t.length)){var t,e,r,i,u,o,a,l,c=1/0,f=-1/0,s=1/0,h=-1/0;if(t.forEach(Bu),(e=t[0]).x=-e.r,e.y=0,M(e),l>1&&((r=t[1]).x=r.r,r.y=0,M(r),l>2))for(Ju(e,r,i=t[2]),M(i),Zu(e,i),e._pack_prev=i,Zu(i,r),r=e._pack_next,u=3;u0)for(o=-1;++o=s[0]&&l<=s[1]&&((a=c[n.bisect(h,l,1,g)-1]).y+=v,a.push(u[o]));return c}return u.value=function(n){return arguments.length?(e=n,u):e},u.range=function(n){return arguments.length?(r=dt(n),u):r},u.bins=function(n){return arguments.length?(i="number"==typeof n?function(t){return Ou(t,n)}:dt(n),u):i},u.frequency=function(n){return arguments.length?(t=!!n,u):t},u},n.layout.pack=function(){var t,e=n.layout.hierarchy().sort(Yu),r=0,i=[1,1];function u(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Su(a,function(n){n.r=+f(n.value)}),Su(a,$u),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;Su(a,function(n){n.r+=s}),Su(a,$u),Su(a,function(n){n.r-=s})}return function n(t,e,r,i){var u=t.children;t.x=e+=i*t.x;t.y=r+=i*t.y;t.r*=i;if(u)for(var o=-1,a=u.length;++op.x&&(p=n),n.depth>g.depth&&(g=n)});var v=e(h,p)/2-h.x,d=r[0]/(p.x+e(p,h)/2+v),y=r[1]/(g.depth||1);wu(f,function(n){n.x=(n.x+v)*d,n.y=n.depth*y})}return c}function o(n){var t=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(t.length){!function(n){var t,e=0,r=0,i=n.children,u=i.length;for(;--u>=0;)(t=i[u]).z+=e,t.m+=e,e+=t.s+(r+=t.c)}(n);var u=(t[0].z+t[t.length-1].z)/2;i?(n.z=i.z+e(n._,i._),n.m=n.z-u):n.z=u}else i&&(n.z=i.z+e(n._,i._));n.parent.A=function(n,t,r){if(t){for(var i,u=n,o=n,a=t,l=u.parent.children[0],c=u.m,f=o.m,s=a.m,h=l.m;a=Qu(a),u=Ku(u),a&&u;)l=Ku(l),(o=Qu(o)).a=n,(i=a.z+s-u.z-c+e(a._,u._))>0&&(no(to(a,n,r),n,i),c+=i,f+=i),s+=a.m,c+=u.m,h+=l.m,f+=o.m;a&&!Qu(o)&&(o.t=a,o.m+=s-f),u&&!Ku(l)&&(l.t=u,l.m+=c-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function l(n){n.x*=r[0],n.y=n.depth*r[1]}return u.separation=function(n){return arguments.length?(e=n,u):e},u.size=function(n){return arguments.length?(i=null==(r=n)?l:null,u):i?null:r},u.nodeSize=function(n){return arguments.length?(i=null==(r=n)?null:l,u):i?r:null},_u(u,t)},n.layout.cluster=function(){var t=n.layout.hierarchy().sort(null).value(null),e=Gu,r=[1,1],i=!1;function u(u,o){var a,l=t.call(this,u,o),c=l[0],f=0;Su(c,function(t){var r=t.children;r&&r.length?(t.x=function(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}(r),t.y=function(t){return 1+n.max(t,function(n){return n.y})}(r)):(t.x=a?f+=e(t,a):0,t.y=0,a=t)});var s=function n(t){var e=t.children;return e&&e.length?n(e[0]):t}(c),h=function n(t){var e,r=t.children;return r&&(e=r.length)?n(r[e-1]):t}(c),p=s.x-e(s,h)/2,g=h.x+e(h,s)/2;return Su(c,i?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-p)/(g-p)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),l}return u.separation=function(n){return arguments.length?(e=n,u):e},u.size=function(n){return arguments.length?(i=null==(r=n),u):i?null:r},u.nodeSize=function(n){return arguments.length?(i=null!=(r=n),u):i?r:null},_u(u,t)},n.layout.treemap=function(){var t,e=n.layout.hierarchy(),r=Math.round,i=[1,1],u=null,o=eo,a=!1,l="squarify",c=.5*(1+Math.sqrt(5));function f(n,t){for(var e,r,i=-1,u=n.length;++i0;)a.push(e=c[i-1]),a.area+=e.area,"squarify"!==l||(r=p(a,v))<=h?(c.pop(),h=r):(a.area-=a.pop().area,g(a,v,u,!1),v=Math.min(u.dx,u.dy),a.length=a.area=0,h=1/0);a.length&&(g(a,v,u,!0),a.length=a.area=0),t.forEach(s)}}function h(n){var t=n.children;if(t&&t.length){var e,r=o(n),i=t.slice(),u=[];for(f(i,r.dx*r.dy/n.value),u.area=0;e=i.pop();)u.push(e),u.area+=e.area,null!=e.z&&(g(u,e.z?r.dx:r.dy,r,!i.length),u.length=u.area=0);t.forEach(h)}}function p(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++oi&&(i=e));return t*=t,(r*=r)?Math.max(t*i*c/r,r/(t*u*c)):1/0}function g(n,t,e,i){var u,o=-1,a=n.length,l=e.x,c=e.y,f=t?r(n.area/t):0;if(t==e.dx){for((i||f>e.dy)&&(f=e.dy);++oe.dx)&&(f=e.dx);++o1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=n.random.normal.apply(n,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=n.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(n){return function(){for(var t=0,e=0;e2?fo:oo,a=i?hu:su;return u=n(t,e,a,r),o=n(e,t,a,Zi),l}function l(n){return u(n)}l.invert=function(n){return o(n)};l.domain=function(n){return arguments.length?(t=n.map(Number),a()):t};l.range=function(n){return arguments.length?(e=n,a()):e};l.rangeRound=function(n){return l.range(n).interpolate(iu)};l.clamp=function(n){return arguments.length?(i=n,a()):i};l.interpolate=function(n){return arguments.length?(r=n,a()):r};l.ticks=function(n){return go(t,n)};l.tickFormat=function(n,e){return vo(t,n,e)};l.nice=function(n){return ho(t,n),a()};l.copy=function(){return n(t,e,r,i)};return a()}([0,1],[0,1],Zi,!1)};var yo={s:1,g:1,p:1,r:1,e:1};function mo(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}n.scale.log=function(){return function t(e,r,i,u){function o(n){return(i?Math.log(n<0?0:n):-Math.log(n>0?0:-n))/Math.log(r)}function a(n){return i?Math.pow(r,n):-Math.pow(r,-n)}function l(n){return e(o(n))}l.invert=function(n){return a(e.invert(n))};l.domain=function(n){return arguments.length?(i=n[0]>=0,e.domain((u=n.map(Number)).map(o)),l):u};l.base=function(n){return arguments.length?(r=+n,e.domain(u.map(o)),l):r};l.nice=function(){var n=ao(u.map(o),i?Math:xo);return e.domain(n),u=n.map(a),l};l.ticks=function(){var n=io(u),t=[],e=n[0],l=n[1],c=Math.floor(o(e)),f=Math.ceil(o(l)),s=r%1?2:r;if(isFinite(f-c)){if(i){for(;c0;h--)t.push(a(c)*h);for(c=0;t[c]l;f--);t=t.slice(c,f)}return t};l.tickFormat=function(t,e){if(!arguments.length)return Mo;arguments.length<2?e=Mo:"function"!=typeof e&&(e=n.format(e));var i=Math.max(1,r*t/l.ticks().length);return function(n){var t=n/a(Math.round(o(n)));return t*r0?i[n-1]:e[0],ns?0:1;if(c=En)return l(c,p)+(a?l(a,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+o.apply(this,arguments)||0)/2)&&(d=r===Eo?Math.sqrt(a*a+c*c):+r.apply(this,arguments),p||(E*=-1),c&&(E=Rn(d/c*Math.sin(y))),a&&(N=Rn(d/a*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=kn?0:1;if(E&&To(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(a){_=a*Math.cos(s-N),w=a*Math.sin(s-N),S=a*Math.cos(f+N),k=a*Math.sin(f+N);var L=Math.abs(f-s+2*N)<=kn?0:1;if(N&&To(_,w,S,k)===1-p^L){var q=(f+s)/2;_=a*Math.cos(q),w=a*Math.sin(q),S=k=null}}else _=w=0;if(h>wn&&(g=Math.min(Math.abs(c-a)/2,+e.apply(this,arguments)))>.001){v=a0?0:1}function Ro(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(y<0?-1:1)*Math.sqrt(Math.max(0,M*M*m-x*x)),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Do(n){var t=Kr,e=Qr,r=Xe,i=Uo,u=i.key,o=.7;function a(u){var a,l=[],c=[],f=-1,s=u.length,h=dt(t),p=dt(e);function g(){l.push("M",i(n(c),o))}for(;++f1&&i.push("H",r[0]);return i.join("")},"step-before":Fo,"step-after":Ho,basis:Yo,"basis-open":function(n){if(n.length<4)return Uo(n);var t,e=[],r=-1,i=n.length,u=[0],o=[0];for(;++r<3;)t=n[r],u.push(t[0]),o.push(t[1]);e.push(Zo($o,u)+","+Zo($o,o)),--r;for(;++r9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));a=-1;for(;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}(n))}});function Uo(n){return n.length>1?n.join("L"):n+"Z"}function jo(n){return n.join("L")+"Z"}function Fo(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;ckn)+",1 "+t}function l(n,t,e,r){return"Q 0,0 "+r}return u.radius=function(n){return arguments.length?(e=dt(n),u):e},u.source=function(t){return arguments.length?(n=dt(t),u):n},u.target=function(n){return arguments.length?(t=dt(n),u):t},u.startAngle=function(n){return arguments.length?(r=dt(n),u):r},u.endAngle=function(n){return arguments.length?(i=dt(n),u):i},u},n.svg.diagonal=function(){var n=jr,t=Fr,e=Qo;function r(r,i){var u=n.call(this,r,i),o=t.call(this,r,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return"M"+(l=l.map(e))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return r.source=function(t){return arguments.length?(n=dt(t),r):n},r.target=function(n){return arguments.length?(t=dt(n),r):t},r.projection=function(n){return arguments.length?(e=n,r):e},r},n.svg.diagonal.radial=function(){var t=n.svg.diagonal(),e=Qo,r=t.projection;return t.projection=function(n){return arguments.length?r(function(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-An;return[e*Math.cos(r),e*Math.sin(r)]}}(e=n)):e},t},n.svg.symbol=function(){var n=ta,t=na;function e(e,r){return(ra.get(n.call(this,e,r))||ea)(t.call(this,e,r))}return e.type=function(t){return arguments.length?(n=dt(t),e):n},e.size=function(n){return arguments.length?(t=dt(n),e):t},e};var ra=n.map({circle:ea,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*ua)),e=t*ua;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/ia),e=t*ia/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/ia),e=t*ia/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});n.svg.symbolTypes=ra.keys();var ia=Math.sqrt(3),ua=Math.tan(30*Cn);X.transition=function(n){for(var t,e,r=ca||++ha,i=va(n),u=[],o=fa||{time:Date.now(),ease:Qi,delay:0,duration:250},a=-1,l=this.length;++a0;)c[--h].call(n,o);if(u>=1)return s.event&&s.event.end.call(n,n.__data__,t),--f.count?delete f[r]:delete n[e],1}s||(u=i.time,o=St(function(n){var t=s.delay;if(o.t=t+u,t<=n)return h(n-t);o.c=h},0,u),s=f[r]={tween:new M,time:u,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++f.count)}sa.call=X.call,sa.empty=X.empty,sa.node=X.node,sa.size=X.size,n.transition=function(t,e){return t&&t.transition?ca?t.transition(e):t:n.selection().transition(t)},n.transition.prototype=sa,sa.select=function(n){var t,e,r,i=this.id,u=this.namespace,o=[];n=$(n);for(var a=-1,l=this.length;++arect,.s>rect").attr("width",a[1]-a[0])}function v(n){n.select(".extent").attr("y",l[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function d(){var s,d,y=this,m=n.select(n.event.target),M=r.of(y,arguments),x=n.select(y),b=m.datum(),_=!/^(n|s)$/.test(b)&&i,w=!/^(e|w)$/.test(b)&&o,S=m.classed("extent"),k=Mn(y),N=n.mouse(y),E=n.select(u(y)).on("keydown.brush",function(){32==n.event.keyCode&&(S||(s=null,N[0]-=a[1],N[1]-=l[1],S=2),U())}).on("keyup.brush",function(){32==n.event.keyCode&&2==S&&(N[0]+=a[1],N[1]+=l[1],S=0,U())});if(n.event.changedTouches?E.on("touchmove.brush",z).on("touchend.brush",q):E.on("mousemove.brush",z).on("mouseup.brush",q),x.interrupt().selectAll("*").interrupt(),S)N[0]=a[0]-N[0],N[1]=l[0]-N[1];else if(b){var A=+/w$/.test(b),C=+/^n/.test(b);d=[a[1-A]-N[0],l[1-C]-N[1]],N[0]=a[A],N[1]=l[C]}else n.event.altKey&&(s=N.slice());function z(){var t=n.mouse(y),e=!1;d&&(t[0]+=d[0],t[1]+=d[1]),S||(n.event.altKey?(s||(s=[(a[0]+a[1])/2,(l[0]+l[1])/2]),N[0]=a[+(t[0]1?{floor:function(t){for(;a(t=n.floor(t));)t=Aa(t-1);return t},ceil:function(t){for(;a(t=n.ceil(t));)t=Aa(+t+1);return t}}:n))},i.ticks=function(n,t){var e=io(i.domain()),r=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return r&&(n=r[0],t=r[1]),n.range(e[0],Aa(+e[1]+1),t<1?1:t)},i.tickFormat=function(){return r},i.copy=function(){return Ea(t.copy(),e,r)},so(i,t)}function Aa(n){return new Date(n)}wa.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Na:ka,Na.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Na.toString=ka.toString,Tt.second=Ut(function(n){return new Rt(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Tt.seconds=Tt.second.range,Tt.seconds.utc=Tt.second.utc.range,Tt.minute=Ut(function(n){return new Rt(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Tt.minutes=Tt.minute.range,Tt.minutes.utc=Tt.minute.utc.range,Tt.hour=Ut(function(n){var t=n.getTimezoneOffset()/60;return new Rt(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Tt.hours=Tt.hour.range,Tt.hours.utc=Tt.hour.utc.range,Tt.month=Ut(function(n){return(n=Tt.day(n)).setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Tt.months=Tt.month.range,Tt.months.utc=Tt.month.utc.range;var Ca=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],za=[[Tt.second,1],[Tt.second,5],[Tt.second,15],[Tt.second,30],[Tt.minute,1],[Tt.minute,5],[Tt.minute,15],[Tt.minute,30],[Tt.hour,1],[Tt.hour,3],[Tt.hour,6],[Tt.hour,12],[Tt.day,1],[Tt.day,2],[Tt.week,1],[Tt.month,1],[Tt.month,3],[Tt.year,1]],La=wa.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Xe]]),qa={range:function(t,e,r){return n.range(Math.ceil(t/r)*r,+e,r).map(Aa)},floor:z,ceil:z};za.year=Tt.year,Tt.scale=function(){return Ea(n.scale.linear(),za,La)};var Ta=za.map(function(n){return[n[0].utc,n[1]]}),Ra=Sa.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Xe]]);function Da(n){return JSON.parse(n.responseText)}function Pa(n){var t=r.createRange();return t.selectNode(r.body),t.createContextualFragment(n.responseText)}Ta.year=Tt.year.utc,Tt.scale.utc=function(){return Ea(n.scale.linear(),Ta,Ra)},n.text=yt(function(n){return n.responseText}),n.json=function(n,t){return mt(n,"application/json",Da,t)},n.html=function(n,t){return mt(n,"text/html",Pa,t)},n.xml=yt(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=n,define(n)):"object"==typeof module&&module.exports?module.exports=n:this.d3=n}(); -},{}],7:[function(require,module,exports) { -!function(){var t={dev:!1};t.tooltip=t.tooltip||{},t.utils=t.utils||{},t.models=t.models||{},t.charts={},t.logs={},t.dom={},"undefined"!=typeof module&&"undefined"!=typeof exports&&"undefined"==typeof d3&&(d3=require("d3")),t.dispatch=d3.dispatch("render_start","render_end"),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i}),t.dev&&(t.dispatch.on("render_start",function(e){t.logs.startTime=+new Date}),t.dispatch.on("render_end",function(e){t.logs.endTime=+new Date,t.logs.totalTime=t.logs.endTime-t.logs.startTime,t.log("total",t.logs.totalTime)})),t.log=function(){if(t.dev&&window.console&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(t.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind){Function.prototype.bind.call(console.log,console).apply(console,arguments)}return arguments[arguments.length-1]},t.deprecated=function(t,e){console&&console.warn&&console.warn("nvd3 warning: `"+t+"` has been deprecated. ",e||"")},t.render=function(e){e=e||1,t.render.active=!0,t.dispatch.render_start();var n=function(){for(var r,i,o=0;op||n>h||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||a){if(u&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(l.nvPointerEventsClass)))return;return o.elementMouseout({mouseX:t,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0)}l.hidden(!1);var s=void 0;if("function"==typeof i.rangeBands){var d=d3.bisect(i.range(),t)-1;if(!(i.range()[d]+i.rangeBand()>=t))return o.elementMouseout({mouseX:t,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0);s=i.domain()[d3.bisect(i.range(),t)-1]}else s=i.invert(t);o.elementMousemove({mouseX:t,mouseY:n,pointXValue:s}),"dblclick"===d3.event.type&&o.elementDblclick({mouseX:t,mouseY:n,pointXValue:s}),"click"===d3.event.type&&o.elementClick({mouseX:t,mouseY:n,pointXValue:s}),"mousedown"===d3.event.type&&o.elementMouseDown({mouseX:t,mouseY:n,pointXValue:s}),"mouseup"===d3.event.type&&o.elementMouseUp({mouseX:t,mouseY:n,pointXValue:s})}g.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer").append("g").attr("class","nv-interactiveGuideLine"),s&&(s.on("touchmove",v).on("mousemove",v,!0).on("mouseout",v,!0).on("mousedown",v,!0).on("mouseup",v,!0).on("dblclick",v).on("click",v),c.guideLine=null,c.renderGuideLine=function(e){a&&(c.guideLine&&c.guideLine.attr("x1")===e||t.dom.write(function(){var n=g.select(".nv-interactiveGuideLine").selectAll("line").data(null!=e?[t.utils.NaNtoZero(e)]:[],String);n.enter().append("line").attr("class","nv-guideline").attr("x1",function(t){return t}).attr("x2",function(t){return t}).attr("y1",h).attr("y2",0),n.exit().remove()}))})})}return l.duration(0).hideDelay(0).hidden(!1),c.dispatch=o,c.tooltip=l,c.margin=function(t){return arguments.length?(e.top=void 0!==t.top?t.top:e.top,e.left=void 0!==t.left?t.left:e.left,c):e},c.width=function(t){return arguments.length?(n=t,c):n},c.height=function(t){return arguments.length?(r=t,c):r},c.xScale=function(t){return arguments.length?(i=t,c):i},c.showGuideLine=function(t){return arguments.length?(a=t,c):a},c.svgContainer=function(t){return arguments.length?(s=t,c):s},c},t.interactiveBisect=function(t,e,n){"use strict";if(!(t instanceof Array))return null;var r;r="function"!=typeof n?function(t){return t.x}:n;var i=d3.bisector(function(t,e){return r(t)-e}).left,o=d3.max([0,i(t,e)-1]),a=r(t[o]);if(void 0===a&&(a=o),a===e)return o;var s=d3.min([o+1,t.length-1]),l=r(t[s]);return void 0===l&&(l=s),Math.abs(l-e)>=Math.abs(a-e)?o:s},t.nearestValueIndex=function(t,e,n){"use strict";var r=1/0,i=null;return t.forEach(function(t,o){var a=Math.abs(e-t);null!=t&&a<=r&&a"+t.footer+"
"),i},x=function(){var t={left:null!==d3.event?d3.event.clientX:0,top:null!==d3.event?d3.event.clientY:0};if("none"!=getComputedStyle(document.body).transform){var e=document.body.getBoundingClientRect();t.left-=e.left,t.top-=e.top}return t},b=function(e){if(e&&e.series){if(t.utils.isArray(e.series))return!0;if(t.utils.isObject(e.series))return e.series=[e.series],!0}return!1},k=function(){t.dom.read(function(){var t=x(),e=function(t){var e,n,o,a=u.node().offsetHeight,s=u.node().offsetWidth,l=document.documentElement.clientWidth,c=document.documentElement.clientHeight;switch(r){case"e":e=-s-i,n=-a/2,t.left+e<0&&(e=i),(o=t.top+n)<0&&(n-=o),(o=t.top+n+a)>c&&(n-=o-c);break;case"w":e=i,n=-a/2,t.left+e+s>l&&(e=-s-i),(o=t.top+n)<0&&(n-=o),(o=t.top+n+a)>c&&(n-=o-c);break;case"n":e=-s/2-5,n=i,t.top+n+a>c&&(n=-a-i),(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"s":e=-s/2,n=-a-i,t.top+n<0&&(n=i),(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"center":e=-s/2,n=-a/2;break;default:e=0,n=0}return{left:e,top:n}}(t),n=t.left+e.left,o=t.top+e.top;if(s)u.interrupt().transition().delay(l).duration(0).style("opacity",0);else{var a="translate("+c.left+"px, "+c.top+"px)",d="translate("+Math.round(n)+"px, "+Math.round(o)+"px)",p=d3.interpolateString(a,d),h=u.style("opacity")<.1;u.interrupt().transition().duration(h?0:f).styleTween("transform",function(t){return p},"important").styleTween("-webkit-transform",function(t){return p}).style("-ms-transform",d).style("opacity",1)}c.left=n,c.top=o})};function w(){if(d&&b(n))return t.dom.write(function(){u&&u.node()||((u=d3.select(document.body).select("#"+e).data([1])).enter().append("div").attr("class","nvtooltip "+(a||"xy-tooltip")).attr("id",e).style("top",0).style("left",0).style("opacity",0).style("position","fixed").selectAll("div, table, td, tr").classed(h,!0).classed(h,!0),u.exit().remove());var t=y(n,u.node());t&&(u.node().innerHTML=t),k()}),w}return w.nvPointerEventsClass=h,w.options=t.utils.optionsFunc.bind(w),w._options=Object.create({},{duration:{get:function(){return f},set:function(t){f=t}},gravity:{get:function(){return r},set:function(t){r=t}},distance:{get:function(){return i},set:function(t){i=t}},snapDistance:{get:function(){return o},set:function(t){o=t}},classes:{get:function(){return a},set:function(t){a=t}},enabled:{get:function(){return d},set:function(t){d=t}},hideDelay:{get:function(){return l},set:function(t){l=t}},contentGenerator:{get:function(){return y},set:function(t){y=t}},valueFormatter:{get:function(){return g},set:function(t){g=t}},headerFormatter:{get:function(){return v},set:function(t){v=t}},keyFormatter:{get:function(){return m},set:function(t){m=t}},headerEnabled:{get:function(){return p},set:function(t){p=t}},position:{get:function(){return x},set:function(t){x=t}},chartContainer:{get:function(){return document.body},set:function(e){t.deprecated("chartContainer","feature removed after 1.8.3")}},fixedTop:{get:function(){return null},set:function(e){t.deprecated("fixedTop","feature removed after 1.8.1")}},offset:{get:function(){return{left:0,top:0}},set:function(e){t.deprecated("offset","use chart.tooltip.distance() instead")}},hidden:{get:function(){return s},set:function(t){s!=t&&(s=!!t,w())}},data:{get:function(){return n},set:function(t){t.point&&(t.value=t.point.x,t.series=t.series||{},t.series.value=t.point.y,t.series.color=t.point.color||t.series.color),n=t}},node:{get:function(){return u.node()},set:function(t){}},id:{get:function(){return e},set:function(t){}}}),t.utils.initOptions(w),w},t.utils.windowSize=function(){var t={width:640,height:480};return window.innerWidth&&window.innerHeight?(t.width=window.innerWidth,t.height=window.innerHeight,t):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(t.width=document.documentElement.offsetWidth,t.height=document.documentElement.offsetHeight,t):document.body&&document.body.offsetWidth?(t.width=document.body.offsetWidth,t.height=document.body.offsetHeight,t):t},t.utils.isArray=Array.isArray,t.utils.isObject=function(t){return null!==t&&"object"==typeof t},t.utils.isFunction=function(t){return"function"==typeof t},t.utils.isDate=function(t){return"[object Date]"===toString.call(t)},t.utils.isNumber=function(t){return!isNaN(t)&&"number"==typeof t},t.utils.windowResize=function(e){return window.addEventListener?window.addEventListener("resize",e):t.log("ERROR: Failed to bind to window.resize with: ",e),{callback:e,clear:function(){window.removeEventListener("resize",e)}}},t.utils.getColor=function(e){if(void 0===e)return t.utils.defaultColor();if(t.utils.isArray(e)){var n=d3.scale.ordinal().range(e);return function(t,e){var r=void 0===e?t:e;return t.color||n(r)}}return e},t.utils.defaultColor=function(){return t.utils.getColor(d3.scale.category20().range())},t.utils.customTheme=function(e,n,r){n=n||function(t){return t.key};var i=(r=r||d3.scale.category20().range()).length;return function(o,a){var s=n(o);return t.utils.isFunction(e[s])?e[s]():void 0!==e[s]?e[s]:(i||(i=r.length),r[i-=1])}},t.utils.pjax=function(e,n){var r=function(r){d3.html(r,function(r){var i=d3.select(n).node();i.parentNode.replaceChild(d3.select(r).select(n).node(),i),t.utils.pjax(e,n)})};d3.selectAll(e).on("click",function(){history.pushState(this.href,this.textContent,this.href),r(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&r(d3.event.state)})},t.utils.calcApproxTextWidth=function(e){if(t.utils.isFunction(e.style)&&t.utils.isFunction(e.text)){var n=parseInt(e.style("font-size").replace("px",""),10),r=e.text().length;return t.utils.NaNtoZero(r*n*.5)}return 0},t.utils.NaNtoZero=function(e){return!t.utils.isNumber(e)||isNaN(e)||null===e||e===1/0||e===-1/0?0:e},d3.selection.prototype.watchTransition=function(t){var e=[this].concat([].slice.call(arguments,1));return t.transition.apply(t,e)},t.utils.renderWatch=function(e,n){if(!(this instanceof t.utils.renderWatch))return new t.utils.renderWatch(e,n);var r=void 0!==n?n:250,i=[],o=this;this.models=function(t){return[].slice.call(arguments,0).forEach(function(t){var e;t.__rendered=!1,(e=t).dispatch.on("renderEnd",function(t){e.__rendered=!0,o.renderEnd("model")}),i.indexOf(t)<0&&i.push(t)}),this},this.reset=function(t){void 0!==t&&(r=t),i=[]},this.transition=function(t,e,n){if(n=(e=arguments.length>1?[].slice.call(arguments,1):[]).length>1?e.pop():void 0!==r?r:250,t.__rendered=!1,i.indexOf(t)<0&&i.push(t),0===n)return t.__rendered=!0,t.delay=function(){return this},t.duration=function(){return this},t;0===t.length?t.__rendered=!0:t.every(function(t){return!t.length})?t.__rendered=!0:t.__rendered=!1;var a=0;return t.transition().duration(n).each(function(){++a}).each("end",function(n,r){0==--a&&(t.__rendered=!0,o.renderEnd.apply(this,e))})},this.renderEnd=function(){i.every(function(t){return t.__rendered})&&(i.forEach(function(t){t.__rendered=!1}),e.renderEnd.apply(this,arguments))}},t.utils.deepExtend=function(e){(arguments.length>1?[].slice.call(arguments,1):[]).forEach(function(n){for(var r in n){var i=t.utils.isArray(e[r]),o=t.utils.isObject(e[r]),a=t.utils.isObject(n[r]);o&&!i&&a?t.utils.deepExtend(e[r],n[r]):e[r]=n[r]}})},t.utils.state=function(){if(!(this instanceof t.utils.state))return new t.utils.state;var e={},n=function(){},r=function(){return{}},i=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",function(t){n(t,!0)}),this.getter=function(t){return r=t,this},this.setter=function(t,e){return e||(e=function(){}),n=function(n,r){t(n),r&&e()},this},this.init=function(e){i=i||{},t.utils.deepExtend(i,e)};this.update=function(){i&&(n(i,!1),i=null),function(){var t=r();if(JSON.stringify(t)===JSON.stringify(e))return!1;for(var n in t)void 0===e[n]&&(e[n]={}),e[n]=t[n],!0;return!0}.call(this)&&this.dispatch.change(e)}},t.utils.optionsFunc=function(e){return e&&d3.map(e).forEach(function(e,n){t.utils.isFunction(this[e])&&this[e](n)}.bind(this)),this},t.utils.calcTicksX=function(e,n){for(var r=1,i=0;ir?o:r}return t.log("Requested number of ticks: ",e),t.log("Calculated max values to be: ",r),e=(e=e>r?e=r-1:e)<1?1:e,e=Math.floor(e),t.log("Calculating tick count as: ",e),e},t.utils.calcTicksY=function(e,n){return t.utils.calcTicksX(e,n)},t.utils.initOption=function(t,e){t._calls&&t._calls[e]?t[e]=t._calls[e]:(t[e]=function(n){return arguments.length?(t._overrides[e]=!0,t._options[e]=n,t):t._options[e]},t["_"+e]=function(n){return arguments.length?(t._overrides[e]||(t._options[e]=n),t):t._options[e]})},t.utils.initOptions=function(e){e._overrides=e._overrides||{};var n=Object.getOwnPropertyNames(e._options||{}),r=Object.getOwnPropertyNames(e._calls||{});for(var i in n=n.concat(r))t.utils.initOption(e,n[i])},t.utils.inheritOptionsD3=function(t,e,n){t._d3options=n.concat(t._d3options||[]),t._d3options=(t._d3options||[]).filter(function(t,e,n){return n.indexOf(t)===e}),n.unshift(e),n.unshift(t),d3.rebind.apply(this,n)},t.utils.arrayUnique=function(t){return t.sort().filter(function(e,n){return!n||e!=t[n-1]})},t.utils.symbolMap=d3.map(),t.utils.symbol=function(){var e,n=64;function r(r,i){var o=e.call(this,r,i),a=n.call(this,r,i);return-1!==d3.svg.symbolTypes.indexOf(o)?d3.svg.symbol().type(o).size(a)():t.utils.symbolMap.get(o)(a)}return r.type=function(t){return arguments.length?(e=d3.functor(t),r):e},r.size=function(t){return arguments.length?(n=d3.functor(t),r):n},r},t.utils.inheritOptions=function(e,n){var r=Object.getOwnPropertyNames(n._options||{}),i=Object.getOwnPropertyNames(n._calls||{}),o=n._inherited||[],a=n._d3options||[],s=r.concat(i).concat(o).concat(a);s.unshift(n),s.unshift(e),d3.rebind.apply(this,s),e._inherited=t.utils.arrayUnique(r.concat(i).concat(o).concat(r).concat(e._inherited||[])),e._d3options=t.utils.arrayUnique(a.concat(e._d3options||[]))},t.utils.initSVG=function(t){t.classed({"nvd3-svg":!0})},t.utils.sanitizeHeight=function(t,e){return t||parseInt(e.style("height"),10)||400},t.utils.sanitizeWidth=function(t,e){return t||parseInt(e.style("width"),10)||960},t.utils.availableHeight=function(e,n,r){return Math.max(0,t.utils.sanitizeHeight(e,n)-r.top-r.bottom)},t.utils.availableWidth=function(e,n,r){return Math.max(0,t.utils.sanitizeWidth(e,n)-r.left-r.right)},t.utils.noData=function(e,n){var r=e.options(),i=r.margin(),o=r.noData(),a=null==o?["No Data Available."]:[o],s=t.utils.availableHeight(null,n,i),l=t.utils.availableWidth(null,n,i),u=i.left+l/2,c=i.top+s/2;n.selectAll("g").remove();var d=n.selectAll(".nv-noData").data(a);d.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),d.attr("x",u).attr("y",c).text(function(t){return t})},t.utils.wrapTicks=function(t,e){t.each(function(){for(var t,n=d3.select(this),r=n.text().split(/\s+/).reverse(),i=[],o=0,a=n.attr("y"),s=parseFloat(n.attr("dy")),l=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");t=r.pop();)i.push(t),l.text(i.join(" ")),l.node().getComputedTextLength()>e&&(i.pop(),l.text(i.join(" ")),i=[t],l=n.append("tspan").attr("x",0).attr("y",a).attr("dy",1.1*++o+s+"em").text(t))})},t.utils.arrayEquals=function(e,n){if(e===n)return!0;if(!e||!n)return!1;if(e.length!=n.length)return!1;for(var r=0,i=e.length;r2&&(A=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",0).attr("x",A/2),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),M.exit().remove(),M.attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(i(e))+",0)"}).select("text").attr("dy","-0.5em").attr("y",-r.tickPadding()).attr("text-anchor","middle").text(function(t,n){var r=(e||k)(t);return(""+r).match("NaN")?"":r}),M.watchTransition(x,"min-max top").attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(i.range()[n])+",0)"}));break;case"bottom":w=g+36;var S=30,W=0,E=b.selectAll("g").select("text"),F="";if(c%360){E.attr("transform",""),E.each(function(t,e){var n=this.getBoundingClientRect(),r=n.width;W=n.height,r>S&&(S=r)}),F="rotate("+c+" 0,"+(W/2+r.tickPadding())+")";var N=Math.abs(Math.sin(c*Math.PI/180));w=(N?N*S:S)+30,E.attr("transform",F).style("text-anchor",c%360>0?"start":"end")}else f?E.attr("transform",function(t,e){return"translate(0,"+(e%2==0?"0":"12")+")"}):E.attr("transform","translate(0,0)");C.enter().append("text").attr("class","nv-axislabel"),A=0,1===i.range().length?A=p?2*i.range()[0]+i.rangeBand():0:2===i.range().length?A=p?i.range()[0]+i.range()[1]+i.rangeBand():i.range()[1]:i.range().length>2&&(A=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",w).attr("x",A/2),u&&((M=y.selectAll("g.nv-axisMaxMin").data([i.domain()[0],i.domain()[i.domain().length-1]])).enter().append("g").attr("class",function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),M.exit().remove(),M.attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(i(e)+(p?i.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",r.tickPadding()).attr("transform",F).style("text-anchor",c?c%360>0?"start":"end":"middle").text(function(t,n){var r=(e||k)(t);return(""+r).match("NaN")?"":r}),M.watchTransition(x,"min-max bottom").attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(i(e)+(p?i.rangeBand()/2:0))+",0)"}));break;case"right":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"begin").attr("transform",d?"rotate(90)":"").attr("y",d?12-Math.max(o.right,a)-(g||0):-10).attr("x",d?d3.max(i.range())/2:r.tickPadding()),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),M.exit().remove(),M.attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(i(e))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",r.tickPadding()).style("text-anchor","start").text(function(t,n){var r=(e||k)(t);return(""+r).match("NaN")?"":r}),M.watchTransition(x,"min-max right").attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(i.range()[n])+")"}).select("text").style("opacity",1));break;case"left":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"end").attr("transform",d?"rotate(-90)":"").attr("y",d?25-Math.max(o.left,a)-(g||0):-10).attr("x",d?-d3.max(i.range())/2:-r.tickPadding()),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),M.exit().remove(),M.attr("transform",function(e,r){return"translate(0,"+t.utils.NaNtoZero(n(e))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-r.tickPadding()).attr("text-anchor","end").text(function(t,n){var r=(e||k)(t);return(""+r).match("NaN")?"":r}),M.watchTransition(x,"min-max right").attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(i.range()[n])+")"}).select("text").style("opacity",1))}if(C.text(function(t){return t}),!u||"left"!==r.orient()&&"right"!==r.orient()||(b.selectAll("g").each(function(t,e){d3.select(this).select("text").attr("opacity",1),(i(t)i.range()[0]-10)&&((t>1e-10||t<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),i.domain()[0]==i.domain()[1]&&0==i.domain()[0]&&y.selectAll("g.nv-axisMaxMin").style("opacity",function(t,e){return e?0:1})),u&&("top"===r.orient()||"bottom"===r.orient())){var D=[];y.selectAll("g.nv-axisMaxMin").each(function(t,e){try{e?D.push(i(t)-this.getBoundingClientRect().width-4):D.push(i(t)+this.getBoundingClientRect().width+4)}catch(n){e?D.push(i(t)-4):D.push(i(t)+4)}}),b.selectAll("g").each(function(t,e){(i(t)D[1])&&(t>1e-10||t<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())})}b.selectAll(".tick").filter(function(t){return!parseFloat(Math.round(1e5*t)/1e6)&&void 0!==t}).classed("zero",!0),n=i.copy()}),x.renderEnd("axis immediate"),b}return b.axis=r,b.dispatch=y,b.options=t.utils.optionsFunc.bind(b),b._options=Object.create({},{axisLabelDistance:{get:function(){return g},set:function(t){g=t}},staggerLabels:{get:function(){return f},set:function(t){f=t}},rotateLabels:{get:function(){return c},set:function(t){c=t}},rotateYLabel:{get:function(){return d},set:function(t){d=t}},showMaxMin:{get:function(){return u},set:function(t){u=t}},axisLabel:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return s},set:function(t){s=t}},ticks:{get:function(){return h},set:function(t){h=t}},width:{get:function(){return a},set:function(t){a=t}},fontSize:{get:function(){return v},set:function(t){v=t}},tickFormatMaxMin:{get:function(){return e},set:function(t){e=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},duration:{get:function(){return m},set:function(t){m=t,x.reset(m)}},scale:{get:function(){return i},set:function(e){i=e,r.scale(i),p="function"==typeof i.rangeBands,t.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"])}}}),t.utils.initOptions(b),t.utils.inheritOptionsD3(b,r,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),t.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"]),b},t.models.boxPlot=function(){"use strict";var e,n,r,i,o,a,s={top:0,right:0,bottom:0,left:0},l=960,u=500,c=Math.floor(1e4*Math.random()),d=d3.scale.ordinal(),f=d3.scale.linear(),p=function(t){return t.label},h=function(t){return t.values.Q1},g=function(t){return t.values.Q2},v=function(t){return t.values.Q3},m=function(t){return t.values.whisker_low},y=function(t){return t.values.whisker_high},x=function(t){return t.color},b=function(t){return t.values.outliers},k=function(t,e,n){return t},w=function(t,e,n){return t},M=function(t,e,n){},A=t.utils.defaultColor(),C=null,S=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),W=250,E=null,F=t.utils.renderWatch(S,W);function N(c){return F.reset(),c.each(function(c){var N=l-s.left-s.right,D=u-s.top-s.bottom;C=d3.select(this),t.utils.initSVG(C),d.domain(e||c.map(function(t,e){return p(t,e)})).rangeBands(n||[0,N],.1);var O=[];if(!r){var _=[];c.forEach(function(t,e){var n=h(t),r=v(t),i=m(t),o=y(t),a=b(t);a&&a.forEach(function(t,e){_.push(k(t,e,void 0))}),i&&_.push(i),n&&_.push(n),r&&_.push(r),o&&_.push(o)}),O=[d3.min(_),d3.max(_)]}f.domain(r||O),f.range(i||[D,0]),o=o||d,a=a||f.copy().range([f(0),f(0)]);var L=C.selectAll("g.nv-wrap").data([c]);L.enter().append("g").attr("class","nvd3 nv-wrap");L.attr("transform","translate("+s.left+","+s.top+")");var B=L.selectAll(".nv-boxplot").data(function(t){return t}),P=B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);B.attr("class","nv-boxplot").attr("transform",function(t,e,n){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"}).classed("hover",function(t){return t.hover}),B.watchTransition(F,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay(function(t,e){return e*W/c.length}).attr("transform",function(t,e){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"}),B.exit().remove(),P.each(function(t,e){var n=d3.select(this);[m,y].forEach(function(r){if(void 0!==r(t)&&null!==r(t)){var i=r===m?"low":"high";n.append("line").style("stroke",x(t)||A(t,e)).attr("class","nv-boxplot-whisker nv-boxplot-"+i),n.append("line").style("stroke",x(t)||A(t,e)).attr("class","nv-boxplot-tick nv-boxplot-"+i)}})});var T=function(){return null===E?.9*d.rangeBand():Math.min(75,.9*d.rangeBand())},I=function(){return.45*d.rangeBand()-T()/2},z=function(){return.45*d.rangeBand()+T()/2};[m,y].forEach(function(t){var e=t===m?"low":"high",n=t===m?h:v;B.select("line.nv-boxplot-whisker.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",.45*d.rangeBand()).attr("y1",function(e,n){return f(t(e))}).attr("x2",.45*d.rangeBand()).attr("y2",function(t,e){return f(n(t))}),B.select("line.nv-boxplot-tick.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",I).attr("y1",function(e,n){return f(t(e))}).attr("x2",z).attr("y2",function(e,n){return f(t(e))})}),[m,y].forEach(function(t){var e=t===m?"low":"high";P.selectAll(".nv-boxplot-"+e).on("mouseover",function(e,n,r){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:t(e),color:x(e)||A(e,r)},e:d3.event})}).on("mouseout",function(e,n,r){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:t(e),color:x(e)||A(e,r)},e:d3.event})}).on("mousemove",function(t,e){S.elementMousemove({e:d3.event})})}),P.append("rect").attr("class","nv-boxplot-box").on("mouseover",function(t,e){d3.select(this).classed("hover",!0),S.elementMouseover({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||A(t,e)},{key:"Q2",value:g(t),color:x(t)||A(t,e)},{key:"Q1",value:h(t),color:x(t)||A(t,e)}],data:t,index:e,e:d3.event})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1),S.elementMouseout({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||A(t,e)},{key:"Q2",value:g(t),color:x(t)||A(t,e)},{key:"Q1",value:h(t),color:x(t)||A(t,e)}],data:t,index:e,e:d3.event})}).on("mousemove",function(t,e){S.elementMousemove({e:d3.event})}),B.select("rect.nv-boxplot-box").watchTransition(F,"nv-boxplot: boxes").attr("y",function(t,e){return f(v(t))}).attr("width",T).attr("x",I).attr("height",function(t,e){return Math.abs(f(v(t))-f(h(t)))||1}).style("fill",function(t,e){return x(t)||A(t,e)}).style("stroke",function(t,e){return x(t)||A(t,e)}),P.append("line").attr("class","nv-boxplot-median"),B.select("line.nv-boxplot-median").watchTransition(F,"nv-boxplot: boxplots line").attr("x1",I).attr("y1",function(t,e){return f(g(t))}).attr("x2",z).attr("y2",function(t,e){return f(g(t))});var V=B.selectAll(".nv-boxplot-outlier").data(function(t){return b(t)||[]});V.enter().append("circle").style("fill",function(t,e,n){return M(t,e,n)||A(t,n)}).style("stroke",function(t,e,n){return M(t,e,n)||A(t,n)}).style("z-index",9e3).on("mouseover",function(t,e,n){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:w(t,e,n),color:M(t,e,n)||A(t,n)},e:d3.event})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:w(t,e,n),color:M(t,e,n)||A(t,n)},e:d3.event})}).on("mousemove",function(t,e){S.elementMousemove({e:d3.event})}),V.attr("class","nv-boxplot-outlier"),V.watchTransition(F,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*d.rangeBand()).attr("cy",function(t,e,n){return f(k(t,e,n))}).attr("r","3"),V.exit().remove(),o=d.copy(),a=f.copy()}),F.renderEnd("nv-boxplot immediate"),N}return N.dispatch=S,N.options=t.utils.optionsFunc.bind(N),N._options=Object.create({},{width:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return u},set:function(t){u=t}},maxBoxWidth:{get:function(){return E},set:function(t){E=t}},x:{get:function(){return p},set:function(t){p=t}},q1:{get:function(){return h},set:function(t){h=t}},q2:{get:function(){return g},set:function(t){g=t}},q3:{get:function(){return v},set:function(t){v=t}},wl:{get:function(){return m},set:function(t){m=t}},wh:{get:function(){return y},set:function(t){y=t}},itemColor:{get:function(){return x},set:function(t){x=t}},outliers:{get:function(){return b},set:function(t){b=t}},outlierValue:{get:function(){return k},set:function(t){k=t}},outlierLabel:{get:function(){return w},set:function(t){w=t}},outlierColor:{get:function(){return M},set:function(t){M=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=t}},id:{get:function(){return c},set:function(t){c=t}},y:{get:function(){return console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead."),{}},set:function(t){console.warn("BoxPlot 'y' chart option is deprecated. Please use model overrides instead.")}},margin:{get:function(){return s},set:function(t){s.top=void 0!==t.top?t.top:s.top,s.right=void 0!==t.right?t.right:s.right,s.bottom=void 0!==t.bottom?t.bottom:s.bottom,s.left=void 0!==t.left?t.left:s.left}},color:{get:function(){return A},set:function(e){A=t.utils.getColor(e)}},duration:{get:function(){return W},set:function(t){W=t,F.reset(W)}}}),t.utils.initOptions(N),N},t.models.boxPlotChart=function(){"use strict";var e,n,r=t.models.boxPlot(),i=t.models.axis(),o=t.models.axis(),a={top:15,right:10,bottom:50,left:60},s=null,l=null,u=t.utils.getColor(),c=!0,d=!0,f=!1,p=!1,h=t.models.tooltip(),g="No Data Available.",v=d3.dispatch("beforeUpdate","renderEnd"),m=250;i.orient("bottom").showMaxMin(!1).tickFormat(function(t){return t}),o.orient(f?"right":"left").tickFormat(d3.format(",.1f")),h.duration(0);var y=t.utils.renderWatch(v,m);function x(u){return y.reset(),y.models(r),c&&y.models(i),d&&y.models(o),u.each(function(u){var h=d3.select(this);t.utils.initSVG(h);var y=(s||parseInt(h.style("width"))||960)-a.left-a.right,b=(l||parseInt(h.style("height"))||400)-a.top-a.bottom;if(x.update=function(){v.beforeUpdate(),h.transition().duration(m).call(x)},x.container=this,!u||!u.length){var k=h.selectAll(".nv-noData").data([g]);return k.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),k.attr("x",a.left+y/2).attr("y",a.top+b/2).text(function(t){return t}),x}h.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale().clamp(!0);var w=h.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([u]),M=w.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),A=M.append("defs"),C=w.select("g");if(M.append("g").attr("class","nv-x nv-axis"),M.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),M.append("g").attr("class","nv-barsWrap"),C.attr("transform","translate("+a.left+","+a.top+")"),f&&C.select(".nv-y.nv-axis").attr("transform","translate("+y+",0)"),r.width(y).height(b),C.select(".nv-barsWrap").datum(u.filter(function(t){return!t.disabled})).transition().call(r),A.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect"),C.select("#nv-x-label-clip-"+r.id()+" rect").attr("width",e.rangeBand()*(p?2:1)).attr("height",16).attr("x",-e.rangeBand()/(p?1:2)),c){i.scale(e).ticks(t.utils.calcTicksX(y/100,u)).tickSize(-b,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),C.select(".nv-x.nv-axis").call(i);var S=C.select(".nv-x.nv-axis").selectAll("g");p&&S.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"})}d&&(o.scale(n).ticks(Math.floor(b/36)).tickSize(-y,0),C.select(".nv-y.nv-axis").call(o)),C.select(".nv-zeroLine line").attr("x1",0).attr("x2",y).attr("y1",n(0)).attr("y2",n(0))}),y.renderEnd("nv-boxplot chart immediate"),x}return r.dispatch.on("elementMouseover.tooltip",function(t){h.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){h.data(t).hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){h()}),x.dispatch=v,x.boxplot=r,x.xAxis=i,x.yAxis=o,x.tooltip=h,x.options=t.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},staggerLabels:{get:function(){return p},set:function(t){p=t}},showXAxis:{get:function(){return c},set:function(t){c=t}},showYAxis:{get:function(){return d},set:function(t){d=t}},tooltipContent:{get:function(){return h},set:function(t){h=t}},noData:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!==t.top?t.top:a.top,a.right=void 0!==t.right?t.right:a.right,a.bottom=void 0!==t.bottom?t.bottom:a.bottom,a.left=void 0!==t.left?t.left:a.left}},duration:{get:function(){return m},set:function(t){m=t,y.reset(m),r.duration(m),i.duration(m),o.duration(m)}},color:{get:function(){return u},set:function(e){u=t.utils.getColor(e),r.color(u)}},rightAlignYAxis:{get:function(){return f},set:function(t){f=t,o.orient(t?"right":"left")}}}),t.utils.inheritOptions(x,r),t.utils.initOptions(x),x},t.models.bullet=function(){"use strict";var e={top:0,right:0,bottom:0,left:0},n="left",r=!1,i=function(t){return t.ranges},o=function(t){return t.markers?t.markers:[]},a=function(t){return t.markerLines?t.markerLines:[0]},s=function(t){return t.measures},l=function(t){return t.rangeLabels?t.rangeLabels:[]},u=function(t){return t.markerLabels?t.markerLabels:[]},c=function(t){return t.markerLineLabels?t.markerLineLabels:[]},d=function(t){return t.measureLabels?t.measureLabels:[]},f=[0],p=380,h=30,g=null,v=null,m=t.utils.getColor(["#1f77b4"]),y=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),x=["Maximum","Mean","Minimum"],b=["Max","Avg","Min"],k=1e3;function w(t,e){var n=t.slice();t.sort(function(t,r){var i=n.indexOf(t),o=n.indexOf(r);return d3.descending(e[i],e[o])})}function M(n){return n.each(function(n,v){var M=p-e.left-e.right,A=h-e.top-e.bottom;g=d3.select(this),t.utils.initSVG(g);var C=i.call(this,n,v).slice(),S=o.call(this,n,v).slice(),W=a.call(this,n,v).slice(),E=s.call(this,n,v).slice(),F=l.call(this,n,v).slice(),N=u.call(this,n,v).slice(),D=c.call(this,n,v).slice(),O=d.call(this,n,v).slice();w(F,C),w(N,S),w(D,W),w(O,E),C.sort(d3.descending),S.sort(d3.descending),W.sort(d3.descending),E.sort(d3.descending);var _=d3.scale.linear().domain(d3.extent(d3.merge([f,C]))).range(r?[M,0]:[0,M]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(_.range());this.__chart__=_;d3.min(C),d3.max(C),C[1];for(var L=g.selectAll("g.nv-wrap.nv-bullet").data([n]),B=L.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet").append("g"),P=L.select("g"),T=(v=0,C.length);vg(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e});_.append("line").attr("class","nv-candlestick-lines").attr("transform",function(t,e){return"translate("+c(f(t,e))+",0)"}).attr("x1",0).attr("y1",function(t,e){return d(v(t,e))}).attr("x2",0).attr("y2",function(t,e){return d(m(t,e))}),_.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"}).attr("x",0).attr("y",0).attr("width",S).attr("height",function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)});O.select(".nv-candlestick-lines").transition().attr("transform",function(t,e){return"translate("+c(f(t,e))+",0)"}).attr("x1",0).attr("y1",function(t,e){return d(v(t,e))}).attr("x2",0).attr("y2",function(t,e){return d(m(t,e))}),O.select(".nv-candlestick-rects").transition().attr("transform",function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"}).attr("x",0).attr("y",0).attr("width",S).attr("height",function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)})}),C}return C.highlightPoint=function(t,n){C.clearHighlights(),e.select(".nv-candlestickBar .nv-tick-0-"+t).classed("hover",n)},C.clearHighlights=function(){e.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},C.dispatch=A,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceX:{get:function(){return y},set:function(t){y=t}},forceY:{get:function(){return x},set:function(t){x=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return k},set:function(t){k=t}},id:{get:function(){return u},set:function(t){u=t}},interactive:{get:function(){return M},set:function(t){M=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return a},set:function(t){a.top=null!=t.top?t.top:a.top,a.right=null!=t.right?t.right:a.right,a.bottom=null!=t.bottom?t.bottom:a.bottom,a.left=null!=t.left?t.left:a.left}},color:{get:function(){return w},set:function(e){w=t.utils.getColor(e)}}}),t.utils.initOptions(C),C},t.models.cumulativeLineChart=function(){"use strict";var e,n,r=t.models.line(),i=t.models.axis(),o=t.models.axis(),a=t.models.legend(),s=t.models.legend(),l=t.interactiveGuideline(),u=t.models.tooltip(),c={top:30,right:30,bottom:50,left:60},d=null,f=t.utils.defaultColor(),p=null,h=null,g=!0,v=!0,m=!0,y=!1,x=!0,b=!1,k=!0,w=r.id(),M=t.utils.state(),A=null,C=null,S=function(t){return t.average},W=d3.dispatch("stateChange","changeState","renderEnd"),E=250,F=!1;M.index=0,M.rescaleY=k,i.orient("bottom").tickPadding(7),o.orient(y?"right":"left"),u.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.updateState(!1);var N,D=d3.scale.linear(),O={i:0,x:0},_=t.utils.renderWatch(W,E),L=function(t){return function(){return{active:t.map(function(t){return!t.disabled}),index:O.i,rescaleY:k}}},B=function(t){return function(e){void 0!==e.index&&(O.i=e.index),void 0!==e.rescaleY&&(k=e.rescaleY),void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};function P(u){return _.reset(),_.models(r),v&&_.models(i),m&&_.models(o),u.each(function(u){var C=d3.select(this);t.utils.initSVG(C),C.classed("nv-chart-"+w,!0);var _,z=t.utils.availableWidth(p,C,c),V=t.utils.availableHeight(h,C,c);if(P.update=function(){0===E?C.call(P):C.transition().duration(E).call(P)},P.container=this,M.setter(B(u),P.update).getter(L(u)).update(),M.disabled=u.map(function(t){return!!t.disabled}),!A)for(_ in A={},M)M[_]instanceof Array?A[_]=M[_].slice(0):A[_]=M[_];var H=d3.behavior.drag().on("dragstart",function(t,e){d3.select(P.container).style("cursor","ew-resize")}).on("drag",function(t,e){O.x=d3.event.x,O.i=Math.round(D.invert(O.x)),$()}).on("dragend",function(t,e){d3.select(P.container).style("cursor","auto"),M.index=O.i,W.stateChange(M)});if(!(u&&u.length&&u.filter(function(t){return t.values.length}).length))return t.utils.noData(P,C),P;C.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale(),D.domain([0,u[0].values.length-1]).range([0,z]).clamp(!0);u=function(t,e){T||(T=r.y());return e.map(function(e,n){if(!e.values)return e;var r=e.values[t];if(null==r)return e;var i=T(r,t);return Math.abs(i)<1e-5&&!F?(e.tempDisabled=!0,e):(e.tempDisabled=!1,e.values=e.values.map(function(t,e){return t.display={y:(T(t,e)-i)/i},t}),e)})}(O.i,u);void 0===N&&(N=I(u)),k?r.yDomain(null):(r.yDomain(N),r.clipEdge(!0));var Y=b?"none":"all",G=C.selectAll("g.nv-wrap.nv-cumulativeLine").data([u]),X=G.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),j=G.select("g");if(X.append("g").attr("class","nv-interactive"),X.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),X.append("g").attr("class","nv-y nv-axis"),X.append("g").attr("class","nv-background"),X.append("g").attr("class","nv-linesWrap").style("pointer-events",Y),X.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),X.append("g").attr("class","nv-legendWrap"),X.append("g").attr("class","nv-controlsWrap"),g?(a.width(z),j.select(".nv-legendWrap").datum(u).call(a),d||a.height()===c.top||(c.top=a.height(),V=t.utils.availableHeight(h,C,c)),j.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):j.select(".nv-legendWrap").selectAll("*").remove(),x){var R=[{key:"Re-scale y-axis",disabled:!k}];s.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),j.select(".nv-controlsWrap").datum(R).attr("transform","translate(0,"+-c.top+")").call(s)}else j.select(".nv-controlsWrap").selectAll("*").remove();G.attr("transform","translate("+c.left+","+c.top+")"),y&&j.select(".nv-y.nv-axis").attr("transform","translate("+z+",0)");var Z=u.filter(function(t){return t.tempDisabled});G.select(".tempDisabled").remove(),Z.length&&G.append("text").attr("class","tempDisabled").attr("x",z/2).attr("y","-.71em").style("text-anchor","end").text(Z.map(function(t){return t.key}).join(", ")+" values cannot be calculated for this time period."),b&&(l.width(z).height(V).margin({left:c.left,top:c.top}).svgContainer(C).xScale(e),G.select(".nv-interactive").call(l)),X.select(".nv-background").append("rect"),j.select(".nv-background rect").attr("width",z).attr("height",V),r.y(function(t){return t.display.y}).width(z).height(V).color(u.map(function(t,e){return t.color||f(t,e)}).filter(function(t,e){return!u[e].disabled&&!u[e].tempDisabled}));var q=j.select(".nv-linesWrap").datum(u.filter(function(t){return!t.disabled&&!t.tempDisabled}));q.call(r),u.forEach(function(t,e){t.seriesIndex=e});var K=u.filter(function(t){return!t.disabled&&!!S(t)}),U=j.select(".nv-avgLinesWrap").selectAll("line").data(K,function(t){return t.key}),Q=function(t){var e=n(S(t));return e<0?0:e>V?V:e};U.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(t,e){return r.color()(t,t.seriesIndex)}).attr("x1",0).attr("x2",z).attr("y1",Q).attr("y2",Q),U.style("stroke-opacity",function(t){var e=n(S(t));return e<0||e>V?0:1}).attr("x1",0).attr("x2",z).attr("y1",Q).attr("y2",Q),U.exit().remove();var J=q.selectAll(".nv-indexLine").data([O]);function $(){J.data([O]);var t=P.duration();P.duration(0),P.update(),P.duration(t)}J.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(H),J.attr("transform",function(t){return"translate("+D(t.i)+",0)"}).attr("height",V),v&&(i.scale(e)._ticks(t.utils.calcTicksX(z/70,u)).tickSize(-V,0),j.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),j.select(".nv-x.nv-axis").call(i)),m&&(o.scale(n)._ticks(t.utils.calcTicksY(V/36,u)).tickSize(-z,0),j.select(".nv-y.nv-axis").call(o)),j.select(".nv-background rect").on("click",function(){O.x=d3.mouse(this)[0],O.i=Math.round(D.invert(O.x)),M.index=O.i,W.stateChange(M),$()}),r.dispatch.on("elementClick",function(t){O.i=t.pointIndex,O.x=D(O.i),M.index=O.i,W.stateChange(M),$()}),s.dispatch.on("legendClick",function(t,e){t.disabled=!t.disabled,k=!t.disabled,M.rescaleY=k,k||(N=I(u)),W.stateChange(M),P.update()}),a.dispatch.on("stateChange",function(t){for(var e in t)M[e]=t[e];W.stateChange(M),P.update()}),l.dispatch.on("elementMousemove",function(e){r.clearHighlights();var n,a,s,c=[];if(u.filter(function(t,e){return t.seriesIndex=e,!(t.disabled||t.tempDisabled)}).forEach(function(i,o){a=t.interactiveBisect(i.values,e.pointXValue,P.x()),r.highlightPoint(o,a,!0);var l=i.values[a];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=P.xScale()(P.x()(l,a))),c.push({key:i.key,value:P.y()(l,a),color:f(i,i.seriesIndex)}))}),c.length>2){var d=P.yScale().invert(e.mouseY),p=.03*Math.abs(P.yScale().domain()[0]-P.yScale().domain()[1]),h=t.nearestValueIndex(c.map(function(t){return t.value}),d,p);null!==h&&(c[h].highlight=!0)}var g=i.tickFormat()(P.x()(n,a),a);l.tooltip.valueFormatter(function(t,e){return o.tickFormat()(t)}).data({value:g,series:c})(),l.renderGuideLine(s)}),l.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),W.on("changeState",function(t){void 0!==t.disabled&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),M.disabled=t.disabled),void 0!==t.index&&(O.i=t.index,O.x=D(O.i),M.index=t.index,J.data([O])),void 0!==t.rescaleY&&(k=t.rescaleY),P.update()})}),_.renderEnd("cumulativeLineChart immediate"),P}r.dispatch.on("elementMouseover.tooltip",function(t){var e={x:P.x()(t.point),y:P.y()(t.point),color:t.point.color};t.point=e,u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)});var T=null;function I(t){var e=t.filter(function(t){return!(t.disabled||t.tempDisabled)}).map(function(t,e){return d3.extent(t.values,function(t){return t.display.y})});return[d3.min(e,function(t){return t[0]}),d3.max(e,function(t){return t[1]})]}return P.dispatch=W,P.lines=r,P.legend=a,P.controls=s,P.xAxis=i,P.yAxis=o,P.interactiveLayer=l,P.state=M,P.tooltip=u,P.options=t.utils.optionsFunc.bind(P),P._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showControls:{get:function(){return x},set:function(t){x=t}},showLegend:{get:function(){return g},set:function(t){g=t}},average:{get:function(){return S},set:function(t){S=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return C},set:function(t){C=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},noErrorCheck:{get:function(){return F},set:function(t){F=t}},rescaleY:{get:function(){return k},set:function(t){k=t,P.state.rescaleY=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e),a.color(f)}},useInteractiveGuideline:{get:function(){return b},set:function(t){b=t,!0===t&&(P.interactive(!1),P.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,o.orient(t?"right":"left")}},duration:{get:function(){return E},set:function(t){E=t,r.duration(E),i.duration(E),o.duration(E),_.reset(E)}}}),t.utils.inheritOptions(P,r),t.utils.initOptions(P),P},t.models.discreteBar=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=d3.scale.ordinal(),p=d3.scale.linear(),h=function(t){return t.x},g=function(t){return t.y},v=[0],m=t.utils.defaultColor(),y=!1,x=d3.format(",.2f"),b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),k="discreteBar",w=250,M=t.utils.renderWatch(b,w);function A(d){return M.reset(),d.each(function(d){var w=u-l.left-l.right,A=c-l.top-l.bottom;e=d3.select(this),t.utils.initSVG(e),d.forEach(function(t,e){t.values.forEach(function(t){t.series=e})});var C=n&&r?[]:d.map(function(t){return t.values.map(function(t,e){return{x:h(t,e),y:g(t,e),y0:t.y0}})});f.domain(n||d3.merge(C).map(function(t){return t.x})).rangeBands(i||[0,w],.1),p.domain(r||d3.extent(d3.merge(C).map(function(t){return t.y}).concat(v))),y?p.range(o||[A-(p.domain()[0]<0?12:0),p.domain()[1]>0?12:0]):p.range(o||[A,0]),a=a||f,s=s||p.copy().range([p(0),p(0)]);var S=e.selectAll("g.nv-wrap.nv-discretebar").data([d]),W=S.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar").append("g");S.select("g");W.append("g").attr("class","nv-groups"),S.attr("transform","translate("+l.left+","+l.top+")");var E=S.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key});E.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),E.exit().watchTransition(M,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),E.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}),E.watchTransition(M,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var F=E.selectAll("g.nv-bar").data(function(t){return t.values});F.exit().remove();var N=F.enter().append("g").attr("transform",function(t,e,n){return"translate("+(f(h(t,e))+.05*f.rangeBand())+", "+p(0)+")"}).on("mouseover",function(t,e){d3.select(this).classed("hover",!0),b.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1),b.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})}).on("mousemove",function(t,e){b.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})}).on("click",function(t,e){b.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()}).on("dblclick",function(t,e){b.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()});N.append("rect").attr("height",0).attr("width",.9*f.rangeBand()/d.length),y?(N.append("text").attr("text-anchor","middle"),F.select("text").text(function(t,e){return x(g(t,e))}).watchTransition(M,"discreteBar: bars text").attr("x",.9*f.rangeBand()/2).attr("y",function(t,e){return g(t,e)<0?p(g(t,e))-p(0)+12:-4})):F.selectAll("text").remove(),F.attr("class",function(t,e){return g(t,e)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(t,e){return t.color||m(t,e)}).style("stroke",function(t,e){return t.color||m(t,e)}).select("rect").attr("class",k).watchTransition(M,"discreteBar: bars rect").attr("width",.9*f.rangeBand()/d.length),F.watchTransition(M,"discreteBar: bars").attr("transform",function(t,e){return"translate("+(f(h(t,e))+.05*f.rangeBand())+", "+(g(t,e)<0?p(0):p(0)-p(g(t,e))<1?p(0)-1:p(g(t,e)))+")"}).select("rect").attr("height",function(t,e){return Math.max(Math.abs(p(g(t,e))-p(0)),1)}),a=f.copy(),s=p.copy()}),M.renderEnd("discreteBar immediate"),A}return A.dispatch=b,A.options=t.utils.optionsFunc.bind(A),A._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},forceY:{get:function(){return v},set:function(t){v=t}},showValues:{get:function(){return y},set:function(t){y=t}},x:{get:function(){return h},set:function(t){h=t}},y:{get:function(){return g},set:function(t){g=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return p},set:function(t){p=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},valueFormat:{get:function(){return x},set:function(t){x=t}},id:{get:function(){return d},set:function(t){d=t}},rectClass:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},color:{get:function(){return m},set:function(e){m=t.utils.getColor(e)}},duration:{get:function(){return w},set:function(t){w=t,M.reset(w)}}}),t.utils.initOptions(A),A},t.models.discreteBarChart=function(){"use strict";var e,n,r=t.models.discreteBar(),i=t.models.axis(),o=t.models.axis(),a=t.models.legend(),s=t.models.tooltip(),l={top:15,right:10,bottom:50,left:60},u=null,c=null,d=null,f=t.utils.getColor(),p=!1,h=!0,g=!0,v=!1,m=!1,y=!1,x=0,b=null,k=d3.dispatch("beforeUpdate","renderEnd"),w=250;i.orient("bottom").showMaxMin(!1).tickFormat(function(t){return t}),o.orient(v?"right":"left").tickFormat(d3.format(",.1f")),s.duration(0).headerEnabled(!1).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).keyFormatter(function(t,e){return i.tickFormat()(t,e)});var M=t.utils.renderWatch(k,w);function A(s){return M.reset(),M.models(r),h&&M.models(i),g&&M.models(o),s.each(function(s){var f=d3.select(this);t.utils.initSVG(f);var b=t.utils.availableWidth(c,f,l),M=t.utils.availableHeight(d,f,l);if(A.update=function(){k.beforeUpdate(),f.transition().duration(w).call(A)},A.container=this,!(s&&s.length&&s.filter(function(t){return t.values.length}).length))return t.utils.noData(A,f),A;f.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale().clamp(!0);var C=f.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([s]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),W=S.append("defs"),E=C.select("g");if(S.append("g").attr("class","nv-x nv-axis"),S.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),S.append("g").attr("class","nv-barsWrap"),S.append("g").attr("class","nv-legendWrap"),E.attr("transform","translate("+l.left+","+l.top+")"),p?(a.width(b),E.select(".nv-legendWrap").datum(s).call(a),u||a.height()===l.top||(l.top=a.height(),M=t.utils.availableHeight(d,f,l)),C.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")):E.select(".nv-legendWrap").selectAll("*").remove(),v&&E.select(".nv-y.nv-axis").attr("transform","translate("+b+",0)"),r.width(b).height(M),E.select(".nv-barsWrap").datum(s.filter(function(t){return!t.disabled})).transition().call(r),W.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect"),E.select("#nv-x-label-clip-"+r.id()+" rect").attr("width",e.rangeBand()*(m?2:1)).attr("height",16).attr("x",-e.rangeBand()/(m?1:2)),h){i.scale(e)._ticks(t.utils.calcTicksX(b/100,s)).tickSize(-M,0),E.select(".nv-x.nv-axis").attr("transform","translate(0,"+(n.range()[0]+(r.showValues()&&n.domain()[0]<0?16:0))+")"),E.select(".nv-x.nv-axis").call(i);var F=E.select(".nv-x.nv-axis").selectAll("g");m&&F.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"}),x&&F.selectAll(".tick text").attr("transform","rotate("+x+" 0,0)").style("text-anchor",x>0?"start":"end"),y&&E.selectAll(".tick text").call(t.utils.wrapTicks,A.xAxis.rangeBand())}g&&(o.scale(n)._ticks(t.utils.calcTicksY(M/36,s)).tickSize(-b,0),E.select(".nv-y.nv-axis").call(o)),E.select(".nv-zeroLine line").attr("x1",0).attr("x2",v?-b:b).attr("y1",n(0)).attr("y2",n(0))}),M.renderEnd("discreteBar chart immediate"),A}return r.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:A.x()(t.data),value:A.y()(t.data),color:t.color},s.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){s.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){s()}),A.dispatch=k,A.discretebar=r,A.legend=a,A.xAxis=i,A.yAxis=o,A.tooltip=s,A.options=t.utils.optionsFunc.bind(A),A._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},showLegend:{get:function(){return p},set:function(t){p=t}},staggerLabels:{get:function(){return m},set:function(t){m=t}},rotateLabels:{get:function(){return x},set:function(t){x=t}},wrapLabels:{get:function(){return y},set:function(t){y=!!t}},showXAxis:{get:function(){return h},set:function(t){h=t}},showYAxis:{get:function(){return g},set:function(t){g=t}},noData:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return w},set:function(t){w=t,M.reset(w),r.duration(w),i.duration(w),o.duration(w)}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e),r.color(f),a.color(f)}},rightAlignYAxis:{get:function(){return v},set:function(t){v=t,o.orient(t?"right":"left")}}}),t.utils.inheritOptions(A,r),t.utils.initOptions(A),A},t.models.distribution=function(){"use strict";var e,n={top:0,right:0,bottom:0,left:0},r=400,i=8,o="x",a=function(t){return t[o]},s=t.utils.defaultColor(),l=d3.scale.linear(),u=250,c=d3.dispatch("renderEnd"),d=t.utils.renderWatch(c,u);function f(r){return d.reset(),r.each(function(r){"x"===o?(n.left,n.right):(n.top,n.bottom);var u="x"==o?"y":"x",c=d3.select(this);t.utils.initSVG(c),e=e||l;var f=c.selectAll("g.nv-distribution").data([r]),p=(f.enter().append("g").attr("class","nvd3 nv-distribution").append("g"),f.select("g"));f.attr("transform","translate("+n.left+","+n.top+")");var h=p.selectAll("g.nv-dist").data(function(t){return t},function(t){return t.key});h.enter().append("g"),h.attr("class",function(t,e){return"nv-dist nv-series-"+e}).style("stroke",function(t,e){return s(t,e)});var g=h.selectAll("line.nv-dist"+o).data(function(t){return t.values});g.enter().append("line").attr(o+"1",function(t,n){return e(a(t,n))}).attr(o+"2",function(t,n){return e(a(t,n))}),d.transition(h.exit().selectAll("line.nv-dist"+o),"dist exit").attr(o+"1",function(t,e){return l(a(t,e))}).attr(o+"2",function(t,e){return l(a(t,e))}).style("stroke-opacity",0).remove(),g.attr("class",function(t,e){return"nv-dist"+o+" nv-dist"+o+"-"+e}).attr(u+"1",0).attr(u+"2",i),d.transition(g,"dist").attr(o+"1",function(t,e){return l(a(t,e))}).attr(o+"2",function(t,e){return l(a(t,e))}),e=l.copy()}),d.renderEnd("distribution immediate"),f}return f.options=t.utils.optionsFunc.bind(f),f.dispatch=c,f.margin=function(t){return arguments.length?(n.top=void 0!==t.top?t.top:n.top,n.right=void 0!==t.right?t.right:n.right,n.bottom=void 0!==t.bottom?t.bottom:n.bottom,n.left=void 0!==t.left?t.left:n.left,f):n},f.width=function(t){return arguments.length?(r=t,f):r},f.axis=function(t){return arguments.length?(o=t,f):o},f.size=function(t){return arguments.length?(i=t,f):i},f.getData=function(t){return arguments.length?(a=d3.functor(t),f):a},f.scale=function(t){return arguments.length?(l=t,f):l},f.color=function(e){return arguments.length?(s=t.utils.getColor(e),f):s},f.duration=function(t){return arguments.length?(u=t,d.reset(u),f):u},f},t.models.focus=function(e){"use strict";e=e||t.models.line();var n,r,i=t.models.axis(),o=t.models.axis(),a=d3.svg.brush(),s={top:10,right:0,bottom:30,left:0},l=t.utils.defaultColor(),u=null,c=70,d=!0,f=!1,p=!1,h=null,g=250,v=d3.dispatch("brush","onBrush","renderEnd"),m=!0;e.interactive(!1),e.pointActive(function(t){return!1});var y=t.utils.renderWatch(v,g);function x(b){return y.reset(),y.models(e),d&&y.models(i),f&&y.models(o),b.each(function(y){var b=d3.select(this);t.utils.initSVG(b);var k=t.utils.availableWidth(u,b,s),w=c-s.top-s.bottom;x.update=function(){0===g?b.call(x):b.transition().duration(g).call(x)},x.container=this,n=e.xScale(),r=e.yScale();var M=b.selectAll("g.nv-focus").data([y]),A=M.enter().append("g").attr("class","nvd3 nv-focus").append("g"),C=M.select("g");M.attr("transform","translate("+s.left+","+s.top+")"),A.append("g").attr("class","nv-background").append("rect"),A.append("g").attr("class","nv-x nv-axis"),A.append("g").attr("class","nv-y nv-axis"),A.append("g").attr("class","nv-contentWrap"),A.append("g").attr("class","nv-brushBackground"),A.append("g").attr("class","nv-x nv-brush"),p&&C.select(".nv-y.nv-axis").attr("transform","translate("+k+",0)"),C.select(".nv-background rect").attr("width",k).attr("height",w),e.width(k).height(w).color(y.map(function(t,e){return t.color||l(t,e)}).filter(function(t,e){return!y[e].disabled}));var S=C.select(".nv-contentWrap").datum(y.filter(function(t){return!t.disabled}));d3.transition(S).call(e),a.x(n).on("brush",function(){N(m)}),a.on("brushend",function(){m||v.onBrush(a.empty()?n.domain():a.extent())}),h&&a.extent(h);var W=C.select(".nv-brushBackground").selectAll("g").data([h||a.extent()]),E=W.enter().append("g");E.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",w),E.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",w);var F=C.select(".nv-x.nv-brush").call(a);function N(t){h=a.empty()?null:a.extent();var e=a.empty()?n.domain():a.extent();v.brush({extent:e,brush:a}),a.empty()||a.extent(h),W.data([a.empty()?n.domain():h]).each(function(t,e){var r=n(t[0])-n.range()[0],i=k-n(t[1]);d3.select(this).select(".left").attr("width",r<0?0:r),d3.select(this).select(".right").attr("x",n(t[1])).attr("width",i<0?0:i)}),t&&v.onBrush(e)}F.selectAll("rect").attr("height",w),F.selectAll(".resize").append("path").attr("d",function(t){var e=+("e"==t),n=e?1:-1,r=w/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)}),N(!0),C.select(".nv-background rect").attr("width",k).attr("height",w),d&&(i.scale(n)._ticks(t.utils.calcTicksX(k/100,y)).tickSize(-w,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),d3.transition(C.select(".nv-x.nv-axis")).call(i)),f&&(o.scale(r)._ticks(t.utils.calcTicksY(w/36,y)).tickSize(-k,0),d3.transition(C.select(".nv-y.nv-axis")).call(o)),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")")}),y.renderEnd("focus immediate"),x}return x.dispatch=v,x.content=e,x.brush=a,x.xAxis=i,x.yAxis=o,x.options=t.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},showXAxis:{get:function(){return d},set:function(t){d=t}},showYAxis:{get:function(){return f},set:function(t){f=t}},brushExtent:{get:function(){return h},set:function(t){h=t}},syncBrushing:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return s},set:function(t){s.top=void 0!==t.top?t.top:s.top,s.right=void 0!==t.right?t.right:s.right,s.bottom=void 0!==t.bottom?t.bottom:s.bottom,s.left=void 0!==t.left?t.left:s.left}},duration:{get:function(){return g},set:function(t){g=t,y.reset(g),e.duration(g),i.duration(g),o.duration(g)}},color:{get:function(){return l},set:function(n){l=t.utils.getColor(n),e.color(l)}},interpolate:{get:function(){return e.interpolate()},set:function(t){e.interpolate(t)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t)}},x:{get:function(){return e.x()},set:function(t){e.x(t)}},y:{get:function(){return e.y()},set:function(t){e.y(t)}},rightAlignYAxis:{get:function(){return p},set:function(t){p=t,o.orient(p?"right":"left")}}}),t.utils.inheritOptions(x,e),t.utils.initOptions(x),x},t.models.forceDirectedGraph=function(){"use strict";var e={top:2,right:0,bottom:2,left:0},n=400,r=32,i=null,o=d3.dispatch("renderEnd"),a=t.utils.getColor(["#000"]),s=t.models.tooltip(),l=null,u=.1,c=.9,d=30,f=-120,p=.1,h=.8,g=.1,v=5,m=function(t){},y=function(t){},x=d3.functor(0),b=d3.functor(0),k=t.utils.renderWatch(o);function w(o){return k.reset(),o.each(function(o){i=d3.select(this),t.utils.initSVG(i);var l=t.utils.availableWidth(n,i,e),x=t.utils.availableHeight(r,i,e);if(i.attr("width",l).attr("height",x),!(o&&o.links&&o.nodes))return t.utils.noData(w,i),w;i.selectAll(".nv-noData").remove(),i.selectAll("*").remove();var b=new Set;o.nodes.forEach(function(t){Object.keys(t).forEach(function(t){b.add(t)})});var k=d3.layout.force().nodes(o.nodes).links(o.links).size([l,x]).linkStrength(u).friction(c).linkDistance(d).charge(f).gravity(p).theta(h).alpha(g).start(),M=i.selectAll(".link").data(o.links).enter().append("line").attr("class","nv-force-link").style("stroke-width",function(t){return Math.sqrt(t.value)}),A=i.selectAll(".node").data(o.nodes).enter().append("g").attr("class","nv-force-node").call(k.drag);A.append("circle").attr("r",v).style("fill",function(t){return a(t)}).on("mouseover",function(t){i.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.py),i.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.px);var e=a(t);t.series=[],b.forEach(function(n){t.series.push({color:e,key:n,value:t[n]})}),s.data(t).hidden(!1)}).on("mouseout",function(t){s.hidden(!0)}),s.headerFormatter(function(t){return"Node"}),y(M),m(A),k.on("tick",function(){M.attr("x1",function(t){return t.source.x}).attr("y1",function(t){return t.source.y}).attr("x2",function(t){return t.target.x}).attr("y2",function(t){return t.target.y}),A.attr("transform",function(t){return"translate("+t.x+", "+t.y+")"})})}),w}return w.options=t.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return r},set:function(t){r=t}},linkStrength:{get:function(){return u},set:function(t){u=t}},friction:{get:function(){return c},set:function(t){c=t}},linkDist:{get:function(){return d},set:function(t){d=t}},charge:{get:function(){return f},set:function(t){f=t}},gravity:{get:function(){return p},set:function(t){p=t}},theta:{get:function(){return h},set:function(t){h=t}},alpha:{get:function(){return g},set:function(t){g=t}},radius:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},margin:{get:function(){return e},set:function(t){e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left}},color:{get:function(){return a},set:function(e){a=t.utils.getColor(e)}},noData:{get:function(){return l},set:function(t){l=t}},nodeExtras:{get:function(){return m},set:function(t){m=t}},linkExtras:{get:function(){return y},set:function(t){y=t}}}),w.dispatch=o,w.tooltip=s,t.utils.initOptions(w),w},t.models.furiousLegend=function(){"use strict";var e={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(t){return t.key},o=function(t){return t},a=t.utils.getColor(),s=20,l=!0,u=28,c=!0,d=!0,f=!1,p=!1,h=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),g="classic";function v(m){function y(t,e){return"furious"!=g?"#000":p?t.disengaged?a(t,e):"#fff":p?void 0:t.disabled?a(t,e):"#fff"}function x(t,e){return p&&"furious"==g?t.disengaged?"#fff":a(t,e):t.disabled?"#fff":a(t,e)}return m.each(function(v){var m=n-e.left-e.right,b=d3.select(this);t.utils.initSVG(b);var k=b.selectAll("g.nv-legend").data([v]),w=(k.enter().append("g").attr("class","nvd3 nv-legend").append("g"),k.select("g"));k.attr("transform","translate("+e.left+","+e.top+")");var M,A=w.selectAll(".nv-series").data(function(t){return"furious"!=g?t:t.filter(function(t){return!!p||!t.disengaged})}),C=A.enter().append("g").attr("class","nv-series");if("classic"==g)C.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),M=A.select("circle");else if("furious"==g){C.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),M=A.select("rect"),C.append("g").attr("class","nv-check-box").property("innerHTML",'').attr("transform","translate(-10,-8)scale(0.5)"),A.select(".nv-check-box").each(function(t,e){d3.select(this).selectAll("path").attr("stroke",y(t,e))})}C.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var S,W=A.select("text.nv-legend-text");switch(A.on("mouseover",function(t,e){h.legendMouseover(t,e)}).on("mouseout",function(t,e){h.legendMouseout(t,e)}).on("click",function(t,e){h.legendClick(t,e);var n=A.data();if(d){if("classic"==g)f?(n.forEach(function(t){t.disabled=!0}),t.disabled=!1):(t.disabled=!t.disabled,n.every(function(t){return t.disabled})&&n.forEach(function(t){t.disabled=!1}));else if("furious"==g)if(p)t.disengaged=!t.disengaged,t.userDisabled=null==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled;else if(!p){t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter(function(t){return!t.disengaged}).every(function(t){return t.userDisabled})&&n.forEach(function(t){t.disabled=t.userDisabled=!1})}h.stateChange({disabled:n.map(function(t){return!!t.disabled}),disengaged:n.map(function(t){return!!t.disengaged})})}}).on("dblclick",function(t,e){if(("furious"!=g||!p)&&(h.legendDblclick(t,e),d)){var n=A.data();n.forEach(function(t){t.disabled=!0,"furious"==g&&(t.userDisabled=t.disabled)}),t.disabled=!1,"furious"==g&&(t.userDisabled=t.disabled),h.stateChange({disabled:n.map(function(t){return!!t.disabled})})}}),A.classed("nv-disabled",function(t){return t.userDisabled}),A.exit().remove(),W.attr("fill",y).text(function(t){return o(i(t))}),g){case"furious":S=23;break;case"classic":S=20}if(l){var E=[];A.each(function(e,n){var r,a;if(o(i(e))&&o(i(e)).length>s){var l=o(i(e)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(e)))}else r=d3.select(this).select("text");try{if((a=r.node().getComputedTextLength())<=0)throw Error()}catch(e){a=t.utils.calcApproxTextWidth(r)}E.push(a+u)});for(var F=0,N=0,D=[];Nm&&F>1;){D=[],F--;for(var O=0;O(D[O%F]||0)&&(D[O%F]=E[O]);N=D.reduce(function(t,e,n,r){return t+e})}for(var _=[],L=0,B=0;Lz&&(z=I),"translate("+P+","+T+")"}),w.attr("transform","translate("+(n-e.right-z)+","+e.top+")"),r=e.top+e.bottom+T+15}"furious"==g&&M.attr("width",function(t,e){return W[0][e].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),M.style("fill",x).style("stroke",function(t,e){return t.color||a(t,e)})}),v}return v.dispatch=h,v.options=t.utils.optionsFunc.bind(v),v._options=Object.create({},{width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return r},set:function(t){r=t}},key:{get:function(){return i},set:function(t){i=t}},keyFormatter:{get:function(){return o},set:function(t){o=t}},align:{get:function(){return l},set:function(t){l=t}},rightAlign:{get:function(){return c},set:function(t){c=t}},maxKeyLength:{get:function(){return s},set:function(t){s=t}},padding:{get:function(){return u},set:function(t){u=t}},updateState:{get:function(){return d},set:function(t){d=t}},radioButtonMode:{get:function(){return f},set:function(t){f=t}},expanded:{get:function(){return p},set:function(t){p=t}},vers:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return e},set:function(t){e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left}},color:{get:function(){return a},set:function(e){a=t.utils.getColor(e)}}}),t.utils.initOptions(v),v},t.models.historicalBar=function(){"use strict";var e,n,r,i,o={top:0,right:0,bottom:0,left:0},a=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=[],g=[0],v=!1,m=!0,y=t.utils.defaultColor(),x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),b=!0,k=t.utils.renderWatch(x,0);function w(M){return M.each(function(w){k.reset(),u=d3.select(this);var M=t.utils.availableWidth(a,u,o),A=t.utils.availableHeight(s,u,o);t.utils.initSVG(u),c.domain(e||d3.extent(w[0].values.map(f).concat(h))),v?c.range(r||[.5*M/w[0].values.length,M*(w[0].values.length-.5)/w[0].values.length]):c.range(r||[0,M]),d.domain(n||d3.extent(w[0].values.map(p).concat(g))).range(i||[A,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var C=u.selectAll("g.nv-wrap.nv-historicalBar-"+l).data([w[0].values]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+l),W=S.append("defs"),E=S.append("g"),F=C.select("g");E.append("g").attr("class","nv-bars"),C.attr("transform","translate("+o.left+","+o.top+")"),u.on("click",function(t,e){x.chartClick({data:t,index:e,pos:d3.event,id:l})}),W.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),C.select("#nv-chart-clip-path-"+l+" rect").attr("width",M).attr("height",A),F.attr("clip-path",m?"url(#nv-chart-clip-path-"+l+")":"");var N=C.select(".nv-bars").selectAll(".nv-bar").data(function(t){return t},function(t,e){return f(t,e)});N.exit().remove(),N.enter().append("rect").attr("x",0).attr("y",function(e,n){return t.utils.NaNtoZero(d(Math.max(0,p(e,n))))}).attr("height",function(e,n){return t.utils.NaNtoZero(Math.abs(d(p(e,n))-d(0)))}).attr("transform",function(t,e){return"translate("+(c(f(t,e))-M/w[0].values.length*.45)+",0)"}).on("mouseover",function(t,e){b&&(d3.select(this).classed("hover",!0),x.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")}))}).on("mouseout",function(t,e){b&&(d3.select(this).classed("hover",!1),x.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")}))}).on("mousemove",function(t,e){b&&x.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})}).on("click",function(t,e){if(b){x.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()}}).on("dblclick",function(t,e){b&&(x.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation())}),N.attr("fill",function(t,e){return y(t,e)}).attr("class",function(t,e,n){return(p(t,e)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+n+"-"+e}).watchTransition(k,"bars").attr("transform",function(t,e){return"translate("+(c(f(t,e))-M/w[0].values.length*.45)+",0)"}).attr("width",M/w[0].values.length*.9),N.watchTransition(k,"bars").attr("y",function(e,n){var r=p(e,n)<0?d(0):d(0)-d(p(e,n))<1?d(0)-1:d(p(e,n));return t.utils.NaNtoZero(r)}).attr("height",function(e,n){return t.utils.NaNtoZero(Math.max(Math.abs(d(p(e,n))-d(0)),1))})}),k.renderEnd("historicalBar immediate"),w}return w.highlightPoint=function(t,e){u.select(".nv-bars .nv-bar-0-"+t).classed("hover",e)},w.clearHighlights=function(){u.select(".nv-bars .nv-bar.hover").classed("hover",!1)},w.dispatch=x,w.options=t.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return h},set:function(t){h=t}},forceY:{get:function(){return g},set:function(t){g=t}},padData:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},clipEdge:{get:function(){return m},set:function(t){m=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return y},set:function(e){y=t.utils.getColor(e)}}}),t.utils.initOptions(w),w},t.models.historicalBarChart=function(e){"use strict";var n,r,i=e||t.models.historicalBar(),o=t.models.axis(),a=t.models.axis(),s=t.models.legend(),l=t.interactiveGuideline(),u=t.models.tooltip(),c={top:30,right:90,bottom:50,left:90},d=null,f=t.utils.defaultColor(),p=null,h=null,g=!1,v=!0,m=!0,y=!1,x=!1,b={},k=null,w=null,M=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),A=250;o.orient("bottom").tickPadding(7),a.orient(y?"right":"left"),u.duration(0).headerEnabled(!1).valueFormatter(function(t,e){return a.tickFormat()(t,e)}).headerFormatter(function(t,e){return o.tickFormat()(t,e)});var C=t.utils.renderWatch(M,0);function S(e){return e.each(function(u){C.reset(),C.models(i),v&&C.models(o),m&&C.models(a);var w=d3.select(this);t.utils.initSVG(w);var W,E=t.utils.availableWidth(p,w,c),F=t.utils.availableHeight(h,w,c);if(S.update=function(){w.transition().duration(A).call(S)},S.container=this,b.disabled=u.map(function(t){return!!t.disabled}),!k)for(W in k={},b)b[W]instanceof Array?k[W]=b[W].slice(0):k[W]=b[W];if(!(u&&u.length&&u.filter(function(t){return t.values.length}).length))return t.utils.noData(S,w),S;w.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale();var N=w.selectAll("g.nv-wrap.nv-historicalBarChart").data([u]),D=N.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),O=N.select("g");D.append("g").attr("class","nv-x nv-axis"),D.append("g").attr("class","nv-y nv-axis"),D.append("g").attr("class","nv-barsWrap"),D.append("g").attr("class","nv-legendWrap"),D.append("g").attr("class","nv-interactive"),g?(s.width(E),O.select(".nv-legendWrap").datum(u).call(s),d||s.height()===c.top||(c.top=s.height(),F=t.utils.availableHeight(h,w,c)),N.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):O.select(".nv-legendWrap").selectAll("*").remove(),N.attr("transform","translate("+c.left+","+c.top+")"),y&&O.select(".nv-y.nv-axis").attr("transform","translate("+E+",0)"),x&&(l.width(E).height(F).margin({left:c.left,top:c.top}).svgContainer(w).xScale(n),N.select(".nv-interactive").call(l)),i.width(E).height(F).color(u.map(function(t,e){return t.color||f(t,e)}).filter(function(t,e){return!u[e].disabled})),O.select(".nv-barsWrap").datum(u.filter(function(t){return!t.disabled})).transition().call(i),v&&(o.scale(n)._ticks(t.utils.calcTicksX(E/100,u)).tickSize(-F,0),O.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),O.select(".nv-x.nv-axis").transition().call(o)),m&&(a.scale(r)._ticks(t.utils.calcTicksY(F/36,u)).tickSize(-E,0),O.select(".nv-y.nv-axis").transition().call(a)),l.dispatch.on("elementMousemove",function(e){i.clearHighlights();var n,r,s,c=[];u.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(o,a){r=t.interactiveBisect(o.values,e.pointXValue,S.x()),i.highlightPoint(r,!0);var l=o.values[r];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=S.xScale()(S.x()(l,r))),c.push({key:o.key,value:S.y()(l,r),color:f(o,o.seriesIndex),data:o.values[r]}))});var d=o.tickFormat()(S.x()(n,r));l.tooltip.valueFormatter(function(t,e){return a.tickFormat()(t)}).data({value:d,index:r,series:c})(),l.renderGuideLine(s)}),l.dispatch.on("elementMouseout",function(t){M.tooltipHide(),i.clearHighlights()}),s.dispatch.on("legendClick",function(t,n){t.disabled=!t.disabled,u.filter(function(t){return!t.disabled}).length||u.map(function(t){return t.disabled=!1,N.selectAll(".nv-series").classed("disabled",!1),t}),b.disabled=u.map(function(t){return!!t.disabled}),M.stateChange(b),e.transition().call(S)}),s.dispatch.on("legendDblclick",function(t){u.forEach(function(t){t.disabled=!0}),t.disabled=!1,b.disabled=u.map(function(t){return!!t.disabled}),M.stateChange(b),S.update()}),M.on("changeState",function(t){void 0!==t.disabled&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),b.disabled=t.disabled),S.update()})}),C.renderEnd("historicalBarChart immediate"),S}return i.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:S.x()(t.data),value:S.y()(t.data),color:t.color},u.data(t).hidden(!1)}),i.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),i.dispatch.on("elementMousemove.tooltip",function(t){u()}),S.dispatch=M,S.bars=i,S.legend=s,S.xAxis=o,S.yAxis=a,S.interactiveLayer=l,S.tooltip=u,S.options=t.utils.optionsFunc.bind(S),S._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return g},set:function(t){g=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},defaultState:{get:function(){return k},set:function(t){k=t}},noData:{get:function(){return w},set:function(t){w=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e),s.color(f),i.color(f)}},duration:{get:function(){return A},set:function(t){A=t,C.reset(A),a.duration(A),o.duration(A)}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,a.orient(t?"right":"left")}},useInteractiveGuideline:{get:function(){return x},set:function(t){x=t,!0===t&&S.interactive(!1)}}}),t.utils.inheritOptions(S,i),t.utils.initOptions(S),S},t.models.ohlcBarChart=function(){var e=t.models.historicalBarChart(t.models.ohlcBar());return e.useInteractiveGuideline(!0),e.interactiveLayer.tooltip.contentGenerator(function(t){var n=t.series[0].data;return'

'+t.value+"

open:"+e.yAxis.tickFormat()(n.open)+"
close:"+e.yAxis.tickFormat()(n.close)+"
high"+e.yAxis.tickFormat()(n.high)+"
low:"+e.yAxis.tickFormat()(n.low)+"
"}),e},t.models.candlestickBarChart=function(){var e=t.models.historicalBarChart(t.models.candlestickBar());return e.useInteractiveGuideline(!0),e.interactiveLayer.tooltip.contentGenerator(function(t){var n=t.series[0].data;return'

'+t.value+"

open:"+e.yAxis.tickFormat()(n.open)+"
close:"+e.yAxis.tickFormat()(n.close)+"
high"+e.yAxis.tickFormat()(n.high)+"
low:"+e.yAxis.tickFormat()(n.low)+"
"}),e},t.models.legend=function(){"use strict";var e={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(t){return t.key},o=function(t){return t},a=t.utils.getColor(),s=20,l=!0,u=32,c=!0,d=!0,f=!0,p=!1,h=!1,g=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),v="classic";function m(y){function x(t,e){return"furious"!=v?"#000":h?t.disengaged?"#000":"#fff":h?void 0:(t.color||(t.color=a(t,e)),t.disabled?t.color:"#fff")}function b(t,e){return h&&"furious"==v&&t.disengaged?"#eee":t.color||a(t,e)}function k(t,e){return h&&"furious"==v?1:t.disabled?0:1}return y.each(function(a){var m=n-e.left-e.right,y=d3.select(this);t.utils.initSVG(y);var w=y.selectAll("g.nv-legend").data([a]),M=w.enter().append("g").attr("class","nvd3 nv-legend").append("g"),A=w.select("g");c?w.attr("transform","translate("+-e.right+","+e.top+")"):w.attr("transform","translate("+e.left+","+e.top+")");var C,S,W=A.selectAll(".nv-series").data(function(t){return"furious"!=v?t:t.filter(function(t){return!!h||!t.disengaged})}),E=W.enter().append("g").attr("class","nv-series");switch(v){case"furious":S=23;break;case"classic":S=20}if("classic"==v)E.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),C=W.select(".nv-legend-symbol");else if("furious"==v){E.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),C=W.select(".nv-legend-symbol"),E.append("g").attr("class","nv-check-box").property("innerHTML",'').attr("transform","translate(-10,-8)scale(0.5)"),W.select(".nv-check-box").each(function(t,e){d3.select(this).selectAll("path").attr("stroke",x(t,e))})}E.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var F=W.select("text.nv-legend-text");W.on("mouseover",function(t,e){g.legendMouseover(t,e)}).on("mouseout",function(t,e){g.legendMouseout(t,e)}).on("click",function(t,e){g.legendClick(t,e);var n=W.data();if(d){if("classic"==v)p?(n.forEach(function(t){t.disabled=!0}),t.disabled=!1):(t.disabled=!t.disabled,n.every(function(t){return t.disabled})&&n.forEach(function(t){t.disabled=!1}));else if("furious"==v)if(h)t.disengaged=!t.disengaged,t.userDisabled=null==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled;else if(!h){t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter(function(t){return!t.disengaged}).every(function(t){return t.userDisabled})&&n.forEach(function(t){t.disabled=t.userDisabled=!1})}g.stateChange({disabled:n.map(function(t){return!!t.disabled}),disengaged:n.map(function(t){return!!t.disengaged})})}}).on("dblclick",function(t,e){if(f){if("furious"==v&&h)return;if(g.legendDblclick(t,e),d){var n=W.data();n.forEach(function(t){t.disabled=!0,"furious"==v&&(t.userDisabled=t.disabled)}),t.disabled=!1,"furious"==v&&(t.userDisabled=t.disabled),g.stateChange({disabled:n.map(function(t){return!!t.disabled})})}}}),W.classed("nv-disabled",function(t){return t.userDisabled}),W.exit().remove(),F.attr("fill",x).text(function(t){return o(i(t))});var N=0;if(l){var D=[];W.each(function(e,n){var r,a;if(o(i(e))&&o(i(e)).length>s){var l=o(i(e)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(e)))}else r=d3.select(this).select("text");try{if((a=r.node().getComputedTextLength())<=0)throw Error()}catch(e){a=t.utils.calcApproxTextWidth(r)}D.push(a+u)});var O=0,_=[];for(N=0;Nm&&O>1;){_=[],O--;for(var L=0;L(_[L%O]||0)&&(_[L%O]=D[L]);N=_.reduce(function(t,e,n,r){return t+e})}for(var B=[],P=0,T=0;PH&&(H=V),N0?k:0),S.attr("clip-path",h?"url(#nv-edge-clip-"+r.id()+")":""),W.attr("clip-path",h?"url(#nv-edge-clip-"+r.id()+")":"");var E=w.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key});E.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",function(t){return t.strokeWidth||l}).style("fill-opacity",1e-6),E.exit().remove(),E.attr("class",function(t,e){return(t.classed||"")+" nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return u(t,e)}).style("stroke",function(t,e){return u(t,e)}),E.watchTransition(b,"line: groups").style("stroke-opacity",1).style("fill-opacity",function(t){return t.fillOpacity||.5});var F=E.selectAll("path.nv-area").data(function(t){return p(t)?[t]:[]});F.enter().append("path").attr("class","nv-area").attr("d",function(e){return d3.svg.area().interpolate(g).defined(f).x(function(e,n){return t.utils.NaNtoZero(y(c(e,n)))}).y0(function(e,n){return t.utils.NaNtoZero(x(d(e,n)))}).y1(function(t,e){return x(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])}).apply(this,[e.values])}),E.exit().selectAll("path.nv-area").remove(),F.watchTransition(b,"line: areaPaths").attr("d",function(r){return d3.svg.area().interpolate(g).defined(f).x(function(n,r){return t.utils.NaNtoZero(e(c(n,r)))}).y0(function(e,r){return t.utils.NaNtoZero(n(d(e,r)))}).y1(function(t,e){return n(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])}).apply(this,[r.values])});var N=E.selectAll("path.nv-line").data(function(t){return[t.values]});N.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(g).defined(f).x(function(e,n){return t.utils.NaNtoZero(y(c(e,n)))}).y(function(e,n){return t.utils.NaNtoZero(x(d(e,n)))})),N.watchTransition(b,"line: linePaths").attr("d",d3.svg.line().interpolate(g).defined(f).x(function(n,r){return t.utils.NaNtoZero(e(c(n,r)))}).y(function(e,r){return t.utils.NaNtoZero(n(d(e,r)))})),y=e.copy(),x=n.copy()}),b.renderEnd("line immediate"),k}return k.dispatch=m,k.scatter=r,r.dispatch.on("elementClick",function(){m.elementClick.apply(this,arguments)}),r.dispatch.on("elementMouseover",function(){m.elementMouseover.apply(this,arguments)}),r.dispatch.on("elementMouseout",function(){m.elementMouseout.apply(this,arguments)}),k.options=t.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},defined:{get:function(){return f},set:function(t){f=t}},interpolate:{get:function(){return g},set:function(t){g=t}},clipEdge:{get:function(){return h},set:function(t){h=t}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},duration:{get:function(){return v},set:function(t){v=t,b.reset(v),r.duration(v)}},isArea:{get:function(){return p},set:function(t){p=d3.functor(t)}},x:{get:function(){return c},set:function(t){c=t,r.x(t)}},y:{get:function(){return d},set:function(t){d=t,r.y(t)}},color:{get:function(){return u},set:function(e){u=t.utils.getColor(e),r.color(u)}}}),t.utils.inheritOptions(k,r),t.utils.initOptions(k),k},t.models.lineChart=function(){"use strict";var e,n,r=t.models.line(),i=t.models.axis(),o=t.models.axis(),a=t.models.legend(),s=t.interactiveGuideline(),l=t.models.tooltip(),u=t.models.focus(t.models.line()),c={top:30,right:20,bottom:50,left:60},d=null,f=t.utils.defaultColor(),p=null,h=null,g=!0,v="top",m=!0,y=!0,x=!1,b=!1,k=!1,w=t.utils.state(),M=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=250;i.orient("bottom").tickPadding(7),o.orient(x?"right":"left"),r.clipEdge(!0).duration(0),l.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.tooltip.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)});var W=t.utils.renderWatch(C,S),E=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},F=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};function N(l){return W.reset(),W.models(r),m&&W.models(i),y&&W.models(o),l.each(function(l){var A=d3.select(this);t.utils.initSVG(A);var W,D=t.utils.availableWidth(p,A,c),O=t.utils.availableHeight(h,A,c)-(k?u.height():0);if(N.update=function(){0===S?A.call(N):A.transition().duration(S).call(N)},N.container=this,w.setter(F(l),N.update).getter(E(l)).update(),w.disabled=l.map(function(t){return!!t.disabled}),!M)for(W in M={},w)w[W]instanceof Array?M[W]=w[W].slice(0):M[W]=w[W];if(!(l&&l.length&&l.filter(function(t){return t.values.length}).length))return t.utils.noData(N,A),N;A.selectAll(".nv-noData").remove(),u.dispatch.on("onBrush",function(t){H(t)}),e=r.xScale(),n=r.yScale();var _=A.selectAll("g.nv-wrap.nv-lineChart").data([l]),L=_.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),B=_.select("g");L.append("g").attr("class","nv-legendWrap");var P=L.append("g").attr("class","nv-focus");P.append("g").attr("class","nv-background").append("rect"),P.append("g").attr("class","nv-x nv-axis"),P.append("g").attr("class","nv-y nv-axis"),P.append("g").attr("class","nv-linesWrap"),P.append("g").attr("class","nv-interactive");L.append("g").attr("class","nv-focusWrap");g?(a.width(D),B.select(".nv-legendWrap").datum(l).call(a),"bottom"===v?(c.bottom=i.height()+a.height(),O=t.utils.availableHeight(h,A,c),B.select(".nv-legendWrap").attr("transform","translate(0,"+(O+i.height())+")")):"top"===v&&(d||a.height()===c.top||(c.top=a.height(),O=t.utils.availableHeight(h,A,c)-(k?u.height():0)),_.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")"))):B.select(".nv-legendWrap").selectAll("*").remove(),_.attr("transform","translate("+c.left+","+c.top+")"),x&&B.select(".nv-y.nv-axis").attr("transform","translate("+D+",0)"),b&&(s.width(D).height(O).margin({left:c.left,top:c.top}).svgContainer(A).xScale(e),_.select(".nv-interactive").call(s)),B.select(".nv-focus .nv-background rect").attr("width",D).attr("height",O),r.width(D).height(O).color(l.map(function(t,e){return t.color||f(t,e)}).filter(function(t,e){return!l[e].disabled}));var T=B.select(".nv-linesWrap").datum(l.filter(function(t){return!t.disabled}));function I(){m&&B.select(".nv-focus .nv-x.nv-axis").transition().duration(S).call(i)}function z(){y&&B.select(".nv-focus .nv-y.nv-axis").transition().duration(S).call(o)}if(m&&i.scale(e)._ticks(t.utils.calcTicksX(D/100,l)).tickSize(-O,0),y&&o.scale(n)._ticks(t.utils.calcTicksY(O/36,l)).tickSize(-D,0),B.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+O+")"),k||null!==u.brush.extent()){u.width(D),B.select(".nv-focusWrap").style("display",k?"initial":"none").attr("transform","translate(0,"+(O+c.bottom+u.margin().top)+")").call(u);var V=u.brush.empty()?u.xDomain():u.brush.extent();null!==V&&H(V)}else T.call(r),I(),z();function H(t){B.select(".nv-focus .nv-linesWrap").datum(l.filter(function(t){return!t.disabled}).map(function(e,n){return{key:e.key,area:e.area,classed:e.classed,values:e.values.filter(function(e,n){return r.x()(e,n)>=t[0]&&r.x()(e,n)<=t[1]}),disableTooltip:e.disableTooltip}})).transition().duration(S).call(r),I(),z()}a.dispatch.on("stateChange",function(t){for(var e in t)w[e]=t[e];C.stateChange(w),N.update()}),s.dispatch.on("elementMousemove",function(n){r.clearHighlights();var i,a,c,d=[];if(l.filter(function(t,e){return t.seriesIndex=e,!t.disabled&&!t.disableTooltip}).forEach(function(o,s){var l=null!==u.brush.extent()?u.brush.empty()?u.xScale().domain():u.brush.extent():e.domain(),p=o.values.filter(function(t,e){return l[0]<=l[1]?r.x()(t,e)>=l[0]&&r.x()(t,e)<=l[1]:r.x()(t,e)>=l[1]&&r.x()(t,e)<=l[0]}),h=p[a=t.interactiveBisect(p,n.pointXValue,r.x())],g=N.y()(h,a);null!==g&&r.highlightPoint(s,a,!0),void 0!==h&&(void 0===i&&(i=h),void 0===c&&(c=N.xScale()(N.x()(h,a))),d.push({key:o.key,value:g,color:f(o,o.seriesIndex),data:h}))}),d.length>2){var p=N.yScale().invert(n.mouseY),h=.03*Math.abs(N.yScale().domain()[0]-N.yScale().domain()[1]),g=t.nearestValueIndex(d.map(function(t){return t.value}),p,h);null!==g&&(d[g].highlight=!0)}s.tooltip.valueFormatter(s.tooltip.valueFormatter()||function(t,e){return null==t?"N/A":o.tickFormat()(t)}).data({value:N.x()(i,a),index:a,series:d})(),s.renderGuideLine(c)}),s.dispatch.on("elementClick",function(e){var n,i=[];l.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(r){var o=t.interactiveBisect(r.values,e.pointXValue,N.x()),a=r.values[o];if(void 0!==a){void 0===n&&(n=N.xScale()(N.x()(a,o)));var s=N.yScale()(N.y()(a,o));i.push({point:a,pointIndex:o,pos:[n,s],seriesIndex:r.seriesIndex,series:r})}}),r.dispatch.elementClick(i)}),s.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),C.on("changeState",function(t){void 0!==t.disabled&&l.length===t.disabled.length&&(l.forEach(function(e,n){e.disabled=t.disabled[n]}),w.disabled=t.disabled),N.update()})}),W.renderEnd("lineChart immediate"),N}return r.dispatch.on("elementMouseover.tooltip",function(t){t.series.disableTooltip||l.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){l.hidden(!0)}),N.dispatch=C,N.lines=r,N.legend=a,N.focus=u,N.xAxis=i,N.x2Axis=u.xAxis,N.yAxis=o,N.y2Axis=u.yAxis,N.interactiveLayer=s,N.tooltip=l,N.state=w,N.dispatch=C,N.options=t.utils.optionsFunc.bind(N),N._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return g},set:function(t){g=t}},legendPosition:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return y},set:function(t){y=t}},defaultState:{get:function(){return M},set:function(t){M=t}},noData:{get:function(){return A},set:function(t){A=t}},focusEnable:{get:function(){return k},set:function(t){k=t}},focusHeight:{get:function(){return u.height()},set:function(t){u.height(t)}},focusShowAxisX:{get:function(){return u.showXAxis()},set:function(t){u.showXAxis(t)}},focusShowAxisY:{get:function(){return u.showYAxis()},set:function(t){u.showYAxis(t)}},brushExtent:{get:function(){return u.brushExtent()},set:function(t){u.brushExtent(t)}},focusMargin:{get:function(){return u.margin},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),u.margin.right=void 0!==t.right?t.right:u.margin.right,u.margin.bottom=void 0!==t.bottom?t.bottom:u.margin.bottom,u.margin.left=void 0!==t.left?t.left:u.margin.left}},margin:{get:function(){return c},set:function(t){c.top=void 0!==t.top?t.top:c.top,c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return S},set:function(t){S=t,W.reset(S),r.duration(S),u.duration(S),i.duration(S),o.duration(S)}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e),a.color(f),r.color(f),u.color(f)}},interpolate:{get:function(){return r.interpolate()},set:function(t){r.interpolate(t),u.interpolate(t)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t),u.xTickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t),u.yTickFormat(t)}},x:{get:function(){return r.x()},set:function(t){r.x(t),u.x(t)}},y:{get:function(){return r.y()},set:function(t){r.y(t),u.y(t)}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t,o.orient(x?"right":"left")}},useInteractiveGuideline:{get:function(){return b},set:function(t){(b=t)&&(r.interactive(!1),r.useVoronoi(!1))}}}),t.utils.inheritOptions(N,r),t.utils.initOptions(N),N},t.models.lineWithFocusChart=function(){return t.models.lineChart().margin({bottom:30}).focusEnable(!0)},t.models.linePlusBarChart=function(){"use strict";var e,n,r,i,o,a,s,l=t.models.line(),u=t.models.line(),c=t.models.historicalBar(),d=t.models.historicalBar(),f=t.models.axis(),p=t.models.axis(),h=t.models.axis(),g=t.models.axis(),v=t.models.axis(),m=t.models.axis(),y=t.models.legend(),x=d3.svg.brush(),b=t.models.tooltip(),k={top:30,right:30,bottom:30,left:60},w=null,M={top:0,right:30,bottom:20,left:60},A=null,C=null,S=function(t){return t.x},W=function(t){return t.y},E=t.utils.defaultColor(),F=!0,N=!0,D=!1,O=!0,_=50,L=null,B=null,P=d3.dispatch("brush","stateChange","changeState"),T=0,I=t.utils.state(),z=null,V=" (left axis)",H=" (right axis)",Y=!1;l.clipEdge(!0),u.interactive(!1),u.pointActive(function(t){return!1}),f.orient("bottom").tickPadding(5),h.orient("left"),g.orient("right"),p.orient("bottom").tickPadding(5),v.orient("left"),m.orient("right"),b.headerEnabled(!0).headerFormatter(function(t,e){return f.tickFormat()(t,e)});var G=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},X=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}},j=function(t){return t.every(function(t){return t.disabled})};function R(b){return b.each(function(b){var B=d3.select(this);t.utils.initSVG(B);var Z,q=t.utils.availableWidth(A,B,k),K=t.utils.availableHeight(C,B,k)-(N?_:0),U=_-M.top-M.bottom;if(R.update=function(){B.transition().duration(T).call(R)},R.container=this,I.setter(X(b),R.update).getter(G(b)).update(),I.disabled=b.map(function(t){return!!t.disabled}),!z)for(Z in z={},I)I[Z]instanceof Array?z[Z]=I[Z].slice(0):z[Z]=I[Z];if(!(b&&b.length&&b.filter(function(t){return t.values.length}).length))return t.utils.noData(R,B),R;B.selectAll(".nv-noData").remove();var Q=b.filter(function(t){return!t.disabled&&t.bar}),J=b.filter(function(t){return!t.bar});n=Q.length&&!Y?c.xScale():l.xScale(),r=p.scale(),i=Y?l.yScale():c.yScale(),o=Y?c.yScale():l.yScale(),a=Y?u.yScale():d.yScale(),s=Y?d.yScale():u.yScale();var $=b.filter(function(t){return!t.disabled&&(Y?!t.bar:t.bar)}).map(function(t){return t.values.map(function(t,e){return{x:S(t,e),y:W(t,e)}})}),tt=b.filter(function(t){return!t.disabled&&(Y?t.bar:!t.bar)}).map(function(t){return t.values.map(function(t,e){return{x:S(t,e),y:W(t,e)}})});n.range([0,q]),r.domain(d3.extent(d3.merge($.concat(tt)),function(t){return t.x})).range([0,q]);var et=B.selectAll("g.nv-wrap.nv-linePlusBar").data([b]),nt=et.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),rt=et.select("g");nt.append("g").attr("class","nv-legendWrap");var it=nt.append("g").attr("class","nv-focus");it.append("g").attr("class","nv-x nv-axis"),it.append("g").attr("class","nv-y1 nv-axis"),it.append("g").attr("class","nv-y2 nv-axis"),it.append("g").attr("class","nv-barsWrap"),it.append("g").attr("class","nv-linesWrap");var ot=nt.append("g").attr("class","nv-context");if(ot.append("g").attr("class","nv-x nv-axis"),ot.append("g").attr("class","nv-y1 nv-axis"),ot.append("g").attr("class","nv-y2 nv-axis"),ot.append("g").attr("class","nv-barsWrap"),ot.append("g").attr("class","nv-linesWrap"),ot.append("g").attr("class","nv-brushBackground"),ot.append("g").attr("class","nv-x nv-brush"),F){var at=y.align()?q/2:q,st=y.align()?at:0;y.width(at),rt.select(".nv-legendWrap").datum(b.map(function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=Y?t.originalKey+(t.bar?H:V):t.originalKey+(t.bar?V:H),t})).call(y),w||y.height()===k.top||(k.top=y.height(),K=t.utils.availableHeight(C,B,k)-_),rt.select(".nv-legendWrap").attr("transform","translate("+st+","+-k.top+")")}else rt.select(".nv-legendWrap").selectAll("*").remove();et.attr("transform","translate("+k.left+","+k.top+")"),rt.select(".nv-context").style("display",N?"initial":"none"),d.width(q).height(U).color(b.map(function(t,e){return t.color||E(t,e)}).filter(function(t,e){return!b[e].disabled&&b[e].bar})),u.width(q).height(U).color(b.map(function(t,e){return t.color||E(t,e)}).filter(function(t,e){return!b[e].disabled&&!b[e].bar}));var lt=rt.select(".nv-context .nv-barsWrap").datum(Q.length?Q:[{values:[]}]),ut=rt.select(".nv-context .nv-linesWrap").datum(j(J)?[{values:[]}]:J.filter(function(t){return!t.disabled}));rt.select(".nv-context").attr("transform","translate(0,"+(K+k.bottom+M.top)+")"),lt.transition().call(d),ut.transition().call(u),O&&(p._ticks(t.utils.calcTicksX(q/100,b)).tickSize(-U,0),rt.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+a.range()[0]+")"),rt.select(".nv-context .nv-x.nv-axis").transition().call(p)),D&&(v.scale(a)._ticks(U/36).tickSize(-q,0),m.scale(s)._ticks(U/36).tickSize(Q.length?0:-q,0),rt.select(".nv-context .nv-y3.nv-axis").style("opacity",Q.length?1:0).attr("transform","translate(0,"+r.range()[0]+")"),rt.select(".nv-context .nv-y2.nv-axis").style("opacity",J.length?1:0).attr("transform","translate("+r.range()[1]+",0)"),rt.select(".nv-context .nv-y1.nv-axis").transition().call(v),rt.select(".nv-context .nv-y2.nv-axis").transition().call(m)),x.x(r).on("brush",pt),L&&x.extent(L);var ct=rt.select(".nv-brushBackground").selectAll("g").data([L||x.extent()]),dt=ct.enter().append("g");dt.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",U),dt.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",U);var ft=rt.select(".nv-x.nv-brush").call(x);function pt(){L=x.empty()?null:x.extent(),e=x.empty()?r.domain():x.extent(),P.brush({extent:e,brush:x}),x.empty()||x.extent(L),ct.data([x.empty()?r.domain():L]).each(function(t,e){var n=r(t[0])-r.range()[0],i=r.range()[1]-r(t[1]);d3.select(this).select(".left").attr("width",n<0?0:n),d3.select(this).select(".right").attr("x",r(t[1])).attr("width",i<0?0:i)}),c.width(q).height(K).color(b.map(function(t,e){return t.color||E(t,e)}).filter(function(t,e){return!b[e].disabled&&b[e].bar})),l.width(q).height(K).color(b.map(function(t,e){return t.color||E(t,e)}).filter(function(t,e){return!b[e].disabled&&!b[e].bar}));var a=rt.select(".nv-focus .nv-barsWrap").datum(Q.length?Q.map(function(t,n){return{key:t.key,values:t.values.filter(function(t,n){return c.x()(t,n)>=e[0]&&c.x()(t,n)<=e[1]})}}):[{values:[]}]),s=rt.select(".nv-focus .nv-linesWrap").datum(j(J)?[{values:[]}]:J.filter(function(t){return!t.disabled}).map(function(t,n){return{area:t.area,fillOpacity:t.fillOpacity,strokeWidth:t.strokeWidth,key:t.key,values:t.values.filter(function(t,n){return l.x()(t,n)>=e[0]&&l.x()(t,n)<=e[1]})}}));n=Q.length&&!Y?c.xScale():l.xScale(),f.scale(n)._ticks(t.utils.calcTicksX(q/100,b)).tickSize(-K,0),f.domain([Math.ceil(e[0]),Math.floor(e[1])]),rt.select(".nv-x.nv-axis").transition().duration(T).call(f),a.transition().duration(T).call(c),s.transition().duration(T).call(l),rt.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+i.range()[0]+")"),h.scale(i)._ticks(t.utils.calcTicksY(K/36,b)).tickSize(-q,0),g.scale(o)._ticks(t.utils.calcTicksY(K/36,b)),Y?g.tickSize(J.length?0:-q,0):g.tickSize(Q.length?0:-q,0);var u=Q.length?1:0,d=J.length&&!j(J)?1:0,p=Y?d:u,v=Y?u:d;rt.select(".nv-focus .nv-y1.nv-axis").style("opacity",p),rt.select(".nv-focus .nv-y2.nv-axis").style("opacity",v).attr("transform","translate("+n.range()[1]+",0)"),rt.select(".nv-focus .nv-y1.nv-axis").transition().duration(T).call(h),rt.select(".nv-focus .nv-y2.nv-axis").transition().duration(T).call(g)}ft.selectAll("rect").attr("height",U),ft.selectAll(".resize").append("path").attr("d",function(t){var e=+("e"==t),n=e?1:-1,r=U/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)}),y.dispatch.on("stateChange",function(t){for(var e in t)I[e]=t[e];P.stateChange(I),R.update()}),P.on("changeState",function(t){void 0!==t.disabled&&(b.forEach(function(e,n){e.disabled=t.disabled[n]}),I.disabled=t.disabled),R.update()}),pt()}),R}return l.dispatch.on("elementMouseover.tooltip",function(t){b.duration(100).valueFormatter(function(t,e){return(Y?{main:h,focus:v}:{main:g,focus:m}).main.tickFormat()(t,e)}).data(t).hidden(!1)}),l.dispatch.on("elementMouseout.tooltip",function(t){b.hidden(!0)}),c.dispatch.on("elementMouseover.tooltip",function(t){t.value=R.x()(t.data),t.series={value:R.y()(t.data),color:t.color},b.duration(0).valueFormatter(function(t,e){return(Y?{main:g,focus:m}:{main:h,focus:v}).main.tickFormat()(t,e)}).data(t).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(t){b.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(t){b()}),R.dispatch=P,R.legend=y,R.lines=l,R.lines2=u,R.bars=c,R.bars2=d,R.xAxis=f,R.x2Axis=p,R.y1Axis=h,R.y2Axis=g,R.y3Axis=v,R.y4Axis=m,R.tooltip=b,R.options=t.utils.optionsFunc.bind(R),R._options=Object.create({},{width:{get:function(){return A},set:function(t){A=t}},height:{get:function(){return C},set:function(t){C=t}},showLegend:{get:function(){return F},set:function(t){F=t}},brushExtent:{get:function(){return L},set:function(t){L=t}},noData:{get:function(){return B},set:function(t){B=t}},focusEnable:{get:function(){return N},set:function(t){N=t}},focusHeight:{get:function(){return _},set:function(t){_=t}},focusShowAxisX:{get:function(){return O},set:function(t){O=t}},focusShowAxisY:{get:function(){return D},set:function(t){D=t}},legendLeftAxisHint:{get:function(){return V},set:function(t){V=t}},legendRightAxisHint:{get:function(){return H},set:function(t){H=t}},margin:{get:function(){return k},set:function(t){void 0!==t.top&&(k.top=t.top,w=t.top),k.right=void 0!==t.right?t.right:k.right,k.bottom=void 0!==t.bottom?t.bottom:k.bottom,k.left=void 0!==t.left?t.left:k.left}},focusMargin:{get:function(){return M},set:function(t){M.top=void 0!==t.top?t.top:M.top,M.right=void 0!==t.right?t.right:M.right,M.bottom=void 0!==t.bottom?t.bottom:M.bottom,M.left=void 0!==t.left?t.left:M.left}},duration:{get:function(){return T},set:function(t){T=t}},color:{get:function(){return E},set:function(e){E=t.utils.getColor(e),y.color(E)}},x:{get:function(){return S},set:function(t){S=t,l.x(t),u.x(t),c.x(t),d.x(t)}},y:{get:function(){return W},set:function(t){W=t,l.y(t),u.y(t),c.y(t),d.y(t)}},switchYAxisOrder:{get:function(){return Y},set:function(t){if(Y!==t){var e=h;h=g,g=e;var n=v;v=m,m=n}Y=t,h.orient("left"),g.orient("right"),v.orient("left"),m.orient("right")}}}),t.utils.inheritOptions(R,l),t.utils.initOptions(R),R},t.models.multiBar=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=d3.scale.ordinal(),f=d3.scale.linear(),p=Math.floor(1e4*Math.random()),h=null,g=function(t){return t.x},v=function(t){return t.y},m=[0],y=!0,x=!1,b="zero",k=t.utils.defaultColor(),w=!1,M=null,A=500,C=.1,S=.75,W=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=t.utils.renderWatch(W,A),F=0;function N(D){return E.reset(),D.each(function(N){var D=u-l.left-l.right,O=c-l.top-l.bottom;h=d3.select(this),t.utils.initSVG(h);var _=0;if(w&&N.length&&(w=[{values:N[0].values.map(function(t){return{x:t.x,y:0,series:t.series,size:.01}})}]),x){var L=d3.layout.stack().offset(b).values(function(t){return t.values}).y(v)(!N.length&&w?w:N);L.forEach(function(t,e){t.nonStackable?(N[e].nonStackableSeries=_++,L[e]=N[e]):e>0&&L[e-1].nonStackable&&L[e].values.map(function(t,n){t.y0-=L[e-1].values[n].y,t.y1=t.y0+t.y})}),N=L}N.forEach(function(t,e){t.values.forEach(function(n){n.series=e,n.key=t.key})}),x&&N.length>0&&N[0].values.map(function(t,e){var n=0,r=0;N.map(function(t,i){if(!N[i].nonStackable){var o=t.values[e];o.size=Math.abs(o.y),o.y<0?(o.y1=r,r-=o.size):(o.y1=o.size+n,n+=o.size)}})});var B=n&&r?[]:N.map(function(t,e){return t.values.map(function(t,n){return{x:g(t,n),y:v(t,n),y0:t.y0,y1:t.y1,idx:e}})});d.domain(n||d3.merge(B).map(function(t){return t.x})).rangeBands(i||[0,D],C),f.domain(r||d3.extent(d3.merge(B).map(function(t){var e=t.y;return x&&!N[t.idx].nonStackable&&(e=t.y>0?t.y1:t.y1+t.y),e}).concat(m))).range(o||[O,0]),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]-.01*d.domain()[0],d.domain()[1]+.01*d.domain()[1]]):d.domain([-1,1])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+.01*f.domain()[0],f.domain()[1]-.01*f.domain()[1]]):f.domain([-1,1])),a=a||d,s=s||f;var P=h.selectAll("g.nv-wrap.nv-multibar").data([N]),T=P.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),I=T.append("defs"),z=T.append("g"),V=P.select("g");z.append("g").attr("class","nv-groups"),P.attr("transform","translate("+l.left+","+l.top+")"),I.append("clipPath").attr("id","nv-edge-clip-"+p).append("rect"),P.select("#nv-edge-clip-"+p+" rect").attr("width",D).attr("height",O),V.attr("clip-path",y?"url(#nv-edge-clip-"+p+")":"");var H=P.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t,e){return e});H.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var Y=E.transition(H.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,A)).attr("y",function(t,e,n){var r=s(0)||0;return x&&N[t.series]&&!N[t.series].nonStackable&&(r=s(t.y0)),r}).attr("height",0).remove();Y.delay&&Y.delay(function(t,e){return e*(A/(F+1))-e}),H.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return k(t,e)}).style("stroke",function(t,e){return k(t,e)}),H.style("stroke-opacity",1).style("fill-opacity",S);var G=H.selectAll("rect.nv-bar").data(function(t){return w&&!N.length?w.values:t.values});G.exit().remove();G.enter().append("rect").attr("class",function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(t,e,n){return x&&!N[n].nonStackable?0:n*d.rangeBand()/N.length}).attr("y",function(t,e,n){return s(x&&!N[n].nonStackable?t.y0:0)||0}).attr("height",0).attr("width",function(t,e,n){return d.rangeBand()/(x&&!N[n].nonStackable?1:N.length)}).attr("transform",function(t,e){return"translate("+d(g(t,e))+",0)"});G.style("fill",function(t,e,n){return k(t,n,e)}).style("stroke",function(t,e,n){return k(t,n,e)}).on("mouseover",function(t,e,n){d3.select(this).classed("hover",!0),W.elementMouseover({data:t,index:e,series:N[n],color:d3.select(this).style("fill")})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),W.elementMouseout({data:t,index:e,series:N[n],color:d3.select(this).style("fill")})}).on("mousemove",function(t,e,n){W.elementMousemove({data:t,index:e,series:N[n],color:d3.select(this).style("fill")})}).on("click",function(t,e,n){W.elementClick({data:t,index:e,series:N[n],color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()}).on("dblclick",function(t,e,n){W.elementDblClick({data:t,index:e,series:N[n],color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),G.attr("class",function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(t,e){return"translate("+d(g(t,e))+",0)"}),M&&(e||(e=N.map(function(){return!0})),G.style("fill",function(t,n,r){return d3.rgb(M(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[r]).toString()}).style("stroke",function(t,n,r){return d3.rgb(M(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[r]).toString()}));var X=G.watchTransition(E,"multibar",Math.min(250,A)).delay(function(t,e){return e*A/N[0].values.length});x?X.attr("y",function(t,e,n){return N[n].nonStackable?v(t,e)<0?f(0):f(0)-f(v(t,e))<-1?f(0)-1:f(v(t,e))||0:f(t.y1)}).attr("height",function(t,e,n){return N[n].nonStackable?Math.max(Math.abs(f(v(t,e))-f(0)),0)||0:Math.max(Math.abs(f(t.y+t.y0)-f(t.y0)),0)}).attr("x",function(t,e,n){var r=0;return N[n].nonStackable&&(r=t.series*d.rangeBand()/N.length,N.length!==_&&(r=N[n].nonStackableSeries*d.rangeBand()/(2*_))),r}).attr("width",function(t,e,n){if(N[n].nonStackable){var r=d.rangeBand()/_;return N.length!==_&&(r=d.rangeBand()/(2*_)),r}return d.rangeBand()}):X.attr("x",function(t,e){return t.series*d.rangeBand()/N.length}).attr("width",d.rangeBand()/N.length).attr("y",function(t,e){return v(t,e)<0?f(0):f(0)-f(v(t,e))<1?f(0)-1:f(v(t,e))||0}).attr("height",function(t,e){return Math.max(Math.abs(f(v(t,e))-f(0)),1)||0}),a=d.copy(),s=f.copy(),N[0]&&N[0].values&&(F=N[0].values.length)}),E.renderEnd("multibar immediate"),N}return N.dispatch=W,N.options=t.utils.optionsFunc.bind(N),N._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceY:{get:function(){return m},set:function(t){m=t}},stacked:{get:function(){return x},set:function(t){x=t}},stackOffset:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return y},set:function(t){y=t}},disabled:{get:function(){return e},set:function(t){e=t}},id:{get:function(){return p},set:function(t){p=t}},hideable:{get:function(){return w},set:function(t){w=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return A},set:function(t){A=t,E.reset(A)}},color:{get:function(){return k},set:function(e){k=t.utils.getColor(e)}},barColor:{get:function(){return M},set:function(e){M=e?t.utils.getColor(e):null}}}),t.utils.initOptions(N),N},t.models.multiBarChart=function(){"use strict";var e,n,r=t.models.multiBar(),i=t.models.axis(),o=t.models.axis(),a=t.interactiveGuideline(),s=t.models.legend(),l=t.models.legend(),u=t.models.tooltip(),c={top:30,right:20,bottom:50,left:60},d=null,f=null,p=null,h=t.utils.defaultColor(),g=!0,v={},m=!0,y=null,x=!0,b=!0,k=!1,w=!0,M=!1,A=!1,C=0,S=t.utils.state(),W=null,E=null,F=d3.dispatch("stateChange","changeState","renderEnd"),N=function(){return g?180:0},D=250,O=!1;S.stacked=!1,r.stacked(!1),i.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat(function(t){return t}),o.orient(k?"right":"left").tickFormat(d3.format(",.1f")),u.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.valueFormatter(function(t,e){return null==t?"N/A":o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.valueFormatter(function(t,e){return null==t?"N/A":o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),l.updateState(!1);var _=t.utils.renderWatch(F),L=!1,B=function(t){return function(){return{active:t.map(function(t){return!t.disabled}),stacked:L}}},P=function(t){return function(e){void 0!==e.stacked&&(L=e.stacked),void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};function T(E){return _.reset(),_.models(r),x&&_.models(i),b&&_.models(o),E.each(function(E){var _=d3.select(this);t.utils.initSVG(_);var I,z=t.utils.availableWidth(f,_,c),V=t.utils.availableHeight(p,_,c);if(T.update=function(){0===D?_.call(T):_.transition().duration(D).call(T)},T.container=this,S.setter(P(E),T.update).getter(B(E)).update(),S.disabled=E.map(function(t){return!!t.disabled}),!W)for(I in W={},S)S[I]instanceof Array?W[I]=S[I].slice(0):W[I]=S[I];if(!(E&&E.length&&E.filter(function(t){return t.values.length}).length))return t.utils.noData(T,_),T;_.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale();var H=_.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([E]),Y=H.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),G=H.select("g");if(Y.append("g").attr("class","nv-x nv-axis"),Y.append("g").attr("class","nv-y nv-axis"),Y.append("g").attr("class","nv-barsWrap"),Y.append("g").attr("class","nv-legendWrap"),Y.append("g").attr("class","nv-controlsWrap"),Y.append("g").attr("class","nv-interactive"),m?"bottom"===y?(s.width(z-c.right),G.select(".nv-legendWrap").datum(E).call(s),c.bottom=i.height()+s.height(),V=t.utils.availableHeight(p,_,c),G.select(".nv-legendWrap").attr("transform","translate(0,"+(V+i.height())+")")):(s.width(z-N()),G.select(".nv-legendWrap").datum(E).call(s),d||s.height()===c.top||(c.top=s.height(),V=t.utils.availableHeight(p,_,c)),G.select(".nv-legendWrap").attr("transform","translate("+N()+","+-c.top+")")):G.select(".nv-legendWrap").selectAll("*").remove(),g){var X=[{key:v.grouped||"Grouped",disabled:r.stacked()},{key:v.stacked||"Stacked",disabled:!r.stacked()}];l.width(N()).color(["#444","#444","#444"]),G.select(".nv-controlsWrap").datum(X).attr("transform","translate(0,"+-c.top+")").call(l)}else G.select(".nv-controlsWrap").selectAll("*").remove();if(H.attr("transform","translate("+c.left+","+c.top+")"),k&&G.select(".nv-y.nv-axis").attr("transform","translate("+z+",0)"),r.disabled(E.map(function(t){return t.disabled})).width(z).height(V).color(E.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!E[e].disabled})),G.select(".nv-barsWrap").datum(E.filter(function(t){return!t.disabled})).call(r),x){i.scale(e)._ticks(t.utils.calcTicksX(z/100,E)).tickSize(-V,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),G.select(".nv-x.nv-axis").call(i);var j=G.select(".nv-x.nv-axis > g").selectAll("g");if(j.selectAll("line, text").style("opacity",1),M){var R=function(t,e){return"translate("+t+","+e+")"};j.selectAll("text").attr("transform",function(t,e,n){return R(0,n%2==0?5:17)});var Z=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;G.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(t,e){return R(0,0===e||Z%2!=0?17:5)})}A&&G.selectAll(".tick text").call(t.utils.wrapTicks,T.xAxis.rangeBand()),w&&j.filter(function(t,e){return e%Math.ceil(E[0].values.length/(z/100))!=0}).selectAll("text, line").style("opacity",0),C&&j.selectAll(".tick text").attr("transform","rotate("+C+" 0,0)").style("text-anchor",C>0?"start":"end"),G.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}b&&(o.scale(n)._ticks(t.utils.calcTicksY(V/36,E)).tickSize(-z,0),G.select(".nv-y.nv-axis").call(o)),O&&(a.width(z).height(V).margin({left:c.left,top:c.top}).svgContainer(_).xScale(e),H.select(".nv-interactive").call(a)),s.dispatch.on("stateChange",function(t){for(var e in t)S[e]=t[e];F.stateChange(S),T.update()}),l.dispatch.on("legendClick",function(t,e){if(t.disabled){switch(X=X.map(function(t){return t.disabled=!0,t}),t.disabled=!1,t.key){case"Grouped":case v.grouped:r.stacked(!1);break;case"Stacked":case v.stacked:r.stacked(!0)}S.stacked=r.stacked(),F.stateChange(S),T.update()}}),F.on("changeState",function(t){void 0!==t.disabled&&(E.forEach(function(e,n){e.disabled=t.disabled[n]}),S.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),S.stacked=t.stacked,L=t.stacked),T.update()}),O?(a.dispatch.on("elementMousemove",function(t){if(null!=t.pointXValue){var n,r,i,o,s=[];E.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(a,l){r=e.domain().indexOf(t.pointXValue);var u=a.values[r];void 0!==u&&(o=u.x,void 0===n&&(n=u),void 0===i&&(i=t.mouseX),s.push({key:a.key,value:T.y()(u,r),color:h(a,a.seriesIndex),data:a.values[r]}))}),a.tooltip.data({value:o,index:r,series:s})(),a.renderGuideLine(i)}}),a.dispatch.on("elementMouseout",function(t){a.tooltip.hidden(!0)})):(r.dispatch.on("elementMouseover.tooltip",function(t){t.value=T.x()(t.data),t.series={key:t.data.key,value:T.y()(t.data),color:t.color},u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){u()}))}),_.renderEnd("multibarchart immediate"),T}return T.dispatch=F,T.multibar=r,T.legend=s,T.controls=l,T.xAxis=i,T.yAxis=o,T.state=S,T.tooltip=u,T.interactiveLayer=a,T.options=t.utils.optionsFunc.bind(T),T._options=Object.create({},{width:{get:function(){return f},set:function(t){f=t}},height:{get:function(){return p},set:function(t){p=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},showControls:{get:function(){return g},set:function(t){g=t}},controlLabels:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return W},set:function(t){W=t}},noData:{get:function(){return E},set:function(t){E=t}},reduceXTicks:{get:function(){return w},set:function(t){w=t}},rotateLabels:{get:function(){return C},set:function(t){C=t}},staggerLabels:{get:function(){return M},set:function(t){M=t}},wrapLabels:{get:function(){return A},set:function(t){A=!!t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return D},set:function(t){D=t,r.duration(D),i.duration(D),o.duration(D),_.reset(D)}},color:{get:function(){return h},set:function(e){h=t.utils.getColor(e),s.color(h)}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,o.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return O},set:function(t){O=t}},barColor:{get:function(){return r.barColor},set:function(t){r.barColor(t),s.color(function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()})}}}),t.utils.inheritOptions(T,r),t.utils.initOptions(T),T},t.models.multiBarHorizontal=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=null,p=d3.scale.ordinal(),h=d3.scale.linear(),g=function(t){return t.x},v=function(t){return t.y},m=function(t){return t.yErr},y=[0],x=t.utils.defaultColor(),b=null,k=!1,w=!1,M=!1,A=60,C=.1,S=.75,W=d3.format(",.2f"),E=250,F=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),N=t.utils.renderWatch(F,E);function D(d){return N.reset(),d.each(function(d){var E=u-l.left-l.right,D=c-l.top-l.bottom;f=d3.select(this),t.utils.initSVG(f),k&&(d=d3.layout.stack().offset("zero").values(function(t){return t.values}).y(v)(d)),d.forEach(function(t,e){t.values.forEach(function(n){n.series=e,n.key=t.key})}),k&&d[0].values.map(function(t,e){var n=0,r=0;d.map(function(t){var i=t.values[e];i.size=Math.abs(i.y),i.y<0?(i.y1=r-i.size,r-=i.size):(i.y1=n,n+=i.size)})});var O=n&&r?[]:d.map(function(t){return t.values.map(function(t,e){return{x:g(t,e),y:v(t,e),y0:t.y0,y1:t.y1}})});p.domain(n||d3.merge(O).map(function(t){return t.x})).rangeBands(i||[0,D],C),h.domain(r||d3.extent(d3.merge(O).map(function(t){return k?t.y>0?t.y1+t.y:t.y1:t.y}).concat(y))),w&&!k?h.range(o||[h.domain()[0]<0?A:0,E-(h.domain()[1]>0?A:0)]):h.range(o||[0,E]),a=a||p,s=s||d3.scale.linear().domain(h.domain()).range([h(0),h(0)]);var _=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([d]),L=_.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),B=(L.append("defs"),L.append("g"));_.select("g");B.append("g").attr("class","nv-groups"),_.attr("transform","translate("+l.left+","+l.top+")");var P=_.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t,e){return e});P.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),P.exit().watchTransition(N,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),P.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return x(t,e)}).style("stroke",function(t,e){return x(t,e)}),P.watchTransition(N,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",S);var T=P.selectAll("g.nv-bar").data(function(t){return t.values});T.exit().remove();var I=T.enter().append("g").attr("transform",function(t,e,n){return"translate("+s(k?t.y0:0)+","+(k?0:n*p.rangeBand()/d.length+p(g(t,e)))+")"});I.append("rect").attr("width",0).attr("height",p.rangeBand()/(k?1:d.length)),T.on("mouseover",function(t,e){d3.select(this).classed("hover",!0),F.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1),F.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){F.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})}).on("mousemove",function(t,e){F.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})}).on("click",function(t,e){F.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()}).on("dblclick",function(t,e){F.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),m(d[0],0)&&(I.append("polyline"),T.select("polyline").attr("fill","none").attr("points",function(t,e){var n=m(t,e),r=.8*p.rangeBand()/(2*(k?1:d.length));return[[(n=(n=n.length?n:[-Math.abs(n),Math.abs(n)]).map(function(n){return h(n+(v(t,e)<0?0:v(t,e)))-h(0)}))[0],-r],[n[0],r],[n[0],0],[n[1],0],[n[1],-r],[n[1],r]].map(function(t){return t.join(",")}).join(" ")}).attr("transform",function(t,e){return"translate(0, "+p.rangeBand()/(2*(k?1:d.length))+")"})),I.append("text"),w&&!k?(T.select("text").attr("text-anchor",function(t,e){return v(t,e)<0?"end":"start"}).attr("y",p.rangeBand()/(2*d.length)).attr("dy",".32em").text(function(t,e){var n=W(v(t,e)),r=m(t,e);return void 0===r?n:r.length?n+"+"+W(Math.abs(r[1]))+"-"+W(Math.abs(r[0])):n+"±"+W(Math.abs(r))}),T.watchTransition(N,"multibarhorizontal: bars").select("text").attr("x",function(t,e){return v(t,e)<0?-4:h(v(t,e))-h(0)+4})):T.selectAll("text").text(""),M&&!k?(I.append("text").classed("nv-bar-label",!0),T.select("text.nv-bar-label").attr("text-anchor",function(t,e){return v(t,e)<0?"start":"end"}).attr("y",p.rangeBand()/(2*d.length)).attr("dy",".32em").text(function(t,e){return g(t,e)}),T.watchTransition(N,"multibarhorizontal: bars").select("text.nv-bar-label").attr("x",function(t,e){return v(t,e)<0?h(0)-h(v(t,e))+4:-4})):T.selectAll("text.nv-bar-label").text(""),T.attr("class",function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"}),b&&(e||(e=d.map(function(){return!0})),T.style("fill",function(t,n,r){return d3.rgb(b(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[r]).toString()}).style("stroke",function(t,n,r){return d3.rgb(b(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[r]).toString()})),k?T.watchTransition(N,"multibarhorizontal: bars").attr("transform",function(t,e){return"translate("+h(t.y1)+","+p(g(t,e))+")"}).select("rect").attr("width",function(t,e){return Math.abs(h(v(t,e)+t.y0)-h(t.y0))||0}).attr("height",p.rangeBand()):T.watchTransition(N,"multibarhorizontal: bars").attr("transform",function(t,e){return"translate("+(v(t,e)<0?h(v(t,e)):h(0))+","+(t.series*p.rangeBand()/d.length+p(g(t,e)))+")"}).select("rect").attr("height",p.rangeBand()/d.length).attr("width",function(t,e){return Math.max(Math.abs(h(v(t,e))-h(0)),1)||0}),a=p.copy(),s=h.copy()}),N.renderEnd("multibarHorizontal immediate"),D}return D.dispatch=F,D.options=t.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},yErr:{get:function(){return m},set:function(t){m=t}},xScale:{get:function(){return p},set:function(t){p=t}},yScale:{get:function(){return h},set:function(t){h=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceY:{get:function(){return y},set:function(t){y=t}},stacked:{get:function(){return k},set:function(t){k=t}},showValues:{get:function(){return w},set:function(t){w=t}},disabled:{get:function(){return e},set:function(t){e=t}},id:{get:function(){return d},set:function(t){d=t}},valueFormat:{get:function(){return W},set:function(t){W=t}},valuePadding:{get:function(){return A},set:function(t){A=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return E},set:function(t){E=t,N.reset(E)}},color:{get:function(){return x},set:function(e){x=t.utils.getColor(e)}},barColor:{get:function(){return b},set:function(e){b=e?t.utils.getColor(e):null}}}),t.utils.initOptions(D),D},t.models.multiBarHorizontalChart=function(){"use strict";var e,n,r=t.models.multiBarHorizontal(),i=t.models.axis(),o=t.models.axis(),a=t.models.legend().height(30),s=t.models.legend().height(30),l=t.models.tooltip(),u={top:30,right:20,bottom:50,left:60},c=null,d=null,f=null,p=t.utils.defaultColor(),h=!0,g="top",v={},m=!0,y="top",x=!0,b=!0,k=!1,w=t.utils.state(),M=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=function(){return h?180:0},W=250;w.stacked=!1,r.stacked(k),i.orient("left").tickPadding(5).showMaxMin(!1).tickFormat(function(t){return t}),o.orient("bottom").tickFormat(d3.format(",.1f")),l.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.updateState(!1);var E=function(t){return function(){return{active:t.map(function(t){return!t.disabled}),stacked:k}}},F=function(t){return function(e){void 0!==e.stacked&&(k=e.stacked),void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}},N=t.utils.renderWatch(C,W);function D(l){return N.reset(),N.models(r),x&&N.models(i),b&&N.models(o),l.each(function(l){var A=d3.select(this);t.utils.initSVG(A);var N,O=t.utils.availableWidth(d,A,u),_=t.utils.availableHeight(f,A,u);if(D.update=function(){A.transition().duration(W).call(D)},D.container=this,k=r.stacked(),w.setter(F(l),D.update).getter(E(l)).update(),w.disabled=l.map(function(t){return!!t.disabled}),!M)for(N in M={},w)w[N]instanceof Array?M[N]=w[N].slice(0):M[N]=w[N];if(!(l&&l.length&&l.filter(function(t){return t.values.length}).length))return t.utils.noData(D,A),D;A.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale().clamp(!0);var L=A.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([l]),B=L.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),P=L.select("g");if(B.append("g").attr("class","nv-x nv-axis"),B.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),B.append("g").attr("class","nv-barsWrap"),B.append("g").attr("class","nv-legendWrap"),B.append("g").attr("class","nv-controlsWrap"),m?(a.width(O-S()),P.select(".nv-legendWrap").datum(l).call(a),"bottom"===y?(u.bottom=i.height()+a.height(),_=t.utils.availableHeight(f,A,u),P.select(".nv-legendWrap").attr("transform","translate("+S()+","+(_+i.height())+")")):"top"===y&&(c||a.height()===u.top||(u.top=a.height(),_=t.utils.availableHeight(f,A,u)),P.select(".nv-legendWrap").attr("transform","translate("+S()+","+-u.top+")"))):P.select(".nv-legendWrap").selectAll("*").remove(),h){var T=[{key:v.grouped||"Grouped",disabled:r.stacked()},{key:v.stacked||"Stacked",disabled:!r.stacked()}];s.width(S()).color(["#444","#444","#444"]),"bottom"===g?(u.bottom=i.height()+a.height(),_=t.utils.availableHeight(f,A,u),P.select(".nv-controlsWrap").datum(T).attr("transform","translate(0,"+(_+i.height())+")").call(s)):"top"===g&&P.select(".nv-controlsWrap").datum(T).attr("transform","translate(0,"+-u.top+")").call(s)}else P.select(".nv-controlsWrap").selectAll("*").remove();(L.attr("transform","translate("+u.left+","+u.top+")"),r.disabled(l.map(function(t){return t.disabled})).width(O).height(_).color(l.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!l[e].disabled})),P.select(".nv-barsWrap").datum(l.filter(function(t){return!t.disabled})).transition().call(r),x)&&(i.scale(e)._ticks(t.utils.calcTicksY(_/24,l)).tickSize(-O,0),P.select(".nv-x.nv-axis").call(i),P.select(".nv-x.nv-axis").selectAll("g").selectAll("line, text"));b&&(o.scale(n)._ticks(t.utils.calcTicksX(O/100,l)).tickSize(-_,0),P.select(".nv-y.nv-axis").attr("transform","translate(0,"+_+")"),P.select(".nv-y.nv-axis").call(o)),P.select(".nv-zeroLine line").attr("x1",n(0)).attr("x2",n(0)).attr("y1",0).attr("y2",-_),a.dispatch.on("stateChange",function(t){for(var e in t)w[e]=t[e];C.stateChange(w),D.update()}),s.dispatch.on("legendClick",function(t,e){if(t.disabled){switch(T=T.map(function(t){return t.disabled=!0,t}),t.disabled=!1,t.key){case"Grouped":case v.grouped:r.stacked(!1);break;case"Stacked":case v.stacked:r.stacked(!0)}w.stacked=r.stacked(),C.stateChange(w),k=r.stacked(),D.update()}}),C.on("changeState",function(t){void 0!==t.disabled&&(l.forEach(function(e,n){e.disabled=t.disabled[n]}),w.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),w.stacked=t.stacked,k=t.stacked),D.update()})}),N.renderEnd("multibar horizontal chart immediate"),D}return r.dispatch.on("elementMouseover.tooltip",function(t){t.value=D.x()(t.data),t.series={key:t.data.key,value:D.y()(t.data),color:t.color},l.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){l.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){l()}),D.dispatch=C,D.multibar=r,D.legend=a,D.controls=s,D.xAxis=i,D.yAxis=o,D.state=w,D.tooltip=l,D.options=t.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return d},set:function(t){d=t}},height:{get:function(){return f},set:function(t){f=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},controlsPosition:{get:function(){return g},set:function(t){g=t}},showControls:{get:function(){return h},set:function(t){h=t}},controlLabels:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return M},set:function(t){M=t}},noData:{get:function(){return A},set:function(t){A=t}},margin:{get:function(){return u},set:function(t){void 0!==t.top&&(u.top=t.top,c=t.top),u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return W},set:function(t){W=t,N.reset(W),r.duration(W),i.duration(W),o.duration(W)}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),a.color(p)}},barColor:{get:function(){return r.barColor},set:function(t){r.barColor(t),a.color(function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()})}}}),t.utils.inheritOptions(D,r),t.utils.initOptions(D),D},t.models.multiChart=function(){"use strict";var e,n,r={top:30,right:20,bottom:50,left:60},i=null,o=t.utils.defaultColor(),a=null,s=null,l=!0,u=null,c=function(t){return t.x},d=function(t){return t.y},f="linear",p=!0,h=t.interactiveGuideline(),g=!1,v=" (right axis)",m=250,y=d3.scale.linear(),x=d3.scale.linear(),b=d3.scale.linear(),k=t.models.line().yScale(x).duration(m),w=t.models.line().yScale(b).duration(m),M=t.models.scatter().yScale(x).duration(m),A=t.models.scatter().yScale(b).duration(m),C=t.models.multiBar().stacked(!1).yScale(x).duration(m),S=t.models.multiBar().stacked(!1).yScale(b).duration(m),W=t.models.stackedArea().yScale(x).duration(m),E=t.models.stackedArea().yScale(b).duration(m),F=t.models.axis().scale(y).orient("bottom").tickPadding(5).duration(m),N=t.models.axis().scale(x).orient("left").duration(m),D=t.models.axis().scale(b).orient("right").duration(m),O=t.models.legend().height(30),_=t.models.tooltip(),L=d3.dispatch(),B=[k,w,M,A,C,S,W,E];function P(u){return u.each(function(u){var p=d3.select(this);t.utils.initSVG(p),P.update=function(){p.transition().call(P)},P.container=this;var m=t.utils.availableWidth(a,p,r),L=t.utils.availableHeight(s,p,r),T=u.filter(function(t){return"line"==t.type&&1==t.yAxis}),I=u.filter(function(t){return"line"==t.type&&2==t.yAxis}),z=u.filter(function(t){return"scatter"==t.type&&1==t.yAxis}),V=u.filter(function(t){return"scatter"==t.type&&2==t.yAxis}),H=u.filter(function(t){return"bar"==t.type&&1==t.yAxis}),Y=u.filter(function(t){return"bar"==t.type&&2==t.yAxis}),G=u.filter(function(t){return"area"==t.type&&1==t.yAxis}),X=u.filter(function(t){return"area"==t.type&&2==t.yAxis});if(!(u&&u.length&&u.filter(function(t){return t.values.length}).length))return t.utils.noData(P,p),P;p.selectAll(".nv-noData").remove();var j=u.filter(function(t){return!t.disabled&&1==t.yAxis}).map(function(t){return t.values.map(function(t,e){return{x:c(t),y:d(t)}})}),R=u.filter(function(t){return!t.disabled&&2==t.yAxis}).map(function(t){return t.values.map(function(t,e){return{x:c(t),y:d(t)}})});y.domain(d3.extent(d3.merge(j.concat(R)),function(t){return t.x})).range([0,m]);var Z=p.selectAll("g.wrap.multiChart").data([u]),q=Z.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");q.append("g").attr("class","nv-x nv-axis"),q.append("g").attr("class","nv-y1 nv-axis"),q.append("g").attr("class","nv-y2 nv-axis"),q.append("g").attr("class","stack1Wrap"),q.append("g").attr("class","stack2Wrap"),q.append("g").attr("class","bars1Wrap"),q.append("g").attr("class","bars2Wrap"),q.append("g").attr("class","scatters1Wrap"),q.append("g").attr("class","scatters2Wrap"),q.append("g").attr("class","lines1Wrap"),q.append("g").attr("class","lines2Wrap"),q.append("g").attr("class","legendWrap"),q.append("g").attr("class","nv-interactive");var K=Z.select("g"),U=u.map(function(t,e){return u[e].color||o(t,e)});if(l){var Q=O.align()?m/2:m,J=O.align()?Q:0;O.width(Q),O.color(U),K.select(".legendWrap").datum(u.map(function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=t.originalKey+(1==t.yAxis?"":v),t})).call(O),i||O.height()===r.top||(r.top=O.height(),L=t.utils.availableHeight(s,p,r)),K.select(".legendWrap").attr("transform","translate("+J+","+-r.top+")")}else K.select(".legendWrap").selectAll("*").remove();k.width(m).height(L).interpolate(f).color(U.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"line"==u[e].type})),w.width(m).height(L).interpolate(f).color(U.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"line"==u[e].type})),M.width(m).height(L).color(U.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"scatter"==u[e].type})),A.width(m).height(L).color(U.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"scatter"==u[e].type})),C.width(m).height(L).color(U.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"bar"==u[e].type})),S.width(m).height(L).color(U.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"bar"==u[e].type})),W.width(m).height(L).interpolate(f).color(U.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"area"==u[e].type})),E.width(m).height(L).interpolate(f).color(U.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"area"==u[e].type})),K.attr("transform","translate("+r.left+","+r.top+")");var $=K.select(".lines1Wrap").datum(T.filter(function(t){return!t.disabled})),tt=K.select(".scatters1Wrap").datum(z.filter(function(t){return!t.disabled})),et=K.select(".bars1Wrap").datum(H.filter(function(t){return!t.disabled})),nt=K.select(".stack1Wrap").datum(G.filter(function(t){return!t.disabled})),rt=K.select(".lines2Wrap").datum(I.filter(function(t){return!t.disabled})),it=K.select(".scatters2Wrap").datum(V.filter(function(t){return!t.disabled})),ot=K.select(".bars2Wrap").datum(Y.filter(function(t){return!t.disabled})),at=K.select(".stack2Wrap").datum(X.filter(function(t){return!t.disabled})),st=[];C.stacked()&&H.length&&((st=H.filter(function(t){return!t.disabled}).map(function(t){return t.values})).length>0&&(st=st.reduce(function(t,e){return t.map(function(t,n){return{x:t.x,y:t.y+e[n].y}})})));H.length&&st.push({x:0,y:0});var lt=[];S.stacked()&&Y.length&&((lt=Y.filter(function(t){return!t.disabled}).map(function(t){return t.values})).length>0&&(lt=lt.reduce(function(t,e){return t.map(function(t,n){return{x:t.x,y:t.y+e[n].y}})})));function ut(t){var e=2===t.series.yAxis?D:N;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},_.duration(0).headerFormatter(function(t,e){return F.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function ct(t){var e=2===t.series.yAxis?D:N;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},_.duration(100).headerFormatter(function(t,e){return F.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function dt(t){var e=2===t.series.yAxis?D:N;t.point.x=W.x()(t.point),t.point.y=W.y()(t.point),_.duration(0).headerFormatter(function(t,e){return F.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function ft(t){var e=2===t.series.yAxis?D:N;t.value=C.x()(t.data),t.series={value:C.y()(t.data),color:t.color,key:t.data.key},_.duration(0).headerFormatter(function(t,e){return F.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function pt(){for(var t=0,e=B.length;t=u[0]&&P.x()(t,e)<=u[1]}),d=c[r=t.interactiveBisect(c,e.pointXValue,P.x())],f=P.y()(d,r);null!==f&&function(t,e,n){for(var r=0,i=B.length;rg(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}).attr("d",function(t,e){return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-W/2+",0l"+W/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(t,e)))+"l"+W/2+",0l"+-W/2+",0z"}).attr("transform",function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"}).attr("fill",function(t,e){return w[0]}).attr("stroke",function(t,e){return w[0]}).attr("x",0).attr("y",function(t,e){return d(Math.max(0,p(t,e)))}).attr("height",function(t,e){return Math.abs(d(p(t,e))-d(0))}),_.attr("class",function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}),d3.transition(_).attr("transform",function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"}).attr("d",function(t,e){var n=C/M[0].values.length*.9;return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-n/2+",0l"+n/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(t,e)))+"l"+n/2+",0l"+-n/2+",0z"})}),C}return C.highlightPoint=function(t,e){C.clearHighlights(),u.select(".nv-ohlcBar .nv-tick-0-"+t).classed("hover",e)},C.clearHighlights=function(){u.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},C.dispatch=A,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},forceX:{get:function(){return y},set:function(t){y=t}},forceY:{get:function(){return x},set:function(t){x=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return k},set:function(t){k=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return M},set:function(t){M=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return o},set:function(t){o.top=null!=t.top?t.top:o.top,o.right=null!=t.right?t.right:o.right,o.bottom=null!=t.bottom?t.bottom:o.bottom,o.left=null!=t.left?t.left:o.left}},color:{get:function(){return w},set:function(e){w=t.utils.getColor(e)}}}),t.utils.initOptions(C),C},t.models.parallelCoordinates=function(){"use strict";var e,n,r,i={top:30,right:0,bottom:10,left:0},o=null,a=null,s=null,l=null,u=d3.scale.ordinal(),c={},d="undefined values",f=[],p=[],h=[],g=!0,v=t.utils.defaultColor(),m=[],y=[],x=[],b=[],k=1,w=d3.svg.line(),M=d3.svg.axis(),A=d3.dispatch("brushstart","brush","brushEnd","dimensionsOrder","stateChange","elementClick","elementMouseover","elementMouseout","elementMousemove","renderEnd","activeChanged"),C=t.utils.renderWatch(A);function S(W){return C.reset(),W.each(function(C){var S=d3.select(this);if(s=t.utils.availableWidth(o,S,i),l=t.utils.availableHeight(a,S,i),t.utils.initSVG(S),void 0===C[0].values){var W=[];C.forEach(function(t){var e={};Object.keys(t).forEach(function(n){"name"!==n&&(e[n]=t[n])}),W.push({key:t.name,values:e})}),C=W}var E=C.map(function(t){return t.values});0===y.length&&(y=C),h=f.sort(function(t,e){return t.currentPosition-e.currentPosition}).map(function(t){return t.key}),p=f.filter(function(t){return!t.disabled}),u.rangePoints([0,s],1).domain(p.map(function(t){return t.key}));var F={},N=!1,D=[];h.forEach(function(t){var e=d3.extent(E,function(e){return+e[t]}),n=e[0],r=e[1],i=!1;(isNaN(n)||isNaN(r))&&(i=!0,n=0,r=0),n===r&&(n-=1,r+=1);var o=m.filter(function(e){return e.dimension==t});0!==o.length&&(i?(n=c[t].domain()[0],r=c[t].domain()[1]):!o[0].hasOnlyNaN&&g?(n=n>o[0].extent[0]?o[0].extent[0]:n,r=r0||N?(B.style("display","inline"),P.style("display","inline")):(B.style("display","none"),P.style("display","none"))),[u(e.key),c[e.key](t.values[e.key])]}))}function j(t){m.forEach(function(e){var n=c[e.dimension].brush.y().domain();e.hasOnlyNaN&&(e.extent[1]=(c[e.dimension].domain()[1]-n[0])*(e.extent[1]-e.extent[0])/(F[e.dimension]-e.extent[0])+n[0]),e.hasNaN&&(e.extent[0]=n[0]),t&&c[e.dimension].brush.extent(e.extent)}),r.select(".nv-brushBackground").each(function(t){d3.select(this).call(c[t.key].brush)}).selectAll("rect").attr("x",-8).attr("width",16),K()}function R(){!1===g&&(g=!0,j(!0))}function Z(){H=h.filter(function(t){return!c[t].brush.empty()}),Y=H.map(function(t){return c[t].brush.extent()}),m=[],H.forEach(function(t,e){m[e]={dimension:t,extent:Y[e],hasNaN:!1,hasOnlyNaN:!1}}),y=[],e.style("display",function(t){var e=H.every(function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||Y[n][0]!=c[e].brush.y().domain()[0])||Y[n][0]<=t.values[e]&&t.values[e]<=Y[n][1]&&!isNaN(parseFloat(t.values[e]))});return e&&y.push(t),e?null:"none"}),K(),A.brush({filters:m,active:y})}function q(){var t=H.length>0;m.forEach(function(t){t.extent[0]===c[t.dimension].brush.y().domain()[0]&&b.indexOf(t.dimension)>=0&&(t.hasNaN=!0),t.extent[1]c[t.key].domain()[0]&&(D[t.key]=[n[0].extent[1]]),n[0].extent[0]>=c[t.key].domain()[0]&&D[t.key].push(n[0].extent[0])),d3.select(this).call(M.scale(c[t.key]).tickFormat(t.format).tickValues(D[t.key]))})}function U(t){var e=x[t];return null==e?u(t):e}y=[],e.style("display",function(t){var e=H.every(function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||Y[n][0]!=c[e].brush.y().domain()[0])||Y[n][0]<=t.values[e]&&t.values[e]<=Y[n][1]&&!isNaN(parseFloat(t.values[e]))});return e&&y.push(t),e?null:"none"}),(m.length>0||!t.utils.arrayEquals(y,G))&&A.activeChanged(y)}),S}return S.dispatch=A,S.options=t.utils.optionsFunc.bind(S),S._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},dimensionData:{get:function(){return f},set:function(t){f=t}},displayBrush:{get:function(){return g},set:function(t){g=t}},filters:{get:function(){return m},set:function(t){m=t}},active:{get:function(){return y},set:function(t){y=t}},lineTension:{get:function(){return k},set:function(t){k=t}},undefinedValuesLabel:{get:function(){return d},set:function(t){d=t}},dimensions:{get:function(){return f.map(function(t){return t.key})},set:function(e){t.deprecated("dimensions","use dimensionData instead"),0===f.length?e.forEach(function(t){f.push({key:t})}):e.forEach(function(t,e){f[e].key=t})}},dimensionNames:{get:function(){return f.map(function(t){return t.key})},set:function(e){t.deprecated("dimensionNames","use dimensionData instead"),h=[],0===f.length?e.forEach(function(t){f.push({key:t})}):e.forEach(function(t,e){f[e].key=t})}},dimensionFormats:{get:function(){return f.map(function(t){return t.format})},set:function(e){t.deprecated("dimensionFormats","use dimensionData instead"),0===f.length?e.forEach(function(t){f.push({format:t})}):e.forEach(function(t,e){f[e].format=t})}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return v},set:function(e){v=t.utils.getColor(e)}}}),t.utils.initOptions(S),S},t.models.parallelCoordinatesChart=function(){"use strict";var e=t.models.parallelCoordinates(),n=t.models.legend(),r=t.models.tooltip(),i=(t.models.tooltip(),{top:0,right:0,bottom:0,left:0}),o=null,a=null,s=null,l=!0,u=t.utils.defaultColor(),c=t.utils.state(),d=[],f=!0,p=null,h=null,g="undefined",v=d3.dispatch("dimensionsOrder","brushEnd","stateChange","changeState","renderEnd"),m=t.utils.renderWatch(v),y=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},x=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};function b(r){return m.reset(),m.models(e),r.each(function(r){var u=d3.select(this);t.utils.initSVG(u);var h,g=t.utils.availableWidth(a,u,i),m=t.utils.availableHeight(s,u,i);if(b.update=function(){u.call(b)},b.container=this,c.setter(x(d),b.update).getter(y(d)).update(),c.disabled=d.map(function(t){return!!t.disabled}),(d=d.map(function(t){return t.disabled=!!t.disabled,t})).forEach(function(t,e){t.originalPosition=isNaN(t.originalPosition)?e:t.originalPosition,t.currentPosition=isNaN(t.currentPosition)?e:t.currentPosition}),!p)for(h in p={},c)c[h]instanceof Array?p[h]=c[h].slice(0):p[h]=c[h];if(!r||!r.length)return t.utils.noData(b,u),b;u.selectAll(".nv-noData").remove();var k=u.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").data([r]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinatesChart").append("g"),M=k.select("g");w.append("g").attr("class","nv-parallelCoordinatesWrap"),w.append("g").attr("class","nv-legendWrap"),M.select("rect").attr("width",g).attr("height",m>0?m:0),l?(n.width(g).color(function(t){return"rgb(188,190,192)"}),M.select(".nv-legendWrap").datum(d.sort(function(t,e){return t.originalPosition-e.originalPosition})).call(n),o||n.height()===i.top||(i.top=n.height(),m=t.utils.availableHeight(s,u,i)),k.select(".nv-legendWrap").attr("transform","translate( 0 ,"+-i.top+")")):M.select(".nv-legendWrap").selectAll("*").remove(),k.attr("transform","translate("+i.left+","+i.top+")"),e.width(g).height(m).dimensionData(d).displayBrush(f),M.select(".nv-parallelCoordinatesWrap ").datum(r).transition().call(e),e.dispatch.on("brushEnd",function(t,e){e?(f=!0,v.brushEnd(t)):f=!1}),n.dispatch.on("stateChange",function(t){for(var e in t)c[e]=t[e];v.stateChange(c),b.update()}),e.dispatch.on("dimensionsOrder",function(t){d.sort(function(t,e){return t.currentPosition-e.currentPosition});var e=!1;d.forEach(function(t,n){t.currentPosition=n,t.currentPosition!==t.originalPosition&&(e=!0)}),v.dimensionsOrder(d,e)}),v.on("changeState",function(t){void 0!==t.disabled&&(d.forEach(function(e,n){e.disabled=t.disabled[n]}),c.disabled=t.disabled),b.update()})}),m.renderEnd("parraleleCoordinateChart immediate"),b}return r.contentGenerator(function(t){var e='";return 0!==t.series.length&&(e+='',t.series.forEach(function(t){e=e+'"}),e+=""),e+="
'+t.key+"
'+t.key+''+t.value+"
"}),e.dispatch.on("elementMouseover.tooltip",function(t){var e={key:t.label,color:t.color,series:[]};t.values&&(Object.keys(t.values).forEach(function(n){var r,i=t.dimensions.filter(function(t){return t.key===n})[0];i&&(r=isNaN(t.values[n])||isNaN(parseFloat(t.values[n]))?g:i.format(t.values[n]),e.series.push({idx:i.currentPosition,key:n,value:r,color:i.color}))}),e.series.sort(function(t,e){return t.idx-e.idx})),r.data(e).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){r.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){r()}),b.dispatch=v,b.parallelCoordinates=e,b.legend=n,b.tooltip=r,b.options=t.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},defaultState:{get:function(){return p},set:function(t){p=t}},dimensionData:{get:function(){return d},set:function(t){d=t}},displayBrush:{get:function(){return f},set:function(t){f=t}},noData:{get:function(){return h},set:function(t){h=t}},nanValue:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,o=t.top),i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return u},set:function(r){u=t.utils.getColor(r),n.color(u),e.color(u)}}}),t.utils.inheritOptions(b,e),t.utils.initOptions(b),b},t.models.pie=function(){"use strict";var e={top:0,right:0,bottom:0,left:0},n=500,r=500,i=function(t){return t.x},o=function(t){return t.y},a=Math.floor(1e4*Math.random()),s=null,l=t.utils.defaultColor(),u=d3.format(",.2f"),c=!0,d=!1,f="key",p=.02,h=!1,g=!1,v=!1,m=!0,y=0,x=!1,b=!1,k=!1,w=!1,M=0,A=.5,C=250,S=[],W=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=[],F=[],N=t.utils.renderWatch(W);function D(O){return N.reset(),O.each(function(D){var O=n-e.left-e.right,_=r-e.top-e.bottom,L=Math.min(O,_)/2,B=[],P=[];if(s=d3.select(this),0===S.length)for(var T=L-L/10,I=A*L,z=0;z=p){var o=J(r);Q[o]&&(r[1]-=14),Q[J(r)]=!0}return"translate("+r+")"}),q.select(".nv-label text").style("text-anchor",function(t,e){return x?(t.startAngle+t.endAngle)/20;--t)u(s*=.99),p(),d(),l(s),p(),d();function l(t){function n(t){return(t.source.y+t.sy+t.dy/2)*t.value}e.forEach(function(e,r){e.forEach(function(e){if(e.targetLinks.length){var r=d3.sum(e.targetLinks,n)/d3.sum(e.targetLinks,f);e.y+=(r-c(e))*t}})})}function u(t){function n(t){return(t.target.y+t.ty+t.dy/2)*t.value}e.slice().reverse().forEach(function(e){e.forEach(function(e){if(e.sourceLinks.length){var r=d3.sum(e.sourceLinks,n)/d3.sum(e.sourceLinks,f);e.y+=(r-c(e))*t}})})}function p(){e.forEach(function(t){var e,n,o,a=0,s=t.length;for(t.sort(h),o=0;o0&&(e.y+=n),a=e.y+e.dy+r;if((n=a-r-i[1])>0)for(a=e.y-=n,o=s-2;o>=0;--o)e=t[o],(n=e.y+e.dy+r-a)>0&&(e.y-=n),a=e.y})}function h(t,e){return t.y-e.y}}(t)},u=function(){var t=.5;function e(e){var n=e.source.x+e.source.dx,r=e.target.x,i=d3.interpolateNumber(n,r),o=i(t),a=i(1-t),s=e.source.y+e.sy+e.dy/2,l=e.target.y+e.ty+e.dy/2;return"M"+n+","+s+"C"+o+","+s+" "+a+","+l+" "+r+","+l}return e.curvature=function(n){return arguments.length?(t=+n,e):t},e},c=function(t){return t.y+t.dy/2};function d(){function t(t,e){return t.source.y-e.source.y}function e(t,e){return t.target.y-e.target.y}o.forEach(function(n){n.sourceLinks.sort(e),n.targetLinks.sort(t)}),o.forEach(function(t){var e=0,n=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=n,n+=t.dy})})}function f(t){return t.value}return e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{nodeWidth:{get:function(){return n},set:function(t){n=+t}},nodePadding:{get:function(){return r},set:function(t){r=t}},nodes:{get:function(){return o},set:function(t){o=t}},links:{get:function(){return a},set:function(t){a=t}},size:{get:function(){return i},set:function(t){i=t}},sinksRight:{get:function(){return s},set:function(t){s=t}},layout:{get:function(){l(32)},set:function(t){l(t)}},relayout:{get:function(){d()},set:function(t){}},center:{get:function(){return c()},set:function(t){"function"==typeof t&&(c=t)}},link:{get:function(){return u()},set:function(t){return"function"==typeof t&&(u=t),u()}}}),t.utils.initOptions(e),e},t.models.sankeyChart=function(){"use strict";var e={top:5,right:0,bottom:5,left:0},n=t.models.sankey(),r=600,i=400,o=36,a=40,s="units",l=void 0,u=d3.format(",.0f"),c=function(t){return u(t)+" "+s},d=d3.scale.category20(),f=function(t){return t.source.name+" → "+t.target.name+"\n"+c(t.value)},p=function(t){return t.color=d(t.name.replace(/ .*/,""))},h=function(t){return d3.rgb(t.color).darker(2)},g=function(t){return t.name+"\n"+c(t.value)},v=function(t,e){t.append("text").attr("x",0).attr("y",0).attr("class","nvd3-sankey-chart-error").attr("text-anchor","middle").text(e)};function m(t){return t.each(function(e){var s={nodes:[{node:1,name:"Test 1"},{node:2,name:"Test 2"},{node:3,name:"Test 3"},{node:4,name:"Test 4"},{node:5,name:"Test 5"},{node:6,name:"Test 6"}],links:[{source:0,target:1,value:2295},{source:0,target:5,value:1199},{source:1,target:2,value:1119},{source:1,target:5,value:1176},{source:2,target:3,value:487},{source:2,target:5,value:632},{source:3,target:4,value:301},{source:3,target:5,value:186}]},u=!1,c=!1;if(("object"==typeof e.nodes&&e.nodes.length)>=0&&("object"==typeof e.links&&e.links.length)>=0&&(u=!0),e.nodes&&e.nodes.length>0&&e.links&&e.links.length>0&&(c=!0),!u)return console.error("NVD3 Sankey chart error:","invalid data format for",e),console.info("Valid data format is: ",s,JSON.stringify(s)),v(t,"Error loading chart, data is invalid"),!1;if(!c)return v(t,"No data available"),!1;var d=t.append("svg").attr("width",r).attr("height",i).append("g").attr("class","nvd3 nv-wrap nv-sankeyChart");n.nodeWidth(o).nodePadding(a).size([r,i]);var m=n.link();n.nodes(e.nodes).links(e.links).layout(32).center(l);var y=d.append("g").selectAll(".link").data(e.links).enter().append("path").attr("class","link").attr("d",m).style("stroke-width",function(t){return Math.max(1,t.dy)}).sort(function(t,e){return e.dy-t.dy});y.append("title").text(f);var x=d.append("g").selectAll(".node").data(e.nodes).enter().append("g").attr("class","node").attr("transform",function(t){return"translate("+t.x+","+t.y+")"}).call(d3.behavior.drag().origin(function(t){return t}).on("dragstart",function(){this.parentNode.appendChild(this)}).on("drag",function(t){d3.select(this).attr("transform","translate("+t.x+","+(t.y=Math.max(0,Math.min(i-t.dy,d3.event.y)))+")"),n.relayout(),y.attr("d",m)}));x.append("rect").attr("height",function(t){return t.dy}).attr("width",n.nodeWidth()).style("fill",p).style("stroke",h).append("title").text(g),x.append("text").attr("x",-6).attr("y",function(t){return t.dy/2}).attr("dy",".35em").attr("text-anchor","end").attr("transform",null).text(function(t){return t.name}).filter(function(t){return t.x0?$+20:0),ct.attr("clip-path",N?"url(#nv-edge-clip-"+h+")":""),R=!0;var ft=at.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key});ft.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),ft.exit().remove(),ft.attr("class",function(t,e){return(t.classed||"")+" nv-group nv-series-"+e}).classed("nv-noninteractive",!S).classed("hover",function(t){return t.hover}),ft.watchTransition(Z,"scatter: groups").style("fill",function(t,e){return f(t,e)}).style("stroke",function(t,e){return t.pointBorderColor||p||f(t,e)}).style("stroke-opacity",1).style("fill-opacity",.5);var pt=ft.selectAll("path.nv-point").data(function(t){return t.values.map(function(t,e){return[t,e]}).filter(function(t,e){return W(t[0],e)})});if(pt.enter().append("path").attr("class",function(t){return"nv-point nv-point-"+t[1]}).style("fill",function(t){return t.color}).style("stroke",function(t){return t.color}).attr("transform",function(r){return"translate("+t.utils.NaNtoZero(e(x(r[0],r[1])))+","+t.utils.NaNtoZero(n(b(r[0],r[1])))+")"}).attr("d",t.utils.symbol().type(function(t){return w(t[0])}).size(function(t){return y(k(t[0],t[1]))})),pt.exit().each(U).remove(),ft.exit().selectAll("path.nv-point").watchTransition(Z,"scatter exit").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(v(x(e[0],e[1])))+","+t.utils.NaNtoZero(m(b(e[0],e[1])))+")"}).remove(),pt.filter(function(t){return Q(t,"x",x,"y",b)||rt||it||ot}).watchTransition(Z,"scatter points").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(v(x(e[0],e[1])))+","+t.utils.NaNtoZero(m(b(e[0],e[1])))+")"}),pt.filter(function(t){return Q(t,"shape",w,"size",k)||rt||it||ot}).watchTransition(Z,"scatter points").attr("d",t.utils.symbol().type(function(t){return w(t[0])}).size(function(t){return y(k(t[0],t[1]))})),j){var ht=ft.selectAll(".nv-label").data(function(t){return t.values.map(function(t,e){return[t,e]}).filter(function(t,e){return W(t[0],e)})});ht.enter().append("text").style("fill",function(t,e){return t.color}).style("stroke-opacity",0).style("fill-opacity",1).attr("transform",function(r){return"translate("+(t.utils.NaNtoZero(e(x(r[0],r[1])))+Math.sqrt(y(k(r[0],r[1]))/Math.PI)+2)+","+t.utils.NaNtoZero(n(b(r[0],r[1])))+")"}).text(function(t,e){return t[0].label}),ht.exit().remove(),ft.exit().selectAll("path.nv-label").watchTransition(Z,"scatter exit").attr("transform",function(e){return"translate("+(t.utils.NaNtoZero(v(x(e[0],e[1])))+Math.sqrt(y(k(e[0],e[1]))/Math.PI)+2)+","+t.utils.NaNtoZero(m(b(e[0],e[1])))+")"}).remove(),ht.each(function(t){d3.select(this).classed("nv-label",!0).classed("nv-label-"+t[1],!1).classed("hover",!1)}),ht.watchTransition(Z,"scatter labels").attr("transform",function(e){return"translate("+(t.utils.NaNtoZero(v(x(e[0],e[1])))+Math.sqrt(y(k(e[0],e[1]))/Math.PI)+2)+","+t.utils.NaNtoZero(m(b(e[0],e[1])))+")"})}X?(clearTimeout(l),l=setTimeout(dt,X)):dt(),e=v.copy(),n=m.copy(),r=y.copy(),a=c,s=d}),Z.renderEnd("scatter immediate"),J}return J.dispatch=H,J.options=t.utils.optionsFunc.bind(J),J._calls=new function(){this.clearHighlights=function(){return t.dom.write(function(){g.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(e,n,r){t.dom.write(function(){g.select(".nv-groups").selectAll(".nv-series-"+e).selectAll(".nv-point-"+n).classed("hover",r)})}},H.on("elementMouseover.point",function(t){S&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!0)}),H.on("elementMouseout.point",function(t){S&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!1)}),J._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},xScale:{get:function(){return v},set:function(t){v=t}},yScale:{get:function(){return m},set:function(t){m=t}},pointScale:{get:function(){return y},set:function(t){y=t}},xDomain:{get:function(){return L},set:function(t){L=t}},yDomain:{get:function(){return B},set:function(t){B=t}},pointDomain:{get:function(){return I},set:function(t){I=t}},xRange:{get:function(){return P},set:function(t){P=t}},yRange:{get:function(){return T},set:function(t){T=t}},pointRange:{get:function(){return z},set:function(t){z=t}},forceX:{get:function(){return M},set:function(t){M=t}},forceY:{get:function(){return A},set:function(t){A=t}},forcePoint:{get:function(){return C},set:function(t){C=t}},interactive:{get:function(){return S},set:function(t){S=t}},pointActive:{get:function(){return W},set:function(t){W=t}},padDataOuter:{get:function(){return F},set:function(t){F=t}},padData:{get:function(){return E},set:function(t){E=t}},clipEdge:{get:function(){return N},set:function(t){N=t}},clipVoronoi:{get:function(){return D},set:function(t){D=t}},clipRadius:{get:function(){return _},set:function(t){_=t}},showVoronoi:{get:function(){return O},set:function(t){O=t}},id:{get:function(){return h},set:function(t){h=t}},interactiveUpdateDelay:{get:function(){return X},set:function(t){X=t}},showLabels:{get:function(){return j},set:function(t){j=t}},pointBorderColor:{get:function(){return p},set:function(t){p=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},pointSize:{get:function(){return k},set:function(t){k=d3.functor(t)}},pointShape:{get:function(){return w},set:function(t){w=d3.functor(t)}},margin:{get:function(){return u},set:function(t){u.top=void 0!==t.top?t.top:u.top,u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return G},set:function(t){G=t,Z.reset(G)}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e)}},useVoronoi:{get:function(){return Y},set:function(t){!1===(Y=t)&&(D=!1)}}}),t.utils.initOptions(J),J},t.models.scatterChart=function(){"use strict";var e=t.models.scatter(),n=t.models.axis(),r=t.models.axis(),i=t.models.legend(),o=t.models.distribution(),a=t.models.distribution(),s=t.models.tooltip(),l={top:30,right:20,bottom:50,left:75},u=null,c=null,d=null,f=null,p=t.utils.defaultColor(),h=e.xScale(),g=e.yScale(),v=!1,m=!1,y=!0,x=!0,b=!0,k=!1,w=t.utils.state(),M=null,A=d3.dispatch("stateChange","changeState","renderEnd"),C=null,S=250,W=!1;e.xScale(h).yScale(g),n.orient("bottom").tickPadding(10),r.orient(k?"right":"left").tickPadding(10),o.axis("x"),a.axis("y"),s.headerFormatter(function(t,e){return n.tickFormat()(t,e)}).valueFormatter(function(t,e){return r.tickFormat()(t,e)});var E=t.utils.renderWatch(A,S),F=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},N=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};function D(C){return E.reset(),E.models(e),x&&E.models(n),b&&E.models(r),v&&E.models(o),m&&E.models(a),C.each(function(C){f=d3.select(this),t.utils.initSVG(f);var O,_=t.utils.availableWidth(c,f,l),L=t.utils.availableHeight(d,f,l);if(D.update=function(){0===S?f.call(D):f.transition().duration(S).call(D)},D.container=this,w.setter(N(C),D.update).getter(F(C)).update(),w.disabled=C.map(function(t){return!!t.disabled}),!M)for(O in M={},w)w[O]instanceof Array?M[O]=w[O].slice(0):M[O]=w[O];if(!(C&&C.length&&C.filter(function(t){return t.values.length}).length))return t.utils.noData(D,f),E.renderEnd("scatter immediate"),D;f.selectAll(".nv-noData").remove(),h=e.xScale(),g=e.yScale();var B=f.selectAll("g.nv-wrap.nv-scatterChart").data([C]),P=B.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+e.id()).append("g"),T=B.select("g");if(P.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),P.append("g").attr("class","nv-x nv-axis"),P.append("g").attr("class","nv-y nv-axis"),P.append("g").attr("class","nv-scatterWrap"),P.append("g").attr("class","nv-regressionLinesWrap"),P.append("g").attr("class","nv-distWrap"),P.append("g").attr("class","nv-legendWrap"),k&&T.select(".nv-y.nv-axis").attr("transform","translate("+_+",0)"),y){var I=_;i.width(I),B.select(".nv-legendWrap").datum(C).call(i),u||i.height()===l.top||(l.top=i.height(),L=t.utils.availableHeight(d,f,l)),B.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")}else T.select(".nv-legendWrap").selectAll("*").remove();B.attr("transform","translate("+l.left+","+l.top+")"),e.width(_).height(L).color(C.map(function(t,e){return t.color=t.color||p(t,e),t.color}).filter(function(t,e){return!C[e].disabled})).showLabels(W),B.select(".nv-scatterWrap").datum(C.filter(function(t){return!t.disabled})).call(e),B.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+e.id()+")");var z=B.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(t){return t});z.enter().append("g").attr("class","nv-regLines");var V=z.selectAll(".nv-regLine").data(function(t){return[t]});V.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),V.filter(function(t){return t.intercept&&t.slope}).watchTransition(E,"scatterPlusLineChart: regline").attr("x1",h.range()[0]).attr("x2",h.range()[1]).attr("y1",function(t,e){return g(h.domain()[0]*t.slope+t.intercept)}).attr("y2",function(t,e){return g(h.domain()[1]*t.slope+t.intercept)}).style("stroke",function(t,e,n){return p(t,n)}).style("stroke-opacity",function(t,e){return t.disabled||void 0===t.slope||void 0===t.intercept?0:1}),x&&(n.scale(h)._ticks(t.utils.calcTicksX(_/100,C)).tickSize(-L,0),T.select(".nv-x.nv-axis").attr("transform","translate(0,"+g.range()[0]+")").call(n)),b&&(r.scale(g)._ticks(t.utils.calcTicksY(L/36,C)).tickSize(-_,0),T.select(".nv-y.nv-axis").call(r)),v&&(o.getData(e.x()).scale(h).width(_).color(C.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!C[e].disabled})),P.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),T.select(".nv-distributionX").attr("transform","translate(0,"+g.range()[0]+")").datum(C.filter(function(t){return!t.disabled})).call(o)),m&&(a.getData(e.y()).scale(g).width(L).color(C.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!C[e].disabled})),P.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),T.select(".nv-distributionY").attr("transform","translate("+(k?_:-a.size())+",0)").datum(C.filter(function(t){return!t.disabled})).call(a)),i.dispatch.on("stateChange",function(t){for(var e in t)w[e]=t[e];A.stateChange(w),D.update()}),A.on("changeState",function(t){void 0!==t.disabled&&(C.forEach(function(e,n){e.disabled=t.disabled[n]}),w.disabled=t.disabled),D.update()}),e.dispatch.on("elementMouseout.tooltip",function(t){s.hidden(!0),f.select(".nv-chart-"+e.id()+" .nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",0),f.select(".nv-chart-"+e.id()+" .nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",a.size())}),e.dispatch.on("elementMouseover.tooltip",function(t){f.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.relativePos[1]-L),f.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.relativePos[0]+o.size()),s.data(t).hidden(!1)}),h.copy(),g.copy()}),E.renderEnd("scatter with line immediate"),D}return D.dispatch=A,D.scatter=e,D.legend=i,D.xAxis=n,D.yAxis=r,D.distX=o,D.distY=a,D.tooltip=s,D.options=t.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},container:{get:function(){return f},set:function(t){f=t}},showDistX:{get:function(){return v},set:function(t){v=t}},showDistY:{get:function(){return m},set:function(t){m=t}},showLegend:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return M},set:function(t){M=t}},noData:{get:function(){return C},set:function(t){C=t}},duration:{get:function(){return S},set:function(t){S=t}},showLabels:{get:function(){return W},set:function(t){W=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,r.orient(t?"right":"left")}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),i.color(p),o.color(p),a.color(p)}}}),t.utils.inheritOptions(D,e),t.utils.initOptions(D),D},t.models.sparkline=function(){"use strict";var e,n,r,i,o={top:2,right:0,bottom:2,left:0},a=400,s=32,l=null,u=!0,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=t.utils.getColor(["#000"]),g=!0,v=!0,m=d3.dispatch("renderEnd"),y=t.utils.renderWatch(m);function x(u){return y.reset(),u.each(function(u){var m=a-o.left-o.right,y=s-o.top-o.bottom;l=d3.select(this),t.utils.initSVG(l),c.domain(e||d3.extent(u,f)).range(r||[0,m]),d.domain(n||d3.extent(u,p)).range(i||[y,0]);var x=l.selectAll("g.nv-wrap.nv-sparkline").data([u]);x.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline").append("g"),x.select("g");x.attr("transform","translate("+o.left+","+o.top+")");var b=x.selectAll("path").data(function(t){return[t]});b.enter().append("path"),b.exit().remove(),b.style("stroke",function(t,e){return t.color||h(t,e)}).attr("d",d3.svg.line().x(function(t,e){return c(f(t,e))}).y(function(t,e){return d(p(t,e))}));var k=x.selectAll("circle.nv-point").data(function(t){var e=t.map(function(t,e){return p(t,e)});function n(e){if(-1!=e){var n=t[e];return n.pointIndex=e,n}return null}var r=n(e.lastIndexOf(d.domain()[1])),i=n(e.indexOf(d.domain()[0])),o=n(e.length-1);return[g?i:null,g?r:null,v?o:null].filter(function(t){return null!=t})});k.enter().append("circle"),k.exit().remove(),k.attr("cx",function(t,e){return c(f(t,t.pointIndex))}).attr("cy",function(t,e){return d(p(t,t.pointIndex))}).attr("r",2).attr("class",function(t,e){return f(t,t.pointIndex)==c.domain()[1]?"nv-point nv-currentValue":p(t,t.pointIndex)==d.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),y.renderEnd("sparkline immediate"),x}return x.options=t.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},animate:{get:function(){return u},set:function(t){u=t}},showMinMaxPoints:{get:function(){return g},set:function(t){g=t}},showCurrentPoint:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=d3.functor(t)}},y:{get:function(){return p},set:function(t){p=d3.functor(t)}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return h},set:function(e){h=t.utils.getColor(e)}}}),x.dispatch=m,t.utils.initOptions(x),x},t.models.sparklinePlus=function(){"use strict";var e,n,r=t.models.sparkline(),i={top:15,right:100,bottom:10,left:50},o=null,a=null,s=[],l=!1,u=d3.format(",r"),c=d3.format(",.2f"),d=!0,f=!0,p=!1,h=null,g=d3.dispatch("renderEnd"),v=t.utils.renderWatch(g);function m(h){return v.reset(),v.models(r),h.each(function(h){var g=d3.select(this);t.utils.initSVG(g);var v=t.utils.availableWidth(o,g,i),y=t.utils.availableHeight(a,g,i);if(m.update=function(){g.call(m)},m.container=this,!h||!h.length)return t.utils.noData(m,g),m;g.selectAll(".nv-noData").remove();var x=r.y()(h[h.length-1],h.length-1);e=r.xScale(),n=r.yScale();var b=g.selectAll("g.nv-wrap.nv-sparklineplus").data([h]),k=b.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus").append("g"),w=b.select("g");k.append("g").attr("class","nv-sparklineWrap"),k.append("g").attr("class","nv-valueWrap"),k.append("g").attr("class","nv-hoverArea"),b.attr("transform","translate("+i.left+","+i.top+")");var M=w.select(".nv-sparklineWrap");if(r.width(v).height(y),M.call(r),d){var A=w.select(".nv-valueWrap").selectAll(".nv-currentValue").data([x]);A.enter().append("text").attr("class","nv-currentValue").attr("dx",p?-8:8).attr("dy",".9em").style("text-anchor",p?"end":"start"),A.attr("x",v+(p?i.right:0)).attr("y",f?function(t){return n(t)}:0).style("fill",r.color()(h[h.length-1],h.length-1)).text(c(x))}function C(){if(!l){var t=w.selectAll(".nv-hoverValue").data(s),n=t.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);t.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),t.attr("transform",function(t){return"translate("+e(r.x()(h[t],t))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),s.length&&(n.append("line").attr("x1",0).attr("y1",-i.top).attr("x2",0).attr("y2",y),n.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-i.top).attr("text-anchor","end").attr("dy",".9em"),w.select(".nv-hoverValue .nv-xValue").text(u(r.x()(h[s[0]],s[0]))),n.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-i.top).attr("text-anchor","start").attr("dy",".9em"),w.select(".nv-hoverValue .nv-yValue").text(c(r.y()(h[s[0]],s[0]))))}}k.select(".nv-hoverArea").append("rect").on("mousemove",function(){if(l)return;var t=d3.mouse(this)[0]-i.left;s=[function(t,e){for(var n=Math.abs(r.x()(t[0],0)-e),i=0,o=0;o=t[0]&&r.x()(e,n)<=t[1]}),disableTooltip:e.disableTooltip}})).transition().duration(_).call(r),tt(),et()}r.dispatch.on("areaClick.toggle",function(t){1===u.filter(function(t){return!t.disabled}).length?u.forEach(function(t){t.disabled=!1}):u.forEach(function(e,n){e.disabled=n!=t.seriesIndex}),S.disabled=u.map(function(t){return!!t.disabled}),F.stateChange(S),V.update()}),a.dispatch.on("stateChange",function(t){for(var e in t)S[e]=t[e];F.stateChange(S),V.update()}),s.dispatch.on("legendClick",function(t,e){t.disabled&&(U=U.map(function(t){return t.disabled=!0,t}),t.disabled=!1,r.style(t.style),S.style=r.style(),F.stateChange(S),V.update())}),l.dispatch.on("elementMousemove",function(e){r.clearHighlights();var n,i,o,a=[],s=0,c=!0,d=!1;if(u.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(l,f){i=t.interactiveBisect(l.values,e.pointXValue,V.x());var p=l.values[i],h=V.y()(p,i);if(null!=h&&h>0&&(r.highlightPoint(f,i,!0),d=!0),f!==u.length-1||d||r.highlightPoint(f,i,!0),void 0!==p){void 0===n&&(n=p),void 0===o&&(o=V.xScale()(V.x()(p,i)));var v="expand"==r.style()?p.display.y:V.y()(p,i);a.push({key:l.key,value:v,color:g(l,l.seriesIndex),point:p}),A&&"expand"!=r.style()&&null!=v&&(s+=v,c=!1)}}),a.reverse(),a.length>2){var f=V.yScale().invert(e.mouseY),p=null;a.forEach(function(t,e){f=Math.abs(f);var n=Math.abs(t.point.display.y0),r=Math.abs(t.point.display.y);f>=n&&f<=r+n&&(p=e)}),null!=p&&(a[p].highlight=!0)}A&&"expand"!=r.style()&&a.length>=2&&!c&&a.push({key:C,value:s,total:!0});var h=V.x()(n,i),v=l.tooltip.valueFormatter();"expand"===r.style()||"stack_percent"===r.style()?(B||(B=v),v=d3.format(".1%")):B&&(v=B,B=null),l.tooltip.valueFormatter(v).data({value:h,series:a})(),l.renderGuideLine(o)}),l.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),c.dispatch.on("onBrush",function(t){rt(t)}),F.on("changeState",function(t){void 0!==t.disabled&&u.length===t.disabled.length&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),S.disabled=t.disabled),void 0!==t.style&&(r.style(t.style),t.style),V.update()})}),P.renderEnd("stacked Area chart immediate"),V}return r.dispatch.on("elementMouseover.tooltip",function(t){t.point.x=r.x()(t.point),t.point.y=r.y()(t.point),u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),V.dispatch=F,V.stacked=r,V.legend=a,V.controls=s,V.xAxis=i,V.x2Axis=c.xAxis,V.yAxis=o,V.y2Axis=c.yAxis,V.interactiveLayer=l,V.tooltip=u,V.focus=c,V.dispatch=F,V.options=t.utils.optionsFunc.bind(V),V._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return W},set:function(t){W=t}},noData:{get:function(){return E},set:function(t){E=t}},showControls:{get:function(){return v},set:function(t){v=t}},controlLabels:{get:function(){return O},set:function(t){O=t}},controlOptions:{get:function(){return D},set:function(t){D=t}},showTotalInTooltip:{get:function(){return A},set:function(t){A=t}},totalLabel:{get:function(){return C},set:function(t){C=t}},focusEnable:{get:function(){return w},set:function(t){w=t}},focusHeight:{get:function(){return c.height()},set:function(t){c.height(t)}},brushExtent:{get:function(){return c.brushExtent()},set:function(t){c.brushExtent(t)}},margin:{get:function(){return d},set:function(t){void 0!==t.top&&(d.top=t.top,f=t.top),d.right=void 0!==t.right?t.right:d.right,d.bottom=void 0!==t.bottom?t.bottom:d.bottom,d.left=void 0!==t.left?t.left:d.left}},focusMargin:{get:function(){return c.margin},set:function(t){c.margin.top=void 0!==t.top?t.top:c.margin.top,c.margin.right=void 0!==t.right?t.right:c.margin.right,c.margin.bottom=void 0!==t.bottom?t.bottom:c.margin.bottom,c.margin.left=void 0!==t.left?t.left:c.margin.left}},duration:{get:function(){return _},set:function(t){_=t,P.reset(_),r.duration(_),i.duration(_),o.duration(_)}},color:{get:function(){return g},set:function(e){g=t.utils.getColor(e),a.color(g),r.color(g),c.color(g)}},x:{get:function(){return r.x()},set:function(t){r.x(t),c.x(t)}},y:{get:function(){return r.y()},set:function(t){r.y(t),c.y(t)}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,o.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return M},set:function(t){M=!!t,V.interactive(!t),V.useVoronoi(!t),r.scatter.interactive(!t)}}}),t.utils.inheritOptions(V,r),t.utils.initOptions(V),V},t.models.stackedAreaWithFocusChart=function(){return t.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},t.models.sunburst=function(){"use strict";var e,n,r,i,o={top:0,right:0,bottom:0,left:0},a=600,s=600,l="count",u={count:function(t){return 1},value:function(t){return t.value||t.size},size:function(t){return t.value||t.size}},c=Math.floor(1e4*Math.random()),d=null,f=t.utils.defaultColor(),p=!1,h=function(t){return"count"===l?t.name+" #"+t.value:t.name+" "+(t.value||t.size)},g=.02,v=function(t,e){return t.name>e.name},m=function(t,e){return void 0!==t.parent?t.name+"-"+t.parent.name+"-"+e:t.name},y=!0,x=500,b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),k=d3.scale.linear().range([0,2*Math.PI]),w=d3.scale.sqrt(),M=d3.layout.partition().sort(v),A={},C=d3.svg.arc().startAngle(function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x)))}).endAngle(function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))}).innerRadius(function(t){return Math.max(0,w(t.y))}).outerRadius(function(t){return Math.max(0,w(t.y+t.dy))});function S(t){return W(t)>90?180:0}function W(t){return(Math.max(0,Math.min(2*Math.PI,k(t.x)))+Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx))))/2*(180/Math.PI)-90}function E(t){var e=Math.max(0,Math.min(2*Math.PI,k(t.x)));return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))-e>g}function F(t,n){var r=d3.interpolate(k.domain(),[e.x,e.x+e.dx]),o=d3.interpolate(w.domain(),[e.y,1]),a=d3.interpolate(w.range(),[e.y?20:0,i]);return 0===n?function(){return C(t)}:function(e){return k.domain(r(e)),w.domain(o(e)).range(a(e)),C(t)}}function N(t){var e=d3.interpolate({x:t.x0,dx:t.dx0,y:t.y0,dy:t.dy0},t);return function(n){var r=e(n);return t.x0=r.x,t.dx0=r.dx,t.y0=r.y,t.dy0=r.dy,C(r)}}function D(t){t.forEach(function(t){var e=m(t),n=A[e];n?(t.dx0=n.dx,t.x0=n.x,t.dy0=n.dy,t.y0=n.y):(t.dx0=t.dx,t.x0=t.x,t.dy0=t.dy,t.y0=t.y),function(t){var e=m(t);A[e]||(A[e]={});var n=A[e];n.dx=t.dx,n.x=t.x,n.dy=t.dy,n.y=t.y}(t)})}function O(t){var n=d.selectAll("text"),r=d.selectAll("path");n.transition().attr("opacity",0),e=t,r.transition().duration(x).attrTween("d",F).each("end",function(e){e.x>=t.x&&e.x=t.depth&&d3.select(this.parentNode).select("text").transition().duration(x).text(function(t){return h(t)}).attr("opacity",function(t){return E(t)?1:0}).attr("transform",function(){var n=this.getBBox().width;if(0===e.depth)return"translate("+n/2*-1+",0)";if(e.depth===t.depth)return"translate("+(w(e.y)+5)+",0)";var r=W(e),i=S(e);return 0===i?"rotate("+r+")translate("+(w(e.y)+5)+",0)":"rotate("+r+")translate("+(w(e.y)+n+5)+",0)rotate("+i+")"}))})}var _=t.utils.renderWatch(b);function L(e){return _.reset(),e.each(function(e){d=d3.select(this),n=t.utils.availableWidth(a,d,o),r=t.utils.availableHeight(s,d,o),i=Math.min(n,r)/2,w.range([0,i]);var g=d.select("g.nvd3.nv-wrap.nv-sunburst");g[0][0]?g.attr("transform","translate("+(n/2+o.left+o.right)+","+(r/2+o.top+o.bottom)+")"):g=d.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+c).attr("transform","translate("+(n/2+o.left+o.right)+","+(r/2+o.top+o.bottom)+")"),d.on("click",function(t,e){b.chartClick({data:t,index:e,pos:d3.event,id:c})}),M.value(u[l]||u.count);var v=M.nodes(e[0]).reverse();D(v);var F=g.selectAll(".arc-container").data(v,m);F.enter().append("g").attr("class","arc-container").append("path").attr("d",C).style("fill",function(t){return t.color?t.color:f(y?(t.children?t:t.parent).name:t.name)}).style("stroke","#FFF").on("click",function(t,e){O(t),b.elementClick({data:t,index:e})}).on("mouseover",function(t,e){d3.select(this).classed("hover",!0).style("opacity",.8),b.elementMouseover({data:t,color:d3.select(this).style("fill"),percent:function(t){var e=Math.max(0,Math.min(2*Math.PI,k(t.x)));return(Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))-e)/(2*Math.PI)}(t)})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1).style("opacity",1),b.elementMouseout({data:t})}).on("mousemove",function(t,e){b.elementMousemove({data:t})}),F.each(function(t){d3.select(this).select("path").transition().duration(x).attrTween("d",N)}),p&&(F.selectAll("text").remove(),F.append("text").text(function(t){return h(t)}).transition().duration(x).attr("opacity",function(t){return E(t)?1:0}).attr("transform",function(t){var e=this.getBBox().width;if(0===t.depth)return"rotate(0)translate("+e/2*-1+",0)";var n=W(t),r=S(t);return 0===r?"rotate("+n+")translate("+(w(t.y)+5)+",0)":"rotate("+n+")translate("+(w(t.y)+e+5)+",0)rotate("+r+")"})),O(v[v.length-1]),F.exit().transition().duration(x).attr("opacity",0).each("end",function(t){var e=m(t);A[e]=void 0}).remove()}),_.renderEnd("sunburst immediate"),L}return L.dispatch=b,L.options=t.utils.optionsFunc.bind(L),L._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},mode:{get:function(){return l},set:function(t){l=t}},id:{get:function(){return c},set:function(t){c=t}},duration:{get:function(){return x},set:function(t){x=t}},groupColorByParent:{get:function(){return y},set:function(t){y=!!t}},showLabels:{get:function(){return p},set:function(t){p=!!t}},labelFormat:{get:function(){return h},set:function(t){h=t}},labelThreshold:{get:function(){return g},set:function(t){g=t}},sort:{get:function(){return v},set:function(t){v=t}},key:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return o},set:function(t){o.top=null!=t.top?t.top:o.top,o.right=null!=t.right?t.right:o.right,o.bottom=null!=t.bottom?t.bottom:o.bottom,o.left=null!=t.left?t.left:o.left}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e)}}}),t.utils.initOptions(L),L},t.models.sunburstChart=function(){"use strict";var e=t.models.sunburst(),n=t.models.tooltip(),r={top:30,right:20,bottom:20,left:20},i=null,o=null,a=t.utils.defaultColor(),s=!1,l=(Math.round(1e5*Math.random()),null),u=null,c=250,d=d3.dispatch("stateChange","changeState","renderEnd"),f=t.utils.renderWatch(d);function p(n){return f.reset(),f.models(e),n.each(function(n){var a=d3.select(this);t.utils.initSVG(a);var s=t.utils.availableWidth(i,a,r),l=t.utils.availableHeight(o,a,r);if(p.update=function(){0===c?a.call(p):a.transition().duration(c).call(p)},p.container=a,!n||!n.length)return t.utils.noData(p,a),p;a.selectAll(".nv-noData").remove(),e.width(s).height(l).margin(r),a.call(e)}),f.renderEnd("sunburstChart immediate"),p}return n.duration(0).headerEnabled(!1).valueFormatter(function(t){return t}),e.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:t.data.name,value:t.data.value||t.data.size,color:t.color,percent:t.percent},s||(delete t.percent,delete t.series.percent),n.data(t).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){n.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(t){n()}),p.dispatch=d,p.sunburst=e,p.tooltip=n,p.options=t.utils.optionsFunc.bind(p),p._options=Object.create({},{noData:{get:function(){return u},set:function(t){u=t}},defaultState:{get:function(){return l},set:function(t){l=t}},showTooltipPercent:{get:function(){return s},set:function(t){s=t}},color:{get:function(){return a},set:function(t){a=t,e.color(a)}},duration:{get:function(){return c},set:function(t){c=t,f.reset(c),e.duration(c)}},margin:{get:function(){return r},set:function(t){r.top=void 0!==t.top?t.top:r.top,r.right=void 0!==t.right?t.right:r.right,r.bottom=void 0!==t.bottom?t.bottom:r.bottom,r.left=void 0!==t.left?t.left:r.left,e.margin(r)}}}),t.utils.inheritOptions(p,e),t.utils.initOptions(p),p},t.version="1.8.6"}(); -},{"d3":5}],6:[function(require,module,exports) { -(function(){var n=this,r=n._,t=Array.prototype,e=Object.prototype,u=Function.prototype,i=t.push,o=t.slice,a=e.toString,c=e.hasOwnProperty,f=Array.isArray,l=Object.keys,s=u.bind,p=Object.create,h=function(){},v=function(n){return n instanceof v?n:this instanceof v?void(this._wrapped=n):new v(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=v),exports._=v):n._=v,v.VERSION="1.8.3";var y=function(n,r,t){if(void 0===r)return n;switch(null==t?3:t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,i){return n.call(r,t,e,u,i)}}return function(){return n.apply(r,arguments)}},d=function(n,r,t){return null==n?v.identity:v.isFunction(n)?y(n,r,t):v.isObject(n)?v.matcher(n):v.property(n)};v.iteratee=function(n,r){return d(n,r,1/0)};var g=function(n,r){return function(t){var e=arguments.length;if(e<2||null==t)return t;for(var u=1;u=0&&r<=x};function w(n){return function(r,t,e,u){t=y(t,u,4);var i=!j(r)&&v.keys(r),o=(i||r).length,a=n>0?0:o-1;return arguments.length<3&&(e=r[i?i[a]:a],a+=n),function(r,t,e,u,i,o){for(;i>=0&&i=0},v.invoke=function(n,r){var t=o.call(arguments,2),e=v.isFunction(r);return v.map(n,function(n){var u=e?r:n[r];return null==u?u:u.apply(n,t)})},v.pluck=function(n,r){return v.map(n,v.property(r))},v.where=function(n,r){return v.filter(n,v.matcher(r))},v.findWhere=function(n,r){return v.find(n,v.matcher(r))},v.max=function(n,r,t){var e,u,i=-1/0,o=-1/0;if(null==r&&null!=n)for(var a=0,c=(n=j(n)?n:v.values(n)).length;ai&&(i=e);else r=d(r,t),v.each(n,function(n,t,e){((u=r(n,t,e))>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},v.min=function(n,r,t){var e,u,i=1/0,o=1/0;if(null==r&&null!=n)for(var a=0,c=(n=j(n)?n:v.values(n)).length;ae||void 0===t)return 1;if(t0?0:u-1;i>=0&&i0?a=i>=0?i:Math.max(i+c,a):c=i>=0?Math.min(i+1,c):i+c+1;else if(t&&i&&c)return e[i=t(e,u)]===u?i:-1;if(u!=u)return(i=r(o.call(e,a,c),v.isNaN))>=0?i+a:-1;for(i=n>0?a:c-1;i>=0&&ir?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||!1===t.trailing||(o=setTimeout(c,l)),i}},v.debounce=function(n,r,t){var e,u,i,o,a,c=function(){var f=v.now()-o;f=0?e=setTimeout(c,r-f):(e=null,t||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=v.now();var f=t&&!e;return e||(e=setTimeout(c,r)),f&&(a=n.apply(i,u),i=u=null),a}},v.wrap=function(n,r){return v.partial(r,n)},v.negate=function(n){return function(){return!n.apply(this,arguments)}},v.compose=function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},v.after=function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},v.before=function(n,r){var t;return function(){return--n>0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}},v.once=v.partial(v.before,2);var E=!{toString:null}.propertyIsEnumerable("toString"),M=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function I(n,r){var t=M.length,u=n.constructor,i=v.isFunction(u)&&u.prototype||e,o="constructor";for(v.has(n,o)&&!v.contains(r,o)&&r.push(o);t--;)(o=M[t])in n&&n[o]!==i[o]&&!v.contains(r,o)&&r.push(o)}v.keys=function(n){if(!v.isObject(n))return[];if(l)return l(n);var r=[];for(var t in n)v.has(n,t)&&r.push(t);return E&&I(n,r),r},v.allKeys=function(n){if(!v.isObject(n))return[];var r=[];for(var t in n)r.push(t);return E&&I(n,r),r},v.values=function(n){for(var r=v.keys(n),t=r.length,e=Array(t),u=0;u":">",'"':""","'":"'","`":"`"},T=v.invert(B),R=function(n){var r=function(r){return n[r]},t="(?:"+v.keys(n).join("|")+")",e=RegExp(t),u=RegExp(t,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,r):n}};v.escape=R(B),v.unescape=R(T),v.result=function(n,r,t){var e=null==n?void 0:n[r];return void 0===e&&(e=t),v.isFunction(e)?e.call(n):e};var q=0;v.uniqueId=function(n){var r=++q+"";return n?n+r:r},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};v.template=function(n,r,t){!r&&t&&(r=t),r=v.defaults({},r,v.templateSettings);var e=RegExp([(r.escape||K).source,(r.interpolate||K).source,(r.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(r,t,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+r.length,t?i+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),r}),i+="';\n",r.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(r.variable||"obj","_",i)}catch(n){throw n.source=i,n}var a=function(n){return o.call(this,n,v)},c=r.variable||"obj";return a.source="function("+c+"){\n"+i+"}",a},v.chain=function(n){var r=v(n);return r._chain=!0,r};var P=function(n,r){return n._chain?v(r).chain():r};v.mixin=function(n){v.each(v.functions(n),function(r){var t=v[r]=n[r];v.prototype[r]=function(){var n=[this._wrapped];return i.apply(n,arguments),P(this,t.apply(v,n))}})},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var r=t[n];v.prototype[n]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==n&&"splice"!==n||0!==t.length||delete t[0],P(this,t)}}),v.each(["concat","join","slice"],function(n){var r=t[n];v.prototype[n]=function(){return P(this,r.apply(this._wrapped,arguments))}}),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return v})}).call(this); -},{}],3:[function(require,module,exports) { +require=function(r,e,n){function t(n,o){function i(r){return t(i.resolve(r))}function f(e){return r[n][1][e]||e}if(!e[n]){if(!r[n]){var c="function"==typeof require&&require;if(!o&&c)return c(n,!0);if(u)return u(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}i.resolve=f;var a=e[n]=new t.Module;r[n][0].call(a.exports,i,a,a.exports)}return e[n].exports}function o(){this.bundle=t,this.exports={}}var u="function"==typeof require&&require;t.Module=o,t.modules=r,t.cache=e,t.parent=u;for(var i=0;it?1:n>=t?0:NaN}function h(n){return null===n?NaN:+n}function p(n){return!isNaN(n)}function g(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}n.ascending=s,n.descending=function(n,t){return tn?1:t>=n?0:NaN},n.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ir&&(e=r)}else{for(;++i=r){e=r;break}for(;++ir&&(e=r)}return e},n.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ie&&(e=r)}else{for(;++i=r){e=r;break}for(;++ie&&(e=r)}return e},n.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u=r){e=i=r;break}for(;++ur&&(e=r),i=r){e=i=r;break}for(;++ur&&(e=r),i1)return o/(l-1)},n.deviation=function(){var t=n.variance.apply(this,arguments);return t?Math.sqrt(t):t};var v=g(s);function d(n){return n.length}n.bisectLeft=v.left,n.bisect=n.bisectRight=v.right,n.bisector=function(n){return g(1===n.length?function(t,e){return s(n(t),e)}:n)},n.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,u<2&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},n.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},n.pairs=function(n){for(var t=0,e=n.length-1,r=n[0],i=new Array(e<0?0:e);t=0;)for(t=(r=n[i]).length;--t>=0;)e[--o]=r[t];return e};var y=Math.abs;function m(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function M(){this._=Object.create(null)}n.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e==1/0)throw new Error("infinite range");var r,i=[],u=function(n){var t=1;for(;n*t%1;)t*=10;return t}(y(e)),o=-1;if(n*=u,t*=u,(e*=u)<0)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)=i.length)return e?e.call(r,u):t?u.sort(t):u;for(var l,c,f,s,h=-1,p=u.length,g=i[a++],v=new M;++h=i.length)return t;var r=[],o=u[e++];return t.forEach(function(t,i){r.push({key:t,values:n(i,e)})}),o?r.sort(function(n,t){return o(n.key,t.key)}):r}(o(n.map,t,0),0)},r.key=function(n){return i.push(n),r},r.sortKeys=function(n){return u[i.length-1]=n,r},r.sortValues=function(n){return t=n,r},r.rollup=function(n){return e=n,r},r},n.set=function(n){var t=new C;if(n)for(var e=0,r=n.length;e=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},n.event=null,n.requote=function(n){return n.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,O={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]};function I(n){return O(n,X),n}var Y=function(n,t){return t.querySelector(n)},Z=function(n,t){return t.querySelectorAll(n)},V=function(n,t){var e=n.matches||n[q(n,"matchesSelector")];return(V=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(Y=function(n,t){return Sizzle(n,t)[0]||null},Z=Sizzle,V=Sizzle.matchesSelector),n.selection=function(){return n.select(r.documentElement)};var X=n.selection.prototype=[];function $(n){return"function"==typeof n?n:function(){return Y(n,this)}}function B(n){return"function"==typeof n?n:function(){return Z(n,this)}}X.select=function(n){var t,e,r,i,u=[];n=$(n);for(var o=-1,a=this.length;++o=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),J.hasOwnProperty(e)?{space:J[e],local:n}:n}},X.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=n.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(G(e,t[e]));return this}return this.each(G(t,e))},X.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=nn(n)).length,i=-1;if(t=e.classList){for(;++i=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},X.sort=function(n){n=function(n){arguments.length||(n=s);return function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}.apply(this,arguments);for(var t=-1,e=this.length;++t0&&(t=t.slice(0,o));var l=gn.get(t);function c(){var n=this[u];n&&(this.removeEventListener(t,n,n.$),delete this[u])}return l&&(t=l,a=dn),o?r?function(){var n=a(r,e(arguments));c.call(this),this.addEventListener(t,this[u]=n,n.$=i),n._=r}:c:r?R:function(){var e,r=new RegExp("^__on([^.]+)"+n.requote(t)+"$");for(var i in this)if(e=i.match(r)){var u=this[i];this.removeEventListener(e[1],u,u.$),delete this[i]}}}n.selection.enter=sn,n.selection.enter.prototype=hn,hn.append=X.append,hn.empty=X.empty,hn.node=X.node,hn.call=X.call,hn.size=X.size,hn.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++a=r&&(r=t+1);!(o=a[r])&&++r0?1:n<0?-1:0}function qn(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function Tn(n){return n>1?0:n<-1?kn:Math.acos(n)}function Rn(n){return n>1?An:n<-1?-An:Math.asin(n)}function Dn(n){return((n=Math.exp(n))+1/n)/2}function Pn(n){return(n=Math.sin(n/2))*n}var Un=Math.SQRT2;n.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(h0&&(t=t.transition().duration(v)),t.call(_.event)}function E(){c&&c.domain(l.range().map(function(n){return(n-h.x)/h.k}).map(l.invert)),s&&s.domain(f.range().map(function(n){return(n-h.y)/h.k}).map(f.invert))}function A(n){d++||n({type:"zoomstart"})}function C(n){E(),n({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function z(n){--d||(n({type:"zoomend"}),e=null)}function L(){var t=this,e=b.of(t,arguments),r=0,i=n.select(u(t)).on(m,function(){r=1,k(n.mouse(t),o),C(e)}).on(M,function(){i.on(m,null).on(M,null),a(r),z(e)}),o=w(n.mouse(t)),a=Mn(t);ua.call(t),A(e)}function q(){var t,e=this,r=b.of(e,arguments),i={},u=0,o=".zoom-"+n.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,f=[],s=n.select(e),p=Mn(e);function g(){var r=n.touches(e);return t=h.k,r.forEach(function(n){n.identifier in i&&(i[n.identifier]=w(n))}),r}function v(){var t=n.event.target;n.select(t).on(l,d).on(c,m),f.push(t);for(var r=n.event.changedTouches,o=0,s=r.length;o1){y=p[0];var M=p[1],x=y[0]-M[0],b=y[1]-M[1];u=x*x+b*b}}function d(){var o,l,c,f,s=n.touches(e);ua.call(e);for(var h=0,p=s.length;h360?t-=360:t<0&&(t+=360),t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r));var t}return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:t<0?0:t>1?1:t,r=2*(e=e<0?0:e>1?1:e)-(i=e<=.5?e*(1+t):e+t-e*t),new ut(u(n+120),u(n),u(n-120))}function Vn(t,e,r){return this instanceof Vn?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof Vn?new Vn(t.h,t.c,t.l):tt(t instanceof Bn?t.l:(t=ht((t=n.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Vn(t,e,r)}Yn.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new In(this.h,this.s,this.l/n)},Yn.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new In(this.h,this.s,n*this.l)},Yn.rgb=function(){return Zn(this.h,this.s,this.l)},n.hcl=Vn;var Xn=Vn.prototype=new On;function $n(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new Bn(e,Math.cos(n*=Cn)*t,Math.sin(n)*t)}function Bn(n,t,e){return this instanceof Bn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof Bn?new Bn(n.l,n.a,n.b):n instanceof Vn?$n(n.h,n.c,n.l):ht((n=ut(n)).r,n.g,n.b):new Bn(n,t,e)}Xn.brighter=function(n){return new Vn(this.h,this.c,Math.min(100,this.l+Wn*(arguments.length?n:1)))},Xn.darker=function(n){return new Vn(this.h,this.c,Math.max(0,this.l-Wn*(arguments.length?n:1)))},Xn.rgb=function(){return $n(this.h,this.c,this.l).rgb()},n.lab=Bn;var Wn=18,Jn=.95047,Gn=1,Kn=1.08883,Qn=Bn.prototype=new On;function nt(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return new ut(it(3.2404542*(i=et(i)*Jn)-1.5371385*(r=et(r)*Gn)-.4985314*(u=et(u)*Kn)),it(-.969266*i+1.8760108*r+.041556*u),it(.0556434*i-.2040259*r+1.0572252*u))}function tt(n,t,e){return n>0?new Vn(Math.atan2(e,t)*zn,Math.sqrt(t*t+e*e),n):new Vn(NaN,NaN,n)}function et(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function rt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function it(n){return Math.round(255*(n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ut(n,t,e){return this instanceof ut?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof ut?new ut(n.r,n.g,n.b):ft(""+n,ut,Zn):new ut(n,t,e)}function ot(n){return new ut(n>>16,n>>8&255,255&n)}function at(n){return ot(n)+""}Qn.brighter=function(n){return new Bn(Math.min(100,this.l+Wn*(arguments.length?n:1)),this.a,this.b)},Qn.darker=function(n){return new Bn(Math.max(0,this.l-Wn*(arguments.length?n:1)),this.a,this.b)},Qn.rgb=function(){return nt(this.l,this.a,this.b)},n.rgb=ut;var lt=ut.prototype=new On;function ct(n){return n<16?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function ft(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(gt(i[0]),gt(i[1]),gt(i[2]))}return(u=vt.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o|=o>>4,a=240&u,a|=a>>4,l=15&u,l|=l<<4):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function st(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=l<.5?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(t0&&l<1?0:r),new In(r,i,l)}function ht(n,t,e){var r=rt((.4124564*(n=pt(n))+.3575761*(t=pt(t))+.1804375*(e=pt(e)))/Jn),i=rt((.2126729*n+.7151522*t+.072175*e)/Gn);return Bn(116*i-16,500*(r-i),200*(i-rt((.0193339*n+.119192*t+.9503041*e)/Kn)))}function pt(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function gt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}lt.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b;return t||e||r?(t&&t<30&&(t=30),e&&e<30&&(e=30),r&&r<30&&(r=30),new ut(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new ut(30,30,30)},lt.darker=function(n){return new ut((n=Math.pow(.7,arguments.length?n:1))*this.r,n*this.g,n*this.b)},lt.hsl=function(){return st(this.r,this.g,this.b)},lt.toString=function(){return"#"+ct(this.r)+ct(this.g)+ct(this.b)};var vt=n.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function dt(n){return"function"==typeof n?n:function(){return n}}function yt(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),mt(t,e,n,r)}}function mt(t,r,i,u){var o,a={},l=n.dispatch("beforesend","progress","load","error"),c={},f=new XMLHttpRequest,s=null;function h(){var n,t,e,r=f.status;if(!r&&((e=(t=f).responseType)&&"text"!==e?t.response:t.responseText)||r>=200&&r<300||304===r){try{n=i.call(a,f)}catch(n){return void l.error.call(a,n)}l.load.call(a,n)}else l.error.call(a,f)}return!this.XDomainRequest||"withCredentials"in f||!/^(http(s)?:)?\/\//.test(t)||(f=new XDomainRequest),"onload"in f?f.onload=f.onerror=h:f.onreadystatechange=function(){f.readyState>3&&h()},f.onprogress=function(t){var e=n.event;n.event=t;try{l.progress.call(a,f)}finally{n.event=e}},a.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?c[n]:(null==t?delete c[n]:c[n]=t+"",a)},a.mimeType=function(n){return arguments.length?(r=null==n?null:n+"",a):r},a.responseType=function(n){return arguments.length?(s=n,a):s},a.response=function(n){return i=n,a},["get","post"].forEach(function(n){a[n]=function(){return a.send.apply(a,[n].concat(e(arguments)))}}),a.send=function(n,e,i){if(2===arguments.length&&"function"==typeof e&&(i=e,e=null),f.open(n,t,!0),null==r||"accept"in c||(c.accept=r+",*/*"),f.setRequestHeader)for(var u in c)f.setRequestHeader(u,c[u]);return null!=r&&f.overrideMimeType&&f.overrideMimeType(r),null!=s&&(f.responseType=s),null!=i&&a.on("error",i).on("load",function(n){i(null,n)}),l.beforesend.call(a,f),f.send(null==e?null:e),a},a.abort=function(){return f.abort(),a},n.rebind(a,l,"on"),null==u?a:a.get(1===(o=u).length?function(n,t){o(null==n?t:null)}:o)}vt.forEach(function(n,t){vt.set(n,ot(t))}),n.functor=dt,n.xhr=yt(z),n.dsv=function(n,t){var e=new RegExp('["'+n+"\n]"),r=n.charCodeAt(0);function i(n,e,r){arguments.length<3&&(r=e,e=null);var i=mt(n,t,null==e?u:o(e),r);return i.row=function(n){return arguments.length?i.response(null==(e=n)?u:o(n)):e},i}function u(n){return i.parse(n.responseText)}function o(n){return function(t){return i.parse(t.responseText,n)}}function a(t){return t.map(l).join(n)}function l(n){return e.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}return i.parse=function(n,t){var e;return i.parseRows(n,function(n,r){if(e)return e(n,r-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");e=t?function(n,e){return t(i(n),e)}:i})},i.parseRows=function(n,t){var e,i,u={},o={},a=[],l=n.length,c=0,f=0;function s(){if(c>=l)return o;if(i)return i=!1,u;var t=c;if(34===n.charCodeAt(t)){for(var e=t;e++24?(isFinite(t)&&(clearTimeout(_t),_t=setTimeout(kt,t)),bt=0):(bt=1,wt(kt))}function Nt(){for(var n=Date.now(),t=Mt;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Et(){for(var n,t=Mt,e=1/0;t;)t.c?(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}});n.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=n.round(t,At(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Ct[8+r/3]};var zt=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Lt=n.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(t,e){return(t=n.round(t,At(t,e))).toFixed(Math.max(0,Math.min(20,At(t*(1+1e-15),e))))}});function qt(n){return n+""}var Tt=n.time={},Rt=Date;function Dt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Dt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Pt.setUTCDate.apply(this._,arguments)},setDay:function(){Pt.setUTCDay.apply(this._,arguments)},setFullYear:function(){Pt.setUTCFullYear.apply(this._,arguments)},setHours:function(){Pt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Pt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Pt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Pt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Pt.setUTCSeconds.apply(this._,arguments)},setTime:function(){Pt.setTime.apply(this._,arguments)}};var Pt=Date.prototype;function Ut(n,t,e){function r(t){var e=n(t),r=u(e,1);return t-e1)for(;o68?1900:2e3),e+i[0].length):-1}function Jt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Gt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Kt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function Qt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function ne(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function te(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ee(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function re(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ie(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=y(t)/60|0,i=y(t)%60;return e+It(r,"0",2)+It(i,"0",2)}function ue(n,t,e){Ot.lastIndex=0;var r=Ot.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function oe(n){for(var t=n.length,e=-1;++e0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),r.push(n.substring(e-=a,e+a)),!((l+=a+1)>t));)a=u[o=(o+1)%u.length];return r.reverse().join(i)}:z,function(t){var e=zt.exec(t),i=e[1]||" ",u=e[2]||">",l=e[3]||"-",c=e[4]||"",f=e[5],s=+e[6],h=e[7],p=e[8],g=e[9],v=1,d="",y="",m=!1,M=!0;switch(p&&(p=+p.substring(1)),(f||"0"===i&&"="===u)&&(f=i="0",u="="),g){case"n":h=!0,g="g";break;case"%":v=100,y="%",g="f";break;case"p":v=100,y="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(d="0"+g.toLowerCase());case"c":M=!1;case"d":m=!0,p=0;break;case"s":v=-1,g="r"}"$"===c&&(d=o[0],y=o[1]),"r"!=g||p||(g="g"),null!=p&&("g"==g?p=Math.max(1,Math.min(21,p)):"e"!=g&&"f"!=g||(p=Math.max(0,Math.min(20,p)))),g=Lt.get(g)||qt;var x=f&&h;return function(t){var e=y;if(m&&t%1)return"";var o=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===l?"":l;if(v<0){var c=n.formatPrefix(t,p);t=c.scale(t),e=c.symbol+y}else t*=v;var b,_,w=(t=g(t,p)).lastIndexOf(".");if(w<0){var S=M?t.lastIndexOf("e"):-1;S<0?(b=t,_=""):(b=t.substring(0,S),_=t.substring(S))}else b=t.substring(0,w),_=r+t.substring(w+1);!f&&h&&(b=a(b,1/0));var k=d.length+b.length+_.length+(x?0:o.length),N=k"===u?N+o+t:"^"===u?N.substring(0,k>>=1)+o+t+N.substring(k):o+(x?t:N+t))+e}}),timeFormat:function(t){var e=t.dateTime,r=t.date,i=t.time,u=t.periods,o=t.days,a=t.shortDays,l=t.months,c=t.shortMonths;function f(n){var t=n.length;function e(e){for(var r,i,u,o=[],a=-1,l=0;++a=c)return-1;if(37===(i=t.charCodeAt(a++))){if(o=t.charAt(a++),!(u=_[o in Ft?t.charAt(a++):o])||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}f.utc=function(n){var t=f(n);function e(n){try{var e=new(Rt=Dt);return e._=n,t(e)}finally{Rt=Date}}return e.parse=function(n){try{Rt=Dt;var e=t.parse(n);return e&&e._}finally{Rt=Date}},e.toString=t.toString,e},f.multi=f.utc.multi=oe;var h=n.map(),p=Yt(o),g=Zt(o),v=Yt(a),d=Zt(a),y=Yt(l),m=Zt(l),M=Yt(c),x=Zt(c);u.forEach(function(n,t){h.set(n.toLowerCase(),t)});var b={a:function(n){return a[n.getDay()]},A:function(n){return o[n.getDay()]},b:function(n){return c[n.getMonth()]},B:function(n){return l[n.getMonth()]},c:f(e),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+Tt.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return u[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(Tt.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(Tt.mondayOfYear(n),t,2)},x:f(r),X:f(i),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:ie,"%":function(){return"%"}},_={a:function(n,t,e){v.lastIndex=0;var r=v.exec(t.slice(e));return r?(n.w=d.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(n,t,e){p.lastIndex=0;var r=p.exec(t.slice(e));return r?(n.w=g.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(n,t,e){M.lastIndex=0;var r=M.exec(t.slice(e));return r?(n.m=x.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(n,t,e){y.lastIndex=0;var r=y.exec(t.slice(e));return r?(n.m=m.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(n,t,e){return s(n,b.c.toString(),t,e)},d:Kt,e:Kt,H:ne,I:ne,j:Qt,L:re,m:Gt,M:te,p:function(n,t,e){var r=h.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)},S:ee,U:Xt,w:Vt,W:$t,x:function(n,t,e){return s(n,b.x.toString(),t,e)},X:function(n,t,e){return s(n,b.X.toString(),t,e)},y:Wt,Y:Bt,Z:Jt,"%":ue};return f}(t)};var e,r,i,u,o,a};var ae=n.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function le(){}n.format=ae.numberFormat,n.geo={},le.prototype={s:0,t:0,add:function(n){fe(n,this.t,ce),fe(ce.s,this.s,this),this.s?this.t+=ce.t:this.s=ce.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ce=new le;function fe(n,t,e){var r=e.s=n+t,i=r-n,u=r-i;e.t=n-u+(t-i)}function se(n,t){n&&pe.hasOwnProperty(n.type)&&pe[n.type](n,t)}n.geo.stream=function(n,t){n&&he.hasOwnProperty(n.type)?he[n.type](n,t):se(n,t)};var he={Feature:function(n,t){se(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r=0?1:-1,a=o*u,l=Math.cos(t),c=Math.sin(t),f=i*c,s=r*l+f*Math.cos(a),h=f*o*Math.sin(a);Ae.add(Math.atan2(h,s)),e=n,r=l,i=c}Ce.point=function(o,a){Ce.point=u,e=(n=o)*Cn,r=Math.cos(a=(t=a)*Cn/2+kn/4),i=Math.sin(a)},Ce.lineEnd=function(){u(n,t)}}function Le(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function qe(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function Te(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Re(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function De(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Pe(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function Ue(n){return[Math.atan2(n[1],n[0]),Rn(n[2])]}function je(n,t){return y(n[0]-t[0])wn?i=90:c<-wn&&(e=-90),s[0]=t,s[1]=r}};function p(n,u){f.push(s=[t=n,r=n]),ui&&(i=u)}function g(n,o){var a=Le([n*Cn,o*Cn]);if(l){var c=Te(l,a),f=Te([c[1],-c[0],0],c);Pe(f),f=Ue(f);var s=n-u,h=s>0?1:-1,g=f[0]*zn*h,v=y(s)>180;if(v^(h*ui&&(i=d);else if(g=(g+360)%360-180,v^(h*ui&&(i=o);v?nb(t,r)&&(r=n):b(n,r)>b(t,r)&&(t=n):r>=t?(nr&&(r=n)):n>u?b(t,n)>b(t,r)&&(r=n):b(n,r)>b(t,r)&&(t=n)}else p(n,o);l=a,u=n}function v(){h.point=g}function d(){s[0]=t,s[1]=r,h.point=p,l=null}function m(n,t){if(l){var e=n-u;c+=y(e)>180?e+(e>0?360:-360):e}else o=n,a=t;Ce.point(n,t),g(n,t)}function M(){Ce.lineStart()}function x(){m(o,a),Ce.lineEnd(),y(c)>wn&&(t=-(r=180)),s[0]=t,s[1]=r,l=null}function b(n,t){return(t-=n)<0?t+360:t}function _(n,t){return n[0]-t[0]}function w(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nb(v[0],v[1])&&(v[1]=p[1]),b(p[0],v[1])>b(v[0],v[1])&&(v[0]=p[0])):a.push(v=p);for(var l,c,p,g=-1/0,v=(o=0,a[c=a.length-1]);o<=c;v=p,++o)p=a[o],(l=b(v[1],p[0]))>g&&(g=l,t=p[0],r=v[1])}return f=s=null,t===1/0||e===1/0?[[NaN,NaN],[NaN,NaN]]:[[t,e],[r,i]]}}(),n.geo.centroid=function(t){ye=me=Me=xe=be=_e=we=Se=ke=Ne=Ee=0,n.geo.stream(t,Fe);var e=ke,r=Ne,i=Ee,u=e*e+r*r+i*i;return u=0;--a)i.point((s=f[a])[0],s[1]);else r(p.x,p.p.x,-1,i);p=p.p}f=(p=p.o).z,g=!g}while(!p.v);i.lineEnd()}}}function Be(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r=0?1:-1,w=_*b,S=w>kn,k=g*M;if(Ae.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Nn:b,S^h>=e^y>=e){var N=Te(Le(s),Le(n));Pe(N);var E=Te(i,N);Pe(E);var A=(S^b>=0?-1:1)*Rn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(u<-wn||u0){for(M||(o.polygonStart(),M=!0),o.lineStart();++u1&&2&t&&e.push(e.pop().concat(e.shift())),a.push(e.filter(Ge))}return f}}function Ge(n){return n.length>1}function Ke(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:R,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Qe(n,t){return((n=n.x)[0]<0?n[1]-An-wn:An-n[1])-((t=t.x)[0]<0?t[1]-An-wn:An-t[1])}var nr=Je(Xe,function(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a,l,c,f,s,h,p,g=u>0?kn:-kn,v=y(u-e);y(v-kn)0?An:-An),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(g,r),n.point(u,r),t=0):i!==g&&v>=kn&&(y(e-i)wn?Math.atan((Math.sin(l)*(h=Math.cos(f))*Math.sin(c)-Math.sin(f)*(s=Math.cos(l))*Math.sin(a))/(s*h*p)):(l+f)/2,n.point(i,r),n.lineEnd(),n.lineStart(),n.point(g,r),t=0),n.point(e=u,r=o),i=g},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}},function(n,t,e,r){var i;if(null==n)i=e*An,r.point(-kn,i),r.point(0,i),r.point(kn,i),r.point(kn,0),r.point(kn,-i),r.point(0,-i),r.point(-kn,-i),r.point(-kn,0),r.point(-kn,i);else if(y(n[0]-t[0])>wn){var u=n[0]0)){if(u/=h,h<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=e-l,h||!(u<0)){if(u/=h,h<0){if(u>s)return;u>f&&(f=u)}else if(h>0){if(u0)){if(u/=p,p<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=r-c,p||!(u<0)){if(u/=p,p<0){if(u>s)return;u>f&&(f=u)}else if(p>0){if(u0&&(i.a={x:l+f*h,y:c+f*p}),s<1&&(i.b={x:l+s*h,y:c+s*p}),i}}}}}}var er=1e9;function rr(t,e,r,i){return function(l){var c,f,s,h,p,g,v,d,y,m,M,x=l,b=Ke(),_=tr(t,e,r,i),w={point:N,lineStart:function(){w.point=E,f&&f.push(s=[]);m=!0,y=!1,v=d=NaN},lineEnd:function(){c&&(E(h,p),g&&y&&b.rejoin(),c.push(b.buffer()));w.point=N,y&&l.lineEnd()},polygonStart:function(){l=b,c=[],f=[],M=!0},polygonEnd:function(){l=x,c=n.merge(c);var e=function(n){for(var t=0,e=f.length,r=n[1],i=0;ir&&qn(c,u,n)>0&&++t:u[1]<=r&&qn(c,u,n)<0&&--t,c=u;return 0!==t}([t,i]),r=M&&e,u=c.length;(r||u)&&(l.polygonStart(),r&&(l.lineStart(),S(null,null,1,l),l.lineEnd()),u&&$e(c,o,e,S,l),l.polygonEnd()),c=f=s=null}};function S(n,o,l,c){var f=0,s=0;if(null==n||(f=u(n,l))!==(s=u(o,l))||a(n,o)<0^l>0)do{c.point(0===f||3===f?t:r,f>1?i:e)}while((f=(f+l+4)%4)!==s);else c.point(o[0],o[1])}function k(n,u){return t<=n&&n<=r&&e<=u&&u<=i}function N(n,t){k(n,t)&&l.point(n,t)}function E(n,t){var e=k(n=Math.max(-er,Math.min(er,n)),t=Math.max(-er,Math.min(er,t)));if(f&&s.push([n,t]),m)h=n,p=t,g=e,m=!1,e&&(l.lineStart(),l.point(n,t));else if(e&&y)l.point(n,t);else{var r={a:{x:v,y:d},b:{x:n,y:t}};_(r)?(y||(l.lineStart(),l.point(r.a.x,r.a.y)),l.point(r.b.x,r.b.y),e||l.lineEnd(),M=!1):e&&(l.lineStart(),l.point(n,t),M=!1)}v=n,d=t,y=e}return w};function u(n,i){return y(n[0]-t)0?0:3:y(n[0]-r)0?2:1:y(n[1]-e)0?1:0:i>0?3:2}function o(n,t){return a(n.x,t.x)}function a(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}}function ir(n){var t=0,e=kn/3,r=Nr(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*kn/180,e=n[1]*kn/180):[t/kn*180,e/kn*180]},i}function ur(n,t){var e=Math.sin(n),r=(e+Math.sin(t))/2,i=1+e*(2*r-e),u=Math.sqrt(i)/r;function o(n,t){var e=Math.sqrt(i-2*r*Math.sin(t))/r;return[e*Math.sin(n*=r),u-e*Math.cos(n)]}return o.invert=function(n,t){var e=u-t;return[Math.atan2(n,e)/r,Rn((i-(n*n+e*e)*r*r)/(2*r))]},o}n.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),(i=u(n)).valid=!0,i},extent:function(a){return arguments.length?(u=rr(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(n.geo.conicEqualArea=function(){return ir(ur)}).raw=ur,n.geo.albers=function(){return n.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},n.geo.albersUsa=function(){var t,e,r,i,u=n.geo.albers(),o=n.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=n.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};function c(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}return c.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?o:i>=.166&&i<.234&&r>=-.214&&r<-.115?a:u).invert(n)},c.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},c.precision=function(n){return arguments.length?(u.precision(n),o.precision(n),a.precision(n),c):u.precision()},c.scale=function(n){return arguments.length?(u.scale(n),o.scale(.35*n),a.scale(n),c.translate(u.translate())):u.scale()},c.translate=function(n){if(!arguments.length)return u.translate();var t=u.scale(),f=+n[0],s=+n[1];return e=u.translate(n).clipExtent([[f-.455*t,s-.238*t],[f+.455*t,s+.238*t]]).stream(l).point,r=o.translate([f-.307*t,s+.201*t]).clipExtent([[f-.425*t+wn,s+.12*t+wn],[f-.214*t-wn,s+.234*t-wn]]).stream(l).point,i=a.translate([f-.205*t,s+.212*t]).clipExtent([[f-.214*t+wn,s+.166*t+wn],[f-.115*t-wn,s+.234*t-wn]]).stream(l).point,c},c.scale(1070)};var or,ar,lr,cr,fr,sr,hr={point:R,lineStart:R,lineEnd:R,polygonStart:function(){ar=0,hr.lineStart=pr},polygonEnd:function(){hr.lineStart=hr.lineEnd=hr.point=R,or+=y(ar/2)}};function pr(){var n,t,e,r;function i(n,t){ar+=r*n-e*t,e=n,r=t}hr.point=function(u,o){hr.point=i,n=e=u,t=r=o},hr.lineEnd=function(){i(n,t)}}var gr={point:function(n,t){nfr&&(fr=n);tsr&&(sr=t)},lineStart:R,lineEnd:R,polygonStart:R,polygonEnd:R};function vr(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}var dr,yr={point:mr,lineStart:Mr,lineEnd:xr,polygonStart:function(){yr.lineStart=br},polygonEnd:function(){yr.point=mr,yr.lineStart=Mr,yr.lineEnd=xr}};function mr(n,t){Me+=n,xe+=t,++be}function Mr(){var n,t;function e(e,r){var i=e-n,u=r-t,o=Math.sqrt(i*i+u*u);_e+=o*(n+e)/2,we+=o*(t+r)/2,Se+=o,mr(n=e,t=r)}yr.point=function(r,i){yr.point=e,mr(n=r,t=i)}}function xr(){yr.point=mr}function br(){var n,t,e,r;function i(n,t){var i=n-e,u=t-r,o=Math.sqrt(i*i+u*u);_e+=o*(e+n)/2,we+=o*(r+t)/2,Se+=o,ke+=(o=r*n-e*t)*(e+n),Ne+=o*(r+t),Ee+=3*o,mr(e=n,r=t)}yr.point=function(u,o){yr.point=i,mr(n=e=u,t=r=o)},yr.lineEnd=function(){i(n,t)}}function _r(n){var t=.5,e=Math.cos(30*Cn),r=16;function i(t){return(r?function(t){var e,i,o,a,l,c,f,s,h,p,g,v,d={point:y,lineStart:m,lineEnd:x,polygonStart:function(){t.polygonStart(),d.lineStart=b},polygonEnd:function(){t.polygonEnd(),d.lineStart=m}};function y(e,r){e=n(e,r),t.point(e[0],e[1])}function m(){s=NaN,d.point=M,t.lineStart()}function M(e,i){var o=Le([e,i]),a=n(e,i);u(s,h,f,p,g,v,s=a[0],h=a[1],f=e,p=o[0],g=o[1],v=o[2],r,t),t.point(s,h)}function x(){d.point=y,t.lineEnd()}function b(){m(),d.point=_,d.lineEnd=w}function _(n,t){M(e=n,t),i=s,o=h,a=p,l=g,c=v,d.point=M}function w(){u(s,h,f,p,g,v,i,o,e,a,l,c,r,t),d.lineEnd=x,x()}return d}:function(t){return Sr(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})})(t)}function u(r,i,o,a,l,c,f,s,h,p,g,v,d,m){var M=f-r,x=s-i,b=M*M+x*x;if(b>4*t&&d--){var _=a+p,w=l+g,S=c+v,k=Math.sqrt(_*_+w*w+S*S),N=Math.asin(S/=k),E=y(y(S)-1)t||y((M*L+x*q)/b-.5)>.3||a*p+l*g+c*v0&&16,i):Math.sqrt(t)},i}function wr(n){this.stream=n}function Sr(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function kr(n){return Nr(function(){return n})()}function Nr(t){var e,r,i,u,o,a,l=_r(function(n,t){return[(n=e(n,t))[0]*c+u,o-n[1]*c]}),c=150,f=480,s=250,h=0,p=0,g=0,v=0,d=0,m=nr,M=z,x=null,b=null;function _(n){return[(n=i(n[0]*Cn,n[1]*Cn))[0]*c+u,o-n[1]*c]}function w(n){return(n=i.invert((n[0]-u)/c,(o-n[1])/c))&&[n[0]*zn,n[1]*zn]}function S(){i=Ve(r=zr(g,v,d),e);var n=e(h,p);return u=f-n[0]*c,o=s+n[1]*c,k()}function k(){return a&&(a.valid=!1,a=null),_}return _.stream=function(n){return a&&(a.valid=!1),(a=Er(m(r,l(M(n))))).valid=!0,a},_.clipAngle=function(n){return arguments.length?(m=null==n?(x=n,nr):function(n){var t=Math.cos(n),e=t>0,r=y(t)>wn;return Je(i,function(n){var t,a,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=i(s,h),d=e?v?0:o(s,h):v?o(s+(s<0?kn:-kn),h):0;if(!t&&(c=l=v)&&n.lineStart(),v!==l&&(p=u(t,g),(je(t,p)||je(g,p))&&(g[0]+=wn,g[1]+=wn,v=i(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=u(g,t),n.point(p[0],p[1])):(p=u(t,g),n.point(p[0],p[1]),n.lineEnd()),t=p;else if(r&&t&&e^v){var y;d&a||!(y=u(g,t,!0))||(f=0,e?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||t&&je(t,g)||n.point(g[0],g[1]),t=g,l=v,a=d},lineEnd:function(){l&&n.lineEnd(),t=null},clean:function(){return f|(c&&l)<<1}}},Rr(n,6*Cn),e?[0,-n]:[-kn,n-kn]);function i(n,e){return Math.cos(n)*Math.cos(e)>t}function u(n,e,r){var i=[1,0,0],u=Te(Le(n),Le(e)),o=qe(u,u),a=u[0],l=o-a*a;if(!l)return!r&&n;var c=t*o/l,f=-t*a/l,s=Te(i,u),h=De(i,c);Re(h,De(u,f));var p=s,g=qe(h,p),v=qe(p,p),d=g*g-v*(qe(h,h)-1);if(!(d<0)){var m=Math.sqrt(d),M=De(p,(-g-m)/v);if(Re(M,h),M=Ue(M),!r)return M;var x,b=n[0],_=e[0],w=n[1],S=e[1];_0^M[1]<(y(M[0]-b)kn^(b<=M[0]&&M[0]<=_)){var E=De(p,(-g+m)/v);return Re(E,h),[M,Ue(E)]}}}function o(t,r){var i=e?n:kn-n,u=0;return t<-i?u|=1:t>i&&(u|=2),r<-i?u|=4:r>i&&(u|=8),u}}((x=+n)*Cn),k()):x},_.clipExtent=function(n){return arguments.length?(b=n,M=n?rr(n[0][0],n[0][1],n[1][0],n[1][1]):z,k()):b},_.scale=function(n){return arguments.length?(c=+n,S()):c},_.translate=function(n){return arguments.length?(f=+n[0],s=+n[1],S()):[f,s]},_.center=function(n){return arguments.length?(h=n[0]%360*Cn,p=n[1]%360*Cn,S()):[h*zn,p*zn]},_.rotate=function(n){return arguments.length?(g=n[0]%360*Cn,v=n[1]%360*Cn,d=n.length>2?n[2]%360*Cn:0,S()):[g*zn,v*zn,d*zn]},n.rebind(_,l,"precision"),function(){return e=t.apply(this,arguments),_.invert=e.invert&&w,S()}}function Er(n){return Sr(n,function(t,e){n.point(t*Cn,e*Cn)})}function Ar(n,t){return[n,t]}function Cr(n,t){return[n>kn?n-Nn:n<-kn?n+Nn:n,t]}function zr(n,t,e){return n?t||e?Ve(qr(n),Tr(t,e)):qr(n):t||e?Tr(t,e):Cr}function Lr(n){return function(t,e){return[(t+=n)>kn?t-Nn:t<-kn?t+Nn:t,e]}}function qr(n){var t=Lr(n);return t.invert=Lr(-n),t}function Tr(n,t){var e=Math.cos(n),r=Math.sin(n),i=Math.cos(t),u=Math.sin(t);function o(n,t){var o=Math.cos(t),a=Math.cos(n)*o,l=Math.sin(n)*o,c=Math.sin(t),f=c*e+a*r;return[Math.atan2(l*i-f*u,a*e-c*r),Rn(f*i+l*u)]}return o.invert=function(n,t){var o=Math.cos(t),a=Math.cos(n)*o,l=Math.sin(n)*o,c=Math.sin(t),f=c*i-l*u;return[Math.atan2(l*i+c*u,a*e+f*r),Rn(f*e-a*r)]},o}function Rr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=Dr(e,i),u=Dr(e,u),(o>0?iu)&&(i+=o*Nn)):(i=n+o*Nn,u=n-.5*l);for(var c,f=i;o>0?f>u:f2?n[2]*Cn:0),t.invert=function(t){return(t=n.invert(t[0]*Cn,t[1]*Cn))[0]*=zn,t[1]*=zn,t},t},Cr.invert=Ar,n.geo.circle=function(){var n,t,e=[0,0],r=6;function i(){var n="function"==typeof e?e.apply(this,arguments):e,r=zr(-n[0]*Cn,-n[1]*Cn,0).invert,i=[];return t(null,null,1,{point:function(n,t){i.push(n=r(n,t)),n[0]*=zn,n[1]*=zn}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(n){return arguments.length?(e=n,i):e},i.angle=function(e){return arguments.length?(t=Rr((n=+e)*Cn,r*Cn),i):n},i.precision=function(e){return arguments.length?(t=Rr(n*Cn,(r=+e)*Cn),i):r},i.angle(90)},n.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Cn,i=n[1]*Cn,u=t[1]*Cn,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},n.geo.graticule=function(){var t,e,r,i,u,o,a,l,c,f,s,h,p=10,g=p,v=90,d=360,m=2.5;function M(){return{type:"MultiLineString",coordinates:x()}}function x(){return n.range(Math.ceil(i/v)*v,r,v).map(s).concat(n.range(Math.ceil(l/d)*d,a,d).map(h)).concat(n.range(Math.ceil(e/p)*p,t,p).filter(function(n){return y(n%v)>wn}).map(c)).concat(n.range(Math.ceil(o/g)*g,u,g).filter(function(n){return y(n%d)>wn}).map(f))}return M.lines=function(){return x().map(function(n){return{type:"LineString",coordinates:n}})},M.outline=function(){return{type:"Polygon",coordinates:[s(i).concat(h(a).slice(1),s(r).reverse().slice(1),h(l).reverse().slice(1))]}},M.extent=function(n){return arguments.length?M.majorExtent(n).minorExtent(n):M.minorExtent()},M.majorExtent=function(n){return arguments.length?(i=+n[0][0],r=+n[1][0],l=+n[0][1],a=+n[1][1],i>r&&(n=i,i=r,r=n),l>a&&(n=l,l=a,a=n),M.precision(m)):[[i,l],[r,a]]},M.minorExtent=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],u=+n[1][1],e>t&&(n=e,e=t,t=n),o>u&&(n=o,o=u,u=n),M.precision(m)):[[e,o],[t,u]]},M.step=function(n){return arguments.length?M.majorStep(n).minorStep(n):M.minorStep()},M.majorStep=function(n){return arguments.length?(v=+n[0],d=+n[1],M):[v,d]},M.minorStep=function(n){return arguments.length?(p=+n[0],g=+n[1],M):[p,g]},M.precision=function(n){return arguments.length?(m=+n,c=Pr(o,u,90),f=Ur(e,t,m),s=Pr(l,a,90),h=Ur(i,r,m),M):m},M.majorExtent([[-180,-90+wn],[180,90-wn]]).minorExtent([[-180,-80-wn],[180,80+wn]])},n.geo.greatArc=function(){var t,e,r=jr,i=Fr;function u(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}return u.distance=function(){return n.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},u.source=function(n){return arguments.length?(r=n,t="function"==typeof n?null:n,u):r},u.target=function(n){return arguments.length?(i=n,e="function"==typeof n?null:n,u):i},u.precision=function(){return arguments.length?u:0},u},n.geo.interpolate=function(n,t){return e=n[0]*Cn,r=n[1]*Cn,i=t[0]*Cn,u=t[1]*Cn,o=Math.cos(r),a=Math.sin(r),l=Math.cos(u),c=Math.sin(u),f=o*Math.cos(e),s=o*Math.sin(e),h=l*Math.cos(i),p=l*Math.sin(i),g=2*Math.asin(Math.sqrt(Pn(u-r)+o*l*Pn(i-e))),v=1/Math.sin(g),(d=g?function(n){var t=Math.sin(n*=g)*v,e=Math.sin(g-n)*v,r=e*f+t*h,i=e*s+t*p,u=e*a+t*c;return[Math.atan2(i,r)*zn,Math.atan2(u,Math.sqrt(r*r+i*i))*zn]}:function(){return[e*zn,r*zn]}).distance=g,d;var e,r,i,u,o,a,l,c,f,s,h,p,g,v,d},n.geo.length=function(t){return dr=0,n.geo.stream(t,Hr),dr};var Hr={sphere:R,point:R,lineStart:function(){var n,t,e;function r(r,i){var u=Math.sin(i*=Cn),o=Math.cos(i),a=y((r*=Cn)-n),l=Math.cos(a);dr+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=e*u-t*o*l)*a),t*u+e*o*l),n=r,t=u,e=o}Hr.point=function(i,u){n=i*Cn,t=Math.sin(u*=Cn),e=Math.cos(u),Hr.point=r},Hr.lineEnd=function(){Hr.point=Hr.lineEnd=R}},lineEnd:R,polygonStart:R,polygonEnd:R};function Or(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}var Ir=Or(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(n.geo.azimuthalEqualArea=function(){return kr(Ir)}).raw=Ir;var Yr=Or(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},z);function Zr(n,t){var e=Math.cos(n),r=function(n){return Math.tan(kn/4+n/2)},i=n===t?Math.sin(n):Math.log(e/Math.cos(t))/Math.log(r(t)/r(n)),u=e*Math.pow(r(n),i)/i;if(!i)return $r;function o(n,t){u>0?t<-An+wn&&(t=-An+wn):t>An-wn&&(t=An-wn);var e=u/Math.pow(r(t),i);return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}return o.invert=function(n,t){var e=u-t,r=Ln(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(u/r,1/i))-An]},o}function Vr(n,t){var e=Math.cos(n),r=n===t?Math.sin(n):(e-Math.cos(t))/(t-n),i=e/r+n;if(y(r)1&&qn(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function ti(n,t){return n[0]-t[0]||n[1]-t[1]}(n.geo.stereographic=function(){return kr(Jr)}).raw=Jr,Gr.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-An]},(n.geo.transverseMercator=function(){var n=Br(Gr),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):[(n=t())[1],-n[0]]},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):[(n=e())[0],n[1],n[2]-90]},e([0,0,90])}).raw=Gr,n.geom={},n.geom.hull=function(n){var t=Kr,e=Qr;if(arguments.length)return r(n);function r(n){if(n.length<3)return[];var r,i=dt(t),u=dt(e),o=n.length,a=[],l=[];for(r=0;r=0;--r)p.push(n[a[c[r]][2]]);for(r=+s;rwn)a=a.L;else{if(!((i=u-mi(a,o))>wn)){r>-wn?(t=a.P,e=a):i>-wn?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=pi(n);if(li.insert(t,l),t||e){if(t===e)return _i(t),e=pi(t.site),li.insert(l,e),l.edge=e.edge=ki(t.site,l.site),bi(t),void bi(e);if(e){_i(t),_i(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};Ni(e.edge,c,g,x),l.edge=ki(c,n,null,x),e.edge=ki(n,g,null,x),bi(t),bi(e)}else l.edge=ki(t.site,l.site)}}function yi(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-1/0;var a=(e=o.site).x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function mi(n,t){var e=n.N;if(e)return yi(e,t);var r=n.site;return r.y===t?r.x:1/0}function Mi(n){this.site=n,this.edges=[]}function xi(n,t){return t.angle-n.angle}function bi(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,i=n.site,u=e.site;if(r!==u){var o=i.x,a=i.y,l=r.x-o,c=r.y-a,f=u.x-o,s=2*(l*(d=u.y-a)-c*f);if(!(s>=-Sn)){var h=l*l+c*c,p=f*f+d*d,g=(d*h-c*p)/s,v=(l*p-f*h)/s,d=v+a,y=hi.pop()||new function(){Ci(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=n,y.site=i,y.x=g+o,y.y=d+Math.sqrt(g*g+v*v),y.cy=d,n.circle=y;for(var m=null,M=fi._;M;)if(y.y=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.y1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.y=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.xwn||y(i-e)>wn)&&(a.splice(o,0,new Ei((m=u.site,M=f,x=y(r-s)wn?{x:s,y:y(t-s)wn?{x:y(e-g)wn?{x:h,y:y(t-h)wn?{x:y(e-p)=e&&c.x<=i&&c.y>=r&&c.y<=o?[[e,o],[i,o],[i,r],[e,r]]:[]).point=n[a]}),t}function a(n){return n.map(function(n,t){return{x:Math.round(r(n,t)/wn)*wn,y:Math.round(i(n,t)/wn)*wn,i:t}})}return o.links=function(n){return Ti(a(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},o.triangles=function(n){var t=[];return Ti(a(n)).cells.forEach(function(e,r){for(var i,u,o,a,l=e.site,c=e.edges.sort(xi),f=-1,s=c.length,h=c[s-1].edge,p=h.l===l?h.r:h.l;++fu&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:Hi(e,r)})),u=Yi.lastIndex;return uv&&(v=l.x),l.y>d&&(d=l.y),c.push(l.x),f.push(l.y);else for(s=0;sv&&(v=x),b>d&&(d=b),c.push(x),f.push(b)}var _=v-p,w=d-g;function S(n,t,e,r,i,u,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,c=n.y;if(null!=l)if(y(l-e)+y(c-r)<.01)k(n,t,e,r,i,u,o,a);else{var f=n.point;n.x=n.y=n.point=null,k(n,f,l,c,i,u,o,a),k(n,t,e,r,i,u,o,a)}else n.x=e,n.y=r,n.point=t}else k(n,t,e,r,i,u,o,a)}function k(n,t,e,r,i,u,o,a){var l=.5*(i+o),c=.5*(u+a),f=e>=l,s=r>=c,h=s<<1|f;n.leaf=!1,n=n.nodes[h]||(n.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),f?i=l:o=l,s?u=c:a=c,S(n,t,e,r,i,u,o,a)}_>w?d=g+_:v=p+w;var N={leaf:!0,nodes:[],point:null,x:null,y:null};if(N.add=function(n){S(N,n,+m(n,++s),+M(n,s),p,g,v,d)},N.visit=function(n){!function n(t,e,r,i,u,o){if(!t(e,r,i,u,o)){var a=.5*(r+u),l=.5*(i+o),c=e.nodes;c[0]&&n(t,c[0],r,i,a,l),c[1]&&n(t,c[1],a,i,u,l),c[2]&&n(t,c[2],r,l,a,o),c[3]&&n(t,c[3],a,l,u,o)}}(n,N,p,g,v,d)},N.find=function(n){return t=N,e=n[0],r=n[1],c=1/0,function n(t,f,s,h,p){if(!(f>o||s>a||h=b)<<1|e>=x,w=_+4;_=0&&!(r=n.interpolators[i](t,e)););return r}function Vi(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;e=1)return 1;var t=n*n,e=t*n;return 4*(n<.5?e:3*(n-t)+e-.75)}function nu(n){return 1-Math.cos(n*An)}function tu(n){return Math.pow(2,10*(n-1))}function eu(n){return 1-Math.sqrt(1-n*n)}function ru(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function iu(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function uu(n){var t,e,r,i=[n.a,n.b],u=[n.c,n.d],o=au(i),a=ou(i,u),l=au(((t=u)[0]+=(r=-a)*(e=i)[0],t[1]+=r*e[1],t))||0;i[0]*u[1]=0?n.slice(0,r):n,u=r>=0?n.slice(r+1):"in";return i=$i.get(i)||Xi,u=Bi.get(u)||z,e=u(i.apply(null,t.call(arguments,1))),function(n){return n<=0?0:n>=1?1:e(n)}},n.interpolateHcl=function(t,e){t=n.hcl(t),e=n.hcl(e);var r=t.h,i=t.c,u=t.l,o=e.h-r,a=e.c-i,l=e.l-u;isNaN(a)&&(a=0,i=isNaN(i)?e.c:i);isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360);return function(n){return $n(r+o*n,i+a*n,u+l*n)+""}},n.interpolateHsl=function(t,e){t=n.hsl(t),e=n.hsl(e);var r=t.h,i=t.s,u=t.l,o=e.h-r,a=e.s-i,l=e.l-u;isNaN(a)&&(a=0,i=isNaN(i)?e.s:i);isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360);return function(n){return Zn(r+o*n,i+a*n,u+l*n)+""}},n.interpolateLab=function(t,e){t=n.lab(t),e=n.lab(e);var r=t.l,i=t.a,u=t.b,o=e.l-r,a=e.a-i,l=e.b-u;return function(n){return nt(r+o*n,i+a*n,u+l*n)+""}},n.interpolateRound=iu,n.transform=function(t){var e=r.createElementNS(n.ns.prefix.svg,"g");return(n.transform=function(n){if(null!=n){e.setAttribute("transform",n);var t=e.transform.baseVal.consolidate()}return new uu(t?t.matrix:lu)})(t)},uu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var lu={a:1,b:0,c:0,d:1,e:0,f:0};function cu(n){return n.length?n.pop()+",":""}function fu(t,e){var r,i,u,o,a,l,c=[],f=[];return t=n.transform(t),e=n.transform(e),function(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push("translate(",null,",",null,")");r.push({i:i-4,x:Hi(n[0],t[0])},{i:i-2,x:Hi(n[1],t[1])})}else(t[0]||t[1])&&e.push("translate("+t+")")}(t.translate,e.translate,c,f),r=t.rotate,i=e.rotate,u=c,r!==i?(r-i>180?i+=360:i-r>180&&(r+=360),f.push({i:u.push(cu(u)+"rotate(",null,")")-2,x:Hi(r,i)})):i&&u.push(cu(u)+"rotate("+i+")"),o=t.skew,a=e.skew,l=c,o!==a?f.push({i:l.push(cu(l)+"skewX(",null,")")-2,x:Hi(o,a)}):a&&l.push(cu(l)+"skewX("+a+")"),function(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(cu(e)+"scale(",null,",",null,")");r.push({i:i-4,x:Hi(n[0],t[0])},{i:i-2,x:Hi(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(cu(e)+"scale("+t+")")}(t.scale,e.scale,c,f),t=e=null,function(n){for(var t,e=-1,r=f.length;++e0?r=n:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:r=0})):n>0&&(l.start({type:"start",alpha:r=n}),t=St(a.tick)),a):r},a.start=function(){var n,t,e,r=y.length,l=m.length,f=c[0],g=c[1];for(n=0;n=0;)e.push(i[r])}function Su(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++o=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;e&&(u.value=0),u.children=c}else e&&(u.value=+e.call(r,u,u.depth)||0),delete u.children;return Su(i,function(t){var r,i;n&&(r=t.children)&&r.sort(n),e&&(i=t.parent)&&(i.value+=t.value)}),a}return r.sort=function(t){return arguments.length?(n=t,r):n},r.children=function(n){return arguments.length?(t=n,r):t},r.value=function(n){return arguments.length?(e=n,r):e},r.revalue=function(n){return e&&(wu(n,function(n){n.children&&(n.value=0)}),Su(n,function(n){var t;n.children||(n.value=+e.call(r,n,n.depth)||0),(t=n.parent)&&(t.value+=n.value)})),n},r},n.layout.partition=function(){var t=n.layout.hierarchy(),e=[1,1];function r(n,r){var i=t.call(this,n,r);return function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++ca&&(a=r),o.push(r)}for(e=0;ei&&(r=e,i=t);return r}function ju(n){return n.reduce(Fu,0)}function Fu(n,t){return n+t[1]}function Hu(n,t){return Ou(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Ou(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function Iu(t){return[n.min(t),n.max(t)]}function Yu(n,t){return n.value-t.value}function Zu(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Vu(n,t){n._pack_next=t,t._pack_prev=n}function Xu(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function $u(n){if((t=n.children)&&(l=t.length)){var t,e,r,i,u,o,a,l,c=1/0,f=-1/0,s=1/0,h=-1/0;if(t.forEach(Bu),(e=t[0]).x=-e.r,e.y=0,M(e),l>1&&((r=t[1]).x=r.r,r.y=0,M(r),l>2))for(Ju(e,r,i=t[2]),M(i),Zu(e,i),e._pack_prev=i,Zu(i,r),r=e._pack_next,u=3;u0)for(o=-1;++o=s[0]&&l<=s[1]&&((a=c[n.bisect(h,l,1,g)-1]).y+=v,a.push(u[o]));return c}return u.value=function(n){return arguments.length?(e=n,u):e},u.range=function(n){return arguments.length?(r=dt(n),u):r},u.bins=function(n){return arguments.length?(i="number"==typeof n?function(t){return Ou(t,n)}:dt(n),u):i},u.frequency=function(n){return arguments.length?(t=!!n,u):t},u},n.layout.pack=function(){var t,e=n.layout.hierarchy().sort(Yu),r=0,i=[1,1];function u(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Su(a,function(n){n.r=+f(n.value)}),Su(a,$u),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;Su(a,function(n){n.r+=s}),Su(a,$u),Su(a,function(n){n.r-=s})}return function n(t,e,r,i){var u=t.children;t.x=e+=i*t.x;t.y=r+=i*t.y;t.r*=i;if(u)for(var o=-1,a=u.length;++op.x&&(p=n),n.depth>g.depth&&(g=n)});var v=e(h,p)/2-h.x,d=r[0]/(p.x+e(p,h)/2+v),y=r[1]/(g.depth||1);wu(f,function(n){n.x=(n.x+v)*d,n.y=n.depth*y})}return c}function o(n){var t=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(t.length){!function(n){var t,e=0,r=0,i=n.children,u=i.length;for(;--u>=0;)(t=i[u]).z+=e,t.m+=e,e+=t.s+(r+=t.c)}(n);var u=(t[0].z+t[t.length-1].z)/2;i?(n.z=i.z+e(n._,i._),n.m=n.z-u):n.z=u}else i&&(n.z=i.z+e(n._,i._));n.parent.A=function(n,t,r){if(t){for(var i,u=n,o=n,a=t,l=u.parent.children[0],c=u.m,f=o.m,s=a.m,h=l.m;a=Qu(a),u=Ku(u),a&&u;)l=Ku(l),(o=Qu(o)).a=n,(i=a.z+s-u.z-c+e(a._,u._))>0&&(no((g=n,v=r,(p=a).a.parent===g.parent?p.a:v),n,i),c+=i,f+=i),s+=a.m,c+=u.m,h+=l.m,f+=o.m;a&&!Qu(o)&&(o.t=a,o.m+=s-f),u&&!Ku(l)&&(l.t=u,l.m+=c-h,r=n)}var p,g,v;return r}(n,i,n.parent.A||r[0])}function a(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function l(n){n.x*=r[0],n.y=n.depth*r[1]}return u.separation=function(n){return arguments.length?(e=n,u):e},u.size=function(n){return arguments.length?(i=null==(r=n)?l:null,u):i?null:r},u.nodeSize=function(n){return arguments.length?(i=null==(r=n)?null:l,u):i?r:null},_u(u,t)},n.layout.cluster=function(){var t=n.layout.hierarchy().sort(null).value(null),e=Gu,r=[1,1],i=!1;function u(u,o){var a,l=t.call(this,u,o),c=l[0],f=0;Su(c,function(t){var r,i,u=t.children;u&&u.length?(t.x=(i=u).reduce(function(n,t){return n+t.x},0)/i.length,t.y=(r=u,1+n.max(r,function(n){return n.y}))):(t.x=a?f+=e(t,a):0,t.y=0,a=t)});var s=function n(t){var e=t.children;return e&&e.length?n(e[0]):t}(c),h=function n(t){var e,r=t.children;return r&&(e=r.length)?n(r[e-1]):t}(c),p=s.x-e(s,h)/2,g=h.x+e(h,s)/2;return Su(c,i?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-p)/(g-p)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),l}return u.separation=function(n){return arguments.length?(e=n,u):e},u.size=function(n){return arguments.length?(i=null==(r=n),u):i?null:r},u.nodeSize=function(n){return arguments.length?(i=null!=(r=n),u):i?r:null},_u(u,t)},n.layout.treemap=function(){var t,e=n.layout.hierarchy(),r=Math.round,i=[1,1],u=null,o=to,a=!1,l="squarify",c=.5*(1+Math.sqrt(5));function f(n,t){for(var e,r,i=-1,u=n.length;++i0;)a.push(e=c[i-1]),a.area+=e.area,"squarify"!==l||(r=p(a,v))<=h?(c.pop(),h=r):(a.area-=a.pop().area,g(a,v,u,!1),v=Math.min(u.dx,u.dy),a.length=a.area=0,h=1/0);a.length&&(g(a,v,u,!0),a.length=a.area=0),t.forEach(s)}}function h(n){var t=n.children;if(t&&t.length){var e,r=o(n),i=t.slice(),u=[];for(f(i,r.dx*r.dy/n.value),u.area=0;e=i.pop();)u.push(e),u.area+=e.area,null!=e.z&&(g(u,e.z?r.dx:r.dy,r,!i.length),u.length=u.area=0);t.forEach(h)}}function p(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++oi&&(i=e));return t*=t,(r*=r)?Math.max(t*i*c/r,r/(t*u*c)):1/0}function g(n,t,e,i){var u,o=-1,a=n.length,l=e.x,c=e.y,f=t?r(n.area/t):0;if(t==e.dx){for((i||f>e.dy)&&(f=e.dy);++oe.dx)&&(f=e.dx);++o1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=n.random.normal.apply(n,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=n.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(n){return function(){for(var t=0,e=0;e2?co:uo,a=i?hu:su;return u=n(t,e,a,r),o=n(e,t,a,Zi),l}function l(n){return u(n)}l.invert=function(n){return o(n)};l.domain=function(n){return arguments.length?(t=n.map(Number),a()):t};l.range=function(n){return arguments.length?(e=n,a()):e};l.rangeRound=function(n){return l.range(n).interpolate(iu)};l.clamp=function(n){return arguments.length?(i=n,a()):i};l.interpolate=function(n){return arguments.length?(r=n,a()):r};l.ticks=function(n){return po(t,n)};l.tickFormat=function(n,e){return go(t,n,e)};l.nice=function(n){return so(t,n),a()};l.copy=function(){return n(t,e,r,i)};return a()}([0,1],[0,1],Zi,!1)};var vo={s:1,g:1,p:1,r:1,e:1};function yo(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}n.scale.log=function(){return function t(e,r,i,u){function o(n){return(i?Math.log(n<0?0:n):-Math.log(n>0?0:-n))/Math.log(r)}function a(n){return i?Math.pow(r,n):-Math.pow(r,-n)}function l(n){return e(o(n))}l.invert=function(n){return a(e.invert(n))};l.domain=function(n){return arguments.length?(i=n[0]>=0,e.domain((u=n.map(Number)).map(o)),l):u};l.base=function(n){return arguments.length?(r=+n,e.domain(u.map(o)),l):r};l.nice=function(){var n=oo(u.map(o),i?Math:Mo);return e.domain(n),u=n.map(a),l};l.ticks=function(){var n=ro(u),t=[],e=n[0],l=n[1],c=Math.floor(o(e)),f=Math.ceil(o(l)),s=r%1?2:r;if(isFinite(f-c)){if(i){for(;c0;h--)t.push(a(c)*h);for(c=0;t[c]l;f--);t=t.slice(c,f)}return t};l.tickFormat=function(t,e){if(!arguments.length)return mo;arguments.length<2?e=mo:"function"!=typeof e&&(e=n.format(e));var i=Math.max(1,r*t/l.ticks().length);return function(n){var t=n/a(Math.round(o(n)));return t*r0?i[n-1]:e[0],ns?0:1;if(c=En)return l(c,p)+(a?l(a,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+o.apply(this,arguments)||0)/2)&&(d=r===No?Math.sqrt(a*a+c*c):+r.apply(this,arguments),p||(E*=-1),c&&(E=Rn(d/c*Math.sin(y))),a&&(N=Rn(d/a*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=kn?0:1;if(E&&qo(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(a){_=a*Math.cos(s-N),w=a*Math.sin(s-N),S=a*Math.cos(f+N),k=a*Math.sin(f+N);var L=Math.abs(f-s+2*N)<=kn?0:1;if(N&&qo(_,w,S,k)===1-p^L){var q=(f+s)/2;_=a*Math.cos(q),w=a*Math.sin(q),S=k=null}}else _=w=0;if(h>wn&&(g=Math.min(Math.abs(c-a)/2,+e.apply(this,arguments)))>.001){v=a0?0:1}function To(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(y<0?-1:1)*Math.sqrt(Math.max(0,M*M*m-x*x)),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Ro(n){var t=Kr,e=Qr,r=Xe,i=Po,u=i.key,o=.7;function a(u){var a,l=[],c=[],f=-1,s=u.length,h=dt(t),p=dt(e);function g(){l.push("M",i(n(c),o))}for(;++f1&&i.push("H",r[0]);return i.join("")},"step-before":jo,"step-after":Fo,basis:Io,"basis-open":function(n){if(n.length<4)return Po(n);var t,e=[],r=-1,i=n.length,u=[0],o=[0];for(;++r<3;)t=n[r],u.push(t[0]),o.push(t[1]);e.push(Yo(Xo,u)+","+Yo(Xo,o)),--r;for(;++r9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));a=-1;for(;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}(n))}});function Po(n){return n.length>1?n.join("L"):n+"Z"}function Uo(n){return n.join("L")+"Z"}function jo(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;ckn)+",1 "+t}function l(n,t,e,r){return"Q 0,0 "+r}return u.radius=function(n){return arguments.length?(e=dt(n),u):e},u.source=function(t){return arguments.length?(n=dt(t),u):n},u.target=function(n){return arguments.length?(t=dt(n),u):t},u.startAngle=function(n){return arguments.length?(r=dt(n),u):r},u.endAngle=function(n){return arguments.length?(i=dt(n),u):i},u},n.svg.diagonal=function(){var n=jr,t=Fr,e=Ko;function r(r,i){var u=n.call(this,r,i),o=t.call(this,r,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return"M"+(l=l.map(e))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return r.source=function(t){return arguments.length?(n=dt(t),r):n},r.target=function(n){return arguments.length?(t=dt(n),r):t},r.projection=function(n){return arguments.length?(e=n,r):e},r},n.svg.diagonal.radial=function(){var t=n.svg.diagonal(),e=Ko,r=t.projection;return t.projection=function(n){return arguments.length?r((t=e=n,function(){var n=t.apply(this,arguments),e=n[0],r=n[1]-An;return[e*Math.cos(r),e*Math.sin(r)]})):e;var t},t},n.svg.symbol=function(){var n=na,t=Qo;function e(e,r){return(ea.get(n.call(this,e,r))||ta)(t.call(this,e,r))}return e.type=function(t){return arguments.length?(n=dt(t),e):n},e.size=function(n){return arguments.length?(t=dt(n),e):t},e};var ea=n.map({circle:ta,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*ia)),e=t*ia;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/ra),e=t*ra/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/ra),e=t*ra/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});n.svg.symbolTypes=ea.keys();var ra=Math.sqrt(3),ia=Math.tan(30*Cn);X.transition=function(n){for(var t,e,r=la||++sa,i=ga(n),u=[],o=ca||{time:Date.now(),ease:Qi,delay:0,duration:250},a=-1,l=this.length;++a0;)c[--h].call(n,o);if(u>=1)return s.event&&s.event.end.call(n,n.__data__,t),--f.count?delete f[r]:delete n[e],1}s||(u=i.time,o=St(function(n){var t=s.delay;if(o.t=t+u,t<=n)return h(n-t);o.c=h},0,u),s=f[r]={tween:new M,time:u,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++f.count)}fa.call=X.call,fa.empty=X.empty,fa.node=X.node,fa.size=X.size,n.transition=function(t,e){return t&&t.transition?la?t.transition(e):t:n.selection().transition(t)},n.transition.prototype=fa,fa.select=function(n){var t,e,r,i=this.id,u=this.namespace,o=[];n=$(n);for(var a=-1,l=this.length;++arect,.s>rect").attr("width",a[1]-a[0])}function v(n){n.select(".extent").attr("y",l[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function d(){var s,d,y=this,m=n.select(n.event.target),M=r.of(y,arguments),x=n.select(y),b=m.datum(),_=!/^(n|s)$/.test(b)&&i,w=!/^(e|w)$/.test(b)&&o,S=m.classed("extent"),k=Mn(y),N=n.mouse(y),E=n.select(u(y)).on("keydown.brush",function(){32==n.event.keyCode&&(S||(s=null,N[0]-=a[1],N[1]-=l[1],S=2),U())}).on("keyup.brush",function(){32==n.event.keyCode&&2==S&&(N[0]+=a[1],N[1]+=l[1],S=0,U())});if(n.event.changedTouches?E.on("touchmove.brush",z).on("touchend.brush",q):E.on("mousemove.brush",z).on("mouseup.brush",q),x.interrupt().selectAll("*").interrupt(),S)N[0]=a[0]-N[0],N[1]=l[0]-N[1];else if(b){var A=+/w$/.test(b),C=+/^n/.test(b);d=[a[1-A]-N[0],l[1-C]-N[1]],N[0]=a[A],N[1]=l[C]}else n.event.altKey&&(s=N.slice());function z(){var t=n.mouse(y),e=!1;d&&(t[0]+=d[0],t[1]+=d[1]),S||(n.event.altKey?(s||(s=[(a[0]+a[1])/2,(l[0]+l[1])/2]),N[0]=a[+(t[0]1?{floor:function(t){for(;a(t=n.floor(t));)t=Ea(t-1);return t},ceil:function(t){for(;a(t=n.ceil(t));)t=Ea(+t+1);return t}}:n))},i.ticks=function(n,t){var e=ro(i.domain()),r=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return r&&(n=r[0],t=r[1]),n.range(e[0],Ea(+e[1]+1),t<1?1:t)},i.tickFormat=function(){return r},i.copy=function(){return Na(t.copy(),e,r)},fo(i,t)}function Ea(n){return new Date(n)}_a.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?ka:Sa,ka.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},ka.toString=Sa.toString,Tt.second=Ut(function(n){return new Rt(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Tt.seconds=Tt.second.range,Tt.seconds.utc=Tt.second.utc.range,Tt.minute=Ut(function(n){return new Rt(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Tt.minutes=Tt.minute.range,Tt.minutes.utc=Tt.minute.utc.range,Tt.hour=Ut(function(n){var t=n.getTimezoneOffset()/60;return new Rt(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Tt.hours=Tt.hour.range,Tt.hours.utc=Tt.hour.utc.range,Tt.month=Ut(function(n){return(n=Tt.day(n)).setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Tt.months=Tt.month.range,Tt.months.utc=Tt.month.utc.range;var Aa=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ca=[[Tt.second,1],[Tt.second,5],[Tt.second,15],[Tt.second,30],[Tt.minute,1],[Tt.minute,5],[Tt.minute,15],[Tt.minute,30],[Tt.hour,1],[Tt.hour,3],[Tt.hour,6],[Tt.hour,12],[Tt.day,1],[Tt.day,2],[Tt.week,1],[Tt.month,1],[Tt.month,3],[Tt.year,1]],za=_a.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Xe]]),La={range:function(t,e,r){return n.range(Math.ceil(t/r)*r,+e,r).map(Ea)},floor:z,ceil:z};Ca.year=Tt.year,Tt.scale=function(){return Na(n.scale.linear(),Ca,za)};var qa=Ca.map(function(n){return[n[0].utc,n[1]]}),Ta=wa.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Xe]]);function Ra(n){return JSON.parse(n.responseText)}function Da(n){var t=r.createRange();return t.selectNode(r.body),t.createContextualFragment(n.responseText)}qa.year=Tt.year.utc,Tt.scale.utc=function(){return Na(n.scale.linear(),qa,Ta)},n.text=yt(function(n){return n.responseText}),n.json=function(n,t){return mt(n,"application/json",Ra,t)},n.html=function(n,t){return mt(n,"text/html",Da,t)},n.xml=yt(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=n,define(n)):"object"==typeof module&&module.exports?module.exports=n:this.d3=n}(); +},{}],5:[function(require,module,exports) { +!function(){var t={dev:!1};t.tooltip=t.tooltip||{},t.utils=t.utils||{},t.models=t.models||{},t.charts={},t.logs={},t.dom={},"undefined"!=typeof module&&"undefined"!=typeof exports&&"undefined"==typeof d3&&(d3=require("d3")),t.dispatch=d3.dispatch("render_start","render_end"),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i}),t.dev&&(t.dispatch.on("render_start",function(e){t.logs.startTime=+new Date}),t.dispatch.on("render_end",function(e){t.logs.endTime=+new Date,t.logs.totalTime=t.logs.endTime-t.logs.startTime,t.log("total",t.logs.totalTime)})),t.log=function(){if(t.dev&&window.console&&console.log&&console.log.apply);else if(t.dev&&window.console&&"function"==typeof console.log&&Function.prototype.bind){Function.prototype.bind.call(console.log,console).apply(console,arguments)}return arguments[arguments.length-1]},t.deprecated=function(t,e){console&&console.warn},t.render=function(e){e=e||1,t.render.active=!0,t.dispatch.render_start();var n=function(){for(var r,i,o=0;op||n>h||d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement||a){if(u&&d3.event.relatedTarget&&void 0===d3.event.relatedTarget.ownerSVGElement&&(void 0===d3.event.relatedTarget.className||d3.event.relatedTarget.className.match(l.nvPointerEventsClass)))return;return o.elementMouseout({mouseX:t,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0)}l.hidden(!1);var s=void 0;if("function"==typeof i.rangeBands){var d=d3.bisect(i.range(),t)-1;if(!(i.range()[d]+i.rangeBand()>=t))return o.elementMouseout({mouseX:t,mouseY:n}),c.renderGuideLine(null),void l.hidden(!0);s=i.domain()[d3.bisect(i.range(),t)-1]}else s=i.invert(t);o.elementMousemove({mouseX:t,mouseY:n,pointXValue:s}),"dblclick"===d3.event.type&&o.elementDblclick({mouseX:t,mouseY:n,pointXValue:s}),"click"===d3.event.type&&o.elementClick({mouseX:t,mouseY:n,pointXValue:s}),"mousedown"===d3.event.type&&o.elementMouseDown({mouseX:t,mouseY:n,pointXValue:s}),"mouseup"===d3.event.type&&o.elementMouseUp({mouseX:t,mouseY:n,pointXValue:s})}g.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer").append("g").attr("class","nv-interactiveGuideLine"),s&&(s.on("touchmove",v).on("mousemove",v,!0).on("mouseout",v,!0).on("mousedown",v,!0).on("mouseup",v,!0).on("dblclick",v).on("click",v),c.guideLine=null,c.renderGuideLine=function(e){a&&(c.guideLine&&c.guideLine.attr("x1")===e||t.dom.write(function(){var n=g.select(".nv-interactiveGuideLine").selectAll("line").data(null!=e?[t.utils.NaNtoZero(e)]:[],String);n.enter().append("line").attr("class","nv-guideline").attr("x1",function(t){return t}).attr("x2",function(t){return t}).attr("y1",h).attr("y2",0),n.exit().remove()}))})})}return l.duration(0).hideDelay(0).hidden(!1),c.dispatch=o,c.tooltip=l,c.margin=function(t){return arguments.length?(e.top=void 0!==t.top?t.top:e.top,e.left=void 0!==t.left?t.left:e.left,c):e},c.width=function(t){return arguments.length?(n=t,c):n},c.height=function(t){return arguments.length?(r=t,c):r},c.xScale=function(t){return arguments.length?(i=t,c):i},c.showGuideLine=function(t){return arguments.length?(a=t,c):a},c.svgContainer=function(t){return arguments.length?(s=t,c):s},c},t.interactiveBisect=function(t,e,n){"use strict";if(!(t instanceof Array))return null;var r;r="function"!=typeof n?function(t){return t.x}:n;var i=d3.bisector(function(t,e){return r(t)-e}).left,o=d3.max([0,i(t,e)-1]),a=r(t[o]);if(void 0===a&&(a=o),a===e)return o;var s=d3.min([o+1,t.length-1]),l=r(t[s]);return void 0===l&&(l=s),Math.abs(l-e)>=Math.abs(a-e)?o:s},t.nearestValueIndex=function(t,e,n){"use strict";var r=1/0,i=null;return t.forEach(function(t,o){var a=Math.abs(e-t);null!=t&&a<=r&&a"+t.footer+"
"),i},x=function(){var t={left:null!==d3.event?d3.event.clientX:0,top:null!==d3.event?d3.event.clientY:0};if("none"!=getComputedStyle(document.body).transform){var e=document.body.getBoundingClientRect();t.left-=e.left,t.top-=e.top}return t},b=function(e){if(e&&e.series){if(t.utils.isArray(e.series))return!0;if(t.utils.isObject(e.series))return e.series=[e.series],!0}return!1},k=function(){t.dom.read(function(){var t=x(),e=function(t){var e,n,o,a=u.node().offsetHeight,s=u.node().offsetWidth,l=document.documentElement.clientWidth,c=document.documentElement.clientHeight;switch(r){case"e":e=-s-i,n=-a/2,t.left+e<0&&(e=i),(o=t.top+n)<0&&(n-=o),(o=t.top+n+a)>c&&(n-=o-c);break;case"w":e=i,n=-a/2,t.left+e+s>l&&(e=-s-i),(o=t.top+n)<0&&(n-=o),(o=t.top+n+a)>c&&(n-=o-c);break;case"n":e=-s/2-5,n=i,t.top+n+a>c&&(n=-a-i),(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"s":e=-s/2,n=-a-i,t.top+n<0&&(n=i),(o=t.left+e)<0&&(e-=o),(o=t.left+e+s)>l&&(e-=o-l);break;case"center":e=-s/2,n=-a/2;break;default:e=0,n=0}return{left:e,top:n}}(t),n=t.left+e.left,o=t.top+e.top;if(s)u.interrupt().transition().delay(l).duration(0).style("opacity",0);else{var a="translate("+c.left+"px, "+c.top+"px)",d="translate("+Math.round(n)+"px, "+Math.round(o)+"px)",p=d3.interpolateString(a,d),h=u.style("opacity")<.1;u.interrupt().transition().duration(h?0:f).styleTween("transform",function(t){return p},"important").styleTween("-webkit-transform",function(t){return p}).style("-ms-transform",d).style("opacity",1)}c.left=n,c.top=o})};function w(){if(d&&b(n))return t.dom.write(function(){u&&u.node()||((u=d3.select(document.body).select("#"+e).data([1])).enter().append("div").attr("class","nvtooltip "+(a||"xy-tooltip")).attr("id",e).style("top",0).style("left",0).style("opacity",0).style("position","fixed").selectAll("div, table, td, tr").classed(h,!0).classed(h,!0),u.exit().remove());var t=y(n,u.node());t&&(u.node().innerHTML=t),k()}),w}return w.nvPointerEventsClass=h,w.options=t.utils.optionsFunc.bind(w),w._options=Object.create({},{duration:{get:function(){return f},set:function(t){f=t}},gravity:{get:function(){return r},set:function(t){r=t}},distance:{get:function(){return i},set:function(t){i=t}},snapDistance:{get:function(){return o},set:function(t){o=t}},classes:{get:function(){return a},set:function(t){a=t}},enabled:{get:function(){return d},set:function(t){d=t}},hideDelay:{get:function(){return l},set:function(t){l=t}},contentGenerator:{get:function(){return y},set:function(t){y=t}},valueFormatter:{get:function(){return g},set:function(t){g=t}},headerFormatter:{get:function(){return v},set:function(t){v=t}},keyFormatter:{get:function(){return m},set:function(t){m=t}},headerEnabled:{get:function(){return p},set:function(t){p=t}},position:{get:function(){return x},set:function(t){x=t}},chartContainer:{get:function(){return document.body},set:function(e){t.deprecated("chartContainer","feature removed after 1.8.3")}},fixedTop:{get:function(){return null},set:function(e){t.deprecated("fixedTop","feature removed after 1.8.1")}},offset:{get:function(){return{left:0,top:0}},set:function(e){t.deprecated("offset","use chart.tooltip.distance() instead")}},hidden:{get:function(){return s},set:function(t){s!=t&&(s=!!t,w())}},data:{get:function(){return n},set:function(t){t.point&&(t.value=t.point.x,t.series=t.series||{},t.series.value=t.point.y,t.series.color=t.point.color||t.series.color),n=t}},node:{get:function(){return u.node()},set:function(t){}},id:{get:function(){return e},set:function(t){}}}),t.utils.initOptions(w),w},t.utils.windowSize=function(){var t={width:640,height:480};return window.innerWidth&&window.innerHeight?(t.width=window.innerWidth,t.height=window.innerHeight,t):"CSS1Compat"==document.compatMode&&document.documentElement&&document.documentElement.offsetWidth?(t.width=document.documentElement.offsetWidth,t.height=document.documentElement.offsetHeight,t):document.body&&document.body.offsetWidth?(t.width=document.body.offsetWidth,t.height=document.body.offsetHeight,t):t},t.utils.isArray=Array.isArray,t.utils.isObject=function(t){return null!==t&&"object"==typeof t},t.utils.isFunction=function(t){return"function"==typeof t},t.utils.isDate=function(t){return"[object Date]"===toString.call(t)},t.utils.isNumber=function(t){return!isNaN(t)&&"number"==typeof t},t.utils.windowResize=function(e){return window.addEventListener?window.addEventListener("resize",e):t.log("ERROR: Failed to bind to window.resize with: ",e),{callback:e,clear:function(){window.removeEventListener("resize",e)}}},t.utils.getColor=function(e){if(void 0===e)return t.utils.defaultColor();if(t.utils.isArray(e)){var n=d3.scale.ordinal().range(e);return function(t,e){var r=void 0===e?t:e;return t.color||n(r)}}return e},t.utils.defaultColor=function(){return t.utils.getColor(d3.scale.category20().range())},t.utils.customTheme=function(e,n,r){n=n||function(t){return t.key};var i=(r=r||d3.scale.category20().range()).length;return function(o,a){var s=n(o);return t.utils.isFunction(e[s])?e[s]():void 0!==e[s]?e[s]:(i||(i=r.length),r[i-=1])}},t.utils.pjax=function(e,n){var r=function(r){d3.html(r,function(r){var i=d3.select(n).node();i.parentNode.replaceChild(d3.select(r).select(n).node(),i),t.utils.pjax(e,n)})};d3.selectAll(e).on("click",function(){history.pushState(this.href,this.textContent,this.href),r(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&r(d3.event.state)})},t.utils.calcApproxTextWidth=function(e){if(t.utils.isFunction(e.style)&&t.utils.isFunction(e.text)){var n=parseInt(e.style("font-size").replace("px",""),10),r=e.text().length;return t.utils.NaNtoZero(r*n*.5)}return 0},t.utils.NaNtoZero=function(e){return!t.utils.isNumber(e)||isNaN(e)||null===e||e===1/0||e===-1/0?0:e},d3.selection.prototype.watchTransition=function(t){var e=[this].concat([].slice.call(arguments,1));return t.transition.apply(t,e)},t.utils.renderWatch=function(e,n){if(!(this instanceof t.utils.renderWatch))return new t.utils.renderWatch(e,n);var r=void 0!==n?n:250,i=[],o=this;this.models=function(t){return[].slice.call(arguments,0).forEach(function(t){var e;t.__rendered=!1,(e=t).dispatch.on("renderEnd",function(t){e.__rendered=!0,o.renderEnd("model")}),i.indexOf(t)<0&&i.push(t)}),this},this.reset=function(t){void 0!==t&&(r=t),i=[]},this.transition=function(t,e,n){if(n=(e=arguments.length>1?[].slice.call(arguments,1):[]).length>1?e.pop():void 0!==r?r:250,t.__rendered=!1,i.indexOf(t)<0&&i.push(t),0===n)return t.__rendered=!0,t.delay=function(){return this},t.duration=function(){return this},t;0===t.length?t.__rendered=!0:t.every(function(t){return!t.length})?t.__rendered=!0:t.__rendered=!1;var a=0;return t.transition().duration(n).each(function(){++a}).each("end",function(n,r){0==--a&&(t.__rendered=!0,o.renderEnd.apply(this,e))})},this.renderEnd=function(){i.every(function(t){return t.__rendered})&&(i.forEach(function(t){t.__rendered=!1}),e.renderEnd.apply(this,arguments))}},t.utils.deepExtend=function(e){(arguments.length>1?[].slice.call(arguments,1):[]).forEach(function(n){for(var r in n){var i=t.utils.isArray(e[r]),o=t.utils.isObject(e[r]),a=t.utils.isObject(n[r]);o&&!i&&a?t.utils.deepExtend(e[r],n[r]):e[r]=n[r]}})},t.utils.state=function(){if(!(this instanceof t.utils.state))return new t.utils.state;var e={},n=function(){},r=function(){return{}},i=null;this.dispatch=d3.dispatch("change","set"),this.dispatch.on("set",function(t){n(t,!0)}),this.getter=function(t){return r=t,this},this.setter=function(t,e){return e||(e=function(){}),n=function(n,r){t(n),r&&e()},this},this.init=function(e){i=i||{},t.utils.deepExtend(i,e)};this.update=function(){i&&(n(i,!1),i=null),function(){var t=r();if(JSON.stringify(t)===JSON.stringify(e))return!1;for(var n in t)void 0===e[n]&&(e[n]={}),e[n]=t[n],!0;return!0}.call(this)&&this.dispatch.change(e)}},t.utils.optionsFunc=function(e){return e&&d3.map(e).forEach(function(e,n){t.utils.isFunction(this[e])&&this[e](n)}.bind(this)),this},t.utils.calcTicksX=function(e,n){for(var r=1,i=0;ir?o:r}return t.log("Requested number of ticks: ",e),t.log("Calculated max values to be: ",r),e=(e=e>r?e=r-1:e)<1?1:e,e=Math.floor(e),t.log("Calculating tick count as: ",e),e},t.utils.calcTicksY=function(e,n){return t.utils.calcTicksX(e,n)},t.utils.initOption=function(t,e){t._calls&&t._calls[e]?t[e]=t._calls[e]:(t[e]=function(n){return arguments.length?(t._overrides[e]=!0,t._options[e]=n,t):t._options[e]},t["_"+e]=function(n){return arguments.length?(t._overrides[e]||(t._options[e]=n),t):t._options[e]})},t.utils.initOptions=function(e){e._overrides=e._overrides||{};var n=Object.getOwnPropertyNames(e._options||{}),r=Object.getOwnPropertyNames(e._calls||{});n=n.concat(r);for(var i in n)t.utils.initOption(e,n[i])},t.utils.inheritOptionsD3=function(t,e,n){t._d3options=n.concat(t._d3options||[]),t._d3options=(t._d3options||[]).filter(function(t,e,n){return n.indexOf(t)===e}),n.unshift(e),n.unshift(t),d3.rebind.apply(this,n)},t.utils.arrayUnique=function(t){return t.sort().filter(function(e,n){return!n||e!=t[n-1]})},t.utils.symbolMap=d3.map(),t.utils.symbol=function(){var e,n=64;function r(r,i){var o=e.call(this,r,i),a=n.call(this,r,i);return-1!==d3.svg.symbolTypes.indexOf(o)?d3.svg.symbol().type(o).size(a)():t.utils.symbolMap.get(o)(a)}return r.type=function(t){return arguments.length?(e=d3.functor(t),r):e},r.size=function(t){return arguments.length?(n=d3.functor(t),r):n},r},t.utils.inheritOptions=function(e,n){var r=Object.getOwnPropertyNames(n._options||{}),i=Object.getOwnPropertyNames(n._calls||{}),o=n._inherited||[],a=n._d3options||[],s=r.concat(i).concat(o).concat(a);s.unshift(n),s.unshift(e),d3.rebind.apply(this,s),e._inherited=t.utils.arrayUnique(r.concat(i).concat(o).concat(r).concat(e._inherited||[])),e._d3options=t.utils.arrayUnique(a.concat(e._d3options||[]))},t.utils.initSVG=function(t){t.classed({"nvd3-svg":!0})},t.utils.sanitizeHeight=function(t,e){return t||parseInt(e.style("height"),10)||400},t.utils.sanitizeWidth=function(t,e){return t||parseInt(e.style("width"),10)||960},t.utils.availableHeight=function(e,n,r){return Math.max(0,t.utils.sanitizeHeight(e,n)-r.top-r.bottom)},t.utils.availableWidth=function(e,n,r){return Math.max(0,t.utils.sanitizeWidth(e,n)-r.left-r.right)},t.utils.noData=function(e,n){var r=e.options(),i=r.margin(),o=r.noData(),a=null==o?["No Data Available."]:[o],s=t.utils.availableHeight(null,n,i),l=t.utils.availableWidth(null,n,i),u=i.left+l/2,c=i.top+s/2;n.selectAll("g").remove();var d=n.selectAll(".nv-noData").data(a);d.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),d.attr("x",u).attr("y",c).text(function(t){return t})},t.utils.wrapTicks=function(t,e){t.each(function(){for(var t,n=d3.select(this),r=n.text().split(/\s+/).reverse(),i=[],o=0,a=n.attr("y"),s=parseFloat(n.attr("dy")),l=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");t=r.pop();)i.push(t),l.text(i.join(" ")),l.node().getComputedTextLength()>e&&(i.pop(),l.text(i.join(" ")),i=[t],l=n.append("tspan").attr("x",0).attr("y",a).attr("dy",1.1*++o+s+"em").text(t))})},t.utils.arrayEquals=function(e,n){if(e===n)return!0;if(!e||!n)return!1;if(e.length!=n.length)return!1;for(var r=0,i=e.length;r2&&(A=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",0).attr("x",A/2),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),M.exit().remove(),M.attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(i(e))+",0)"}).select("text").attr("dy","-0.5em").attr("y",-r.tickPadding()).attr("text-anchor","middle").text(function(t,n){var r=(e||k)(t);return(""+r).match("NaN")?"":r}),M.watchTransition(x,"min-max top").attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(i.range()[n])+",0)"}));break;case"bottom":w=g+36;var S=30,W=0,E=b.selectAll("g").select("text"),F="";if(c%360){E.attr("transform",""),E.each(function(t,e){var n=this.getBoundingClientRect(),r=n.width;W=n.height,r>S&&(S=r)}),F="rotate("+c+" 0,"+(W/2+r.tickPadding())+")";var N=Math.abs(Math.sin(c*Math.PI/180));w=(N?N*S:S)+30,E.attr("transform",F).style("text-anchor",c%360>0?"start":"end")}else f?E.attr("transform",function(t,e){return"translate(0,"+(e%2==0?"0":"12")+")"}):E.attr("transform","translate(0,0)");C.enter().append("text").attr("class","nv-axislabel"),A=0,1===i.range().length?A=p?2*i.range()[0]+i.rangeBand():0:2===i.range().length?A=p?i.range()[0]+i.range()[1]+i.rangeBand():i.range()[1]:i.range().length>2&&(A=i.range()[i.range().length-1]+(i.range()[1]-i.range()[0])),C.attr("text-anchor","middle").attr("y",w).attr("x",A/2),u&&((M=y.selectAll("g.nv-axisMaxMin").data([i.domain()[0],i.domain()[i.domain().length-1]])).enter().append("g").attr("class",function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-x",0==e?"nv-axisMin-x":"nv-axisMax-x"].join(" ")}).append("text"),M.exit().remove(),M.attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(i(e)+(p?i.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",r.tickPadding()).attr("transform",F).style("text-anchor",c?c%360>0?"start":"end":"middle").text(function(t,n){var r=(e||k)(t);return(""+r).match("NaN")?"":r}),M.watchTransition(x,"min-max bottom").attr("transform",function(e,n){return"translate("+t.utils.NaNtoZero(i(e)+(p?i.rangeBand()/2:0))+",0)"}));break;case"right":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"begin").attr("transform",d?"rotate(90)":"").attr("y",d?12-Math.max(o.right,a)-(g||0):-10).attr("x",d?d3.max(i.range())/2:r.tickPadding()),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),M.exit().remove(),M.attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(i(e))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",r.tickPadding()).style("text-anchor","start").text(function(t,n){var r=(e||k)(t);return(""+r).match("NaN")?"":r}),M.watchTransition(x,"min-max right").attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(i.range()[n])+")"}).select("text").style("opacity",1));break;case"left":C.enter().append("text").attr("class","nv-axislabel"),C.style("text-anchor",d?"middle":"end").attr("transform",d?"rotate(-90)":"").attr("y",d?25-Math.max(o.left,a)-(g||0):-10).attr("x",d?-d3.max(i.range())/2:-r.tickPadding()),u&&((M=y.selectAll("g.nv-axisMaxMin").data(i.domain())).enter().append("g").attr("class",function(t,e){return["nv-axisMaxMin","nv-axisMaxMin-y",0==e?"nv-axisMin-y":"nv-axisMax-y"].join(" ")}).append("text").style("opacity",0),M.exit().remove(),M.attr("transform",function(e,r){return"translate(0,"+t.utils.NaNtoZero(n(e))+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-r.tickPadding()).attr("text-anchor","end").text(function(t,n){var r=(e||k)(t);return(""+r).match("NaN")?"":r}),M.watchTransition(x,"min-max right").attr("transform",function(e,n){return"translate(0,"+t.utils.NaNtoZero(i.range()[n])+")"}).select("text").style("opacity",1))}if(C.text(function(t){return t}),!u||"left"!==r.orient()&&"right"!==r.orient()||(b.selectAll("g").each(function(t,e){d3.select(this).select("text").attr("opacity",1),(i(t)i.range()[0]-10)&&((t>1e-10||t<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0))}),i.domain()[0]==i.domain()[1]&&0==i.domain()[0]&&y.selectAll("g.nv-axisMaxMin").style("opacity",function(t,e){return e?0:1})),u&&("top"===r.orient()||"bottom"===r.orient())){var D=[];y.selectAll("g.nv-axisMaxMin").each(function(t,e){try{e?D.push(i(t)-this.getBoundingClientRect().width-4):D.push(i(t)+this.getBoundingClientRect().width+4)}catch(n){e?D.push(i(t)-4):D.push(i(t)+4)}}),b.selectAll("g").each(function(t,e){(i(t)D[1])&&(t>1e-10||t<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())})}b.selectAll(".tick").filter(function(t){return!parseFloat(Math.round(1e5*t)/1e6)&&void 0!==t}).classed("zero",!0),n=i.copy()}),x.renderEnd("axis immediate"),b}return b.axis=r,b.dispatch=y,b.options=t.utils.optionsFunc.bind(b),b._options=Object.create({},{axisLabelDistance:{get:function(){return g},set:function(t){g=t}},staggerLabels:{get:function(){return f},set:function(t){f=t}},rotateLabels:{get:function(){return c},set:function(t){c=t}},rotateYLabel:{get:function(){return d},set:function(t){d=t}},showMaxMin:{get:function(){return u},set:function(t){u=t}},axisLabel:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return s},set:function(t){s=t}},ticks:{get:function(){return h},set:function(t){h=t}},width:{get:function(){return a},set:function(t){a=t}},fontSize:{get:function(){return v},set:function(t){v=t}},tickFormatMaxMin:{get:function(){return e},set:function(t){e=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},duration:{get:function(){return m},set:function(t){m=t,x.reset(m)}},scale:{get:function(){return i},set:function(e){i=e,r.scale(i),p="function"==typeof i.rangeBands,t.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"])}}}),t.utils.initOptions(b),t.utils.inheritOptionsD3(b,r,["orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"]),t.utils.inheritOptionsD3(b,i,["domain","range","rangeBand","rangeBands"]),b},t.models.boxPlot=function(){"use strict";var e,n,r,i,o,a,s={top:0,right:0,bottom:0,left:0},l=960,u=500,c=Math.floor(1e4*Math.random()),d=d3.scale.ordinal(),f=d3.scale.linear(),p=function(t){return t.label},h=function(t){return t.values.Q1},g=function(t){return t.values.Q2},v=function(t){return t.values.Q3},m=function(t){return t.values.whisker_low},y=function(t){return t.values.whisker_high},x=function(t){return t.color},b=function(t){return t.values.outliers},k=function(t,e,n){return t},w=function(t,e,n){return t},M=function(t,e,n){},A=t.utils.defaultColor(),C=null,S=d3.dispatch("elementMouseover","elementMouseout","elementMousemove","renderEnd"),W=250,E=null,F=t.utils.renderWatch(S,W);function N(c){return F.reset(),c.each(function(c){var N=l-s.left-s.right,D=u-s.top-s.bottom;C=d3.select(this),t.utils.initSVG(C),d.domain(e||c.map(function(t,e){return p(t,e)})).rangeBands(n||[0,N],.1);var O=[];if(!r){var _=[];c.forEach(function(t,e){var n=h(t),r=v(t),i=m(t),o=y(t),a=b(t);a&&a.forEach(function(t,e){_.push(k(t,e,void 0))}),i&&_.push(i),n&&_.push(n),r&&_.push(r),o&&_.push(o)}),O=[d3.min(_),d3.max(_)]}f.domain(r||O),f.range(i||[D,0]),o=o||d,a=a||f.copy().range([f(0),f(0)]);var L=C.selectAll("g.nv-wrap").data([c]);L.enter().append("g").attr("class","nvd3 nv-wrap");L.attr("transform","translate("+s.left+","+s.top+")");var B=L.selectAll(".nv-boxplot").data(function(t){return t}),P=B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);B.attr("class","nv-boxplot").attr("transform",function(t,e,n){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"}).classed("hover",function(t){return t.hover}),B.watchTransition(F,"nv-boxplot: boxplots").style("stroke-opacity",1).style("fill-opacity",.75).delay(function(t,e){return e*W/c.length}).attr("transform",function(t,e){return"translate("+(d(p(t,e))+.05*d.rangeBand())+", 0)"}),B.exit().remove(),P.each(function(t,e){var n=d3.select(this);[m,y].forEach(function(r){if(void 0!==r(t)&&null!==r(t)){var i=r===m?"low":"high";n.append("line").style("stroke",x(t)||A(t,e)).attr("class","nv-boxplot-whisker nv-boxplot-"+i),n.append("line").style("stroke",x(t)||A(t,e)).attr("class","nv-boxplot-tick nv-boxplot-"+i)}})});var T=function(){return null===E?.9*d.rangeBand():Math.min(75,.9*d.rangeBand())},I=function(){return.45*d.rangeBand()-T()/2},z=function(){return.45*d.rangeBand()+T()/2};[m,y].forEach(function(t){var e=t===m?"low":"high",n=t===m?h:v;B.select("line.nv-boxplot-whisker.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",.45*d.rangeBand()).attr("y1",function(e,n){return f(t(e))}).attr("x2",.45*d.rangeBand()).attr("y2",function(t,e){return f(n(t))}),B.select("line.nv-boxplot-tick.nv-boxplot-"+e).watchTransition(F,"nv-boxplot: boxplots").attr("x1",I).attr("y1",function(e,n){return f(t(e))}).attr("x2",z).attr("y2",function(e,n){return f(t(e))})}),[m,y].forEach(function(t){var e=t===m?"low":"high";P.selectAll(".nv-boxplot-"+e).on("mouseover",function(e,n,r){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:t(e),color:x(e)||A(e,r)},e:d3.event})}).on("mouseout",function(e,n,r){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:t(e),color:x(e)||A(e,r)},e:d3.event})}).on("mousemove",function(t,e){S.elementMousemove({e:d3.event})})}),P.append("rect").attr("class","nv-boxplot-box").on("mouseover",function(t,e){d3.select(this).classed("hover",!0),S.elementMouseover({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||A(t,e)},{key:"Q2",value:g(t),color:x(t)||A(t,e)},{key:"Q1",value:h(t),color:x(t)||A(t,e)}],data:t,index:e,e:d3.event})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1),S.elementMouseout({key:p(t),value:p(t),series:[{key:"Q3",value:v(t),color:x(t)||A(t,e)},{key:"Q2",value:g(t),color:x(t)||A(t,e)},{key:"Q1",value:h(t),color:x(t)||A(t,e)}],data:t,index:e,e:d3.event})}).on("mousemove",function(t,e){S.elementMousemove({e:d3.event})}),B.select("rect.nv-boxplot-box").watchTransition(F,"nv-boxplot: boxes").attr("y",function(t,e){return f(v(t))}).attr("width",T).attr("x",I).attr("height",function(t,e){return Math.abs(f(v(t))-f(h(t)))||1}).style("fill",function(t,e){return x(t)||A(t,e)}).style("stroke",function(t,e){return x(t)||A(t,e)}),P.append("line").attr("class","nv-boxplot-median"),B.select("line.nv-boxplot-median").watchTransition(F,"nv-boxplot: boxplots line").attr("x1",I).attr("y1",function(t,e){return f(g(t))}).attr("x2",z).attr("y2",function(t,e){return f(g(t))});var V=B.selectAll(".nv-boxplot-outlier").data(function(t){return b(t)||[]});V.enter().append("circle").style("fill",function(t,e,n){return M(t,e,n)||A(t,n)}).style("stroke",function(t,e,n){return M(t,e,n)||A(t,n)}).style("z-index",9e3).on("mouseover",function(t,e,n){d3.select(this).classed("hover",!0),S.elementMouseover({series:{key:w(t,e,n),color:M(t,e,n)||A(t,n)},e:d3.event})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),S.elementMouseout({series:{key:w(t,e,n),color:M(t,e,n)||A(t,n)},e:d3.event})}).on("mousemove",function(t,e){S.elementMousemove({e:d3.event})}),V.attr("class","nv-boxplot-outlier"),V.watchTransition(F,"nv-boxplot: nv-boxplot-outlier").attr("cx",.45*d.rangeBand()).attr("cy",function(t,e,n){return f(k(t,e,n))}).attr("r","3"),V.exit().remove(),o=d.copy(),a=f.copy()}),F.renderEnd("nv-boxplot immediate"),N}return N.dispatch=S,N.options=t.utils.optionsFunc.bind(N),N._options=Object.create({},{width:{get:function(){return l},set:function(t){l=t}},height:{get:function(){return u},set:function(t){u=t}},maxBoxWidth:{get:function(){return E},set:function(t){E=t}},x:{get:function(){return p},set:function(t){p=t}},q1:{get:function(){return h},set:function(t){h=t}},q2:{get:function(){return g},set:function(t){g=t}},q3:{get:function(){return v},set:function(t){v=t}},wl:{get:function(){return m},set:function(t){m=t}},wh:{get:function(){return y},set:function(t){y=t}},itemColor:{get:function(){return x},set:function(t){x=t}},outliers:{get:function(){return b},set:function(t){b=t}},outlierValue:{get:function(){return k},set:function(t){k=t}},outlierLabel:{get:function(){return w},set:function(t){w=t}},outlierColor:{get:function(){return M},set:function(t){M=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return n},set:function(t){n=t}},yRange:{get:function(){return i},set:function(t){i=t}},id:{get:function(){return c},set:function(t){c=t}},y:{get:function(){return{}},set:function(t){}},margin:{get:function(){return s},set:function(t){s.top=void 0!==t.top?t.top:s.top,s.right=void 0!==t.right?t.right:s.right,s.bottom=void 0!==t.bottom?t.bottom:s.bottom,s.left=void 0!==t.left?t.left:s.left}},color:{get:function(){return A},set:function(e){A=t.utils.getColor(e)}},duration:{get:function(){return W},set:function(t){W=t,F.reset(W)}}}),t.utils.initOptions(N),N},t.models.boxPlotChart=function(){"use strict";var e,n,r=t.models.boxPlot(),i=t.models.axis(),o=t.models.axis(),a={top:15,right:10,bottom:50,left:60},s=null,l=null,u=t.utils.getColor(),c=!0,d=!0,f=!1,p=!1,h=t.models.tooltip(),g="No Data Available.",v=d3.dispatch("beforeUpdate","renderEnd"),m=250;i.orient("bottom").showMaxMin(!1).tickFormat(function(t){return t}),o.orient(f?"right":"left").tickFormat(d3.format(",.1f")),h.duration(0);var y=t.utils.renderWatch(v,m);function x(u){return y.reset(),y.models(r),c&&y.models(i),d&&y.models(o),u.each(function(u){var h=d3.select(this);t.utils.initSVG(h);var y=(s||parseInt(h.style("width"))||960)-a.left-a.right,b=(l||parseInt(h.style("height"))||400)-a.top-a.bottom;if(x.update=function(){v.beforeUpdate(),h.transition().duration(m).call(x)},x.container=this,!u||!u.length){var k=h.selectAll(".nv-noData").data([g]);return k.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),k.attr("x",a.left+y/2).attr("y",a.top+b/2).text(function(t){return t}),x}h.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale().clamp(!0);var w=h.selectAll("g.nv-wrap.nv-boxPlotWithAxes").data([u]),M=w.enter().append("g").attr("class","nvd3 nv-wrap nv-boxPlotWithAxes").append("g"),A=M.append("defs"),C=w.select("g");if(M.append("g").attr("class","nv-x nv-axis"),M.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),M.append("g").attr("class","nv-barsWrap"),C.attr("transform","translate("+a.left+","+a.top+")"),f&&C.select(".nv-y.nv-axis").attr("transform","translate("+y+",0)"),r.width(y).height(b),C.select(".nv-barsWrap").datum(u.filter(function(t){return!t.disabled})).transition().call(r),A.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect"),C.select("#nv-x-label-clip-"+r.id()+" rect").attr("width",e.rangeBand()*(p?2:1)).attr("height",16).attr("x",-e.rangeBand()/(p?1:2)),c){i.scale(e).ticks(t.utils.calcTicksX(y/100,u)).tickSize(-b,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),C.select(".nv-x.nv-axis").call(i);var S=C.select(".nv-x.nv-axis").selectAll("g");p&&S.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"})}d&&(o.scale(n).ticks(Math.floor(b/36)).tickSize(-y,0),C.select(".nv-y.nv-axis").call(o)),C.select(".nv-zeroLine line").attr("x1",0).attr("x2",y).attr("y1",n(0)).attr("y2",n(0))}),y.renderEnd("nv-boxplot chart immediate"),x}return r.dispatch.on("elementMouseover.tooltip",function(t){h.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){h.data(t).hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){h()}),x.dispatch=v,x.boxplot=r,x.xAxis=i,x.yAxis=o,x.tooltip=h,x.options=t.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},staggerLabels:{get:function(){return p},set:function(t){p=t}},showXAxis:{get:function(){return c},set:function(t){c=t}},showYAxis:{get:function(){return d},set:function(t){d=t}},tooltipContent:{get:function(){return h},set:function(t){h=t}},noData:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!==t.top?t.top:a.top,a.right=void 0!==t.right?t.right:a.right,a.bottom=void 0!==t.bottom?t.bottom:a.bottom,a.left=void 0!==t.left?t.left:a.left}},duration:{get:function(){return m},set:function(t){m=t,y.reset(m),r.duration(m),i.duration(m),o.duration(m)}},color:{get:function(){return u},set:function(e){u=t.utils.getColor(e),r.color(u)}},rightAlignYAxis:{get:function(){return f},set:function(t){f=t,o.orient(t?"right":"left")}}}),t.utils.inheritOptions(x,r),t.utils.initOptions(x),x},t.models.bullet=function(){"use strict";var e={top:0,right:0,bottom:0,left:0},n="left",r=!1,i=function(t){return t.ranges},o=function(t){return t.markers?t.markers:[]},a=function(t){return t.markerLines?t.markerLines:[0]},s=function(t){return t.measures},l=function(t){return t.rangeLabels?t.rangeLabels:[]},u=function(t){return t.markerLabels?t.markerLabels:[]},c=function(t){return t.markerLineLabels?t.markerLineLabels:[]},d=function(t){return t.measureLabels?t.measureLabels:[]},f=[0],p=380,h=30,g=null,v=null,m=t.utils.getColor(["#1f77b4"]),y=d3.dispatch("elementMouseover","elementMouseout","elementMousemove"),x=["Maximum","Mean","Minimum"],b=["Max","Avg","Min"],k=1e3;function w(t,e){var n=t.slice();t.sort(function(t,r){var i=n.indexOf(t),o=n.indexOf(r);return d3.descending(e[i],e[o])})}function M(n){return n.each(function(n,v){var M=p-e.left-e.right,A=h-e.top-e.bottom;g=d3.select(this),t.utils.initSVG(g);var C=i.call(this,n,v).slice(),S=o.call(this,n,v).slice(),W=a.call(this,n,v).slice(),E=s.call(this,n,v).slice(),F=l.call(this,n,v).slice(),N=u.call(this,n,v).slice(),D=c.call(this,n,v).slice(),O=d.call(this,n,v).slice();w(F,C),w(N,S),w(D,W),w(O,E),C.sort(d3.descending),S.sort(d3.descending),W.sort(d3.descending),E.sort(d3.descending);var _=d3.scale.linear().domain(d3.extent(d3.merge([f,C]))).range(r?[M,0]:[0,M]);this.__chart__||d3.scale.linear().domain([0,1/0]).range(_.range());this.__chart__=_;d3.min(C),d3.max(C),C[1];for(var L=g.selectAll("g.nv-wrap.nv-bullet").data([n]),B=L.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet").append("g"),P=L.select("g"),T=(v=0,C.length);vg(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e});_.append("line").attr("class","nv-candlestick-lines").attr("transform",function(t,e){return"translate("+c(f(t,e))+",0)"}).attr("x1",0).attr("y1",function(t,e){return d(v(t,e))}).attr("x2",0).attr("y2",function(t,e){return d(m(t,e))}),_.append("rect").attr("class","nv-candlestick-rects nv-bars").attr("transform",function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"}).attr("x",0).attr("y",0).attr("width",S).attr("height",function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)});O.select(".nv-candlestick-lines").transition().attr("transform",function(t,e){return"translate("+c(f(t,e))+",0)"}).attr("x1",0).attr("y1",function(t,e){return d(v(t,e))}).attr("x2",0).attr("y2",function(t,e){return d(m(t,e))}),O.select(".nv-candlestick-rects").transition().attr("transform",function(t,e){return"translate("+(c(f(t,e))-S/2)+","+(d(p(t,e))-(h(t,e)>g(t,e)?d(g(t,e))-d(h(t,e)):0))+")"}).attr("x",0).attr("y",0).attr("width",S).attr("height",function(t,e){var n=h(t,e),r=g(t,e);return n>r?d(r)-d(n):d(n)-d(r)})}),C}return C.highlightPoint=function(t,n){C.clearHighlights(),e.select(".nv-candlestickBar .nv-tick-0-"+t).classed("hover",n)},C.clearHighlights=function(){e.select(".nv-candlestickBar .nv-tick.hover").classed("hover",!1)},C.dispatch=A,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return s},set:function(t){s=t}},height:{get:function(){return l},set:function(t){l=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceX:{get:function(){return y},set:function(t){y=t}},forceY:{get:function(){return x},set:function(t){x=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return k},set:function(t){k=t}},id:{get:function(){return u},set:function(t){u=t}},interactive:{get:function(){return M},set:function(t){M=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return a},set:function(t){a.top=void 0!=t.top?t.top:a.top,a.right=void 0!=t.right?t.right:a.right,a.bottom=void 0!=t.bottom?t.bottom:a.bottom,a.left=void 0!=t.left?t.left:a.left}},color:{get:function(){return w},set:function(e){w=t.utils.getColor(e)}}}),t.utils.initOptions(C),C},t.models.cumulativeLineChart=function(){"use strict";var e,n,r=t.models.line(),i=t.models.axis(),o=t.models.axis(),a=t.models.legend(),s=t.models.legend(),l=t.interactiveGuideline(),u=t.models.tooltip(),c={top:30,right:30,bottom:50,left:60},d=null,f=t.utils.defaultColor(),p=null,h=null,g=!0,v=!0,m=!0,y=!1,x=!0,b=!1,k=!0,w=r.id(),M=t.utils.state(),A=null,C=null,S=function(t){return t.average},W=d3.dispatch("stateChange","changeState","renderEnd"),E=250,F=!1;M.index=0,M.rescaleY=k,i.orient("bottom").tickPadding(7),o.orient(y?"right":"left"),u.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.updateState(!1);var N,D=d3.scale.linear(),O={i:0,x:0},_=t.utils.renderWatch(W,E),L=function(t){return function(){return{active:t.map(function(t){return!t.disabled}),index:O.i,rescaleY:k}}},B=function(t){return function(e){void 0!==e.index&&(O.i=e.index),void 0!==e.rescaleY&&(k=e.rescaleY),void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};function P(u){return _.reset(),_.models(r),v&&_.models(i),m&&_.models(o),u.each(function(u){var C=d3.select(this);t.utils.initSVG(C),C.classed("nv-chart-"+w,!0);var _=t.utils.availableWidth(p,C,c),z=t.utils.availableHeight(h,C,c);if(P.update=function(){0===E?C.call(P):C.transition().duration(E).call(P)},P.container=this,M.setter(B(u),P.update).getter(L(u)).update(),M.disabled=u.map(function(t){return!!t.disabled}),!A){var V;A={};for(V in M)M[V]instanceof Array?A[V]=M[V].slice(0):A[V]=M[V]}var H=d3.behavior.drag().on("dragstart",function(t,e){d3.select(P.container).style("cursor","ew-resize")}).on("drag",function(t,e){O.x=d3.event.x,O.i=Math.round(D.invert(O.x)),$()}).on("dragend",function(t,e){d3.select(P.container).style("cursor","auto"),M.index=O.i,W.stateChange(M)});if(!(u&&u.length&&u.filter(function(t){return t.values.length}).length))return t.utils.noData(P,C),P;C.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale(),D.domain([0,u[0].values.length-1]).range([0,_]).clamp(!0);u=function(t,e){T||(T=r.y());return e.map(function(e,n){if(!e.values)return e;var r=e.values[t];if(null==r)return e;var i=T(r,t);return Math.abs(i)<1e-5&&!F?(e.tempDisabled=!0,e):(e.tempDisabled=!1,e.values=e.values.map(function(t,e){return t.display={y:(T(t,e)-i)/i},t}),e)})}(O.i,u);void 0===N&&(N=I(u)),k?r.yDomain(null):(r.yDomain(N),r.clipEdge(!0));var Y=b?"none":"all",G=C.selectAll("g.nv-wrap.nv-cumulativeLine").data([u]),X=G.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),j=G.select("g");if(X.append("g").attr("class","nv-interactive"),X.append("g").attr("class","nv-x nv-axis").style("pointer-events","none"),X.append("g").attr("class","nv-y nv-axis"),X.append("g").attr("class","nv-background"),X.append("g").attr("class","nv-linesWrap").style("pointer-events",Y),X.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none"),X.append("g").attr("class","nv-legendWrap"),X.append("g").attr("class","nv-controlsWrap"),g?(a.width(_),j.select(".nv-legendWrap").datum(u).call(a),d||a.height()===c.top||(c.top=a.height(),z=t.utils.availableHeight(h,C,c)),j.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):j.select(".nv-legendWrap").selectAll("*").remove(),x){var R=[{key:"Re-scale y-axis",disabled:!k}];s.width(140).color(["#444","#444","#444"]).rightAlign(!1).margin({top:5,right:0,bottom:5,left:20}),j.select(".nv-controlsWrap").datum(R).attr("transform","translate(0,"+-c.top+")").call(s)}else j.select(".nv-controlsWrap").selectAll("*").remove();G.attr("transform","translate("+c.left+","+c.top+")"),y&&j.select(".nv-y.nv-axis").attr("transform","translate("+_+",0)");var Z=u.filter(function(t){return t.tempDisabled});G.select(".tempDisabled").remove(),Z.length&&G.append("text").attr("class","tempDisabled").attr("x",_/2).attr("y","-.71em").style("text-anchor","end").text(Z.map(function(t){return t.key}).join(", ")+" values cannot be calculated for this time period."),b&&(l.width(_).height(z).margin({left:c.left,top:c.top}).svgContainer(C).xScale(e),G.select(".nv-interactive").call(l)),X.select(".nv-background").append("rect"),j.select(".nv-background rect").attr("width",_).attr("height",z),r.y(function(t){return t.display.y}).width(_).height(z).color(u.map(function(t,e){return t.color||f(t,e)}).filter(function(t,e){return!u[e].disabled&&!u[e].tempDisabled}));var q=j.select(".nv-linesWrap").datum(u.filter(function(t){return!t.disabled&&!t.tempDisabled}));q.call(r),u.forEach(function(t,e){t.seriesIndex=e});var K=u.filter(function(t){return!t.disabled&&!!S(t)}),U=j.select(".nv-avgLinesWrap").selectAll("line").data(K,function(t){return t.key}),Q=function(t){var e=n(S(t));return e<0?0:e>z?z:e};U.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(t,e){return r.color()(t,t.seriesIndex)}).attr("x1",0).attr("x2",_).attr("y1",Q).attr("y2",Q),U.style("stroke-opacity",function(t){var e=n(S(t));return e<0||e>z?0:1}).attr("x1",0).attr("x2",_).attr("y1",Q).attr("y2",Q),U.exit().remove();var J=q.selectAll(".nv-indexLine").data([O]);function $(){J.data([O]);var t=P.duration();P.duration(0),P.update(),P.duration(t)}J.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).style("pointer-events","all").call(H),J.attr("transform",function(t){return"translate("+D(t.i)+",0)"}).attr("height",z),v&&(i.scale(e)._ticks(t.utils.calcTicksX(_/70,u)).tickSize(-z,0),j.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),j.select(".nv-x.nv-axis").call(i)),m&&(o.scale(n)._ticks(t.utils.calcTicksY(z/36,u)).tickSize(-_,0),j.select(".nv-y.nv-axis").call(o)),j.select(".nv-background rect").on("click",function(){O.x=d3.mouse(this)[0],O.i=Math.round(D.invert(O.x)),M.index=O.i,W.stateChange(M),$()}),r.dispatch.on("elementClick",function(t){O.i=t.pointIndex,O.x=D(O.i),M.index=O.i,W.stateChange(M),$()}),s.dispatch.on("legendClick",function(t,e){t.disabled=!t.disabled,k=!t.disabled,M.rescaleY=k,k||(N=I(u)),W.stateChange(M),P.update()}),a.dispatch.on("stateChange",function(t){for(var e in t)M[e]=t[e];W.stateChange(M),P.update()}),l.dispatch.on("elementMousemove",function(e){r.clearHighlights();var n,a,s,c=[];if(u.filter(function(t,e){return t.seriesIndex=e,!(t.disabled||t.tempDisabled)}).forEach(function(i,o){a=t.interactiveBisect(i.values,e.pointXValue,P.x()),r.highlightPoint(o,a,!0);var l=i.values[a];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=P.xScale()(P.x()(l,a))),c.push({key:i.key,value:P.y()(l,a),color:f(i,i.seriesIndex)}))}),c.length>2){var d=P.yScale().invert(e.mouseY),p=.03*Math.abs(P.yScale().domain()[0]-P.yScale().domain()[1]),h=t.nearestValueIndex(c.map(function(t){return t.value}),d,p);null!==h&&(c[h].highlight=!0)}var g=i.tickFormat()(P.x()(n,a),a);l.tooltip.valueFormatter(function(t,e){return o.tickFormat()(t)}).data({value:g,series:c})(),l.renderGuideLine(s)}),l.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),W.on("changeState",function(t){void 0!==t.disabled&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),M.disabled=t.disabled),void 0!==t.index&&(O.i=t.index,O.x=D(O.i),M.index=t.index,J.data([O])),void 0!==t.rescaleY&&(k=t.rescaleY),P.update()})}),_.renderEnd("cumulativeLineChart immediate"),P}r.dispatch.on("elementMouseover.tooltip",function(t){var e={x:P.x()(t.point),y:P.y()(t.point),color:t.point.color};t.point=e,u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)});var T=null;function I(t){var e=t.filter(function(t){return!(t.disabled||t.tempDisabled)}).map(function(t,e){return d3.extent(t.values,function(t){return t.display.y})});return[d3.min(e,function(t){return t[0]}),d3.max(e,function(t){return t[1]})]}return P.dispatch=W,P.lines=r,P.legend=a,P.controls=s,P.xAxis=i,P.yAxis=o,P.interactiveLayer=l,P.state=M,P.tooltip=u,P.options=t.utils.optionsFunc.bind(P),P._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showControls:{get:function(){return x},set:function(t){x=t}},showLegend:{get:function(){return g},set:function(t){g=t}},average:{get:function(){return S},set:function(t){S=t}},defaultState:{get:function(){return A},set:function(t){A=t}},noData:{get:function(){return C},set:function(t){C=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},noErrorCheck:{get:function(){return F},set:function(t){F=t}},rescaleY:{get:function(){return k},set:function(t){k=t,P.state.rescaleY=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e),a.color(f)}},useInteractiveGuideline:{get:function(){return b},set:function(t){b=t,!0===t&&(P.interactive(!1),P.useVoronoi(!1))}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,o.orient(t?"right":"left")}},duration:{get:function(){return E},set:function(t){E=t,r.duration(E),i.duration(E),o.duration(E),_.reset(E)}}}),t.utils.inheritOptions(P,r),t.utils.initOptions(P),P},t.models.discreteBar=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=d3.scale.ordinal(),p=d3.scale.linear(),h=function(t){return t.x},g=function(t){return t.y},v=[0],m=t.utils.defaultColor(),y=!1,x=d3.format(",.2f"),b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),k="discreteBar",w=250,M=t.utils.renderWatch(b,w);function A(d){return M.reset(),d.each(function(d){var w=u-l.left-l.right,A=c-l.top-l.bottom;e=d3.select(this),t.utils.initSVG(e),d.forEach(function(t,e){t.values.forEach(function(t){t.series=e})});var C=n&&r?[]:d.map(function(t){return t.values.map(function(t,e){return{x:h(t,e),y:g(t,e),y0:t.y0}})});f.domain(n||d3.merge(C).map(function(t){return t.x})).rangeBands(i||[0,w],.1),p.domain(r||d3.extent(d3.merge(C).map(function(t){return t.y}).concat(v))),y?p.range(o||[A-(p.domain()[0]<0?12:0),p.domain()[1]>0?12:0]):p.range(o||[A,0]),a=a||f,s=s||p.copy().range([p(0),p(0)]);var S=e.selectAll("g.nv-wrap.nv-discretebar").data([d]),W=S.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar").append("g");S.select("g");W.append("g").attr("class","nv-groups"),S.attr("transform","translate("+l.left+","+l.top+")");var E=S.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key});E.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),E.exit().watchTransition(M,"discreteBar: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),E.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}),E.watchTransition(M,"discreteBar: groups").style("stroke-opacity",1).style("fill-opacity",.75);var F=E.selectAll("g.nv-bar").data(function(t){return t.values});F.exit().remove();var N=F.enter().append("g").attr("transform",function(t,e,n){return"translate("+(f(h(t,e))+.05*f.rangeBand())+", "+p(0)+")"}).on("mouseover",function(t,e){d3.select(this).classed("hover",!0),b.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1),b.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})}).on("mousemove",function(t,e){b.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})}).on("click",function(t,e){b.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()}).on("dblclick",function(t,e){b.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()});N.append("rect").attr("height",0).attr("width",.9*f.rangeBand()/d.length),y?(N.append("text").attr("text-anchor","middle"),F.select("text").text(function(t,e){return x(g(t,e))}).watchTransition(M,"discreteBar: bars text").attr("x",.9*f.rangeBand()/2).attr("y",function(t,e){return g(t,e)<0?p(g(t,e))-p(0)+12:-4})):F.selectAll("text").remove(),F.attr("class",function(t,e){return g(t,e)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(t,e){return t.color||m(t,e)}).style("stroke",function(t,e){return t.color||m(t,e)}).select("rect").attr("class",k).watchTransition(M,"discreteBar: bars rect").attr("width",.9*f.rangeBand()/d.length),F.watchTransition(M,"discreteBar: bars").attr("transform",function(t,e){return"translate("+(f(h(t,e))+.05*f.rangeBand())+", "+(g(t,e)<0?p(0):p(0)-p(g(t,e))<1?p(0)-1:p(g(t,e)))+")"}).select("rect").attr("height",function(t,e){return Math.max(Math.abs(p(g(t,e))-p(0)),1)}),a=f.copy(),s=p.copy()}),M.renderEnd("discreteBar immediate"),A}return A.dispatch=b,A.options=t.utils.optionsFunc.bind(A),A._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},forceY:{get:function(){return v},set:function(t){v=t}},showValues:{get:function(){return y},set:function(t){y=t}},x:{get:function(){return h},set:function(t){h=t}},y:{get:function(){return g},set:function(t){g=t}},xScale:{get:function(){return f},set:function(t){f=t}},yScale:{get:function(){return p},set:function(t){p=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},valueFormat:{get:function(){return x},set:function(t){x=t}},id:{get:function(){return d},set:function(t){d=t}},rectClass:{get:function(){return k},set:function(t){k=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},color:{get:function(){return m},set:function(e){m=t.utils.getColor(e)}},duration:{get:function(){return w},set:function(t){w=t,M.reset(w)}}}),t.utils.initOptions(A),A},t.models.discreteBarChart=function(){"use strict";var e,n,r=t.models.discreteBar(),i=t.models.axis(),o=t.models.axis(),a=t.models.legend(),s=t.models.tooltip(),l={top:15,right:10,bottom:50,left:60},u=null,c=null,d=null,f=t.utils.getColor(),p=!1,h=!0,g=!0,v=!1,m=!1,y=!1,x=0,b=null,k=d3.dispatch("beforeUpdate","renderEnd"),w=250;i.orient("bottom").showMaxMin(!1).tickFormat(function(t){return t}),o.orient(v?"right":"left").tickFormat(d3.format(",.1f")),s.duration(0).headerEnabled(!1).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).keyFormatter(function(t,e){return i.tickFormat()(t,e)});var M=t.utils.renderWatch(k,w);function A(s){return M.reset(),M.models(r),h&&M.models(i),g&&M.models(o),s.each(function(s){var f=d3.select(this);t.utils.initSVG(f);var b=t.utils.availableWidth(c,f,l),M=t.utils.availableHeight(d,f,l);if(A.update=function(){k.beforeUpdate(),f.transition().duration(w).call(A)},A.container=this,!(s&&s.length&&s.filter(function(t){return t.values.length}).length))return t.utils.noData(A,f),A;f.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale().clamp(!0);var C=f.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([s]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),W=S.append("defs"),E=C.select("g");if(S.append("g").attr("class","nv-x nv-axis"),S.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),S.append("g").attr("class","nv-barsWrap"),S.append("g").attr("class","nv-legendWrap"),E.attr("transform","translate("+l.left+","+l.top+")"),p?(a.width(b),E.select(".nv-legendWrap").datum(s).call(a),u||a.height()===l.top||(l.top=a.height(),M=t.utils.availableHeight(d,f,l)),C.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")):E.select(".nv-legendWrap").selectAll("*").remove(),v&&E.select(".nv-y.nv-axis").attr("transform","translate("+b+",0)"),r.width(b).height(M),E.select(".nv-barsWrap").datum(s.filter(function(t){return!t.disabled})).transition().call(r),W.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect"),E.select("#nv-x-label-clip-"+r.id()+" rect").attr("width",e.rangeBand()*(m?2:1)).attr("height",16).attr("x",-e.rangeBand()/(m?1:2)),h){i.scale(e)._ticks(t.utils.calcTicksX(b/100,s)).tickSize(-M,0),E.select(".nv-x.nv-axis").attr("transform","translate(0,"+(n.range()[0]+(r.showValues()&&n.domain()[0]<0?16:0))+")"),E.select(".nv-x.nv-axis").call(i);var F=E.select(".nv-x.nv-axis").selectAll("g");m&&F.selectAll("text").attr("transform",function(t,e,n){return"translate(0,"+(n%2==0?"5":"17")+")"}),x&&F.selectAll(".tick text").attr("transform","rotate("+x+" 0,0)").style("text-anchor",x>0?"start":"end"),y&&E.selectAll(".tick text").call(t.utils.wrapTicks,A.xAxis.rangeBand())}g&&(o.scale(n)._ticks(t.utils.calcTicksY(M/36,s)).tickSize(-b,0),E.select(".nv-y.nv-axis").call(o)),E.select(".nv-zeroLine line").attr("x1",0).attr("x2",v?-b:b).attr("y1",n(0)).attr("y2",n(0))}),M.renderEnd("discreteBar chart immediate"),A}return r.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:A.x()(t.data),value:A.y()(t.data),color:t.color},s.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){s.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){s()}),A.dispatch=k,A.discretebar=r,A.legend=a,A.xAxis=i,A.yAxis=o,A.tooltip=s,A.options=t.utils.optionsFunc.bind(A),A._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},showLegend:{get:function(){return p},set:function(t){p=t}},staggerLabels:{get:function(){return m},set:function(t){m=t}},rotateLabels:{get:function(){return x},set:function(t){x=t}},wrapLabels:{get:function(){return y},set:function(t){y=!!t}},showXAxis:{get:function(){return h},set:function(t){h=t}},showYAxis:{get:function(){return g},set:function(t){g=t}},noData:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return w},set:function(t){w=t,M.reset(w),r.duration(w),i.duration(w),o.duration(w)}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e),r.color(f),a.color(f)}},rightAlignYAxis:{get:function(){return v},set:function(t){v=t,o.orient(t?"right":"left")}}}),t.utils.inheritOptions(A,r),t.utils.initOptions(A),A},t.models.distribution=function(){"use strict";var e,n={top:0,right:0,bottom:0,left:0},r=400,i=8,o="x",a=function(t){return t[o]},s=t.utils.defaultColor(),l=d3.scale.linear(),u=250,c=d3.dispatch("renderEnd"),d=t.utils.renderWatch(c,u);function f(r){return d.reset(),r.each(function(r){"x"===o?(n.left,n.right):(n.top,n.bottom);var u="x"==o?"y":"x",c=d3.select(this);t.utils.initSVG(c),e=e||l;var f=c.selectAll("g.nv-distribution").data([r]),p=(f.enter().append("g").attr("class","nvd3 nv-distribution").append("g"),f.select("g"));f.attr("transform","translate("+n.left+","+n.top+")");var h=p.selectAll("g.nv-dist").data(function(t){return t},function(t){return t.key});h.enter().append("g"),h.attr("class",function(t,e){return"nv-dist nv-series-"+e}).style("stroke",function(t,e){return s(t,e)});var g=h.selectAll("line.nv-dist"+o).data(function(t){return t.values});g.enter().append("line").attr(o+"1",function(t,n){return e(a(t,n))}).attr(o+"2",function(t,n){return e(a(t,n))}),d.transition(h.exit().selectAll("line.nv-dist"+o),"dist exit").attr(o+"1",function(t,e){return l(a(t,e))}).attr(o+"2",function(t,e){return l(a(t,e))}).style("stroke-opacity",0).remove(),g.attr("class",function(t,e){return"nv-dist"+o+" nv-dist"+o+"-"+e}).attr(u+"1",0).attr(u+"2",i),d.transition(g,"dist").attr(o+"1",function(t,e){return l(a(t,e))}).attr(o+"2",function(t,e){return l(a(t,e))}),e=l.copy()}),d.renderEnd("distribution immediate"),f}return f.options=t.utils.optionsFunc.bind(f),f.dispatch=c,f.margin=function(t){return arguments.length?(n.top=void 0!==t.top?t.top:n.top,n.right=void 0!==t.right?t.right:n.right,n.bottom=void 0!==t.bottom?t.bottom:n.bottom,n.left=void 0!==t.left?t.left:n.left,f):n},f.width=function(t){return arguments.length?(r=t,f):r},f.axis=function(t){return arguments.length?(o=t,f):o},f.size=function(t){return arguments.length?(i=t,f):i},f.getData=function(t){return arguments.length?(a=d3.functor(t),f):a},f.scale=function(t){return arguments.length?(l=t,f):l},f.color=function(e){return arguments.length?(s=t.utils.getColor(e),f):s},f.duration=function(t){return arguments.length?(u=t,d.reset(u),f):u},f},t.models.focus=function(e){"use strict";e=e||t.models.line();var n,r,i=t.models.axis(),o=t.models.axis(),a=d3.svg.brush(),s={top:10,right:0,bottom:30,left:0},l=t.utils.defaultColor(),u=null,c=70,d=!0,f=!1,p=!1,h=null,g=250,v=d3.dispatch("brush","onBrush","renderEnd"),m=!0;e.interactive(!1),e.pointActive(function(t){return!1});var y=t.utils.renderWatch(v,g);function x(b){return y.reset(),y.models(e),d&&y.models(i),f&&y.models(o),b.each(function(y){var b=d3.select(this);t.utils.initSVG(b);var k=t.utils.availableWidth(u,b,s),w=c-s.top-s.bottom;x.update=function(){0===g?b.call(x):b.transition().duration(g).call(x)},x.container=this,n=e.xScale(),r=e.yScale();var M=b.selectAll("g.nv-focus").data([y]),A=M.enter().append("g").attr("class","nvd3 nv-focus").append("g"),C=M.select("g");M.attr("transform","translate("+s.left+","+s.top+")"),A.append("g").attr("class","nv-background").append("rect"),A.append("g").attr("class","nv-x nv-axis"),A.append("g").attr("class","nv-y nv-axis"),A.append("g").attr("class","nv-contentWrap"),A.append("g").attr("class","nv-brushBackground"),A.append("g").attr("class","nv-x nv-brush"),p&&C.select(".nv-y.nv-axis").attr("transform","translate("+k+",0)"),C.select(".nv-background rect").attr("width",k).attr("height",w),e.width(k).height(w).color(y.map(function(t,e){return t.color||l(t,e)}).filter(function(t,e){return!y[e].disabled}));var S=C.select(".nv-contentWrap").datum(y.filter(function(t){return!t.disabled}));d3.transition(S).call(e),a.x(n).on("brush",function(){N(m)}),a.on("brushend",function(){m||v.onBrush(a.empty()?n.domain():a.extent())}),h&&a.extent(h);var W=C.select(".nv-brushBackground").selectAll("g").data([h||a.extent()]),E=W.enter().append("g");E.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",w),E.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",w);var F=C.select(".nv-x.nv-brush").call(a);function N(t){h=a.empty()?null:a.extent();var e=a.empty()?n.domain():a.extent();v.brush({extent:e,brush:a}),a.empty()||a.extent(h),W.data([a.empty()?n.domain():h]).each(function(t,e){var r=n(t[0])-n.range()[0],i=k-n(t[1]);d3.select(this).select(".left").attr("width",r<0?0:r),d3.select(this).select(".right").attr("x",n(t[1])).attr("width",i<0?0:i)}),t&&v.onBrush(e)}F.selectAll("rect").attr("height",w),F.selectAll(".resize").append("path").attr("d",function(t){var e=+("e"==t),n=e?1:-1,r=w/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)}),N(!0),C.select(".nv-background rect").attr("width",k).attr("height",w),d&&(i.scale(n)._ticks(t.utils.calcTicksX(k/100,y)).tickSize(-w,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),d3.transition(C.select(".nv-x.nv-axis")).call(i)),f&&(o.scale(r)._ticks(t.utils.calcTicksY(w/36,y)).tickSize(-k,0),d3.transition(C.select(".nv-y.nv-axis")).call(o)),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")")}),y.renderEnd("focus immediate"),x}return x.dispatch=v,x.content=e,x.brush=a,x.xAxis=i,x.yAxis=o,x.options=t.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},showXAxis:{get:function(){return d},set:function(t){d=t}},showYAxis:{get:function(){return f},set:function(t){f=t}},brushExtent:{get:function(){return h},set:function(t){h=t}},syncBrushing:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return s},set:function(t){s.top=void 0!==t.top?t.top:s.top,s.right=void 0!==t.right?t.right:s.right,s.bottom=void 0!==t.bottom?t.bottom:s.bottom,s.left=void 0!==t.left?t.left:s.left}},duration:{get:function(){return g},set:function(t){g=t,y.reset(g),e.duration(g),i.duration(g),o.duration(g)}},color:{get:function(){return l},set:function(n){l=t.utils.getColor(n),e.color(l)}},interpolate:{get:function(){return e.interpolate()},set:function(t){e.interpolate(t)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t)}},x:{get:function(){return e.x()},set:function(t){e.x(t)}},y:{get:function(){return e.y()},set:function(t){e.y(t)}},rightAlignYAxis:{get:function(){return p},set:function(t){p=t,o.orient(p?"right":"left")}}}),t.utils.inheritOptions(x,e),t.utils.initOptions(x),x},t.models.forceDirectedGraph=function(){"use strict";var e={top:2,right:0,bottom:2,left:0},n=400,r=32,i=null,o=d3.dispatch("renderEnd"),a=t.utils.getColor(["#000"]),s=t.models.tooltip(),l=null,u=.1,c=.9,d=30,f=-120,p=.1,h=.8,g=.1,v=5,m=function(t){},y=function(t){},x=d3.functor(0),b=d3.functor(0),k=t.utils.renderWatch(o);function w(o){return k.reset(),o.each(function(o){i=d3.select(this),t.utils.initSVG(i);var l=t.utils.availableWidth(n,i,e),x=t.utils.availableHeight(r,i,e);if(i.attr("width",l).attr("height",x),!(o&&o.links&&o.nodes))return t.utils.noData(w,i),w;i.selectAll(".nv-noData").remove(),i.selectAll("*").remove();var b=new Set;o.nodes.forEach(function(t){Object.keys(t).forEach(function(t){b.add(t)})});var k=d3.layout.force().nodes(o.nodes).links(o.links).size([l,x]).linkStrength(u).friction(c).linkDistance(d).charge(f).gravity(p).theta(h).alpha(g).start(),M=i.selectAll(".link").data(o.links).enter().append("line").attr("class","nv-force-link").style("stroke-width",function(t){return Math.sqrt(t.value)}),A=i.selectAll(".node").data(o.nodes).enter().append("g").attr("class","nv-force-node").call(k.drag);A.append("circle").attr("r",v).style("fill",function(t){return a(t)}).on("mouseover",function(t){i.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.py),i.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.px);var e=a(t);t.series=[],b.forEach(function(n){t.series.push({color:e,key:n,value:t[n]})}),s.data(t).hidden(!1)}).on("mouseout",function(t){s.hidden(!0)}),s.headerFormatter(function(t){return"Node"}),y(M),m(A),k.on("tick",function(){M.attr("x1",function(t){return t.source.x}).attr("y1",function(t){return t.source.y}).attr("x2",function(t){return t.target.x}).attr("y2",function(t){return t.target.y}),A.attr("transform",function(t){return"translate("+t.x+", "+t.y+")"})})}),w}return w.options=t.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return r},set:function(t){r=t}},linkStrength:{get:function(){return u},set:function(t){u=t}},friction:{get:function(){return c},set:function(t){c=t}},linkDist:{get:function(){return d},set:function(t){d=t}},charge:{get:function(){return f},set:function(t){f=t}},gravity:{get:function(){return p},set:function(t){p=t}},theta:{get:function(){return h},set:function(t){h=t}},alpha:{get:function(){return g},set:function(t){g=t}},radius:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},margin:{get:function(){return e},set:function(t){e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left}},color:{get:function(){return a},set:function(e){a=t.utils.getColor(e)}},noData:{get:function(){return l},set:function(t){l=t}},nodeExtras:{get:function(){return m},set:function(t){m=t}},linkExtras:{get:function(){return y},set:function(t){y=t}}}),w.dispatch=o,w.tooltip=s,t.utils.initOptions(w),w},t.models.furiousLegend=function(){"use strict";var e={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(t){return t.key},o=function(t){return t},a=t.utils.getColor(),s=20,l=!0,u=28,c=!0,d=!0,f=!1,p=!1,h=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),g="classic";function v(m){function y(t,e){return"furious"!=g?"#000":p?t.disengaged?a(t,e):"#fff":p?void 0:t.disabled?a(t,e):"#fff"}function x(t,e){return p&&"furious"==g?t.disengaged?"#fff":a(t,e):t.disabled?"#fff":a(t,e)}return m.each(function(v){var m=n-e.left-e.right,b=d3.select(this);t.utils.initSVG(b);var k=b.selectAll("g.nv-legend").data([v]),w=(k.enter().append("g").attr("class","nvd3 nv-legend").append("g"),k.select("g"));k.attr("transform","translate("+e.left+","+e.top+")");var M,A=w.selectAll(".nv-series").data(function(t){return"furious"!=g?t:t.filter(function(t){return!!p||!t.disengaged})}),C=A.enter().append("g").attr("class","nv-series");if("classic"==g)C.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),M=A.select("circle");else if("furious"==g){C.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),M=A.select("rect"),C.append("g").attr("class","nv-check-box").property("innerHTML",'').attr("transform","translate(-10,-8)scale(0.5)"),A.select(".nv-check-box").each(function(t,e){d3.select(this).selectAll("path").attr("stroke",y(t,e))})}C.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var S,W=A.select("text.nv-legend-text");switch(A.on("mouseover",function(t,e){h.legendMouseover(t,e)}).on("mouseout",function(t,e){h.legendMouseout(t,e)}).on("click",function(t,e){h.legendClick(t,e);var n=A.data();if(d){if("classic"==g)f?(n.forEach(function(t){t.disabled=!0}),t.disabled=!1):(t.disabled=!t.disabled,n.every(function(t){return t.disabled})&&n.forEach(function(t){t.disabled=!1}));else if("furious"==g)if(p)t.disengaged=!t.disengaged,t.userDisabled=void 0==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled;else if(!p){t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter(function(t){return!t.disengaged}).every(function(t){return t.userDisabled})&&n.forEach(function(t){t.disabled=t.userDisabled=!1})}h.stateChange({disabled:n.map(function(t){return!!t.disabled}),disengaged:n.map(function(t){return!!t.disengaged})})}}).on("dblclick",function(t,e){if(("furious"!=g||!p)&&(h.legendDblclick(t,e),d)){var n=A.data();n.forEach(function(t){t.disabled=!0,"furious"==g&&(t.userDisabled=t.disabled)}),t.disabled=!1,"furious"==g&&(t.userDisabled=t.disabled),h.stateChange({disabled:n.map(function(t){return!!t.disabled})})}}),A.classed("nv-disabled",function(t){return t.userDisabled}),A.exit().remove(),W.attr("fill",y).text(function(t){return o(i(t))}),g){case"furious":S=23;break;case"classic":S=20}if(l){var E=[];A.each(function(e,n){var r,a;if(o(i(e))&&o(i(e)).length>s){var l=o(i(e)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(e)))}else r=d3.select(this).select("text");try{if((a=r.node().getComputedTextLength())<=0)throw Error()}catch(e){a=t.utils.calcApproxTextWidth(r)}E.push(a+u)});for(var F=0,N=0,D=[];Nm&&F>1;){D=[],F--;for(var O=0;O(D[O%F]||0)&&(D[O%F]=E[O]);N=D.reduce(function(t,e,n,r){return t+e})}for(var _=[],L=0,B=0;Lz&&(z=I),"translate("+P+","+T+")"}),w.attr("transform","translate("+(n-e.right-z)+","+e.top+")"),r=e.top+e.bottom+T+15}"furious"==g&&M.attr("width",function(t,e){return W[0][e].getComputedTextLength()+27}).attr("height",18).attr("y",-9).attr("x",-15),M.style("fill",x).style("stroke",function(t,e){return t.color||a(t,e)})}),v}return v.dispatch=h,v.options=t.utils.optionsFunc.bind(v),v._options=Object.create({},{width:{get:function(){return n},set:function(t){n=t}},height:{get:function(){return r},set:function(t){r=t}},key:{get:function(){return i},set:function(t){i=t}},keyFormatter:{get:function(){return o},set:function(t){o=t}},align:{get:function(){return l},set:function(t){l=t}},rightAlign:{get:function(){return c},set:function(t){c=t}},maxKeyLength:{get:function(){return s},set:function(t){s=t}},padding:{get:function(){return u},set:function(t){u=t}},updateState:{get:function(){return d},set:function(t){d=t}},radioButtonMode:{get:function(){return f},set:function(t){f=t}},expanded:{get:function(){return p},set:function(t){p=t}},vers:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return e},set:function(t){e.top=void 0!==t.top?t.top:e.top,e.right=void 0!==t.right?t.right:e.right,e.bottom=void 0!==t.bottom?t.bottom:e.bottom,e.left=void 0!==t.left?t.left:e.left}},color:{get:function(){return a},set:function(e){a=t.utils.getColor(e)}}}),t.utils.initOptions(v),v},t.models.historicalBar=function(){"use strict";var e,n,r,i,o={top:0,right:0,bottom:0,left:0},a=null,s=null,l=Math.floor(1e4*Math.random()),u=null,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=[],g=[0],v=!1,m=!0,y=t.utils.defaultColor(),x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),b=!0,k=t.utils.renderWatch(x,0);function w(M){return M.each(function(w){k.reset(),u=d3.select(this);var M=t.utils.availableWidth(a,u,o),A=t.utils.availableHeight(s,u,o);t.utils.initSVG(u),c.domain(e||d3.extent(w[0].values.map(f).concat(h))),v?c.range(r||[.5*M/w[0].values.length,M*(w[0].values.length-.5)/w[0].values.length]):c.range(r||[0,M]),d.domain(n||d3.extent(w[0].values.map(p).concat(g))).range(i||[A,0]),c.domain()[0]===c.domain()[1]&&(c.domain()[0]?c.domain([c.domain()[0]-.01*c.domain()[0],c.domain()[1]+.01*c.domain()[1]]):c.domain([-1,1])),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]+.01*d.domain()[0],d.domain()[1]-.01*d.domain()[1]]):d.domain([-1,1]));var C=u.selectAll("g.nv-wrap.nv-historicalBar-"+l).data([w[0].values]),S=C.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+l),W=S.append("defs"),E=S.append("g"),F=C.select("g");E.append("g").attr("class","nv-bars"),C.attr("transform","translate("+o.left+","+o.top+")"),u.on("click",function(t,e){x.chartClick({data:t,index:e,pos:d3.event,id:l})}),W.append("clipPath").attr("id","nv-chart-clip-path-"+l).append("rect"),C.select("#nv-chart-clip-path-"+l+" rect").attr("width",M).attr("height",A),F.attr("clip-path",m?"url(#nv-chart-clip-path-"+l+")":"");var N=C.select(".nv-bars").selectAll(".nv-bar").data(function(t){return t},function(t,e){return f(t,e)});N.exit().remove(),N.enter().append("rect").attr("x",0).attr("y",function(e,n){return t.utils.NaNtoZero(d(Math.max(0,p(e,n))))}).attr("height",function(e,n){return t.utils.NaNtoZero(Math.abs(d(p(e,n))-d(0)))}).attr("transform",function(t,e){return"translate("+(c(f(t,e))-M/w[0].values.length*.45)+",0)"}).on("mouseover",function(t,e){b&&(d3.select(this).classed("hover",!0),x.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")}))}).on("mouseout",function(t,e){b&&(d3.select(this).classed("hover",!1),x.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")}))}).on("mousemove",function(t,e){b&&x.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})}).on("click",function(t,e){if(b){x.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()}}).on("dblclick",function(t,e){b&&(x.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation())}),N.attr("fill",function(t,e){return y(t,e)}).attr("class",function(t,e,n){return(p(t,e)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+n+"-"+e}).watchTransition(k,"bars").attr("transform",function(t,e){return"translate("+(c(f(t,e))-M/w[0].values.length*.45)+",0)"}).attr("width",M/w[0].values.length*.9),N.watchTransition(k,"bars").attr("y",function(e,n){var r=p(e,n)<0?d(0):d(0)-d(p(e,n))<1?d(0)-1:d(p(e,n));return t.utils.NaNtoZero(r)}).attr("height",function(e,n){return t.utils.NaNtoZero(Math.max(Math.abs(d(p(e,n))-d(0)),1))})}),k.renderEnd("historicalBar immediate"),w}return w.highlightPoint=function(t,e){u.select(".nv-bars .nv-bar-0-"+t).classed("hover",e)},w.clearHighlights=function(){u.select(".nv-bars .nv-bar.hover").classed("hover",!1)},w.dispatch=x,w.options=t.utils.optionsFunc.bind(w),w._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},forceX:{get:function(){return h},set:function(t){h=t}},forceY:{get:function(){return g},set:function(t){g=t}},padData:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},clipEdge:{get:function(){return m},set:function(t){m=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return b},set:function(t){b=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return y},set:function(e){y=t.utils.getColor(e)}}}),t.utils.initOptions(w),w},t.models.historicalBarChart=function(e){"use strict";var n,r,i=e||t.models.historicalBar(),o=t.models.axis(),a=t.models.axis(),s=t.models.legend(),l=t.interactiveGuideline(),u=t.models.tooltip(),c={top:30,right:90,bottom:50,left:90},d=null,f=t.utils.defaultColor(),p=null,h=null,g=!1,v=!0,m=!0,y=!1,x=!1,b={},k=null,w=null,M=d3.dispatch("tooltipHide","stateChange","changeState","renderEnd"),A=250;o.orient("bottom").tickPadding(7),a.orient(y?"right":"left"),u.duration(0).headerEnabled(!1).valueFormatter(function(t,e){return a.tickFormat()(t,e)}).headerFormatter(function(t,e){return o.tickFormat()(t,e)});var C=t.utils.renderWatch(M,0);function S(e){return e.each(function(u){C.reset(),C.models(i),v&&C.models(o),m&&C.models(a);var w=d3.select(this);t.utils.initSVG(w);var W=t.utils.availableWidth(p,w,c),E=t.utils.availableHeight(h,w,c);if(S.update=function(){w.transition().duration(A).call(S)},S.container=this,b.disabled=u.map(function(t){return!!t.disabled}),!k){var F;k={};for(F in b)b[F]instanceof Array?k[F]=b[F].slice(0):k[F]=b[F]}if(!(u&&u.length&&u.filter(function(t){return t.values.length}).length))return t.utils.noData(S,w),S;w.selectAll(".nv-noData").remove(),n=i.xScale(),r=i.yScale();var N=w.selectAll("g.nv-wrap.nv-historicalBarChart").data([u]),D=N.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),O=N.select("g");D.append("g").attr("class","nv-x nv-axis"),D.append("g").attr("class","nv-y nv-axis"),D.append("g").attr("class","nv-barsWrap"),D.append("g").attr("class","nv-legendWrap"),D.append("g").attr("class","nv-interactive"),g?(s.width(W),O.select(".nv-legendWrap").datum(u).call(s),d||s.height()===c.top||(c.top=s.height(),E=t.utils.availableHeight(h,w,c)),N.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")")):O.select(".nv-legendWrap").selectAll("*").remove(),N.attr("transform","translate("+c.left+","+c.top+")"),y&&O.select(".nv-y.nv-axis").attr("transform","translate("+W+",0)"),x&&(l.width(W).height(E).margin({left:c.left,top:c.top}).svgContainer(w).xScale(n),N.select(".nv-interactive").call(l)),i.width(W).height(E).color(u.map(function(t,e){return t.color||f(t,e)}).filter(function(t,e){return!u[e].disabled})),O.select(".nv-barsWrap").datum(u.filter(function(t){return!t.disabled})).transition().call(i),v&&(o.scale(n)._ticks(t.utils.calcTicksX(W/100,u)).tickSize(-E,0),O.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),O.select(".nv-x.nv-axis").transition().call(o)),m&&(a.scale(r)._ticks(t.utils.calcTicksY(E/36,u)).tickSize(-W,0),O.select(".nv-y.nv-axis").transition().call(a)),l.dispatch.on("elementMousemove",function(e){i.clearHighlights();var n,r,s,c=[];u.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(o,a){r=t.interactiveBisect(o.values,e.pointXValue,S.x()),i.highlightPoint(r,!0);var l=o.values[r];void 0!==l&&(void 0===n&&(n=l),void 0===s&&(s=S.xScale()(S.x()(l,r))),c.push({key:o.key,value:S.y()(l,r),color:f(o,o.seriesIndex),data:o.values[r]}))});var d=o.tickFormat()(S.x()(n,r));l.tooltip.valueFormatter(function(t,e){return a.tickFormat()(t)}).data({value:d,index:r,series:c})(),l.renderGuideLine(s)}),l.dispatch.on("elementMouseout",function(t){M.tooltipHide(),i.clearHighlights()}),s.dispatch.on("legendClick",function(t,n){t.disabled=!t.disabled,u.filter(function(t){return!t.disabled}).length||u.map(function(t){return t.disabled=!1,N.selectAll(".nv-series").classed("disabled",!1),t}),b.disabled=u.map(function(t){return!!t.disabled}),M.stateChange(b),e.transition().call(S)}),s.dispatch.on("legendDblclick",function(t){u.forEach(function(t){t.disabled=!0}),t.disabled=!1,b.disabled=u.map(function(t){return!!t.disabled}),M.stateChange(b),S.update()}),M.on("changeState",function(t){void 0!==t.disabled&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),b.disabled=t.disabled),S.update()})}),C.renderEnd("historicalBarChart immediate"),S}return i.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:S.x()(t.data),value:S.y()(t.data),color:t.color},u.data(t).hidden(!1)}),i.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),i.dispatch.on("elementMousemove.tooltip",function(t){u()}),S.dispatch=M,S.bars=i,S.legend=s,S.xAxis=o,S.yAxis=a,S.interactiveLayer=l,S.tooltip=u,S.options=t.utils.optionsFunc.bind(S),S._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return g},set:function(t){g=t}},showXAxis:{get:function(){return v},set:function(t){v=t}},showYAxis:{get:function(){return m},set:function(t){m=t}},defaultState:{get:function(){return k},set:function(t){k=t}},noData:{get:function(){return w},set:function(t){w=t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e),s.color(f),i.color(f)}},duration:{get:function(){return A},set:function(t){A=t,C.reset(A),a.duration(A),o.duration(A)}},rightAlignYAxis:{get:function(){return y},set:function(t){y=t,a.orient(t?"right":"left")}},useInteractiveGuideline:{get:function(){return x},set:function(t){x=t,!0===t&&S.interactive(!1)}}}),t.utils.inheritOptions(S,i),t.utils.initOptions(S),S},t.models.ohlcBarChart=function(){var e=t.models.historicalBarChart(t.models.ohlcBar());return e.useInteractiveGuideline(!0),e.interactiveLayer.tooltip.contentGenerator(function(t){var n=t.series[0].data;return'

'+t.value+"

open:"+e.yAxis.tickFormat()(n.open)+"
close:"+e.yAxis.tickFormat()(n.close)+"
high"+e.yAxis.tickFormat()(n.high)+"
low:"+e.yAxis.tickFormat()(n.low)+"
"}),e},t.models.candlestickBarChart=function(){var e=t.models.historicalBarChart(t.models.candlestickBar());return e.useInteractiveGuideline(!0),e.interactiveLayer.tooltip.contentGenerator(function(t){var n=t.series[0].data;return'

'+t.value+"

open:"+e.yAxis.tickFormat()(n.open)+"
close:"+e.yAxis.tickFormat()(n.close)+"
high"+e.yAxis.tickFormat()(n.high)+"
low:"+e.yAxis.tickFormat()(n.low)+"
"}),e},t.models.legend=function(){"use strict";var e={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(t){return t.key},o=function(t){return t},a=t.utils.getColor(),s=20,l=!0,u=32,c=!0,d=!0,f=!0,p=!1,h=!1,g=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange"),v="classic";function m(y){function x(t,e){return"furious"!=v?"#000":h?t.disengaged?"#000":"#fff":h?void 0:(t.color||(t.color=a(t,e)),t.disabled?t.color:"#fff")}function b(t,e){return h&&"furious"==v&&t.disengaged?"#eee":t.color||a(t,e)}function k(t,e){return h&&"furious"==v?1:t.disabled?0:1}return y.each(function(a){var m=n-e.left-e.right,y=d3.select(this);t.utils.initSVG(y);var w=y.selectAll("g.nv-legend").data([a]),M=w.enter().append("g").attr("class","nvd3 nv-legend").append("g"),A=w.select("g");c?w.attr("transform","translate("+-e.right+","+e.top+")"):w.attr("transform","translate("+e.left+","+e.top+")");var C,S,W=A.selectAll(".nv-series").data(function(t){return"furious"!=v?t:t.filter(function(t){return!!h||!t.disengaged})}),E=W.enter().append("g").attr("class","nv-series");switch(v){case"furious":S=23;break;case"classic":S=20}if("classic"==v)E.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),C=W.select(".nv-legend-symbol");else if("furious"==v){E.append("rect").style("stroke-width",2).attr("class","nv-legend-symbol").attr("rx",3).attr("ry",3),C=W.select(".nv-legend-symbol"),E.append("g").attr("class","nv-check-box").property("innerHTML",'').attr("transform","translate(-10,-8)scale(0.5)"),W.select(".nv-check-box").each(function(t,e){d3.select(this).selectAll("path").attr("stroke",x(t,e))})}E.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");var F=W.select("text.nv-legend-text");W.on("mouseover",function(t,e){g.legendMouseover(t,e)}).on("mouseout",function(t,e){g.legendMouseout(t,e)}).on("click",function(t,e){g.legendClick(t,e);var n=W.data();if(d){if("classic"==v)p?(n.forEach(function(t){t.disabled=!0}),t.disabled=!1):(t.disabled=!t.disabled,n.every(function(t){return t.disabled})&&n.forEach(function(t){t.disabled=!1}));else if("furious"==v)if(h)t.disengaged=!t.disengaged,t.userDisabled=void 0==t.userDisabled?!!t.disabled:t.userDisabled,t.disabled=t.disengaged||t.userDisabled;else if(!h){t.disabled=!t.disabled,t.userDisabled=t.disabled,n.filter(function(t){return!t.disengaged}).every(function(t){return t.userDisabled})&&n.forEach(function(t){t.disabled=t.userDisabled=!1})}g.stateChange({disabled:n.map(function(t){return!!t.disabled}),disengaged:n.map(function(t){return!!t.disengaged})})}}).on("dblclick",function(t,e){if(f){if("furious"==v&&h)return;if(g.legendDblclick(t,e),d){var n=W.data();n.forEach(function(t){t.disabled=!0,"furious"==v&&(t.userDisabled=t.disabled)}),t.disabled=!1,"furious"==v&&(t.userDisabled=t.disabled),g.stateChange({disabled:n.map(function(t){return!!t.disabled})})}}}),W.classed("nv-disabled",function(t){return t.userDisabled}),W.exit().remove(),F.attr("fill",x).text(function(t){return o(i(t))});var N=0;if(l){var D=[];W.each(function(e,n){var r,a;if(o(i(e))&&o(i(e)).length>s){var l=o(i(e)).substring(0,s);r=d3.select(this).select("text").text(l+"..."),d3.select(this).append("svg:title").text(o(i(e)))}else r=d3.select(this).select("text");try{if((a=r.node().getComputedTextLength())<=0)throw Error()}catch(e){a=t.utils.calcApproxTextWidth(r)}D.push(a+u)});var O=0,_=[];for(N=0;Nm&&O>1;){_=[],O--;for(var L=0;L(_[L%O]||0)&&(_[L%O]=D[L]);N=_.reduce(function(t,e,n,r){return t+e})}for(var B=[],P=0,T=0;PH&&(H=V),N0?k:0),S.attr("clip-path",h?"url(#nv-edge-clip-"+r.id()+")":""),W.attr("clip-path",h?"url(#nv-edge-clip-"+r.id()+")":"");var E=w.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key});E.enter().append("g").style("stroke-opacity",1e-6).style("stroke-width",function(t){return t.strokeWidth||l}).style("fill-opacity",1e-6),E.exit().remove(),E.attr("class",function(t,e){return(t.classed||"")+" nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return u(t,e)}).style("stroke",function(t,e){return u(t,e)}),E.watchTransition(b,"line: groups").style("stroke-opacity",1).style("fill-opacity",function(t){return t.fillOpacity||.5});var F=E.selectAll("path.nv-area").data(function(t){return p(t)?[t]:[]});F.enter().append("path").attr("class","nv-area").attr("d",function(e){return d3.svg.area().interpolate(g).defined(f).x(function(e,n){return t.utils.NaNtoZero(y(c(e,n)))}).y0(function(e,n){return t.utils.NaNtoZero(x(d(e,n)))}).y1(function(t,e){return x(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])}).apply(this,[e.values])}),E.exit().selectAll("path.nv-area").remove(),F.watchTransition(b,"line: areaPaths").attr("d",function(r){return d3.svg.area().interpolate(g).defined(f).x(function(n,r){return t.utils.NaNtoZero(e(c(n,r)))}).y0(function(e,r){return t.utils.NaNtoZero(n(d(e,r)))}).y1(function(t,e){return n(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])}).apply(this,[r.values])});var N=E.selectAll("path.nv-line").data(function(t){return[t.values]});N.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(g).defined(f).x(function(e,n){return t.utils.NaNtoZero(y(c(e,n)))}).y(function(e,n){return t.utils.NaNtoZero(x(d(e,n)))})),N.watchTransition(b,"line: linePaths").attr("d",d3.svg.line().interpolate(g).defined(f).x(function(n,r){return t.utils.NaNtoZero(e(c(n,r)))}).y(function(e,r){return t.utils.NaNtoZero(n(d(e,r)))})),y=e.copy(),x=n.copy()}),b.renderEnd("line immediate"),k}return k.dispatch=m,k.scatter=r,r.dispatch.on("elementClick",function(){m.elementClick.apply(this,arguments)}),r.dispatch.on("elementMouseover",function(){m.elementMouseover.apply(this,arguments)}),r.dispatch.on("elementMouseout",function(){m.elementMouseout.apply(this,arguments)}),k.options=t.utils.optionsFunc.bind(k),k._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},defined:{get:function(){return f},set:function(t){f=t}},interpolate:{get:function(){return g},set:function(t){g=t}},clipEdge:{get:function(){return h},set:function(t){h=t}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},duration:{get:function(){return v},set:function(t){v=t,b.reset(v),r.duration(v)}},isArea:{get:function(){return p},set:function(t){p=d3.functor(t)}},x:{get:function(){return c},set:function(t){c=t,r.x(t)}},y:{get:function(){return d},set:function(t){d=t,r.y(t)}},color:{get:function(){return u},set:function(e){u=t.utils.getColor(e),r.color(u)}}}),t.utils.inheritOptions(k,r),t.utils.initOptions(k),k},t.models.lineChart=function(){"use strict";var e,n,r=t.models.line(),i=t.models.axis(),o=t.models.axis(),a=t.models.legend(),s=t.interactiveGuideline(),l=t.models.tooltip(),u=t.models.focus(t.models.line()),c={top:30,right:20,bottom:50,left:60},d=null,f=t.utils.defaultColor(),p=null,h=null,g=!0,v="top",m=!0,y=!0,x=!1,b=!1,k=!1,w=t.utils.state(),M=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=250;i.orient("bottom").tickPadding(7),o.orient(x?"right":"left"),r.clipEdge(!0).duration(0),l.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.tooltip.valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)});var W=t.utils.renderWatch(C,S),E=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},F=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};function N(l){return W.reset(),W.models(r),m&&W.models(i),y&&W.models(o),l.each(function(l){var A=d3.select(this);t.utils.initSVG(A);var W=t.utils.availableWidth(p,A,c),D=t.utils.availableHeight(h,A,c)-(k?u.height():0);if(N.update=function(){0===S?A.call(N):A.transition().duration(S).call(N)},N.container=this,w.setter(F(l),N.update).getter(E(l)).update(),w.disabled=l.map(function(t){return!!t.disabled}),!M){var O;M={};for(O in w)w[O]instanceof Array?M[O]=w[O].slice(0):M[O]=w[O]}if(!(l&&l.length&&l.filter(function(t){return t.values.length}).length))return t.utils.noData(N,A),N;A.selectAll(".nv-noData").remove(),u.dispatch.on("onBrush",function(t){H(t)}),e=r.xScale(),n=r.yScale();var _=A.selectAll("g.nv-wrap.nv-lineChart").data([l]),L=_.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),B=_.select("g");L.append("g").attr("class","nv-legendWrap");var P=L.append("g").attr("class","nv-focus");P.append("g").attr("class","nv-background").append("rect"),P.append("g").attr("class","nv-x nv-axis"),P.append("g").attr("class","nv-y nv-axis"),P.append("g").attr("class","nv-linesWrap"),P.append("g").attr("class","nv-interactive");L.append("g").attr("class","nv-focusWrap");g?(a.width(W),B.select(".nv-legendWrap").datum(l).call(a),"bottom"===v?(c.bottom=i.height()+a.height(),D=t.utils.availableHeight(h,A,c),B.select(".nv-legendWrap").attr("transform","translate(0,"+(D+i.height())+")")):"top"===v&&(d||a.height()===c.top||(c.top=a.height(),D=t.utils.availableHeight(h,A,c)-(k?u.height():0)),_.select(".nv-legendWrap").attr("transform","translate(0,"+-c.top+")"))):B.select(".nv-legendWrap").selectAll("*").remove(),_.attr("transform","translate("+c.left+","+c.top+")"),x&&B.select(".nv-y.nv-axis").attr("transform","translate("+W+",0)"),b&&(s.width(W).height(D).margin({left:c.left,top:c.top}).svgContainer(A).xScale(e),_.select(".nv-interactive").call(s)),B.select(".nv-focus .nv-background rect").attr("width",W).attr("height",D),r.width(W).height(D).color(l.map(function(t,e){return t.color||f(t,e)}).filter(function(t,e){return!l[e].disabled}));var T=B.select(".nv-linesWrap").datum(l.filter(function(t){return!t.disabled}));function I(){m&&B.select(".nv-focus .nv-x.nv-axis").transition().duration(S).call(i)}function z(){y&&B.select(".nv-focus .nv-y.nv-axis").transition().duration(S).call(o)}if(m&&i.scale(e)._ticks(t.utils.calcTicksX(W/100,l)).tickSize(-D,0),y&&o.scale(n)._ticks(t.utils.calcTicksY(D/36,l)).tickSize(-W,0),B.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+D+")"),k||null!==u.brush.extent()){u.width(W),B.select(".nv-focusWrap").style("display",k?"initial":"none").attr("transform","translate(0,"+(D+c.bottom+u.margin().top)+")").call(u);var V=u.brush.empty()?u.xDomain():u.brush.extent();null!==V&&H(V)}else T.call(r),I(),z();function H(t){B.select(".nv-focus .nv-linesWrap").datum(l.filter(function(t){return!t.disabled}).map(function(e,n){return{key:e.key,area:e.area,classed:e.classed,values:e.values.filter(function(e,n){return r.x()(e,n)>=t[0]&&r.x()(e,n)<=t[1]}),disableTooltip:e.disableTooltip}})).transition().duration(S).call(r),I(),z()}a.dispatch.on("stateChange",function(t){for(var e in t)w[e]=t[e];C.stateChange(w),N.update()}),s.dispatch.on("elementMousemove",function(n){r.clearHighlights();var i,a,c,d=[];if(l.filter(function(t,e){return t.seriesIndex=e,!t.disabled&&!t.disableTooltip}).forEach(function(o,s){var l=null!==u.brush.extent()?u.brush.empty()?u.xScale().domain():u.brush.extent():e.domain(),p=o.values.filter(function(t,e){return l[0]<=l[1]?r.x()(t,e)>=l[0]&&r.x()(t,e)<=l[1]:r.x()(t,e)>=l[1]&&r.x()(t,e)<=l[0]}),h=p[a=t.interactiveBisect(p,n.pointXValue,r.x())],g=N.y()(h,a);null!==g&&r.highlightPoint(s,a,!0),void 0!==h&&(void 0===i&&(i=h),void 0===c&&(c=N.xScale()(N.x()(h,a))),d.push({key:o.key,value:g,color:f(o,o.seriesIndex),data:h}))}),d.length>2){var p=N.yScale().invert(n.mouseY),h=.03*Math.abs(N.yScale().domain()[0]-N.yScale().domain()[1]),g=t.nearestValueIndex(d.map(function(t){return t.value}),p,h);null!==g&&(d[g].highlight=!0)}s.tooltip.valueFormatter(s.tooltip.valueFormatter()||function(t,e){return null==t?"N/A":o.tickFormat()(t)}).data({value:N.x()(i,a),index:a,series:d})(),s.renderGuideLine(c)}),s.dispatch.on("elementClick",function(e){var n,i=[];l.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(r){var o=t.interactiveBisect(r.values,e.pointXValue,N.x()),a=r.values[o];if(void 0!==a){void 0===n&&(n=N.xScale()(N.x()(a,o)));var s=N.yScale()(N.y()(a,o));i.push({point:a,pointIndex:o,pos:[n,s],seriesIndex:r.seriesIndex,series:r})}}),r.dispatch.elementClick(i)}),s.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),C.on("changeState",function(t){void 0!==t.disabled&&l.length===t.disabled.length&&(l.forEach(function(e,n){e.disabled=t.disabled[n]}),w.disabled=t.disabled),N.update()})}),W.renderEnd("lineChart immediate"),N}return r.dispatch.on("elementMouseover.tooltip",function(t){t.series.disableTooltip||l.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){l.hidden(!0)}),N.dispatch=C,N.lines=r,N.legend=a,N.focus=u,N.xAxis=i,N.x2Axis=u.xAxis,N.yAxis=o,N.y2Axis=u.yAxis,N.interactiveLayer=s,N.tooltip=l,N.state=w,N.dispatch=C,N.options=t.utils.optionsFunc.bind(N),N._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return g},set:function(t){g=t}},legendPosition:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return m},set:function(t){m=t}},showYAxis:{get:function(){return y},set:function(t){y=t}},defaultState:{get:function(){return M},set:function(t){M=t}},noData:{get:function(){return A},set:function(t){A=t}},focusEnable:{get:function(){return k},set:function(t){k=t}},focusHeight:{get:function(){return u.height()},set:function(t){u.height(t)}},focusShowAxisX:{get:function(){return u.showXAxis()},set:function(t){u.showXAxis(t)}},focusShowAxisY:{get:function(){return u.showYAxis()},set:function(t){u.showYAxis(t)}},brushExtent:{get:function(){return u.brushExtent()},set:function(t){u.brushExtent(t)}},focusMargin:{get:function(){return u.margin},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),u.margin.right=void 0!==t.right?t.right:u.margin.right,u.margin.bottom=void 0!==t.bottom?t.bottom:u.margin.bottom,u.margin.left=void 0!==t.left?t.left:u.margin.left}},margin:{get:function(){return c},set:function(t){c.top=void 0!==t.top?t.top:c.top,c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return S},set:function(t){S=t,W.reset(S),r.duration(S),u.duration(S),i.duration(S),o.duration(S)}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e),a.color(f),r.color(f),u.color(f)}},interpolate:{get:function(){return r.interpolate()},set:function(t){r.interpolate(t),u.interpolate(t)}},xTickFormat:{get:function(){return i.tickFormat()},set:function(t){i.tickFormat(t),u.xTickFormat(t)}},yTickFormat:{get:function(){return o.tickFormat()},set:function(t){o.tickFormat(t),u.yTickFormat(t)}},x:{get:function(){return r.x()},set:function(t){r.x(t),u.x(t)}},y:{get:function(){return r.y()},set:function(t){r.y(t),u.y(t)}},rightAlignYAxis:{get:function(){return x},set:function(t){x=t,o.orient(x?"right":"left")}},useInteractiveGuideline:{get:function(){return b},set:function(t){(b=t)&&(r.interactive(!1),r.useVoronoi(!1))}}}),t.utils.inheritOptions(N,r),t.utils.initOptions(N),N},t.models.lineWithFocusChart=function(){return t.models.lineChart().margin({bottom:30}).focusEnable(!0)},t.models.linePlusBarChart=function(){"use strict";var e,n,r,i,o,a,s,l=t.models.line(),u=t.models.line(),c=t.models.historicalBar(),d=t.models.historicalBar(),f=t.models.axis(),p=t.models.axis(),h=t.models.axis(),g=t.models.axis(),v=t.models.axis(),m=t.models.axis(),y=t.models.legend(),x=d3.svg.brush(),b=t.models.tooltip(),k={top:30,right:30,bottom:30,left:60},w=null,M={top:0,right:30,bottom:20,left:60},A=null,C=null,S=function(t){return t.x},W=function(t){return t.y},E=t.utils.defaultColor(),F=!0,N=!0,D=!1,O=!0,_=50,L=null,B=null,P=d3.dispatch("brush","stateChange","changeState"),T=0,I=t.utils.state(),z=null,V=" (left axis)",H=" (right axis)",Y=!1;l.clipEdge(!0),u.interactive(!1),u.pointActive(function(t){return!1}),f.orient("bottom").tickPadding(5),h.orient("left"),g.orient("right"),p.orient("bottom").tickPadding(5),v.orient("left"),m.orient("right"),b.headerEnabled(!0).headerFormatter(function(t,e){return f.tickFormat()(t,e)});var G=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},X=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}},j=function(t){return t.every(function(t){return t.disabled})};function R(b){return b.each(function(b){var B=d3.select(this);t.utils.initSVG(B);var Z=t.utils.availableWidth(A,B,k),q=t.utils.availableHeight(C,B,k)-(N?_:0),K=_-M.top-M.bottom;if(R.update=function(){B.transition().duration(T).call(R)},R.container=this,I.setter(X(b),R.update).getter(G(b)).update(),I.disabled=b.map(function(t){return!!t.disabled}),!z){var U;z={};for(U in I)I[U]instanceof Array?z[U]=I[U].slice(0):z[U]=I[U]}if(!(b&&b.length&&b.filter(function(t){return t.values.length}).length))return t.utils.noData(R,B),R;B.selectAll(".nv-noData").remove();var Q=b.filter(function(t){return!t.disabled&&t.bar}),J=b.filter(function(t){return!t.bar});n=Q.length&&!Y?c.xScale():l.xScale(),r=p.scale(),i=Y?l.yScale():c.yScale(),o=Y?c.yScale():l.yScale(),a=Y?u.yScale():d.yScale(),s=Y?d.yScale():u.yScale();var $=b.filter(function(t){return!t.disabled&&(Y?!t.bar:t.bar)}).map(function(t){return t.values.map(function(t,e){return{x:S(t,e),y:W(t,e)}})}),tt=b.filter(function(t){return!t.disabled&&(Y?t.bar:!t.bar)}).map(function(t){return t.values.map(function(t,e){return{x:S(t,e),y:W(t,e)}})});n.range([0,Z]),r.domain(d3.extent(d3.merge($.concat(tt)),function(t){return t.x})).range([0,Z]);var et=B.selectAll("g.nv-wrap.nv-linePlusBar").data([b]),nt=et.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),rt=et.select("g");nt.append("g").attr("class","nv-legendWrap");var it=nt.append("g").attr("class","nv-focus");it.append("g").attr("class","nv-x nv-axis"),it.append("g").attr("class","nv-y1 nv-axis"),it.append("g").attr("class","nv-y2 nv-axis"),it.append("g").attr("class","nv-barsWrap"),it.append("g").attr("class","nv-linesWrap");var ot=nt.append("g").attr("class","nv-context");if(ot.append("g").attr("class","nv-x nv-axis"),ot.append("g").attr("class","nv-y1 nv-axis"),ot.append("g").attr("class","nv-y2 nv-axis"),ot.append("g").attr("class","nv-barsWrap"),ot.append("g").attr("class","nv-linesWrap"),ot.append("g").attr("class","nv-brushBackground"),ot.append("g").attr("class","nv-x nv-brush"),F){var at=y.align()?Z/2:Z,st=y.align()?at:0;y.width(at),rt.select(".nv-legendWrap").datum(b.map(function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=Y?t.originalKey+(t.bar?H:V):t.originalKey+(t.bar?V:H),t})).call(y),w||y.height()===k.top||(k.top=y.height(),q=t.utils.availableHeight(C,B,k)-_),rt.select(".nv-legendWrap").attr("transform","translate("+st+","+-k.top+")")}else rt.select(".nv-legendWrap").selectAll("*").remove();et.attr("transform","translate("+k.left+","+k.top+")"),rt.select(".nv-context").style("display",N?"initial":"none"),d.width(Z).height(K).color(b.map(function(t,e){return t.color||E(t,e)}).filter(function(t,e){return!b[e].disabled&&b[e].bar})),u.width(Z).height(K).color(b.map(function(t,e){return t.color||E(t,e)}).filter(function(t,e){return!b[e].disabled&&!b[e].bar}));var lt=rt.select(".nv-context .nv-barsWrap").datum(Q.length?Q:[{values:[]}]),ut=rt.select(".nv-context .nv-linesWrap").datum(j(J)?[{values:[]}]:J.filter(function(t){return!t.disabled}));rt.select(".nv-context").attr("transform","translate(0,"+(q+k.bottom+M.top)+")"),lt.transition().call(d),ut.transition().call(u),O&&(p._ticks(t.utils.calcTicksX(Z/100,b)).tickSize(-K,0),rt.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+a.range()[0]+")"),rt.select(".nv-context .nv-x.nv-axis").transition().call(p)),D&&(v.scale(a)._ticks(K/36).tickSize(-Z,0),m.scale(s)._ticks(K/36).tickSize(Q.length?0:-Z,0),rt.select(".nv-context .nv-y3.nv-axis").style("opacity",Q.length?1:0).attr("transform","translate(0,"+r.range()[0]+")"),rt.select(".nv-context .nv-y2.nv-axis").style("opacity",J.length?1:0).attr("transform","translate("+r.range()[1]+",0)"),rt.select(".nv-context .nv-y1.nv-axis").transition().call(v),rt.select(".nv-context .nv-y2.nv-axis").transition().call(m)),x.x(r).on("brush",pt),L&&x.extent(L);var ct=rt.select(".nv-brushBackground").selectAll("g").data([L||x.extent()]),dt=ct.enter().append("g");dt.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",K),dt.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",K);var ft=rt.select(".nv-x.nv-brush").call(x);function pt(){L=x.empty()?null:x.extent(),e=x.empty()?r.domain():x.extent(),P.brush({extent:e,brush:x}),x.empty()||x.extent(L),ct.data([x.empty()?r.domain():L]).each(function(t,e){var n=r(t[0])-r.range()[0],i=r.range()[1]-r(t[1]);d3.select(this).select(".left").attr("width",n<0?0:n),d3.select(this).select(".right").attr("x",r(t[1])).attr("width",i<0?0:i)}),c.width(Z).height(q).color(b.map(function(t,e){return t.color||E(t,e)}).filter(function(t,e){return!b[e].disabled&&b[e].bar})),l.width(Z).height(q).color(b.map(function(t,e){return t.color||E(t,e)}).filter(function(t,e){return!b[e].disabled&&!b[e].bar}));var a=rt.select(".nv-focus .nv-barsWrap").datum(Q.length?Q.map(function(t,n){return{key:t.key,values:t.values.filter(function(t,n){return c.x()(t,n)>=e[0]&&c.x()(t,n)<=e[1]})}}):[{values:[]}]),s=rt.select(".nv-focus .nv-linesWrap").datum(j(J)?[{values:[]}]:J.filter(function(t){return!t.disabled}).map(function(t,n){return{area:t.area,fillOpacity:t.fillOpacity,strokeWidth:t.strokeWidth,key:t.key,values:t.values.filter(function(t,n){return l.x()(t,n)>=e[0]&&l.x()(t,n)<=e[1]})}}));n=Q.length&&!Y?c.xScale():l.xScale(),f.scale(n)._ticks(t.utils.calcTicksX(Z/100,b)).tickSize(-q,0),f.domain([Math.ceil(e[0]),Math.floor(e[1])]),rt.select(".nv-x.nv-axis").transition().duration(T).call(f),a.transition().duration(T).call(c),s.transition().duration(T).call(l),rt.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+i.range()[0]+")"),h.scale(i)._ticks(t.utils.calcTicksY(q/36,b)).tickSize(-Z,0),g.scale(o)._ticks(t.utils.calcTicksY(q/36,b)),Y?g.tickSize(J.length?0:-Z,0):g.tickSize(Q.length?0:-Z,0);var u=Q.length?1:0,d=J.length&&!j(J)?1:0,p=Y?d:u,v=Y?u:d;rt.select(".nv-focus .nv-y1.nv-axis").style("opacity",p),rt.select(".nv-focus .nv-y2.nv-axis").style("opacity",v).attr("transform","translate("+n.range()[1]+",0)"),rt.select(".nv-focus .nv-y1.nv-axis").transition().duration(T).call(h),rt.select(".nv-focus .nv-y2.nv-axis").transition().duration(T).call(g)}ft.selectAll("rect").attr("height",K),ft.selectAll(".resize").append("path").attr("d",function(t){var e=+("e"==t),n=e?1:-1,r=K/3;return"M"+.5*n+","+r+"A6,6 0 0 "+e+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+e+" "+.5*n+","+2*r+"ZM"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)}),y.dispatch.on("stateChange",function(t){for(var e in t)I[e]=t[e];P.stateChange(I),R.update()}),P.on("changeState",function(t){void 0!==t.disabled&&(b.forEach(function(e,n){e.disabled=t.disabled[n]}),I.disabled=t.disabled),R.update()}),pt()}),R}return l.dispatch.on("elementMouseover.tooltip",function(t){b.duration(100).valueFormatter(function(t,e){return(Y?{main:h,focus:v}:{main:g,focus:m}).main.tickFormat()(t,e)}).data(t).hidden(!1)}),l.dispatch.on("elementMouseout.tooltip",function(t){b.hidden(!0)}),c.dispatch.on("elementMouseover.tooltip",function(t){t.value=R.x()(t.data),t.series={value:R.y()(t.data),color:t.color},b.duration(0).valueFormatter(function(t,e){return(Y?{main:g,focus:m}:{main:h,focus:v}).main.tickFormat()(t,e)}).data(t).hidden(!1)}),c.dispatch.on("elementMouseout.tooltip",function(t){b.hidden(!0)}),c.dispatch.on("elementMousemove.tooltip",function(t){b()}),R.dispatch=P,R.legend=y,R.lines=l,R.lines2=u,R.bars=c,R.bars2=d,R.xAxis=f,R.x2Axis=p,R.y1Axis=h,R.y2Axis=g,R.y3Axis=v,R.y4Axis=m,R.tooltip=b,R.options=t.utils.optionsFunc.bind(R),R._options=Object.create({},{width:{get:function(){return A},set:function(t){A=t}},height:{get:function(){return C},set:function(t){C=t}},showLegend:{get:function(){return F},set:function(t){F=t}},brushExtent:{get:function(){return L},set:function(t){L=t}},noData:{get:function(){return B},set:function(t){B=t}},focusEnable:{get:function(){return N},set:function(t){N=t}},focusHeight:{get:function(){return _},set:function(t){_=t}},focusShowAxisX:{get:function(){return O},set:function(t){O=t}},focusShowAxisY:{get:function(){return D},set:function(t){D=t}},legendLeftAxisHint:{get:function(){return V},set:function(t){V=t}},legendRightAxisHint:{get:function(){return H},set:function(t){H=t}},margin:{get:function(){return k},set:function(t){void 0!==t.top&&(k.top=t.top,w=t.top),k.right=void 0!==t.right?t.right:k.right,k.bottom=void 0!==t.bottom?t.bottom:k.bottom,k.left=void 0!==t.left?t.left:k.left}},focusMargin:{get:function(){return M},set:function(t){M.top=void 0!==t.top?t.top:M.top,M.right=void 0!==t.right?t.right:M.right,M.bottom=void 0!==t.bottom?t.bottom:M.bottom,M.left=void 0!==t.left?t.left:M.left}},duration:{get:function(){return T},set:function(t){T=t}},color:{get:function(){return E},set:function(e){E=t.utils.getColor(e),y.color(E)}},x:{get:function(){return S},set:function(t){S=t,l.x(t),u.x(t),c.x(t),d.x(t)}},y:{get:function(){return W},set:function(t){W=t,l.y(t),u.y(t),c.y(t),d.y(t)}},switchYAxisOrder:{get:function(){return Y},set:function(t){if(Y!==t){var e=h;h=g,g=e;var n=v;v=m,m=n}Y=t,h.orient("left"),g.orient("right"),v.orient("left"),m.orient("right")}}}),t.utils.inheritOptions(R,l),t.utils.initOptions(R),R},t.models.multiBar=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=d3.scale.ordinal(),f=d3.scale.linear(),p=Math.floor(1e4*Math.random()),h=null,g=function(t){return t.x},v=function(t){return t.y},m=[0],y=!0,x=!1,b="zero",k=t.utils.defaultColor(),w=!1,M=null,A=500,C=.1,S=.75,W=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=t.utils.renderWatch(W,A),F=0;function N(D){return E.reset(),D.each(function(N){var D=u-l.left-l.right,O=c-l.top-l.bottom;h=d3.select(this),t.utils.initSVG(h);var _=0;if(w&&N.length&&(w=[{values:N[0].values.map(function(t){return{x:t.x,y:0,series:t.series,size:.01}})}]),x){var L=d3.layout.stack().offset(b).values(function(t){return t.values}).y(v)(!N.length&&w?w:N);L.forEach(function(t,e){t.nonStackable?(N[e].nonStackableSeries=_++,L[e]=N[e]):e>0&&L[e-1].nonStackable&&L[e].values.map(function(t,n){t.y0-=L[e-1].values[n].y,t.y1=t.y0+t.y})}),N=L}N.forEach(function(t,e){t.values.forEach(function(n){n.series=e,n.key=t.key})}),x&&N.length>0&&N[0].values.map(function(t,e){var n=0,r=0;N.map(function(t,i){if(!N[i].nonStackable){var o=t.values[e];o.size=Math.abs(o.y),o.y<0?(o.y1=r,r-=o.size):(o.y1=o.size+n,n+=o.size)}})});var B=n&&r?[]:N.map(function(t,e){return t.values.map(function(t,n){return{x:g(t,n),y:v(t,n),y0:t.y0,y1:t.y1,idx:e}})});d.domain(n||d3.merge(B).map(function(t){return t.x})).rangeBands(i||[0,D],C),f.domain(r||d3.extent(d3.merge(B).map(function(t){var e=t.y;return x&&!N[t.idx].nonStackable&&(e=t.y>0?t.y1:t.y1+t.y),e}).concat(m))).range(o||[O,0]),d.domain()[0]===d.domain()[1]&&(d.domain()[0]?d.domain([d.domain()[0]-.01*d.domain()[0],d.domain()[1]+.01*d.domain()[1]]):d.domain([-1,1])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+.01*f.domain()[0],f.domain()[1]-.01*f.domain()[1]]):f.domain([-1,1])),a=a||d,s=s||f;var P=h.selectAll("g.nv-wrap.nv-multibar").data([N]),T=P.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),I=T.append("defs"),z=T.append("g"),V=P.select("g");z.append("g").attr("class","nv-groups"),P.attr("transform","translate("+l.left+","+l.top+")"),I.append("clipPath").attr("id","nv-edge-clip-"+p).append("rect"),P.select("#nv-edge-clip-"+p+" rect").attr("width",D).attr("height",O),V.attr("clip-path",y?"url(#nv-edge-clip-"+p+")":"");var H=P.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t,e){return e});H.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);var Y=E.transition(H.exit().selectAll("rect.nv-bar"),"multibarExit",Math.min(100,A)).attr("y",function(t,e,n){var r=s(0)||0;return x&&N[t.series]&&!N[t.series].nonStackable&&(r=s(t.y0)),r}).attr("height",0).remove();Y.delay&&Y.delay(function(t,e){return e*(A/(F+1))-e}),H.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return k(t,e)}).style("stroke",function(t,e){return k(t,e)}),H.style("stroke-opacity",1).style("fill-opacity",S);var G=H.selectAll("rect.nv-bar").data(function(t){return w&&!N.length?w.values:t.values});G.exit().remove();G.enter().append("rect").attr("class",function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(t,e,n){return x&&!N[n].nonStackable?0:n*d.rangeBand()/N.length}).attr("y",function(t,e,n){return s(x&&!N[n].nonStackable?t.y0:0)||0}).attr("height",0).attr("width",function(t,e,n){return d.rangeBand()/(x&&!N[n].nonStackable?1:N.length)}).attr("transform",function(t,e){return"translate("+d(g(t,e))+",0)"});G.style("fill",function(t,e,n){return k(t,n,e)}).style("stroke",function(t,e,n){return k(t,n,e)}).on("mouseover",function(t,e,n){d3.select(this).classed("hover",!0),W.elementMouseover({data:t,index:e,series:N[n],color:d3.select(this).style("fill")})}).on("mouseout",function(t,e,n){d3.select(this).classed("hover",!1),W.elementMouseout({data:t,index:e,series:N[n],color:d3.select(this).style("fill")})}).on("mousemove",function(t,e,n){W.elementMousemove({data:t,index:e,series:N[n],color:d3.select(this).style("fill")})}).on("click",function(t,e,n){W.elementClick({data:t,index:e,series:N[n],color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()}).on("dblclick",function(t,e,n){W.elementDblClick({data:t,index:e,series:N[n],color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),G.attr("class",function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(t,e){return"translate("+d(g(t,e))+",0)"}),M&&(e||(e=N.map(function(){return!0})),G.style("fill",function(t,n,r){return d3.rgb(M(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[r]).toString()}).style("stroke",function(t,n,r){return d3.rgb(M(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[r]).toString()}));var X=G.watchTransition(E,"multibar",Math.min(250,A)).delay(function(t,e){return e*A/N[0].values.length});x?X.attr("y",function(t,e,n){return N[n].nonStackable?v(t,e)<0?f(0):f(0)-f(v(t,e))<-1?f(0)-1:f(v(t,e))||0:f(t.y1)}).attr("height",function(t,e,n){return N[n].nonStackable?Math.max(Math.abs(f(v(t,e))-f(0)),0)||0:Math.max(Math.abs(f(t.y+t.y0)-f(t.y0)),0)}).attr("x",function(t,e,n){var r=0;return N[n].nonStackable&&(r=t.series*d.rangeBand()/N.length,N.length!==_&&(r=N[n].nonStackableSeries*d.rangeBand()/(2*_))),r}).attr("width",function(t,e,n){if(N[n].nonStackable){var r=d.rangeBand()/_;return N.length!==_&&(r=d.rangeBand()/(2*_)),r}return d.rangeBand()}):X.attr("x",function(t,e){return t.series*d.rangeBand()/N.length}).attr("width",d.rangeBand()/N.length).attr("y",function(t,e){return v(t,e)<0?f(0):f(0)-f(v(t,e))<1?f(0)-1:f(v(t,e))||0}).attr("height",function(t,e){return Math.max(Math.abs(f(v(t,e))-f(0)),1)||0}),a=d.copy(),s=f.copy(),N[0]&&N[0].values&&(F=N[0].values.length)}),E.renderEnd("multibar immediate"),N}return N.dispatch=W,N.options=t.utils.optionsFunc.bind(N),N._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},xScale:{get:function(){return d},set:function(t){d=t}},yScale:{get:function(){return f},set:function(t){f=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceY:{get:function(){return m},set:function(t){m=t}},stacked:{get:function(){return x},set:function(t){x=t}},stackOffset:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return y},set:function(t){y=t}},disabled:{get:function(){return e},set:function(t){e=t}},id:{get:function(){return p},set:function(t){p=t}},hideable:{get:function(){return w},set:function(t){w=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return A},set:function(t){A=t,E.reset(A)}},color:{get:function(){return k},set:function(e){k=t.utils.getColor(e)}},barColor:{get:function(){return M},set:function(e){M=e?t.utils.getColor(e):null}}}),t.utils.initOptions(N),N},t.models.multiBarChart=function(){"use strict";var e,n,r=t.models.multiBar(),i=t.models.axis(),o=t.models.axis(),a=t.interactiveGuideline(),s=t.models.legend(),l=t.models.legend(),u=t.models.tooltip(),c={top:30,right:20,bottom:50,left:60},d=null,f=null,p=null,h=t.utils.defaultColor(),g=!0,v={},m=!0,y=null,x=!0,b=!0,k=!1,w=!0,M=!1,A=!1,C=0,S=t.utils.state(),W=null,E=null,F=d3.dispatch("stateChange","changeState","renderEnd"),N=function(){return g?180:0},D=250,O=!1;S.stacked=!1,r.stacked(!1),i.orient("bottom").tickPadding(7).showMaxMin(!1).tickFormat(function(t){return t}),o.orient(k?"right":"left").tickFormat(d3.format(",.1f")),u.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.valueFormatter(function(t,e){return null==t?"N/A":o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.valueFormatter(function(t,e){return null==t?"N/A":o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),a.tooltip.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),l.updateState(!1);var _=t.utils.renderWatch(F),L=!1,B=function(t){return function(){return{active:t.map(function(t){return!t.disabled}),stacked:L}}},P=function(t){return function(e){void 0!==e.stacked&&(L=e.stacked),void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};function T(E){return _.reset(),_.models(r),x&&_.models(i),b&&_.models(o),E.each(function(E){var _=d3.select(this);t.utils.initSVG(_);var I=t.utils.availableWidth(f,_,c),z=t.utils.availableHeight(p,_,c);if(T.update=function(){0===D?_.call(T):_.transition().duration(D).call(T)},T.container=this,S.setter(P(E),T.update).getter(B(E)).update(),S.disabled=E.map(function(t){return!!t.disabled}),!W){var V;W={};for(V in S)S[V]instanceof Array?W[V]=S[V].slice(0):W[V]=S[V]}if(!(E&&E.length&&E.filter(function(t){return t.values.length}).length))return t.utils.noData(T,_),T;_.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale();var H=_.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([E]),Y=H.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),G=H.select("g");if(Y.append("g").attr("class","nv-x nv-axis"),Y.append("g").attr("class","nv-y nv-axis"),Y.append("g").attr("class","nv-barsWrap"),Y.append("g").attr("class","nv-legendWrap"),Y.append("g").attr("class","nv-controlsWrap"),Y.append("g").attr("class","nv-interactive"),m?"bottom"===y?(s.width(I-c.right),G.select(".nv-legendWrap").datum(E).call(s),c.bottom=i.height()+s.height(),z=t.utils.availableHeight(p,_,c),G.select(".nv-legendWrap").attr("transform","translate(0,"+(z+i.height())+")")):(s.width(I-N()),G.select(".nv-legendWrap").datum(E).call(s),d||s.height()===c.top||(c.top=s.height(),z=t.utils.availableHeight(p,_,c)),G.select(".nv-legendWrap").attr("transform","translate("+N()+","+-c.top+")")):G.select(".nv-legendWrap").selectAll("*").remove(),g){var X=[{key:v.grouped||"Grouped",disabled:r.stacked()},{key:v.stacked||"Stacked",disabled:!r.stacked()}];l.width(N()).color(["#444","#444","#444"]),G.select(".nv-controlsWrap").datum(X).attr("transform","translate(0,"+-c.top+")").call(l)}else G.select(".nv-controlsWrap").selectAll("*").remove();if(H.attr("transform","translate("+c.left+","+c.top+")"),k&&G.select(".nv-y.nv-axis").attr("transform","translate("+I+",0)"),r.disabled(E.map(function(t){return t.disabled})).width(I).height(z).color(E.map(function(t,e){return t.color||h(t,e)}).filter(function(t,e){return!E[e].disabled})),G.select(".nv-barsWrap").datum(E.filter(function(t){return!t.disabled})).call(r),x){i.scale(e)._ticks(t.utils.calcTicksX(I/100,E)).tickSize(-z,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),G.select(".nv-x.nv-axis").call(i);var j=G.select(".nv-x.nv-axis > g").selectAll("g");if(j.selectAll("line, text").style("opacity",1),M){var R=function(t,e){return"translate("+t+","+e+")"};j.selectAll("text").attr("transform",function(t,e,n){return R(0,n%2==0?5:17)});var Z=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;G.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(t,e){return R(0,0===e||Z%2!=0?17:5)})}A&&G.selectAll(".tick text").call(t.utils.wrapTicks,T.xAxis.rangeBand()),w&&j.filter(function(t,e){return e%Math.ceil(E[0].values.length/(I/100))!=0}).selectAll("text, line").style("opacity",0),C&&j.selectAll(".tick text").attr("transform","rotate("+C+" 0,0)").style("text-anchor",C>0?"start":"end"),G.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}b&&(o.scale(n)._ticks(t.utils.calcTicksY(z/36,E)).tickSize(-I,0),G.select(".nv-y.nv-axis").call(o)),O&&(a.width(I).height(z).margin({left:c.left,top:c.top}).svgContainer(_).xScale(e),H.select(".nv-interactive").call(a)),s.dispatch.on("stateChange",function(t){for(var e in t)S[e]=t[e];F.stateChange(S),T.update()}),l.dispatch.on("legendClick",function(t,e){if(t.disabled){switch(X=X.map(function(t){return t.disabled=!0,t}),t.disabled=!1,t.key){case"Grouped":case v.grouped:r.stacked(!1);break;case"Stacked":case v.stacked:r.stacked(!0)}S.stacked=r.stacked(),F.stateChange(S),T.update()}}),F.on("changeState",function(t){void 0!==t.disabled&&(E.forEach(function(e,n){e.disabled=t.disabled[n]}),S.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),S.stacked=t.stacked,L=t.stacked),T.update()}),O?(a.dispatch.on("elementMousemove",function(t){if(void 0!=t.pointXValue){var n,r,i,o,s=[];E.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(a,l){r=e.domain().indexOf(t.pointXValue);var u=a.values[r];void 0!==u&&(o=u.x,void 0===n&&(n=u),void 0===i&&(i=t.mouseX),s.push({key:a.key,value:T.y()(u,r),color:h(a,a.seriesIndex),data:a.values[r]}))}),a.tooltip.data({value:o,index:r,series:s})(),a.renderGuideLine(i)}}),a.dispatch.on("elementMouseout",function(t){a.tooltip.hidden(!0)})):(r.dispatch.on("elementMouseover.tooltip",function(t){t.value=T.x()(t.data),t.series={key:t.data.key,value:T.y()(t.data),color:t.color},u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){u()}))}),_.renderEnd("multibarchart immediate"),T}return T.dispatch=F,T.multibar=r,T.legend=s,T.controls=l,T.xAxis=i,T.yAxis=o,T.state=S,T.tooltip=u,T.interactiveLayer=a,T.options=t.utils.optionsFunc.bind(T),T._options=Object.create({},{width:{get:function(){return f},set:function(t){f=t}},height:{get:function(){return p},set:function(t){p=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},showControls:{get:function(){return g},set:function(t){g=t}},controlLabels:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return W},set:function(t){W=t}},noData:{get:function(){return E},set:function(t){E=t}},reduceXTicks:{get:function(){return w},set:function(t){w=t}},rotateLabels:{get:function(){return C},set:function(t){C=t}},staggerLabels:{get:function(){return M},set:function(t){M=t}},wrapLabels:{get:function(){return A},set:function(t){A=!!t}},margin:{get:function(){return c},set:function(t){void 0!==t.top&&(c.top=t.top,d=t.top),c.right=void 0!==t.right?t.right:c.right,c.bottom=void 0!==t.bottom?t.bottom:c.bottom,c.left=void 0!==t.left?t.left:c.left}},duration:{get:function(){return D},set:function(t){D=t,r.duration(D),i.duration(D),o.duration(D),_.reset(D)}},color:{get:function(){return h},set:function(e){h=t.utils.getColor(e),s.color(h)}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,o.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return O},set:function(t){O=t}},barColor:{get:function(){return r.barColor},set:function(t){r.barColor(t),s.color(function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()})}}}),t.utils.inheritOptions(T,r),t.utils.initOptions(T),T},t.models.multiBarHorizontal=function(){"use strict";var e,n,r,i,o,a,s,l={top:0,right:0,bottom:0,left:0},u=960,c=500,d=Math.floor(1e4*Math.random()),f=null,p=d3.scale.ordinal(),h=d3.scale.linear(),g=function(t){return t.x},v=function(t){return t.y},m=function(t){return t.yErr},y=[0],x=t.utils.defaultColor(),b=null,k=!1,w=!1,M=!1,A=60,C=.1,S=.75,W=d3.format(",.2f"),E=250,F=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),N=t.utils.renderWatch(F,E);function D(d){return N.reset(),d.each(function(d){var E=u-l.left-l.right,D=c-l.top-l.bottom;f=d3.select(this),t.utils.initSVG(f),k&&(d=d3.layout.stack().offset("zero").values(function(t){return t.values}).y(v)(d)),d.forEach(function(t,e){t.values.forEach(function(n){n.series=e,n.key=t.key})}),k&&d[0].values.map(function(t,e){var n=0,r=0;d.map(function(t){var i=t.values[e];i.size=Math.abs(i.y),i.y<0?(i.y1=r-i.size,r-=i.size):(i.y1=n,n+=i.size)})});var O=n&&r?[]:d.map(function(t){return t.values.map(function(t,e){return{x:g(t,e),y:v(t,e),y0:t.y0,y1:t.y1}})});p.domain(n||d3.merge(O).map(function(t){return t.x})).rangeBands(i||[0,D],C),h.domain(r||d3.extent(d3.merge(O).map(function(t){return k?t.y>0?t.y1+t.y:t.y1:t.y}).concat(y))),w&&!k?h.range(o||[h.domain()[0]<0?A:0,E-(h.domain()[1]>0?A:0)]):h.range(o||[0,E]),a=a||p,s=s||d3.scale.linear().domain(h.domain()).range([h(0),h(0)]);var _=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([d]),L=_.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),B=(L.append("defs"),L.append("g"));_.select("g");B.append("g").attr("class","nv-groups"),_.attr("transform","translate("+l.left+","+l.top+")");var P=_.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t,e){return e});P.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),P.exit().watchTransition(N,"multibarhorizontal: exit groups").style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),P.attr("class",function(t,e){return"nv-group nv-series-"+e}).classed("hover",function(t){return t.hover}).style("fill",function(t,e){return x(t,e)}).style("stroke",function(t,e){return x(t,e)}),P.watchTransition(N,"multibarhorizontal: groups").style("stroke-opacity",1).style("fill-opacity",S);var T=P.selectAll("g.nv-bar").data(function(t){return t.values});T.exit().remove();var I=T.enter().append("g").attr("transform",function(t,e,n){return"translate("+s(k?t.y0:0)+","+(k?0:n*p.rangeBand()/d.length+p(g(t,e)))+")"});I.append("rect").attr("width",0).attr("height",p.rangeBand()/(k?1:d.length)),T.on("mouseover",function(t,e){d3.select(this).classed("hover",!0),F.elementMouseover({data:t,index:e,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1),F.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})}).on("mouseout",function(t,e){F.elementMouseout({data:t,index:e,color:d3.select(this).style("fill")})}).on("mousemove",function(t,e){F.elementMousemove({data:t,index:e,color:d3.select(this).style("fill")})}).on("click",function(t,e){F.elementClick({data:t,index:e,color:d3.select(this).style("fill"),event:d3.event,element:this}),d3.event.stopPropagation()}).on("dblclick",function(t,e){F.elementDblClick({data:t,index:e,color:d3.select(this).style("fill")}),d3.event.stopPropagation()}),m(d[0],0)&&(I.append("polyline"),T.select("polyline").attr("fill","none").attr("points",function(t,e){var n=m(t,e),r=.8*p.rangeBand()/(2*(k?1:d.length));return[[(n=(n=n.length?n:[-Math.abs(n),Math.abs(n)]).map(function(n){return h(n+(v(t,e)<0?0:v(t,e)))-h(0)}))[0],-r],[n[0],r],[n[0],0],[n[1],0],[n[1],-r],[n[1],r]].map(function(t){return t.join(",")}).join(" ")}).attr("transform",function(t,e){return"translate(0, "+p.rangeBand()/(2*(k?1:d.length))+")"})),I.append("text"),w&&!k?(T.select("text").attr("text-anchor",function(t,e){return v(t,e)<0?"end":"start"}).attr("y",p.rangeBand()/(2*d.length)).attr("dy",".32em").text(function(t,e){var n=W(v(t,e)),r=m(t,e);return void 0===r?n:r.length?n+"+"+W(Math.abs(r[1]))+"-"+W(Math.abs(r[0])):n+"±"+W(Math.abs(r))}),T.watchTransition(N,"multibarhorizontal: bars").select("text").attr("x",function(t,e){return v(t,e)<0?-4:h(v(t,e))-h(0)+4})):T.selectAll("text").text(""),M&&!k?(I.append("text").classed("nv-bar-label",!0),T.select("text.nv-bar-label").attr("text-anchor",function(t,e){return v(t,e)<0?"start":"end"}).attr("y",p.rangeBand()/(2*d.length)).attr("dy",".32em").text(function(t,e){return g(t,e)}),T.watchTransition(N,"multibarhorizontal: bars").select("text.nv-bar-label").attr("x",function(t,e){return v(t,e)<0?h(0)-h(v(t,e))+4:-4})):T.selectAll("text.nv-bar-label").text(""),T.attr("class",function(t,e){return v(t,e)<0?"nv-bar negative":"nv-bar positive"}),b&&(e||(e=d.map(function(){return!0})),T.style("fill",function(t,n,r){return d3.rgb(b(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[r]).toString()}).style("stroke",function(t,n,r){return d3.rgb(b(t,n)).darker(e.map(function(t,e){return e}).filter(function(t,n){return!e[n]})[r]).toString()})),k?T.watchTransition(N,"multibarhorizontal: bars").attr("transform",function(t,e){return"translate("+h(t.y1)+","+p(g(t,e))+")"}).select("rect").attr("width",function(t,e){return Math.abs(h(v(t,e)+t.y0)-h(t.y0))||0}).attr("height",p.rangeBand()):T.watchTransition(N,"multibarhorizontal: bars").attr("transform",function(t,e){return"translate("+(v(t,e)<0?h(v(t,e)):h(0))+","+(t.series*p.rangeBand()/d.length+p(g(t,e)))+")"}).select("rect").attr("height",p.rangeBand()/d.length).attr("width",function(t,e){return Math.max(Math.abs(h(v(t,e))-h(0)),1)||0}),a=p.copy(),s=h.copy()}),N.renderEnd("multibarHorizontal immediate"),D}return D.dispatch=F,D.options=t.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return u},set:function(t){u=t}},height:{get:function(){return c},set:function(t){c=t}},x:{get:function(){return g},set:function(t){g=t}},y:{get:function(){return v},set:function(t){v=t}},yErr:{get:function(){return m},set:function(t){m=t}},xScale:{get:function(){return p},set:function(t){p=t}},yScale:{get:function(){return h},set:function(t){h=t}},xDomain:{get:function(){return n},set:function(t){n=t}},yDomain:{get:function(){return r},set:function(t){r=t}},xRange:{get:function(){return i},set:function(t){i=t}},yRange:{get:function(){return o},set:function(t){o=t}},forceY:{get:function(){return y},set:function(t){y=t}},stacked:{get:function(){return k},set:function(t){k=t}},showValues:{get:function(){return w},set:function(t){w=t}},disabled:{get:function(){return e},set:function(t){e=t}},id:{get:function(){return d},set:function(t){d=t}},valueFormat:{get:function(){return W},set:function(t){W=t}},valuePadding:{get:function(){return A},set:function(t){A=t}},groupSpacing:{get:function(){return C},set:function(t){C=t}},fillOpacity:{get:function(){return S},set:function(t){S=t}},margin:{get:function(){return l},set:function(t){l.top=void 0!==t.top?t.top:l.top,l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},duration:{get:function(){return E},set:function(t){E=t,N.reset(E)}},color:{get:function(){return x},set:function(e){x=t.utils.getColor(e)}},barColor:{get:function(){return b},set:function(e){b=e?t.utils.getColor(e):null}}}),t.utils.initOptions(D),D},t.models.multiBarHorizontalChart=function(){"use strict";var e,n,r=t.models.multiBarHorizontal(),i=t.models.axis(),o=t.models.axis(),a=t.models.legend().height(30),s=t.models.legend().height(30),l=t.models.tooltip(),u={top:30,right:20,bottom:50,left:60},c=null,d=null,f=null,p=t.utils.defaultColor(),h=!0,g="top",v={},m=!0,y="top",x=!0,b=!0,k=!1,w=t.utils.state(),M=null,A=null,C=d3.dispatch("stateChange","changeState","renderEnd"),S=function(){return h?180:0},W=250;w.stacked=!1,r.stacked(k),i.orient("left").tickPadding(5).showMaxMin(!1).tickFormat(function(t){return t}),o.orient("bottom").tickFormat(d3.format(",.1f")),l.duration(0).valueFormatter(function(t,e){return o.tickFormat()(t,e)}).headerFormatter(function(t,e){return i.tickFormat()(t,e)}),s.updateState(!1);var E=function(t){return function(){return{active:t.map(function(t){return!t.disabled}),stacked:k}}},F=function(t){return function(e){void 0!==e.stacked&&(k=e.stacked),void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}},N=t.utils.renderWatch(C,W);function D(l){return N.reset(),N.models(r),x&&N.models(i),b&&N.models(o),l.each(function(l){var A=d3.select(this);t.utils.initSVG(A);var N=t.utils.availableWidth(d,A,u),O=t.utils.availableHeight(f,A,u);if(D.update=function(){A.transition().duration(W).call(D)},D.container=this,k=r.stacked(),w.setter(F(l),D.update).getter(E(l)).update(),w.disabled=l.map(function(t){return!!t.disabled}),!M){var _;M={};for(_ in w)w[_]instanceof Array?M[_]=w[_].slice(0):M[_]=w[_]}if(!(l&&l.length&&l.filter(function(t){return t.values.length}).length))return t.utils.noData(D,A),D;A.selectAll(".nv-noData").remove(),e=r.xScale(),n=r.yScale().clamp(!0);var L=A.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([l]),B=L.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),P=L.select("g");if(B.append("g").attr("class","nv-x nv-axis"),B.append("g").attr("class","nv-y nv-axis").append("g").attr("class","nv-zeroLine").append("line"),B.append("g").attr("class","nv-barsWrap"),B.append("g").attr("class","nv-legendWrap"),B.append("g").attr("class","nv-controlsWrap"),m?(a.width(N-S()),P.select(".nv-legendWrap").datum(l).call(a),"bottom"===y?(u.bottom=i.height()+a.height(),O=t.utils.availableHeight(f,A,u),P.select(".nv-legendWrap").attr("transform","translate("+S()+","+(O+i.height())+")")):"top"===y&&(c||a.height()===u.top||(u.top=a.height(),O=t.utils.availableHeight(f,A,u)),P.select(".nv-legendWrap").attr("transform","translate("+S()+","+-u.top+")"))):P.select(".nv-legendWrap").selectAll("*").remove(),h){var T=[{key:v.grouped||"Grouped",disabled:r.stacked()},{key:v.stacked||"Stacked",disabled:!r.stacked()}];s.width(S()).color(["#444","#444","#444"]),"bottom"===g?(u.bottom=i.height()+a.height(),O=t.utils.availableHeight(f,A,u),P.select(".nv-controlsWrap").datum(T).attr("transform","translate(0,"+(O+i.height())+")").call(s)):"top"===g&&P.select(".nv-controlsWrap").datum(T).attr("transform","translate(0,"+-u.top+")").call(s)}else P.select(".nv-controlsWrap").selectAll("*").remove();(L.attr("transform","translate("+u.left+","+u.top+")"),r.disabled(l.map(function(t){return t.disabled})).width(N).height(O).color(l.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!l[e].disabled})),P.select(".nv-barsWrap").datum(l.filter(function(t){return!t.disabled})).transition().call(r),x)&&(i.scale(e)._ticks(t.utils.calcTicksY(O/24,l)).tickSize(-N,0),P.select(".nv-x.nv-axis").call(i),P.select(".nv-x.nv-axis").selectAll("g").selectAll("line, text"));b&&(o.scale(n)._ticks(t.utils.calcTicksX(N/100,l)).tickSize(-O,0),P.select(".nv-y.nv-axis").attr("transform","translate(0,"+O+")"),P.select(".nv-y.nv-axis").call(o)),P.select(".nv-zeroLine line").attr("x1",n(0)).attr("x2",n(0)).attr("y1",0).attr("y2",-O),a.dispatch.on("stateChange",function(t){for(var e in t)w[e]=t[e];C.stateChange(w),D.update()}),s.dispatch.on("legendClick",function(t,e){if(t.disabled){switch(T=T.map(function(t){return t.disabled=!0,t}),t.disabled=!1,t.key){case"Grouped":case v.grouped:r.stacked(!1);break;case"Stacked":case v.stacked:r.stacked(!0)}w.stacked=r.stacked(),C.stateChange(w),k=r.stacked(),D.update()}}),C.on("changeState",function(t){void 0!==t.disabled&&(l.forEach(function(e,n){e.disabled=t.disabled[n]}),w.disabled=t.disabled),void 0!==t.stacked&&(r.stacked(t.stacked),w.stacked=t.stacked,k=t.stacked),D.update()})}),N.renderEnd("multibar horizontal chart immediate"),D}return r.dispatch.on("elementMouseover.tooltip",function(t){t.value=D.x()(t.data),t.series={key:t.data.key,value:D.y()(t.data),color:t.color},l.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){l.hidden(!0)}),r.dispatch.on("elementMousemove.tooltip",function(t){l()}),D.dispatch=C,D.multibar=r,D.legend=a,D.controls=s,D.xAxis=i,D.yAxis=o,D.state=w,D.tooltip=l,D.options=t.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return d},set:function(t){d=t}},height:{get:function(){return f},set:function(t){f=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},controlsPosition:{get:function(){return g},set:function(t){g=t}},showControls:{get:function(){return h},set:function(t){h=t}},controlLabels:{get:function(){return v},set:function(t){v=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return M},set:function(t){M=t}},noData:{get:function(){return A},set:function(t){A=t}},margin:{get:function(){return u},set:function(t){void 0!==t.top&&(u.top=t.top,c=t.top),u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return W},set:function(t){W=t,N.reset(W),r.duration(W),i.duration(W),o.duration(W)}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),a.color(p)}},barColor:{get:function(){return r.barColor},set:function(t){r.barColor(t),a.color(function(t,e){return d3.rgb("#ccc").darker(1.5*e).toString()})}}}),t.utils.inheritOptions(D,r),t.utils.initOptions(D),D},t.models.multiChart=function(){"use strict";var e,n,r={top:30,right:20,bottom:50,left:60},i=null,o=t.utils.defaultColor(),a=null,s=null,l=!0,u=null,c=function(t){return t.x},d=function(t){return t.y},f="linear",p=!0,h=t.interactiveGuideline(),g=!1,v=" (right axis)",m=250,y=d3.scale.linear(),x=d3.scale.linear(),b=d3.scale.linear(),k=t.models.line().yScale(x).duration(m),w=t.models.line().yScale(b).duration(m),M=t.models.scatter().yScale(x).duration(m),A=t.models.scatter().yScale(b).duration(m),C=t.models.multiBar().stacked(!1).yScale(x).duration(m),S=t.models.multiBar().stacked(!1).yScale(b).duration(m),W=t.models.stackedArea().yScale(x).duration(m),E=t.models.stackedArea().yScale(b).duration(m),F=t.models.axis().scale(y).orient("bottom").tickPadding(5).duration(m),N=t.models.axis().scale(x).orient("left").duration(m),D=t.models.axis().scale(b).orient("right").duration(m),O=t.models.legend().height(30),_=t.models.tooltip(),L=d3.dispatch(),B=[k,w,M,A,C,S,W,E];function P(u){return u.each(function(u){var p=d3.select(this);t.utils.initSVG(p),P.update=function(){p.transition().call(P)},P.container=this;var m=t.utils.availableWidth(a,p,r),L=t.utils.availableHeight(s,p,r),T=u.filter(function(t){return"line"==t.type&&1==t.yAxis}),I=u.filter(function(t){return"line"==t.type&&2==t.yAxis}),z=u.filter(function(t){return"scatter"==t.type&&1==t.yAxis}),V=u.filter(function(t){return"scatter"==t.type&&2==t.yAxis}),H=u.filter(function(t){return"bar"==t.type&&1==t.yAxis}),Y=u.filter(function(t){return"bar"==t.type&&2==t.yAxis}),G=u.filter(function(t){return"area"==t.type&&1==t.yAxis}),X=u.filter(function(t){return"area"==t.type&&2==t.yAxis});if(!(u&&u.length&&u.filter(function(t){return t.values.length}).length))return t.utils.noData(P,p),P;p.selectAll(".nv-noData").remove();var j=u.filter(function(t){return!t.disabled&&1==t.yAxis}).map(function(t){return t.values.map(function(t,e){return{x:c(t),y:d(t)}})}),R=u.filter(function(t){return!t.disabled&&2==t.yAxis}).map(function(t){return t.values.map(function(t,e){return{x:c(t),y:d(t)}})});y.domain(d3.extent(d3.merge(j.concat(R)),function(t){return t.x})).range([0,m]);var Z=p.selectAll("g.wrap.multiChart").data([u]),q=Z.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");q.append("g").attr("class","nv-x nv-axis"),q.append("g").attr("class","nv-y1 nv-axis"),q.append("g").attr("class","nv-y2 nv-axis"),q.append("g").attr("class","stack1Wrap"),q.append("g").attr("class","stack2Wrap"),q.append("g").attr("class","bars1Wrap"),q.append("g").attr("class","bars2Wrap"),q.append("g").attr("class","scatters1Wrap"),q.append("g").attr("class","scatters2Wrap"),q.append("g").attr("class","lines1Wrap"),q.append("g").attr("class","lines2Wrap"),q.append("g").attr("class","legendWrap"),q.append("g").attr("class","nv-interactive");var K=Z.select("g"),U=u.map(function(t,e){return u[e].color||o(t,e)});if(l){var Q=O.align()?m/2:m,J=O.align()?Q:0;O.width(Q),O.color(U),K.select(".legendWrap").datum(u.map(function(t){return t.originalKey=void 0===t.originalKey?t.key:t.originalKey,t.key=t.originalKey+(1==t.yAxis?"":v),t})).call(O),i||O.height()===r.top||(r.top=O.height(),L=t.utils.availableHeight(s,p,r)),K.select(".legendWrap").attr("transform","translate("+J+","+-r.top+")")}else K.select(".legendWrap").selectAll("*").remove();k.width(m).height(L).interpolate(f).color(U.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"line"==u[e].type})),w.width(m).height(L).interpolate(f).color(U.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"line"==u[e].type})),M.width(m).height(L).color(U.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"scatter"==u[e].type})),A.width(m).height(L).color(U.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"scatter"==u[e].type})),C.width(m).height(L).color(U.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"bar"==u[e].type})),S.width(m).height(L).color(U.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"bar"==u[e].type})),W.width(m).height(L).interpolate(f).color(U.filter(function(t,e){return!u[e].disabled&&1==u[e].yAxis&&"area"==u[e].type})),E.width(m).height(L).interpolate(f).color(U.filter(function(t,e){return!u[e].disabled&&2==u[e].yAxis&&"area"==u[e].type})),K.attr("transform","translate("+r.left+","+r.top+")");var $=K.select(".lines1Wrap").datum(T.filter(function(t){return!t.disabled})),tt=K.select(".scatters1Wrap").datum(z.filter(function(t){return!t.disabled})),et=K.select(".bars1Wrap").datum(H.filter(function(t){return!t.disabled})),nt=K.select(".stack1Wrap").datum(G.filter(function(t){return!t.disabled})),rt=K.select(".lines2Wrap").datum(I.filter(function(t){return!t.disabled})),it=K.select(".scatters2Wrap").datum(V.filter(function(t){return!t.disabled})),ot=K.select(".bars2Wrap").datum(Y.filter(function(t){return!t.disabled})),at=K.select(".stack2Wrap").datum(X.filter(function(t){return!t.disabled})),st=[];C.stacked()&&H.length&&((st=H.filter(function(t){return!t.disabled}).map(function(t){return t.values})).length>0&&(st=st.reduce(function(t,e){return t.map(function(t,n){return{x:t.x,y:t.y+e[n].y}})})));H.length&&st.push({x:0,y:0});var lt=[];S.stacked()&&Y.length&&((lt=Y.filter(function(t){return!t.disabled}).map(function(t){return t.values})).length>0&&(lt=lt.reduce(function(t,e){return t.map(function(t,n){return{x:t.x,y:t.y+e[n].y}})})));function ut(t){var e=2===t.series.yAxis?D:N;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},_.duration(0).headerFormatter(function(t,e){return F.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function ct(t){var e=2===t.series.yAxis?D:N;t.value=t.point.x,t.series={value:t.point.y,color:t.point.color,key:t.series.key},_.duration(100).headerFormatter(function(t,e){return F.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function dt(t){var e=2===t.series.yAxis?D:N;t.point.x=W.x()(t.point),t.point.y=W.y()(t.point),_.duration(0).headerFormatter(function(t,e){return F.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function ft(t){var e=2===t.series.yAxis?D:N;t.value=C.x()(t.data),t.series={value:C.y()(t.data),color:t.color,key:t.data.key},_.duration(0).headerFormatter(function(t,e){return F.tickFormat()(t,e)}).valueFormatter(function(t,n){return e.tickFormat()(t,n)}).data(t).hidden(!1)}function pt(){for(var t=0,e=B.length;t=u[0]&&P.x()(t,e)<=u[1]}),d=c[r=t.interactiveBisect(c,e.pointXValue,P.x())],f=P.y()(d,r);null!==f&&function(t,e,n){for(var r=0,i=B.length;rg(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}).attr("d",function(t,e){return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-W/2+",0l"+W/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(t,e)))+"l"+W/2+",0l"+-W/2+",0z"}).attr("transform",function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"}).attr("fill",function(t,e){return w[0]}).attr("stroke",function(t,e){return w[0]}).attr("x",0).attr("y",function(t,e){return d(Math.max(0,p(t,e)))}).attr("height",function(t,e){return Math.abs(d(p(t,e))-d(0))}),_.attr("class",function(t,e,n){return(h(t,e)>g(t,e)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+n+"-"+e}),d3.transition(_).attr("transform",function(t,e){return"translate("+c(f(t,e))+","+d(v(t,e))+")"}).attr("d",function(t,e){var n=C/M[0].values.length*.9;return"m0,0l0,"+(d(h(t,e))-d(v(t,e)))+"l"+-n/2+",0l"+n/2+",0l0,"+(d(m(t,e))-d(h(t,e)))+"l0,"+(d(g(t,e))-d(m(t,e)))+"l"+n/2+",0l"+-n/2+",0z"})}),C}return C.highlightPoint=function(t,e){C.clearHighlights(),u.select(".nv-ohlcBar .nv-tick-0-"+t).classed("hover",e)},C.clearHighlights=function(){u.select(".nv-ohlcBar .nv-tick.hover").classed("hover",!1)},C.dispatch=A,C.options=t.utils.optionsFunc.bind(C),C._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},forceX:{get:function(){return y},set:function(t){y=t}},forceY:{get:function(){return x},set:function(t){x=t}},padData:{get:function(){return b},set:function(t){b=t}},clipEdge:{get:function(){return k},set:function(t){k=t}},id:{get:function(){return l},set:function(t){l=t}},interactive:{get:function(){return M},set:function(t){M=t}},x:{get:function(){return f},set:function(t){f=t}},y:{get:function(){return p},set:function(t){p=t}},open:{get:function(){return h()},set:function(t){h=t}},close:{get:function(){return g()},set:function(t){g=t}},high:{get:function(){return v},set:function(t){v=t}},low:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!=t.top?t.top:o.top,o.right=void 0!=t.right?t.right:o.right,o.bottom=void 0!=t.bottom?t.bottom:o.bottom,o.left=void 0!=t.left?t.left:o.left}},color:{get:function(){return w},set:function(e){w=t.utils.getColor(e)}}}),t.utils.initOptions(C),C},t.models.parallelCoordinates=function(){"use strict";var e,n,r,i={top:30,right:0,bottom:10,left:0},o=null,a=null,s=null,l=null,u=d3.scale.ordinal(),c={},d="undefined values",f=[],p=[],h=[],g=!0,v=t.utils.defaultColor(),m=[],y=[],x=[],b=[],k=1,w=d3.svg.line(),M=d3.svg.axis(),A=d3.dispatch("brushstart","brush","brushEnd","dimensionsOrder","stateChange","elementClick","elementMouseover","elementMouseout","elementMousemove","renderEnd","activeChanged"),C=t.utils.renderWatch(A);function S(W){return C.reset(),W.each(function(C){var S=d3.select(this);if(s=t.utils.availableWidth(o,S,i),l=t.utils.availableHeight(a,S,i),t.utils.initSVG(S),void 0===C[0].values){var W=[];C.forEach(function(t){var e={};Object.keys(t).forEach(function(n){"name"!==n&&(e[n]=t[n])}),W.push({key:t.name,values:e})}),C=W}var E=C.map(function(t){return t.values});0===y.length&&(y=C),h=f.sort(function(t,e){return t.currentPosition-e.currentPosition}).map(function(t){return t.key}),p=f.filter(function(t){return!t.disabled}),u.rangePoints([0,s],1).domain(p.map(function(t){return t.key}));var F={},N=!1,D=[];h.forEach(function(t){var e=d3.extent(E,function(e){return+e[t]}),n=e[0],r=e[1],i=!1;(isNaN(n)||isNaN(r))&&(i=!0,n=0,r=0),n===r&&(n-=1,r+=1);var o=m.filter(function(e){return e.dimension==t});0!==o.length&&(i?(n=c[t].domain()[0],r=c[t].domain()[1]):!o[0].hasOnlyNaN&&g?(n=n>o[0].extent[0]?o[0].extent[0]:n,r=r0||N?(B.style("display","inline"),P.style("display","inline")):(B.style("display","none"),P.style("display","none"))),[u(e.key),c[e.key](t.values[e.key])]}))}function j(t){m.forEach(function(e){var n=c[e.dimension].brush.y().domain();e.hasOnlyNaN&&(e.extent[1]=(c[e.dimension].domain()[1]-n[0])*(e.extent[1]-e.extent[0])/(F[e.dimension]-e.extent[0])+n[0]),e.hasNaN&&(e.extent[0]=n[0]),t&&c[e.dimension].brush.extent(e.extent)}),r.select(".nv-brushBackground").each(function(t){d3.select(this).call(c[t.key].brush)}).selectAll("rect").attr("x",-8).attr("width",16),K()}function R(){!1===g&&(g=!0,j(!0))}function Z(){H=h.filter(function(t){return!c[t].brush.empty()}),Y=H.map(function(t){return c[t].brush.extent()}),m=[],H.forEach(function(t,e){m[e]={dimension:t,extent:Y[e],hasNaN:!1,hasOnlyNaN:!1}}),y=[],e.style("display",function(t){var e=H.every(function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||Y[n][0]!=c[e].brush.y().domain()[0])||Y[n][0]<=t.values[e]&&t.values[e]<=Y[n][1]&&!isNaN(parseFloat(t.values[e]))});return e&&y.push(t),e?null:"none"}),K(),A.brush({filters:m,active:y})}function q(){var t=H.length>0;m.forEach(function(t){t.extent[0]===c[t.dimension].brush.y().domain()[0]&&b.indexOf(t.dimension)>=0&&(t.hasNaN=!0),t.extent[1]c[t.key].domain()[0]&&(D[t.key]=[n[0].extent[1]]),n[0].extent[0]>=c[t.key].domain()[0]&&D[t.key].push(n[0].extent[0])),d3.select(this).call(M.scale(c[t.key]).tickFormat(t.format).tickValues(D[t.key]))})}function U(t){var e=x[t];return null==e?u(t):e}y=[],e.style("display",function(t){var e=H.every(function(e,n){return!(!isNaN(t.values[e])&&!isNaN(parseFloat(t.values[e]))||Y[n][0]!=c[e].brush.y().domain()[0])||Y[n][0]<=t.values[e]&&t.values[e]<=Y[n][1]&&!isNaN(parseFloat(t.values[e]))});return e&&y.push(t),e?null:"none"}),(m.length>0||!t.utils.arrayEquals(y,G))&&A.activeChanged(y)}),S}return S.dispatch=A,S.options=t.utils.optionsFunc.bind(S),S._options=Object.create({},{width:{get:function(){return o},set:function(t){o=t}},height:{get:function(){return a},set:function(t){a=t}},dimensionData:{get:function(){return f},set:function(t){f=t}},displayBrush:{get:function(){return g},set:function(t){g=t}},filters:{get:function(){return m},set:function(t){m=t}},active:{get:function(){return y},set:function(t){y=t}},lineTension:{get:function(){return k},set:function(t){k=t}},undefinedValuesLabel:{get:function(){return d},set:function(t){d=t}},dimensions:{get:function(){return f.map(function(t){return t.key})},set:function(e){t.deprecated("dimensions","use dimensionData instead"),0===f.length?e.forEach(function(t){f.push({key:t})}):e.forEach(function(t,e){f[e].key=t})}},dimensionNames:{get:function(){return f.map(function(t){return t.key})},set:function(e){t.deprecated("dimensionNames","use dimensionData instead"),h=[],0===f.length?e.forEach(function(t){f.push({key:t})}):e.forEach(function(t,e){f[e].key=t})}},dimensionFormats:{get:function(){return f.map(function(t){return t.format})},set:function(e){t.deprecated("dimensionFormats","use dimensionData instead"),0===f.length?e.forEach(function(t){f.push({format:t})}):e.forEach(function(t,e){f[e].format=t})}},margin:{get:function(){return i},set:function(t){i.top=void 0!==t.top?t.top:i.top,i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return v},set:function(e){v=t.utils.getColor(e)}}}),t.utils.initOptions(S),S},t.models.parallelCoordinatesChart=function(){"use strict";var e=t.models.parallelCoordinates(),n=t.models.legend(),r=t.models.tooltip(),i=(t.models.tooltip(),{top:0,right:0,bottom:0,left:0}),o=null,a=null,s=null,l=!0,u=t.utils.defaultColor(),c=t.utils.state(),d=[],f=!0,p=null,h=null,g="undefined",v=d3.dispatch("dimensionsOrder","brushEnd","stateChange","changeState","renderEnd"),m=t.utils.renderWatch(v),y=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},x=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};function b(r){return m.reset(),m.models(e),r.each(function(r){var u=d3.select(this);t.utils.initSVG(u);var h=t.utils.availableWidth(a,u,i),g=t.utils.availableHeight(s,u,i);if(b.update=function(){u.call(b)},b.container=this,c.setter(x(d),b.update).getter(y(d)).update(),c.disabled=d.map(function(t){return!!t.disabled}),(d=d.map(function(t){return t.disabled=!!t.disabled,t})).forEach(function(t,e){t.originalPosition=isNaN(t.originalPosition)?e:t.originalPosition,t.currentPosition=isNaN(t.currentPosition)?e:t.currentPosition}),!p){var m;p={};for(m in c)c[m]instanceof Array?p[m]=c[m].slice(0):p[m]=c[m]}if(!r||!r.length)return t.utils.noData(b,u),b;u.selectAll(".nv-noData").remove();var k=u.selectAll("g.nv-wrap.nv-parallelCoordinatesChart").data([r]),w=k.enter().append("g").attr("class","nvd3 nv-wrap nv-parallelCoordinatesChart").append("g"),M=k.select("g");w.append("g").attr("class","nv-parallelCoordinatesWrap"),w.append("g").attr("class","nv-legendWrap"),M.select("rect").attr("width",h).attr("height",g>0?g:0),l?(n.width(h).color(function(t){return"rgb(188,190,192)"}),M.select(".nv-legendWrap").datum(d.sort(function(t,e){return t.originalPosition-e.originalPosition})).call(n),o||n.height()===i.top||(i.top=n.height(),g=t.utils.availableHeight(s,u,i)),k.select(".nv-legendWrap").attr("transform","translate( 0 ,"+-i.top+")")):M.select(".nv-legendWrap").selectAll("*").remove(),k.attr("transform","translate("+i.left+","+i.top+")"),e.width(h).height(g).dimensionData(d).displayBrush(f),M.select(".nv-parallelCoordinatesWrap ").datum(r).transition().call(e),e.dispatch.on("brushEnd",function(t,e){e?(f=!0,v.brushEnd(t)):f=!1}),n.dispatch.on("stateChange",function(t){for(var e in t)c[e]=t[e];v.stateChange(c),b.update()}),e.dispatch.on("dimensionsOrder",function(t){d.sort(function(t,e){return t.currentPosition-e.currentPosition});var e=!1;d.forEach(function(t,n){t.currentPosition=n,t.currentPosition!==t.originalPosition&&(e=!0)}),v.dimensionsOrder(d,e)}),v.on("changeState",function(t){void 0!==t.disabled&&(d.forEach(function(e,n){e.disabled=t.disabled[n]}),c.disabled=t.disabled),b.update()})}),m.renderEnd("parraleleCoordinateChart immediate"),b}return r.contentGenerator(function(t){var e='";return 0!==t.series.length&&(e+='',t.series.forEach(function(t){e=e+'"}),e+=""),e+="
'+t.key+"
'+t.key+''+t.value+"
"}),e.dispatch.on("elementMouseover.tooltip",function(t){var e={key:t.label,color:t.color,series:[]};t.values&&(Object.keys(t.values).forEach(function(n){var r,i=t.dimensions.filter(function(t){return t.key===n})[0];i&&(r=isNaN(t.values[n])||isNaN(parseFloat(t.values[n]))?g:i.format(t.values[n]),e.series.push({idx:i.currentPosition,key:n,value:r,color:i.color}))}),e.series.sort(function(t,e){return t.idx-e.idx})),r.data(e).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){r.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(){r()}),b.dispatch=v,b.parallelCoordinates=e,b.legend=n,b.tooltip=r,b.options=t.utils.optionsFunc.bind(b),b._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},showLegend:{get:function(){return l},set:function(t){l=t}},defaultState:{get:function(){return p},set:function(t){p=t}},dimensionData:{get:function(){return d},set:function(t){d=t}},displayBrush:{get:function(){return f},set:function(t){f=t}},noData:{get:function(){return h},set:function(t){h=t}},nanValue:{get:function(){return g},set:function(t){g=t}},margin:{get:function(){return i},set:function(t){void 0!==t.top&&(i.top=t.top,o=t.top),i.right=void 0!==t.right?t.right:i.right,i.bottom=void 0!==t.bottom?t.bottom:i.bottom,i.left=void 0!==t.left?t.left:i.left}},color:{get:function(){return u},set:function(r){u=t.utils.getColor(r),n.color(u),e.color(u)}}}),t.utils.inheritOptions(b,e),t.utils.initOptions(b),b},t.models.pie=function(){"use strict";var e={top:0,right:0,bottom:0,left:0},n=500,r=500,i=function(t){return t.x},o=function(t){return t.y},a=Math.floor(1e4*Math.random()),s=null,l=t.utils.defaultColor(),u=d3.format(",.2f"),c=!0,d=!1,f="key",p=.02,h=!1,g=!1,v=!1,m=!0,y=0,x=!1,b=!1,k=!1,w=!1,M=0,A=.5,C=250,S=[],W=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout","elementMousemove","renderEnd"),E=[],F=[],N=t.utils.renderWatch(W);function D(O){return N.reset(),O.each(function(D){var O=n-e.left-e.right,_=r-e.top-e.bottom,L=Math.min(O,_)/2,B=[],P=[];if(s=d3.select(this),0===S.length)for(var T=L-L/10,I=A*L,z=0;z=p){var o=J(r);Q[o]&&(r[1]-=14),Q[J(r)]=!0}return"translate("+r+")"}),q.select(".nv-label text").style("text-anchor",function(t,e){return x?(t.startAngle+t.endAngle)/20;--t)u(s*=.99),p(),d(),l(s),p(),d();function l(t){function n(t){return(t.source.y+t.sy+t.dy/2)*t.value}e.forEach(function(e,r){e.forEach(function(e){if(e.targetLinks.length){var r=d3.sum(e.targetLinks,n)/d3.sum(e.targetLinks,f);e.y+=(r-c(e))*t}})})}function u(t){function n(t){return(t.target.y+t.ty+t.dy/2)*t.value}e.slice().reverse().forEach(function(e){e.forEach(function(e){if(e.sourceLinks.length){var r=d3.sum(e.sourceLinks,n)/d3.sum(e.sourceLinks,f);e.y+=(r-c(e))*t}})})}function p(){e.forEach(function(t){var e,n,o,a=0,s=t.length;for(t.sort(h),o=0;o0&&(e.y+=n),a=e.y+e.dy+r;if((n=a-r-i[1])>0)for(a=e.y-=n,o=s-2;o>=0;--o)e=t[o],(n=e.y+e.dy+r-a)>0&&(e.y-=n),a=e.y})}function h(t,e){return t.y-e.y}}(t)},u=function(){var t=.5;function e(e){var n=e.source.x+e.source.dx,r=e.target.x,i=d3.interpolateNumber(n,r),o=i(t),a=i(1-t),s=e.source.y+e.sy+e.dy/2,l=e.target.y+e.ty+e.dy/2;return"M"+n+","+s+"C"+o+","+s+" "+a+","+l+" "+r+","+l}return e.curvature=function(n){return arguments.length?(t=+n,e):t},e},c=function(t){return t.y+t.dy/2};function d(){function t(t,e){return t.source.y-e.source.y}function e(t,e){return t.target.y-e.target.y}o.forEach(function(n){n.sourceLinks.sort(e),n.targetLinks.sort(t)}),o.forEach(function(t){var e=0,n=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=n,n+=t.dy})})}function f(t){return t.value}return e.options=t.utils.optionsFunc.bind(e),e._options=Object.create({},{nodeWidth:{get:function(){return n},set:function(t){n=+t}},nodePadding:{get:function(){return r},set:function(t){r=t}},nodes:{get:function(){return o},set:function(t){o=t}},links:{get:function(){return a},set:function(t){a=t}},size:{get:function(){return i},set:function(t){i=t}},sinksRight:{get:function(){return s},set:function(t){s=t}},layout:{get:function(){l(32)},set:function(t){l(t)}},relayout:{get:function(){d()},set:function(t){}},center:{get:function(){return c()},set:function(t){"function"==typeof t&&(c=t)}},link:{get:function(){return u()},set:function(t){return"function"==typeof t&&(u=t),u()}}}),t.utils.initOptions(e),e},t.models.sankeyChart=function(){"use strict";var e={top:5,right:0,bottom:5,left:0},n=t.models.sankey(),r=600,i=400,o=36,a=40,s="units",l=void 0,u=d3.format(",.0f"),c=function(t){return u(t)+" "+s},d=d3.scale.category20(),f=function(t){return t.source.name+" → "+t.target.name+"\n"+c(t.value)},p=function(t){return t.color=d(t.name.replace(/ .*/,""))},h=function(t){return d3.rgb(t.color).darker(2)},g=function(t){return t.name+"\n"+c(t.value)},v=function(t,e){t.append("text").attr("x",0).attr("y",0).attr("class","nvd3-sankey-chart-error").attr("text-anchor","middle").text(e)};function m(t){return t.each(function(e){var s=!1,u=!1;if(("object"==typeof e.nodes&&e.nodes.length)>=0&&("object"==typeof e.links&&e.links.length)>=0&&(s=!0),e.nodes&&e.nodes.length>0&&e.links&&e.links.length>0&&(u=!0),!s)return v(t,"Error loading chart, data is invalid"),!1;if(!u)return v(t,"No data available"),!1;var c=t.append("svg").attr("width",r).attr("height",i).append("g").attr("class","nvd3 nv-wrap nv-sankeyChart");n.nodeWidth(o).nodePadding(a).size([r,i]);var d=n.link();n.nodes(e.nodes).links(e.links).layout(32).center(l);var m=c.append("g").selectAll(".link").data(e.links).enter().append("path").attr("class","link").attr("d",d).style("stroke-width",function(t){return Math.max(1,t.dy)}).sort(function(t,e){return e.dy-t.dy});m.append("title").text(f);var y=c.append("g").selectAll(".node").data(e.nodes).enter().append("g").attr("class","node").attr("transform",function(t){return"translate("+t.x+","+t.y+")"}).call(d3.behavior.drag().origin(function(t){return t}).on("dragstart",function(){this.parentNode.appendChild(this)}).on("drag",function(t){d3.select(this).attr("transform","translate("+t.x+","+(t.y=Math.max(0,Math.min(i-t.dy,d3.event.y)))+")"),n.relayout(),m.attr("d",d)}));y.append("rect").attr("height",function(t){return t.dy}).attr("width",n.nodeWidth()).style("fill",p).style("stroke",h).append("title").text(g),y.append("text").attr("x",-6).attr("y",function(t){return t.dy/2}).attr("dy",".35em").attr("text-anchor","end").attr("transform",null).text(function(t){return t.name}).filter(function(t){return t.x0?$+20:0),ct.attr("clip-path",N?"url(#nv-edge-clip-"+h+")":""),R=!0;var ft=at.select(".nv-groups").selectAll(".nv-group").data(function(t){return t},function(t){return t.key});ft.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),ft.exit().remove(),ft.attr("class",function(t,e){return(t.classed||"")+" nv-group nv-series-"+e}).classed("nv-noninteractive",!S).classed("hover",function(t){return t.hover}),ft.watchTransition(Z,"scatter: groups").style("fill",function(t,e){return f(t,e)}).style("stroke",function(t,e){return t.pointBorderColor||p||f(t,e)}).style("stroke-opacity",1).style("fill-opacity",.5);var pt=ft.selectAll("path.nv-point").data(function(t){return t.values.map(function(t,e){return[t,e]}).filter(function(t,e){return W(t[0],e)})});if(pt.enter().append("path").attr("class",function(t){return"nv-point nv-point-"+t[1]}).style("fill",function(t){return t.color}).style("stroke",function(t){return t.color}).attr("transform",function(r){return"translate("+t.utils.NaNtoZero(e(x(r[0],r[1])))+","+t.utils.NaNtoZero(n(b(r[0],r[1])))+")"}).attr("d",t.utils.symbol().type(function(t){return w(t[0])}).size(function(t){return y(k(t[0],t[1]))})),pt.exit().each(U).remove(),ft.exit().selectAll("path.nv-point").watchTransition(Z,"scatter exit").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(v(x(e[0],e[1])))+","+t.utils.NaNtoZero(m(b(e[0],e[1])))+")"}).remove(),pt.filter(function(t){return Q(t,"x",x,"y",b)||rt||it||ot}).watchTransition(Z,"scatter points").attr("transform",function(e){return"translate("+t.utils.NaNtoZero(v(x(e[0],e[1])))+","+t.utils.NaNtoZero(m(b(e[0],e[1])))+")"}),pt.filter(function(t){return Q(t,"shape",w,"size",k)||rt||it||ot}).watchTransition(Z,"scatter points").attr("d",t.utils.symbol().type(function(t){return w(t[0])}).size(function(t){return y(k(t[0],t[1]))})),j){var ht=ft.selectAll(".nv-label").data(function(t){return t.values.map(function(t,e){return[t,e]}).filter(function(t,e){return W(t[0],e)})});ht.enter().append("text").style("fill",function(t,e){return t.color}).style("stroke-opacity",0).style("fill-opacity",1).attr("transform",function(r){return"translate("+(t.utils.NaNtoZero(e(x(r[0],r[1])))+Math.sqrt(y(k(r[0],r[1]))/Math.PI)+2)+","+t.utils.NaNtoZero(n(b(r[0],r[1])))+")"}).text(function(t,e){return t[0].label}),ht.exit().remove(),ft.exit().selectAll("path.nv-label").watchTransition(Z,"scatter exit").attr("transform",function(e){return"translate("+(t.utils.NaNtoZero(v(x(e[0],e[1])))+Math.sqrt(y(k(e[0],e[1]))/Math.PI)+2)+","+t.utils.NaNtoZero(m(b(e[0],e[1])))+")"}).remove(),ht.each(function(t){d3.select(this).classed("nv-label",!0).classed("nv-label-"+t[1],!1).classed("hover",!1)}),ht.watchTransition(Z,"scatter labels").attr("transform",function(e){return"translate("+(t.utils.NaNtoZero(v(x(e[0],e[1])))+Math.sqrt(y(k(e[0],e[1]))/Math.PI)+2)+","+t.utils.NaNtoZero(m(b(e[0],e[1])))+")"})}X?(clearTimeout(l),l=setTimeout(dt,X)):dt(),e=v.copy(),n=m.copy(),r=y.copy(),a=c,s=d}),Z.renderEnd("scatter immediate"),J}return J.dispatch=H,J.options=t.utils.optionsFunc.bind(J),J._calls=new function(){this.clearHighlights=function(){return t.dom.write(function(){g.selectAll(".nv-point.hover").classed("hover",!1)}),null},this.highlightPoint=function(e,n,r){t.dom.write(function(){g.select(".nv-groups").selectAll(".nv-series-"+e).selectAll(".nv-point-"+n).classed("hover",r)})}},H.on("elementMouseover.point",function(t){S&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!0)}),H.on("elementMouseout.point",function(t){S&&J._calls.highlightPoint(t.seriesIndex,t.pointIndex,!1)}),J._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},xScale:{get:function(){return v},set:function(t){v=t}},yScale:{get:function(){return m},set:function(t){m=t}},pointScale:{get:function(){return y},set:function(t){y=t}},xDomain:{get:function(){return L},set:function(t){L=t}},yDomain:{get:function(){return B},set:function(t){B=t}},pointDomain:{get:function(){return I},set:function(t){I=t}},xRange:{get:function(){return P},set:function(t){P=t}},yRange:{get:function(){return T},set:function(t){T=t}},pointRange:{get:function(){return z},set:function(t){z=t}},forceX:{get:function(){return M},set:function(t){M=t}},forceY:{get:function(){return A},set:function(t){A=t}},forcePoint:{get:function(){return C},set:function(t){C=t}},interactive:{get:function(){return S},set:function(t){S=t}},pointActive:{get:function(){return W},set:function(t){W=t}},padDataOuter:{get:function(){return F},set:function(t){F=t}},padData:{get:function(){return E},set:function(t){E=t}},clipEdge:{get:function(){return N},set:function(t){N=t}},clipVoronoi:{get:function(){return D},set:function(t){D=t}},clipRadius:{get:function(){return _},set:function(t){_=t}},showVoronoi:{get:function(){return O},set:function(t){O=t}},id:{get:function(){return h},set:function(t){h=t}},interactiveUpdateDelay:{get:function(){return X},set:function(t){X=t}},showLabels:{get:function(){return j},set:function(t){j=t}},pointBorderColor:{get:function(){return p},set:function(t){p=t}},x:{get:function(){return x},set:function(t){x=d3.functor(t)}},y:{get:function(){return b},set:function(t){b=d3.functor(t)}},pointSize:{get:function(){return k},set:function(t){k=d3.functor(t)}},pointShape:{get:function(){return w},set:function(t){w=d3.functor(t)}},margin:{get:function(){return u},set:function(t){u.top=void 0!==t.top?t.top:u.top,u.right=void 0!==t.right?t.right:u.right,u.bottom=void 0!==t.bottom?t.bottom:u.bottom,u.left=void 0!==t.left?t.left:u.left}},duration:{get:function(){return G},set:function(t){G=t,Z.reset(G)}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e)}},useVoronoi:{get:function(){return Y},set:function(t){!1===(Y=t)&&(D=!1)}}}),t.utils.initOptions(J),J},t.models.scatterChart=function(){"use strict";var e=t.models.scatter(),n=t.models.axis(),r=t.models.axis(),i=t.models.legend(),o=t.models.distribution(),a=t.models.distribution(),s=t.models.tooltip(),l={top:30,right:20,bottom:50,left:75},u=null,c=null,d=null,f=null,p=t.utils.defaultColor(),h=e.xScale(),g=e.yScale(),v=!1,m=!1,y=!0,x=!0,b=!0,k=!1,w=t.utils.state(),M=null,A=d3.dispatch("stateChange","changeState","renderEnd"),C=null,S=250,W=!1;e.xScale(h).yScale(g),n.orient("bottom").tickPadding(10),r.orient(k?"right":"left").tickPadding(10),o.axis("x"),a.axis("y"),s.headerFormatter(function(t,e){return n.tickFormat()(t,e)}).valueFormatter(function(t,e){return r.tickFormat()(t,e)});var E=t.utils.renderWatch(A,S),F=function(t){return function(){return{active:t.map(function(t){return!t.disabled})}}},N=function(t){return function(e){void 0!==e.active&&t.forEach(function(t,n){t.disabled=!e.active[n]})}};function D(C){return E.reset(),E.models(e),x&&E.models(n),b&&E.models(r),v&&E.models(o),m&&E.models(a),C.each(function(C){f=d3.select(this),t.utils.initSVG(f);var O=t.utils.availableWidth(c,f,l),_=t.utils.availableHeight(d,f,l);if(D.update=function(){0===S?f.call(D):f.transition().duration(S).call(D)},D.container=this,w.setter(N(C),D.update).getter(F(C)).update(),w.disabled=C.map(function(t){return!!t.disabled}),!M){var L;M={};for(L in w)w[L]instanceof Array?M[L]=w[L].slice(0):M[L]=w[L]}if(!(C&&C.length&&C.filter(function(t){return t.values.length}).length))return t.utils.noData(D,f),E.renderEnd("scatter immediate"),D;f.selectAll(".nv-noData").remove(),h=e.xScale(),g=e.yScale();var B=f.selectAll("g.nv-wrap.nv-scatterChart").data([C]),P=B.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+e.id()).append("g"),T=B.select("g");if(P.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none"),P.append("g").attr("class","nv-x nv-axis"),P.append("g").attr("class","nv-y nv-axis"),P.append("g").attr("class","nv-scatterWrap"),P.append("g").attr("class","nv-regressionLinesWrap"),P.append("g").attr("class","nv-distWrap"),P.append("g").attr("class","nv-legendWrap"),k&&T.select(".nv-y.nv-axis").attr("transform","translate("+O+",0)"),y){var I=O;i.width(I),B.select(".nv-legendWrap").datum(C).call(i),u||i.height()===l.top||(l.top=i.height(),_=t.utils.availableHeight(d,f,l)),B.select(".nv-legendWrap").attr("transform","translate(0,"+-l.top+")")}else T.select(".nv-legendWrap").selectAll("*").remove();B.attr("transform","translate("+l.left+","+l.top+")"),e.width(O).height(_).color(C.map(function(t,e){return t.color=t.color||p(t,e),t.color}).filter(function(t,e){return!C[e].disabled})).showLabels(W),B.select(".nv-scatterWrap").datum(C.filter(function(t){return!t.disabled})).call(e),B.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+e.id()+")");var z=B.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(t){return t});z.enter().append("g").attr("class","nv-regLines");var V=z.selectAll(".nv-regLine").data(function(t){return[t]});V.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0),V.filter(function(t){return t.intercept&&t.slope}).watchTransition(E,"scatterPlusLineChart: regline").attr("x1",h.range()[0]).attr("x2",h.range()[1]).attr("y1",function(t,e){return g(h.domain()[0]*t.slope+t.intercept)}).attr("y2",function(t,e){return g(h.domain()[1]*t.slope+t.intercept)}).style("stroke",function(t,e,n){return p(t,n)}).style("stroke-opacity",function(t,e){return t.disabled||void 0===t.slope||void 0===t.intercept?0:1}),x&&(n.scale(h)._ticks(t.utils.calcTicksX(O/100,C)).tickSize(-_,0),T.select(".nv-x.nv-axis").attr("transform","translate(0,"+g.range()[0]+")").call(n)),b&&(r.scale(g)._ticks(t.utils.calcTicksY(_/36,C)).tickSize(-O,0),T.select(".nv-y.nv-axis").call(r)),v&&(o.getData(e.x()).scale(h).width(O).color(C.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!C[e].disabled})),P.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),T.select(".nv-distributionX").attr("transform","translate(0,"+g.range()[0]+")").datum(C.filter(function(t){return!t.disabled})).call(o)),m&&(a.getData(e.y()).scale(g).width(_).color(C.map(function(t,e){return t.color||p(t,e)}).filter(function(t,e){return!C[e].disabled})),P.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),T.select(".nv-distributionY").attr("transform","translate("+(k?O:-a.size())+",0)").datum(C.filter(function(t){return!t.disabled})).call(a)),i.dispatch.on("stateChange",function(t){for(var e in t)w[e]=t[e];A.stateChange(w),D.update()}),A.on("changeState",function(t){void 0!==t.disabled&&(C.forEach(function(e,n){e.disabled=t.disabled[n]}),w.disabled=t.disabled),D.update()}),e.dispatch.on("elementMouseout.tooltip",function(t){s.hidden(!0),f.select(".nv-chart-"+e.id()+" .nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",0),f.select(".nv-chart-"+e.id()+" .nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",a.size())}),e.dispatch.on("elementMouseover.tooltip",function(t){f.select(".nv-series-"+t.seriesIndex+" .nv-distx-"+t.pointIndex).attr("y1",t.relativePos[1]-_),f.select(".nv-series-"+t.seriesIndex+" .nv-disty-"+t.pointIndex).attr("x2",t.relativePos[0]+o.size()),s.data(t).hidden(!1)}),h.copy(),g.copy()}),E.renderEnd("scatter with line immediate"),D}return D.dispatch=A,D.scatter=e,D.legend=i,D.xAxis=n,D.yAxis=r,D.distX=o,D.distY=a,D.tooltip=s,D.options=t.utils.optionsFunc.bind(D),D._options=Object.create({},{width:{get:function(){return c},set:function(t){c=t}},height:{get:function(){return d},set:function(t){d=t}},container:{get:function(){return f},set:function(t){f=t}},showDistX:{get:function(){return v},set:function(t){v=t}},showDistY:{get:function(){return m},set:function(t){m=t}},showLegend:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return M},set:function(t){M=t}},noData:{get:function(){return C},set:function(t){C=t}},duration:{get:function(){return S},set:function(t){S=t}},showLabels:{get:function(){return W},set:function(t){W=t}},margin:{get:function(){return l},set:function(t){void 0!==t.top&&(l.top=t.top,u=t.top),l.right=void 0!==t.right?t.right:l.right,l.bottom=void 0!==t.bottom?t.bottom:l.bottom,l.left=void 0!==t.left?t.left:l.left}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,r.orient(t?"right":"left")}},color:{get:function(){return p},set:function(e){p=t.utils.getColor(e),i.color(p),o.color(p),a.color(p)}}}),t.utils.inheritOptions(D,e),t.utils.initOptions(D),D},t.models.sparkline=function(){"use strict";var e,n,r,i,o={top:2,right:0,bottom:2,left:0},a=400,s=32,l=null,u=!0,c=d3.scale.linear(),d=d3.scale.linear(),f=function(t){return t.x},p=function(t){return t.y},h=t.utils.getColor(["#000"]),g=!0,v=!0,m=d3.dispatch("renderEnd"),y=t.utils.renderWatch(m);function x(u){return y.reset(),u.each(function(u){var m=a-o.left-o.right,y=s-o.top-o.bottom;l=d3.select(this),t.utils.initSVG(l),c.domain(e||d3.extent(u,f)).range(r||[0,m]),d.domain(n||d3.extent(u,p)).range(i||[y,0]);var x=l.selectAll("g.nv-wrap.nv-sparkline").data([u]);x.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline").append("g"),x.select("g");x.attr("transform","translate("+o.left+","+o.top+")");var b=x.selectAll("path").data(function(t){return[t]});b.enter().append("path"),b.exit().remove(),b.style("stroke",function(t,e){return t.color||h(t,e)}).attr("d",d3.svg.line().x(function(t,e){return c(f(t,e))}).y(function(t,e){return d(p(t,e))}));var k=x.selectAll("circle.nv-point").data(function(t){var e=t.map(function(t,e){return p(t,e)});function n(e){if(-1!=e){var n=t[e];return n.pointIndex=e,n}return null}var r=n(e.lastIndexOf(d.domain()[1])),i=n(e.indexOf(d.domain()[0])),o=n(e.length-1);return[g?i:null,g?r:null,v?o:null].filter(function(t){return null!=t})});k.enter().append("circle"),k.exit().remove(),k.attr("cx",function(t,e){return c(f(t,t.pointIndex))}).attr("cy",function(t,e){return d(p(t,t.pointIndex))}).attr("r",2).attr("class",function(t,e){return f(t,t.pointIndex)==c.domain()[1]?"nv-point nv-currentValue":p(t,t.pointIndex)==d.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),y.renderEnd("sparkline immediate"),x}return x.options=t.utils.optionsFunc.bind(x),x._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},xDomain:{get:function(){return e},set:function(t){e=t}},yDomain:{get:function(){return n},set:function(t){n=t}},xRange:{get:function(){return r},set:function(t){r=t}},yRange:{get:function(){return i},set:function(t){i=t}},xScale:{get:function(){return c},set:function(t){c=t}},yScale:{get:function(){return d},set:function(t){d=t}},animate:{get:function(){return u},set:function(t){u=t}},showMinMaxPoints:{get:function(){return g},set:function(t){g=t}},showCurrentPoint:{get:function(){return v},set:function(t){v=t}},x:{get:function(){return f},set:function(t){f=d3.functor(t)}},y:{get:function(){return p},set:function(t){p=d3.functor(t)}},margin:{get:function(){return o},set:function(t){o.top=void 0!==t.top?t.top:o.top,o.right=void 0!==t.right?t.right:o.right,o.bottom=void 0!==t.bottom?t.bottom:o.bottom,o.left=void 0!==t.left?t.left:o.left}},color:{get:function(){return h},set:function(e){h=t.utils.getColor(e)}}}),x.dispatch=m,t.utils.initOptions(x),x},t.models.sparklinePlus=function(){"use strict";var e,n,r=t.models.sparkline(),i={top:15,right:100,bottom:10,left:50},o=null,a=null,s=[],l=!1,u=d3.format(",r"),c=d3.format(",.2f"),d=!0,f=!0,p=!1,h=null,g=d3.dispatch("renderEnd"),v=t.utils.renderWatch(g);function m(h){return v.reset(),v.models(r),h.each(function(h){var g=d3.select(this);t.utils.initSVG(g);var v=t.utils.availableWidth(o,g,i),y=t.utils.availableHeight(a,g,i);if(m.update=function(){g.call(m)},m.container=this,!h||!h.length)return t.utils.noData(m,g),m;g.selectAll(".nv-noData").remove();var x=r.y()(h[h.length-1],h.length-1);e=r.xScale(),n=r.yScale();var b=g.selectAll("g.nv-wrap.nv-sparklineplus").data([h]),k=b.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus").append("g"),w=b.select("g");k.append("g").attr("class","nv-sparklineWrap"),k.append("g").attr("class","nv-valueWrap"),k.append("g").attr("class","nv-hoverArea"),b.attr("transform","translate("+i.left+","+i.top+")");var M=w.select(".nv-sparklineWrap");if(r.width(v).height(y),M.call(r),d){var A=w.select(".nv-valueWrap").selectAll(".nv-currentValue").data([x]);A.enter().append("text").attr("class","nv-currentValue").attr("dx",p?-8:8).attr("dy",".9em").style("text-anchor",p?"end":"start"),A.attr("x",v+(p?i.right:0)).attr("y",f?function(t){return n(t)}:0).style("fill",r.color()(h[h.length-1],h.length-1)).text(c(x))}function C(){if(!l){var t=w.selectAll(".nv-hoverValue").data(s),n=t.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);t.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),t.attr("transform",function(t){return"translate("+e(r.x()(h[t],t))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1),s.length&&(n.append("line").attr("x1",0).attr("y1",-i.top).attr("x2",0).attr("y2",y),n.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-i.top).attr("text-anchor","end").attr("dy",".9em"),w.select(".nv-hoverValue .nv-xValue").text(u(r.x()(h[s[0]],s[0]))),n.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-i.top).attr("text-anchor","start").attr("dy",".9em"),w.select(".nv-hoverValue .nv-yValue").text(c(r.y()(h[s[0]],s[0]))))}}k.select(".nv-hoverArea").append("rect").on("mousemove",function(){if(l)return;var t=d3.mouse(this)[0]-i.left;s=[function(t,e){for(var n=Math.abs(r.x()(t[0],0)-e),i=0,o=0;o=t[0]&&r.x()(e,n)<=t[1]}),disableTooltip:e.disableTooltip}})).transition().duration(_).call(r),tt(),et()}r.dispatch.on("areaClick.toggle",function(t){1===u.filter(function(t){return!t.disabled}).length?u.forEach(function(t){t.disabled=!1}):u.forEach(function(e,n){e.disabled=n!=t.seriesIndex}),S.disabled=u.map(function(t){return!!t.disabled}),F.stateChange(S),V.update()}),a.dispatch.on("stateChange",function(t){for(var e in t)S[e]=t[e];F.stateChange(S),V.update()}),s.dispatch.on("legendClick",function(t,e){t.disabled&&(U=U.map(function(t){return t.disabled=!0,t}),t.disabled=!1,r.style(t.style),S.style=r.style(),F.stateChange(S),V.update())}),l.dispatch.on("elementMousemove",function(e){r.clearHighlights();var n,i,o,a=[],s=0,c=!0,d=!1;if(u.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(l,f){i=t.interactiveBisect(l.values,e.pointXValue,V.x());var p=l.values[i],h=V.y()(p,i);if(null!=h&&h>0&&(r.highlightPoint(f,i,!0),d=!0),f!==u.length-1||d||r.highlightPoint(f,i,!0),void 0!==p){void 0===n&&(n=p),void 0===o&&(o=V.xScale()(V.x()(p,i)));var v="expand"==r.style()?p.display.y:V.y()(p,i);a.push({key:l.key,value:v,color:g(l,l.seriesIndex),point:p}),A&&"expand"!=r.style()&&null!=v&&(s+=v,c=!1)}}),a.reverse(),a.length>2){var f=V.yScale().invert(e.mouseY),p=null;a.forEach(function(t,e){f=Math.abs(f);var n=Math.abs(t.point.display.y0),r=Math.abs(t.point.display.y);f>=n&&f<=r+n&&(p=e)}),null!=p&&(a[p].highlight=!0)}A&&"expand"!=r.style()&&a.length>=2&&!c&&a.push({key:C,value:s,total:!0});var h=V.x()(n,i),v=l.tooltip.valueFormatter();"expand"===r.style()||"stack_percent"===r.style()?(B||(B=v),v=d3.format(".1%")):B&&(v=B,B=null),l.tooltip.valueFormatter(v).data({value:h,series:a})(),l.renderGuideLine(o)}),l.dispatch.on("elementMouseout",function(t){r.clearHighlights()}),c.dispatch.on("onBrush",function(t){rt(t)}),F.on("changeState",function(t){void 0!==t.disabled&&u.length===t.disabled.length&&(u.forEach(function(e,n){e.disabled=t.disabled[n]}),S.disabled=t.disabled),void 0!==t.style&&(r.style(t.style),t.style),V.update()})}),P.renderEnd("stacked Area chart immediate"),V}return r.dispatch.on("elementMouseover.tooltip",function(t){t.point.x=r.x()(t.point),t.point.y=r.y()(t.point),u.data(t).hidden(!1)}),r.dispatch.on("elementMouseout.tooltip",function(t){u.hidden(!0)}),V.dispatch=F,V.stacked=r,V.legend=a,V.controls=s,V.xAxis=i,V.x2Axis=c.xAxis,V.yAxis=o,V.y2Axis=c.yAxis,V.interactiveLayer=l,V.tooltip=u,V.focus=c,V.dispatch=F,V.options=t.utils.optionsFunc.bind(V),V._options=Object.create({},{width:{get:function(){return p},set:function(t){p=t}},height:{get:function(){return h},set:function(t){h=t}},showLegend:{get:function(){return m},set:function(t){m=t}},legendPosition:{get:function(){return y},set:function(t){y=t}},showXAxis:{get:function(){return x},set:function(t){x=t}},showYAxis:{get:function(){return b},set:function(t){b=t}},defaultState:{get:function(){return W},set:function(t){W=t}},noData:{get:function(){return E},set:function(t){E=t}},showControls:{get:function(){return v},set:function(t){v=t}},controlLabels:{get:function(){return O},set:function(t){O=t}},controlOptions:{get:function(){return D},set:function(t){D=t}},showTotalInTooltip:{get:function(){return A},set:function(t){A=t}},totalLabel:{get:function(){return C},set:function(t){C=t}},focusEnable:{get:function(){return w},set:function(t){w=t}},focusHeight:{get:function(){return c.height()},set:function(t){c.height(t)}},brushExtent:{get:function(){return c.brushExtent()},set:function(t){c.brushExtent(t)}},margin:{get:function(){return d},set:function(t){void 0!==t.top&&(d.top=t.top,f=t.top),d.right=void 0!==t.right?t.right:d.right,d.bottom=void 0!==t.bottom?t.bottom:d.bottom,d.left=void 0!==t.left?t.left:d.left}},focusMargin:{get:function(){return c.margin},set:function(t){c.margin.top=void 0!==t.top?t.top:c.margin.top,c.margin.right=void 0!==t.right?t.right:c.margin.right,c.margin.bottom=void 0!==t.bottom?t.bottom:c.margin.bottom,c.margin.left=void 0!==t.left?t.left:c.margin.left}},duration:{get:function(){return _},set:function(t){_=t,P.reset(_),r.duration(_),i.duration(_),o.duration(_)}},color:{get:function(){return g},set:function(e){g=t.utils.getColor(e),a.color(g),r.color(g),c.color(g)}},x:{get:function(){return r.x()},set:function(t){r.x(t),c.x(t)}},y:{get:function(){return r.y()},set:function(t){r.y(t),c.y(t)}},rightAlignYAxis:{get:function(){return k},set:function(t){k=t,o.orient(k?"right":"left")}},useInteractiveGuideline:{get:function(){return M},set:function(t){M=!!t,V.interactive(!t),V.useVoronoi(!t),r.scatter.interactive(!t)}}}),t.utils.inheritOptions(V,r),t.utils.initOptions(V),V},t.models.stackedAreaWithFocusChart=function(){return t.models.stackedAreaChart().margin({bottom:30}).focusEnable(!0)},t.models.sunburst=function(){"use strict";var e,n,r,i,o={top:0,right:0,bottom:0,left:0},a=600,s=600,l="count",u={count:function(t){return 1},value:function(t){return t.value||t.size},size:function(t){return t.value||t.size}},c=Math.floor(1e4*Math.random()),d=null,f=t.utils.defaultColor(),p=!1,h=function(t){return"count"===l?t.name+" #"+t.value:t.name+" "+(t.value||t.size)},g=.02,v=function(t,e){return t.name>e.name},m=function(t,e){return void 0!==t.parent?t.name+"-"+t.parent.name+"-"+e:t.name},y=!0,x=500,b=d3.dispatch("chartClick","elementClick","elementDblClick","elementMousemove","elementMouseover","elementMouseout","renderEnd"),k=d3.scale.linear().range([0,2*Math.PI]),w=d3.scale.sqrt(),M=d3.layout.partition().sort(v),A={},C=d3.svg.arc().startAngle(function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x)))}).endAngle(function(t){return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))}).innerRadius(function(t){return Math.max(0,w(t.y))}).outerRadius(function(t){return Math.max(0,w(t.y+t.dy))});function S(t){return W(t)>90?180:0}function W(t){return(Math.max(0,Math.min(2*Math.PI,k(t.x)))+Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx))))/2*(180/Math.PI)-90}function E(t){var e=Math.max(0,Math.min(2*Math.PI,k(t.x)));return Math.max(0,Math.min(2*Math.PI,k(t.x+t.dx)))-e>g}function F(t,n){var r=d3.interpolate(k.domain(),[e.x,e.x+e.dx]),o=d3.interpolate(w.domain(),[e.y,1]),a=d3.interpolate(w.range(),[e.y?20:0,i]);return 0===n?function(){return C(t)}:function(e){return k.domain(r(e)),w.domain(o(e)).range(a(e)),C(t)}}function N(t){var e=d3.interpolate({x:t.x0,dx:t.dx0,y:t.y0,dy:t.dy0},t);return function(n){var r=e(n);return t.x0=r.x,t.dx0=r.dx,t.y0=r.y,t.dy0=r.dy,C(r)}}function D(t){t.forEach(function(t){var e=m(t),n=A[e];n?(t.dx0=n.dx,t.x0=n.x,t.dy0=n.dy,t.y0=n.y):(t.dx0=t.dx,t.x0=t.x,t.dy0=t.dy,t.y0=t.y),function(t){var e=m(t);A[e]||(A[e]={});var n=A[e];n.dx=t.dx,n.x=t.x,n.dy=t.dy,n.y=t.y}(t)})}function O(t){var n=d.selectAll("text"),r=d.selectAll("path");n.transition().attr("opacity",0),e=t,r.transition().duration(x).attrTween("d",F).each("end",function(e){e.x>=t.x&&e.x=t.depth&&d3.select(this.parentNode).select("text").transition().duration(x).text(function(t){return h(t)}).attr("opacity",function(t){return E(t)?1:0}).attr("transform",function(){var n=this.getBBox().width;if(0===e.depth)return"translate("+n/2*-1+",0)";if(e.depth===t.depth)return"translate("+(w(e.y)+5)+",0)";var r=W(e),i=S(e);return 0===i?"rotate("+r+")translate("+(w(e.y)+5)+",0)":"rotate("+r+")translate("+(w(e.y)+n+5)+",0)rotate("+i+")"}))})}var _=t.utils.renderWatch(b);function L(e){return _.reset(),e.each(function(e){d=d3.select(this),n=t.utils.availableWidth(a,d,o),r=t.utils.availableHeight(s,d,o),i=Math.min(n,r)/2,w.range([0,i]);var g=d.select("g.nvd3.nv-wrap.nv-sunburst");g[0][0]?g.attr("transform","translate("+(n/2+o.left+o.right)+","+(r/2+o.top+o.bottom)+")"):g=d.append("g").attr("class","nvd3 nv-wrap nv-sunburst nv-chart-"+c).attr("transform","translate("+(n/2+o.left+o.right)+","+(r/2+o.top+o.bottom)+")"),d.on("click",function(t,e){b.chartClick({data:t,index:e,pos:d3.event,id:c})}),M.value(u[l]||u.count);var v=M.nodes(e[0]).reverse();D(v);var F=g.selectAll(".arc-container").data(v,m);F.enter().append("g").attr("class","arc-container").append("path").attr("d",C).style("fill",function(t){return t.color?t.color:f(y?(t.children?t:t.parent).name:t.name)}).style("stroke","#FFF").on("click",function(t,e){O(t),b.elementClick({data:t,index:e})}).on("mouseover",function(t,e){var n,r;d3.select(this).classed("hover",!0).style("opacity",.8),b.elementMouseover({data:t,color:d3.select(this).style("fill"),percent:(n=t,r=Math.max(0,Math.min(2*Math.PI,k(n.x))),(Math.max(0,Math.min(2*Math.PI,k(n.x+n.dx)))-r)/(2*Math.PI))})}).on("mouseout",function(t,e){d3.select(this).classed("hover",!1).style("opacity",1),b.elementMouseout({data:t})}).on("mousemove",function(t,e){b.elementMousemove({data:t})}),F.each(function(t){d3.select(this).select("path").transition().duration(x).attrTween("d",N)}),p&&(F.selectAll("text").remove(),F.append("text").text(function(t){return h(t)}).transition().duration(x).attr("opacity",function(t){return E(t)?1:0}).attr("transform",function(t){var e=this.getBBox().width;if(0===t.depth)return"rotate(0)translate("+e/2*-1+",0)";var n=W(t),r=S(t);return 0===r?"rotate("+n+")translate("+(w(t.y)+5)+",0)":"rotate("+n+")translate("+(w(t.y)+e+5)+",0)rotate("+r+")"})),O(v[v.length-1]),F.exit().transition().duration(x).attr("opacity",0).each("end",function(t){var e=m(t);A[e]=void 0}).remove()}),_.renderEnd("sunburst immediate"),L}return L.dispatch=b,L.options=t.utils.optionsFunc.bind(L),L._options=Object.create({},{width:{get:function(){return a},set:function(t){a=t}},height:{get:function(){return s},set:function(t){s=t}},mode:{get:function(){return l},set:function(t){l=t}},id:{get:function(){return c},set:function(t){c=t}},duration:{get:function(){return x},set:function(t){x=t}},groupColorByParent:{get:function(){return y},set:function(t){y=!!t}},showLabels:{get:function(){return p},set:function(t){p=!!t}},labelFormat:{get:function(){return h},set:function(t){h=t}},labelThreshold:{get:function(){return g},set:function(t){g=t}},sort:{get:function(){return v},set:function(t){v=t}},key:{get:function(){return m},set:function(t){m=t}},margin:{get:function(){return o},set:function(t){o.top=void 0!=t.top?t.top:o.top,o.right=void 0!=t.right?t.right:o.right,o.bottom=void 0!=t.bottom?t.bottom:o.bottom,o.left=void 0!=t.left?t.left:o.left}},color:{get:function(){return f},set:function(e){f=t.utils.getColor(e)}}}),t.utils.initOptions(L),L},t.models.sunburstChart=function(){"use strict";var e=t.models.sunburst(),n=t.models.tooltip(),r={top:30,right:20,bottom:20,left:20},i=null,o=null,a=t.utils.defaultColor(),s=!1,l=(Math.round(1e5*Math.random()),null),u=null,c=250,d=d3.dispatch("stateChange","changeState","renderEnd"),f=t.utils.renderWatch(d);function p(n){return f.reset(),f.models(e),n.each(function(n){var a=d3.select(this);t.utils.initSVG(a);var s=t.utils.availableWidth(i,a,r),l=t.utils.availableHeight(o,a,r);if(p.update=function(){0===c?a.call(p):a.transition().duration(c).call(p)},p.container=a,!n||!n.length)return t.utils.noData(p,a),p;a.selectAll(".nv-noData").remove(),e.width(s).height(l).margin(r),a.call(e)}),f.renderEnd("sunburstChart immediate"),p}return n.duration(0).headerEnabled(!1).valueFormatter(function(t){return t}),e.dispatch.on("elementMouseover.tooltip",function(t){t.series={key:t.data.name,value:t.data.value||t.data.size,color:t.color,percent:t.percent},s||(delete t.percent,delete t.series.percent),n.data(t).hidden(!1)}),e.dispatch.on("elementMouseout.tooltip",function(t){n.hidden(!0)}),e.dispatch.on("elementMousemove.tooltip",function(t){n()}),p.dispatch=d,p.sunburst=e,p.tooltip=n,p.options=t.utils.optionsFunc.bind(p),p._options=Object.create({},{noData:{get:function(){return u},set:function(t){u=t}},defaultState:{get:function(){return l},set:function(t){l=t}},showTooltipPercent:{get:function(){return s},set:function(t){s=t}},color:{get:function(){return a},set:function(t){a=t,e.color(a)}},duration:{get:function(){return c},set:function(t){c=t,f.reset(c),e.duration(c)}},margin:{get:function(){return r},set:function(t){r.top=void 0!==t.top?t.top:r.top,r.right=void 0!==t.right?t.right:r.right,r.bottom=void 0!==t.bottom?t.bottom:r.bottom,r.left=void 0!==t.left?t.left:r.left,e.margin(r)}}}),t.utils.inheritOptions(p,e),t.utils.initOptions(p),p},t.version="1.8.6"}(); +},{"d3":4}],7:[function(require,module,exports) { +(function(){var n=this,r=n._,t=Array.prototype,e=Object.prototype,u=Function.prototype,i=t.push,o=t.slice,a=e.toString,c=e.hasOwnProperty,f=Array.isArray,l=Object.keys,s=u.bind,p=Object.create,h=function(){},v=function(n){return n instanceof v?n:this instanceof v?void(this._wrapped=n):new v(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=v),exports._=v):n._=v,v.VERSION="1.8.3";var y=function(n,r,t){if(void 0===r)return n;switch(null==t?3:t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,i){return n.call(r,t,e,u,i)}}return function(){return n.apply(r,arguments)}},d=function(n,r,t){return null==n?v.identity:v.isFunction(n)?y(n,r,t):v.isObject(n)?v.matcher(n):v.property(n)};v.iteratee=function(n,r){return d(n,r,1/0)};var g=function(n,r){return function(t){var e=arguments.length;if(e<2||null==t)return t;for(var u=1;u=0&&r<=x};function w(n){return function(r,t,e,u){t=y(t,u,4);var i=!j(r)&&v.keys(r),o=(i||r).length,a=n>0?0:o-1;return arguments.length<3&&(e=r[i?i[a]:a],a+=n),function(r,t,e,u,i,o){for(;i>=0&&i=0},v.invoke=function(n,r){var t=o.call(arguments,2),e=v.isFunction(r);return v.map(n,function(n){var u=e?r:n[r];return null==u?u:u.apply(n,t)})},v.pluck=function(n,r){return v.map(n,v.property(r))},v.where=function(n,r){return v.filter(n,v.matcher(r))},v.findWhere=function(n,r){return v.find(n,v.matcher(r))},v.max=function(n,r,t){var e,u,i=-1/0,o=-1/0;if(null==r&&null!=n)for(var a=0,c=(n=j(n)?n:v.values(n)).length;ai&&(i=e);else r=d(r,t),v.each(n,function(n,t,e){((u=r(n,t,e))>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},v.min=function(n,r,t){var e,u,i=1/0,o=1/0;if(null==r&&null!=n)for(var a=0,c=(n=j(n)?n:v.values(n)).length;ae||void 0===t)return 1;if(t0?0:u-1;i>=0&&i0?a=i>=0?i:Math.max(i+c,a):c=i>=0?Math.min(i+1,c):i+c+1;else if(t&&i&&c)return e[i=t(e,u)]===u?i:-1;if(u!=u)return(i=r(o.call(e,a,c),v.isNaN))>=0?i+a:-1;for(i=n>0?a:c-1;i>=0&&ir?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||!1===t.trailing||(o=setTimeout(c,l)),i}},v.debounce=function(n,r,t){var e,u,i,o,a,c=function(){var f=v.now()-o;f=0?e=setTimeout(c,r-f):(e=null,t||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=v.now();var f=t&&!e;return e||(e=setTimeout(c,r)),f&&(a=n.apply(i,u),i=u=null),a}},v.wrap=function(n,r){return v.partial(r,n)},v.negate=function(n){return function(){return!n.apply(this,arguments)}},v.compose=function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},v.after=function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},v.before=function(n,r){var t;return function(){return--n>0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}},v.once=v.partial(v.before,2);var E=!{toString:null}.propertyIsEnumerable("toString"),M=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function I(n,r){var t=M.length,u=n.constructor,i=v.isFunction(u)&&u.prototype||e,o="constructor";for(v.has(n,o)&&!v.contains(r,o)&&r.push(o);t--;)(o=M[t])in n&&n[o]!==i[o]&&!v.contains(r,o)&&r.push(o)}v.keys=function(n){if(!v.isObject(n))return[];if(l)return l(n);var r=[];for(var t in n)v.has(n,t)&&r.push(t);return E&&I(n,r),r},v.allKeys=function(n){if(!v.isObject(n))return[];var r=[];for(var t in n)r.push(t);return E&&I(n,r),r},v.values=function(n){for(var r=v.keys(n),t=r.length,e=Array(t),u=0;u":">",'"':""","'":"'","`":"`"},T=v.invert(B),R=function(n){var r=function(r){return n[r]},t="(?:"+v.keys(n).join("|")+")",e=RegExp(t),u=RegExp(t,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,r):n}};v.escape=R(B),v.unescape=R(T),v.result=function(n,r,t){var e=null==n?void 0:n[r];return void 0===e&&(e=t),v.isFunction(e)?e.call(n):e};var q=0;v.uniqueId=function(n){var r=++q+"";return n?n+r:r},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};v.template=function(n,r,t){!r&&t&&(r=t),r=v.defaults({},r,v.templateSettings);var e=RegExp([(r.escape||K).source,(r.interpolate||K).source,(r.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(r,t,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+r.length,t?i+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),r}),i+="';\n",r.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(r.variable||"obj","_",i)}catch(n){throw n.source=i,n}var a=function(n){return o.call(this,n,v)},c=r.variable||"obj";return a.source="function("+c+"){\n"+i+"}",a},v.chain=function(n){var r=v(n);return r._chain=!0,r};var P=function(n,r){return n._chain?v(r).chain():r};v.mixin=function(n){v.each(v.functions(n),function(r){var t=v[r]=n[r];v.prototype[r]=function(){var n=[this._wrapped];return i.apply(n,arguments),P(this,t.apply(v,n))}})},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var r=t[n];v.prototype[n]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==n&&"splice"!==n||0!==t.length||delete t[0],P(this,t)}}),v.each(["concat","join","slice"],function(n){var r=t[n];v.prototype[n]=function(){return P(this,r.apply(this._wrapped,arguments))}}),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return v})}).call(this); +},{}],2:[function(require,module,exports) { var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a1)for(var n=1;n0&&t-1 in e)}b.fn=b.prototype={jquery:"3.3.1",constructor:b,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return b.each(this,e)},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,y,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!v||!v.test(e))){if(1!==T)m=t,y=e;else if("object"!==t.nodeName.toLowerCase()){for((c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;s--;)h[s]="#"+c+" "+ye(h[s]);y=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(y)try{return L.apply(r,m.querySelectorAll(y)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(h=(d=a).documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],v=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),y.push("!=",W)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",v=t.parentNode,y=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(v){if(o){for(;g;){for(p=t;p=p[g];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?v.firstChild:v.lastChild],a&&m){for(x=(d=(l=(c=(f=(p=v)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&v.childNodes[d];p=++d&&p&&p[g]||(x=d=0)||h.pop();)if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)for(;(p=++d&&p&&p[g]||(x=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++x||(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s-1&&(o[l]=!(a[l]=f))}}else y=be(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):L.apply(a,y)})}function Te(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ye(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,c){var f,h,v,y=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){for(h=0,a||f.ownerDocument===d||(p(f),s=!g);v=e[h++];)if(v(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!v&&f)&&y--,o&&x.push(f))}if(y+=m,n&&m!==y){for(h=0;v=t[h++];)v(x,b,a,s);if(o){if(y>0)for(;m--;)x[m]||b[m]||(b[m]=j.call(u));b=be(b)}L.apply(u,b),c&&!o&&b.length>0&&y+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}(o,i))).selector=e}return s},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=V.needsContext.test(e)?0:u.length;o--&&(l=u[o],!r.relative[c=l.type]);)if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ye(u)))return L.apply(n,i),n;break}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);b.find=C,b.expr=C.selectors,b.expr[":"]=b.expr.pseudos,b.uniqueSort=b.unique=C.uniqueSort,b.text=C.getText,b.isXMLDoc=C.isXML,b.contains=C.contains,b.escapeSelector=C.escape;var E=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&b(e).is(n))break;r.push(e)}return r},k=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},S=b.expr.match.needsContext;function D(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(e,t,n){return g(t)?b.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?b.grep(e,function(e){return e===t!==n}):"string"!=typeof t?b.grep(e,function(e){return u.call(t,e)>-1!==n}):b.filter(t,e,n)}b.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?b.find.matchesSelector(r,e)?[r]:[]:b.find.matches(e,b.grep(t,function(e){return 1===e.nodeType}))},b.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(b(e).filter(function(){for(t=0;t1?b.uniqueSort(n):n},filter:function(e){return this.pushStack(A(this,e||[],!1))},not:function(e){return this.pushStack(A(this,e||[],!0))},is:function(e){return!!A(this,"string"==typeof e&&S.test(e)?b(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(b.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:q.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof b?t[0]:t,b.merge(this,b.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),N.test(i[1])&&b.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(b):b.makeArray(e,this)}).prototype=b.fn,j=b(r);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}b.fn.extend({has:function(e){var t=b(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&b.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?b.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(b(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(b.uniqueSort(b.merge(this.get(),b(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return E(e,"parentNode")},parentsUntil:function(e,t,n){return E(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return E(e,"nextSibling")},prevAll:function(e){return E(e,"previousSibling")},nextUntil:function(e,t,n){return E(e,"nextSibling",n)},prevUntil:function(e,t,n){return E(e,"previousSibling",n)},siblings:function(e){return k((e.parentNode||{}).firstChild,e)},children:function(e){return k(e.firstChild)},contents:function(e){return D(e,"iframe")?e.contentDocument:(D(e,"template")&&(e=e.content||e),b.merge([],e.childNodes))}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),this.length>1&&(H[e]||b.uniqueSort(i),L.test(e)&&i.reverse()),this.pushStack(i)}});var P=/[^\x20\t\r\n\f]+/g;function M(e){return e}function R(e){throw e}function I(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}b.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return b.each(e.match(P)||[],function(e,n){t[n]=!0}),t}(e):b.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?b.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},b.extend({Deferred:function(t){var n=[["notify","progress",b.Callbacks("memory"),b.Callbacks("memory"),2],["resolve","done",b.Callbacks("once memory"),b.Callbacks("once memory"),0,"resolved"],["reject","fail",b.Callbacks("once memory"),b.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return b.Deferred(function(t){b.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==R&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(b.Deferred.getStackHook&&(c.stackTrace=b.Deferred.getStackHook()),e.setTimeout(c))}}return b.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:M,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:M)),n[2][3].add(a(0,e,g(r)?r:R))}).promise()},promise:function(e){return null!=e?b.extend(e,i):i}},o={};return b.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=b.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(I(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();for(;n--;)I(i[n],s(n),a.reject);return a.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;b.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&W.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},b.readyException=function(t){e.setTimeout(function(){throw t})};var $=b.Deferred();function B(){r.removeEventListener("DOMContentLoaded",B),e.removeEventListener("load",B),b.ready()}b.fn.ready=function(e){return $.then(e).catch(function(e){b.readyException(e)}),this},b.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--b.readyWait:b.isReady)||(b.isReady=!0,!0!==e&&--b.readyWait>0||$.resolveWith(r,[b]))}}),b.ready.then=$.then,"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(b.ready):(r.addEventListener("DOMContentLoaded",B),e.addEventListener("load",B));var F=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)F(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(b(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),b.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,b.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){b.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:b.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),b.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,fe=/^$|^module$|\/(?:java|ecma)script/i,pe={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function de(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?b.merge([e],n):n}function he(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=b.contains(o.ownerDocument,o),a=de(f.appendChild(o),"script"),l&&he(a),n)for(c=0;o=a[c++];)fe.test(o.type||"")&&n.push(o);return f}ge=r.createDocumentFragment().appendChild(r.createElement("div")),(ve=r.createElement("input")).setAttribute("type","radio"),ve.setAttribute("checked","checked"),ve.setAttribute("name","t"),ge.appendChild(ve),h.checkClone=ge.cloneNode(!0).cloneNode(!0).lastChild.checked,ge.innerHTML="",h.noCloneChecked=!!ge.cloneNode(!0).lastChild.defaultValue;var xe=r.documentElement,be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function ke(){try{return r.activeElement}catch(e){}}function Se(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Se(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return b().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=b.guid++)),e.each(function(){b.event.add(this,t,i,r,n)})}b.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(e);if(v)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&b.find.matchesSelector(xe,i),n.guid||(n.guid=b.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(t){return void 0!==b&&b.event.triggered!==t.type?b.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(P)||[""]).length;l--;)d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=b.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=b.event.special[d]||{},c=b.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&b.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),b.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(P)||[""]).length;l--;)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){for(f=b.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||b.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=b.event.fix(e),u=new Array(arguments.length),l=(Y.get(this,"events")||{})[s.type]||[],c=b.event.special[s.type]||{};for(u[0]=s,t=1;t=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:b.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ne=/\s*$/g;function qe(e,t){return D(e,"table")&&D(11!==t.nodeType?t:t.firstChild,"tr")&&b(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Y.hasData(e)&&(o=Y.access(e),a=Y.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n1&&"string"==typeof v&&!h.checkClone&&Ae.test(v))return e.each(function(i){var o=e.eq(i);y&&(t[0]=v.call(this,i,o.html())),Pe(o,t,n,r)});if(p&&(o=(i=me(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=b.map(de(i,"script"),Le)).length;f")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=b.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(a=de(c),r=0,i=(o=de(e)).length;r0&&he(a,!f&&de(e,"script")),c},cleanData:function(e){for(var t,n,r,i=b.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?b.event.remove(n,r):b.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),b.fn.extend({detach:function(e){return Me(this,e,!0)},remove:function(e){return Me(this,e)},text:function(e){return F(this,function(e){return void 0===e?b.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(b.cleanData(de(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return F(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!pe[(ce.exec(e)||["",""])[1].toLowerCase()]){e=b.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function Je(e,t,n){var r=Ie(e),i=$e(e,t,r),o="border-box"===b.css(e,"boxSizing",!1,r),a=o;if(Re.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===b.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Qe(e,t,n||(o?"border":"content"),a,r,i)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=$e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=U(t),u=_e.test(t),l=e.style;if(u||(t=Ge(s)),a=b.cssHooks[t]||b.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=oe(e,t,i),o="number"),null!=n&&n==n&&("number"===o&&(n+=i&&i[3]||(b.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=U(t);return _e.test(t)||(t=Ge(s)),(a=b.cssHooks[t]||b.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=$e(e,t,r)),"normal"===i&&t in Xe&&(i=Xe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),b.each(["height","width"],function(e,t){b.cssHooks[t]={get:function(e,n,r){if(n)return!Fe.test(b.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,r):ie(e,ze,function(){return Je(e,t,r)})},set:function(e,n,r){var i,o=Ie(e),a="border-box"===b.css(e,"boxSizing",!1,o),s=r&&Qe(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Qe(e,t,"border",!1,o)-.5)),s&&(i=te.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=b.css(e,t)),Ye(0,n,s)}}}),b.cssHooks.marginLeft=Be(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat($e(e,"marginLeft"))||e.getBoundingClientRect().left-ie(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+ne[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(b.cssHooks[e+t].set=Ye)}),b.fn.extend({css:function(e,t){return F(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a1)}}),b.Tween=Ke,Ke.prototype={constructor:Ke,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||b.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}},Ke.prototype.init.prototype=Ke.prototype,Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=b.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[b.cssProps[e.prop]]&&!b.cssHooks[e.prop]?e.elem[e.prop]=e.now:b.style(e.elem,e.prop,e.now+e.unit)}}},Ke.propHooks.scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},b.fx=Ke.prototype.init,b.fx.step={};var Ze,et,tt=/^(?:toggle|show|hide)$/,nt=/queueHooks$/;function rt(){et&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(rt):e.setTimeout(rt,b.fx.interval),b.fx.tick())}function it(){return e.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function ot(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function at(e,t,n){for(var r,i=(st.tweeners[t]||[]).concat(st.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})}}),b.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?b.prop(e,t,n):(1===o&&b.isXMLDoc(e)||(i=b.attrHooks[t.toLowerCase()]||(b.expr.match.bool.test(t)?ut:void 0)),void 0!==n?null===n?void b.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=b.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&D(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),ut={set:function(e,t,n){return!1===t?b.removeAttr(e,n):e.setAttribute(n,n),n}},b.each(b.expr.match.bool.source.match(/\w+/g),function(e,t){var n=lt[t]||b.find.attr;lt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=lt[a],lt[a]=i,i=null!=n(e,t,r)?a:null,lt[a]=o),i}});var ct=/^(?:input|select|textarea|button)$/i,ft=/^(?:a|area)$/i;function pt(e){return(e.match(P)||[]).join(" ")}function dt(e){return e.getAttribute&&e.getAttribute("class")||""}function ht(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}b.fn.extend({prop:function(e,t){return F(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[b.propFix[e]||e]})}}),b.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&b.isXMLDoc(e)||(t=b.propFix[t]||t,i=b.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=b.find.attr(e,"tabindex");return t?parseInt(t,10):ct.test(e.nodeName)||ft.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),h.optSelected||(b.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),b.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){b.propFix[this.toLowerCase()]=this}),b.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){b(this).addClass(e.call(this,t,dt(this)))});if((t=ht(e)).length)for(;n=this[u++];)if(i=dt(n),r=1===n.nodeType&&" "+pt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){b(this).removeClass(e.call(this,t,dt(this)))});if(!arguments.length)return this.attr("class","");if((t=ht(e)).length)for(;n=this[u++];)if(i=dt(n),r=1===n.nodeType&&" "+pt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,dt(this),t),t)}):this.each(function(){var t,i,o,a;if(r)for(i=0,o=b(this),a=ht(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=dt(this))&&Y.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+pt(dt(n))+" ").indexOf(t)>-1)return!0;return!1}});var gt=/\r/g;b.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,b(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=b.map(i,function(e){return null==e?"":e+""})),(t=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=b.valHooks[i.type]||b.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(gt,""):null==n?"":n:void 0}}),b.extend({valHooks:{option:{get:function(e){var t=b.find.attr(e,"value");return null!=t?t:pt(b.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=b.inArray(b(e).val(),t)>-1}},h.checkOn||(b.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var vt=/^(?:focusinfocus|focusoutblur)$/,yt=function(e){e.stopPropagation()};b.extend(b.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,y=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!vt.test(m+b.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[b.expando]?t:new b.Event(m,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:b.makeArray(n,[t]),d=b.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!v(i)){for(l=d.delegateType||m,vt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)y.push(s),u=s;u===(i.ownerDocument||r)&&y.push(u.defaultView||u.parentWindow||e)}for(a=0;(s=y[a++])&&!t.isPropagationStopped();)h=s,t.type=a>1?l:d.bindType||m,(p=(Y.get(s,"events")||{})[t.type]&&Y.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&V(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!V(i)||c&&g(i[m])&&!v(i)&&((u=i[c])&&(i[c]=null),b.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,yt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,yt),b.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=b.extend(new b.Event,n,{type:e,isSimulated:!0});b.event.trigger(r,null,t)}}),b.fn.extend({trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return b.event.trigger(e,t,n,!0)}}),h.focusin||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){b.event.simulate(t,e.target,b.event.fix(e))};b.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Y.access(r,t);i||r.addEventListener(e,n,!0),Y.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Y.access(r,t)-1;i?Y.access(r,t,i):(r.removeEventListener(e,n,!0),Y.remove(r,t))}}});var mt=e.location,xt=Date.now(),bt=/\?/;b.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+t),n};var wt=/\[\]$/,Tt=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function kt(e,t,n,r){var i;if(Array.isArray(t))b.each(t,function(t,i){n||wt.test(e)?r(e,i):kt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)kt(e+"["+i+"]",t[i],n,r)}b.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){i(this.name,this.value)});else for(n in e)kt(n,e[n],t,i);return r.join("&")},b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&Et.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!le.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:Array.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}}):{name:t.name,value:n.replace(Tt,"\r\n")}}).get()}});var St=/%20/g,Dt=/#.*$/,Nt=/([?&])_=[^&]*/,At=/^(.*?):[ \t]*([^\r\n]*)$/gm,jt=/^(?:GET|HEAD)$/,qt=/^\/\//,Lt={},Ht={},Ot="*/".concat("*"),Pt=r.createElement("a");function Mt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(P)||[];if(g(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Rt(e,t,n,r){var i={},o=e===Ht;function a(s){var u;return i[s]=!0,b.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function It(e,t){var n,r,i=b.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&b.extend(!0,e,r),e}Pt.href=mt.href,b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:mt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ot,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?It(It(e,b.ajaxSettings),t):It(b.ajaxSettings,e)},ajaxPrefilter:Mt(Lt),ajaxTransport:Mt(Ht),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=b.ajaxSetup({},n),g=h.context||h,v=h.context&&(g.nodeType||g.jquery)?b(g):b.event,y=b.Deferred(),m=b.Callbacks("once memory"),x=h.statusCode||{},w={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=At.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(y.promise(E),h.url=((t||h.url||mt.href)+"").replace(qt,mt.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(P)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Pt.protocol+"//"+Pt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=b.param(h.data,h.traditional)),Rt(Lt,h,n,E),c)return E;for(p in(f=b.event&&h.global)&&0==b.active++&&b.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!jt.test(h.type),o=h.url.replace(Dt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(St,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(bt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Nt,"$1"),d=(bt.test(o)?"&":"?")+"_="+xt+++d),h.url=o+d),h.ifModified&&(b.lastModified[o]&&E.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&E.setRequestHeader("If-None-Match",b.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ot+"; q=0.01":""):h.accepts["*"]),h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=Rt(Ht,h,n,E)){if(E.readyState=1,f&&v.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(w,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,w,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(w=function(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(h,E,r)),w=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(h,w,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(b.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(b.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=w.state,p=w.data,l=!(d=w.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?y.resolveWith(g,[p,C,E]):y.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&v.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(v.trigger("ajaxComplete",[E,h]),--b.active||b.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return b.get(e,t,n,"json")},getScript:function(e,t){return b.get(e,void 0,t,"script")}}),b.each(["get","post"],function(e,t){b[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),b.ajax(b.extend({url:e,type:t,dataType:i,data:n,success:r},b.isPlainObject(e)&&e))}}),b._evalUrl=function(e){return b.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},b.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=b(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){b(this).replaceWith(this.childNodes)}),this}}),b.expr.pseudos.hidden=function(e){return!b.expr.pseudos.visible(e)},b.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},b.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},$t=b.ajaxSettings.xhr();h.cors=!!$t&&"withCredentials"in $t,h.ajax=$t=!!$t,b.ajaxTransport(function(t){var n,r;if(h.cors||$t&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Wt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),b.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),b.ajaxTransport("script",function(e){var t,n;if(e.crossDomain)return{send:function(i,o){t=b(" -${h.js( 'libs/jquery/jquery', - 'libs/underscore', - 'libs/d3')} ${h.javascript_link( root + 'plugins/visualizations/scatterplot/static/scatterplot.js' )} diff --git a/config/plugins/visualizations/trackster/config/trackster.xml b/config/plugins/visualizations/trackster/config/trackster.xml index 2d63a12854b..ac0cb8a41b9 100644 --- a/config/plugins/visualizations/trackster/config/trackster.xml +++ b/config/plugins/visualizations/trackster/config/trackster.xml @@ -1,7 +1,7 @@ - - + + Fast, interactive visualization for large, NGS/HTS datasets using only a web browser. HistoryDatasetAssociation diff --git a/config/plugins/visualizations/trackster/static/logo.png b/config/plugins/visualizations/trackster/static/logo.png new file mode 100644 index 00000000000..345f97a2e3a Binary files /dev/null and b/config/plugins/visualizations/trackster/static/logo.png differ diff --git a/config/plugins/visualizations/unipept/config/unipept.xml b/config/plugins/visualizations/unipept/config/unipept.xml index a37790c37d8..02dd9816019 100644 --- a/config/plugins/visualizations/unipept/config/unipept.xml +++ b/config/plugins/visualizations/unipept/config/unipept.xml @@ -1,6 +1,7 @@ + Interactive Unipept Tree viewer. HistoryDatasetAssociation diff --git a/config/plugins/visualizations/venn/src/script.js b/config/plugins/visualizations/venn/src/script.js index ee129abc443..32fef5b6d5d 100644 --- a/config/plugins/visualizations/venn/src/script.js +++ b/config/plugins/visualizations/venn/src/script.js @@ -18,6 +18,7 @@ _.extend(window.bundleEntries || {}, { }); }; Datasets.request({ + chart : options.chart, dataset_id : options.chart.get( 'dataset_id' ), dataset_groups : options.chart.groups, success : function( result ) { diff --git a/config/plugins/visualizations/venn/static/script.js b/config/plugins/visualizations/venn/static/script.js index 29452fe3c19..06a6f91b34d 100644 --- a/config/plugins/visualizations/venn/static/script.js +++ b/config/plugins/visualizations/venn/static/script.js @@ -4,5 +4,5 @@ var t=(0,eval)("this");!function(t,r){"object"==typeof exports&&"undefined"!=typ },{}],3:[function(require,module,exports) { !function(){var n={version:"3.5.17"},t=[].slice,e=function(n){return t.call(n)},r=this.document;function i(n){return n&&(n.ownerDocument||n.document||n).documentElement}function u(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}if(r)try{e(r.documentElement.childNodes)[0].nodeType}catch(n){e=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),r)try{r.createElement("DIV").style.setProperty("opacity",0,"")}catch(n){var o=this.Element.prototype,a=o.setAttribute,l=o.setAttributeNS,c=this.CSSStyleDeclaration.prototype,f=c.setProperty;o.setAttribute=function(n,t){a.call(this,n,t+"")},o.setAttributeNS=function(n,t,e){l.call(this,n,t,e+"")},c.setProperty=function(n,t,e){f.call(this,n,t+"",e)}}function s(n,t){return nt?1:n>=t?0:NaN}function h(n){return null===n?NaN:+n}function p(n){return!isNaN(n)}function g(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}n.ascending=s,n.descending=function(n,t){return tn?1:t>=n?0:NaN},n.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ir&&(e=r)}else{for(;++i=r){e=r;break}for(;++ir&&(e=r)}return e},n.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ie&&(e=r)}else{for(;++i=r){e=r;break}for(;++ie&&(e=r)}return e},n.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u=r){e=i=r;break}for(;++ur&&(e=r),i=r){e=i=r;break}for(;++ur&&(e=r),i1)return o/(l-1)},n.deviation=function(){var t=n.variance.apply(this,arguments);return t?Math.sqrt(t):t};var v=g(s);function d(n){return n.length}n.bisectLeft=v.left,n.bisect=n.bisectRight=v.right,n.bisector=function(n){return g(1===n.length?function(t,e){return s(n(t),e)}:n)},n.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,u<2&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},n.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},n.pairs=function(n){for(var t=0,e=n.length-1,r=n[0],i=new Array(e<0?0:e);t=0;)for(t=(r=n[i]).length;--t>=0;)e[--o]=r[t];return e};var y=Math.abs;function m(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function M(){this._=Object.create(null)}n.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e==1/0)throw new Error("infinite range");var r,i=[],u=function(n){var t=1;for(;n*t%1;)t*=10;return t}(y(e)),o=-1;if(n*=u,t*=u,(e*=u)<0)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)=i.length)return e?e.call(r,u):t?u.sort(t):u;for(var l,c,f,s,h=-1,p=u.length,g=i[a++],v=new M;++h=i.length)return t;var r=[],o=u[e++];return t.forEach(function(t,i){r.push({key:t,values:n(i,e)})}),o?r.sort(function(n,t){return o(n.key,t.key)}):r}(o(n.map,t,0),0)},r.key=function(n){return i.push(n),r},r.sortKeys=function(n){return u[i.length-1]=n,r},r.sortValues=function(n){return t=n,r},r.rollup=function(n){return e=n,r},r},n.set=function(n){var t=new C;if(n)for(var e=0,r=n.length;e=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},n.event=null,n.requote=function(n){return n.replace(H,"\\$&")};var H=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,O={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]};function I(n){return O(n,X),n}var Y=function(n,t){return t.querySelector(n)},Z=function(n,t){return t.querySelectorAll(n)},V=function(n,t){var e=n.matches||n[q(n,"matchesSelector")];return(V=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(Y=function(n,t){return Sizzle(n,t)[0]||null},Z=Sizzle,V=Sizzle.matchesSelector),n.selection=function(){return n.select(r.documentElement)};var X=n.selection.prototype=[];function $(n){return"function"==typeof n?n:function(){return Y(n,this)}}function B(n){return"function"==typeof n?n:function(){return Z(n,this)}}X.select=function(n){var t,e,r,i,u=[];n=$(n);for(var o=-1,a=this.length;++o=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),J.hasOwnProperty(e)?{space:J[e],local:n}:n}},X.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=n.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(G(e,t[e]));return this}return this.each(G(t,e))},X.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=nn(n)).length,i=-1;if(t=e.classList){for(;++i=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},X.sort=function(n){n=function(n){arguments.length||(n=s);return function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}.apply(this,arguments);for(var t=-1,e=this.length;++t0&&(t=t.slice(0,o));var l=gn.get(t);function c(){var n=this[u];n&&(this.removeEventListener(t,n,n.$),delete this[u])}return l&&(t=l,a=dn),o?r?function(){var n=a(r,e(arguments));c.call(this),this.addEventListener(t,this[u]=n,n.$=i),n._=r}:c:r?R:function(){var e,r=new RegExp("^__on([^.]+)"+n.requote(t)+"$");for(var i in this)if(e=i.match(r)){var u=this[i];this.removeEventListener(e[1],u,u.$),delete this[i]}}}n.selection.enter=sn,n.selection.enter.prototype=hn,hn.append=X.append,hn.empty=X.empty,hn.node=X.node,hn.call=X.call,hn.size=X.size,hn.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++a=r&&(r=t+1);!(o=a[r])&&++r0?1:n<0?-1:0}function qn(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function Tn(n){return n>1?0:n<-1?kn:Math.acos(n)}function Rn(n){return n>1?An:n<-1?-An:Math.asin(n)}function Dn(n){return((n=Math.exp(n))+1/n)/2}function Pn(n){return(n=Math.sin(n/2))*n}var Un=Math.SQRT2;n.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(h0&&(t=t.transition().duration(v)),t.call(_.event)}function E(){c&&c.domain(l.range().map(function(n){return(n-h.x)/h.k}).map(l.invert)),s&&s.domain(f.range().map(function(n){return(n-h.y)/h.k}).map(f.invert))}function A(n){d++||n({type:"zoomstart"})}function C(n){E(),n({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function z(n){--d||(n({type:"zoomend"}),e=null)}function L(){var t=this,e=b.of(t,arguments),r=0,i=n.select(u(t)).on(m,function(){r=1,k(n.mouse(t),o),C(e)}).on(M,function(){i.on(m,null).on(M,null),a(r),z(e)}),o=w(n.mouse(t)),a=Mn(t);oa.call(t),A(e)}function q(){var t,e=this,r=b.of(e,arguments),i={},u=0,o=".zoom-"+n.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,f=[],s=n.select(e),p=Mn(e);function g(){var r=n.touches(e);return t=h.k,r.forEach(function(n){n.identifier in i&&(i[n.identifier]=w(n))}),r}function v(){var t=n.event.target;n.select(t).on(l,d).on(c,m),f.push(t);for(var r=n.event.changedTouches,o=0,s=r.length;o1){y=p[0];var M=p[1],x=y[0]-M[0],b=y[1]-M[1];u=x*x+b*b}}function d(){var o,l,c,f,s=n.touches(e);oa.call(e);for(var h=0,p=s.length;h360?n-=360:n<0&&(n+=360),n<60?r+(i-r)*n/60:n<180?i:n<240?r+(i-r)*(240-n)/60:r}(n))}return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:t<0?0:t>1?1:t,r=2*(e=e<0?0:e>1?1:e)-(i=e<=.5?e*(1+t):e+t-e*t),new ut(u(n+120),u(n),u(n-120))}function Vn(t,e,r){return this instanceof Vn?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof Vn?new Vn(t.h,t.c,t.l):tt(t instanceof Bn?t.l:(t=ht((t=n.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Vn(t,e,r)}Yn.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new In(this.h,this.s,this.l/n)},Yn.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new In(this.h,this.s,n*this.l)},Yn.rgb=function(){return Zn(this.h,this.s,this.l)},n.hcl=Vn;var Xn=Vn.prototype=new On;function $n(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new Bn(e,Math.cos(n*=Cn)*t,Math.sin(n)*t)}function Bn(n,t,e){return this instanceof Bn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof Bn?new Bn(n.l,n.a,n.b):n instanceof Vn?$n(n.h,n.c,n.l):ht((n=ut(n)).r,n.g,n.b):new Bn(n,t,e)}Xn.brighter=function(n){return new Vn(this.h,this.c,Math.min(100,this.l+Wn*(arguments.length?n:1)))},Xn.darker=function(n){return new Vn(this.h,this.c,Math.max(0,this.l-Wn*(arguments.length?n:1)))},Xn.rgb=function(){return $n(this.h,this.c,this.l).rgb()},n.lab=Bn;var Wn=18,Jn=.95047,Gn=1,Kn=1.08883,Qn=Bn.prototype=new On;function nt(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return new ut(it(3.2404542*(i=et(i)*Jn)-1.5371385*(r=et(r)*Gn)-.4985314*(u=et(u)*Kn)),it(-.969266*i+1.8760108*r+.041556*u),it(.0556434*i-.2040259*r+1.0572252*u))}function tt(n,t,e){return n>0?new Vn(Math.atan2(e,t)*zn,Math.sqrt(t*t+e*e),n):new Vn(NaN,NaN,n)}function et(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function rt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function it(n){return Math.round(255*(n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ut(n,t,e){return this instanceof ut?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof ut?new ut(n.r,n.g,n.b):ft(""+n,ut,Zn):new ut(n,t,e)}function ot(n){return new ut(n>>16,n>>8&255,255&n)}function at(n){return ot(n)+""}Qn.brighter=function(n){return new Bn(Math.min(100,this.l+Wn*(arguments.length?n:1)),this.a,this.b)},Qn.darker=function(n){return new Bn(Math.max(0,this.l-Wn*(arguments.length?n:1)),this.a,this.b)},Qn.rgb=function(){return nt(this.l,this.a,this.b)},n.rgb=ut;var lt=ut.prototype=new On;function ct(n){return n<16?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function ft(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(gt(i[0]),gt(i[1]),gt(i[2]))}return(u=vt.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o|=o>>4,a=240&u,a|=a>>4,l=15&u,l|=l<<4):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function st(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=l<.5?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(t0&&l<1?0:r),new In(r,i,l)}function ht(n,t,e){var r=rt((.4124564*(n=pt(n))+.3575761*(t=pt(t))+.1804375*(e=pt(e)))/Jn),i=rt((.2126729*n+.7151522*t+.072175*e)/Gn);return Bn(116*i-16,500*(r-i),200*(i-rt((.0193339*n+.119192*t+.9503041*e)/Kn)))}function pt(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function gt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}lt.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&t=200&&t<300||304===t){try{n=i.call(o,c)}catch(n){return void a.error.call(o,n)}a.load.call(o,n)}else a.error.call(o,c)}return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=s:c.onreadystatechange=function(){c.readyState>3&&s()},c.onprogress=function(t){var e=n.event;n.event=t;try{a.progress.call(o,c)}finally{n.event=e}},o.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?l[n]:(null==t?delete l[n]:l[n]=t+"",o)},o.mimeType=function(n){return arguments.length?(r=null==n?null:n+"",o):r},o.responseType=function(n){return arguments.length?(f=n,o):f},o.response=function(n){return i=n,o},["get","post"].forEach(function(n){o[n]=function(){return o.send.apply(o,[n].concat(e(arguments)))}}),o.send=function(n,e,i){if(2===arguments.length&&"function"==typeof e&&(i=e,e=null),c.open(n,t,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var u in l)c.setRequestHeader(u,l[u]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=f&&(c.responseType=f),null!=i&&o.on("error",i).on("load",function(n){i(null,n)}),a.beforesend.call(o,c),c.send(null==e?null:e),o},o.abort=function(){return c.abort(),o},n.rebind(o,a,"on"),null==u?o:o.get(function(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}(u))}vt.forEach(function(n,t){vt.set(n,ot(t))}),n.functor=dt,n.xhr=yt(z),n.dsv=function(n,t){var e=new RegExp('["'+n+"\n]"),r=n.charCodeAt(0);function i(n,e,r){arguments.length<3&&(r=e,e=null);var i=mt(n,t,null==e?u:o(e),r);return i.row=function(n){return arguments.length?i.response(null==(e=n)?u:o(n)):e},i}function u(n){return i.parse(n.responseText)}function o(n){return function(t){return i.parse(t.responseText,n)}}function a(t){return t.map(l).join(n)}function l(n){return e.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}return i.parse=function(n,t){var e;return i.parseRows(n,function(n,r){if(e)return e(n,r-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");e=t?function(n,e){return t(i(n),e)}:i})},i.parseRows=function(n,t){var e,i,u={},o={},a=[],l=n.length,c=0,f=0;function s(){if(c>=l)return o;if(i)return i=!1,u;var t=c;if(34===n.charCodeAt(t)){for(var e=t;e++24?(isFinite(t)&&(clearTimeout(_t),_t=setTimeout(kt,t)),bt=0):(bt=1,wt(kt))}function Nt(){for(var n=Date.now(),t=Mt;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Et(){for(var n,t=Mt,e=1/0;t;)t.c?(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}});n.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=n.round(t,At(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Ct[8+r/3]};var zt=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Lt=n.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(t,e){return(t=n.round(t,At(t,e))).toFixed(Math.max(0,Math.min(20,At(t*(1+1e-15),e))))}});function qt(n){return n+""}var Tt=n.time={},Rt=Date;function Dt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Dt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Pt.setUTCDate.apply(this._,arguments)},setDay:function(){Pt.setUTCDay.apply(this._,arguments)},setFullYear:function(){Pt.setUTCFullYear.apply(this._,arguments)},setHours:function(){Pt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Pt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Pt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Pt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Pt.setUTCSeconds.apply(this._,arguments)},setTime:function(){Pt.setTime.apply(this._,arguments)}};var Pt=Date.prototype;function Ut(n,t,e){function r(t){var e=n(t),r=u(e,1);return t-e1)for(;o68?1900:2e3),e+i[0].length):-1}function Jt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Gt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Kt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function Qt(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function ne(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function te(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ee(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function re(n,t,e){Ht.lastIndex=0;var r=Ht.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ie(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=y(t)/60|0,i=y(t)%60;return e+It(r,"0",2)+It(i,"0",2)}function ue(n,t,e){Ot.lastIndex=0;var r=Ot.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function oe(n){for(var t=n.length,e=-1;++e0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),u.push(n.substring(e-=a,e+a)),!((l+=a+1)>t));)a=i[o=(o+1)%i.length];return u.reverse().join(r)}:z;return function(t){var r=zt.exec(t),i=r[1]||" ",a=r[2]||">",l=r[3]||"-",c=r[4]||"",f=r[5],s=+r[6],h=r[7],p=r[8],g=r[9],v=1,d="",y="",m=!1,M=!0;switch(p&&(p=+p.substring(1)),(f||"0"===i&&"="===a)&&(f=i="0",a="="),g){case"n":h=!0,g="g";break;case"%":v=100,y="%",g="f";break;case"p":v=100,y="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(d="0"+g.toLowerCase());case"c":M=!1;case"d":m=!0,p=0;break;case"s":v=-1,g="r"}"$"===c&&(d=u[0],y=u[1]),"r"!=g||p||(g="g"),null!=p&&("g"==g?p=Math.max(1,Math.min(21,p)):"e"!=g&&"f"!=g||(p=Math.max(0,Math.min(20,p)))),g=Lt.get(g)||qt;var x=f&&h;return function(t){var r=y;if(m&&t%1)return"";var u=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===l?"":l;if(v<0){var c=n.formatPrefix(t,p);t=c.scale(t),r=c.symbol+y}else t*=v;var b,_,w=(t=g(t,p)).lastIndexOf(".");if(w<0){var S=M?t.lastIndexOf("e"):-1;S<0?(b=t,_=""):(b=t.substring(0,S),_=t.substring(S))}else b=t.substring(0,w),_=e+t.substring(w+1);!f&&h&&(b=o(b,1/0));var k=d.length+b.length+_.length+(x?0:u.length),N=k"===a?N+u+t:"^"===a?N.substring(0,k>>=1)+u+t+N.substring(k):u+(x?t:N+t))+r}}}(t),timeFormat:function(t){var e=t.dateTime,r=t.date,i=t.time,u=t.periods,o=t.days,a=t.shortDays,l=t.months,c=t.shortMonths;function f(n){var t=n.length;function e(e){for(var r,i,u,o=[],a=-1,l=0;++a=c)return-1;if(37===(i=t.charCodeAt(a++))){if(o=t.charAt(a++),!(u=_[o in Ft?t.charAt(a++):o])||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}f.utc=function(n){var t=f(n);function e(n){try{var e=new(Rt=Dt);return e._=n,t(e)}finally{Rt=Date}}return e.parse=function(n){try{Rt=Dt;var e=t.parse(n);return e&&e._}finally{Rt=Date}},e.toString=t.toString,e},f.multi=f.utc.multi=oe;var h=n.map(),p=Yt(o),g=Zt(o),v=Yt(a),d=Zt(a),y=Yt(l),m=Zt(l),M=Yt(c),x=Zt(c);u.forEach(function(n,t){h.set(n.toLowerCase(),t)});var b={a:function(n){return a[n.getDay()]},A:function(n){return o[n.getDay()]},b:function(n){return c[n.getMonth()]},B:function(n){return l[n.getMonth()]},c:f(e),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+Tt.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return u[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(Tt.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(Tt.mondayOfYear(n),t,2)},x:f(r),X:f(i),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:ie,"%":function(){return"%"}},_={a:function(n,t,e){v.lastIndex=0;var r=v.exec(t.slice(e));return r?(n.w=d.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(n,t,e){p.lastIndex=0;var r=p.exec(t.slice(e));return r?(n.w=g.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(n,t,e){M.lastIndex=0;var r=M.exec(t.slice(e));return r?(n.m=x.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(n,t,e){y.lastIndex=0;var r=y.exec(t.slice(e));return r?(n.m=m.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(n,t,e){return s(n,b.c.toString(),t,e)},d:Kt,e:Kt,H:ne,I:ne,j:Qt,L:re,m:Gt,M:te,p:function(n,t,e){var r=h.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)},S:ee,U:Xt,w:Vt,W:$t,x:function(n,t,e){return s(n,b.x.toString(),t,e)},X:function(n,t,e){return s(n,b.X.toString(),t,e)},y:Wt,Y:Bt,Z:Jt,"%":ue};return f}(t)}};var ae=n.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function le(){}n.format=ae.numberFormat,n.geo={},le.prototype={s:0,t:0,add:function(n){fe(n,this.t,ce),fe(ce.s,this.s,this),this.s?this.t+=ce.t:this.s=ce.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ce=new le;function fe(n,t,e){var r=e.s=n+t,i=r-n,u=r-i;e.t=n-u+(t-i)}function se(n,t){n&&pe.hasOwnProperty(n.type)&&pe[n.type](n,t)}n.geo.stream=function(n,t){n&&he.hasOwnProperty(n.type)?he[n.type](n,t):se(n,t)};var he={Feature:function(n,t){se(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r=0?1:-1,a=o*u,l=Math.cos(t),c=Math.sin(t),f=i*c,s=r*l+f*Math.cos(a),h=f*o*Math.sin(a);Ae.add(Math.atan2(h,s)),e=n,r=l,i=c}Ce.point=function(o,a){Ce.point=u,e=(n=o)*Cn,r=Math.cos(a=(t=a)*Cn/2+kn/4),i=Math.sin(a)},Ce.lineEnd=function(){u(n,t)}}function Le(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function qe(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function Te(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Re(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function De(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Pe(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function Ue(n){return[Math.atan2(n[1],n[0]),Rn(n[2])]}function je(n,t){return y(n[0]-t[0])wn?i=90:c<-wn&&(e=-90),s[0]=t,s[1]=r}};function p(n,u){f.push(s=[t=n,r=n]),ui&&(i=u)}function g(n,o){var a=Le([n*Cn,o*Cn]);if(l){var c=Te(l,a),f=Te([c[1],-c[0],0],c);Pe(f),f=Ue(f);var s=n-u,h=s>0?1:-1,g=f[0]*zn*h,v=y(s)>180;if(v^(h*ui&&(i=d);else if(v^(h*u<(g=(g+360)%360-180)&&gi&&(i=o);v?nb(t,r)&&(r=n):b(n,r)>b(t,r)&&(t=n):r>=t?(nr&&(r=n)):n>u?b(t,n)>b(t,r)&&(r=n):b(n,r)>b(t,r)&&(t=n)}else p(n,o);l=a,u=n}function v(){h.point=g}function d(){s[0]=t,s[1]=r,h.point=p,l=null}function m(n,t){if(l){var e=n-u;c+=y(e)>180?e+(e>0?360:-360):e}else o=n,a=t;Ce.point(n,t),g(n,t)}function M(){Ce.lineStart()}function x(){m(o,a),Ce.lineEnd(),y(c)>wn&&(t=-(r=180)),s[0]=t,s[1]=r,l=null}function b(n,t){return(t-=n)<0?t+360:t}function _(n,t){return n[0]-t[0]}function w(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nb(v[0],v[1])&&(v[1]=p[1]),b(p[0],v[1])>b(v[0],v[1])&&(v[0]=p[0])):a.push(v=p);for(var l,c,p,g=-1/0,v=(o=0,a[c=a.length-1]);o<=c;v=p,++o)p=a[o],(l=b(v[1],p[0]))>g&&(g=l,t=p[0],r=v[1])}return f=s=null,t===1/0||e===1/0?[[NaN,NaN],[NaN,NaN]]:[[t,e],[r,i]]}}(),n.geo.centroid=function(t){ye=me=Me=xe=be=_e=we=Se=ke=Ne=Ee=0,n.geo.stream(t,Fe);var e=ke,r=Ne,i=Ee,u=e*e+r*r+i*i;return u=0;--a)i.point((s=f[a])[0],s[1]);else r(p.x,p.p.x,-1,i);p=p.p}f=(p=p.o).z,g=!g}while(!p.v);i.lineEnd()}}}function Be(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r=0?1:-1,w=_*b,S=w>kn,k=g*M;if(Ae.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Nn:b,S^h>=e^y>=e){var N=Te(Le(s),Le(n));Pe(N);var E=Te(i,N);Pe(E);var A=(S^b>=0?-1:1)*Rn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(u<-wn||u0){for(M||(o.polygonStart(),M=!0),o.lineStart();++u1&&2&t&&e.push(e.pop().concat(e.shift())),a.push(e.filter(Ge))}return f}}function Ge(n){return n.length>1}function Ke(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:R,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Qe(n,t){return((n=n.x)[0]<0?n[1]-An-wn:An-n[1])-((t=t.x)[0]<0?t[1]-An-wn:An-t[1])}var nr=Je(Xe,function(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?kn:-kn,l=y(u-e);y(l-kn)0?An:-An),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&l>=kn&&(y(e-i)wn?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}(e,r,u,o),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=u,r=o),i=a},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}},function(n,t,e,r){var i;if(null==n)i=e*An,r.point(-kn,i),r.point(0,i),r.point(kn,i),r.point(kn,0),r.point(kn,-i),r.point(0,-i),r.point(-kn,-i),r.point(-kn,0),r.point(-kn,i);else if(y(n[0]-t[0])>wn){var u=n[0]0)){if(u/=h,h<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=e-l,h||!(u<0)){if(u/=h,h<0){if(u>s)return;u>f&&(f=u)}else if(h>0){if(u0)){if(u/=p,p<0){if(u0){if(u>s)return;u>f&&(f=u)}if(u=r-c,p||!(u<0)){if(u/=p,p<0){if(u>s)return;u>f&&(f=u)}else if(p>0){if(u0&&(i.a={x:l+f*h,y:c+f*p}),s<1&&(i.b={x:l+s*h,y:c+s*p}),i}}}}}}var er=1e9;function rr(t,e,r,i){return function(l){var c,f,s,h,p,g,v,d,y,m,M,x=l,b=Ke(),_=tr(t,e,r,i),w={point:N,lineStart:function(){w.point=E,f&&f.push(s=[]);m=!0,y=!1,v=d=NaN},lineEnd:function(){c&&(E(h,p),g&&y&&b.rejoin(),c.push(b.buffer()));w.point=N,y&&l.lineEnd()},polygonStart:function(){l=b,c=[],f=[],M=!0},polygonEnd:function(){l=x,c=n.merge(c);var e=function(n){for(var t=0,e=f.length,r=n[1],i=0;ir&&qn(c,u,n)>0&&++t:u[1]<=r&&qn(c,u,n)<0&&--t,c=u;return 0!==t}([t,i]),r=M&&e,u=c.length;(r||u)&&(l.polygonStart(),r&&(l.lineStart(),S(null,null,1,l),l.lineEnd()),u&&$e(c,o,e,S,l),l.polygonEnd()),c=f=s=null}};function S(n,o,l,c){var f=0,s=0;if(null==n||(f=u(n,l))!==(s=u(o,l))||a(n,o)<0^l>0)do{c.point(0===f||3===f?t:r,f>1?i:e)}while((f=(f+l+4)%4)!==s);else c.point(o[0],o[1])}function k(n,u){return t<=n&&n<=r&&e<=u&&u<=i}function N(n,t){k(n,t)&&l.point(n,t)}function E(n,t){var e=k(n=Math.max(-er,Math.min(er,n)),t=Math.max(-er,Math.min(er,t)));if(f&&s.push([n,t]),m)h=n,p=t,g=e,m=!1,e&&(l.lineStart(),l.point(n,t));else if(e&&y)l.point(n,t);else{var r={a:{x:v,y:d},b:{x:n,y:t}};_(r)?(y||(l.lineStart(),l.point(r.a.x,r.a.y)),l.point(r.b.x,r.b.y),e||l.lineEnd(),M=!1):e&&(l.lineStart(),l.point(n,t),M=!1)}v=n,d=t,y=e}return w};function u(n,i){return y(n[0]-t)0?0:3:y(n[0]-r)0?2:1:y(n[1]-e)0?1:0:i>0?3:2}function o(n,t){return a(n.x,t.x)}function a(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}}function ir(n){var t=0,e=kn/3,r=Nr(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*kn/180,e=n[1]*kn/180):[t/kn*180,e/kn*180]},i}function ur(n,t){var e=Math.sin(n),r=(e+Math.sin(t))/2,i=1+e*(2*r-e),u=Math.sqrt(i)/r;function o(n,t){var e=Math.sqrt(i-2*r*Math.sin(t))/r;return[e*Math.sin(n*=r),u-e*Math.cos(n)]}return o.invert=function(n,t){var e=u-t;return[Math.atan2(n,e)/r,Rn((i-(n*n+e*e)*r*r)/(2*r))]},o}n.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),(i=u(n)).valid=!0,i},extent:function(a){return arguments.length?(u=rr(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(n.geo.conicEqualArea=function(){return ir(ur)}).raw=ur,n.geo.albers=function(){return n.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},n.geo.albersUsa=function(){var t,e,r,i,u=n.geo.albers(),o=n.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=n.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};function c(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}return c.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?o:i>=.166&&i<.234&&r>=-.214&&r<-.115?a:u).invert(n)},c.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},c.precision=function(n){return arguments.length?(u.precision(n),o.precision(n),a.precision(n),c):u.precision()},c.scale=function(n){return arguments.length?(u.scale(n),o.scale(.35*n),a.scale(n),c.translate(u.translate())):u.scale()},c.translate=function(n){if(!arguments.length)return u.translate();var t=u.scale(),f=+n[0],s=+n[1];return e=u.translate(n).clipExtent([[f-.455*t,s-.238*t],[f+.455*t,s+.238*t]]).stream(l).point,r=o.translate([f-.307*t,s+.201*t]).clipExtent([[f-.425*t+wn,s+.12*t+wn],[f-.214*t-wn,s+.234*t-wn]]).stream(l).point,i=a.translate([f-.205*t,s+.212*t]).clipExtent([[f-.214*t+wn,s+.166*t+wn],[f-.115*t-wn,s+.234*t-wn]]).stream(l).point,c},c.scale(1070)};var or,ar,lr,cr,fr,sr,hr={point:R,lineStart:R,lineEnd:R,polygonStart:function(){ar=0,hr.lineStart=pr},polygonEnd:function(){hr.lineStart=hr.lineEnd=hr.point=R,or+=y(ar/2)}};function pr(){var n,t,e,r;function i(n,t){ar+=r*n-e*t,e=n,r=t}hr.point=function(u,o){hr.point=i,n=e=u,t=r=o},hr.lineEnd=function(){i(n,t)}}var gr={point:function(n,t){nfr&&(fr=n);tsr&&(sr=t)},lineStart:R,lineEnd:R,polygonStart:R,polygonEnd:R};function vr(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}var dr,yr={point:mr,lineStart:Mr,lineEnd:xr,polygonStart:function(){yr.lineStart=br},polygonEnd:function(){yr.point=mr,yr.lineStart=Mr,yr.lineEnd=xr}};function mr(n,t){Me+=n,xe+=t,++be}function Mr(){var n,t;function e(e,r){var i=e-n,u=r-t,o=Math.sqrt(i*i+u*u);_e+=o*(n+e)/2,we+=o*(t+r)/2,Se+=o,mr(n=e,t=r)}yr.point=function(r,i){yr.point=e,mr(n=r,t=i)}}function xr(){yr.point=mr}function br(){var n,t,e,r;function i(n,t){var i=n-e,u=t-r,o=Math.sqrt(i*i+u*u);_e+=o*(e+n)/2,we+=o*(r+t)/2,Se+=o,ke+=(o=r*n-e*t)*(e+n),Ne+=o*(r+t),Ee+=3*o,mr(e=n,r=t)}yr.point=function(u,o){yr.point=i,mr(n=e=u,t=r=o)},yr.lineEnd=function(){i(n,t)}}function _r(n){var t=.5,e=Math.cos(30*Cn),r=16;function i(t){return(r?function(t){var e,i,o,a,l,c,f,s,h,p,g,v,d={point:y,lineStart:m,lineEnd:x,polygonStart:function(){t.polygonStart(),d.lineStart=b},polygonEnd:function(){t.polygonEnd(),d.lineStart=m}};function y(e,r){e=n(e,r),t.point(e[0],e[1])}function m(){s=NaN,d.point=M,t.lineStart()}function M(e,i){var o=Le([e,i]),a=n(e,i);u(s,h,f,p,g,v,s=a[0],h=a[1],f=e,p=o[0],g=o[1],v=o[2],r,t),t.point(s,h)}function x(){d.point=y,t.lineEnd()}function b(){m(),d.point=_,d.lineEnd=w}function _(n,t){M(e=n,t),i=s,o=h,a=p,l=g,c=v,d.point=M}function w(){u(s,h,f,p,g,v,i,o,e,a,l,c,r,t),d.lineEnd=x,x()}return d}:function(t){return Sr(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})})(t)}function u(r,i,o,a,l,c,f,s,h,p,g,v,d,m){var M=f-r,x=s-i,b=M*M+x*x;if(b>4*t&&d--){var _=a+p,w=l+g,S=c+v,k=Math.sqrt(_*_+w*w+S*S),N=Math.asin(S/=k),E=y(y(S)-1)t||y((M*L+x*q)/b-.5)>.3||a*p+l*g+c*v0&&16,i):Math.sqrt(t)},i}function wr(n){this.stream=n}function Sr(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function kr(n){return Nr(function(){return n})()}function Nr(t){var e,r,i,u,o,a,l=_r(function(n,t){return[(n=e(n,t))[0]*c+u,o-n[1]*c]}),c=150,f=480,s=250,h=0,p=0,g=0,v=0,d=0,m=nr,M=z,x=null,b=null;function _(n){return[(n=i(n[0]*Cn,n[1]*Cn))[0]*c+u,o-n[1]*c]}function w(n){return(n=i.invert((n[0]-u)/c,(o-n[1])/c))&&[n[0]*zn,n[1]*zn]}function S(){i=Ve(r=zr(g,v,d),e);var n=e(h,p);return u=f-n[0]*c,o=s+n[1]*c,k()}function k(){return a&&(a.valid=!1,a=null),_}return _.stream=function(n){return a&&(a.valid=!1),(a=Er(m(r,l(M(n))))).valid=!0,a},_.clipAngle=function(n){return arguments.length?(m=null==n?(x=n,nr):function(n){var t=Math.cos(n),e=t>0,r=y(t)>wn;return Je(i,function(n){var t,a,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=i(s,h),d=e?v?0:o(s,h):v?o(s+(s<0?kn:-kn),h):0;if(!t&&(c=l=v)&&n.lineStart(),v!==l&&(p=u(t,g),(je(t,p)||je(g,p))&&(g[0]+=wn,g[1]+=wn,v=i(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=u(g,t),n.point(p[0],p[1])):(p=u(t,g),n.point(p[0],p[1]),n.lineEnd()),t=p;else if(r&&t&&e^v){var y;d&a||!(y=u(g,t,!0))||(f=0,e?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||t&&je(t,g)||n.point(g[0],g[1]),t=g,l=v,a=d},lineEnd:function(){l&&n.lineEnd(),t=null},clean:function(){return f|(c&&l)<<1}}},Rr(n,6*Cn),e?[0,-n]:[-kn,n-kn]);function i(n,e){return Math.cos(n)*Math.cos(e)>t}function u(n,e,r){var i=[1,0,0],u=Te(Le(n),Le(e)),o=qe(u,u),a=u[0],l=o-a*a;if(!l)return!r&&n;var c=t*o/l,f=-t*a/l,s=Te(i,u),h=De(i,c);Re(h,De(u,f));var p=s,g=qe(h,p),v=qe(p,p),d=g*g-v*(qe(h,h)-1);if(!(d<0)){var m=Math.sqrt(d),M=De(p,(-g-m)/v);if(Re(M,h),M=Ue(M),!r)return M;var x,b=n[0],_=e[0],w=n[1],S=e[1];_0^M[1]<(y(M[0]-b)kn^(b<=M[0]&&M[0]<=_)){var E=De(p,(-g+m)/v);return Re(E,h),[M,Ue(E)]}}}function o(t,r){var i=e?n:kn-n,u=0;return t<-i?u|=1:t>i&&(u|=2),r<-i?u|=4:r>i&&(u|=8),u}}((x=+n)*Cn),k()):x},_.clipExtent=function(n){return arguments.length?(b=n,M=n?rr(n[0][0],n[0][1],n[1][0],n[1][1]):z,k()):b},_.scale=function(n){return arguments.length?(c=+n,S()):c},_.translate=function(n){return arguments.length?(f=+n[0],s=+n[1],S()):[f,s]},_.center=function(n){return arguments.length?(h=n[0]%360*Cn,p=n[1]%360*Cn,S()):[h*zn,p*zn]},_.rotate=function(n){return arguments.length?(g=n[0]%360*Cn,v=n[1]%360*Cn,d=n.length>2?n[2]%360*Cn:0,S()):[g*zn,v*zn,d*zn]},n.rebind(_,l,"precision"),function(){return e=t.apply(this,arguments),_.invert=e.invert&&w,S()}}function Er(n){return Sr(n,function(t,e){n.point(t*Cn,e*Cn)})}function Ar(n,t){return[n,t]}function Cr(n,t){return[n>kn?n-Nn:n<-kn?n+Nn:n,t]}function zr(n,t,e){return n?t||e?Ve(qr(n),Tr(t,e)):qr(n):t||e?Tr(t,e):Cr}function Lr(n){return function(t,e){return[(t+=n)>kn?t-Nn:t<-kn?t+Nn:t,e]}}function qr(n){var t=Lr(n);return t.invert=Lr(-n),t}function Tr(n,t){var e=Math.cos(n),r=Math.sin(n),i=Math.cos(t),u=Math.sin(t);function o(n,t){var o=Math.cos(t),a=Math.cos(n)*o,l=Math.sin(n)*o,c=Math.sin(t),f=c*e+a*r;return[Math.atan2(l*i-f*u,a*e-c*r),Rn(f*i+l*u)]}return o.invert=function(n,t){var o=Math.cos(t),a=Math.cos(n)*o,l=Math.sin(n)*o,c=Math.sin(t),f=c*i-l*u;return[Math.atan2(l*i+c*u,a*e+f*r),Rn(f*e-a*r)]},o}function Rr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=Dr(e,i),u=Dr(e,u),(o>0?iu)&&(i+=o*Nn)):(i=n+o*Nn,u=n-.5*l);for(var c,f=i;o>0?f>u:f2?n[2]*Cn:0),t.invert=function(t){return(t=n.invert(t[0]*Cn,t[1]*Cn))[0]*=zn,t[1]*=zn,t},t},Cr.invert=Ar,n.geo.circle=function(){var n,t,e=[0,0],r=6;function i(){var n="function"==typeof e?e.apply(this,arguments):e,r=zr(-n[0]*Cn,-n[1]*Cn,0).invert,i=[];return t(null,null,1,{point:function(n,t){i.push(n=r(n,t)),n[0]*=zn,n[1]*=zn}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(n){return arguments.length?(e=n,i):e},i.angle=function(e){return arguments.length?(t=Rr((n=+e)*Cn,r*Cn),i):n},i.precision=function(e){return arguments.length?(t=Rr(n*Cn,(r=+e)*Cn),i):r},i.angle(90)},n.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Cn,i=n[1]*Cn,u=t[1]*Cn,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},n.geo.graticule=function(){var t,e,r,i,u,o,a,l,c,f,s,h,p=10,g=p,v=90,d=360,m=2.5;function M(){return{type:"MultiLineString",coordinates:x()}}function x(){return n.range(Math.ceil(i/v)*v,r,v).map(s).concat(n.range(Math.ceil(l/d)*d,a,d).map(h)).concat(n.range(Math.ceil(e/p)*p,t,p).filter(function(n){return y(n%v)>wn}).map(c)).concat(n.range(Math.ceil(o/g)*g,u,g).filter(function(n){return y(n%d)>wn}).map(f))}return M.lines=function(){return x().map(function(n){return{type:"LineString",coordinates:n}})},M.outline=function(){return{type:"Polygon",coordinates:[s(i).concat(h(a).slice(1),s(r).reverse().slice(1),h(l).reverse().slice(1))]}},M.extent=function(n){return arguments.length?M.majorExtent(n).minorExtent(n):M.minorExtent()},M.majorExtent=function(n){return arguments.length?(i=+n[0][0],r=+n[1][0],l=+n[0][1],a=+n[1][1],i>r&&(n=i,i=r,r=n),l>a&&(n=l,l=a,a=n),M.precision(m)):[[i,l],[r,a]]},M.minorExtent=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],u=+n[1][1],e>t&&(n=e,e=t,t=n),o>u&&(n=o,o=u,u=n),M.precision(m)):[[e,o],[t,u]]},M.step=function(n){return arguments.length?M.majorStep(n).minorStep(n):M.minorStep()},M.majorStep=function(n){return arguments.length?(v=+n[0],d=+n[1],M):[v,d]},M.minorStep=function(n){return arguments.length?(p=+n[0],g=+n[1],M):[p,g]},M.precision=function(n){return arguments.length?(m=+n,c=Pr(o,u,90),f=Ur(e,t,m),s=Pr(l,a,90),h=Ur(i,r,m),M):m},M.majorExtent([[-180,-90+wn],[180,90-wn]]).minorExtent([[-180,-80-wn],[180,80+wn]])},n.geo.greatArc=function(){var t,e,r=jr,i=Fr;function u(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}return u.distance=function(){return n.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},u.source=function(n){return arguments.length?(r=n,t="function"==typeof n?null:n,u):r},u.target=function(n){return arguments.length?(i=n,e="function"==typeof n?null:n,u):i},u.precision=function(){return arguments.length?u:0},u},n.geo.interpolate=function(n,t){return e=n[0]*Cn,r=n[1]*Cn,i=t[0]*Cn,u=t[1]*Cn,o=Math.cos(r),a=Math.sin(r),l=Math.cos(u),c=Math.sin(u),f=o*Math.cos(e),s=o*Math.sin(e),h=l*Math.cos(i),p=l*Math.sin(i),g=2*Math.asin(Math.sqrt(Pn(u-r)+o*l*Pn(i-e))),v=1/Math.sin(g),(d=g?function(n){var t=Math.sin(n*=g)*v,e=Math.sin(g-n)*v,r=e*f+t*h,i=e*s+t*p,u=e*a+t*c;return[Math.atan2(i,r)*zn,Math.atan2(u,Math.sqrt(r*r+i*i))*zn]}:function(){return[e*zn,r*zn]}).distance=g,d;var e,r,i,u,o,a,l,c,f,s,h,p,g,v,d},n.geo.length=function(t){return dr=0,n.geo.stream(t,Hr),dr};var Hr={sphere:R,point:R,lineStart:function(){var n,t,e;function r(r,i){var u=Math.sin(i*=Cn),o=Math.cos(i),a=y((r*=Cn)-n),l=Math.cos(a);dr+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=e*u-t*o*l)*a),t*u+e*o*l),n=r,t=u,e=o}Hr.point=function(i,u){n=i*Cn,t=Math.sin(u*=Cn),e=Math.cos(u),Hr.point=r},Hr.lineEnd=function(){Hr.point=Hr.lineEnd=R}},lineEnd:R,polygonStart:R,polygonEnd:R};function Or(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}var Ir=Or(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(n.geo.azimuthalEqualArea=function(){return kr(Ir)}).raw=Ir;var Yr=Or(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},z);function Zr(n,t){var e=Math.cos(n),r=function(n){return Math.tan(kn/4+n/2)},i=n===t?Math.sin(n):Math.log(e/Math.cos(t))/Math.log(r(t)/r(n)),u=e*Math.pow(r(n),i)/i;if(!i)return $r;function o(n,t){u>0?t<-An+wn&&(t=-An+wn):t>An-wn&&(t=An-wn);var e=u/Math.pow(r(t),i);return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}return o.invert=function(n,t){var e=u-t,r=Ln(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(u/r,1/i))-An]},o}function Vr(n,t){var e=Math.cos(n),r=n===t?Math.sin(n):(e-Math.cos(t))/(t-n),i=e/r+n;if(y(r)1&&qn(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function ti(n,t){return n[0]-t[0]||n[1]-t[1]}(n.geo.stereographic=function(){return kr(Jr)}).raw=Jr,Gr.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-An]},(n.geo.transverseMercator=function(){var n=Br(Gr),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):[(n=t())[1],-n[0]]},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):[(n=e())[0],n[1],n[2]-90]},e([0,0,90])}).raw=Gr,n.geom={},n.geom.hull=function(n){var t=Kr,e=Qr;if(arguments.length)return r(n);function r(n){if(n.length<3)return[];var r,i=dt(t),u=dt(e),o=n.length,a=[],l=[];for(r=0;r=0;--r)p.push(n[a[c[r]][2]]);for(r=+s;rwn)a=a.L;else{if(!((i=u-mi(a,o))>wn)){r>-wn?(t=a.P,e=a):i>-wn?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=pi(n);if(li.insert(t,l),t||e){if(t===e)return _i(t),e=pi(t.site),li.insert(l,e),l.edge=e.edge=ki(t.site,l.site),bi(t),void bi(e);if(e){_i(t),_i(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};Ni(e.edge,c,g,x),l.edge=ki(c,n,null,x),e.edge=ki(n,g,null,x),bi(t),bi(e)}else l.edge=ki(t.site,l.site)}}function yi(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-1/0;var a=(e=o.site).x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function mi(n,t){var e=n.N;if(e)return yi(e,t);var r=n.site;return r.y===t?r.x:1/0}function Mi(n){this.site=n,this.edges=[]}function xi(n,t){return t.angle-n.angle}function bi(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,i=n.site,u=e.site;if(r!==u){var o=i.x,a=i.y,l=r.x-o,c=r.y-a,f=u.x-o,s=2*(l*(d=u.y-a)-c*f);if(!(s>=-Sn)){var h=l*l+c*c,p=f*f+d*d,g=(d*h-c*p)/s,v=(l*p-f*h)/s,d=v+a,y=hi.pop()||new function(){Ci(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=n,y.site=i,y.x=g+o,y.y=d+Math.sqrt(g*g+v*v),y.cy=d,n.circle=y;for(var m=null,M=fi._;M;)if(y.y=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.y1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.y=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.xwn||y(i-e)>wn)&&(a.splice(o,0,new Ei((m=u.site,M=f,x=y(r-s)wn?{x:s,y:y(t-s)wn?{x:y(e-g)wn?{x:h,y:y(t-h)wn?{x:y(e-p)=e&&c.x<=i&&c.y>=r&&c.y<=o?[[e,o],[i,o],[i,r],[e,r]]:[]).point=n[a]}),t}function a(n){return n.map(function(n,t){return{x:Math.round(r(n,t)/wn)*wn,y:Math.round(i(n,t)/wn)*wn,i:t}})}return o.links=function(n){return Ti(a(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},o.triangles=function(n){var t=[];return Ti(a(n)).cells.forEach(function(e,r){for(var i,u,o,a,l=e.site,c=e.edges.sort(xi),f=-1,s=c.length,h=c[s-1].edge,p=h.l===l?h.r:h.l;++fu&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:Hi(e,r)})),u=Yi.lastIndex;return uv&&(v=l.x),l.y>d&&(d=l.y),c.push(l.x),f.push(l.y);else for(s=0;sv&&(v=x),b>d&&(d=b),c.push(x),f.push(b)}var _=v-p,w=d-g;function S(n,t,e,r,i,u,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,c=n.y;if(null!=l)if(y(l-e)+y(c-r)<.01)k(n,t,e,r,i,u,o,a);else{var f=n.point;n.x=n.y=n.point=null,k(n,f,l,c,i,u,o,a),k(n,t,e,r,i,u,o,a)}else n.x=e,n.y=r,n.point=t}else k(n,t,e,r,i,u,o,a)}function k(n,t,e,r,i,u,o,a){var l=.5*(i+o),c=.5*(u+a),f=e>=l,s=r>=c,h=s<<1|f;n.leaf=!1,n=n.nodes[h]||(n.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(n){S(N,n,+m(n,++s),+M(n,s),p,g,v,d)}}),f?i=l:o=l,s?u=c:a=c,S(n,t,e,r,i,u,o,a)}_>w?d=g+_:v=p+w;var N={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(n){S(N,n,+m(n,++s),+M(n,s),p,g,v,d)}};if(N.visit=function(n){!function n(t,e,r,i,u,o){if(!t(e,r,i,u,o)){var a=.5*(r+u),l=.5*(i+o),c=e.nodes;c[0]&&n(t,c[0],r,i,a,l),c[1]&&n(t,c[1],a,i,u,l),c[2]&&n(t,c[2],r,l,a,o),c[3]&&n(t,c[3],a,l,u,o)}}(n,N,p,g,v,d)},N.find=function(n){return function(n,t,e,r,i,u,o){var a,l=1/0;return function n(c,f,s,h,p){if(!(f>u||s>o||h=b)<<1|t>=x,w=_+4;_=0&&!(r=n.interpolators[i](t,e)););return r}function Vi(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;e=1)return 1;var t=n*n,e=t*n;return 4*(n<.5?e:3*(n-t)+e-.75)}function nu(n){return 1-Math.cos(n*An)}function tu(n){return Math.pow(2,10*(n-1))}function eu(n){return 1-Math.sqrt(1-n*n)}function ru(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function iu(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function uu(n){var t,e,r,i=[n.a,n.b],u=[n.c,n.d],o=au(i),a=ou(i,u),l=au(((t=u)[0]+=(r=-a)*(e=i)[0],t[1]+=r*e[1],t))||0;i[0]*u[1]=0?n.slice(0,r):n,u=r>=0?n.slice(r+1):"in";return i=$i.get(i)||Xi,u=Bi.get(u)||z,e=u(i.apply(null,t.call(arguments,1))),function(n){return n<=0?0:n>=1?1:e(n)}},n.interpolateHcl=function(t,e){t=n.hcl(t),e=n.hcl(e);var r=t.h,i=t.c,u=t.l,o=e.h-r,a=e.c-i,l=e.l-u;isNaN(a)&&(a=0,i=isNaN(i)?e.c:i);isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360);return function(n){return $n(r+o*n,i+a*n,u+l*n)+""}},n.interpolateHsl=function(t,e){t=n.hsl(t),e=n.hsl(e);var r=t.h,i=t.s,u=t.l,o=e.h-r,a=e.s-i,l=e.l-u;isNaN(a)&&(a=0,i=isNaN(i)?e.s:i);isNaN(o)?(o=0,r=isNaN(r)?e.h:r):o>180?o-=360:o<-180&&(o+=360);return function(n){return Zn(r+o*n,i+a*n,u+l*n)+""}},n.interpolateLab=function(t,e){t=n.lab(t),e=n.lab(e);var r=t.l,i=t.a,u=t.b,o=e.l-r,a=e.a-i,l=e.b-u;return function(n){return nt(r+o*n,i+a*n,u+l*n)+""}},n.interpolateRound=iu,n.transform=function(t){var e=r.createElementNS(n.ns.prefix.svg,"g");return(n.transform=function(n){if(null!=n){e.setAttribute("transform",n);var t=e.transform.baseVal.consolidate()}return new uu(t?t.matrix:lu)})(t)},uu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var lu={a:1,b:0,c:0,d:1,e:0,f:0};function cu(n){return n.length?n.pop()+",":""}function fu(t,e){var r=[],i=[];return t=n.transform(t),e=n.transform(e),function(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push("translate(",null,",",null,")");r.push({i:i-4,x:Hi(n[0],t[0])},{i:i-2,x:Hi(n[1],t[1])})}else(t[0]||t[1])&&e.push("translate("+t+")")}(t.translate,e.translate,r,i),function(n,t,e,r){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(cu(e)+"rotate(",null,")")-2,x:Hi(n,t)})):t&&e.push(cu(e)+"rotate("+t+")")}(t.rotate,e.rotate,r,i),function(n,t,e,r){n!==t?r.push({i:e.push(cu(e)+"skewX(",null,")")-2,x:Hi(n,t)}):t&&e.push(cu(e)+"skewX("+t+")")}(t.skew,e.skew,r,i),function(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(cu(e)+"scale(",null,",",null,")");r.push({i:i-4,x:Hi(n[0],t[0])},{i:i-2,x:Hi(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(cu(e)+"scale("+t+")")}(t.scale,e.scale,r,i),t=e=null,function(n){for(var t,e=-1,u=i.length;++e0?r=n:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:r=0})):n>0&&(l.start({type:"start",alpha:r=n}),t=St(a.tick)),a):r},a.start=function(){var n,t,e,r=y.length,l=m.length,f=c[0],g=c[1];for(n=0;n=0;)e.push(i[r])}function Su(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++o=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;e&&(u.value=0),u.children=c}else e&&(u.value=+e.call(r,u,u.depth)||0),delete u.children;return Su(i,function(t){var r,i;n&&(r=t.children)&&r.sort(n),e&&(i=t.parent)&&(i.value+=t.value)}),a}return r.sort=function(t){return arguments.length?(n=t,r):n},r.children=function(n){return arguments.length?(t=n,r):t},r.value=function(n){return arguments.length?(e=n,r):e},r.revalue=function(n){return e&&(wu(n,function(n){n.children&&(n.value=0)}),Su(n,function(n){var t;n.children||(n.value=+e.call(r,n,n.depth)||0),(t=n.parent)&&(t.value+=n.value)})),n},r},n.layout.partition=function(){var t=n.layout.hierarchy(),e=[1,1];function r(n,r){var i=t.call(this,n,r);return function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++ca&&(a=r),o.push(r)}for(e=0;ei&&(r=e,i=t);return r}function ju(n){return n.reduce(Fu,0)}function Fu(n,t){return n+t[1]}function Hu(n,t){return Ou(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Ou(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function Iu(t){return[n.min(t),n.max(t)]}function Yu(n,t){return n.value-t.value}function Zu(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Vu(n,t){n._pack_next=t,t._pack_prev=n}function Xu(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function $u(n){if((t=n.children)&&(l=t.length)){var t,e,r,i,u,o,a,l,c=1/0,f=-1/0,s=1/0,h=-1/0;if(t.forEach(Bu),(e=t[0]).x=-e.r,e.y=0,M(e),l>1&&((r=t[1]).x=r.r,r.y=0,M(r),l>2))for(Ju(e,r,i=t[2]),M(i),Zu(e,i),e._pack_prev=i,Zu(i,r),r=e._pack_next,u=3;u0)for(o=-1;++o=s[0]&&l<=s[1]&&((a=c[n.bisect(h,l,1,g)-1]).y+=v,a.push(u[o]));return c}return u.value=function(n){return arguments.length?(e=n,u):e},u.range=function(n){return arguments.length?(r=dt(n),u):r},u.bins=function(n){return arguments.length?(i="number"==typeof n?function(t){return Ou(t,n)}:dt(n),u):i},u.frequency=function(n){return arguments.length?(t=!!n,u):t},u},n.layout.pack=function(){var t,e=n.layout.hierarchy().sort(Yu),r=0,i=[1,1];function u(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Su(a,function(n){n.r=+f(n.value)}),Su(a,$u),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;Su(a,function(n){n.r+=s}),Su(a,$u),Su(a,function(n){n.r-=s})}return function n(t,e,r,i){var u=t.children;t.x=e+=i*t.x;t.y=r+=i*t.y;t.r*=i;if(u)for(var o=-1,a=u.length;++op.x&&(p=n),n.depth>g.depth&&(g=n)});var v=e(h,p)/2-h.x,d=r[0]/(p.x+e(p,h)/2+v),y=r[1]/(g.depth||1);wu(f,function(n){n.x=(n.x+v)*d,n.y=n.depth*y})}return c}function o(n){var t=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(t.length){!function(n){var t,e=0,r=0,i=n.children,u=i.length;for(;--u>=0;)(t=i[u]).z+=e,t.m+=e,e+=t.s+(r+=t.c)}(n);var u=(t[0].z+t[t.length-1].z)/2;i?(n.z=i.z+e(n._,i._),n.m=n.z-u):n.z=u}else i&&(n.z=i.z+e(n._,i._));n.parent.A=function(n,t,r){if(t){for(var i,u=n,o=n,a=t,l=u.parent.children[0],c=u.m,f=o.m,s=a.m,h=l.m;a=Qu(a),u=Ku(u),a&&u;)l=Ku(l),(o=Qu(o)).a=n,(i=a.z+s-u.z-c+e(a._,u._))>0&&(no(to(a,n,r),n,i),c+=i,f+=i),s+=a.m,c+=u.m,h+=l.m,f+=o.m;a&&!Qu(o)&&(o.t=a,o.m+=s-f),u&&!Ku(l)&&(l.t=u,l.m+=c-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function l(n){n.x*=r[0],n.y=n.depth*r[1]}return u.separation=function(n){return arguments.length?(e=n,u):e},u.size=function(n){return arguments.length?(i=null==(r=n)?l:null,u):i?null:r},u.nodeSize=function(n){return arguments.length?(i=null==(r=n)?null:l,u):i?r:null},_u(u,t)},n.layout.cluster=function(){var t=n.layout.hierarchy().sort(null).value(null),e=Gu,r=[1,1],i=!1;function u(u,o){var a,l=t.call(this,u,o),c=l[0],f=0;Su(c,function(t){var r=t.children;r&&r.length?(t.x=function(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}(r),t.y=function(t){return 1+n.max(t,function(n){return n.y})}(r)):(t.x=a?f+=e(t,a):0,t.y=0,a=t)});var s=function n(t){var e=t.children;return e&&e.length?n(e[0]):t}(c),h=function n(t){var e,r=t.children;return r&&(e=r.length)?n(r[e-1]):t}(c),p=s.x-e(s,h)/2,g=h.x+e(h,s)/2;return Su(c,i?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-p)/(g-p)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),l}return u.separation=function(n){return arguments.length?(e=n,u):e},u.size=function(n){return arguments.length?(i=null==(r=n),u):i?null:r},u.nodeSize=function(n){return arguments.length?(i=null!=(r=n),u):i?r:null},_u(u,t)},n.layout.treemap=function(){var t,e=n.layout.hierarchy(),r=Math.round,i=[1,1],u=null,o=eo,a=!1,l="squarify",c=.5*(1+Math.sqrt(5));function f(n,t){for(var e,r,i=-1,u=n.length;++i0;)a.push(e=c[i-1]),a.area+=e.area,"squarify"!==l||(r=p(a,v))<=h?(c.pop(),h=r):(a.area-=a.pop().area,g(a,v,u,!1),v=Math.min(u.dx,u.dy),a.length=a.area=0,h=1/0);a.length&&(g(a,v,u,!0),a.length=a.area=0),t.forEach(s)}}function h(n){var t=n.children;if(t&&t.length){var e,r=o(n),i=t.slice(),u=[];for(f(i,r.dx*r.dy/n.value),u.area=0;e=i.pop();)u.push(e),u.area+=e.area,null!=e.z&&(g(u,e.z?r.dx:r.dy,r,!i.length),u.length=u.area=0);t.forEach(h)}}function p(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++oi&&(i=e));return t*=t,(r*=r)?Math.max(t*i*c/r,r/(t*u*c)):1/0}function g(n,t,e,i){var u,o=-1,a=n.length,l=e.x,c=e.y,f=t?r(n.area/t):0;if(t==e.dx){for((i||f>e.dy)&&(f=e.dy);++oe.dx)&&(f=e.dx);++o1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=n.random.normal.apply(n,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=n.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(n){return function(){for(var t=0,e=0;e2?fo:oo,a=i?hu:su;return u=n(t,e,a,r),o=n(e,t,a,Zi),l}function l(n){return u(n)}l.invert=function(n){return o(n)};l.domain=function(n){return arguments.length?(t=n.map(Number),a()):t};l.range=function(n){return arguments.length?(e=n,a()):e};l.rangeRound=function(n){return l.range(n).interpolate(iu)};l.clamp=function(n){return arguments.length?(i=n,a()):i};l.interpolate=function(n){return arguments.length?(r=n,a()):r};l.ticks=function(n){return go(t,n)};l.tickFormat=function(n,e){return vo(t,n,e)};l.nice=function(n){return ho(t,n),a()};l.copy=function(){return n(t,e,r,i)};return a()}([0,1],[0,1],Zi,!1)};var yo={s:1,g:1,p:1,r:1,e:1};function mo(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}n.scale.log=function(){return function t(e,r,i,u){function o(n){return(i?Math.log(n<0?0:n):-Math.log(n>0?0:-n))/Math.log(r)}function a(n){return i?Math.pow(r,n):-Math.pow(r,-n)}function l(n){return e(o(n))}l.invert=function(n){return a(e.invert(n))};l.domain=function(n){return arguments.length?(i=n[0]>=0,e.domain((u=n.map(Number)).map(o)),l):u};l.base=function(n){return arguments.length?(r=+n,e.domain(u.map(o)),l):r};l.nice=function(){var n=ao(u.map(o),i?Math:xo);return e.domain(n),u=n.map(a),l};l.ticks=function(){var n=io(u),t=[],e=n[0],l=n[1],c=Math.floor(o(e)),f=Math.ceil(o(l)),s=r%1?2:r;if(isFinite(f-c)){if(i){for(;c0;h--)t.push(a(c)*h);for(c=0;t[c]l;f--);t=t.slice(c,f)}return t};l.tickFormat=function(t,e){if(!arguments.length)return Mo;arguments.length<2?e=Mo:"function"!=typeof e&&(e=n.format(e));var i=Math.max(1,r*t/l.ticks().length);return function(n){var t=n/a(Math.round(o(n)));return t*r0?i[n-1]:e[0],ns?0:1;if(c=En)return l(c,p)+(a?l(a,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+o.apply(this,arguments)||0)/2)&&(d=r===Eo?Math.sqrt(a*a+c*c):+r.apply(this,arguments),p||(E*=-1),c&&(E=Rn(d/c*Math.sin(y))),a&&(N=Rn(d/a*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=kn?0:1;if(E&&To(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(a){_=a*Math.cos(s-N),w=a*Math.sin(s-N),S=a*Math.cos(f+N),k=a*Math.sin(f+N);var L=Math.abs(f-s+2*N)<=kn?0:1;if(N&&To(_,w,S,k)===1-p^L){var q=(f+s)/2;_=a*Math.cos(q),w=a*Math.sin(q),S=k=null}}else _=w=0;if(h>wn&&(g=Math.min(Math.abs(c-a)/2,+e.apply(this,arguments)))>.001){v=a0?0:1}function Ro(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(y<0?-1:1)*Math.sqrt(Math.max(0,M*M*m-x*x)),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Do(n){var t=Kr,e=Qr,r=Xe,i=Uo,u=i.key,o=.7;function a(u){var a,l=[],c=[],f=-1,s=u.length,h=dt(t),p=dt(e);function g(){l.push("M",i(n(c),o))}for(;++f1&&i.push("H",r[0]);return i.join("")},"step-before":Fo,"step-after":Ho,basis:Yo,"basis-open":function(n){if(n.length<4)return Uo(n);var t,e=[],r=-1,i=n.length,u=[0],o=[0];for(;++r<3;)t=n[r],u.push(t[0]),o.push(t[1]);e.push(Zo($o,u)+","+Zo($o,o)),--r;for(;++r9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));a=-1;for(;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}(n))}});function Uo(n){return n.length>1?n.join("L"):n+"Z"}function jo(n){return n.join("L")+"Z"}function Fo(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;ckn)+",1 "+t}function l(n,t,e,r){return"Q 0,0 "+r}return u.radius=function(n){return arguments.length?(e=dt(n),u):e},u.source=function(t){return arguments.length?(n=dt(t),u):n},u.target=function(n){return arguments.length?(t=dt(n),u):t},u.startAngle=function(n){return arguments.length?(r=dt(n),u):r},u.endAngle=function(n){return arguments.length?(i=dt(n),u):i},u},n.svg.diagonal=function(){var n=jr,t=Fr,e=Qo;function r(r,i){var u=n.call(this,r,i),o=t.call(this,r,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return"M"+(l=l.map(e))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return r.source=function(t){return arguments.length?(n=dt(t),r):n},r.target=function(n){return arguments.length?(t=dt(n),r):t},r.projection=function(n){return arguments.length?(e=n,r):e},r},n.svg.diagonal.radial=function(){var t=n.svg.diagonal(),e=Qo,r=t.projection;return t.projection=function(n){return arguments.length?r(function(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-An;return[e*Math.cos(r),e*Math.sin(r)]}}(e=n)):e},t},n.svg.symbol=function(){var n=ta,t=na;function e(e,r){return(ra.get(n.call(this,e,r))||ea)(t.call(this,e,r))}return e.type=function(t){return arguments.length?(n=dt(t),e):n},e.size=function(n){return arguments.length?(t=dt(n),e):t},e};var ra=n.map({circle:ea,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*ua)),e=t*ua;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/ia),e=t*ia/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/ia),e=t*ia/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});n.svg.symbolTypes=ra.keys();var ia=Math.sqrt(3),ua=Math.tan(30*Cn);X.transition=function(n){for(var t,e,r=ca||++ha,i=va(n),u=[],o=fa||{time:Date.now(),ease:Qi,delay:0,duration:250},a=-1,l=this.length;++a0;)c[--h].call(n,o);if(u>=1)return s.event&&s.event.end.call(n,n.__data__,t),--f.count?delete f[r]:delete n[e],1}s||(u=i.time,o=St(function(n){var t=s.delay;if(o.t=t+u,t<=n)return h(n-t);o.c=h},0,u),s=f[r]={tween:new M,time:u,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++f.count)}sa.call=X.call,sa.empty=X.empty,sa.node=X.node,sa.size=X.size,n.transition=function(t,e){return t&&t.transition?ca?t.transition(e):t:n.selection().transition(t)},n.transition.prototype=sa,sa.select=function(n){var t,e,r,i=this.id,u=this.namespace,o=[];n=$(n);for(var a=-1,l=this.length;++arect,.s>rect").attr("width",a[1]-a[0])}function v(n){n.select(".extent").attr("y",l[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function d(){var s,d,y=this,m=n.select(n.event.target),M=r.of(y,arguments),x=n.select(y),b=m.datum(),_=!/^(n|s)$/.test(b)&&i,w=!/^(e|w)$/.test(b)&&o,S=m.classed("extent"),k=Mn(y),N=n.mouse(y),E=n.select(u(y)).on("keydown.brush",function(){32==n.event.keyCode&&(S||(s=null,N[0]-=a[1],N[1]-=l[1],S=2),U())}).on("keyup.brush",function(){32==n.event.keyCode&&2==S&&(N[0]+=a[1],N[1]+=l[1],S=0,U())});if(n.event.changedTouches?E.on("touchmove.brush",z).on("touchend.brush",q):E.on("mousemove.brush",z).on("mouseup.brush",q),x.interrupt().selectAll("*").interrupt(),S)N[0]=a[0]-N[0],N[1]=l[0]-N[1];else if(b){var A=+/w$/.test(b),C=+/^n/.test(b);d=[a[1-A]-N[0],l[1-C]-N[1]],N[0]=a[A],N[1]=l[C]}else n.event.altKey&&(s=N.slice());function z(){var t=n.mouse(y),e=!1;d&&(t[0]+=d[0],t[1]+=d[1]),S||(n.event.altKey?(s||(s=[(a[0]+a[1])/2,(l[0]+l[1])/2]),N[0]=a[+(t[0]1?{floor:function(t){for(;a(t=n.floor(t));)t=Aa(t-1);return t},ceil:function(t){for(;a(t=n.ceil(t));)t=Aa(+t+1);return t}}:n))},i.ticks=function(n,t){var e=io(i.domain()),r=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return r&&(n=r[0],t=r[1]),n.range(e[0],Aa(+e[1]+1),t<1?1:t)},i.tickFormat=function(){return r},i.copy=function(){return Ea(t.copy(),e,r)},so(i,t)}function Aa(n){return new Date(n)}wa.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Na:ka,Na.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Na.toString=ka.toString,Tt.second=Ut(function(n){return new Rt(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Tt.seconds=Tt.second.range,Tt.seconds.utc=Tt.second.utc.range,Tt.minute=Ut(function(n){return new Rt(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Tt.minutes=Tt.minute.range,Tt.minutes.utc=Tt.minute.utc.range,Tt.hour=Ut(function(n){var t=n.getTimezoneOffset()/60;return new Rt(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Tt.hours=Tt.hour.range,Tt.hours.utc=Tt.hour.utc.range,Tt.month=Ut(function(n){return(n=Tt.day(n)).setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Tt.months=Tt.month.range,Tt.months.utc=Tt.month.utc.range;var Ca=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],za=[[Tt.second,1],[Tt.second,5],[Tt.second,15],[Tt.second,30],[Tt.minute,1],[Tt.minute,5],[Tt.minute,15],[Tt.minute,30],[Tt.hour,1],[Tt.hour,3],[Tt.hour,6],[Tt.hour,12],[Tt.day,1],[Tt.day,2],[Tt.week,1],[Tt.month,1],[Tt.month,3],[Tt.year,1]],La=wa.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Xe]]),qa={range:function(t,e,r){return n.range(Math.ceil(t/r)*r,+e,r).map(Aa)},floor:z,ceil:z};za.year=Tt.year,Tt.scale=function(){return Ea(n.scale.linear(),za,La)};var Ta=za.map(function(n){return[n[0].utc,n[1]]}),Ra=Sa.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Xe]]);function Da(n){return JSON.parse(n.responseText)}function Pa(n){var t=r.createRange();return t.selectNode(r.body),t.createContextualFragment(n.responseText)}Ta.year=Tt.year.utc,Tt.scale.utc=function(){return Ea(n.scale.linear(),Ta,Ra)},n.text=yt(function(n){return n.responseText}),n.json=function(n,t){return mt(n,"application/json",Da,t)},n.html=function(n,t){return mt(n,"text/html",Pa,t)},n.xml=yt(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=n,define(n)):"object"==typeof module&&module.exports?module.exports=n:this.d3=n}(); },{}],1:[function(require,module,exports) { -"use strict";var e=require("./venn"),t=a(e),n=require("d3"),s=a(n);function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}window.d3=s;var o=window.bundleEntries.chartUtilities.Datasets;_.extend(window.bundleEntries||{},{load:function(e){o.request({dataset_id:e.chart.get("dataset_id"),dataset_groups:e.chart.groups,success:function(n){var a=[],o=[],r={},i=[];_.each(n,function(e,t){var n={};_.each(e.values,function(e){r[e.observation]=n[e.observation]=!0}),a.push(e.key),o.push(n),i.push(t)});var u=[];!function e(t,n,s){_.each(n,function(a,o){var r=t.slice(),i=n.slice();i.splice(0,o+1),r.push(a),s.push(r),e(r,i,s)})}([],i,u);var c=[];_.each(u,function(e){var t=0;for(var n in r){var s=0;_.each(e,function(e){o[e][n]&&s++}),s==e.length&&t++}if(t>0){var i=[];_.each(e,function(e){i.push(a[e])}),c.push({sets:i,size:t})}});var l=s.select("#"+e.targets[0]).datum(c).call(t.VennDiagram()),p=null;l.selectAll("g").on("mouseover",function(e,n){t.sortAreas(l,e),(p=s.select("body").append("div").attr("class","venntooltip")).transition().duration(400).style("opacity",.9),p.text(e.size),s.select(this).transition("tooltip").duration(400).select("path").style("stroke-width",3).style("fill-opacity",1==e.sets.length?.4:.1).style("stroke-opacity",1)}).on("mousemove",function(){p.style("left",s.event.pageX+"px").style("top",s.event.pageY-28+"px")}).on("mouseout",function(e,t){p.remove()}),e.chart.state("ok","Venn diagram drawn."),e.process.resolve()}})}}); +"use strict";var t=require("./venn"),e=a(t),n=require("d3"),s=a(n);function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}window.d3=s;var o=window.bundleEntries.chartUtilities.Datasets;_.extend(window.bundleEntries||{},{load:function(t){o.request({chart:t.chart,dataset_id:t.chart.get("dataset_id"),dataset_groups:t.chart.groups,success:function(n){var a=[],o=[],r={},i=[];_.each(n,function(t,e){var n={};_.each(t.values,function(t){r[t.observation]=n[t.observation]=!0}),a.push(t.key),o.push(n),i.push(e)});var c=[];!function t(e,n,s){_.each(n,function(a,o){var r=e.slice(),i=n.slice();i.splice(0,o+1),r.push(a),s.push(r),t(r,i,s)})}([],i,c);var u=[];_.each(c,function(t){var e=0;for(var n in r){var s=0;_.each(t,function(t){o[t][n]&&s++}),s==t.length&&e++}if(e>0){var i=[];_.each(t,function(t){i.push(a[t])}),u.push({sets:i,size:e})}});var l=s.select("#"+t.targets[0]).datum(u).call(e.VennDiagram()),p=null;l.selectAll("g").on("mouseover",function(t,n){e.sortAreas(l,t),(p=s.select("body").append("div").attr("class","venntooltip")).transition().duration(400).style("opacity",.9),p.text(t.size),s.select(this).transition("tooltip").duration(400).select("path").style("stroke-width",3).style("fill-opacity",1==t.sets.length?.4:.1).style("stroke-opacity",1)}).on("mousemove",function(){p.style("left",s.event.pageX+"px").style("top",s.event.pageY-28+"px")}).on("mouseout",function(t,e){p.remove()}),t.chart.state("ok","Venn diagram drawn."),t.process.resolve()}})}}); },{"./venn":2,"d3":3}]},{},[1]) \ No newline at end of file diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index c77b764a514..440d53a7113 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -71,7 +71,7 @@ gone away", you will want to set this to some positive value (7200 should work). :Default: ``-1`` -:Type: str +:Type: int ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -443,7 +443,7 @@ scheme that may work in wider range of scenarios than the watchdog default. :Default: ``false`` -:Type: bool +:Type: str ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -608,7 +608,7 @@ which will use a less efficient monitoring scheme that may work in wider range of scenarios than the watchdog default. :Default: ``false`` -:Type: bool +:Type: str ~~~~~~~~~~~~~~~~~~~~ @@ -1546,20 +1546,8 @@ Redirect. This should be set to the path defined in the nginx config as an internal redirect with access to Galaxy's data files (see documentation linked above). -:Default: ``false`` -:Type: bool - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -``nginx_x_archive_files_base`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:Description: - nginx can make use of mod_zip to create zip files containing - multiple library files. If using X-Accel-Redirect, this can be - the same value as that option. -:Default: ``false`` -:Type: bool +:Default: ``None`` +:Type: str ~~~~~~~~~~~~~~~~~ @@ -1601,8 +1589,8 @@ explained in detail in the documentation linked above. The upload store is a temporary directory in which files uploaded by the upload module will be placed. -:Default: ``false`` -:Type: bool +:Default: ``None`` +:Type: str ~~~~~~~~~~~~~~~~~~~~~ @@ -1613,8 +1601,8 @@ This value overrides the action set on the file upload form, e.g. the web path where the nginx_upload_module has been configured to intercept upload requests. -:Default: ``false`` -:Type: bool +:Default: ``None`` +:Type: str ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1626,8 +1614,8 @@ out upon job completion by remote job runners (i.e. Pulsar) that initiate staging operations on the remote end. See the Galaxy nginx documentation for the corresponding nginx configuration. -:Default: ``false`` -:Type: bool +:Default: ``None`` +:Type: str ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1639,8 +1627,8 @@ out upon job completion by remote job runners (i.e. Pulsar) that initiate staging operations on the remote end. See the Galaxy nginx documentation for the corresponding nginx configuration. -:Default: ``false`` -:Type: bool +:Default: ``None`` +:Type: str ~~~~~~~~~~~~~~~~~~~~~ @@ -2169,6 +2157,19 @@ :Type: str +~~~~~~~~~~~~~~~~~~~ +``statsd_influxdb`` +~~~~~~~~~~~~~~~~~~~ + +:Description: + If you are using telegraf to collect these metrics and then + sending them to InfluxDB, Galaxy can provide more nicely tagged + metrics. Instead of sending prefix + dot-separated-path, Galaxy + will send prefix with a tag path set to the page url +:Default: ``false`` +:Type: bool + + ~~~~~~~~~~~~~~~~~ ``graphite_host`` ~~~~~~~~~~~~~~~~~ @@ -3422,6 +3423,38 @@ :Type: str +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``workflow_resource_params_file`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:Description: + Similar to the above parameter, workflows can describe parameters + used to influence scheduling of jobs within the workflow. This + requires both a description of the fields available (which + defaults to the definitions in job_resource_params_file if not + set). +:Default: ``config/workflow_resource_params_conf.xml`` +:Type: str + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``workflow_resource_params_mapper`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:Description: + This parameter describes how to map users and workflows to a set + of workflow resource parameter to present (typically input IDs + from workflow_resource_params_file). If this this is a function + reference it will be passed various inputs (workflow model object + and user) and it should produce a list of input IDs. If it is a + path it is expected to an XML or YAML file describing how to map + group names to parameter descriptions (additional types of + mappings via these files could be implemented but haven't yet - + for instance using workflow tags to do the mapping). +:Default: ``config/workflow_resource_mapper_conf.yml`` +:Type: str + + ~~~~~~~~~~~~~~~~~~~~~~~~ ``cache_user_job_count`` ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/source/releases/18.01_announce.rst b/doc/source/releases/18.01_announce.rst index c6b00ecff6d..e2032f067bb 100644 --- a/doc/source/releases/18.01_announce.rst +++ b/doc/source/releases/18.01_announce.rst @@ -14,10 +14,8 @@ Highlights **Web Server and Configuration** The default web server used by Galaxy has changed from Paste to `uWSGI `__ and the default configuration file for Galaxy is now ``config/galaxy.yml`` instead of ``config/galaxy.ini``. - uWSGI is more production ready and allows Galaxy to scale better in its default - configuration. In the future uWSGI will allow Galaxy to setup GIE proxies without additional - configuration and use modern web technologies such as web sockets. - Read more about the server, configuration, and documentation changes in the `uWSGI details`_ section of this document. + To minimize the impact of this change on existing Galaxy instances, if a Galaxy has a ``galaxy.ini`` file configured, it will continue to use Paste by default unless additional steps are taken by the administrator. + uWSGI is more production ready and allows Galaxy to scale better in its default configuration. Read more about the server, configuration, and documentation changes in the `uWSGI details`_ section of this document. **Dataset Collection Usability** This release has significantly improved the usability of Galaxy dataset collections. Dozens of improvements @@ -78,7 +76,7 @@ To get a new Galaxy repository run: To update an existing Galaxy repository run: .. code-block:: shell - $ git checkout release_18.01 && git pull --ff-only origin release_18.01 + $ git fetch origin && git checkout release_18.01 && git pull --ff-only origin release_18.01 See the `community hub `__ for additional details regarding the source code locations. @@ -128,17 +126,16 @@ In addition to that, the PlantTribes datatypes have been commented out in the so uWSGI details ============= - -To minimize the impact of this change on existing Galaxy instances, if a Galaxy has a ``galaxy.ini`` -file configured, it will continue to use Paste by default unless additional steps are -taken by the administrator (Galaxy can be forced to start under uWSGI even with an older configuration file -by setting ``APP_WEBSERVER=uwsgi`` in the environment). As part of the transition to YAML-based +Galaxy can be forced to start under uWSGI even with an older configuration file +by setting ``APP_WEBSERVER=uwsgi`` in the environment. As part of the transition to YAML-based configuration files, we have implemented a schema to validate Galaxy configuration files. Run ``make config-validate`` from Galaxy's root directory to validate a schema and ``make config-lint`` to check for best practices. While there is no need to convert your configuration file (``galaxy.ini`` hasn't been deprecated), you can run ``make config-convert-dry-run`` and ``make config-convert`` to respectively test and perform the conversion of an ``ini`` configuration file to a YAML one. +In the future uWSGI will allow Galaxy to setup GIE proxies without additional configuration and use modern web technologies such as web sockets. + These are big changes that affect many parts of Galaxy's administration documentation and makes this documentation very dependent on which Galaxy version they are targeting. To address this, we have moved a significant amount of administration documentation into Galaxy's code diff --git a/lib/galaxy/auth/providers/ldap_ad.py b/lib/galaxy/auth/providers/ldap_ad.py index 0fddc3a0875..477ee8fd3e3 100644 --- a/lib/galaxy/auth/providers/ldap_ad.py +++ b/lib/galaxy/auth/providers/ldap_ad.py @@ -165,7 +165,7 @@ class LDAP(AuthProvider): log.debug(("LDAP authenticate: search attributes are %s" % attrs)) if hasattr(attrs, 'has_key'): for attr in attributes: - if attr == self.role_search_attribute[1:-1]: # strip brackets + if self.role_search_attribute and attr == self.role_search_attribute[1:-1]: # strip brackets # keep role names as list params[self.role_search_option] = attrs[attr] elif attr in attrs: diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index 1f054d552df..885c51878b3 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -514,7 +514,6 @@ class Configuration(object): self.upstream_gzip = string_as_bool(kwargs.get('upstream_gzip', False)) self.apache_xsendfile = string_as_bool(kwargs.get('apache_xsendfile', False)) self.nginx_x_accel_redirect_base = kwargs.get('nginx_x_accel_redirect_base', False) - self.nginx_x_archive_files_base = kwargs.get('nginx_x_archive_files_base', False) self.nginx_upload_store = kwargs.get('nginx_upload_store', False) self.nginx_upload_path = kwargs.get('nginx_upload_path', False) self.nginx_upload_job_files_store = kwargs.get('nginx_upload_job_files_store', False) @@ -637,6 +636,7 @@ class Configuration(object): self.statsd_host = kwargs.get('statsd_host', '') self.statsd_port = int(kwargs.get('statsd_port', 8125)) self.statsd_prefix = kwargs.get('statsd_prefix', 'galaxy') + self.statsd_influxdb = string_as_bool(kwargs.get('statsd_influxdb', False)) # Statistics and profiling with graphite self.graphite_host = kwargs.get('graphite_host', '') self.graphite_port = int(kwargs.get('graphite_port', 2003)) diff --git a/lib/galaxy/datatypes/converters/bed_gff_or_vcf_to_bigwig_converter.xml b/lib/galaxy/datatypes/converters/bed_gff_or_vcf_to_bigwig_converter.xml index 3a2c28cf6fa..53a815b8de7 100644 --- a/lib/galaxy/datatypes/converters/bed_gff_or_vcf_to_bigwig_converter.xml +++ b/lib/galaxy/datatypes/converters/bed_gff_or_vcf_to_bigwig_converter.xml @@ -1,4 +1,4 @@ -