diff --git a/.eslintrc b/.eslintrc index 7e97fe3..5e40cc0 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,14 +1,14 @@ -{ - "extends": "airbnb", - "rules": { - "semi": ["error", "never"], - "prefer-const": 0, - "func-names": 0, - "import/no-extraneous-dependencies": 0, - "space-before-function-paren": "off" - }, - "globals": { - "document": true, - "GaugeChart": true - } -} +{ + "extends": "airbnb", + "rules": { + "semi": ["error", "never"], + "prefer-const": 0, + "func-names": 0, + "import/no-extraneous-dependencies": 0, + "space-before-function-paren": "off" + }, + "globals": { + "document": true, + "GaugeChart": true + } +} diff --git a/.gitignore b/.gitignore index 136525e..5ba4fbb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -dist/gauge -dist/index.d.ts -node_modules -coverage -npm-debug.log +dist/gauge +dist/index.d.ts +node_modules +coverage +npm-debug.log diff --git a/.nojekyll b/.nojekyll index 8b13789..d3f5a12 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ - + diff --git a/.prettierignore b/.prettierignore index 1521c8b..6fc7bee 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1 @@ -dist +dist diff --git a/.prettierrc b/.prettierrc index e3b414c..216ebdc 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ -{ - "semi": false, - "singleQuote": true, - "trailingComma": "all" -} +{ + "semi": false, + "singleQuote": true, + "trailingComma": "all" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 92531e9..1ab943d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,46 +1,46 @@ -## 0.5.3 -- Don't format `bundle.js` with prettier. - -## 0.5.2 - -- Updated typescript to `3.x.x`. - -## 0.5.2-rc.0 - -- Updating dependencies. - -## 0.5.1 - -- Fixed bug with build avialability via cdn. -- Updated gitignore and readme - -## 0.5.0 - -- New functionality developed by [Nicolas Bonamy](https://github.com/nbonamy): - - Enable/disable over effect. - - Padding between arc. - - Arc labels. - -- Updated README. -- Fixed tests. - -## 0.4.4 - -- Updated readme. -- Updated dependencies. - -## 0.4.3 - -- Updated readme. - -## 0.4.2 - -- Updated docs and readme. - -## 0.4.1 - -- Updated needle outlining. -- Added examples. +## 0.5.3 +- Don't format `bundle.js` with prettier. + +## 0.5.2 + +- Updated typescript to `3.x.x`. + +## 0.5.2-rc.0 + +- Updating dependencies. + +## 0.5.1 + +- Fixed bug with build avialability via cdn. +- Updated gitignore and readme + +## 0.5.0 + +- New functionality developed by [Nicolas Bonamy](https://github.com/nbonamy): + + Enable/disable over effect. + + Padding between arc. + + Arc labels. + +- Updated README. +- Fixed tests. + +## 0.4.4 + +- Updated readme. +- Updated dependencies. + +## 0.4.3 + +- Updated readme. + +## 0.4.2 + +- Updated docs and readme. + +## 0.4.1 + +- Updated needle outlining. +- Added examples. diff --git a/LICENSE b/LICENSE index 6602779..b591a17 100644 --- a/LICENSE +++ b/LICENSE @@ -1,20 +1,20 @@ -Copyright (c) 2017 RECOGIZER GROUP GmbH. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +Copyright (c) 2017 RECOGIZER GROUP GmbH. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 6e400d2..cf5ff30 100644 --- a/README.md +++ b/README.md @@ -1,115 +1,116 @@ -# Gauge Chart - -**A library for creating nice and flexible gauge charts.** - -[](https://github.com/prettier/prettier) - -You can [catch us on twitter](https://twitter.com/recogizer): [@recogizer](https://twitter.com/recogizer) or head over to [our company's website](http://www.recogizer.com/). - -## [Demo](https://recogizer.github.io/gauge-chart/examples/samples/) | [Documentation](https://recogizer.github.io/gauge-chart/docs/) - -## Installation - -The easiest way to get started is to install it via npm: - -``` - npm install gauge-chart -``` - -**beware that we moved from `@recogizer/gauge-chart` to `gauge-chart`** - -Or to add manually a link to the library into your html file: - -```html - -``` - -## Usage - -Create an element for positioning gauge in your html file: - -```html -
-``` - -Now you're ready to draw your own gauge. - -Just copy this code into your js / ts file or into `` tags in html file: - -```javascript -// Element inside which you want to see the chart -let element = document.querySelector('#gaugeArea') - -// Properties of the gauge -let gaugeOptions = { - hasNeedle: true, - needleColor: 'gray', - needleUpdateSpeed: 1000, - arcColors: ['rgb(44, 151, 222)', 'lightgray'], - arcDelimiters: [30], - rangeLabel: ['0', '100'], - centralLabel: '50', -} - -// Drawing and updating the chart -GaugeChart.gaugeChart(element, 300, gaugeOptions).updateNeedle(50) -``` - -#### Result: - - - -By default, the needle is pointing to 0, thus in order to move it you have to use `.updateNeedle(val)`, where `val` denotes the value on the chart. - -Feel free to change or delete any of the gaugeOptions properties as long as their values are in permitted ranges. - -## Options - -#### gaugeOptions: { ... } - -| Name | Values Ranges | Description | -| ----------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------- | -| hasNeedle | true / false | determines whether to show the needle or not | -| needleColor | [value supported by CSS](https://www.w3schools.com/colors/default.asp) | colorizes needle with specified colors | -| needleUpdateSpeed | number ⩾ 0 | determines the speed of needle update animation | -| arcColors | [array of values supported by CSS](https://www.w3schools.com/colors/default.asp) | colorizes gauge with specified color | -| arcDelimiters | array of numbers from 0 to 100 | specifies delimiters of the gauge in ascending order | -| arcOverEffect | true / false | determines if over effect on ars is enabled or not | -| arcLabels | array of strings | specifies labels to be placed at delimiters ends | -| arcPadding | number | specifies padding between arcs (in pixels) | -| arcPaddingColor | [value supported by CSS](https://www.w3schools.com/colors/default.asp) | color of the padding between delimeters | -| rangeLabel | array of two strings | depicts gauge ranges on both sides of the chart | -| centralLabel | string | depicts gauge inner label | -| labelsFont | string | specifies font-family to be used for labels | - -#### .gaugeChart( ... ) - -| Name | Values Ranges | Description | -| ------------ | -------------------- | --------------------------------------------------------------- | -| element | html element | specifies an element which contains a chart | -| chartWidth | number larger than 0 | gives a width to the gauge (height is always 0.5 \* chartWidth) | -| gaugeOptions | object | provides gauge properties (can be empty) | - -#### .updateNeedle( ... ) - -| Name | Values Ranges | Description | -| ----------- | -------------------- | ----------------------------------- | -| needleValue | number from 0 to 100 | specifies needle value on the gauge | - -## Examples - -Some examples of what you can get out of the library using different properties: - - - -## Contributing - -Build the library with `npm run build`. For a production version with console warnings, execute `npm run build:prod_warn`. This will fetch all dependencies and then compile the `dist` files. To see the examples locally you can start a web server with `npm run dev` and go to `localhost:8080` (`localhost:8081` if port `8080` is busy). - -## License - -MIT License. Copyright (c) 2017-2019 RECOGIZER GROUP GmbH. - -## Authors - -[Alexey Karpov](https://github.com/cherurg), [Maxim Maltsev](https://github.com/mmaltsev). +# Gauge Chart + +**A library for creating nice and flexible gauge charts.** + +[](https://github.com/prettier/prettier) + +You can [catch us on twitter](https://twitter.com/recogizer): [@recogizer](https://twitter.com/recogizer) or head over to [our company's website](http://www.recogizer.com/). + +## [Demo](https://recogizer.github.io/gauge-chart/examples/samples/) | [Documentation](https://recogizer.github.io/gauge-chart/docs/) + +## Installation + +The easiest way to get started is to install it via npm: + +``` + npm install gauge-chart +``` + +**beware that we moved from `@recogizer/gauge-chart` to `gauge-chart`** + +Or to add manually a link to the library into your html file: + +```html + +``` + +## Usage + +Create an element for positioning gauge in your html file: + +```html + +``` + +Now you're ready to draw your own gauge. + +Just copy this code into your js / ts file or into `` tags in html file: + +```javascript +// Element inside which you want to see the chart +let element = document.querySelector('#gaugeArea') + +// Properties of the gauge +let gaugeOptions = { + hasNeedle: true, + needleColor: 'gray', + needleUpdateSpeed: 1000, + arcColors: ['rgb(44, 151, 222)', 'lightgray'], + arcDelimiters: [30], + rangeLabel: ['0', '100'], + centralLabel: '50', +} + +// Drawing and updating the chart +GaugeChart.gaugeChart(element, 300, gaugeOptions).updateNeedle(50) +``` + +#### Result: + + + +By default, the needle is pointing to 0, thus in order to move it you have to use `.updateNeedle(val)`, where `val` denotes the value on the chart. + +Feel free to change or delete any of the gaugeOptions properties as long as their values are in permitted ranges. + +## Options + +#### gaugeOptions: { ... } + +| Name | Values Ranges | Description | +| ----------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------- | +| hasNeedle | true / false | determines whether to show the needle or not | +| needleColor | [value supported by CSS](https://www.w3schools.com/colors/default.asp) | colorizes needle with specified colors | +| needleUpdateSpeed | number ⩾ 0 | determines the speed of needle update animation | +| arcColors | [array of values supported by CSS](https://www.w3schools.com/colors/default.asp) | colorizes gauge with specified color | +| arcDelimiters | array of numbers from 0 to 100 | specifies delimiters of the gauge in ascending order | +| arcOverEffect | true / false | determines if over effect on ars is enabled or not | +| arcLabels | array of strings | specifies labels to be placed at delimiters ends | +| arcPadding | number | specifies padding between arcs (in pixels) | +| arcPaddingColor | [value supported by CSS](https://www.w3schools.com/colors/default.asp) | color of the padding between delimeters | +| rangeLabel | array of two strings | depicts gauge ranges on both sides of the chart | +| centralLabel | string | depicts gauge inner label | +| labelsFont | string | specifies font-family to be used for labels | +| labelsColor | string | specifies font color to be used for labels | + +#### .gaugeChart( ... ) + +| Name | Values Ranges | Description | +| ------------ | -------------------- | --------------------------------------------------------------- | +| element | html element | specifies an element which contains a chart | +| chartWidth | number larger than 0 | gives a width to the gauge (height is always 0.5 \* chartWidth) | +| gaugeOptions | object | provides gauge properties (can be empty) | + +#### .updateNeedle( ... ) + +| Name | Values Ranges | Description | +| ----------- | -------------------- | ----------------------------------- | +| needleValue | number from 0 to 100 | specifies needle value on the gauge | + +## Examples + +Some examples of what you can get out of the library using different properties: + + + +## Contributing + +Build the library with `npm run build`. For a production version with console warnings, execute `npm run build:prod_warn`. This will fetch all dependencies and then compile the `dist` files. To see the examples locally you can start a web server with `npm run dev` and go to `localhost:8080` (`localhost:8081` if port `8080` is busy). + +## License + +MIT License. Copyright (c) 2017-2019 RECOGIZER GROUP GmbH. + +## Authors + +[Alexey Karpov](https://github.com/cherurg), [Maxim Maltsev](https://github.com/mmaltsev). diff --git a/dist/bundle.js b/dist/bundle.js index 9d0955d..355d403 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1 +1 @@ -!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.GaugeChart=n():t.GaugeChart=n()}(this,function(){return function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var e={};return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},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,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=196)}([function(t,n,e){"use strict";function r(t){return t>1?0:t<-1?c:Math.acos(t)}function i(t){return t>1?f:t<-1?-f:Math.asin(t)}function u(t){return(t=w(t/2))*t}e.d(n,"o",function(){return a}),e.d(n,"w",function(){return o}),e.d(n,"a",function(){return c}),e.d(n,"k",function(){return f}),e.d(n,"v",function(){return s}),e.d(n,"b",function(){return l}),e.d(n,"h",function(){return h}),e.d(n,"g",function(){return d}),e.d(n,"p",function(){return p}),e.d(n,"l",function(){return v}),e.d(n,"e",function(){return b}),e.d(n,"c",function(){return g}),e.d(n,"u",function(){return y}),e.d(n,"m",function(){return _}),e.d(n,"i",function(){return m}),e.d(n,"r",function(){return x}),e.d(n,"d",function(){return w}),e.d(n,"q",function(){return M}),e.d(n,"n",function(){return k}),e.d(n,"j",function(){return N}),n.s=r,n.f=i,n.t=u;var a=1e-6,o=1e-12,c=Math.PI,f=c/2,s=c/4,l=2*c,h=180/c,d=c/180,p=Math.abs,v=Math.atan,b=Math.atan2,g=Math.cos,y=Math.ceil,_=Math.exp,m=(Math.floor,Math.log),x=Math.pow,w=Math.sin,M=Math.sign||function(t){return t>0?1:t<0?-1:0},k=Math.sqrt,N=Math.tan},function(t,n,e){"use strict";n.a=function(t){for(var n=t.length/6|0,e=new Array(n),r=0;rl.length)return t;var r,i=h[e-1];return null!=f&&e>=l.length?r=t.entries():(r=[],t.each(function(t,i){r.push({key:i,values:n(t,e)})})),null!=i?r.sort(function(t,n){return i(t.key,n.key)}):r}var c,f,s,l=[],h=[];return s={object:function(n){return t(n,0,r,i)},map:function(n){return t(n,0,u,a)},entries:function(e){return n(t(e,0,u,a),0)},key:function(t){return l.push(t),s},sortKeys:function(t){return h[l.length-1]=t,s},sortValues:function(t){return c=t,s},rollup:function(t){return f=t,s}}}},function(t,n,e){"use strict";function r(){}function i(t,n){var e=new r;if(t instanceof r)t.each(function(t){e.add(t)});else if(t){var i=-1,u=t.length;if(null==n)for(;++iw?Math.pow(t,1/3):t/x+_}function o(t){return t>m?t*t*t:x*(t-_)}function c(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function f(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function s(t){if(t instanceof h)return new h(t.h,t.c,t.l,t.opacity);t instanceof u||(t=r(t));var n=Math.atan2(t.b,t.a)*v.a;return new h(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function l(t,n,e,r){return 1===arguments.length?s(t):new h(t,n,e,null==r?1:r)}function h(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}n.a=i,n.b=l;var d=e(59),p=e(58),v=e(115),b=.95047,g=1,y=1.08883,_=4/29,m=6/29,x=3*m*m,w=m*m*m;e.i(d.a)(u,i,e.i(d.b)(p.f,{brighter:function(t){return new u(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new u(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=g*o(t),n=b*o(n),e=y*o(e),new p.d(c(3.2404542*n-1.5371385*t-.4985314*e),c(-.969266*n+1.8760108*t+.041556*e),c(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),e.i(d.a)(h,l,e.i(d.b)(p.f,{brighter:function(t){return new h(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new h(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return r(this).rgb()}}))},function(t,n,e){"use strict";function r(){for(var t,n=0,e=arguments.length,r={};n 0&&(u=0)}return u>0?t.slice(0,u)+t.slice(e+1):t}},function(t,n,e){"use strict";n.a=function(t,n){return function(e,r){for(var i=e.length,u=[],a=0,o=t[0],c=0;i>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),u.push(e.substring(i-=o,i+o)),!((c+=o+1)>r));)o=t[a=(a+1)%t.length];return u.reverse().join(n)}}},function(t,n,e){"use strict";n.a=function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}}},function(t,n,e){"use strict";var r=e(65);n.a=function(t,n){var i=e.i(r.a)(t,n);if(!i)return t+"";var u=i[0],a=i[1];return a<0?"0."+new Array(-a).join("0")+u:u.length>a+1?u.slice(0,a+1)+"."+u.slice(a+1):u+new Array(a-u.length+2).join("0")}},function(t,n,e){"use strict";n.a=function(t){return t}},function(t,n,e){"use strict";var r=e(37);n.a=function(t){return Math.max(0,-e.i(r.a)(Math.abs(t)))}},function(t,n,e){"use strict";var r=e(37);n.a=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(e.i(r.a)(n)/3)))-e.i(r.a)(Math.abs(t)))}},function(t,n,e){"use strict";var r=e(37);n.a=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,e.i(r.a)(n)-e.i(r.a)(t))+1}},function(t,n,e){"use strict";var r=e(124);e.d(n,"a",function(){return r.a});var i=e(268);e.d(n,"b",function(){return i.a});var u=e(269);e.d(n,"c",function(){return u.a});var a=e(125);e.d(n,"d",function(){return a.a});var o=e(126);e.d(n,"e",function(){return o.a});var c=e(128);e.d(n,"f",function(){return c.a});var f=e(270);e.d(n,"g",function(){return f.a});var s=e(38);e.d(n,"h",function(){return s.a});var l=e(273);e.d(n,"i",function(){return l.a});var h=e(132);e.d(n,"j",function(){return h.a});var d=e(274);e.d(n,"k",function(){return d.a}),e.d(n,"l",function(){return d.b});var p=e(275);e.d(n,"m",function(){return p.a});var v=e(133);e.d(n,"n",function(){return v.a});var b=e(279);e.d(n,"o",function(){return b.a});var g=e(137);e.d(n,"p",function(){return g.a});var y=e(282);e.d(n,"q",function(){return y.a});var _=e(283);e.d(n,"r",function(){return _.a}),e.d(n,"s",function(){return _.b});var m=e(284);e.d(n,"t",function(){return m.a}),e.d(n,"u",function(){return m.b});var x=e(285);e.d(n,"v",function(){return x.a}),e.d(n,"w",function(){return x.b});var w=e(68);e.d(n,"x",function(){return w.a}),e.d(n,"y",function(){return w.b});var M=e(286);e.d(n,"z",function(){return M.a}),e.d(n,"A",function(){return M.b});var k=e(138);e.d(n,"B",function(){return k.a}),e.d(n,"C",function(){return k.b});var N=e(288);e.d(n,"D",function(){return N.a}),e.d(n,"E",function(){return N.b});var A=e(289);e.d(n,"F",function(){return A.a});var S=e(10);e.d(n,"G",function(){return S.a}),e.d(n,"H",function(){return S.b});var T=e(70);e.d(n,"I",function(){return T.a}),e.d(n,"J",function(){return T.b});var E=e(290);e.d(n,"K",function(){return E.a}),e.d(n,"L",function(){return E.b});var C=e(291);e.d(n,"M",function(){return C.a}),e.d(n,"N",function(){return C.b});var P=e(293);e.d(n,"O",function(){return P.a}),e.d(n,"P",function(){return P.b});var z=e(294);e.d(n,"Q",function(){return z.a}),e.d(n,"R",function(){return z.b});var R=e(39);e.d(n,"S",function(){return R.a});var q=e(15);e.d(n,"T",function(){return q.a});var L=e(40);e.d(n,"U",function(){return L.a})},function(t,n,e){"use strict";function r(t,n){x.push(w=[d=t,v=t]),n b&&(b=n)}function i(t,n){var r=e.i(N.a)([t*A.g,n*A.g]);if(m){var i=e.i(N.b)(m,r),u=[i[1],-i[0],0],a=e.i(N.b)(u,i);e.i(N.c)(a),a=e.i(N.g)(a);var o,c=t-g,f=c>0?1:-1,l=a[0]*A.h*f,h=e.i(A.p)(c)>180;h^(f*g b&&(b=n),m=r,g=t}function u(){E.point=i}function a(){w[0]=d,w[1]=v,E.point=r,m=null}function o(t,n){if(m){var r=t-g;T.add(e.i(A.p)(r)>180?r+(r>0?360:-360):r)}else y=t,_=n;k.b.point(t,n),i(t,n)}function c(){k.b.lineStart()}function f(){o(y,_),k.b.lineEnd(),e.i(A.p)(T)>A.o&&(d=-(v=180)),w[0]=d,w[1]=v,m=null}function s(t,n){return(n-=t)<0?n+360:n}function l(t,n){return t[0]-n[0]}function h(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n >>1;s[v] h.a&&S>h.a?z>h.a?(x=f(U,j,I,B,i,-z,m),w=f(O,D,Y,F,i,-z,m),_.lineTo(x.cx+x.x01,x.cy+x.y01),z 0)for(var r,i=t[0],u=n[0],a=t[e]-i,o=n[e]-u,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*n[c]+(1-this._beta)*(u+r*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}},n.a=function t(n){function e(t){return 1===n?new i.b(t):new r(t,n)}return e.beta=function(n){return t(+n)},e}(.85)},function(t,n,e){"use strict";function r(t,n){this._context=t,this._alpha=n}var i=e(173),u=e(51),a=e(90);r.prototype={areaStart:u.a,areaEnd:u.a,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var r=this._x2-t,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:e.i(a.b)(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}},n.a=function t(n){function e(t){return n?new r(t,n):new i.b(t,0)}return e.alpha=function(n){return t(+n)},e}(.5)},function(t,n,e){"use strict";function r(t,n){this._context=t,this._alpha=n}var i=e(174),u=e(90);r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var r=this._x2-t,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:e.i(u.b)(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}},n.a=function t(n){function e(t){return n?new r(t,n):new i.b(t,0)}return e.alpha=function(n){return t(+n)},e}(.5)},function(t,n,e){"use strict";function r(t){this._context=t}var i=e(51);r.prototype={areaStart:i.a,areaEnd:i.a,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}},n.a=function(t){return new r(t)}},function(t,n,e){"use strict";function r(t){return t<0?-1:1}function i(t,n,e){var i=t._x1-t._x0,u=n-t._x1,a=(t._y1-t._y0)/(i||u<0&&-0),o=(e-t._y1)/(u||i<0&&-0),c=(a*u+o*i)/(i+u);return(r(a)+r(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(c))||0}function u(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function a(t,n,e){var r=t._x0,i=t._y0,u=t._x1,a=t._y1,o=(u-r)/3;t._context.bezierCurveTo(r+o,i+o*n,u-o,a-o*e,u,a)}function o(t){this._context=t}function c(t){this._context=new f(t)}function f(t){this._context=t}function s(t){return new o(t)}function l(t){return new c(t)}n.a=s,n.b=l,o.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:a(this,this._t0,u(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,t!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,a(this,u(this,e=i(this,t,n)),e);break;default:a(this,this._t0,e=i(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(c.prototype=Object.create(o.prototype)).point=function(t,n){o.prototype.point.call(this,n,t)},f.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,u){this._context.bezierCurveTo(n,t,r,e,u,i)}}},function(t,n,e){"use strict";function r(t){this._context=t}function i(t){var n,e,r=t.length-1,i=new Array(r),u=new Array(r),a=new Array(r);for(i[0]=0,u[0]=2,a[0]=t[0]+2*t[1],n=1;n =i;--u)v.point(y[u],_[u]);v.lineEnd(),v.areaEnd()}g&&(y[n]=+o(a,n,t),_[n]=+s(a,n,t),v.point(f?+f(a,n,t):y[n],l?+l(a,n,t):_[n]))}if(c)return v=null,c+""||null}function n(){return e.i(a.a)().defined(d).curve(b).context(h)}var o=c.a,f=null,s=e.i(i.a)(0),l=c.b,d=e.i(i.a)(!0),h=null,b=u.a,v=null;return t.x=function(n){return arguments.length?(o="function"==typeof n?n:e.i(i.a)(+n),f=null,t):o},t.x0=function(n){return arguments.length?(o="function"==typeof n?n:e.i(i.a)(+n),t):o},t.x1=function(n){return arguments.length?(f=null==n?null:"function"==typeof n?n:e.i(i.a)(+n),t):f},t.y=function(n){return arguments.length?(s="function"==typeof n?n:e.i(i.a)(+n),l=null,t):s},t.y0=function(n){return arguments.length?(s="function"==typeof n?n:e.i(i.a)(+n),t):s},t.y1=function(n){return arguments.length?(l=null==n?null:"function"==typeof n?n:e.i(i.a)(+n),t):l},t.lineX0=t.lineY0=function(){return n().x(o).y(s)},t.lineY1=function(){return n().x(o).y(l)},t.lineX1=function(){return n().x(f).y(s)},t.defined=function(n){return arguments.length?(d="function"==typeof n?n:e.i(i.a)(!!n),t):d},t.curve=function(n){return arguments.length?(b=n,null!=h&&(v=b(h)),t):b},t.context=function(n){return arguments.length?(null==n?h=v=null:v=b(h=n),t):h},t}},function(t,n,e){"use strict";e.d(n,"a",function(){return r});var r=Array.prototype.slice},function(t,n,e){"use strict";function r(t,n){this._context=t,this._k=(1-n)/6}n.b=r;var i=e(48),u=e(46);r.prototype={areaStart:i.a,areaEnd:i.a,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:e.i(u.c)(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}},n.a=function t(n){function e(t){return new r(t,n)}return e.tension=function(n){return t(+n)},e}(0)},function(t,n,e){"use strict";function r(t,n){this._context=t,this._k=(1-n)/6}n.b=r;var i=e(46);r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:e.i(i.c)(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}},n.a=function t(n){function e(t){return new r(t,n)}return e.tension=function(n){return t(+n)},e}(0)},function(t,n,e){"use strict";function r(t){this._curve=t}function i(t){function n(n){return new r(t(n))}return n._curve=t,n}e.d(n,"b",function(){return a}),n.a=i;var u=e(47),a=i(u.a);r.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}}},function(t,n,e){"use strict";function r(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(e.i(i.a)(t)):n()._curve},t}n.b=r;var i=e(160),u=e(84);n.a=function(){return r(e.i(u.a)().curve(i.b))}},function(t,n,e){"use strict";n.a=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}},function(t,n,e){"use strict";var r=e(31);n.a={draw:function(t,n){var e=Math.sqrt(n/r.b);t.moveTo(e,0),t.arc(0,0,e,0,r.c)}}},function(t,n,e){"use strict";n.a={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}}},function(t,n,e){"use strict";var r=Math.sqrt(1/3),i=2*r;n.a={draw:function(t,n){var e=Math.sqrt(n/i),u=e*r;t.moveTo(0,-e),t.lineTo(u,0),t.lineTo(0,e),t.lineTo(-u,0),t.closePath()}}},function(t,n,e){"use strict";n.a={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}}},function(t,n,e){"use strict";var r=e(31),i=Math.sin(r.b/10)/Math.sin(7*r.b/10),u=Math.sin(r.c/10)*i,a=-Math.cos(r.c/10)*i;n.a={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),i=u*e,c=a*e;t.moveTo(0,-e),t.lineTo(i,c);for(var o=1;o<5;++o){var f=r.c*o/5,s=Math.cos(f),l=Math.sin(f);t.lineTo(l*e,-s*e),t.lineTo(s*i-l*c,l*i+s*c)}t.closePath()}}},function(t,n,e){"use strict";var r=Math.sqrt(3);n.a={draw:function(t,n){var e=-Math.sqrt(n/(3*r));t.moveTo(0,2*e),t.lineTo(-r*e,-e),t.lineTo(r*e,-e),t.closePath()}}},function(t,n,e){"use strict";var r=-.5,i=Math.sqrt(3)/2,u=1/Math.sqrt(12),a=3*(u/2+1);n.a={draw:function(t,n){var e=Math.sqrt(n/a),c=e/2,o=e*u,f=c,s=e*u+e,l=-f,d=s;t.moveTo(c,o),t.lineTo(f,s),t.lineTo(l,d),t.lineTo(r*c-i*o,i*c+r*o),t.lineTo(r*f-i*s,i*f+r*s),t.lineTo(r*l-i*d,i*l+r*d),t.lineTo(r*c+i*o,r*o-i*c),t.lineTo(r*f+i*s,r*s-i*f),t.lineTo(r*l+i*d,r*d-i*l),t.closePath()}}},function(t,n,e){"use strict";function r(t){return t.toISOString()}e.d(n,"b",function(){return u});var i=e(88),u="%Y-%m-%dT%H:%M:%S.%LZ",a=Date.prototype.toISOString?r:e.i(i.d)(u);n.a=a},function(t,n,e){"use strict";function r(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function i(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function u(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function a(t){function n(t,n){return function(e){var r,i,u,a=[],c=-1,o=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++c =e)for(r=e;++ut.r&&(t.r=t[n].r)}function f(){if(s){var n,e,r=s.length;for(l=new Array(r),n=0;nh&&(h=u));for(l=0&&(t=t.slice(0,n)),!t||"start"===t})}function i(t,n,e){var i,a,o=r(n)?u.g:u.e;return function(){var r=o(this,t),u=r.on;u!==i&&(a=(i=u).copy()).on(n,e),r.on=a}}var u=e(8);n.a=function(t,n){var r=this._id;return arguments.length<2?e.i(u.f)(this.node(),r).on.on(t):this.each(i(r,t,n))}},function(t,n,e){"use strict";function r(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}n.a=function(){return this.on("end.remove",r(this._id))}},function(t,n,e){"use strict";var r=e(3),i=e(13),u=e(8);n.a=function(t){var n=this._name,a=this._id;"function"!=typeof t&&(t=e.i(r.l)(t));for(var o=this._groups,c=o.length,f=new Array(c),s=0;s0)do{a.point(0===c||3===c?t:r,c>1?l:n)}while((c=(c+u+4)%4)!==o);else a.point(i[0],i[1])}function b(u,a){return e.i(i.p)(u[0]-t)1?(y.on(t,n),s):y.on(t)}}}},function(t,n,e){"use strict";e.d(n,"b",function(){return r});var r,i=e(62);n.a=function(t,n){var u=e.i(i.a)(t,n);if(!u)return t+"";var a=u[0],c=u[1],o=c-(r=3*Math.max(-8,Math.min(8,Math.floor(c/3))))+1,f=a.length;return o===f?a:o>f?a+new Array(o-f+1).join("0"):o>0?a.slice(0,o)+"."+a.slice(o):"0."+new Array(1-o).join("0")+e.i(i.a)(t,Math.max(0,n+o-1))[0]}},function(t,n,e){"use strict";function r(t){return new i(t)}function i(t){if(!(n=a.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",c=n[4]||"",o=!!n[5],f=n[6]&&+n[6],s=!!n[7],l=n[8]&&+n[8].slice(1),d=n[9]||"";"n"===d?(s=!0,d="g"):u.a[d]||(d=""),(o||"0"===e&&"="===r)&&(o=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=c,this.zero=o,this.width=f,this.comma=s,this.precision=l,this.type=d}n.a=r;var u=e(115),a=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;r.prototype=i.prototype,i.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type}},function(t,n,e){"use strict";var r=e(244),i=e(113),u=e(247);n.a={"":r.a,"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return e.i(u.a)(100*t,n)},r:u.a,s:i.a,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}}},function(t,n,e){"use strict";var r=e(35),i=e(245),u=e(246),a=e(114),c=e(115),o=e(113),f=e(248),s=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];n.a=function(t){function n(t){function n(t){var n,e,a,c=x,f=w;if("c"===m)f=M(t)+f,t="";else{t=+t;var h=t<0;if(t=M(Math.abs(t),_),h&&0==+t&&(h=!1),c=(h?"("===u?u:"-":"-"===u||"("===u?"":u)+c,f=("s"===m?s[8+o.b/3]:"")+f+(h&&"("===u?")":""),k)for(n=-1,e=t.length;++n0^k[1]<(e.i(u.p)(k[0]-S)l&&(s=n.slice(l,s),h[d]?h[d]+=s:h[++d]=s),(o=o[0])===(f=f[0])?h[d]?h[d]+=f:h[++d]=f:(h[++d]=null,b.push({i:d,x:e.i(u.a)(o,f)})),l=c.lastIndex;return l