jupyterlab_sparkmonitor
Version:
Jupyter Lab extension to monitor Apache Spark Jobs
1 lines • 932 kB
JavaScript
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=169)}([function(e,t,r){"use strict";var n=r(2),a=r(3),i=r(12),o=i.FP_SAFE,l=i.BADNUM,s=e.exports={};s.nestedProperty=r(59),s.keyedContainer=r(176),s.relativeAttr=r(177),s.isPlainObject=r(36),s.toLogRange=r(60),s.relinkPrivateKeys=r(178);var c=r(35);s.isTypedArray=c.isTypedArray,s.isArrayOrTypedArray=c.isArrayOrTypedArray,s.isArray1D=c.isArray1D,s.ensureArray=c.ensureArray,s.concat=c.concat,s.maxRowLength=c.maxRowLength,s.minRowLength=c.minRowLength;var u=r(37);s.mod=u.mod,s.modHalf=u.modHalf;var d=r(179);s.valObjectMeta=d.valObjectMeta,s.coerce=d.coerce,s.coerce2=d.coerce2,s.coerceFont=d.coerceFont,s.coerceHoverinfo=d.coerceHoverinfo,s.coerceSelectionMarkerOpacity=d.coerceSelectionMarkerOpacity,s.validate=d.validate;var f=r(180);s.dateTime2ms=f.dateTime2ms,s.isDateTime=f.isDateTime,s.ms2DateTime=f.ms2DateTime,s.ms2DateTimeLocal=f.ms2DateTimeLocal,s.cleanDate=f.cleanDate,s.isJSDate=f.isJSDate,s.formatDate=f.formatDate,s.incrementMonth=f.incrementMonth,s.dateTick0=f.dateTick0,s.dfltRange=f.dfltRange,s.findExactDates=f.findExactDates,s.MIN_MS=f.MIN_MS,s.MAX_MS=f.MAX_MS;var h=r(97);s.findBin=h.findBin,s.sorterAsc=h.sorterAsc,s.sorterDes=h.sorterDes,s.distinctVals=h.distinctVals,s.roundUp=h.roundUp,s.sort=h.sort,s.findIndexOfMin=h.findIndexOfMin;var p=r(182);s.aggNums=p.aggNums,s.len=p.len,s.mean=p.mean,s.median=p.median,s.midRange=p.midRange,s.variance=p.variance,s.stdev=p.stdev,s.interp=p.interp;var g=r(99);s.init2dArray=g.init2dArray,s.transposeRagged=g.transposeRagged,s.dot=g.dot,s.translationMatrix=g.translationMatrix,s.rotationMatrix=g.rotationMatrix,s.rotationXYMatrix=g.rotationXYMatrix,s.apply2DTransform=g.apply2DTransform,s.apply2DTransform2=g.apply2DTransform2;var v=r(183);s.deg2rad=v.deg2rad,s.rad2deg=v.rad2deg,s.angleDelta=v.angleDelta,s.angleDist=v.angleDist,s.isFullCircle=v.isFullCircle,s.isAngleInsideSector=v.isAngleInsideSector,s.isPtInsideSector=v.isPtInsideSector,s.pathArc=v.pathArc,s.pathSector=v.pathSector,s.pathAnnulus=v.pathAnnulus;var m=r(184);s.isLeftAnchor=m.isLeftAnchor,s.isCenterAnchor=m.isCenterAnchor,s.isRightAnchor=m.isRightAnchor,s.isTopAnchor=m.isTopAnchor,s.isMiddleAnchor=m.isMiddleAnchor,s.isBottomAnchor=m.isBottomAnchor;var y=r(185);s.segmentsIntersect=y.segmentsIntersect,s.segmentDistance=y.segmentDistance,s.getTextLocation=y.getTextLocation,s.clearLocationCache=y.clearLocationCache,s.getVisibleSegment=y.getVisibleSegment,s.findPointOnPath=y.findPointOnPath;var x=r(9);s.extendFlat=x.extendFlat,s.extendDeep=x.extendDeep,s.extendDeepAll=x.extendDeepAll,s.extendDeepNoArrays=x.extendDeepNoArrays;var b=r(29);s.log=b.log,s.warn=b.warn,s.error=b.error;var _=r(39);s.counterRegex=_.counter;var w=r(66);s.throttle=w.throttle,s.throttleDone=w.done,s.clearThrottle=w.clear;var k=r(64);function T(e){var t={};for(var r in e)for(var n=e[r],a=0;a<n.length;a++)t[n[a]]=+r;return t}s.getGraphDiv=k.getGraphDiv,s.isPlotDiv=k.isPlotDiv,s.removeElement=k.removeElement,s.addStyleRule=k.addStyleRule,s.addRelatedStyleRule=k.addRelatedStyleRule,s.deleteRelatedStyleRule=k.deleteRelatedStyleRule,s.clearResponsive=r(186),s.makeTraceGroups=r(187),s._=r(188),s.notifier=r(95),s.filterUnique=r(189),s.filterVisible=r(190),s.pushUnique=r(96),s.cleanNumber=r(191),s.ensureNumber=function(e){return a(e)?(e=Number(e))<-o||e>o?l:a(e)?Number(e):l:l},s.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&(a(e)&&e>=0&&e%1==0)},s.noop=r(63),s.identity=r(98),s.repeat=function(e,t){for(var r=new Array(t),n=0;n<t;n++)r[n]=e;return r},s.swapAttrs=function(e,t,r,n){r||(r="x"),n||(n="y");for(var a=0;a<t.length;a++){var i=t[a],o=s.nestedProperty(e,i.replace("?",r)),l=s.nestedProperty(e,i.replace("?",n)),c=o.get();o.set(l.get()),l.set(c)}},s.raiseToTop=function(e){e.parentNode.appendChild(e)},s.cancelTransition=function(e){return e.transition().duration(0)},s.constrain=function(e,t,r){return t>r?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},s.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},s.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l<i;l++)o[l]=t(e[l],r,n,a);return o},s.randstr=function e(t,r,n,a){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,o,l=Math.log(Math.pow(2,r))/Math.log(n),c="";for(i=2;l===1/0;i*=2)l=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var u=l-Math.floor(l);for(i=0;i<Math.floor(l);i++)c=Math.floor(Math.random()*n).toString(n)+c;u&&(o=Math.pow(n,u),c=Math.floor(Math.random()*o).toString(n)+c);var d=parseInt(c,n);return t&&t[c]||d!==1/0&&d>=Math.pow(2,r)?a>10?(s.warn("randstr failed uniqueness"),c):e(t,r,n,(a||0)+1):c},s.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},s.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r<s;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/t))/(2*t);for(r=0;r<o;r++){for(i=0,n=0;n<s;n++)(a=r+n+1-t)<-o?a-=l*Math.round(a/l):a>=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},s.syncOrAsync=function(e,t,r){var n;function a(){return s.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a).then(void 0,s.promiseError);return r&&r(t)},s.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},s.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n<r.length;n++)null!=e[r[n]]?a=!0:i=!1;if(a&&!i)for(n=0;n<r.length;n++)e[r[n]]=t[r[n]]}},s.mergeArray=function(e,t,r,n){var a="function"==typeof n;if(s.isArrayOrTypedArray(e))for(var i=Math.min(e.length,t.length),o=0;o<i;o++){var l=e[o];t[o][r]=a?n(l):l}},s.mergeArrayCastPositive=function(e,t,r){return s.mergeArray(e,t,r,(function(e){var t=+e;return isFinite(t)&&t>0?t:0}))},s.fillArray=function(e,t,r,n){if(n=n||s.identity,s.isArrayOrTypedArray(e))for(var a=0;a<t.length;a++)t[a][r]=n(e[a])},s.castOption=function(e,t,r,n){n=n||s.identity;var a=s.nestedProperty(e,r).get();return s.isArrayOrTypedArray(a)?Array.isArray(t)&&s.isArrayOrTypedArray(a[t[0]])?n(a[t[0]][t[1]]):n(a[t]):a},s.extractOption=function(e,t,r,n){if(r in e)return e[r];var a=s.nestedProperty(t,n).get();return Array.isArray(a)?void 0:a},s.tagSelected=function(e,t,r){var n,a,i=t.selectedpoints,o=t._indexToPoints;o&&(n=T(o));for(var l=0;l<i.length;l++){var c=i[l];if(s.isIndex(c)||s.isArrayOrTypedArray(c)&&s.isIndex(c[0])&&s.isIndex(c[1])){var u=n?n[c]:c,d=r?r[u]:u;void 0!==(a=d)&&a<e.length&&(e[d].selected=1)}}},s.selIndices2selPoints=function(e){var t=e.selectedpoints,r=e._indexToPoints;if(r){for(var n=T(r),a=[],i=0;i<t.length;i++){var o=t[i];if(s.isIndex(o)){var l=n[o];s.isIndex(l)&&a.push(l)}}return a}return t},s.getTargetArray=function(e,t){var r=t.target;if("string"==typeof r&&r){var n=s.nestedProperty(e,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},s.minExtend=function(e,t){var r={};"object"!=typeof t&&(t={});var n,a,i,o=Object.keys(e);for(n=0;n<o.length;n++)i=e[a=o[n]],"_"!==a.charAt(0)&&"function"!=typeof i&&("module"===a?r[a]=i:Array.isArray(i)?r[a]="colorscale"===a?i.slice():i.slice(0,3):s.isTypedArray(i)?r[a]=i.subarray(0,3):r[a]=i&&"object"==typeof i?s.minExtend(e[a],t[a]):i);for(o=Object.keys(t),n=0;n<o.length;n++)"object"==typeof(i=t[a=o[n]])&&a in r&&"object"==typeof r[a]||(r[a]=i);return r},s.titleCase=function(e){return e.charAt(0).toUpperCase()+e.substr(1)},s.containsAny=function(e,t){for(var r=0;r<t.length;r++)if(-1!==e.indexOf(t[r]))return!0;return!1},s.isIE=function(){return void 0!==window.navigator.msSaveBlob};var A=/MSIE [1-9]\./;s.isIE9orBelow=function(){return s.isIE()&&A.test(window.navigator.userAgent)};var M=/Version\/[\d\.]+.*Safari/;s.isSafari=function(){return M.test(window.navigator.userAgent)},s.isD3Selection=function(e){return e&&"function"==typeof e.classed},s.ensureSingle=function(e,t,r,n){var a=e.select(t+(r?"."+r:""));if(a.size())return a;var i=e.append(t);return r&&i.classed(r,!0),n&&i.call(n),i},s.ensureSingleById=function(e,t,r,n){var a=e.select(t+"#"+r);if(a.size())return a;var i=e.append(t).attr("id",r);return n&&i.call(n),i},s.objectFromPath=function(e,t){for(var r,n=e.split("."),a=r={},i=0;i<n.length;i++){var o=n[i],l=null,s=n[i].match(/(.*)\[([0-9]+)\]/);s?(o=s[1],l=s[2],r=r[o]=[],i===n.length-1?r[l]=t:r[l]={},r=r[l]):(i===n.length-1?r[o]=t:r[o]={},r=r[o])}return a};var S=/^([^\[\.]+)\.(.+)?/,L=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;s.expandObjectPaths=function(e){var t,r,n,a,i,o,l;if("object"==typeof e&&!Array.isArray(e))for(r in e)e.hasOwnProperty(r)&&((t=r.match(S))?(a=e[r],n=t[1],delete e[r],e[n]=s.extendDeepNoArrays(e[n]||{},s.objectFromPath(r,s.expandObjectPaths(a))[n])):(t=r.match(L))?(a=e[r],n=t[1],i=parseInt(t[2]),delete e[r],e[n]=e[n]||[],"."===t[3]?(l=t[4],o=e[n][i]=e[n][i]||{},s.extendDeepNoArrays(o,s.objectFromPath(l,s.expandObjectPaths(a)))):e[n][i]=s.expandObjectPaths(a)):e[r]=s.expandObjectPaths(e[r]));return e},s.numSeparate=function(e,t,r){if(r||(r=!1),"string"!=typeof t||0===t.length)throw new Error("Separator string required for formatting!");"number"==typeof e&&(e=String(e));var n=/(\d+)(\d{3})/,a=t.charAt(0),i=t.charAt(1),o=e.split("."),l=o[0],s=o.length>1?a+o[1]:"";if(i&&(o.length>1||l.length>4||r))for(;n.test(l);)l=l.replace(n,"$1"+i+"$2");return l+s},s.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;s.templateString=function(e,t){var r={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,n){var a;return C.test(n)?a=t[n]:(r[n]=r[n]||s.nestedProperty(t,n).get,a=r[n]()),s.isValidTextValue(a)?a:""}))};var D={max:10,count:0,name:"hovertemplate"};s.hovertemplateString=function(){return I.apply(D,arguments)};var O={max:10,count:0,name:"texttemplate"};s.texttemplateString=function(){return I.apply(O,arguments)};var z=/^[:|\|]/;function I(e,t,r){var a=this,i=arguments;t||(t={});var o={};return e.replace(s.TEMPLATE_STRING_REGEX,(function(e,l,c){var u,d,f,h;for(f=3;f<i.length;f++)if(u=i[f]){if(u.hasOwnProperty(l)){d=u[l];break}if(C.test(l)||(d=o[l]||s.nestedProperty(u,l).get())&&(o[l]=d),void 0!==d)break}if(void 0===d&&a)return a.count<a.max&&(s.warn("Variable '"+l+"' in "+a.name+" could not be found!"),d=e),a.count===a.max&&s.warn("Too many "+a.name+" warnings - additional warnings will be suppressed"),a.count++,e;if(c){if(":"===c[0]&&(d=(h=r?r.numberFormat:n.format)(c.replace(z,""))(d)),"|"===c[0]){h=r?r.timeFormat.utc:n.time.format.utc;var p=s.dateTime2ms(d);d=s.formatDate(p,c.replace(z,""),!1,h)}}else t.hasOwnProperty(l+"Label")&&(d=t[l+"Label"]);return d}))}s.subplotSort=function(e,t){for(var r=Math.min(e.length,t.length)+1,n=0,a=0,i=0;i<r;i++){var o=e.charCodeAt(i)||0,l=t.charCodeAt(i)||0,s=o>=48&&o<=57,c=l>=48&&l<=57;if(s&&(n=10*n+o-48),c&&(a=10*a+l-48),!s||!c){if(n!==a)return n-a;if(o!==l)return o-l}}return a-n};var P=2e9;s.seedPseudoRandom=function(){P=2e9},s.pseudoRandom=function(){var e=P;return P=(69069*P+1)%4294967296,Math.abs(P-e)<429496729?s.pseudoRandom():P/4294967296},s.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=s.extractOption(e,t,"htx","hovertext");if(s.isValidTextValue(a))return n(a);var i=s.extractOption(e,t,"tx","text");return s.isValidTextValue(i)?n(i):void 0},s.isValidTextValue=function(e){return e||0===e},s.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n<t;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},s.isHidden=function(e){var t=window.getComputedStyle(e).display;return!t||"none"===t},s.getTextTransform=function(e){var t=e.noCenter,r=e.textX,n=e.textY,a=e.targetX,i=e.targetY,o=e.anchorX||0,l=e.anchorY||0,s=e.rotate,c=e.scale;return c?c>1&&(c=1):c=0,"translate("+(a-c*(r+o))+","+(i-c*(n+l))+")"+(c<1?"scale("+c+")":"")+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},s.ensureUniformFontSize=function(e,t){var r=s.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r}},function(e,t,r){"use strict";var n=r(29),a=r(63),i=r(96),o=r(36),l=r(64).addStyleRule,s=r(9),c=r(27),u=r(40),d=s.extendFlat,f=s.extendDeepAll;function h(e){var r=e.name,a=e.categories,i=e.meta;if(t.modules[r])n.log("Type "+r+" already registered");else{t.subplotsRegistry[e.basePlotModule.name]||function(e){var r=e.name;if(t.subplotsRegistry[r])return void n.log("Plot type "+r+" already registered.");for(var a in m(e),t.subplotsRegistry[r]=e,t.componentsRegistry)b(a,e.name)}(e.basePlotModule);for(var o={},s=0;s<a.length;s++)o[a[s]]=!0,t.allCategories[a[s]]=!0;for(var c in t.modules[r]={_module:e,categories:o},i&&Object.keys(i).length&&(t.modules[r].meta=i),t.allTypes.push(r),t.componentsRegistry)y(c,r);e.layoutAttributes&&d(t.traceLayoutAttributes,e.layoutAttributes);var u=e.basePlotModule,f=u.name;if("mapbox"===f){var h=u.constants.styleRules;for(var p in h)l(".js-plotly-plot .plotly .mapboxgl-"+p,h[p])}"geo"!==f&&"mapbox"!==f||void 0===typeof window||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function p(e){if("string"!=typeof e.name)throw new Error("Component module *name* must be a string.");var r=e.name;for(var n in t.componentsRegistry[r]=e,e.layoutAttributes&&(e.layoutAttributes._isLinkedToArray&&i(t.layoutArrayContainers,r),m(e)),t.modules)y(r,n);for(var a in t.subplotsRegistry)b(r,a);for(var o in t.transformsRegistry)x(r,o);e.schema&&e.schema.layout&&f(u,e.schema.layout)}function g(e){if("string"!=typeof e.name)throw new Error("Transform module *name* must be a string.");var r="Transform module "+e.name,a="function"==typeof e.transform,i="function"==typeof e.calcTransform;if(!a&&!i)throw new Error(r+" is missing a *transform* or *calcTransform* method.");for(var l in a&&i&&n.log([r+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(e.attributes)||n.log(r+" registered without an *attributes* object."),"function"!=typeof e.supplyDefaults&&n.log(r+" registered without a *supplyDefaults* method."),t.transformsRegistry[e.name]=e,t.componentsRegistry)x(l,e.name)}function v(e){var r=e.name,n=r.split("-")[0],a=e.dictionary,i=e.format,o=a&&Object.keys(a).length,l=i&&Object.keys(i).length,s=t.localeRegistry,c=s[r];if(c||(s[r]=c={}),n!==r){var u=s[n];u||(s[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=a),l&&u.format===c.format&&(u.format=i)}o&&(c.dictionary=a),l&&(c.format=i)}function m(e){if(e.layoutAttributes){var r=e.layoutAttributes._arrayAttrRegexps;if(r)for(var n=0;n<r.length;n++)i(t.layoutArrayRegexes,r[n])}}function y(e,r){var n=t.componentsRegistry[e].schema;if(n&&n.traces){var a=n.traces[r];a&&f(t.modules[r]._module.attributes,a)}}function x(e,r){var n=t.componentsRegistry[e].schema;if(n&&n.transforms){var a=n.transforms[r];a&&f(t.transformsRegistry[r].attributes,a)}}function b(e,r){var n=t.componentsRegistry[e].schema;if(n&&n.subplots){var a=t.subplotsRegistry[r],i=a.layoutAttributes,o="subplot"===a.attr?a.name:a.attr;Array.isArray(o)&&(o=o[0]);var l=n.subplots[o];i&&l&&f(i,l)}}function _(e){return"object"==typeof e&&(e=e.type),e}t.modules={},t.allCategories={},t.allTypes=[],t.subplotsRegistry={},t.transformsRegistry={},t.componentsRegistry={},t.layoutArrayContainers=[],t.layoutArrayRegexes=[],t.traceLayoutAttributes={},t.localeRegistry={},t.apiMethodRegistry={},t.collectableSubplotTypes=null,t.register=function(e){if(t.collectableSubplotTypes=null,!e)throw new Error("No argument passed to Plotly.register.");e&&!Array.isArray(e)&&(e=[e]);for(var r=0;r<e.length;r++){var n=e[r];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":h(n);break;case"transform":g(n);break;case"component":p(n);break;case"locale":v(n);break;case"apiMethod":var a=n.name;t.apiMethodRegistry[a]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},t.getModule=function(e){var r=t.modules[_(e)];return!!r&&r._module},t.traceIs=function(e,r){if("various"===(e=_(e)))return!1;var a=t.modules[e];return a||(e&&"area"!==e&&n.log("Unrecognized trace type "+e+"."),a=t.modules[c.type.dflt]),!!a.categories[r]},t.getTransformIndices=function(e,t){for(var r=[],n=e.transforms||[],a=0;a<n.length;a++)n[a].type===t&&r.push(a);return r},t.hasTransform=function(e,t){for(var r=e.transforms||[],n=0;n<r.length;n++)if(r[n].type===t)return!0;return!1},t.getComponentMethod=function(e,r){var n=t.componentsRegistry[e];return n&&n[r]||a},t.call=function(){var e=arguments[0],r=[].slice.call(arguments,1);return t.apiMethodRegistry[e].apply(null,r)}},function(e,t,r){var n,a;!function(){var i={version:"3.5.17"},o=[].slice,l=function(e){return o.call(e)},s=this.document;function c(e){return e&&(e.ownerDocument||e.document||e).documentElement}function u(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(s)try{l(s.documentElement.childNodes)[0].nodeType}catch(e){l=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),s)try{s.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var d=this.Element.prototype,f=d.setAttribute,h=d.setAttributeNS,p=this.CSSStyleDeclaration.prototype,g=p.setProperty;d.setAttribute=function(e,t){f.call(this,e,t+"")},d.setAttributeNS=function(e,t,r){h.call(this,e,t,r+"")},p.setProperty=function(e,t,r){g.call(this,e,t+"",r)}}function v(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function m(e){return null===e?NaN:+e}function y(e){return!isNaN(e)}function x(e){return{left:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n<a;){var i=n+a>>>1;e(t[i],r)<0?n=i+1:a=i}return n},right:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n<a;){var i=n+a>>>1;e(t[i],r)>0?a=i:n=i+1}return n}}}i.ascending=v,i.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},i.min=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=e[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=e[a])&&r>n&&(r=n)}else{for(;++a<i;)if(null!=(n=t.call(e,e[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=t.call(e,e[a],a))&&r>n&&(r=n)}return r},i.max=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a<i;)if(null!=(n=e[a])&&n>=n){r=n;break}for(;++a<i;)null!=(n=e[a])&&n>r&&(r=n)}else{for(;++a<i;)if(null!=(n=t.call(e,e[a],a))&&n>=n){r=n;break}for(;++a<i;)null!=(n=t.call(e,e[a],a))&&n>r&&(r=n)}return r},i.extent=function(e,t){var r,n,a,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(n=e[i])&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=e[i])&&(r>n&&(r=n),a<n&&(a=n))}else{for(;++i<o;)if(null!=(n=t.call(e,e[i],i))&&n>=n){r=a=n;break}for(;++i<o;)null!=(n=t.call(e,e[i],i))&&(r>n&&(r=n),a<n&&(a=n))}return[r,a]},i.sum=function(e,t){var r,n=0,a=e.length,i=-1;if(1===arguments.length)for(;++i<a;)y(r=+e[i])&&(n+=r);else for(;++i<a;)y(r=+t.call(e,e[i],i))&&(n+=r);return n},i.mean=function(e,t){var r,n=0,a=e.length,i=-1,o=a;if(1===arguments.length)for(;++i<a;)y(r=m(e[i]))?n+=r:--o;else for(;++i<a;)y(r=m(t.call(e,e[i],i)))?n+=r:--o;if(o)return n/o},i.quantile=function(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),a=+e[n-1],i=r-n;return i?a+i*(e[n]-a):a},i.median=function(e,t){var r,n=[],a=e.length,o=-1;if(1===arguments.length)for(;++o<a;)y(r=m(e[o]))&&n.push(r);else for(;++o<a;)y(r=m(t.call(e,e[o],o)))&&n.push(r);if(n.length)return i.quantile(n.sort(v),.5)},i.variance=function(e,t){var r,n,a=e.length,i=0,o=0,l=-1,s=0;if(1===arguments.length)for(;++l<a;)y(r=m(e[l]))&&(o+=(n=r-i)*(r-(i+=n/++s)));else for(;++l<a;)y(r=m(t.call(e,e[l],l)))&&(o+=(n=r-i)*(r-(i+=n/++s)));if(s>1)return o/(s-1)},i.deviation=function(){var e=i.variance.apply(this,arguments);return e?Math.sqrt(e):e};var b=x(v);function _(e){return e.length}i.bisectLeft=b.left,i.bisect=i.bisectRight=b.right,i.bisector=function(e){return x(1===e.length?function(t,r){return v(e(t),r)}:e)},i.shuffle=function(e,t,r){(i=arguments.length)<3&&(r=e.length,i<2&&(t=0));for(var n,a,i=r-t;i;)a=Math.random()*i--|0,n=e[i+t],e[i+t]=e[a+t],e[a+t]=n;return e},i.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},i.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],a=new Array(r<0?0:r);t<r;)a[t]=[n,n=e[++t]];return a},i.transpose=function(e){if(!(a=e.length))return[];for(var t=-1,r=i.min(e,_),n=new Array(r);++t<r;)for(var a,o=-1,l=n[t]=new Array(a);++o<a;)l[o]=e[o][t];return n},i.zip=function(){return i.transpose(arguments)},i.keys=function(e){var t=[];for(var r in e)t.push(r);return t},i.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},i.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},i.merge=function(e){for(var t,r,n,a=e.length,i=-1,o=0;++i<a;)o+=e[i].length;for(r=new Array(o);--a>=0;)for(t=(n=e[a]).length;--t>=0;)r[--o]=n[t];return r};var w=Math.abs;function k(e){for(var t=1;e*t%1;)t*=10;return t}function T(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function A(){this._=Object.create(null)}i.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r==1/0)throw new Error("infinite range");var n,a=[],i=k(w(r)),o=-1;if(e*=i,t*=i,(r*=i)<0)for(;(n=e+r*++o)>t;)a.push(n/i);else for(;(n=e+r*++o)<t;)a.push(n/i);return a},i.map=function(e,t){var r=new A;if(e instanceof A)e.forEach((function(e,t){r.set(e,t)}));else if(Array.isArray(e)){var n,a=-1,i=e.length;if(1===arguments.length)for(;++a<i;)r.set(a,e[a]);else for(;++a<i;)r.set(t.call(e,n=e[a],a),n)}else for(var o in e)r.set(o,e[o]);return r};function M(e){return"__proto__"==(e+="")||"\0"===e[0]?"\0"+e:e}function S(e){return"\0"===(e+="")[0]?e.slice(1):e}function L(e){return M(e)in this._}function C(e){return(e=M(e))in this._&&delete this._[e]}function D(){var e=[];for(var t in this._)e.push(S(t));return e}function O(){var e=0;for(var t in this._)++e;return e}function z(){for(var e in this._)return!1;return!0}function I(){this._=Object.create(null)}function P(e){return e}function j(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}function E(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var r=0,n=R.length;r<n;++r){var a=R[r]+t;if(a in e)return a}}T(A,{has:L,get:function(e){return this._[M(e)]},set:function(e,t){return this._[M(e)]=t},remove:C,keys:D,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:S(t),value:this._[t]});return e},size:O,empty:z,forEach:function(e){for(var t in this._)e.call(this,S(t),this._[t])}}),i.nest=function(){var e,t,r={},n=[],a=[];function o(a,i,l){if(l>=n.length)return t?t.call(r,i):e?i.sort(e):i;for(var s,c,u,d,f=-1,h=i.length,p=n[l++],g=new A;++f<h;)(d=g.get(s=p(c=i[f])))?d.push(c):g.set(s,[c]);return a?(c=a(),u=function(e,t){c.set(e,o(a,t,l))}):(c={},u=function(e,t){c[e]=o(a,t,l)}),g.forEach(u),c}return r.map=function(e,t){return o(t,e,0)},r.entries=function(e){return function e(t,r){if(r>=n.length)return t;var i=[],o=a[r++];return t.forEach((function(t,n){i.push({key:t,values:e(n,r)})})),o?i.sort((function(e,t){return o(e.key,t.key)})):i}(o(i.map,e,0),0)},r.key=function(e){return n.push(e),r},r.sortKeys=function(e){return a[n.length-1]=e,r},r.sortValues=function(t){return e=t,r},r.rollup=function(e){return t=e,r},r},i.set=function(e){var t=new I;if(e)for(var r=0,n=e.length;r<n;++r)t.add(e[r]);return t},T(I,{has:L,add:function(e){return this._[M(e+="")]=!0,e},remove:C,values:D,size:O,empty:z,forEach:function(e){for(var t in this._)e.call(this,S(t))}}),i.behavior={},i.rebind=function(e,t){for(var r,n=1,a=arguments.length;++n<a;)e[r=arguments[n]]=j(e,t,t[r]);return e};var R=["webkit","ms","moz","Moz","o","O"];function N(){}function F(){}function B(e){var t=[],r=new A;function n(){for(var r,n=t,a=-1,i=n.length;++a<i;)(r=n[a].on)&&r.apply(this,arguments);return e}return n.on=function(n,a){var i,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,t=t.slice(0,i=t.indexOf(o)).concat(t.slice(i+1)),r.remove(n)),a&&t.push(r.set(n,{on:a})),e)},n}function H(){i.event.preventDefault()}function q(){for(var e,t=i.event;e=t.sourceEvent;)t=e;return t}function V(e){for(var t=new F,r=0,n=arguments.length;++r<n;)t[arguments[r]]=B(t);return t.of=function(r,n){return function(a){try{var o=a.sourceEvent=i.event;a.target=e,i.event=a,t[a.type].apply(r,n)}finally{i.event=o}}},t}i.dispatch=function(){for(var e=new F,t=-1,r=arguments.length;++t<r;)e[arguments[t]]=B(e);return e},F.prototype.on=function(e,t){var r=e.indexOf("."),n="";if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},i.event=null,i.requote=function(e){return e.replace(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,G={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function Z(e){return G(e,J),e}var Y=function(e,t){return t.querySelector(e)},X=function(e,t){return t.querySelectorAll(e)},W=function(e,t){var r=e.matches||e[E(e,"matchesSelector")];return(W=function(e,t){return r.call(e,t)})(e,t)};"function"==typeof Sizzle&&(Y=function(e,t){return Sizzle(e,t)[0]||null},X=Sizzle,W=Sizzle.matchesSelector),i.selection=function(){return i.select(s.documentElement)};var J=i.selection.prototype=[];function $(e){return"function"==typeof e?e:function(){return Y(e,this)}}function Q(e){return"function"==typeof e?e:function(){return X(e,this)}}J.select=function(e){var t,r,n,a,i=[];e=$(e);for(var o=-1,l=this.length;++o<l;){i.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var s=-1,c=n.length;++s<c;)(a=n[s])?(t.push(r=e.call(a,a.__data__,s,o)),r&&"__data__"in a&&(r.__data__=a.__data__)):t.push(null)}return Z(i)},J.selectAll=function(e){var t,r,n=[];e=Q(e);for(var a=-1,i=this.length;++a<i;)for(var o=this[a],s=-1,c=o.length;++s<c;)(r=o[s])&&(n.push(t=l(e.call(r,r.__data__,s,a))),t.parentNode=r);return Z(n)};var K="http://www.w3.org/1999/xhtml",ee={svg:"http://www.w3.org/2000/svg",xhtml:K,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function te(e,t){return e=i.ns.qualify(e),null==t?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof t?e.local?function(){var r=t.apply(this,arguments);null==r?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}:function(){var r=t.apply(this,arguments);null==r?this.removeAttribute(e):this.setAttribute(e,r)}:e.local?function(){this.setAttributeNS(e.space,e.local,t)}:function(){this.setAttribute(e,t)}}function re(e){return e.trim().replace(/\s+/g," ")}function ne(e){return new RegExp("(?:^|\\s+)"+i.requote(e)+"(?:\\s+|$)","g")}function ae(e){return(e+"").trim().split(/^|\s+/)}function ie(e,t){var r=(e=ae(e).map(oe)).length;return"function"==typeof t?function(){for(var n=-1,a=t.apply(this,arguments);++n<r;)e[n](this,a)}:function(){for(var n=-1;++n<r;)e[n](this,t)}}function oe(e){var t=ne(e);return function(r,n){if(a=r.classList)return n?a.add(e):a.remove(e);var a=r.getAttribute("class")||"";n?(t.lastIndex=0,t.test(a)||r.setAttribute("class",re(a+" "+e))):r.setAttribute("class",re(a.replace(t," ")))}}function le(e,t,r){return null==t?function(){this.style.removeProperty(e)}:"function"==typeof t?function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(e):this.style.setProperty(e,n,r)}:function(){this.style.setProperty(e,t,r)}}function se(e,t){return null==t?function(){delete this[e]}:"function"==typeof t?function(){var r=t.apply(this,arguments);null==r?delete this[e]:this[e]=r}:function(){this[e]=t}}function ce(e){return"function"==typeof e?e:(e=i.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===K&&t.documentElement.namespaceURI===K?t.createElement(e):t.createElementNS(r,e)}}function ue(){var e=this.parentNode;e&&e.removeChild(this)}function de(e){return{__data__:e}}function fe(e){return function(){return W(this,e)}}function he(e){return arguments.length||(e=v),function(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}}function pe(e,t){for(var r=0,n=e.length;r<n;r++)for(var a,i=e[r],o=0,l=i.length;o<l;o++)(a=i[o])&&t(a,o,r);return e}function ge(e){return G(e,ve),e}i.ns={prefix:ee,qualify:function(e){var t=e.indexOf(":"),r=e;return t>=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),ee.hasOwnProperty(r)?{space:ee[r],local:e}:e}},J.attr=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node();return(e=i.ns.qualify(e)).local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}for(t in e)this.each(te(t,e[t]));return this}return this.each(te(e,t))},J.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node(),n=(e=ae(e)).length,a=-1;if(t=r.classList){for(;++a<n;)if(!t.contains(e[a]))return!1}else for(t=r.getAttribute("class");++a<n;)if(!ne(e[a]).test(t))return!1;return!0}for(t in e)this.each(ie(t,e[t]));return this}return this.each(ie(e,t))},J.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=""),e)this.each(le(r,e[r],t));return this}if(n<2){var a=this.node();return u(a).getComputedStyle(a,null).getPropertyValue(e)}r=""}return this.each(le(e,t,r))},J.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(se(t,e[t]));return this}return this.each(se(e,t))},J.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},J.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},J.append=function(e){return e=ce(e),this.select((function(){return this.appendChild(e.apply(this,arguments))}))},J.insert=function(e,t){return e=ce(e),t=$(t),this.select((function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)}))},J.remove=function(){return this.each(ue)},J.data=function(e,t){var r,n,a=-1,i=this.length;if(!arguments.length){for(e=new Array(i=(r=this[0]).length);++a<i;)(n=r[a])&&(e[a]=n.__data__);return e}function o(e,r){var n,a,i,o=e.length,u=r.length,d=Math.min(o,u),f=new Array(u),h=new Array(u),p=new Array(o);if(t){var g,v=new A,m=new Array(o);for(n=-1;++n<o;)(a=e[n])&&(v.has(g=t.call(a,a.__data__,n))?p[n]=a:v.set(g,a),m[n]=g);for(n=-1;++n<u;)(a=v.get(g=t.call(r,i=r[n],n)))?!0!==a&&(f[n]=a,a.__data__=i):h[n]=de(i),v.set(g,!0);for(n=-1;++n<o;)n in m&&!0!==v.get(m[n])&&(p[n]=e[n])}else{for(n=-1;++n<d;)a=e[n],i=r[n],a?(a.__data__=i,f[n]=a):h[n]=de(i);for(;n<u;++n)h[n]=de(r[n]);for(;n<o;++n)p[n]=e[n]}h.update=f,h.parentNode=f.parentNode=p.parentNode=e.parentNode,l.push(h),s.push(f),c.push(p)}var l=ge([]),s=Z([]),c=Z([]);if("function"==typeof e)for(;++a<i;)o(r=this[a],e.call(r,r.parentNode.__data__,a));else for(;++a<i;)o(r=this[a],e);return s.enter=function(){return l},s.exit=function(){return c},s},J.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},J.filter=function(e){var t,r,n,a=[];"function"!=typeof e&&(e=fe(e));for(var i=0,o=this.length;i<o;i++){a.push(t=[]),t.parentNode=(r=this[i]).parentNode;for(var l=0,s=r.length;l<s;l++)(n=r[l])&&e.call(n,n.__data__,l,i)&&t.push(n)}return Z(a)},J.order=function(){for(var e=-1,t=this.length;++e<t;)for(var r,n=this[e],a=n.length-1,i=n[a];--a>=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},J.sort=function(e){e=he.apply(this,arguments);for(var t=-1,r=this.length;++t<r;)this[t].sort(e);return this.order()},J.each=function(e){return pe(this,(function(t,r,n){e.call(t,t.__data__,r,n)}))},J.call=function(e){var t=l(arguments);return e.apply(t[0]=this,t),this},J.empty=function(){return!this.node()},J.node=function(){for(var e=0,t=this.length;e<t;e++)for(var r=this[e],n=0,a=r.length;n<a;n++){var i=r[n];if(i)return i}return null},J.size=function(){var e=0;return pe(this,(function(){++e})),e};var ve=[];function me(e){var t,r;return function(n,a,i){var o,l=e[i].update,s=l.length;for(i!=r&&(r=i,t=0),a>=t&&(t=a+1);!(o=l[t])&&++t<s;);return o}}function ye(e,t,r){var n="__on"+e,a=e.indexOf("."),o=be;a>0&&(e=e.slice(0,a));var s=xe.get(e);function c(){var t=this[n];t&&(this.removeEventListener(e,t,t.$),delete this[n])}return s&&(e=s,o=_e),a?t?function(){var a=o(t,l(arguments));c.call(this),this.addEventListener(e,this[n]=a,a.$=r),a._=t}:c:t?N:function(){var t,r=new RegExp("^__on([^.]+)"+i.requote(e)+"$");for(var n in this)if(t=n.match(r)){var a=this[n];this.removeEventListener(t[1],a,a.$),delete this[n]}}}i.selection.enter=ge,i.selection.enter.prototype=ve,ve.append=J.append,ve.empty=J.empty,ve.node=J.node,ve.call=J.call,ve.size=J.size,ve.select=function(e){for(var t,r,n,a,i,o=[],l=-1,s=this.length;++l<s;){n=(a=this[l]).update,o.push(t=[]),t.parentNode=a.parentNode;for(var c=-1,u=a.length;++c<u;)(i=a[c])?(t.push(n[c]=r=e.call(a.parentNode,i.__data__,c,l)),r.__data__=i.__data__):t.push(null)}return Z(o)},ve.insert=function(e,t){return arguments.length<2&&(t=me(this)),J.insert.call(this,e,t)},i.select=function(e){var t;return"string"==typeof e?(t=[Y(e,s)]).parentNode=s.documentElement:(t=[e]).parentNode=c(e),Z([t])},i.selectAll=function(e){var t;return"string"==typeof e?(t=l(X(e,s))).parentNode=s.documentElement:(t=l(e)).parentNode=null,Z([t])},J.on=function(e,t,r){var n=arguments.length;if(n<3){if("string"!=typeof e){for(r in n<2&&(t=!1),e)this.each(ye(r,e[r],t));return this}if(n<2)return(n=this.node()["__on"+e])&&n._;r=!1}return this.each(ye(e,t,r))};var xe=i.map({mouseenter:"mouseover",mouseleave:"mouseout"});function be(e,t){return function(r){var n=i.event;i.event=r,t[0]=this.__data__;try{e.apply(this,t)}finally{i.event=n}}}function _e(e,t){var r=be(e,t);return function(e){var t=e.relatedTarget;t&&(t===this||8&t.compareDocumentPosition(this))||r.call(this,e)}}s&&xe.forEach((function(e){"on"+e in s&&xe.remove(e)}));var we,ke=0;function Te(e){var t=".dragsuppress-"+ ++ke,r="click"+t,n=i.select(u(e)).on("touchmove"+t,H).on("dragstart"+t,H).on("selectstart"+t,H);if(null==we&&(we=!("onselectstart"in e)&&E(e.style,"userSelect")),we){var a=c(e).style,o=a[we];a[we]="none"}return function(e){if(n.on(t,null),we&&(a[we]=o),e){var i=function(){n.on(r,null)};n.on(r,(function(){H(),i()}),!0),setTimeout(i,0)}}}i.mouse=function(e){return Me(e,q())};var Ae=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Me(e,t){t.changedTouches&&(t=t.changedTouches[0]);var r=e.ownerSVGElement||e;if(r.createSVGPoint){var n=r.createSVGPoint();if(Ae<0){var a=u(e);if(a.scrollX||a.scrollY){var o=(r=i.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();Ae=!(o.f||o.e),r.remove()}}return Ae?(n.x=t.pageX,n.y=t.pageY):(n.x=t.clientX,n.y=t.clientY),[(n=n.matrixTransform(e.getScreenCTM().inverse())).x,n.y]}var l=e.getBoundingClientRect();return[t.clientX-l.left-e.clientLeft,t.clientY-l.top-e.clientTop]}function Se(){return i.event.changedTouches[0].identifier}i.touch=function(e,t,r){if(arguments.length<3&&(r=t,t=q().changedTouches),t)for(var n,a=0,i=t.length;a<i;++a)if((n=t[a]).identifier===r)return Me(e,n)},i.behavior.drag=function(){var e=V(a,"drag","dragstart","dragend"),t=null,r=o(N,i.mouse,u,"mousemove","mouseup"),n=o(Se,i.touch,P,"touchmove","touchend");function a(){this.on("mousedown.drag",r).on("touchstart.drag",n)}function o(r,n,a,o,l){return function(){var s,c=this,u=i.event.target.correspondingElement||i.event.target,d=c.parentNode,f=e.of(c,arguments),h=0,p=r(),g=".drag"+(null==p?"":"-"+p),v=i.select(a(u)).on(o+g,x).on(l+g,b),m=Te(u),y=n(d,p);function x(){var e,t,r=n(d,p);r&&(e=r[0]-y[0],t=r[1]-y[1],h|=e|t,y=r,f({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:e,dy:t}))}function b(){n(d,p)&&(v.on(o+g,null).on(l+g,null),m(h),f({type:"dragend"}))}s=t?[(s=t.apply(c,arguments)).x-y[0],s.y-y[1]]:[0,0],f({type:"dragstart"})}}return a.origin=function(e){return arguments.length?(t=e,a):t},i.rebind(a,e,"on")},i.touches=function(e,t){return arguments.length<2&&(t=q().touches),t?l(t).map((function(t){var r=Me(e,t);return r.identifier=t.identifier,r})):[]};var Le=1e-6,Ce=1e-12,De=Math.PI,Oe=2*De,ze=Oe-Le,Ie=De/2,Pe=De/180,je=180/De;function Ee(e){return e>0?1:e<0?-1:0}function Re(e,t,r){return(t[0]-e[0])*(r[1]-e[1])-(t[1]-e[1])*(r[0]-e[0])}function Ne(e){return e>1?0:e<-1?De:Math.acos(e)}function Fe(e){return e>1?Ie:e<-1?-Ie:Math.asin(e)}function Be(e){return((e=Math.exp(e))+1/e)/2}function He(e){return(e=Math.sin(e/2))*e}var qe=Math.SQRT2;i.interpolateZoom=function(e,t){var r,n,a=e[0],i=e[1],o=e[2],l=t[0],s=t[1],c=t[2],u=l-a,d=s-i,f=u*u+d*d;if(f<Ce)n=Math.log(c/o)/qe,r=function(e){return[a+e*u,i+e*d,o*Math.exp(qe*e*n)]};else{var h=Math.sqrt(f),p=(c*c-o*o+4*f)/(2*o*2*h),g=(c*c-o*o-4*f)/(2*c*2*h),v=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/qe,r=function(e){var t,r=e*n,l=Be(v),s=o/(2*h)*(l*(t=qe*r+v,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+s*u,i+s*d,o*l/Be(qe*r+v)]}}return r.duration=1e3*n,r},i.behavior.zoom=function(){var e,t,r,n,a,o,l,c,d,f={x:0,y:0,k:1},h=[960,500],p=Ge,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=V(w,"zoomstart","zoom","zoomend");function w(e){e.on(m,O).on(Ue+".zoom",I).on("dblclick.zoom",P).on(b,z)}function k(e){return[(e[0]-f.x)/f.k,(e[1]-f.y)/f.k]}function T(e){f.k=Math.max(p[0],Math.min(p[1],e))}function A(e,t){t=function(e){return[e[0]*f.k+f.x,e[1]*f.k+f.y]}(t),f.x+=e[0]-t[0],f.y+=e[1]-t[1]}function M(e,r,n,a){e.__chart__={x:f.x,y:f.y,k:f.k},T(Math.pow(2,a)),A(t=r,n),e=i.select(e),g>0&&(e=e.transition().duration(g)),e.call(w.event)}function S(){l&&l.domain(o.range().map((function(e){return(e-f.x)/f.k})).map(o.invert)),d&&d.domain(c.range().map((function(e){return(e-f.y)/f.k})).map(c.invert))}function L(e){v++||e({type:"zoomstart"})}function C(e){S(),e({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function D(e){--v||(e({type:"zoomend"}),t=null)}function O(){var e=this,t=_.of(e,arguments),r=0,n=i.select(u(e)).on(y,l).on(x,s),a=k(i.mouse(e)),o=Te(e);function l(){r=1,A(i.mouse(e),a),C(t)}function s(){n.on(y,null).on(x,null),o(r),D(t)}_l.call(e),L(t)}function z(){var e,t=this,r=_.of(t,arguments),n={},o=0,l=".zoom-"+i.event.changedTouches[0].identifier,s="touchmove"+l,c="touchend"+l,u=[],d=i.select(t),h=Te(t);function p(){var r=i.touches(t);return e=f.k,r.forEach((function(e){e.identifier in n&&(n[e.identifier]=k(e))})),r}function g(){var e=i.event.target;i.select(e).on(s,v).on(c,y),u.push(e);for(var r=i.event.changedTouches,l=0,d=r.length;l<d;++l)n[r[l].identifier]=null;var h=p(),g=Date.now();if(1===h.length){if(g-a<500){var m=h[0];M(t,m,n[m.identifier],Math.floor(Math.log(f.k)/Math.LN2)+1),H()}a=g}else if(h.length>1){m=h[0];var x=h[1],b=m[0]-x[0],_=m[1]-x[1];o=b*b+_*_}}function v(){var l,s,c,u,d=i.touches(t);_l.call(t);for(var f=0,h=d.length;f<h;++f,u=null)if(c=d[f],u=n[c.identifier]){if(s)break;l=c,s=u}if(u){var p=(p=c[0]-l[0])*p+(p=c[1]-l[1])*p,g=o&&Math.sqrt(p/o);l=[(l[0]+c[0])/2,(l[1]+c[1])/2],s=[(s[0]+u[0])/2,(s[1]+u[1])/2],T(g*e)}a=null,A(l,s),C(r)}function y(){if(i.event.touches.length){for(var e=i.event.changedTouches,t=0,a=e.length;t<a;++t)delete n[e[t].identifier];for(var o in n)return void p()}i.selectAll(u).on(l,null),d.on(m,O).on(b,z),h(),D(r)}g(),L(r),d.on(m,null).on(b,g)}function I(){var a=_.of(this,arguments);n?clearTimeout(n):(_l.call(this),e=k(t=r||i.mouse(this)),L(a)),n=setTimeout((function(){n=null,D(a)}),50),H(),T(Math.pow(2,.002*Ve())*f.k),A(t,e),C(a)}function P(){var e=i.mouse(this),t=Math.log(f.k)/Math.LN2;M(this,e,k(e),i.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}return Ue||(Ue="onwheel"in s?(Ve=function(){return-i.event.deltaY*(i.event.deltaMode?120:1)},"wheel"):"onmousewheel"in s?(Ve=function(){return i.event.wheelDelta},"mousewheel"):(Ve=function(){return-i.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each((function(){var e=_.of(this,arguments),r=f;Tl?i.select(this).transition().each("start.zoom",(function(){f=this.__chart__||{x:0,y:0,k:1},L(e)})).tween("zoom:zoom",(function(){var n=h[0],a=h[1],o=t?t[0]:n/2,l=t?t[1]:a/2,s=i.interpolateZoom([(o-f.x)/f.k,(l-f.y)/f.k,n/f.k],[(o-r.x)/r.k,(l-r.y)/r.k,n/r.k]);return function(t){var r=s(t),a=n/r[2];this.__chart__=f={x:o-r[0]*a,y:l-r[1]*a,k:a},C(e)}})).each("interrupt.zoom",(function(){D(e)})).each("end.zoom",(function(){D(e)})):(this.__chart__=f,L(e),C(e),D(e))}))},w.translate=function(e){return arguments.length?(f={x:+e[0],y:+e[1],k:f.k},S(),w):[f.x,f.y]},w.scale=function(e){return arguments.length?(f={x:f.x,y:f.y,k:null},T(+e),S(),w):f.k},w.scaleExtent=function(e){return arguments.length?(p=null==e?Ge:[+e[0],+e[1]],w):p},w.center=function(e){return arguments.length?(r=e&&[+e[0],+e[1]],w):r},w.size=function(e){return arguments.length?(h=e&&[+e[0],+e[1]],w):h},w.duration=function(e){return arguments.length?(g=+e,w):g},w.x=function(e){return arguments.length?(l=e,o=e.copy(),f={x:0,y:0,k:1},w):l},w.y=function(e){return arguments.length?(d=e,c=e.copy(),f={x:0,y:0,k:1},w):d},i.rebind(w,_,"on")};var Ve,Ue,Ge=[0,1/0];function Ze(){}function Ye(e,t,r){return this instanceof Ye?(this.h=+e,this.s=+t,void(this.l=+r)):arguments.length<2?e instanceof Ye?new Ye(e.h,e.s,e.l):ft(""+e,ht,Ye):new Ye(e,t,r)}i.color=Ze,Ze.prototype.toString=function(){return this.rgb()+""},i.hsl=Ye;var Xe=Ye.prototype=new Ze;function We(e,t,r){var n,a;function i(e){return Math.round(255*function(e){return e>360?e-=360:e<0&&(e+=360),e<60?n+(a-n)*e/60:e<180?a:e<240?n+(a-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+t):r+t-r*t),new lt(i(e+120),i(e),i(e-120))}function Je(e,t,r){return this instanceof Je?(this.h=+e,this.c=+t,void(this.l=+r)):arguments.length<2?e instanceof Je?new Je(e.h,e.c,e.l):nt(e instanceof Ke?e.l:(e=pt((e=i.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Je(e,t,r)}Xe.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Ye(this.h,this.s,this.l/e)},Xe.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Ye(this.h,this.s,e*this.l)},Xe.rgb=function(){return We(this.h,this.s,this.l)},i.hcl=Je;var $e=Je.prototype=new Ze;function Qe(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Ke(r,Math.cos(e*=Pe)*t,Math.sin(e)*t)}function Ke(e,t,r){return this instanceof Ke?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof Ke?new Ke(e.l,e.a,e.b):e instanceof Je?Qe(e.h,e.c,e.l):pt((e=lt(e)).r,e.g,e.b):new Ke(e,t,r)}$e.brighter=function(e){return new Je(this.h,this.c,Math.min(100,this.l+et*(arguments.length?e:1)))},$e.darker=function(e){return new Je(this.h,this.c,Math.max(0,this.l-et*(arguments.length?e:1)))},$e.rgb=function(){return Qe(this.h,this.c,this.l).rgb()},i.lab=Ke;var et=18,tt=Ke.prototype=new Ze;function rt(e,t,r){var n=(e+16)/116,a=n+t/500,i=n-r/200;return new lt(ot(3.2404542*(a=.95047*at(a))-1.5371385*(n=1*at(n))-.4985314*(i=1.08883*at(i))),ot(-.969266*a+1.8760108*n+.041556*i),ot(.0556434*a-.2040259*n+1.0572252*i))}function nt(e,t,r){return e>0?new Je(Math.atan2(r,t)*je,Math.sqrt(t*t+r*r),e):new Je(NaN,NaN,e)}function at(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function it(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function ot(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function lt(e,t,r){return this instanceof lt?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof lt?new lt(e.r,e.g,e.b):ft(""+e,lt,We):new lt(e,t,r)}function st(e){return new lt(e>>16,e>>8&255,255&e)}function ct(e){return st(e)+""}tt.brighter=function(e){return new Ke(Math.min(100,this.l+et*(arguments.length?e:1)),this.a,this.b)},tt.darker=function(e){return new Ke(Math.max(0,this.l-et*(arguments.length?e:1)),this.a,this.b)},tt.rgb=function(){return rt(this.l,this.a,this.b)},i.rgb=lt;var ut=lt.prototype=new Ze;function dt(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function ft(e,t,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return t(vt(a[0]),vt(a[1]),vt(a[2]))}return(i=mt.get(e))?t(i.r,i.g,i.b):(null==e||"#"!==e.charAt(0)||isNaN(i=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===e.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),t(o,l,s))}function ht(e,t,r){var n,a,i=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=e==o?(t-r)/l+(t<r?6:0):t==o?(r-e)/l+2:(e-t)/l+4,n*=60):(n=NaN,a=s>0&&s<1?0:n),new Ye(n,a,s)}function pt(e,t,r){var n=it((.4124564*(e=gt(e))+.3575761*(t=gt(t))+.1804375*(r=gt(r)))/.95047),a=it((.2126729*e+.7151522*t+.072175*r)/1);return Ke(116*a-16,500*(n-a),200*(a-it((.0193339*e+.119192*t+.9503041*r)/1.08883)))}function gt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function vt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}ut.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,a=30;return t||r||n?(t&&t<a&&(t=a),r&&r<a&&(r=a),n&&n<a&&(n=a),new lt(Math.min(255,t/e),Math.min(255,r/e),Math.min(255,n/e))):new lt(a,a,a)},ut.darker=function(e){return new lt((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},ut.hsl=function(){return ht(this.r,this.g,this.b)},ut.toString=function(){return"#"+dt(this.r)+dt(this.g)+dt(this.b)};var mt=i.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 yt(e){return"function"==typeof e?e:function(){return e}}function xt(e){return function(t,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),bt(t,r,e,n)}}function bt(e,t,r,n){var a={},o=i.dispatch("beforesend","progress","load","error"),s={},c=new XMLHttpRequest,u=null;function d(){var e,t=c.status;if(!t&&function(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}(c)||t>=200&&t<300||304===t){try{e=r