{"id":20139053,"url":"https://github.com/threeletters/quadmap","last_synced_at":"2025-07-22T07:32:59.086Z","repository":{"id":57171444,"uuid":"63546082","full_name":"ThreeLetters/QuadMap","owner":"ThreeLetters","description":"A map-styled quadtree (Failure)","archived":false,"fork":false,"pushed_at":"2016-09-19T02:16:27.000Z","size":64,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-01T05:46:07.670Z","etag":null,"topics":["experiment","failed"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThreeLetters.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-17T18:18:57.000Z","updated_at":"2017-01-16T03:54:29.000Z","dependencies_parsed_at":"2022-08-27T13:11:43.517Z","dependency_job_id":null,"html_url":"https://github.com/ThreeLetters/QuadMap","commit_stats":null,"previous_names":["ajs-development/quadmap"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThreeLetters/QuadMap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FQuadMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FQuadMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FQuadMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FQuadMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThreeLetters","download_url":"https://codeload.github.com/ThreeLetters/QuadMap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThreeLetters%2FQuadMap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266447977,"owners_count":23930088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["experiment","failed"],"created_at":"2024-11-13T21:43:48.502Z","updated_at":"2025-07-22T07:32:59.061Z","avatar_url":"https://github.com/ThreeLetters.png","language":"JavaScript","readme":"[![NPM] (https://img.shields.io/badge/Module-Npm-blue.svg)] (https://www.npmjs.com/package/QuadMap)\n[![Donate] (https://img.shields.io/badge/Donate-Paypal-brightgreen.svg)] (https://paypal.me/andrews54757)\n# QuadMap\nA map-styled quadtree. Also supports multi-variables (uses collections/fast-map)\n\n\n[![Build Status](https://travis-ci.org/AJS-development/QuadMap.svg?branch=master)](https://travis-ci.org/AJS-development/QuadMap)\n\n\n## Installation\n\n\u003e npm install QuadMap\n\n## Usage\n```\nvar QuadMap = require(\"QuadMap\");\nvar quadMap = new QuadMap(top,bottom,left,right);\n```\n\nTo insert a node\n\n\n```\nvar QuadMap = require(\"QuadMap\");\nvar quadMap = new QuadMap(100,-100,-100,100);\n\nvar node = {\nposition: {x:10,y: 20},\nname: \"hello\",\ncolor: {R:0,G:0,B:0}\nnode.id: id\n}\nquadMap.set(node.id,node);\n```\n\n\nTo get a node\n\n\n```\nquadMap.get(id)\n```\n\nTo get the nodes in the nodes quad\n\n\n```\nvar quad = quadMap.getQuadById(id);\nvar nodes = quad.getNodes();\n```\n\nTo get the nodes in a box\n\n```\nvar box = {\ntop: 20,\nbottom: 0,\nleft: -1,\nright: 10,\n}\nvar quad = quadMap.getQuadBox(box)\nvar nodes = quad.getNodes(true);\n// Note that it is wise to set the recursive option to true, because if the box is too big for a bottom quad, then it will return a quad it fits.\n```\n\n\nTo change the position variable \n\n\n```\nvar QuadMap = require(\"QuadMap\");\nvar quadMap = new QuadMap(100,-100,-100,100);\n\nvar node = {\npos: {x:10,y: 20}, // Note the var is now \"pos\" not \"position\". \"position\" is default\nname: \"hello\",\ncolor: {R:0,G:0,B:0}\nnode.id: id\n}\nquadMap.setPosVar(\"pos\");\nquadMap.set(node.id,node);\n```\n\n\nTo change the max amount of levels\n\n\n```\nquadMap.setMaxLevel(number);\n```\n\n\nTo add a variable\n\n\n``quadMap.addVar(\"something\")``\n\n\nTo add a object to a variable\n\n\n```\nquadMap.something.set(id,obj); // Note this also adds it to the MASTER nodes list\n```\n\n\nTo get a list of objects in a var inside a quad\n\n\n```\nvar nodes = quad.something.getNodes(recursive,keep);\n```\n\n## Documentation\n\n#### Quadmap.prototye.set(id,node)\nInsert an item\n\n#### Quadmap.prototype.get(id)\nreturns the item based on its id.\n\n#### Quadmap.prototype.delete(id)\ndeleted the node based apon its id\n\n#### Quadmap.prototype.clear(id)\nclears the quadmap/quad\n\n#### Quadmap.prototype.getQuad(pos)\ngets the quad based apon the pos\n\n#### Quadmap.prototype.getQuadBox(box)\ngets the quad the box fits into\n\n#### Quadmap.prototype.getNodes(recursive,include)\nGets the nodes in a quad. If recursive is true, then any nodes in quads under the quad will also be included. if include is true, then it will return an onject like below.\n\u003e {\n\u003e node: node,\n\u003e QTree: quad,\n\u003e compiled: true,\n\u003e stored: true,\n\u003e}\n\nThe original node can be found in the .node variable, and the QTree is the quad it resides in. Compiled and stored are system variables.\n#### Quadmap.prototype.setPosVar(var)\nsets the name of the variable to get a nodes pos from\n\n#### Quadmap.prototype.setNodeIntTime(time)\nsets the time in which the node update runs\n","funding_links":["https://paypal.me/andrews54757"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeletters%2Fquadmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreeletters%2Fquadmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeletters%2Fquadmap/lists"}