![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
GridIndex is a 2D spatial index that is transferable.
Pairs of keys and boxes can be inserted into GridIndex. The grid can then be queried to find all the keys that intersect a given box. The grid can be serialized to an ArrayBuffer so that it can be transferred between WebWorkers.
You should probably use rbush instead of GridIndex! It's easier to use and it's as fast or faster in many cases.
GridIndex can be faster in a specific set of cases:
GridIndex is used by mapbox-gl-js for label collision detection and feature picking.
var GridIndex = require('grid-index');
var grid = new GridIndex(100, 5, 0);
var key1 = 1;
var key2 = 2;
var key3 = 3;
grid.insert(key1, 30, 10, 35, 15);
grid.insert(key2, 60, 20, 65, 25);
grid.insert(key3, 40, 10, 45, 15);
var keys = grid.query(0, 0, 100, 13);
// `keys` is now [key1, key3]
var arrayBuffer = grid.toArrayBuffer();
// transfer the ArrayBuffer to a different worker
var grid2 = new GridIndex(arrayBuffer);
var keys2 = grid2.query(0, 0, 100, 13);
// `keys2` is now [key1, key3]
GridIndex(extent, n, padding)
Create a new GridIndex.
4096
.4
would divide the grid into 16 cells.GridIndex(arrayBuffer)
Unserialize a GridIndex.
gridIndex.toArrayBuffer()
.gridIndex.insert(key, x1, y1, x2, y2)
Insert a new key, box pair into the grid.
gridIndex.query(key, x1, y1, x2, y2, intersectionTest?)
Find the keys that intersect with the given box.
returns an array of keys.
gridIndex.toArrayBuffer()
Serialize a GridIndex to an ArrayBuffer so that it can be transferred between WebWorkers efficiently.
returns an ArrayBuffer that can later be deserialized with new GridIndex(arrayBuffer)
.
FAQs
A 2D spatial index for axis-aligned boxes
The npm package grid-index receives a total of 0 weekly downloads. As such, grid-index popularity was classified as not popular.
We found that grid-index demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.