Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-scale-cluster

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-scale-cluster - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

dist/d3-scale-cluster.min.js

@@ -1,1 +0,1 @@

!function(r){function n(e){if(t[e])return t[e].exports;var o=t[e]={exports:{},id:e,loaded:!1};return r[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var t={};return n.m=r,n.c=t,n.p="",n(0)}([function(r,n,t){function e(){function r(){if(!(a.length<=2)){n=o(t,a.length),u=[];for(var r=0;r<n.length;r++)u.push(n[r][0])}}var n=[],t=[],a=[],u=[],f=function(r){if(0!==n.length){for(var t=u.length-1;t>=0;t--)if(r>=u[t])return a[t];return a[0]}};return f.domain=function(){return arguments.length?(t=arguments[0],r(),f):t},f.range=function(){if(arguments.length){var n=arguments[0],t=n.length!==a.length;return a=n,t&&r(),f}return a},f.invertExtent=function(r){for(var n=NaN,t=NaN,e=0;e<a.length;e++)if(a[e]===r){n=u[e],t=e+1<a.length?u[e+1]:NaN;break}return[n,t]},f.clusters=function(){return u.slice(1)},f.copy=function(){return e().domain(t).range(a)},f}var o=t(1);"object"==typeof d3&&(d3.scaleCluster=e),r.exports=e},function(r,n){function t(r){return r.slice().sort(function(r,n){return r-n})}function e(r){for(var n,t=0,e=0;e<r.length;e++)0!==e&&r[e]===n||(n=r[e],t++);return t}function o(r,n){for(var t=[],e=0;e<r;e++){for(var o=[],a=0;a<n;a++)o.push(0);t.push(o)}return t}function a(r,n){if(n>r.length)throw new Error("Cannot generate more classes than there are data values");var a=t(r),u=e(a);if(1===u)return[a];for(var f=o(n,a.length),i=o(n,a.length),l=0;l<n;l++)for(var c=a[0],h=Math.max(l,1);h<a.length;h++)if(0===l){var s=Math.pow(a[h]-c,2);f[l][h]=f[l][h-1]+h/(h+1)*s;var g=h*c+a[h];c=g/(h+1)}else for(var v=0,p=0,d=h;d>=l;d--)v+=(h-d)/(h-d+1)*Math.pow(a[d]-p,2),p=(a[d]+(h-d)*p)/(h-d+1),d===h?(f[l][h]=v,i[l][h]=d,d>0&&(f[l][h]+=f[l-1][d-1])):0===d?v<=f[l][h]&&(f[l][h]=v,i[l][h]=d):v+f[l-1][d-1]<f[l][h]&&(f[l][h]=v+f[l-1][d-1],i[l][h]=d);var x=[],N=i[0].length-1;for(l=i.length-1;l>=0;l--){var m=i[l][N];x[l]=a.slice(m,N+1),l>0&&(N=m-1)}return x}r.exports=a}]);
!function(r){function n(e){if(t[e])return t[e].exports;var a=t[e]={exports:{},id:e,loaded:!1};return r[e].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}var t={};return n.m=r,n.c=t,n.p="",n(0)}([function(r,n,t){function e(){function r(){if(!(o.length<=2)){n=a(t,o.length),u=[];for(var r=0;r<n.length;r++)u.push(n[r][0])}}var n=[],t=[],o=[],u=[],f=function(r){if(0!==n.length){for(var t=u.length-1;t>=0;t--)if(r>=u[t])return o[t];return o[0]}};return f.domain=function(){return arguments.length?(t=arguments[0],r(),f):t},f.range=function(){if(arguments.length){var n=arguments[0],t=n.length!==o.length;return o=n,t&&r(),f}return o},f.invertExtent=function(r){for(var n=NaN,t=NaN,e=0;e<o.length;e++)if(o[e]===r){n=u[e],t=e+1<o.length?u[e+1]:NaN;break}return[n,t]},f.clusters=function(){return u.slice(1)},f.copy=function(){return e().domain(t).range(o)},f}var a=t(1);"object"==typeof d3&&(d3.scaleCluster=e),r.exports=e},function(r,n){function t(r){return r.slice().sort(function(r,n){return r-n})}function e(r){for(var n,t=0,e=0;e<r.length;e++)0!==e&&r[e]===n||(n=r[e],t++);return t}function a(r,n){for(var t=[],e=0;e<r;e++){for(var a=[],o=0;o<n;o++)a.push(0);t.push(a)}return t}function o(r,n,t,e){var a;if(r>0){var o=(t[n]-t[r-1])/(n-r+1);a=e[n]-e[r-1]-(n-r+1)*o*o}else a=e[n]-t[n]*t[n]/(n+1);return a<0?0:a}function u(r,n,t,e,a,f,i){if(!(r>n)){var l=Math.floor((r+n)/2);e[t][l]=e[t-1][l-1],a[t][l]=l;var h=t;r>t&&(h=Math.max(h,a[t][r-1]||0)),h=Math.max(h,a[t-1][l]||0);var c=l-1;n<e.length-1&&(c=Math.min(c,a[t][n+1]||0));for(var v,g,s,p,d=c;d>=h&&(v=o(d,l,f,i),!(v+e[t-1][h-1]>=e[t][l]));--d)g=o(h,l,f,i),s=g+e[t-1][h-1],s<e[t][l]&&(e[t][l]=s,a[t][l]=h),h++,p=v+e[t-1][d-1],p<e[t][l]&&(e[t][l]=p,a[t][l]=d);u(r,l-1,t,e,a,f,i),u(l+1,n,t,e,a,f,i)}}function f(r,n,t){for(var e=n[0].length,a=new Array(e),f=new Array(e),i=r[Math.floor(e/2)],l=0;l<e;++l)0===l?(a[0]=r[0]-i,f[0]=(r[0]-i)*(r[0]-i)):(a[l]=a[l-1]+r[l]-i,f[l]=f[l-1]+(r[l]-i)*(r[l]-i)),n[0][l]=o(0,l,a,f),t[0][l]=0;for(var h,c=1;c<n.length;++c)h=c<n.length-1?c:e-1,u(h,e-1,c,n,t,a,f)}function i(r,n){if(n>r.length)throw new Error("Cannot generate more classes than there are data values");var o=r.length,u=t(r),i=e(u);if(1===i)return[u];n=Math.min(i,n);var l=a(n,o),h=a(n,o);f(u,l,h);for(var c=[],v=h[0].length-1,g=h.length-1;g>=0;g--){var s=h[g][v];c[g]=u.slice(s,v+1),g>0&&(v=s-1)}return c}r.exports=i}]);
{
"name": "d3-scale-cluster",
"version": "1.1.1",
"version": "1.1.2",
"description": "D3 scale that clusters data into discrete groups",

@@ -5,0 +5,0 @@ "repository": "schnerd/d3-scale-cluster",

@@ -16,3 +16,3 @@ # d3-scale-cluster

```
<script src="https://unpkg.com/d3-scale-cluster@1.1.0/dist/d3-scale-cluster.min.js"></script>
<script src="https://unpkg.com/d3-scale-cluster@1.1.2/dist/d3-scale-cluster.min.js"></script>
```

@@ -19,0 +19,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc