UNPKG

jupyterlab_sparkmonitor

Version:

Jupyter Lab extension to monitor Apache Spark Jobs

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