-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into lane/checks-workflow
- Loading branch information
Showing
107 changed files
with
12,126 additions
and
9,249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"printWidth": 120, | ||
"trailingComma": "es5", | ||
"tabWidth": 4, | ||
"singleQuote": true, | ||
"semi": true, | ||
"singleAttributePerLine": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
Allen Institute Software License – This software license is the 2-clause BSD | ||
license plus clause a third clause that prohibits redistribution and use for | ||
commercial purposes without further permission. | ||
Allen Institute Software License – This software license is the 2-clause BSD | ||
license plus clause a third clause that prohibits redistribution and use for | ||
commercial purposes without further permission. | ||
|
||
Copyright © 2019. Allen Institute. All rights reserved. | ||
Copyright © 2019. Allen Institute. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Redistributions and use for commercial purposes are not permitted without | ||
the Allen Institute’s written permission. For purposes of this license, | ||
commercial purposes are the incorporation of the Allen Institute's software | ||
into anything for which you will charge fees or other compensation or use of | ||
the software to perform a commercial service for a third party. Contact | ||
[email protected] for commercial licensing opportunities. | ||
3. Redistributions and use for commercial purposes are not permitted without | ||
the Allen Institute’s written permission. For purposes of this license, | ||
commercial purposes are the incorporation of the Allen Institute's software | ||
into anything for which you will charge fees or other compensation or use of | ||
the software to perform a commercial service for a third party. Contact | ||
[email protected] for commercial licensing opportunities. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
# Allen Institute Vis | ||
|
||
This repository contains a collection of packages for building scalable visualization tools at the Allen Institute. It houses the `vis-[package name]` packages on the Allen Institute GitHub organization's NPM package registry. | ||
|
||
# Available Packages | ||
- `vis-geometry`: A collection of vector functions for 2D and 3D geometry | ||
- `scatterbrain`: A collection of useful utitilites used to build our big-data, scalable, scatterplot tool "Scatterbrain" in the Brain Knowledge Platform | ||
|
||
- `vis-geometry`: A collection of vector functions for 2D and 3D geometry | ||
- `scatterbrain`: A collection of useful utitilites used to build our big-data, scalable, scatterplot tool "Scatterbrain" in the Brain Knowledge Platform | ||
|
||
# Examples | ||
|
||
See the `apps` directory for example projects using the packages. Over time, these examples will become simpler as the base tooling becomes more mature. | ||
|
||
For details on running or adding new examples, see the `docs/examples.md` file. | ||
|
||
# Contributing | ||
|
||
Contributions are welcome! We're currently breaking apart the Scattebrain component into smaller, more manageable packages. If you have a package that you think would be useful to others, please open a PR. | ||
|
||
# Using the Libraries | ||
|
||
See the `docs/using-packages.md` file for information on how to use the packages in your own projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,35 +3,34 @@ | |
"version": "0.0.1", | ||
"HEY": "NOTE! DO not use this package directly - its just for sharing code between our little apps", | ||
"contributors": [ | ||
{ | ||
"name": "Lane Sawyer", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "James Gerstenberger", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Noah Shepard", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Skyler Moosman", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Su Li", | ||
"email": "[email protected]" | ||
} | ||
{ | ||
"name": "Lane Sawyer", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "James Gerstenberger", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Noah Shepard", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Skyler Moosman", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Su Li", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"private": true, | ||
"dependencies": { | ||
"@alleninstitute/vis-geometry": "workspace:*", | ||
"@alleninstitute/vis-scatterbrain": "workspace:*", | ||
"@types/lodash": "^4.14.202", | ||
"lodash": "^4.17.21", | ||
"regl": "^2.1.0", | ||
"zarr": "^0.6.2" | ||
|
||
"@alleninstitute/vis-geometry": "workspace:*", | ||
"@alleninstitute/vis-scatterbrain": "workspace:*", | ||
"@types/lodash": "^4.14.202", | ||
"lodash": "^4.17.21", | ||
"regl": "^2.1.0", | ||
"zarr": "^0.6.2" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,26 @@ | ||
|
||
// a web-worker which fetches slices of data, decodes them, and returns the result as a flat float32 array, using transferables | ||
import type { NestedArray, TypedArray } from 'zarr' | ||
import { getSlice, type ZarrDataset, type ZarrRequest } from "./zarr-data"; | ||
import type { NestedArray, TypedArray } from 'zarr'; | ||
import { getSlice, type ZarrDataset, type ZarrRequest } from './zarr-data'; | ||
|
||
const ctx = self; | ||
type ZarrSliceRequest = { | ||
id: string; | ||
type: 'ZarrSliceRequest' | ||
metadata: ZarrDataset | ||
req: ZarrRequest, | ||
layerIndex: number | ||
} | ||
type: 'ZarrSliceRequest'; | ||
metadata: ZarrDataset; | ||
req: ZarrRequest; | ||
layerIndex: number; | ||
}; | ||
function isSliceRequest(payload: any): payload is ZarrSliceRequest { | ||
return typeof payload === 'object' && payload['type'] === 'ZarrSliceRequest'; | ||
} | ||
ctx.onmessage = (msg: MessageEvent<unknown>) => { | ||
const { data } = msg; | ||
if (isSliceRequest(data)) { | ||
const { metadata, req, layerIndex, id } = data; | ||
getSlice(metadata, req, layerIndex).then((result: { | ||
shape: number[], | ||
buffer: NestedArray<TypedArray> | ||
}) => { | ||
getSlice(metadata, req, layerIndex).then((result: { shape: number[]; buffer: NestedArray<TypedArray> }) => { | ||
const { shape, buffer } = result; | ||
const R = new Float32Array(buffer.flatten()); | ||
ctx.postMessage({ type: 'slice', id, shape, data: R }, { transfer: [R.buffer] }) | ||
}) | ||
ctx.postMessage({ type: 'slice', id, shape, data: R }, { transfer: [R.buffer] }); | ||
}); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.