Skip to content

Releases: mourner/kdbush

v4.0.2

27 Apr 19:34
Compare
Choose a tag to compare

Make sure empty KDBush (with zero items) doesn't throw an error.

v4.0.1

20 Apr 19:52
Compare
Choose a tag to compare

Fix NPM package missing index.js.

v4.0.0

20 Apr 19:51
Compare
Choose a tag to compare

⚠️ A major rewrite of the library to make it more memory-efficient, serializable and similar in API to Flatbush. Breaks the API in the following way:

// old API
const index = new KDBush(points, p => p.x, p => p.y, 64, Uint32Array);

// new API
const index = new KDBush(points.length, 64, Uint32Array);
for (const {x, y} of points) index.add(x, y);
index.finish();

The new API is more verbose, but it allows creating an index without requiring to store coordinates in some intermediate point array, allowing more efficient memory use, and allows transferring (or saving to a binary file) and recreating an index from a single array buffer:

// instantly transfer the index from a worker to the main thread
postMessage(index.data, [index.data]);

// reconstruct the index from a raw array buffer
const index = Flatbush.from(e.data);

⚠️ Also breaking in this version:

  • Dropped CommonJS entry point in favor of a ESM-only one (there's still a UMD bundle provided for browsers though).
  • Dropped transpilation for IE11 (although you can still do it on your end and it will work).

v3.0.0

07 Sep 09:00
Compare
Choose a tag to compare
  • ⚠️ Breaking: Changed the API from kdbush(...) to new KDBush(...).
  • ⚡️ Improved memory footprint (and performance for float types) by storing indices more efficiently. #22
  • 🔧 Converted to idiomatic ES for module consumers. Browser/Node builds are still transpiled to ES5.

v2.0.1

07 Jun 16:48
Compare
Choose a tag to compare

Fix Unpkg and JSDelivr configurations.

v2.0.0

07 Jun 16:25
Compare
Choose a tag to compare

Expose KDBush as a proper ES module:

import kdbush from 'kdbush';

v1.0.1

18 Oct 21:19
Compare
Choose a tag to compare
  • Moved tape from dependencies to devDependencies.