QuadTree Save

A QuadTree Example for JavaScript (with p5.js)

Project README

A QuadTree example (and almost sort of a JavaScript library) with p5.js.

QuadTree

How to use

  • You can download and include quadtree.js in your p5 sketch or refer to it via this CDN link:
<script src="https://cdn.jsdelivr.net/gh/CodingTrain/QuadTree/quadtree.js"></script>

Once you've include the library you can create a QuadTree object a Rectangle boundary and maximum capacity:

const r = new Rectangle(0, 0, width, height);
const capacity = 4;
const quadtree = new QuadTree(r, capacity);

Testing

To run tests use one of the following commands

For continuous testing

npm run test-watch

For a single run test, with coverage

npm run test

This will output to the coverage folder where you can few test coverage by opening index.html

Other QuadTree libraries in JS

Other Versions

Ports to other languages

  • Carla de Beer (Processing port) - GitHub
  • Alix Poulsen (Kit port) - Github
Open Source Agenda is not affiliated with "QuadTree" Project. README Source: CodingTrain/QuadTree
Stars
129
Open Issues
3
Last Commit
1 year ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating