{"id":19658160,"url":"https://github.com/cdaringe/3d-adjacency","last_synced_at":"2025-08-02T11:06:16.780Z","repository":{"id":8842079,"uuid":"59922606","full_name":"cdaringe/3d-adjacency","owner":"cdaringe","description":"find \"clusters\" of adjacent values/cells from a 3d array","archived":false,"fork":false,"pushed_at":"2024-08-06T05:55:26.000Z","size":850,"stargazers_count":0,"open_issues_count":16,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-25T05:10:33.075Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdaringe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-05-29T02:15:28.000Z","updated_at":"2020-07-30T12:35:09.000Z","dependencies_parsed_at":"2024-02-26T03:26:24.875Z","dependency_job_id":"ad27e876-a71f-4fca-b2db-072810b279fc","html_url":"https://github.com/cdaringe/3d-adjacency","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cdaringe/3d-adjacency","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2F3d-adjacency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2F3d-adjacency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2F3d-adjacency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2F3d-adjacency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdaringe","download_url":"https://codeload.github.com/cdaringe/3d-adjacency/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2F3d-adjacency/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268378623,"owners_count":24240895,"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-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2024-11-11T15:36:17.286Z","updated_at":"2025-08-02T11:06:16.725Z","avatar_url":"https://github.com/cdaringe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 3d-adjacency\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/cdaringe/3d-adjacency.svg)](https://greenkeeper.io/)\n\n[ ![Codeship Status for cdaringe/3d-adjacency](https://codeship.com/projects/9480c8b0-0977-0134-9cd2-02b70758e3b0/status?branch=master)](https://codeship.com/projects/155284) [![Coverage Status](https://coveralls.io/repos/github/cdaringe/3d-adjacency/badge.svg?branch=master)](https://coveralls.io/github/cdaringe/3d-adjacency?branch=master) \u003cimg src=\"https://img.shields.io/badge/standardjs-%E2%9C%93-green.svg\" /\u003e\n\nfind \"clusters\" of adjacent cells from a 3d array.  the array does _not_ need to be cubic, but it does need to be a rectangular prism.\n\n## example\n\nsuppose you had a three dimensional array, full of 0s and 1s.  0s are white, and 1s are green.  graphically, it may look like:\n\n\u003cimg style=\"max-height: 125px\" src=\"https://raw.githubusercontent.com/cdaringe/3d-adjacency/master/img/green-white-array.png\" /\u003e\n\nwhat you desire is the sets of connected green cells.  graphically, it may look like:\n\n\u003cimg style=\"max-height: 125px\" src=\"https://raw.githubusercontent.com/cdaringe/3d-adjacency/master/img/green-clusters.png\" /\u003e\n\nwell, that's exactly what this module provides!  yahoo!\n\n```js\nconst adj3d = require('3d-adjacency')\nconst exampleCube = [ // as shown above\n\t[\n\t  [1, 0, 1], [0, 0, 0], [1, 0, 1],\n\t],\n\t[\n\t  [1, 0, 1], [0, 0, 0], [1, 0, 1],\n\t],\n\t[\n\t  [1, 0, 1], [0, 0, 0], [1, 0, 2],\n\t],\n]\nconst groups = adj3d.find(exampleCube)\n// ==\u003e\n/*\n[ // four groups of green blocks\n  [\n    { x: 0, y: 0, z: 0, value: 1 },\n    { x: 1, y: 0, z: 0, value: 1 },\n    { x: 2, y: 0, z: 0, value: 1 }\n  ],\n  [\n    { x: 0, y: 0, z: 2, value: 1 },\n    { x: 1, y: 0, z: 2, value: 1 },\n    { x: 2, y: 0, z: 2, value: 1 }\n  ],\n  [\n    { x: 0, y: 2, z: 0, value: 1 },\n    { x: 1, y: 2, z: 0, value: 1 },\n    { x: 2, y: 2, z: 0, value: 1 }\n  ],\n  [\n    { x: 0, y: 2, z: 2, value: 1 },\n    { x: 1, y: 2, z: 2, value: 1 },\n    { x: 2, y: 2, z: 2, value: 2 }\n  ]\n]\n*/\n```\n\n_\"Hey, why is output not matching the same form as the input?\"_\n\nValid question.  Specifically, the output is a set of objects that are coordinates+values. the input is the actual data.  Although one might expect the output to be something like `[ [0, 1, 2] ]`, where `0, 1, 2` are coordinates, the input was not coordinate sets to begin with.\n\n## install\n\n`npm install --save 3d-adjacency`\n\n## usage\n\nSee example above and the [offcial API docs](http://cdaringe.github.io/3d-adjacency)\n\n\n### changelog\n\n- 0.0.2 handle much larger arrays. remove recursive calls to keep stack down\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdaringe%2F3d-adjacency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdaringe%2F3d-adjacency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdaringe%2F3d-adjacency/lists"}