UNPKG

@hpcc-js/composite

Version:
1 lines 54.3 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/api"),require("@hpcc-js/layout"),require("@hpcc-js/form"),require("@hpcc-js/other")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/api","@hpcc-js/layout","@hpcc-js/form","@hpcc-js/other"],e):e(t["@hpcc-js/composite"]={},t["@hpcc-js/common"],t["@hpcc-js/api"],t["@hpcc-js/layout"],t["@hpcc-js/form"],t["@hpcc-js/other"])}(this,function(t,b,e,r,n,a){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function l(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o="$";function s(){}function h(t,e){var r=new s;if(t instanceof s)t.each(function(t,e){r.set(e,t)});else if(Array.isArray(t)){var i,n=-1,o=t.length;if(null==e)for(;++n<o;)r.set(n,t[n]);else for(;++n<o;)r.set(e(i=t[n],n,t),i)}else if(t)for(var a in t)r.set(a,t[a]);return r}function p(){}s.prototype=h.prototype={constructor:s,has:function(t){return o+t in this},get:function(t){return this[o+t]},set:function(t,e){return this[o+t]=e,this},remove:function(t){var e=o+t;return e in this&&delete this[e]},clear:function(){for(var t in this)t[0]===o&&delete this[t]},keys:function(){var t=[];for(var e in this)e[0]===o&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)e[0]===o&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)e[0]===o&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)e[0]===o&&++t;return t},empty:function(){for(var t in this)if(t[0]===o)return!1;return!0},each:function(t){for(var e in this)e[0]===o&&t(this[e],e.slice(1),this)}};var c=h.prototype;function u(e){return new Promise(function(r,t){var i=b.Utility.parseClassID(e);require&&require([i.package],function(t){var e=null;t&&t[i.widgetID]&&(e=t[i.widgetID]),r(i.memberWidgetID?e.prototype?e.prototype[i.memberWidgetID]:e[i.memberWidgetID]:e)})})}p.prototype=function(t,e){var r=new p;if(t instanceof p)t.each(function(t){r.add(t)});else if(t){var i=-1,n=t.length;if(null==e)for(;++i<n;)r.add(t[i]);else for(;++i<n;)r.add(e(t[i],i,t))}return r}.prototype={constructor:p,has:c.has,add:function(t){return this[o+(t+="")]=t,this},remove:c.remove,clear:c.clear,values:c.keys,size:c.size,empty:c.empty,each:c.each};var d=Object.freeze({requireWidget:u,requireWidgets:function(t){return Promise.all(t.map(u))}}),f=function(s){function t(){var t=s.call(this)||this;return t._allCharts={},e.INDChart.call(t),e.IGraph.call(t),t._tag="div",t._allCharts={},t._allChartTypes.forEach(function(t){var e=JSON.parse(JSON.stringify(t));e.widget=null,this._allCharts[t.id]=e,this._allCharts[t.display]=e,this._allCharts[t.widgetClass]=e},t),t._chartTypeDefaults={},t._chartTypeProperties={},t}return l(t,s),t.prototype.fields=function(t){var e=s.prototype.fields.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().fields();this.chart().fields(t)}return e},t.prototype.columns=function(t,e){var r=b.HTMLWidget.prototype.columns.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().columns();this.chart().columns(t,e)}return r},t.prototype.data=function(t){var e=b.HTMLWidget.prototype.data.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().data();this.chart().data(t)}return e},t.prototype.hasOverlay=function(){return this.chart()&&this.chart().hasOverlay()},t.prototype.visible=function(t){return arguments.length?(this.chart()&&this.chart().visible(t),this):this.chart()&&this.chart().visible()},t.prototype.chartTypeDefaults=function(t){return arguments.length?(this._chartTypeDefaults=t,this):this._chartTypeDefaults},t.prototype.chartTypeProperties=function(t){return arguments.length?(this._chartTypeProperties=t,this):this._chartTypeProperties},t.prototype.getChartDataFamily=function(){return this._allCharts[this.chartType()].family},t.prototype.requireContent=function(t,e){var r=b.Utility.parseClassID(this._allCharts[t].widgetClass);switch(r.package){case"@hpcc-js/chart":require(["@hpcc-js/chart"],function(t){e(new t[r.widgetID])});break;case"@hpcc-js/dgrid":require(["@hpcc-js/dgrid"],function(t){e(new t[r.widgetID])});break;default:u(this._allCharts[t].widgetClass).then(function(t){e(new t)})}},t.prototype.switchChart=function(r){if(this._switchingTo!==this.chartType()){this._switchingTo&&console.log("Attempting switch to: "+this.chartType()+", before previous switch is complete ("+this._switchingTo+")"),this._switchingTo=this.chartType();var i=this.chart(),n=this;this.requireContent(this.chartType(),function(t){if(t!==i){var e=n.size();t.fields(n.fields()).data(n.data()).size(e),n.chart(t),i&&i.size({width:1,height:1}).render()}delete n._switchingTo,r&&r(this)})}else r&&r(this)},t.prototype.update=function(t,e){s.prototype.update.call(this,t,e);var r=e.selectAll(".multiChart").data(this.chart()?[this.chart()]:[],function(t){return t._id});r.enter().append("div").attr("class","multiChart").each(function(t){t.target(this)});var i=this.chart();if(i){for(var n in this._chartTypeDefaults)if(i[n+"_default"])try{i[n+"_default"](this._chartTypeDefaults[n])}catch(t){console.log("Exception Setting Default: "+n)}else console.log("Unknown Default: "+n);for(var o in this._chartTypeDefaults={},this._chartTypeProperties)if(i[o])try{i[o](this._chartTypeProperties[o])}catch(t){console.log("Exception Setting Property: "+o)}else console.log("Unknown Property: "+o);this._chartTypeProperties={}}var a=this;r.each(function(t){t.resize(a.size())}),r.exit().transition().each(function(t){t.target(null)}).remove()},t.prototype.exit=function(t,e){this._chartMonitor&&(this._chartMonitor.remove(),delete this._chartMonitor),this.chart()&&this.chart().target(null),s.prototype.exit.call(this,t,e)},t.prototype.render=function(t){if(!this.chartType()||this.chart()&&this.chart().classID()===this._allCharts[this.chartType()].widgetClass)return b.HTMLWidget.prototype.render.apply(this,arguments);var e=this,r=arguments;return this.switchChart(function(){b.HTMLWidget.prototype.render.apply(e,r)}),this},t}(b.HTMLWidget);f.prototype._class+=" composite_MultiChart",f.prototype.implements(e.INDChart.prototype),f.prototype.implements(e.IGraph.prototype),f.prototype._otherChartTypes=[{id:"FORM",display:"Form",widgetClass:"form_FieldForm"}].map(function(t){return t.family="other",t}),f.prototype._graphChartTypes=[{id:"GRAPH",display:"Graph",widgetClass:"graph_Graph"},{id:"ADJACENCY_GRAPH",display:"Graph",widgetClass:"graph_AdjacencyGraph"},{id:"GRAPHC",display:"GraphC",widgetClass:"graph_GraphC"}].map(function(t){return t.family="GRAPH",t}),f.prototype._1DChartTypes=[].map(function(t){return t.family="1D",t}),f.prototype._2DChartTypes=[{id:"SUMMARY",display:"Summary",widgetClass:"chart_Summary"},{id:"BUBBLE",display:"Bubble",widgetClass:"chart_Bubble"},{id:"PIE",display:"Pie",widgetClass:"chart_Pie"},{id:"WORD_CLOUD",display:"Word Cloud",widgetClass:"other_WordCloud"}].map(function(t){return t.family="2D",t}),f.prototype._NDChartTypes=[{id:"COLUMN",display:"Column",widgetClass:"chart_Column"},{id:"BAR",display:"Bar",widgetClass:"chart_Bar"},{id:"LINE",display:"Line",widgetClass:"chart_Line"},{id:"AREA",display:"Area",widgetClass:"chart_Area"},{id:"STEP",display:"Step",widgetClass:"chart_Step"},{id:"SCATTER",display:"Scatter",widgetClass:"chart_Scatter"},{id:"HEXBIN",display:"Hex Bin",widgetClass:"chart_HexBin"}].map(function(t){return t.family="ND",t}),f.prototype._mapChartTypes=[{id:"CHORO_USSTATES",display:"US State Choropleth",widgetClass:"map_ChoroplethStates"},{id:"CHORO_USCOUNTIES",display:"US County Choropleth",widgetClass:"map_ChoroplethCounties"},{id:"CHORO_COUNTRIES",display:"Country Choropleth",widgetClass:"map_ChoroplethCountries"},{id:"GMAP_CHORO_USCOUNTIES",display:"Google Map US County Choropleth",widgetClass:"map_GMapCounties"},{id:"GOOGLE_MAP",display:"Google Map",widgetClass:"map_GMapLayered"},{id:"OPENSTREET",display:"Open Street Map",widgetClass:"map_OpenStreet"}].map(function(t){return t.family="map",t}),f.prototype._anyChartTypes=[{id:"TABLE",display:"Table",widgetClass:"dgrid_Table"},{id:"TABLE_LEGACY",display:"Table (legacy)",widgetClass:"other_Table"},{id:"TABLE_NESTED",display:"Nested Table",widgetClass:"other_NestedTable"},{id:"TABLE_CALENDAR",display:"Table driven Calendar Heat Map",widgetClass:"other_CalendarHeatMap"},{id:"TABLE_BULLET",display:"Table driven bullet chart",widgetClass:"chart_Bullet"},{id:"TABLE_SELECT",display:"Table driven select",widgetClass:"other_Select"},{id:"TABLE_AUTOCOMPLETE",display:"Table driven auto complete",widgetClass:"other_AutoCompleteText"},{id:"TABLE_OPPORTUNITY",display:"Table driven opportunity widget",widgetClass:"graph_Opportunity"},{id:"TABLE_TREE",display:"Table driven tree",widgetClass:"tree_Dendrogram"},{id:"TABLE_TREEMAP",display:"Table driven Treemap",widgetClass:"tree_Treemap"},{id:"TABLE_SANKEY",display:"Table driven Sankey",widgetClass:"graph_Sankey"},{id:"TABLE_GMAP_PIN",display:"Table driven Google Map (pins)",widgetClass:"map_GMapPin"},{id:"TABLE_GMAP_PINLINE",display:"Table driven Google Map (pins/lines)",widgetClass:"map_GMapPinLine"},{id:"TABLE_XML_TREE",display:"Table driven XML Tree",widgetClass:"tree_Indented"}].map(function(t){return t.family="any",t}),f.prototype._allChartTypes=f.prototype._otherChartTypes.concat(f.prototype._graphChartTypes.concat(f.prototype._1DChartTypes.concat(f.prototype._2DChartTypes.concat(f.prototype._NDChartTypes.concat(f.prototype._mapChartTypes.concat(f.prototype._anyChartTypes)))))),f.prototype._allMap=h(f.prototype._allChartTypes,function(t){return t.family}),f.prototype._allFamilies=f.prototype._allMap.keys(),f.prototype._allChartTypesMap={},f.prototype._allChartTypesByClass={},f.prototype._allChartTypes.forEach(function(t){t.widgetPath=b.Utility.widgetPath(t.widgetClass),f.prototype._allChartTypesMap[t.id]=t,f.prototype._allChartTypesByClass[t.widgetClass]=t}),f.prototype.publishReset(),f.prototype.publish("chartType","BUBBLE","set","Chart Type",f.prototype._allChartTypes.map(function(t){return t.id}),{tags:["Basic"]}),f.prototype.publish("chart",null,"widget","Chart",null,{tags:["Basic"]});var y=f.prototype.chart;function _(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}f.prototype.chart=function(i){var t=y.apply(this,arguments);if(arguments.length){var n=this;this._allChartTypesByClass[i.classID()]?this.chartType(this._allChartTypesByClass[i.classID()].id):console.log("Unknown Class ID: "+i.classID()),i.click=function(t,e,r){n.click.apply(n,arguments)},i.dblclick=function(t,e,r){n.dblclick.apply(n,arguments)},i.vertex_click=function(t,e,r,i){n.vertex_click.apply(n,arguments)},i.vertex_dblclick=function(t,e,r,i){n.vertex_dblclick.apply(n,arguments)},i.edge_click=function(t,e,r,i){n.edge_click.apply(n,arguments)},i.edge_dblclick=function(t,e,r,i){n.edge_dblclick.apply(n,arguments)},this._chartMonitor&&(this._chartMonitor.remove(),delete this._chartMonitor),this._chartMonitor=i.monitor(function(t,e,r){n.broadcast(t,e,r,i)})}return t};_(".composite_ChartPanel > .body {\r\n margin: 0;\r\n padding: 0;\r\n display: flex;\r\n flex-flow: row;\r\n}\r\n\r\n.composite_ChartPanel > .body > article {\r\n flex: 3 1 60%;\r\n order: 2;\r\n}\r\n\r\n.composite_ChartPanel > .body > nav {\r\n flex: 1 6 20%;\r\n order: 1;\r\n}\r\n\r\n.composite_ChartPanel > .body > aside {\r\n margin-left: 4px;\r\n flex: 1 6 20%;\r\n order: 3;\r\n}\r\n\r\nheader, footer {\r\n display: block;\r\n}\r\n"),function(r){function t(){return r.call(this)||this}return l(t,r),t.prototype.enter=function(t,e){r.prototype.enter.call(this,t,e),e.append("p")},t.prototype.update=function(t,e){r.prototype.update.call(this,t,e),e.select("p").text(this.text())},t}(b.HTMLWidget).prototype.publish("text","","string");var g=function(r){function t(){var t=r.call(this)||this;return t.widget((new f).chartType("COLUMN")),t}return l(t,r),t.prototype.multiChart=function(){return this._widget},t.prototype.chartType=function(t){return arguments.length?(this._widget.chartType(t),this):this._widget.chartType()},t.prototype.chart=function(t){return arguments.length?(this._widget.chart(t),this):this._widget.chart()},t.prototype.chartTypeDefaults=function(t){return arguments.length?(this._widget.chartTypeDefaults(t),this):this._widget.chartTypeDefaults()},t.prototype.chartTypeProperties=function(t){return arguments.length?(this._widget.chartTypeProperties(t),this):this._widget.chartTypeProperties()},t.prototype.update=function(t,e){r.prototype.update.call(this,t,e),this._widget instanceof f&&this._legend.dataFamily(this._widget.getChartDataFamily()),r.prototype.update.call(this,t,e)},t}(r.ChartPanel);g.prototype._class+=" composite_MultiChartPanel";_(".composite_Dermatology {\r\n background-color: ghostwhite;\r\n}\r\n\r\n.composite_Dermatology .common_Icon {\r\n background-color: red;\r\n opacity:0.75;\r\n}\r\n\r\n.composite_Dermatology .common_Icon .common_Shape {\r\n fill: white;\r\n stroke: darkgray;\r\n cursor:pointer;\r\n}\r\n\r\n.composite_Dermatology .common_Icon.show .common_Shape {\r\n fill: lightgray;\r\n}\r\n\r\n.composite_Dermatology .common_Icon .common_FAChar .common_Text {\r\n fill: darkgray;\r\n cursor:pointer;\r\n}\r\n\r\n.composite_Dermatology .other_PropertyEditor {\r\n font-family: sans-serif;\r\n font-size: 11px;\r\n}\r\n\r\n.composite_Dermatology .other_PropertyEditor input {\r\n font-family: sans-serif;\r\n font-size: 11px;\r\n border:0px;\r\n}\r\n\r\n.composite_Dermatology .other_PropertyEditor .property-label {\r\n height:unset;\r\n}\r\n");var m=function(i){function t(){var t=i.call(this)||this;return t._toolbar=(new r.Toolbar).title("Dermatology"),t._propEditor=(new a.PropertyEditor).show_settings(!0),t}return l(t,i),t.prototype.showProperties=function(t){if(!arguments.length)return this._showProperties;this._showProperties=t,this.rightPercentage(0).rightSize(this._showProperties?360:0).setContent("right",this._showProperties?this._propEditor:null);var e=this.widget();return e&&e.designMode&&e.designMode(this._showProperties),this},t.prototype.toggleProperties=function(){return this.showProperties(!this.showProperties())},t.prototype.enter=function(t,e){i.prototype.enter.call(this,t,e),this.topPercentage(0).topSize(0).setContent("top",this._toolbar),this.getCell("top").surfaceShadow(!0);var r=this;this._propsButton=(new n.OnOff).id(this.id()+"_props").value("Properties").on("click",function(){r.toggleProperties().render()}),this._toolbar.widgets([this._propsButton])},t.prototype.update=function(t,e){this.topPercentage(0).topSize(this.showToolbar()?32:0),i.prototype.update.call(this,t,e);var r=this.widget();e.style("background-color",r&&r.surfaceShadow?null:"white")},t.prototype.render=function(t){var e=this.widget();return e!==this._prevWidget&&(e&&e.surfaceShadow&&e.surfaceBackgroundColor_default("white"),this.setContent("center",e),this._propEditor.widget(e),this._prevWidget=e),i.prototype.render.call(this,t)},t}(r.Border);m.prototype._class+=" composite_Dermatology",m.prototype.publish("showToolbar",!0,"boolean","Show Toolbar"),m.prototype.publish("widget",null,"widget","Widget");var w={value:function(){}};function v(){for(var t,e=0,r=arguments.length,i={};e<r;++e){if(!(t=arguments[e]+"")||t in i)throw new Error("illegal type: "+t);i[t]=[]}return new C(i)}function C(t){this._=t}function T(t,e){for(var r,i=0,n=t.length;i<n;++i)if((r=t[i]).name===e)return r.value}function x(t,e,r){for(var i=0,n=t.length;i<n;++i)if(t[i].name===e){t[i]=w,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}C.prototype=v.prototype={constructor:C,on:function(t,e){var r,i,n=this._,o=(i=n,(t+"").trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(0<=r&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(r=(t=o[a]).type)n[r]=x(n[r],t.name,e);else if(null==e)for(r in n)n[r]=x(n[r],t.name,null);return this}for(;++a<s;)if((r=(t=o[a]).type)&&(r=T(n[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new C(t)},call:function(t,e){if(0<(r=arguments.length-2))for(var r,i,n=new Array(r),o=0;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,r=(i=this._[t]).length;o<r;++o)i[o].value.apply(e,n)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],n=0,o=i.length;n<o;++n)i[n].value.apply(e,r)}};var k,S,P=0,M=0,E=0,N=1e3,A=0,B=0,D=0,I="object"==typeof performance&&performance.now?performance:Date,O="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function z(){return B||(O(L),B=I.now()+D)}function L(){B=0}function F(){this._call=this._time=this._next=null}function j(t,e,r){var i=new F;return i.restart(t,e,r),i}function R(){B=(A=I.now())+D,P=M=0;try{!function(){z(),++P;for(var t,e=k;e;)0<=(t=B-e._time)&&e._call.call(null,t),e=e._next;--P}()}finally{P=0,function(){var t,e,r=k,i=1/0;for(;r;)r=r._call?(i>r._time&&(i=r._time),(t=r)._next):(e=r._next,r._next=null,t?t._next=e:k=e);S=t,G(i)}(),B=0}}function U(){var t=I.now(),e=t-A;N<e&&(D-=e,A=t)}function G(t){if(!P){M&&(M=clearTimeout(M));var e=t-B;24<e?(t<1/0&&(M=setTimeout(R,e)),E&&(E=clearInterval(E))):(E||(A=B,E=setInterval(U,N)),P=1,O(R))}}function H(e,r,t){var i=new F;return r=null==r?0:+r,i.restart(function(t){i.stop(),e(t+r)},r,t),i}F.prototype=j.prototype={constructor:F,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?z():+r)+(null==e?0:+e),this._next||S===this||(S?S._next=this:k=this,S=this),this._call=t,this._time=r,G()},stop:function(){this._call&&(this._call=null,this._time=1/0,G())}};var q=v("start","end","interrupt"),W=[],V=0,X=1,Y=2,J=3,$=4,K=5,Q=6;function Z(t,e,r,i,n,o){var a=t.__transition;if(a){if(r in a)return}else t.__transition={};!function(o,a,s){var l,h=o.__transition;function p(t){var e,r,i,n;if(s.state!==X)return u();for(e in h)if((n=h[e]).name===s.name){if(n.state===J)return H(p);n.state===$?(n.state=Q,n.timer.stop(),n.on.call("interrupt",o,o.__data__,n.index,n.group),delete h[e]):+e<a&&(n.state=Q,n.timer.stop(),delete h[e])}if(H(function(){s.state===J&&(s.state=$,s.timer.restart(c,s.delay,s.time),c(t))}),s.state=Y,s.on.call("start",o,o.__data__,s.index,s.group),s.state===Y){for(s.state=J,l=new Array(i=s.tween.length),e=0,r=-1;e<i;++e)(n=s.tween[e].value.call(o,o.__data__,s.index,s.group))&&(l[++r]=n);l.length=r+1}}function c(t){for(var e=t<s.duration?s.ease.call(null,t/s.duration):(s.timer.restart(u),s.state=K,1),r=-1,i=l.length;++r<i;)l[r].call(null,e);s.state===K&&(s.on.call("end",o,o.__data__,s.index,s.group),u())}function u(){for(var t in s.state=Q,s.timer.stop(),delete h[a],h)return;delete o.__transition}(h[a]=s).timer=j(function(t){s.state=X,s.timer.restart(p,s.delay,s.time),s.delay<=t&&p(t-s.delay)},0,s.time)}(t,r,{name:e,index:i,group:n,on:q,tween:W,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:V})}function tt(t,e){var r=t.__transition;if(!r||!(r=r[e])||r.state>V)throw new Error("too late");return r}function et(t,e){var r=t.__transition;if(!r||!(r=r[e])||r.state>Y)throw new Error("too late");return r}function rt(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("too late");return r}function it(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function nt(t,e){var r=Object.create(t.prototype);for(var i in e)r[i]=e[i];return r}function ot(){}var at=1/.7,st="\\s*([+-]?\\d+)\\s*",lt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ht="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pt=/^#([0-9a-f]{3})$/,ct=/^#([0-9a-f]{6})$/,ut=new RegExp("^rgb\\("+[st,st,st]+"\\)$"),dt=new RegExp("^rgb\\("+[ht,ht,ht]+"\\)$"),ft=new RegExp("^rgba\\("+[st,st,st,lt]+"\\)$"),yt=new RegExp("^rgba\\("+[ht,ht,ht,lt]+"\\)$"),_t=new RegExp("^hsl\\("+[lt,ht,ht]+"\\)$"),gt=new RegExp("^hsla\\("+[lt,ht,ht,lt]+"\\)$"),mt={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 wt(t){var e;return t=(t+"").trim().toLowerCase(),(e=pt.exec(t))?new xt((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=ct.exec(t))?vt(parseInt(e[1],16)):(e=ut.exec(t))?new xt(e[1],e[2],e[3],1):(e=dt.exec(t))?new xt(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ft.exec(t))?bt(e[1],e[2],e[3],e[4]):(e=yt.exec(t))?bt(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=_t.exec(t))?St(e[1],e[2]/100,e[3]/100,1):(e=gt.exec(t))?St(e[1],e[2]/100,e[3]/100,e[4]):mt.hasOwnProperty(t)?vt(mt[t]):"transparent"===t?new xt(NaN,NaN,NaN,0):null}function vt(t){return new xt(t>>16&255,t>>8&255,255&t,1)}function bt(t,e,r,i){return i<=0&&(t=e=r=NaN),new xt(t,e,r,i)}function Ct(t){return t instanceof ot||(t=wt(t)),t?new xt((t=t.rgb()).r,t.g,t.b,t.opacity):new xt}function Tt(t,e,r,i){return 1===arguments.length?Ct(t):new xt(t,e,r,null==i?1:i)}function xt(t,e,r,i){this.r=+t,this.g=+e,this.b=+r,this.opacity=+i}function kt(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function St(t,e,r,i){return i<=0?t=e=r=NaN:r<=0||1<=r?t=e=NaN:e<=0&&(t=NaN),new Pt(t,e,r,i)}function Pt(t,e,r,i){this.h=+t,this.s=+e,this.l=+r,this.opacity=+i}function Mt(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}it(ot,wt,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),it(xt,Tt,nt(ot,{brighter:function(t){return t=null==t?at:Math.pow(at,t),new xt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new xt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+kt(this.r)+kt(this.g)+kt(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),it(Pt,function(t,e,r,i){return 1===arguments.length?function(t){if(t instanceof Pt)return new Pt(t.h,t.s,t.l,t.opacity);if(t instanceof ot||(t=wt(t)),!t)return new Pt;if(t instanceof Pt)return t;var e=(t=t.rgb()).r/255,r=t.g/255,i=t.b/255,n=Math.min(e,r,i),o=Math.max(e,r,i),a=NaN,s=o-n,l=(o+n)/2;return s?(a=e===o?(r-i)/s+6*(r<i):r===o?(i-e)/s+2:(e-r)/s+4,s/=l<.5?o+n:2-o-n,a*=60):s=0<l&&l<1?0:a,new Pt(a,s,l,t.opacity)}(t):new Pt(t,e,r,null==i?1:i)},nt(ot,{brighter:function(t){return t=null==t?at:Math.pow(at,t),new Pt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Pt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*e,n=2*r-i;return new xt(Mt(240<=t?t-240:t+120,n,i),Mt(t,n,i),Mt(t<120?t+240:t-120,n,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Et=Math.PI/180,Nt=180/Math.PI,At=.96422,Bt=1,Dt=.82521,It=4/29,Ot=6/29,zt=3*Ot*Ot,Lt=Ot*Ot*Ot;function Ft(t){if(t instanceof jt)return new jt(t.l,t.a,t.b,t.opacity);if(t instanceof qt){if(isNaN(t.h))return new jt(t.l,0,0,t.opacity);var e=t.h*Et;return new jt(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof xt||(t=Ct(t));var r,i,n=Ht(t.r),o=Ht(t.g),a=Ht(t.b),s=Rt((.2225045*n+.7168786*o+.0606169*a)/Bt);return n===o&&o===a?r=i=s:(r=Rt((.4360747*n+.3850649*o+.1430804*a)/At),i=Rt((.0139322*n+.0971045*o+.7141733*a)/Dt)),new jt(116*s-16,500*(r-s),200*(s-i),t.opacity)}function jt(t,e,r,i){this.l=+t,this.a=+e,this.b=+r,this.opacity=+i}function Rt(t){return Lt<t?Math.pow(t,1/3):t/zt+It}function Ut(t){return Ot<t?t*t*t:zt*(t-It)}function Gt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ht(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function qt(t,e,r,i){this.h=+t,this.c=+e,this.l=+r,this.opacity=+i}it(jt,function(t,e,r,i){return 1===arguments.length?Ft(t):new jt(t,e,r,null==i?1:i)},nt(ot,{brighter:function(t){return new jt(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new jt(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new xt(Gt(3.1338561*(e=At*Ut(e))-1.6168667*(t=Bt*Ut(t))-.4906146*(r=Dt*Ut(r))),Gt(-.9787684*e+1.9161415*t+.033454*r),Gt(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),it(qt,function(t,e,r,i){return 1===arguments.length?function(t){if(t instanceof qt)return new qt(t.h,t.c,t.l,t.opacity);if(t instanceof jt||(t=Ft(t)),0===t.a&&0===t.b)return new qt(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Nt;return new qt(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new qt(t,e,r,null==i?1:i)},nt(ot,{brighter:function(t){return new qt(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new qt(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Ft(this).rgb()}}));var Wt=1.78277,Vt=-.29227,Xt=-.90649,Yt=1.97294,Jt=Yt*Xt,$t=Yt*Wt,Kt=Wt*Vt- -.14861*Xt;function Qt(t,e,r,i){this.h=+t,this.s=+e,this.l=+r,this.opacity=+i}function Zt(t){return function(){return t}}function te(o){return 1==(o=+o)?ee:function(t,e){return e-t?(r=t,i=e,n=o,r=Math.pow(r,n),i=Math.pow(i,n)-r,n=1/n,function(t){return Math.pow(r+t*i,n)}):Zt(isNaN(t)?e:t);var r,i,n}}function ee(t,e){var r,i,n=e-t;return n?(r=t,i=n,function(t){return r+t*i}):Zt(isNaN(t)?e:t)}it(Qt,function(t,e,r,i){return 1===arguments.length?function(t){if(t instanceof Qt)return new Qt(t.h,t.s,t.l,t.opacity);t instanceof xt||(t=Ct(t));var e=t.r/255,r=t.g/255,i=t.b/255,n=(Kt*i+Jt*e-$t*r)/(Kt+Jt-$t),o=i-n,a=(Yt*(r-n)-Vt*o)/Xt,s=Math.sqrt(a*a+o*o)/(Yt*n*(1-n)),l=s?Math.atan2(a,o)*Nt-120:NaN;return new Qt(l<0?l+360:l,s,n,t.opacity)}(t):new Qt(t,e,r,null==i?1:i)},nt(ot,{brighter:function(t){return t=null==t?at:Math.pow(at,t),new Qt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Qt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Et,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),n=Math.sin(t);return new xt(255*(e+r*(-.14861*i+Wt*n)),255*(e+r*(Vt*i+Xt*n)),255*(e+r*(Yt*i)),this.opacity)}}));var re=function t(e){var a=te(e);function r(e,t){var r=a((e=Tt(e)).r,(t=Tt(t)).r),i=a(e.g,t.g),n=a(e.b,t.b),o=ee(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=n(t),e.opacity=o(t),e+""}}return r.gamma=t,r}(1);function ie(e,r){return r-=e=+e,function(t){return e+r*t}}var ne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,oe=new RegExp(ne.source,"g");var ae,se,le,he,pe=180/Math.PI,ce={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ue(t,e,r,i,n,o){var a,s,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*r+e*i)&&(r-=t*l,i-=e*l),(s=Math.sqrt(r*r+i*i))&&(r/=s,i/=s,l/=s),t*i<e*r&&(t=-t,e=-e,l=-l,a=-a),{translateX:n,translateY:o,rotate:Math.atan2(e,t)*pe,skewX:Math.atan(l)*pe,scaleX:a,scaleY:s}}function de(u,d,f,y){function _(t){return t.length?t.pop()+" ":""}return function(t,e){var r,i,n,o,a,s,l,h,p=[],c=[];return t=u(t),e=u(e),function(t,e,r,i,n,o){if(t!==r||e!==i){var a=n.push("translate(",null,d,null,f);o.push({i:a-4,x:ie(t,r)},{i:a-2,x:ie(e,i)})}else(r||i)&&n.push("translate("+r+d+i+f)}(t.translateX,t.translateY,e.translateX,e.translateY,p,c),r=t.rotate,i=e.rotate,n=p,o=c,r!==i?(180<r-i?i+=360:180<i-r&&(r+=360),o.push({i:n.push(_(n)+"rotate(",null,y)-2,x:ie(r,i)})):i&&n.push(_(n)+"rotate("+i+y),a=t.skewX,s=e.skewX,l=p,h=c,a!==s?h.push({i:l.push(_(l)+"skewX(",null,y)-2,x:ie(a,s)}):s&&l.push(_(l)+"skewX("+s+y),function(t,e,r,i,n,o){if(t!==r||e!==i){var a=n.push(_(n)+"scale(",null,",",null,")");o.push({i:a-4,x:ie(t,r)},{i:a-2,x:ie(e,i)})}else 1===r&&1===i||n.push(_(n)+"scale("+r+","+i+")")}(t.scaleX,t.scaleY,e.scaleX,e.scaleY,p,c),t=e=null,function(t){for(var e,r=-1,i=c.length;++r<i;)p[(e=c[r]).i]=e.x(t);return p.join("")}}}var fe=de(function(t){return"none"===t?ce:(ae||(ae=document.createElement("DIV"),se=document.documentElement,le=document.defaultView),ae.style.transform=t,t=le.getComputedStyle(se.appendChild(ae),null).getPropertyValue("transform"),se.removeChild(ae),ue(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))},"px, ","px)","deg)"),ye=de(function(t){return null==t?ce:(he||(he=document.createElementNS("http://www.w3.org/2000/svg","g")),he.setAttribute("transform",t),(t=he.transform.baseVal.consolidate())?ue((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):ce)},", ",")",")");Math.SQRT2;function _e(t,e,r){var i=t._id;return t.each(function(){var t=et(this,i);(t.value||(t.value={}))[e]=r.apply(this,arguments)}),function(t){return rt(t,i).value[e]}}function ge(t,e){var r;return("number"==typeof e?ie:e instanceof wt?re:(r=wt(e))?(e=r,re):function(t,i){var e,r,n,o,a,s=ne.lastIndex=oe.lastIndex=0,l=-1,h=[],p=[];for(t+="",i+="";(e=ne.exec(t))&&(r=oe.exec(i));)(n=r.index)>s&&(n=i.slice(s,n),h[l]?h[l]+=n:h[++l]=n),(e=e[0])===(r=r[0])?h[l]?h[l]+=r:h[++l]=r:(h[++l]=null,p.push({i:l,x:ie(e,r)})),s=oe.lastIndex;return s<i.length&&(n=i.slice(s),h[l]?h[l]+=n:h[++l]=n),h.length<2?p[0]?(a=p[0].x,function(t){return a(t)+""}):(o=i,function(){return o}):(i=p.length,function(t){for(var e,r=0;r<i;++r)h[(e=p[r]).i]=e.x(t);return h.join("")})})(t,e)}var me=b.selection.prototype.constructor;var we=0;function ve(t,e,r,i){this._groups=t,this._parents=e,this._name=r,this._id=i}function be(){return++we}var Ce=b.selection.prototype;ve.prototype=function(t){return b.selection().transition(t)}.prototype={constructor:ve,select:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=b.selector(t));for(var i=this._groups,n=i.length,o=new Array(n),a=0;a<n;++a)for(var s,l,h=i[a],p=h.length,c=o[a]=new Array(p),u=0;u<p;++u)(s=h[u])&&(l=t.call(s,s.__data__,u,h))&&("__data__"in s&&(l.__data__=s.__data__),c[u]=l,Z(c[u],e,r,u,c,rt(s,r)));return new ve(o,this._parents,e,r)},selectAll:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=b.selectorAll(t));for(var i=this._groups,n=i.length,o=[],a=[],s=0;s<n;++s)for(var l,h=i[s],p=h.length,c=0;c<p;++c)if(l=h[c]){for(var u,d=t.call(l,l.__data__,c,h),f=rt(l,r),y=0,_=d.length;y<_;++y)(u=d[y])&&Z(u,e,r,y,d,f);o.push(d),a.push(l)}return new ve(o,a,e,r)},filter:function(t){"function"!=typeof t&&(t=b.matcher(t));for(var e=this._groups,r=e.length,i=new Array(r),n=0;n<r;++n)for(var o,a=e[n],s=a.length,l=i[n]=[],h=0;h<s;++h)(o=a[h])&&t.call(o,o.__data__,h,a)&&l.push(o);return new ve(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,i=e.length,n=r.length,o=Math.min(i,n),a=new Array(i),s=0;s<o;++s)for(var l,h=e[s],p=r[s],c=h.length,u=a[s]=new Array(c),d=0;d<c;++d)(l=h[d]||p[d])&&(u[d]=l);for(;s<i;++s)a[s]=e[s];return new ve(a,this._parents,this._name,this._id)},selection:function(){return new me(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,r=be(),i=this._groups,n=i.length,o=0;o<n;++o)for(var a,s=i[o],l=s.length,h=0;h<l;++h)if(a=s[h]){var p=rt(a,e);Z(a,t,r,h,s,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new ve(i,this._parents,t,r)},call:Ce.call,nodes:Ce.nodes,node:Ce.node,size:Ce.size,empty:Ce.empty,each:Ce.each,on:function(t,e){var r,i,n,o,a,s,l=this._id;return arguments.length<2?rt(this.node(),l).on.on(t):this.each((r=l,n=e,s=((i=t)+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return 0<=e&&(t=t.slice(0,e)),!t||"start"===t})?tt:et,function(){var t=s(this,r),e=t.on;e!==o&&(a=(o=e).copy()).on(i,n),t.on=a}))},attr:function(t,e){var r=b.namespace(t),i="transform"===r?ye:ge;return this.attrTween(t,"function"==typeof e?(r.local?function(r,i,n){var o,a,s;return function(){var t,e=n(this);if(null!=e)return(t=this.getAttributeNS(r.space,r.local))===e?null:t===o&&e===a?s:s=i(o=t,a=e);this.removeAttributeNS(r.space,r.local)}}:function(r,i,n){var o,a,s;return function(){var t,e=n(this);if(null!=e)return(t=this.getAttribute(r))===e?null:t===o&&e===a?s:s=i(o=t,a=e);this.removeAttribute(r)}})(r,i,_e(this,"attr."+t,e)):null==e?(r.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(r):(r.local?function(e,r,i){var n,o;return function(){var t=this.getAttributeNS(e.space,e.local);return t===i?null:t===n?o:o=r(n=t,i)}}:function(e,r,i){var n,o;return function(){var t=this.getAttribute(e);return t===i?null:t===n?o:o=r(n=t,i)}})(r,i,e+""))},attrTween:function(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var i=b.namespace(t);return this.tween(r,(i.local?function(i,t){function e(){var e=this,r=t.apply(e,arguments);return r&&function(t){e.setAttributeNS(i.space,i.local,r(t))}}return e._value=t,e}:function(i,t){function e(){var e=this,r=t.apply(e,arguments);return r&&function(t){e.setAttribute(i,r(t))}}return e._value=t,e})(i,e))},style:function(t,e,r){var i,n,o,a,s,l,h,p,c,u,d,f,y,_,g,m,w,v="transform"==(t+="")?fe:ge;return null==e?this.styleTween(t,(y=t,_=v,function(){var t=b.style(this,y),e=(this.style.removeProperty(y),b.style(this,y));return t===e?null:t===g&&e===m?w:w=_(g=t,m=e)})).on("end.style."+t,(f=t,function(){this.style.removeProperty(f)})):this.styleTween(t,"function"==typeof e?(h=v,p=_e(this,"style."+(l=t),e),function(){var t=b.style(this,l),e=p(this);return null==e&&(this.style.removeProperty(l),e=b.style(this,l)),t===e?null:t===c&&e===u?d:d=h(c=t,u=e)}):(i=t,n=v,o=e+"",function(){var t=b.style(this,i);return t===o?null:t===a?s:s=n(a=t,o)}),r)},styleTween:function(t,e,r){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(i,t,n){function e(){var e=this,r=t.apply(e,arguments);return r&&function(t){e.style.setProperty(i,r(t),n)}}return e._value=t,e}(t,e,null==r?"":r))},text:function(t){return this.tween("text","function"==typeof t?(r=_e(this,"text",t),function(){var t=r(this);this.textContent=null==t?"":t}):(e=null==t?"":t+"",function(){this.textContent=e}));var e,r},remove:function(){return this.on("end.remove",(r=this._id,function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==r)return;t&&t.removeChild(this)}));var r},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var i,n=rt(this.node(),r).tween,o=0,a=n.length;o<a;++o)if((i=n[o]).name===t)return i.value;return null}return this.each((null==e?function(n,o){var a,s;return function(){var t=et(this,n),e=t.tween;if(e!==a)for(var r=0,i=(s=a=e).length;r<i;++r)if(s[r].name===o){(s=s.slice()).splice(r,1);break}t.tween=s}}:function(o,a,s){var l,h;if("function"!=typeof s)throw new Error;return function(){var t=et(this,o),e=t.tween;if(e!==l){h=(l=e).slice();for(var r={name:a,value:s},i=0,n=h.length;i<n;++i)if(h[i].name===a){h[i]=r;break}i===n&&h.push(r)}t.tween=h}})(r,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){tt(this,t).delay=+e.apply(this,arguments)}}:function(t,e){return e=+e,function(){tt(this,t).delay=e}})(e,t)):rt(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){et(this,t).duration=+e.apply(this,arguments)}}:function(t,e){return e=+e,function(){et(this,t).duration=e}})(e,t)):rt(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){et(this,t).ease=e}}(e,t)):rt(this.node(),e).ease}};Math.PI,Math.PI;var Te={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function xe(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))return Te.time=z(),Te;return r}b.selection.prototype.interrupt=function(t){return this.each(function(){!function(t,e){var r,i,n,o=t.__transition,a=!0;if(o){for(n in e=null==e?null:e+"",o)(r=o[n]).name===e?(i=r.state>Y&&r.state<K,r.state=Q,r.timer.stop(),i&&r.on.call("interrupt",t,t.__data__,r.index,r.group),delete o[n]):a=!1;a&&delete t.__transition}}(this,t)})},b.selection.prototype.transition=function(t){var e,r;t=t instanceof ve?(e=t._id,t._name):(e=be(),(r=Te).time=z(),null==t?null:t+"");for(var i=this._groups,n=i.length,o=0;o<n;++o)for(var a,s=i[o],l=s.length,h=0;h<l;++h)(a=s[h])&&Z(a,t,e,h,s,r||xe(a,e));return new ve(i,this._parents,t,e)};_(".composite_MegaChart-Info,\r\n.composite_MegaChart-Info *,\r\n.composite_MegaChart-Maximize,\r\n.composite_MegaChart-Maximize *{\r\n font-family: FontAwesome;\r\n}");var ke=function(o){function t(){var t=o.call(this)||this;t._chart=new f,t._toolbar=new r.Toolbar,t._valueTitle=new b.Text,t._domainTitle=new b.Text,t._legend=new a.Legend,t._tag="div";var e=t;return t._chart.click=function(){e.click.apply(e,arguments)},t._chart.dblclick=function(){e.dblclick.apply(e,arguments)},t._chart.vertex_click=function(){e.vertex_click.apply(e,arguments)},t._chart.vertex_dblclick=function(){e.vertex_dblclick.apply(e,arguments)},t._chart.edge_click=function(){e.edge_click.apply(e,arguments)},t._chart.edge_dblclick=function(){e.edge_dblclick.apply(e,arguments)},t}return l(t,o),t.prototype.toolbarWidgets=function(t){return arguments.length?(this._toolbar.widgets(t),this):this._toolbar.widgets()},t.prototype.chartTypeDefaults=function(t){return arguments.length?(this._chart.chartTypeDefaults(t),this):this._chart.chartTypeDefaults()},t.prototype.chartTypeProperties=function(t){return arguments.length?(this._chart.chartTypeProperties(t),this):this._chart.chartTypeProperties()},t.prototype.fields=function(t){return arguments.length?(this._chart.fields(t),this):this._chart.fields()},t.prototype.columns=function(t,e){return arguments.length?(this._chart.columns(t,e),this):this._chart.columns()},t.prototype.data=function(t){return arguments.length?(this._chart.data(t),this):this._chart.data()},t.prototype.downloadCSV=function(){return b.Utility.downloadBlob("CSV",this._chart.export("CSV")),this},t.prototype.enter=function(t,e){o.prototype.enter.call(this,t,e);var m=this;this.topShrinkWrap(!1).topPercentage(0).topSize(30),this._dataCount=(new a.Html).classed({"composite_MegaChart-dataCount":!0}).id(this.id()+"_dataCount").html('<span class="MegaChart-dataCount-label">Count:</span>&nbsp;<span class="MegaChart-dataCount-value">'+(this.data()?this.data().length:"0")+"</span>").overflowX("visible").overflowY("visible"),this._csvButton=(new n.Button).classed({"composite_MegaChart-CSV":!0}).id(this.id()+"_csv").value("CSV"),this._csvButton.click=function(t){m.downloadCSV()},this._infoButton=(new n.Button).classed({"composite_MegaChart-Info":!0}).id(this.id()+"_info").value(this.infoIcon()),this._maximizeButton=(new n.Button).classed({"composite_MegaChart-Maximize":!0}).id(this.id()+"_maximize").value(""),this._maximizeButton.click=function(t){var e=m.target(),r=e,i=b.select(e).classed("__hpccisMaximized"),n=m.locateAncestor("layout_Grid");r=n?n.element().node():document.body;var o=b.select(m.target());if(i){var a=e.parentElement.getBoundingClientRect(),s=parseInt(getComputedStyle(e,null).getPropertyValue("padding-top").replace("px","")),l=parseInt(getComputedStyle(e,null).getPropertyValue("padding-left").replace("px","")),h=parseInt(getComputedStyle(e,null).getPropertyValue("padding-right").replace("px","")),p=parseInt(getComputedStyle(e,null).getPropertyValue("padding-bottom").replace("px",""));m.contentDiv.style("opacity",0).transition(100),o.transition().style("top",a.top+"px").style("left",a.left+"px").style("width",a.width-l-h+"px").style("height",a.height-s-p+"px").each("end",function(){o.style("position",e.__old_position),o.style("z-index",e.__old_zindex),o.style("background-color",e.__old_backgroundColor),o.style("box-shadow",e.__old_boxshadow),m.resize({width:a.width-l-h,height:a.height-s-p}).render(function(){m.contentDiv.transition().style("opacity",1)}),t.value("").render()})}else{e.__old_position=e.style.position,e.__old_zindex=e.style.zIndex,e.__old_boxshadow=e.style.boxShadow,e.__old_backgroundColor=m.element().style("background-color");var c=b.select(r).datum(),u=c.target(),d=c?u.getBoundingClientRect():r.getBoundingClientRect(),f=parseInt(getComputedStyle(u,null).getPropertyValue("padding-top").replace("px","")),y=parseInt(getComputedStyle(u,null).getPropertyValue("padding-left").replace("px","")),_=parseInt(getComputedStyle(u,null).getPropertyValue("padding-right").replace("px","")),g=parseInt(getComputedStyle(u,null).getPropertyValue("padding-bottom").replace("px",""));m.contentDiv.style("opacity",0).transition(100),o.style("position","fixed").style("z-index",999999).style("box-shadow","0 8px 8px 0 rgba(0,0,0,.14),0 12px 4px -8px rgba(0,0,0,.2),0 4px 20px 0 rgba(0,0,0,.12)").style("background-color",e.__old_backgroundColor).transition().style("top",d.top+f+"px").style("left",d.left+y+"px").style("width",d.width-y-_+"px").style("height",d.height-f-g+"px").each("end",function(){o.style("background-color",m.maximizedBackgroundColor()),m.resize({width:d.width-y-_,height:d.height-f-g}).render(function(){m.contentDiv.transition().style("opacity",1)}),t.value("").render()})}b.select(e).classed("__hpccisMaximized",!i)},this._legendButton=(new n.Input).classed({"composite_MegaChart-legend":!0}).id(this.id()+"_legend").type("checkbox").inlineLabel("Legend: "),this._legendButton.click=function(t){m.render()},this._chartTypeSelect=(new n.Select).classed({"composite_MegaChart-chartType":!0}).id(this.id()+"_chartType").selectOptions(this._allChartTypes.map(function(t){return[t.id,t.display]})).value(this.chartType()),this._chartTypeSelect.change=function(t){m.chartType(t.value()).render()},this.setContent("center",this._chart),this._legend.targetWidget(this._chart).orientation(-1!==["top","bottom"].indexOf(this.legendPosition())?"horizontal":"vertical").fixedSize(!0),this._prevLegendPosition=this.legendPosition(),this.valueAxisTitle()&&this.setContent("left",this._valueTitle.rotation(-90)).leftShrinkWrap(!0),this.domainAxisTitle()&&this.setContent("bottom",this._domainTitle).bottomShrinkWrap(!0),"none"!==this.legendPosition()&&this.setContent(this.legendPosition(),this._legend)[this.legendPosition()+"ShrinkWrap"](!0)},t.prototype.update=function(t,e){function r(t,e,r){if(r&&-1===t.indexOf(e))t.push(e);else if(!r){var i=t.indexOf(e);0<=i&&t.splice(i,1)}}this._chartTypeSelect.value(this.chartType());var i=this.toolbarWidgets();r(i,this._csvButton,this.showCSV()),r(i,this._maximizeButton,this.showMaximize()),r(i,this._legendButton,this.toolbarShowLegend()),r(i,this._chartTypeSelect,this.showChartSelect()),r(i,this._infoButton,this.showInfoButton()),this.toolbarWidgets(i),this._prevShowToolbar!==this.showToolbar()&&(this.setContent("top",this.showToolbar()?this._toolbar:null),this._prevShowToolbar=this.showToolbar()),this._toolbar.fontSize(this.titleFontSize()).fontColor(this.titleFontColor()).fontFamily(this.titleFontFamily()).fontBold(this.titleFontBold()).backgroundColor(this.titleBackgroundColor()),this._chart.data(this.data()),this._chart.chartType()!==this.chartType()&&this._chart.chartType(this.chartType());var n=this.legendPosition();this.toolbarShowLegend()&&!this._legendButton.checked()&&(n="none"),this._prevLegendPosition!==n&&("none"!==this._prevLegendPosition&&this.clearContent(this._prevLegendPosition),"none"!==(this._prevLegendPosition=n)&&(this._legend=(new a.Legend).targetWidget(this.getContent("center").fixedSize(!0)),this.setContent(n,this._legend),this._legend.orientation(-1!==["top","bottom"].indexOf(n)?"horizontal":"vertical"))),this._contentClasses=this.getContentClasses(),this.valueAxisTitle()&&"common_Text"!==this._contentClasses.left&&"left"!==n&&this.setContent("left",this._valueTitle.rotation(-90)),this.domainAxisTitle()&&"common_Text"!==this._contentClasses.bottom&&"bottom"!==n&&this.setContent("bottom",this._domainTitle).bottomShrinkWrap(!0),this._legend.dataFamily(this._chart.getChartDataFamily()),o.prototype.update.call(this,t,e)},t.prototype.exit=function(t,e){o.prototype.exit.call(this,t,e)},t.prototype.getContentClasses=function(){var t={},e=this.getContent("top"),r=this.getContent("right"),i=this.getContent("bottom"),n=this.getContent("left");return t.top=null!==e?e.classID():void 0,t.right=null!==r?r.classID():void 0,t.bottom=null!==i?i.classID():void 0,t.left=null!==n?n.classID():void 0,t},t.prototype.serializeState=function(){var t={title:this.title(),data:this.data()},e=this.chart();return e&&e.serializeState&&(t.chart=e.serializeState(),delete t.chart.data),t},t.prototype.deserializeState=function(t){if(t){this.title(t.title).data(t.data);var e=this.chart();e&&t.chart&&e.serializeState&&e.deserializeState(t.chart)}return this},t.prototype.click=function(t,e,r){console.log("Click: "+JSON.stringify(t)+", "+e+", "+r)},t.prototype.dblclick=function(t,e,r){console.log("Double click: "+JSON.stringify(t)+", "+e+", "+r)},t.prototype.vertex_click=function(t,e,r,i){i&&i.vertex&&console.log("Vertex click: "+i.vertex.id())},t.prototype.vertex_dblclick=function(t,e,r,i){i&&i.vertex&&console.log("Vertex double click: "+i.vertex.id())},t.prototype.edge_click=function(t,e,r,i){i&&i.edge&&console.log("Edge click: "+i.edge.id())},t.prototype.edge_dblclick=function(t,e,r,i){i&&i.edge&&console.log("Edge double click: "+i.edge.id())},t}(r.Border);function Se(t,e){if(e=e&&"1.14.2-dev"!==e?e:"1.18.0",!t.__version)return t;var r=b.Utility.parseVersionString(t.__version),i=b.Utility.parseVersionString(e);if(1!==r.major||14!==r.minor)return t;console.log("Upgrading old persist from "+t.__version+" to "+e);var n=JSON.stringify(t);n=n.split('"'+t.__version).join('"'+e);var o=JSON.parse(n);return o.__properties&&o.__properties.content&&o.__properties.content.forEach(function(t){1<JSON.stringify(t).split("graph_Graph").length&&16<=i.minor&&(t.__properties.widget.__id=t.__properties.widget.__properties.widget.__id,t.__properties.widget.__class="composite_MegaChart",t.__properties.widget.__properties.showCSV=!1,t.__properties.widget.__properties.chartType="GRAPH",t.__properties.widget.__properties.chart=t.__properties.widget.__properties.widget,delete t.__properties.widget.__properties.chart.__id,delete t.__properties.widget.__properties.widget),void