{"id":16126732,"url":"https://github.com/mikolalysenko/interval-tree-1d","last_synced_at":"2025-04-05T15:09:49.484Z","repository":{"id":11219654,"uuid":"13608936","full_name":"mikolalysenko/interval-tree-1d","owner":"mikolalysenko","description":"1D interval tree","archived":false,"fork":false,"pushed_at":"2023-03-06T03:25:05.000Z","size":109,"stargazers_count":71,"open_issues_count":15,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T06:05:31.938Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikolalysenko.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-16T03:38:28.000Z","updated_at":"2025-01-30T02:15:40.000Z","dependencies_parsed_at":"2024-06-18T13:49:55.190Z","dependency_job_id":"390063c4-a03f-436b-a137-c5a27a7d12a0","html_url":"https://github.com/mikolalysenko/interval-tree-1d","commit_stats":{"total_commits":18,"total_committers":3,"mean_commits":6.0,"dds":"0.16666666666666663","last_synced_commit":"adc7a60a8af9e0376f66ab7c00fcb4954f0e70b1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Finterval-tree-1d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Finterval-tree-1d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Finterval-tree-1d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Finterval-tree-1d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikolalysenko","download_url":"https://codeload.github.com/mikolalysenko/interval-tree-1d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353749,"owners_count":20925329,"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","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":[],"created_at":"2024-10-09T21:40:05.553Z","updated_at":"2025-04-05T15:09:49.467Z","avatar_url":"https://github.com/mikolalysenko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"interval-tree-1d\n================\nA simple 1D interval tree.  Supports O(log(n)) amortized updates and O(log(n)) queries.\n\n[![build status](https://secure.travis-ci.org/mikolalysenko/interval-tree-1d.png)](http://travis-ci.org/mikolalysenko/interval-tree-1d)\n\n# Example\n\n```javascript\nvar createIntervalTree = require(\"interval-tree-1d\")\n\n//Create some random list of intervals\nvar intervals = [ [1, 2], [-1, 0], [0.5, 1], [-10, 10] ]\n\n//Build tree\nvar tree = createIntervalTree(intervals)\n\n//Find all intervals containing query point 0.7\nconsole.log(\"querying point:\", 0.7)\ntree.queryPoint(0.7, function(interval) {\n  console.log(interval)\n})\n```\n\n# API\n\n```javascript\nvar createIntervalTree = require(\"interval-tree-1d\")\n```\n\n## Constructor\n\n### `var tree = createIntervalTree(intervals)`\nConstructs an interval tree given a list of intervals\n\n## Properties\n\n### `tree.count`\nReturns the number of items in the tree\n\n### `tree.intervals`\nReturns a list of all the intervals in the tree\n\n### `tree.insert(interval)`\nAdds an interval to the tree\n\n### `tree.remove(interval)`\nRemoves an interval from the tree\n\n### `tree.queryPoint(p, visit(interval))`\nVisits all intervals containing the point p\n\n### `tree.queryInterval(lo, hi, visit(interval))`\nReturns all intervals which intersect the interval `[lo, hi]`\n\n# Credits\n(c) 2013-2015 Mikola Lysenko. MIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikolalysenko%2Finterval-tree-1d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikolalysenko%2Finterval-tree-1d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikolalysenko%2Finterval-tree-1d/lists"}