Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two #34

Merged
merged 6 commits into from
Aug 23, 2020
Merged

Two #34

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A [quadtree](https://en.wikipedia.org/wiki/Quadtree) recursively partitions two-

## Installing

If you use NPM, `npm install d3-quadtree`. Otherwise, download the [latest release](https://github.com/d3/d3-quadtree/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-quadtree.v1.min.js) or as part of [D3](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
If you use NPM, `npm install d3-quadtree`. Otherwise, download the [latest release](https://github.com/d3/d3-quadtree/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-quadtree.v2.min.js) or as part of [D3](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:

```html
<script src="https://d3js.org/d3-quadtree.v1.min.js"></script>
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "d3-quadtree",
"version": "1.0.7",
"version": "2.0.0-rc.1",
"publishConfig": {
"tag": "next"
},
"description": "Two-dimensional recursive spatial subdivision.",
"keywords": [
"d3",
Expand Down
2 changes: 1 addition & 1 deletion src/add.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default function(d) {
var x = +this._x.call(null, d),
const x = +this._x.call(null, d),
y = +this._y.call(null, d);
return add(this.cover(x, y), x, y, d);
}
Expand Down
2 changes: 1 addition & 1 deletion src/cover.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function(x, y) {

// Otherwise, double repeatedly to cover.
else {
var z = x1 - x0,
var z = x1 - x0 || 1,
node = this._root,
parent,
i;
Expand Down
5 changes: 5 additions & 0 deletions test/cover-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,8 @@ tape("quadtree.cover(x, y) does not wrap the root node if it is undefined", func
test.equal(q.copy().cover(-3, -3).root(), undefined);
test.end();
});

tape("quadtree.cover() does not crash on huge values", function(test) {
d3_quadtree.quadtree([[1e23, 0]]);
test.end();
});