react-vis
Version:
Data visualization library based on React and d3.
2 lines • 711 kB
JavaScript
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.reactVis=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.d3=global.d3||{})})(this,function(exports){"use strict";var ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN};var bisector=function(compare){if(compare.length===1)compare=ascendingComparator(compare);return{left:function(a,x,lo,hi){if(lo==null)lo=0;if(hi==null)hi=a.length;while(lo<hi){var mid=lo+hi>>>1;if(compare(a[mid],x)<0)lo=mid+1;else hi=mid}return lo},right:function(a,x,lo,hi){if(lo==null)lo=0;if(hi==null)hi=a.length;while(lo<hi){var mid=lo+hi>>>1;if(compare(a[mid],x)>0)hi=mid;else lo=mid+1}return lo}}};function ascendingComparator(f){return function(d,x){return ascending(f(d),x)}}var ascendingBisect=bisector(ascending);var bisectRight=ascendingBisect.right;var bisectLeft=ascendingBisect.left;var pairs=function(array,f){if(f==null)f=pair;var i=0,n=array.length-1,p=array[0],pairs=new Array(n<0?0:n);while(i<n)pairs[i]=f(p,p=array[++i]);return pairs};function pair(a,b){return[a,b]}var cross=function(values0,values1,reduce){var n0=values0.length,n1=values1.length,values=new Array(n0*n1),i0,i1,i,value0;if(reduce==null)reduce=pair;for(i0=i=0;i0<n0;++i0){for(value0=values0[i0],i1=0;i1<n1;++i1,++i){values[i]=reduce(value0,values1[i1])}}return values};var descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN};var number=function(x){return x===null?NaN:+x};var variance=function(values,valueof){var n=values.length,m=0,i=-1,mean=0,value,delta,sum=0;if(valueof==null){while(++i<n){if(!isNaN(value=number(values[i]))){delta=value-mean;mean+=delta/++m;sum+=delta*(value-mean)}}}else{while(++i<n){if(!isNaN(value=number(valueof(values[i],i,values)))){delta=value-mean;mean+=delta/++m;sum+=delta*(value-mean)}}}if(m>1)return sum/(m-1)};var deviation=function(array,f){var v=variance(array,f);return v?Math.sqrt(v):v};var extent=function(values,valueof){var n=values.length,i=-1,value,min,max;if(valueof==null){while(++i<n){if((value=values[i])!=null&&value>=value){min=max=value;while(++i<n){if((value=values[i])!=null){if(min>value)min=value;if(max<value)max=value}}}}}else{while(++i<n){if((value=valueof(values[i],i,values))!=null&&value>=value){min=max=value;while(++i<n){if((value=valueof(values[i],i,values))!=null){if(min>value)min=value;if(max<value)max=value}}}}}return[min,max]};var array=Array.prototype;var slice=array.slice;var map=array.map;var constant=function(x){return function(){return x}};var identity=function(x){return x};var range=function(start,stop,step){start=+start,stop=+stop,step=(n=arguments.length)<2?(stop=start,start=0,1):n<3?1:+step;var i=-1,n=Math.max(0,Math.ceil((stop-start)/step))|0,range=new Array(n);while(++i<n){range[i]=start+i*step}return range};var e10=Math.sqrt(50);var e5=Math.sqrt(10);var e2=Math.sqrt(2);var ticks=function(start,stop,count){var reverse=stop<start,i=-1,n,ticks,step;if(reverse)n=start,start=stop,stop=n;if((step=tickIncrement(start,stop,count))===0||!isFinite(step))return[];if(step>0){start=Math.ceil(start/step);stop=Math.floor(stop/step);ticks=new Array(n=Math.ceil(stop-start+1));while(++i<n)ticks[i]=(start+i)*step}else{start=Math.floor(start*step);stop=Math.ceil(stop*step);ticks=new Array(n=Math.ceil(start-stop+1));while(++i<n)ticks[i]=(start-i)/step}if(reverse)ticks.reverse();return ticks};function tickIncrement(start,stop,count){var step=(stop-start)/Math.max(0,count),power=Math.floor(Math.log(step)/Math.LN10),error=step/Math.pow(10,power);return power>=0?(error>=e10?10:error>=e5?5:error>=e2?2:1)*Math.pow(10,power):-Math.pow(10,-power)/(error>=e10?10:error>=e5?5:error>=e2?2:1)}function tickStep(start,stop,count){var step0=Math.abs(stop-start)/Math.max(0,count),step1=Math.pow(10,Math.floor(Math.log(step0)/Math.LN10)),error=step0/step1;if(error>=e10)step1*=10;else if(error>=e5)step1*=5;else if(error>=e2)step1*=2;return stop<start?-step1:step1}var sturges=function(values){return Math.ceil(Math.log(values.length)/Math.LN2)+1};var histogram=function(){var value=identity,domain=extent,threshold=sturges;function histogram(data){var i,n=data.length,x,values=new Array(n);for(i=0;i<n;++i){values[i]=value(data[i],i,data)}var xz=domain(values),x0=xz[0],x1=xz[1],tz=threshold(values,x0,x1);if(!Array.isArray(tz)){tz=tickStep(x0,x1,tz);tz=range(Math.ceil(x0/tz)*tz,Math.floor(x1/tz)*tz,tz)}var m=tz.length;while(tz[0]<=x0)tz.shift(),--m;while(tz[m-1]>x1)tz.pop(),--m;var bins=new Array(m+1),bin;for(i=0;i<=m;++i){bin=bins[i]=[];bin.x0=i>0?tz[i-1]:x0;bin.x1=i<m?tz[i]:x1}for(i=0;i<n;++i){x=values[i];if(x0<=x&&x<=x1){bins[bisectRight(tz,x,0,m)].push(data[i])}}return bins}histogram.value=function(_){return arguments.length?(value=typeof _==="function"?_:constant(_),histogram):value};histogram.domain=function(_){return arguments.length?(domain=typeof _==="function"?_:constant([_[0],_[1]]),histogram):domain};histogram.thresholds=function(_){return arguments.length?(threshold=typeof _==="function"?_:Array.isArray(_)?constant(slice.call(_)):constant(_),histogram):threshold};return histogram};var quantile=function(values,p,valueof){if(valueof==null)valueof=number;if(!(n=values.length))return;if((p=+p)<=0||n<2)return+valueof(values[0],0,values);if(p>=1)return+valueof(values[n-1],n-1,values);var n,i=(n-1)*p,i0=Math.floor(i),value0=+valueof(values[i0],i0,values),value1=+valueof(values[i0+1],i0+1,values);return value0+(value1-value0)*(i-i0)};var freedmanDiaconis=function(values,min,max){values=map.call(values,number).sort(ascending);return Math.ceil((max-min)/(2*(quantile(values,.75)-quantile(values,.25))*Math.pow(values.length,-1/3)))};var scott=function(values,min,max){return Math.ceil((max-min)/(3.5*deviation(values)*Math.pow(values.length,-1/3)))};var max=function(values,valueof){var n=values.length,i=-1,value,max;if(valueof==null){while(++i<n){if((value=values[i])!=null&&value>=value){max=value;while(++i<n){if((value=values[i])!=null&&value>max){max=value}}}}}else{while(++i<n){if((value=valueof(values[i],i,values))!=null&&value>=value){max=value;while(++i<n){if((value=valueof(values[i],i,values))!=null&&value>max){max=value}}}}}return max};var mean=function(values,valueof){var n=values.length,m=n,i=-1,value,sum=0;if(valueof==null){while(++i<n){if(!isNaN(value=number(values[i])))sum+=value;else--m}}else{while(++i<n){if(!isNaN(value=number(valueof(values[i],i,values))))sum+=value;else--m}}if(m)return sum/m};var median=function(values,valueof){var n=values.length,i=-1,value,numbers=[];if(valueof==null){while(++i<n){if(!isNaN(value=number(values[i]))){numbers.push(value)}}}else{while(++i<n){if(!isNaN(value=number(valueof(values[i],i,values)))){numbers.push(value)}}}return quantile(numbers.sort(ascending),.5)};var merge=function(arrays){var n=arrays.length,m,i=-1,j=0,merged,array;while(++i<n)j+=arrays[i].length;merged=new Array(j);while(--n>=0){array=arrays[n];m=array.length;while(--m>=0){merged[--j]=array[m]}}return merged};var min=function(values,valueof){var n=values.length,i=-1,value,min;if(valueof==null){while(++i<n){if((value=values[i])!=null&&value>=value){min=value;while(++i<n){if((value=values[i])!=null&&min>value){min=value}}}}}else{while(++i<n){if((value=valueof(values[i],i,values))!=null&&value>=value){min=value;while(++i<n){if((value=valueof(values[i],i,values))!=null&&min>value){min=value}}}}}return min};var permute=function(array,indexes){var i=indexes.length,permutes=new Array(i);while(i--)permutes[i]=array[indexes[i]];return permutes};var scan=function(values,compare){if(!(n=values.length))return;var n,i=0,j=0,xi,xj=values[j];if(compare==null)compare=ascending;while(++i<n){if(compare(xi=values[i],xj)<0||compare(xj,xj)!==0){xj=xi,j=i}}if(compare(xj,xj)===0)return j};var shuffle=function(array,i0,i1){var m=(i1==null?array.length:i1)-(i0=i0==null?0:+i0),t,i;while(m){i=Math.random()*m--|0;t=array[m+i0];array[m+i0]=array[i+i0];array[i+i0]=t}return array};var sum=function(values,valueof){var n=values.length,i=-1,value,sum=0;if(valueof==null){while(++i<n){if(value=+values[i])sum+=value}}else{while(++i<n){if(value=+valueof(values[i],i,values))sum+=value}}return sum};var transpose=function(matrix){if(!(n=matrix.length))return[];for(var i=-1,m=min(matrix,length),transpose=new Array(m);++i<m;){for(var j=-1,n,row=transpose[i]=new Array(n);++j<n;){row[j]=matrix[j][i]}}return transpose};function length(d){return d.length}var zip=function(){return transpose(arguments)};exports.bisect=bisectRight;exports.bisectRight=bisectRight;exports.bisectLeft=bisectLeft;exports.ascending=ascending;exports.bisector=bisector;exports.cross=cross;exports.descending=descending;exports.deviation=deviation;exports.extent=extent;exports.histogram=histogram;exports.thresholdFreedmanDiaconis=freedmanDiaconis;exports.thresholdScott=scott;exports.thresholdSturges=sturges;exports.max=max;exports.mean=mean;exports.median=median;exports.merge=merge;exports.min=min;exports.pairs=pairs;exports.permute=permute;exports.quantile=quantile;exports.range=range;exports.scan=scan;exports.shuffle=shuffle;exports.sum=sum;exports.ticks=ticks;exports.tickIncrement=tickIncrement;exports.tickStep=tickStep;exports.transpose=transpose;exports.variance=variance;exports.zip=zip;Object.defineProperty(exports,"__esModule",{value:true})})},{}],2:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.d3=global.d3||{})})(this,function(exports){"use strict";var prefix="$";function Map(){}Map.prototype=map.prototype={constructor:Map,has:function(key){return prefix+key in this},get:function(key){return this[prefix+key]},set:function(key,value){this[prefix+key]=value;return this},remove:function(key){var property=prefix+key;return property in this&&delete this[property]},clear:function(){for(var property in this)if(property[0]===prefix)delete this[property]},keys:function(){var keys=[];for(var property in this)if(property[0]===prefix)keys.push(property.slice(1));return keys},values:function(){var values=[];for(var property in this)if(property[0]===prefix)values.push(this[property]);return values},entries:function(){var entries=[];for(var property in this)if(property[0]===prefix)entries.push({key:property.slice(1),value:this[property]});return entries},size:function(){var size=0;for(var property in this)if(property[0]===prefix)++size;return size},empty:function(){for(var property in this)if(property[0]===prefix)return false;return true},each:function(f){for(var property in this)if(property[0]===prefix)f(this[property],property.slice(1),this)}};function map(object,f){var map=new Map;if(object instanceof Map)object.each(function(value,key){map.set(key,value)});else if(Array.isArray(object)){var i=-1,n=object.length,o;if(f==null)while(++i<n)map.set(i,object[i]);else while(++i<n)map.set(f(o=object[i],i,object),o)}else if(object)for(var key in object)map.set(key,object[key]);return map}var nest=function(){var keys=[],sortKeys=[],sortValues,rollup,nest;function apply(array,depth,createResult,setResult){if(depth>=keys.length)return rollup!=null?rollup(array):sortValues!=null?array.sort(sortValues):array;var i=-1,n=array.length,key=keys[depth++],keyValue,value,valuesByKey=map(),values,result=createResult();while(++i<n){if(values=valuesByKey.get(keyValue=key(value=array[i])+"")){values.push(value)}else{valuesByKey.set(keyValue,[value])}}valuesByKey.each(function(values,key){setResult(result,key,apply(values,depth,createResult,setResult))});return result}function entries(map$$1,depth){if(++depth>keys.length)return map$$1;var array,sortKey=sortKeys[depth-1];if(rollup!=null&&depth>=keys.length)array=map$$1.entries();else array=[],map$$1.each(function(v,k){array.push({key:k,values:entries(v,depth)})});return sortKey!=null?array.sort(function(a,b){return sortKey(a.key,b.key)}):array}return nest={object:function(array){return apply(array,0,createObject,setObject)},map:function(array){return apply(array,0,createMap,setMap)},entries:function(array){return entries(apply(array,0,createMap,setMap),0)},key:function(d){keys.push(d);return nest},sortKeys:function(order){sortKeys[keys.length-1]=order;return nest},sortValues:function(order){sortValues=order;return nest},rollup:function(f){rollup=f;return nest}}};function createObject(){return{}}function setObject(object,key,value){object[key]=value}function createMap(){return map()}function setMap(map$$1,key,value){map$$1.set(key,value)}function Set(){}var proto=map.prototype;Set.prototype=set.prototype={constructor:Set,has:proto.has,add:function(value){value+="";this[prefix+value]=value;return this},remove:proto.remove,clear:proto.clear,values:proto.keys,size:proto.size,empty:proto.empty,each:proto.each};function set(object,f){var set=new Set;if(object instanceof Set)object.each(function(value){set.add(value)});else if(object){var i=-1,n=object.length;if(f==null)while(++i<n)set.add(object[i]);else while(++i<n)set.add(f(object[i],i,object))}return set}var keys=function(map){var keys=[];for(var key in map)keys.push(key);return keys};var values=function(map){var values=[];for(var key in map)values.push(map[key]);return values};var entries=function(map){var entries=[];for(var key in map)entries.push({key:key,value:map[key]});return entries};exports.nest=nest;exports.set=set;exports.map=map;exports.keys=keys;exports.values=values;exports.entries=entries;Object.defineProperty(exports,"__esModule",{value:true})})},{}],3:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.d3=global.d3||{})})(this,function(exports){"use strict";var define=function(constructor,factory,prototype){constructor.prototype=factory.prototype=prototype;prototype.constructor=constructor};function extend(parent,definition){var prototype=Object.create(parent.prototype);for(var key in definition)prototype[key]=definition[key];return prototype}function Color(){}var darker=.7;var brighter=1/darker;var reI="\\s*([+-]?\\d+)\\s*";var reN="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*";var reP="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*";var reHex3=/^#([0-9a-f]{3})$/;var reHex6=/^#([0-9a-f]{6})$/;var reRgbInteger=new RegExp("^rgb\\("+[reI,reI,reI]+"\\)$");var reRgbPercent=new RegExp("^rgb\\("+[reP,reP,reP]+"\\)$");var reRgbaInteger=new RegExp("^rgba\\("+[reI,reI,reI,reN]+"\\)$");var reRgbaPercent=new RegExp("^rgba\\("+[reP,reP,reP,reN]+"\\)$");var reHslPercent=new RegExp("^hsl\\("+[reN,reP,reP]+"\\)$");var reHslaPercent=new RegExp("^hsla\\("+[reN,reP,reP,reN]+"\\)$");var named={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};define(Color,color,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}});function color(format){var m;format=(format+"").trim().toLowerCase();return(m=reHex3.exec(format))?(m=parseInt(m[1],16),new Rgb(m>>8&15|m>>4&240,m>>4&15|m&240,(m&15)<<4|m&15,1)):(m=reHex6.exec(format))?rgbn(parseInt(m[1],16)):(m=reRgbInteger.exec(format))?new Rgb(m[1],m[2],m[3],1):(m=reRgbPercent.exec(format))?new Rgb(m[1]*255/100,m[2]*255/100,m[3]*255/100,1):(m=reRgbaInteger.exec(format))?rgba(m[1],m[2],m[3],m[4]):(m=reRgbaPercent.exec(format))?rgba(m[1]*255/100,m[2]*255/100,m[3]*255/100,m[4]):(m=reHslPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,1):(m=reHslaPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,m[4]):named.hasOwnProperty(format)?rgbn(named[format]):format==="transparent"?new Rgb(NaN,NaN,NaN,0):null}function rgbn(n){return new Rgb(n>>16&255,n>>8&255,n&255,1)}function rgba(r,g,b,a){if(a<=0)r=g=b=NaN;return new Rgb(r,g,b,a)}function rgbConvert(o){if(!(o instanceof Color))o=color(o);if(!o)return new Rgb;o=o.rgb();return new Rgb(o.r,o.g,o.b,o.opacity)}function rgb(r,g,b,opacity){return arguments.length===1?rgbConvert(r):new Rgb(r,g,b,opacity==null?1:opacity)}function Rgb(r,g,b,opacity){this.r=+r;this.g=+g;this.b=+b;this.opacity=+opacity}define(Rgb,rgb,extend(Color,{brighter:function(k){k=k==null?brighter:Math.pow(brighter,k);return new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},darker:function(k){k=k==null?darker:Math.pow(darker,k);return new Rgb(this.r*k,this.g*k,this.b*k,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&(0<=this.g&&this.g<=255)&&(0<=this.b&&this.b<=255)&&(0<=this.opacity&&this.opacity<=1)},toString:function(){var a=this.opacity;a=isNaN(a)?1:Math.max(0,Math.min(1,a));return(a===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(a===1?")":", "+a+")")}}));function hsla(h,s,l,a){if(a<=0)h=s=l=NaN;else if(l<=0||l>=1)h=s=NaN;else if(s<=0)h=NaN;return new Hsl(h,s,l,a)}function hslConvert(o){if(o instanceof Hsl)return new Hsl(o.h,o.s,o.l,o.opacity);if(!(o instanceof Color))o=color(o);if(!o)return new Hsl;if(o instanceof Hsl)return o;o=o.rgb();var r=o.r/255,g=o.g/255,b=o.b/255,min=Math.min(r,g,b),max=Math.max(r,g,b),h=NaN,s=max-min,l=(max+min)/2;if(s){if(r===max)h=(g-b)/s+(g<b)*6;else if(g===max)h=(b-r)/s+2;else h=(r-g)/s+4;s/=l<.5?max+min:2-max-min;h*=60}else{s=l>0&&l<1?0:h}return new Hsl(h,s,l,o.opacity)}function hsl(h,s,l,opacity){return arguments.length===1?hslConvert(h):new Hsl(h,s,l,opacity==null?1:opacity)}function Hsl(h,s,l,opacity){this.h=+h;this.s=+s;this.l=+l;this.opacity=+opacity}define(Hsl,hsl,extend(Color,{brighter:function(k){k=k==null?brighter:Math.pow(brighter,k);return new Hsl(this.h,this.s,this.l*k,this.opacity)},darker:function(k){k=k==null?darker:Math.pow(darker,k);return new Hsl(this.h,this.s,this.l*k,this.opacity)},rgb:function(){var h=this.h%360+(this.h<0)*360,s=isNaN(h)||isNaN(this.s)?0:this.s,l=this.l,m2=l+(l<.5?l:1-l)*s,m1=2*l-m2;return new Rgb(hsl2rgb(h>=240?h-240:h+120,m1,m2),hsl2rgb(h,m1,m2),hsl2rgb(h<120?h+240:h-120,m1,m2),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)}}));function hsl2rgb(h,m1,m2){return(h<60?m1+(m2-m1)*h/60:h<180?m2:h<240?m1+(m2-m1)*(240-h)/60:m1)*255}var deg2rad=Math.PI/180;var rad2deg=180/Math.PI;var Kn=18;var Xn=.95047;var Yn=1;var Zn=1.08883;var t0=4/29;var t1=6/29;var t2=3*t1*t1;var t3=t1*t1*t1;function labConvert(o){if(o instanceof Lab)return new Lab(o.l,o.a,o.b,o.opacity);if(o instanceof Hcl){var h=o.h*deg2rad;return new Lab(o.l,Math.cos(h)*o.c,Math.sin(h)*o.c,o.opacity)}if(!(o instanceof Rgb))o=rgbConvert(o);var b=rgb2xyz(o.r),a=rgb2xyz(o.g),l=rgb2xyz(o.b),x=xyz2lab((.4124564*b+.3575761*a+.1804375*l)/Xn),y=xyz2lab((.2126729*b+.7151522*a+.072175*l)/Yn),z=xyz2lab((.0193339*b+.119192*a+.9503041*l)/Zn);return new Lab(116*y-16,500*(x-y),200*(y-z),o.opacity)}function lab(l,a,b,opacity){return arguments.length===1?labConvert(l):new Lab(l,a,b,opacity==null?1:opacity)}function Lab(l,a,b,opacity){this.l=+l;this.a=+a;this.b=+b;this.opacity=+opacity}define(Lab,lab,extend(Color,{brighter:function(k){return new Lab(this.l+Kn*(k==null?1:k),this.a,this.b,this.opacity)},darker:function(k){return new Lab(this.l-Kn*(k==null?1:k),this.a,this.b,this.opacity)},rgb:function(){var y=(this.l+16)/116,x=isNaN(this.a)?y:y+this.a/500,z=isNaN(this.b)?y:y-this.b/200;y=Yn*lab2xyz(y);x=Xn*lab2xyz(x);z=Zn*lab2xyz(z);return new Rgb(xyz2rgb(3.2404542*x-1.5371385*y-.4985314*z),xyz2rgb(-.969266*x+1.8760108*y+.041556*z),xyz2rgb(.0556434*x-.2040259*y+1.0572252*z),this.opacity)}}));function xyz2lab(t){return t>t3?Math.pow(t,1/3):t/t2+t0}function lab2xyz(t){return t>t1?t*t*t:t2*(t-t0)}function xyz2rgb(x){return 255*(x<=.0031308?12.92*x:1.055*Math.pow(x,1/2.4)-.055)}function rgb2xyz(x){return(x/=255)<=.04045?x/12.92:Math.pow((x+.055)/1.055,2.4)}function hclConvert(o){if(o instanceof Hcl)return new Hcl(o.h,o.c,o.l,o.opacity);if(!(o instanceof Lab))o=labConvert(o);var h=Math.atan2(o.b,o.a)*rad2deg;return new Hcl(h<0?h+360:h,Math.sqrt(o.a*o.a+o.b*o.b),o.l,o.opacity)}function hcl(h,c,l,opacity){return arguments.length===1?hclConvert(h):new Hcl(h,c,l,opacity==null?1:opacity)}function Hcl(h,c,l,opacity){this.h=+h;this.c=+c;this.l=+l;this.opacity=+opacity}define(Hcl,hcl,extend(Color,{brighter:function(k){return new Hcl(this.h,this.c,this.l+Kn*(k==null?1:k),this.opacity)},darker:function(k){return new Hcl(this.h,this.c,this.l-Kn*(k==null?1:k),this.opacity)},rgb:function(){return labConvert(this).rgb()}}));var A=-.14861;var B=+1.78277;var C=-.29227;var D=-.90649;var E=+1.97294;var ED=E*D;var EB=E*B;var BC_DA=B*C-D*A;function cubehelixConvert(o){if(o instanceof Cubehelix)return new Cubehelix(o.h,o.s,o.l,o.opacity);if(!(o instanceof Rgb))o=rgbConvert(o);var r=o.r/255,g=o.g/255,b=o.b/255,l=(BC_DA*b+ED*r-EB*g)/(BC_DA+ED-EB),bl=b-l,k=(E*(g-l)-C*bl)/D,s=Math.sqrt(k*k+bl*bl)/(E*l*(1-l)),h=s?Math.atan2(k,bl)*rad2deg-120:NaN;return new Cubehelix(h<0?h+360:h,s,l,o.opacity)}function cubehelix(h,s,l,opacity){return arguments.length===1?cubehelixConvert(h):new Cubehelix(h,s,l,opacity==null?1:opacity)}function Cubehelix(h,s,l,opacity){this.h=+h;this.s=+s;this.l=+l;this.opacity=+opacity}define(Cubehelix,cubehelix,extend(Color,{brighter:function(k){k=k==null?brighter:Math.pow(brighter,k);return new Cubehelix(this.h,this.s,this.l*k,this.opacity)},darker:function(k){k=k==null?darker:Math.pow(darker,k);return new Cubehelix(this.h,this.s,this.l*k,this.opacity)},rgb:function(){var h=isNaN(this.h)?0:(this.h+120)*deg2rad,l=+this.l,a=isNaN(this.s)?0:this.s*l*(1-l),cosh=Math.cos(h),sinh=Math.sin(h);return new Rgb(255*(l+a*(A*cosh+B*sinh)),255*(l+a*(C*cosh+D*sinh)),255*(l+a*(E*cosh)),this.opacity)}}));exports.color=color;exports.rgb=rgb;exports.hsl=hsl;exports.lab=lab;exports.hcl=hcl;exports.cubehelix=cubehelix;Object.defineProperty(exports,"__esModule",{value:true})})},{}],4:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports,require("d3-array")):typeof define==="function"&&define.amd?define(["exports","d3-array"],factory):factory(global.d3=global.d3||{},global.d3)})(this,function(exports,d3Array){"use strict";var array=Array.prototype;var slice=array.slice;var ascending=function(a,b){return a-b};var area=function(ring){var i=0,n=ring.length,area=ring[n-1][1]*ring[0][0]-ring[n-1][0]*ring[0][1];while(++i<n)area+=ring[i-1][1]*ring[i][0]-ring[i-1][0]*ring[i][1];return area};var constant=function(x){return function(){return x}};var contains=function(ring,hole){var i=-1,n=hole.length,c;while(++i<n)if(c=ringContains(ring,hole[i]))return c;return 0};function ringContains(ring,point){var x=point[0],y=point[1],contains=-1;for(var i=0,n=ring.length,j=n-1;i<n;j=i++){var pi=ring[i],xi=pi[0],yi=pi[1],pj=ring[j],xj=pj[0],yj=pj[1];if(segmentContains(pi,pj,point))return 0;if(yi>y!==yj>y&&x<(xj-xi)*(y-yi)/(yj-yi)+xi)contains=-contains}return contains}function segmentContains(a,b,c){var i;return collinear(a,b,c)&&within(a[i=+(a[0]===b[0])],c[i],b[i])}function collinear(a,b,c){return(b[0]-a[0])*(c[1]-a[1])===(c[0]-a[0])*(b[1]-a[1])}function within(p,q,r){return p<=q&&q<=r||r<=q&&q<=p}var noop=function(){};var cases=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,.5],[.5,1]],[[1,1.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,1.5]],[[1.5,1],[1,.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];var contours=function(){var dx=1,dy=1,threshold=d3Array.thresholdSturges,smooth=smoothLinear;function contours(values){var tz=threshold(values);if(!Array.isArray(tz)){var domain=d3Array.extent(values),start=domain[0],stop=domain[1];tz=d3Array.tickStep(start,stop,tz);tz=d3Array.range(Math.floor(start/tz)*tz,Math.floor(stop/tz)*tz,tz)}else{tz=tz.slice().sort(ascending)}var layers=tz.map(function(value){var polygons=[],holes=[];isorings(values,value,function(ring){smooth(ring,values,value);if(area(ring)>0)polygons.push([ring]);else holes.push(ring)});holes.forEach(function(hole){for(var i=0,n=polygons.length,polygon;i<n;++i){if(contains((polygon=polygons[i])[0],hole)){polygon.push(hole);return}}});return polygons});return layers.map(function(polygons,i){return{type:"MultiPolygon",value:tz[i],coordinates:polygons}})}function isorings(values,value,callback){var fragmentByStart=new Array,fragmentByEnd=new Array,x,y,t0,t1,t2,t3;x=y=-1;t1=values[0]>=value;cases[t1<<1].forEach(stitch);while(++x<dx-1){t0=t1,t1=values[x+1]>=value;cases[t0|t1<<1].forEach(stitch)}cases[t1<<0].forEach(stitch);while(++y<dy-1){x=-1;t1=values[y*dx+dx]>=value;t2=values[y*dx]>=value;cases[t1<<1|t2<<2].forEach(stitch);while(++x<dx-1){t0=t1,t1=values[y*dx+dx+x+1]>=value;t3=t2,t2=values[y*dx+x+1]>=value;cases[t0|t1<<1|t2<<2|t3<<3].forEach(stitch)}cases[t1|t2<<3].forEach(stitch)}x=-1;t2=values[y*dx]>=value;cases[t2<<2].forEach(stitch);while(++x<dx-1){t3=t2,t2=values[y*dx+x+1]>=value;cases[t2<<2|t3<<3].forEach(stitch)}cases[t2<<3].forEach(stitch);function stitch(line){var start=[line[0][0]+x,line[0][1]+y],end=[line[1][0]+x,line[1][1]+y],startIndex=index(start),endIndex=index(end),f,g;if(f=fragmentByEnd[startIndex]){if(g=fragmentByStart[endIndex]){delete fragmentByEnd[f.end];delete fragmentByStart[g.start];if(f===g){f.ring.push(end);callback(f.ring)}else{fragmentByStart[f.start]=fragmentByEnd[g.end]={start:f.start,end:g.end,ring:f.ring.concat(g.ring)}}}else{delete fragmentByEnd[f.end];f.ring.push(end);fragmentByEnd[f.end=endIndex]=f}}else if(f=fragmentByStart[endIndex]){if(g=fragmentByEnd[startIndex]){delete fragmentByStart[f.start];delete fragmentByEnd[g.end];if(f===g){f.ring.push(end);callback(f.ring)}else{fragmentByStart[g.start]=fragmentByEnd[f.end]={start:g.start,end:f.end,ring:g.ring.concat(f.ring)}}}else{delete fragmentByStart[f.start];f.ring.unshift(start);fragmentByStart[f.start=startIndex]=f}}else{fragmentByStart[startIndex]=fragmentByEnd[endIndex]={start:startIndex,end:endIndex,ring:[start,end]}}}}function index(point){return point[0]*2+point[1]*(dx+1)*4}function smoothLinear(ring,values,value){ring.forEach(function(point){var x=point[0],y=point[1],xt=x|0,yt=y|0,v0,v1=values[yt*dx+xt];if(x>0&&x<dx&&xt===x){v0=values[yt*dx+xt-1];point[0]=x+(value-v0)/(v1-v0)-.5}if(y>0&&y<dy&&yt===y){v0=values[(yt-1)*dx+xt];point[1]=y+(value-v0)/(v1-v0)-.5}})}contours.size=function(_){if(!arguments.length)return[dx,dy];var _0=Math.ceil(_[0]),_1=Math.ceil(_[1]);if(!(_0>0)||!(_1>0))throw new Error("invalid size");return dx=_0,dy=_1,contours};contours.thresholds=function(_){return arguments.length?(threshold=typeof _==="function"?_:Array.isArray(_)?constant(slice.call(_)):constant(_),contours):threshold};contours.smooth=function(_){return arguments.length?(smooth=_?smoothLinear:noop,contours):smooth===smoothLinear};return contours};function blurX(source,target,r){var n=source.width,m=source.height,w=(r<<1)+1;for(var j=0;j<m;++j){for(var i=0,sr=0;i<n+r;++i){if(i<n){sr+=source.data[i+j*n]}if(i>=r){if(i>=w){sr-=source.data[i-w+j*n]}target.data[i-r+j*n]=sr/Math.min(i+1,n-1+w-i,w)}}}}function blurY(source,target,r){var n=source.width,m=source.height,w=(r<<1)+1;for(var i=0;i<n;++i){for(var j=0,sr=0;j<m+r;++j){if(j<m){sr+=source.data[i+j*n]}if(j>=r){if(j>=w){sr-=source.data[i+(j-w)*n]}target.data[i+(j-r)*n]=sr/Math.min(j+1,m-1+w-j,w)}}}}function defaultX(d){return d[0]}function defaultY(d){return d[1]}var density=function(){var x=defaultX,y=defaultY,dx=960,dy=500,r=20,k=2,o=r*3,n=dx+o*2>>k,m=dy+o*2>>k,threshold=constant(20);function density(data){var values0=new Float32Array(n*m),values1=new Float32Array(n*m);data.forEach(function(d,i,data){var xi=x(d,i,data)+o>>k,yi=y(d,i,data)+o>>k;if(xi>=0&&xi<n&&yi>=0&&yi<m){++values0[xi+yi*n]}});blurX({width:n,height:m,data:values0},{width:n,height:m,data:values1},r>>k);blurY({width:n,height:m,data:values1},{width:n,height:m,data:values0},r>>k);blurX({width:n,height:m,data:values0},{width:n,height:m,data:values1},r>>k);blurY({width:n,height:m,data:values1},{width:n,height:m,data:values0},r>>k);blurX({width:n,height:m,data:values0},{width:n,height:m,data:values1},r>>k);blurY({width:n,height:m,data:values1},{width:n,height:m,data:values0},r>>k);var tz=threshold(values0);if(!Array.isArray(tz)){var stop=d3Array.max(values0);tz=d3Array.tickStep(0,stop,tz);tz=d3Array.range(0,Math.floor(stop/tz)*tz,tz);tz.shift()}return contours().thresholds(tz).size([n,m])(values0).map(transform)}function transform(geometry){geometry.value*=Math.pow(2,-2*k)
;geometry.coordinates.forEach(transformPolygon);return geometry}function transformPolygon(coordinates){coordinates.forEach(transformRing)}function transformRing(coordinates){coordinates.forEach(transformPoint)}function transformPoint(coordinates){coordinates[0]=coordinates[0]*Math.pow(2,k)-o;coordinates[1]=coordinates[1]*Math.pow(2,k)-o}function resize(){o=r*3;n=dx+o*2>>k;m=dy+o*2>>k;return density}density.x=function(_){return arguments.length?(x=typeof _==="function"?_:constant(+_),density):x};density.y=function(_){return arguments.length?(y=typeof _==="function"?_:constant(+_),density):y};density.size=function(_){if(!arguments.length)return[dx,dy];var _0=Math.ceil(_[0]),_1=Math.ceil(_[1]);if(!(_0>=0)&&!(_0>=0))throw new Error("invalid size");return dx=_0,dy=_1,resize()};density.cellSize=function(_){if(!arguments.length)return 1<<k;if(!((_=+_)>=1))throw new Error("invalid cell size");return k=Math.floor(Math.log(_)/Math.LN2),resize()};density.thresholds=function(_){return arguments.length?(threshold=typeof _==="function"?_:Array.isArray(_)?constant(slice.call(_)):constant(_),density):threshold};density.bandwidth=function(_){if(!arguments.length)return Math.sqrt(r*(r+1));if(!((_=+_)>=0))throw new Error("invalid bandwidth");return r=Math.round((Math.sqrt(4*_*_+1)-1)/2),resize()};return density};exports.contours=contours;exports.contourDensity=density;Object.defineProperty(exports,"__esModule",{value:true})})},{"d3-array":1}],5:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.d3=global.d3||{})})(this,function(exports){"use strict";var formatDecimal=function(x,p){if((i=(x=p?x.toExponential(p-1):x.toExponential()).indexOf("e"))<0)return null;var i,coefficient=x.slice(0,i);return[coefficient.length>1?coefficient[0]+coefficient.slice(2):coefficient,+x.slice(i+1)]};var exponent=function(x){return x=formatDecimal(Math.abs(x)),x?x[1]:NaN};var formatGroup=function(grouping,thousands){return function(value,width){var i=value.length,t=[],j=0,g=grouping[0],length=0;while(i>0&&g>0){if(length+g+1>width)g=Math.max(1,width-length);t.push(value.substring(i-=g,i+g));if((length+=g+1)>width)break;g=grouping[j=(j+1)%grouping.length]}return t.reverse().join(thousands)}};var formatNumerals=function(numerals){return function(value){return value.replace(/[0-9]/g,function(i){return numerals[+i]})}};var formatDefault=function(x,p){x=x.toPrecision(p);out:for(var n=x.length,i=1,i0=-1,i1;i<n;++i){switch(x[i]){case".":i0=i1=i;break;case"0":if(i0===0)i0=i;i1=i;break;case"e":break out;default:if(i0>0)i0=0;break}}return i0>0?x.slice(0,i0)+x.slice(i1+1):x};var prefixExponent;var formatPrefixAuto=function(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1],i=exponent-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(exponent/3)))*3)+1,n=coefficient.length;return i===n?coefficient:i>n?coefficient+new Array(i-n+1).join("0"):i>0?coefficient.slice(0,i)+"."+coefficient.slice(i):"0."+new Array(1-i).join("0")+formatDecimal(x,Math.max(0,p+i-1))[0]};var formatRounded=function(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1];return exponent<0?"0."+new Array(-exponent).join("0")+coefficient:coefficient.length>exponent+1?coefficient.slice(0,exponent+1)+"."+coefficient.slice(exponent+1):coefficient+new Array(exponent-coefficient.length+2).join("0")};var formatTypes={"":formatDefault,"%":function(x,p){return(x*100).toFixed(p)},b:function(x){return Math.round(x).toString(2)},c:function(x){return x+""},d:function(x){return Math.round(x).toString(10)},e:function(x,p){return x.toExponential(p)},f:function(x,p){return x.toFixed(p)},g:function(x,p){return x.toPrecision(p)},o:function(x){return Math.round(x).toString(8)},p:function(x,p){return formatRounded(x*100,p)},r:formatRounded,s:formatPrefixAuto,X:function(x){return Math.round(x).toString(16).toUpperCase()},x:function(x){return Math.round(x).toString(16)}};var re=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function formatSpecifier(specifier){return new FormatSpecifier(specifier)}formatSpecifier.prototype=FormatSpecifier.prototype;function FormatSpecifier(specifier){if(!(match=re.exec(specifier)))throw new Error("invalid format: "+specifier);var match,fill=match[1]||" ",align=match[2]||">",sign=match[3]||"-",symbol=match[4]||"",zero=!!match[5],width=match[6]&&+match[6],comma=!!match[7],precision=match[8]&&+match[8].slice(1),type=match[9]||"";if(type==="n")comma=true,type="g";else if(!formatTypes[type])type="";if(zero||fill==="0"&&align==="=")zero=true,fill="0",align="=";this.fill=fill;this.align=align;this.sign=sign;this.symbol=symbol;this.zero=zero;this.width=width;this.comma=comma;this.precision=precision;this.type=type}FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width==null?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision==null?"":"."+Math.max(0,this.precision|0))+this.type};var identity=function(x){return x};var prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];var formatLocale=function(locale){var group=locale.grouping&&locale.thousands?formatGroup(locale.grouping,locale.thousands):identity,currency=locale.currency,decimal=locale.decimal,numerals=locale.numerals?formatNumerals(locale.numerals):identity,percent=locale.percent||"%";function newFormat(specifier){specifier=formatSpecifier(specifier);var fill=specifier.fill,align=specifier.align,sign=specifier.sign,symbol=specifier.symbol,zero=specifier.zero,width=specifier.width,comma=specifier.comma,precision=specifier.precision,type=specifier.type;var prefix=symbol==="$"?currency[0]:symbol==="#"&&/[boxX]/.test(type)?"0"+type.toLowerCase():"",suffix=symbol==="$"?currency[1]:/[%p]/.test(type)?percent:"";var formatType=formatTypes[type],maybeSuffix=!type||/[defgprs%]/.test(type);precision=precision==null?type?6:12:/[gprs]/.test(type)?Math.max(1,Math.min(21,precision)):Math.max(0,Math.min(20,precision));function format(value){var valuePrefix=prefix,valueSuffix=suffix,i,n,c;if(type==="c"){valueSuffix=formatType(value)+valueSuffix;value=""}else{value=+value;var valueNegative=value<0;value=formatType(Math.abs(value),precision);if(valueNegative&&+value===0)valueNegative=false;valuePrefix=(valueNegative?sign==="("?sign:"-":sign==="-"||sign==="("?"":sign)+valuePrefix;valueSuffix=valueSuffix+(type==="s"?prefixes[8+prefixExponent/3]:"")+(valueNegative&&sign==="("?")":"");if(maybeSuffix){i=-1,n=value.length;while(++i<n){if(c=value.charCodeAt(i),48>c||c>57){valueSuffix=(c===46?decimal+value.slice(i+1):value.slice(i))+valueSuffix;value=value.slice(0,i);break}}}}if(comma&&!zero)value=group(value,Infinity);var length=valuePrefix.length+value.length+valueSuffix.length,padding=length<width?new Array(width-length+1).join(fill):"";if(comma&&zero)value=group(padding+value,padding.length?width-valueSuffix.length:Infinity),padding="";switch(align){case"<":value=valuePrefix+value+valueSuffix+padding;break;case"=":value=valuePrefix+padding+value+valueSuffix;break;case"^":value=padding.slice(0,length=padding.length>>1)+valuePrefix+value+valueSuffix+padding.slice(length);break;default:value=padding+valuePrefix+value+valueSuffix;break}return numerals(value)}format.toString=function(){return specifier+""};return format}function formatPrefix(specifier,value){var f=newFormat((specifier=formatSpecifier(specifier),specifier.type="f",specifier)),e=Math.max(-8,Math.min(8,Math.floor(exponent(value)/3)))*3,k=Math.pow(10,-e),prefix=prefixes[8+e/3];return function(value){return f(k*value)+prefix}}return{format:newFormat,formatPrefix:formatPrefix}};var locale;defaultLocale({decimal:".",thousands:",",grouping:[3],currency:["$",""]});function defaultLocale(definition){locale=formatLocale(definition);exports.format=locale.format;exports.formatPrefix=locale.formatPrefix;return locale}var precisionFixed=function(step){return Math.max(0,-exponent(Math.abs(step)))};var precisionPrefix=function(step,value){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(exponent(value)/3)))*3-exponent(Math.abs(step)))};var precisionRound=function(step,max){step=Math.abs(step),max=Math.abs(max)-step;return Math.max(0,exponent(max)-exponent(step))+1};exports.formatDefaultLocale=defaultLocale;exports.formatLocale=formatLocale;exports.formatSpecifier=formatSpecifier;exports.precisionFixed=precisionFixed;exports.precisionPrefix=precisionPrefix;exports.precisionRound=precisionRound;Object.defineProperty(exports,"__esModule",{value:true})})},{}],6:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports,require("d3-array")):typeof define==="function"&&define.amd?define(["exports","d3-array"],factory):factory(global.d3=global.d3||{},global.d3)})(this,function(exports,d3Array){"use strict";var adder=function(){return new Adder};function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(y){add(temp,y,this.t);add(this,temp.s,this.s);if(this.s)this.t+=temp.t;else this.s=temp.t},valueOf:function(){return this.s}};var temp=new Adder;function add(adder,a,b){var x=adder.s=a+b,bv=x-a,av=x-bv;adder.t=a-av+(b-bv)}var epsilon=1e-6;var epsilon2=1e-12;var pi=Math.PI;var halfPi=pi/2;var quarterPi=pi/4;var tau=pi*2;var degrees=180/pi;var radians=pi/180;var abs=Math.abs;var atan=Math.atan;var atan2=Math.atan2;var cos=Math.cos;var ceil=Math.ceil;var exp=Math.exp;var log=Math.log;var pow=Math.pow;var sin=Math.sin;var sign=Math.sign||function(x){return x>0?1:x<0?-1:0};var sqrt=Math.sqrt;var tan=Math.tan;function acos(x){return x>1?0:x<-1?pi:Math.acos(x)}function asin(x){return x>1?halfPi:x<-1?-halfPi:Math.asin(x)}function haversin(x){return(x=sin(x/2))*x}function noop(){}function streamGeometry(geometry,stream){if(geometry&&streamGeometryType.hasOwnProperty(geometry.type)){streamGeometryType[geometry.type](geometry,stream)}}var streamObjectType={Feature:function(object,stream){streamGeometry(object.geometry,stream)},FeatureCollection:function(object,stream){var features=object.features,i=-1,n=features.length;while(++i<n)streamGeometry(features[i].geometry,stream)}};var streamGeometryType={Sphere:function(object,stream){stream.sphere()},Point:function(object,stream){object=object.coordinates;stream.point(object[0],object[1],object[2])},MultiPoint:function(object,stream){var coordinates=object.coordinates,i=-1,n=coordinates.length;while(++i<n)object=coordinates[i],stream.point(object[0],object[1],object[2])},LineString:function(object,stream){streamLine(object.coordinates,stream,0)},MultiLineString:function(object,stream){var coordinates=object.coordinates,i=-1,n=coordinates.length;while(++i<n)streamLine(coordinates[i],stream,0)},Polygon:function(object,stream){streamPolygon(object.coordinates,stream)},MultiPolygon:function(object,stream){var coordinates=object.coordinates,i=-1,n=coordinates.length;while(++i<n)streamPolygon(coordinates[i],stream)},GeometryCollection:function(object,stream){var geometries=object.geometries,i=-1,n=geometries.length;while(++i<n)streamGeometry(geometries[i],stream)}};function streamLine(coordinates,stream,closed){var i=-1,n=coordinates.length-closed,coordinate;stream.lineStart();while(++i<n)coordinate=coordinates[i],stream.point(coordinate[0],coordinate[1],coordinate[2]);stream.lineEnd()}function streamPolygon(coordinates,stream){var i=-1,n=coordinates.length;stream.polygonStart();while(++i<n)streamLine(coordinates[i],stream,1);stream.polygonEnd()}var geoStream=function(object,stream){if(object&&streamObjectType.hasOwnProperty(object.type)){streamObjectType[object.type](object,stream)}else{streamGeometry(object,stream)}};var areaRingSum=adder();var areaSum=adder();var lambda00;var phi00;var lambda0;var cosPhi0;var sinPhi0;var areaStream={point:noop,lineStart:noop,lineEnd:noop,polygonStart:function(){areaRingSum.reset();areaStream.lineStart=areaRingStart;areaStream.lineEnd=areaRingEnd},polygonEnd:function(){var areaRing=+areaRingSum;areaSum.add(areaRing<0?tau+areaRing:areaRing);this.lineStart=this.lineEnd=this.point=noop},sphere:function(){areaSum.add(tau)}};function areaRingStart(){areaStream.point=areaPointFirst}function areaRingEnd(){areaPoint(lambda00,phi00)}function areaPointFirst(lambda,phi){areaStream.point=areaPoint;lambda00=lambda,phi00=phi;lambda*=radians,phi*=radians;lambda0=lambda,cosPhi0=cos(phi=phi/2+quarterPi),sinPhi0=sin(phi)}function areaPoint(lambda,phi){lambda*=radians,phi*=radians;phi=phi/2+quarterPi;var dLambda=lambda-lambda0,sdLambda=dLambda>=0?1:-1,adLambda=sdLambda*dLambda,cosPhi=cos(phi),sinPhi=sin(phi),k=sinPhi0*sinPhi,u=cosPhi0*cosPhi+k*cos(adLambda),v=k*sdLambda*sin(adLambda);areaRingSum.add(atan2(v,u));lambda0=lambda,cosPhi0=cosPhi,sinPhi0=sinPhi}var area=function(object){areaSum.reset();geoStream(object,areaStream);return areaSum*2};function spherical(cartesian){return[atan2(cartesian[1],cartesian[0]),asin(cartesian[2])]}function cartesian(spherical){var lambda=spherical[0],phi=spherical[1],cosPhi=cos(phi);return[cosPhi*cos(lambda),cosPhi*sin(lambda),sin(phi)]}function cartesianDot(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function cartesianCross(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function cartesianAddInPlace(a,b){a[0]+=b[0],a[1]+=b[1],a[2]+=b[2]}function cartesianScale(vector,k){return[vector[0]*k,vector[1]*k,vector[2]*k]}function cartesianNormalizeInPlace(d){var l=sqrt(d[0]*d[0]+d[1]*d[1]+d[2]*d[2]);d[0]/=l,d[1]/=l,d[2]/=l}var lambda0$1;var phi0;var lambda1;var phi1;var lambda2;var lambda00$1;var phi00$1;var p0;var deltaSum=adder();var ranges;var range$1;var boundsStream={point:boundsPoint,lineStart:boundsLineStart,lineEnd:boundsLineEnd,polygonStart:function(){boundsStream.point=boundsRingPoint;boundsStream.lineStart=boundsRingStart;boundsStream.lineEnd=boundsRingEnd;deltaSum.reset();areaStream.polygonStart()},polygonEnd:function(){areaStream.polygonEnd();boundsStream.point=boundsPoint;boundsStream.lineStart=boundsLineStart;boundsStream.lineEnd=boundsLineEnd;if(areaRingSum<0)lambda0$1=-(lambda1=180),phi0=-(phi1=90);else if(deltaSum>epsilon)phi1=90;else if(deltaSum<-epsilon)phi0=-90;range$1[0]=lambda0$1,range$1[1]=lambda1}};function boundsPoint(lambda,phi){ranges.push(range$1=[lambda0$1=lambda,lambda1=lambda]);if(phi<phi0)phi0=phi;if(phi>phi1)phi1=phi}function linePoint(lambda,phi){var p=cartesian([lambda*radians,phi*radians]);if(p0){var normal=cartesianCross(p0,p),equatorial=[normal[1],-normal[0],0],inflection=cartesianCross(equatorial,normal);cartesianNormalizeInPlace(inflection);inflection=spherical(inflection);var delta=lambda-lambda2,sign$$1=delta>0?1:-1,lambdai=inflection[0]*degrees*sign$$1,phii,antimeridian=abs(delta)>180;if(antimeridian^(sign$$1*lambda2<lambdai&&lambdai<sign$$1*lambda)){phii=inflection[1]*degrees;if(phii>phi1)phi1=phii}else if(lambdai=(lambdai+360)%360-180,antimeridian^(sign$$1*lambda2<lambdai&&lambdai<sign$$1*lambda)){phii=-inflection[1]*degrees;if(phii<phi0)phi0=phii}else{if(phi<phi0)phi0=phi;if(phi>phi1)phi1=phi}if(antimeridian){if(lambda<lambda2){if(angle(lambda0$1,lambda)>angle(lambda0$1,lambda1))lambda1=lambda}else{if(angle(lambda,lambda1)>angle(lambda0$1,lambda1))lambda0$1=lambda}}else{if(lambda1>=lambda0$1){if(lambda<lambda0$1)lambda0$1=lambda;if(lambda>lambda1)lambda1=lambda}else{if(lambda>lambda2){if(angle(lambda0$1,lambda)>angle(lambda0$1,lambda1))lambda1=lambda}else{if(angle(lambda,lambda1)>angle(lambda0$1,lambda1))lambda0$1=lambda}}}}else{ranges.push(range$1=[lambda0$1=lambda,lambda1=lambda])}if(phi<phi0)phi0=phi;if(phi>phi1)phi1=phi;p0=p,lambda2=lambda}function boundsLineStart(){boundsStream.point=linePoint}function boundsLineEnd(){range$1[0]=lambda0$1,range$1[1]=lambda1;boundsStream.point=boundsPoint;p0=null}function boundsRingPoint(lambda,phi){if(p0){var delta=lambda-lambda2;deltaSum.add(abs(delta)>180?delta+(delta>0?360:-360):delta)}else{lambda00$1=lambda,phi00$1=phi}areaStream.point(lambda,phi);linePoint(lambda,phi)}function boundsRingStart(){areaStream.lineStart()}function boundsRingEnd(){boundsRingPoint(lambda00$1,phi00$1);areaStream.lineEnd();if(abs(deltaSum)>epsilon)lambda0$1=-(lambda1=180);range$1[0]=lambda0$1,range$1[1]=lambda1;p0=null}function angle(lambda0,lambda1){return(lambda1-=lambda0)<0?lambda1+360:lambda1}function rangeCompare(a,b){return a[0]-b[0]}function rangeContains(range$$1,x){return range$$1[0]<=range$$1[1]?range$$1[0]<=x&&x<=range$$1[1]:x<range$$1[0]||range$$1[1]<x}var bounds=function(feature){var i,n,a,b,merged,deltaMax,delta;phi1=lambda1=-(lambda0$1=phi0=Infinity);ranges=[];geoStream(feature,boundsStream);if(n=ranges.length){ranges.sort(rangeCompare);for(i=1,a=ranges[0],merged=[a];i<n;++i){b=ranges[i];if(rangeContains(a,b[0])||rangeContains(a,b[1])){if(angle(a[0],b[1])>angle(a[0],a[1]))a[1]=b[1];if(angle(b[0],a[1])>angle(a[0],a[1]))a[0]=b[0]}else{merged.push(a=b)}}for(deltaMax=-Infinity,n=merged.length-1,i=0,a=merged[n];i<=n;a=b,++i){b=merged[i];if((delta=angle(a[1],b[0]))>deltaMax)deltaMax=delta,lambda0$1=b[0],lambda1=a[1]}}ranges=range$1=null;return lambda0$1===Infinity||phi0===Infinity?[[NaN,NaN],[NaN,NaN]]:[[lambda0$1,phi0],[lambda1,phi1]]};var W0;var W1;var X0;var Y0;var Z0;var X1;var Y1;var Z1;var X2;var Y2;var Z2;var lambda00$2;var phi00$2;var x0;var y0;var z0;var centroidStream={sphere:noop,point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function(){centroidStream.lineStart=centroidRingStart;centroidStream.lineEnd=centroidRingEnd},polygonEnd:function(){centroidStream.lineStart=centroidLineStart;centroidStream.lineEnd=centroidLineEnd}};function centroidPoint(lambda,phi){lambda*=radians,phi*=radians;var cosPhi=cos(phi);centroidPointCartesian(cosPhi*cos(lambda),cosPhi*sin(lambda),sin(phi))}function centroidPointCartesian(x,y,z){++W0;X0+=(x-X0)/W0;Y0+=(y-Y0)/W0;Z0+=(z-Z0)/W0}function centroidLineStart(){centroidStream.point=centroidLi