// https://d3js.org/d3-array/ v1.2.4 Copyright 2018 Mike Bostock !function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.d3=n.d3||{})}(this,function(n){"use strict";function r(n,r){return nr?1:n>=r?0:NaN}function t(n){var t;return 1===n.length&&(t=n,n=function(n,e){return r(t(n),e)}),{left:function(r,t,e,o){for(null==e&&(e=0),null==o&&(o=r.length);e>>1;n(r[u],t)<0?e=u+1:o=u}return e},right:function(r,t,e,o){for(null==e&&(e=0),null==o&&(o=r.length);e>>1;n(r[u],t)>0?o=u:e=u+1}return e}}}var e=t(r),o=e.right,u=e.left;function f(n,r){return[n,r]}function l(n){return null===n?NaN:+n}function i(n,r){var t,e,o=n.length,u=0,f=-1,i=0,a=0;if(null==r)for(;++f1)return a/(u-1)}function a(n,r){var t=i(n,r);return t?Math.sqrt(t):t}function h(n,r){var t,e,o,u=n.length,f=-1;if(null==r){for(;++f=t)for(e=o=t;++ft&&(e=t),o=t)for(e=o=t;++ft&&(e=t),o=0?(u>=d?10:u>=y?5:u>=N?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(u>=d?10:u>=y?5:u>=N?2:1)}function w(n,r,t){var e=Math.abs(r-n)/Math.max(0,t),o=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),u=e/o;return u>=d?o*=10:u>=y?o*=5:u>=N&&(o*=2),r=1)return+t(n[e-1],e-1,n);var e,o=(e-1)*r,u=Math.floor(o),f=+t(n[u],u,n);return f+(+t(n[u+1],u+1,n)-f)*(o-u)}}function b(n,r){var t,e,o=n.length,u=-1;if(null==r){for(;++u=t)for(e=t;++ut&&(e=t)}else for(;++u=t)for(e=t;++ut&&(e=t);return e}function q(n){if(!(o=n.length))return[];for(var r=-1,t=b(n,L),e=new Array(t);++rn?1:r>=n?0:NaN},n.deviation=a,n.extent=h,n.histogram=function(){var n=M,r=h,t=A;function e(e){var u,f,l=e.length,i=new Array(l);for(u=0;uc;)s.pop(),--g;var v,M=new Array(g+1);for(u=0;u<=g;++u)(v=M[u]=[]).x0=u>0?s[u-1]:h,v.x1=u=t)for(e=t;++ue&&(e=t)}else for(;++u=t)for(e=t;++ue&&(e=t);return e},n.mean=function(n,r){var t,e=n.length,o=e,u=-1,f=0;if(null==r)for(;++u=0;)for(r=(e=n[o]).length;--r>=0;)t[--f]=e[r];return t},n.min=b,n.pairs=function(n,r){null==r&&(r=f);for(var t=0,e=n.length-1,o=n[0],u=new Array(e<0?0:e);t0)return[n];if((e=r0)for(n=Math.ceil(n/f),r=Math.floor(r/f),u=new Array(o=Math.ceil(r-n+1));++l