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

d3-quadtree

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-quadtree - npm Package Compare versions

Comparing version 0.0.3 to 0.1.0

2

build/bundle.js

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

var version = "0.0.3"; export * from "../index"; export {version};
var version = "0.1.0"; export * from "../index"; export {version};

@@ -245,3 +245,3 @@ (function (global, factory) {

var version = "0.0.3";
var version = "0.1.0";

@@ -248,0 +248,0 @@ exports.version = version;

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

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("d3-quadtree",["exports"],t):t(n.d3_quadtree={})}(this,function(n){"use strict";function t(n){return n[0]}function e(n){return n[1]}function u(n){return function(){return n}}function i(){this.x=null,this.y=null,this.leaf=!0,this.point=null,this.nodes=[]}function r(n,t,e,u,i,f){if(!n(t,e,u,i,f)){var o=.5*(e+i),l=.5*(u+f),a=t.nodes;a[0]&&r(n,a[0],e,u,o,l),a[1]&&r(n,a[1],o,u,i,l),a[2]&&r(n,a[2],e,l,o,f),a[3]&&r(n,a[3],o,l,i,f)}}function f(n,t,e,u,i,r,f){var o,l=1/0;return function a(n,s,c,d,h){if(!(s>r||c>f||u>d||i>h)){if(v=n.point){var v,p=t-n.x,y=e-n.y,x=p*p+y*y;if(l>x){var g=Math.sqrt(l=x);u=t-g,i=e-g,r=t+g,f=e+g,o=v}}for(var b=n.nodes,m=.5*(s+d),q=.5*(c+h),N=t>=m,k=e>=q,w=k<<1|N,M=w+4;M>w;++w)if(n=b[3&w])switch(3&w){case 0:a(n,s,c,m,q);break;case 1:a(n,m,c,d,q);break;case 2:a(n,s,q,m,h);break;case 3:a(n,m,q,d,h)}}}(n,u,i,r,f),o}function o(){function n(n){function t(n,t,u,i,r,f,o,l){if(!isNaN(u)&&!isNaN(i))if(n.leaf){var a=n.x,s=n.y;if(null!=a)if(Math.abs(a-u)+Math.abs(s-i)<.01)e(n,t,u,i,r,f,o,l);else{var c=n.point;n.x=n.y=n.point=null,e(n,c,a,s,r,f,o,l),e(n,t,u,i,r,f,o,l)}else n.x=u,n.y=i,n.point=t}else e(n,t,u,i,r,f,o,l)}function e(n,e,u,r,f,o,l,a){var s=.5*(f+l),c=.5*(o+a),d=u>=s,h=r>=c,v=h<<1|d;n.leaf=!1,n=n.nodes[v]||(n.nodes[v]=new i),d?f=s:l=s,h?o=c:a=c,t(n,e,u,r,f,o,l,a)}var h,v,p,y,x,g,b,m,q,N="function"==typeof c?c:u(c),k="function"==typeof d?d:u(d);if(n||(n=[]),null!=o)g=o,b=a,m=l,q=s;else for(m=q=-(g=b=1/0),v=[],p=[],x=n.length,y=0;x>y;++y){var w=+N(h=n[y],y),M=+k(h,y);g>w&&(g=w),b>M&&(b=M),w>m&&(m=w),M>q&&(q=M),v.push(w),p.push(M)}var F=m-g,j=q-b;isFinite(F)&&isFinite(j)&&(F>j?q=b+F:m=g+j);var z=new i;if(z.add=function(n){return t(z,n,+N(n,++y),+k(n,y),g,b,m,q),z},z.visit=function(n){return r(n,z,g,b,m,q),z},z.find=function(n,t){return f(z,n,t,g,b,m,q)},y=-1,null==o){for(;++y<x;)t(z,n[y],v[y],p[y],g,b,m,q);--y}else n.forEach(z.add);return v=p=n=h=null,z}var o,l,a,s,c=t,d=e;return n.x=function(t){return arguments.length?(c=t,n):c},n.y=function(t){return arguments.length?(d=t,n):d},n.extent=function(t){return arguments.length?(null==t?o=a=l=s=null:(o=+t[0][0],a=+t[0][1],l=+t[1][0],s=+t[1][1]),n):null==o?null:[[o,a],[l,s]]},n.size=function(t){return arguments.length?(null==t?o=a=l=s=null:(o=a=0,l=+t[0],s=+t[1]),n):null==o?null:[l-o,s-a]},n}var l="0.0.3";n.version=l,n.quadtree=o});
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("d3-quadtree",["exports"],t):t(n.d3_quadtree={})}(this,function(n){"use strict";function t(n){return n[0]}function e(n){return n[1]}function u(n){return function(){return n}}function i(){this.x=null,this.y=null,this.leaf=!0,this.point=null,this.nodes=[]}function r(n,t,e,u,i,f){if(!n(t,e,u,i,f)){var o=.5*(e+i),l=.5*(u+f),a=t.nodes;a[0]&&r(n,a[0],e,u,o,l),a[1]&&r(n,a[1],o,u,i,l),a[2]&&r(n,a[2],e,l,o,f),a[3]&&r(n,a[3],o,l,i,f)}}function f(n,t,e,u,i,r,f){var o,l=1/0;return function a(n,s,c,d,h){if(!(s>r||c>f||u>d||i>h)){if(v=n.point){var v,p=t-n.x,y=e-n.y,x=p*p+y*y;if(l>x){var g=Math.sqrt(l=x);u=t-g,i=e-g,r=t+g,f=e+g,o=v}}for(var b=n.nodes,m=.5*(s+d),q=.5*(c+h),N=t>=m,k=e>=q,w=k<<1|N,M=w+4;M>w;++w)if(n=b[3&w])switch(3&w){case 0:a(n,s,c,m,q);break;case 1:a(n,m,c,d,q);break;case 2:a(n,s,q,m,h);break;case 3:a(n,m,q,d,h)}}}(n,u,i,r,f),o}function o(){function n(n){function t(n,t,u,i,r,f,o,l){if(!isNaN(u)&&!isNaN(i))if(n.leaf){var a=n.x,s=n.y;if(null!=a)if(Math.abs(a-u)+Math.abs(s-i)<.01)e(n,t,u,i,r,f,o,l);else{var c=n.point;n.x=n.y=n.point=null,e(n,c,a,s,r,f,o,l),e(n,t,u,i,r,f,o,l)}else n.x=u,n.y=i,n.point=t}else e(n,t,u,i,r,f,o,l)}function e(n,e,u,r,f,o,l,a){var s=.5*(f+l),c=.5*(o+a),d=u>=s,h=r>=c,v=h<<1|d;n.leaf=!1,n=n.nodes[v]||(n.nodes[v]=new i),d?f=s:l=s,h?o=c:a=c,t(n,e,u,r,f,o,l,a)}var h,v,p,y,x,g,b,m,q,N="function"==typeof c?c:u(c),k="function"==typeof d?d:u(d);if(n||(n=[]),null!=o)g=o,b=a,m=l,q=s;else for(m=q=-(g=b=1/0),v=[],p=[],x=n.length,y=0;x>y;++y){var w=+N(h=n[y],y),M=+k(h,y);g>w&&(g=w),b>M&&(b=M),w>m&&(m=w),M>q&&(q=M),v.push(w),p.push(M)}var F=m-g,j=q-b;isFinite(F)&&isFinite(j)&&(F>j?q=b+F:m=g+j);var z=new i;if(z.add=function(n){return t(z,n,+N(n,++y),+k(n,y),g,b,m,q),z},z.visit=function(n){return r(n,z,g,b,m,q),z},z.find=function(n,t){return f(z,n,t,g,b,m,q)},y=-1,null==o){for(;++y<x;)t(z,n[y],v[y],p[y],g,b,m,q);--y}else n.forEach(z.add);return v=p=n=h=null,z}var o,l,a,s,c=t,d=e;return n.x=function(t){return arguments.length?(c=t,n):c},n.y=function(t){return arguments.length?(d=t,n):d},n.extent=function(t){return arguments.length?(null==t?o=a=l=s=null:(o=+t[0][0],a=+t[0][1],l=+t[1][0],s=+t[1][1]),n):null==o?null:[[o,a],[l,s]]},n.size=function(t){return arguments.length?(null==t?o=a=l=s=null:(o=a=0,l=+t[0],s=+t[1]),n):null==o?null:[l-o,s-a]},n}var l="0.1.0";n.version=l,n.quadtree=o});
{
"name": "d3-quadtree",
"version": "0.0.3",
"version": "0.1.0",
"description": "Two-dimensional recursive spatial subdivision.",

@@ -27,3 +27,3 @@ "keywords": [

"devDependencies": {
"d3-arrays": "~0.3.1",
"d3-array": "~0.6.1",
"faucet": "0.0",

@@ -30,0 +30,0 @@ "rollup": "0.20.5",

@@ -14,7 +14,13 @@ # d3-quadtree

If you use NPM, `npm install d3-quadtree`. Otherwise, download the [latest release](https://github.com/d3/d3-quadtree/releases/latest).
If you use NPM, `npm install d3-quadtree`. Otherwise, download the [latest release](https://github.com/d3/d3-quadtree/releases/latest). The released bundle supports AMD, CommonJS, and vanilla environments. Create a custom build using [Rollup](https://github.com/rollup/rollup) or your preferred bundler. You can also load directly from [d3js.org](https://d3js.org):
```html
<script src="https://d3js.org/d3-quadtree.v0.1.min.js"></script>
```
In a vanilla environment, a `d3_quadtree` global is exported. [Try d3-quadtree in your browser.](https://tonicdev.com/npm/d3-quadtree)
## API Reference
<a name="quadtree" href="#quadtree">#</a> <b>quadtree</b>()
<a name="quadtree" href="#quadtree">#</a> d3_quadtree.<b>quadtree</b>()

@@ -21,0 +27,0 @@ Creates a new [quadtree factory](#_quadtree) with the default [*x*-accessor](#quadtree_x), [*y*-accessor](#quadtree_y) and [extent](#quadtree_extent). The returned factory function can be used to create any number of quadtrees from data.

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