Observed since 20 Oct, 19:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
3d-adjacency
find clusters of adjacent cells from a 3d array.
find "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.
suppose you had a three dimensional array, full of 0s and 1s. 0s are white, and 1s are green. graphically, it may look like:
what you desire is the sets of connected green cells. graphically, it may look like:
well, that's exactly what this module provides! yahoo!
const adj3d = require('3d-adjacency')
const exampleCube = [ // as shown above
[
[1, 0, 1], [0, 0, 0], [1, 0, 1],
],
[
[1, 0, 1], [0, 0, 0], [1, 0, 1],
],
[
[1, 0, 1], [0, 0, 0], [1, 0, 2],
],
]
const groups = adj3d.find(exampleCube)
// ==>
/*
[ // four groups of green blocks
[
{ x: 0, y: 0, z: 0, value: 1 },
{ x: 1, y: 0, z: 0, value: 1 },
{ x: 2, y: 0, z: 0, value: 1 }
],
[
{ x: 0, y: 0, z: 2, value: 1 },
{ x: 1, y: 0, z: 2, value: 1 },
{ x: 2, y: 0, z: 2, value: 1 }
],
[
{ x: 0, y: 2, z: 0, value: 1 },
{ x: 1, y: 2, z: 0, value: 1 },
{ x: 2, y: 2, z: 0, value: 1 }
],
[
{ x: 0, y: 2, z: 2, value: 1 },
{ x: 1, y: 2, z: 2, value: 1 },
{ x: 2, y: 2, z: 2, value: 2 }
]
]
*/
"Hey, why is output not matching the same form as the input?"
Valid 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.
npm install --save 3d-adjacency
See example above and the offcial API docs
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
coverallsEnvironment{
"local_name": "coveralls",
"alias": false,
"peer_metadata": null
} | ^2.11.9 | development |
gh-pagesEnvironment{
"local_name": "gh-pages",
"alias": false,
"peer_metadata": null
} | ^0.11.0 | development |
jsdocEnvironment{
"local_name": "jsdoc",
"alias": false,
"peer_metadata": null
} | ^3.4.0 | development |
minamiEnvironment{
"local_name": "minami",
"alias": false,
"peer_metadata": null
} | ^1.1.1 | development |
nycEnvironment{
"local_name": "nyc",
"alias": false,
"peer_metadata": null
} | ^6.4.4 | development |
shizamEnvironment{
"local_name": "shizam",
"alias": false,
"peer_metadata": null
} | 0.0.5 | development |
standardEnvironment{
"local_name": "standard",
"alias": false,
"peer_metadata": null
} | ^7.1.1 | development |
standard-formatEnvironment{
"local_name": "standard-format",
"alias": false,
"peer_metadata": null
} | ^2.2.1 | development |
tapeEnvironment{
"local_name": "tape",
"alias": false,
"peer_metadata": null
} | ^4.5.1 | development |
Source distribution
{
"shasum": "bca026a5609bf4e2c6f90e811fad91d6b4c3497f",
"tarball": "https://registry.npmjs.org/3d-adjacency/-/3d-adjacency-0.0.2.tgz",
"integrity": "sha512-z9eAXZXDwRr2jUQ9spF46InxRj0xPbDEOLOzNMMAiVYEYIbCCzLsmQU+kwLrFcIMUd9nZQ0bkT7o42H3ptuicg==",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIAE4hVK91ebCxncFJh3NdQNFlQOHJgarR877w5Wnf/qMAiEAwuDwg6S27S2WZO27DfL3hnM3BUK+AmouZL0mGUT1ex8="
}
]
}Observed since 20 Oct, 19:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:574004c7fec8b2794cdd98a4ccd8bfbf92fd0ce5a997b4d6bb5ef51bae5384b1