@vitessce/neuroglancer 3.9.5 → 3.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ReactNeuroglancer-BCg93QGV.js → ReactNeuroglancer-pv4bM8Yp.js} +43 -26
- package/dist/index-BEPd2Tds.js +37856 -0
- package/dist/index.js +1 -1
- package/dist-tsc/Neuroglancer.d.ts +0 -2
- package/dist-tsc/Neuroglancer.d.ts.map +1 -1
- package/dist-tsc/Neuroglancer.js +26 -26
- package/dist-tsc/NeuroglancerSubscriber.d.ts.map +1 -1
- package/dist-tsc/NeuroglancerSubscriber.js +219 -53
- package/dist-tsc/ReactNeuroglancer.d.ts +2 -2
- package/dist-tsc/ReactNeuroglancer.d.ts.map +1 -1
- package/dist-tsc/ReactNeuroglancer.js +31 -28
- package/dist-tsc/data-hook-ng-utils.d.ts +18 -20
- package/dist-tsc/data-hook-ng-utils.d.ts.map +1 -1
- package/dist-tsc/data-hook-ng-utils.js +136 -68
- package/dist-tsc/shader-utils.d.ts +126 -0
- package/dist-tsc/shader-utils.d.ts.map +1 -0
- package/dist-tsc/shader-utils.js +547 -0
- package/dist-tsc/shader-utils.test.d.ts +2 -0
- package/dist-tsc/shader-utils.test.d.ts.map +1 -0
- package/dist-tsc/shader-utils.test.js +364 -0
- package/dist-tsc/use-memo-custom-comparison.d.ts +14 -0
- package/dist-tsc/use-memo-custom-comparison.d.ts.map +1 -0
- package/dist-tsc/use-memo-custom-comparison.js +150 -0
- package/package.json +9 -8
- package/src/Neuroglancer.js +31 -26
- package/src/NeuroglancerSubscriber.js +361 -81
- package/src/README.md +28 -0
- package/src/ReactNeuroglancer.js +34 -27
- package/src/data-hook-ng-utils.js +178 -78
- package/src/shader-utils.js +653 -0
- package/src/shader-utils.test.js +432 -0
- package/src/use-memo-custom-comparison.js +190 -0
- package/dist/index-Wdrc02VW.js +0 -32390
- package/dist-tsc/data-hook-ng-utils.test.d.ts +0 -2
- package/dist-tsc/data-hook-ng-utils.test.d.ts.map +0 -1
- package/dist-tsc/data-hook-ng-utils.test.js +0 -35
- package/src/data-hook-ng-utils.test.js +0 -52
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-hook-ng-utils.test.d.ts","sourceRoot":"","sources":["../src/data-hook-ng-utils.test.js"],"names":[],"mappings":""}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { extractDataTypeEntities, DEFAULT_NG_PROPS, } from './data-hook-ng-utils.js';
|
|
3
|
-
describe('extractDataTypeEntities (minimal tests)', () => {
|
|
4
|
-
it('returns empty array when internMap is missing or invalid', () => {
|
|
5
|
-
expect(extractDataTypeEntities({}, 'A', 'obsSegmentations')).toEqual([]);
|
|
6
|
-
expect(extractDataTypeEntities({ A: { loaders: {} } }, 'A', 'obsSegmentations')).toEqual([]);
|
|
7
|
-
expect(extractDataTypeEntities({ A: { loaders: { obsSegmentations: {} } } }, 'A', 'obsSegmentations')).toEqual([]);
|
|
8
|
-
});
|
|
9
|
-
it('builds an entity for a precomputed loader and applies sane defaults', () => {
|
|
10
|
-
const key = { fileUid: 'melanoma-meshes' };
|
|
11
|
-
const loader = {
|
|
12
|
-
fileType: 'obsSegmentations.ng-precomputed',
|
|
13
|
-
url: 'https://www.example.com/example/example_meshes',
|
|
14
|
-
options: { projectionScale: 2048 },
|
|
15
|
-
};
|
|
16
|
-
const internMap = new Map([[key, loader]]);
|
|
17
|
-
const loaders = { A: { loaders: { obsSegmentations: internMap } } };
|
|
18
|
-
const out = extractDataTypeEntities(loaders, 'A', 'obsSegmentations');
|
|
19
|
-
expect(out).toHaveLength(1);
|
|
20
|
-
const e = out[0];
|
|
21
|
-
expect(e.key).toBe(key);
|
|
22
|
-
expect(e.type).toBe('segmentation');
|
|
23
|
-
expect(e.fileUid).toBe('melanoma-meshes');
|
|
24
|
-
expect(e.layout).toBe(DEFAULT_NG_PROPS.layout);
|
|
25
|
-
// URL + source prefixing
|
|
26
|
-
expect(e.url).toBe(loader.url);
|
|
27
|
-
expect(e.source).toBe('precomputed://https://www.example.com/example/example_meshes');
|
|
28
|
-
expect(e.dimensions).toEqual({ x: [1, 'nm'], y: [1, 'nm'], z: [1, 'nm'] });
|
|
29
|
-
// camera defaults + single override
|
|
30
|
-
expect(e.position).toEqual(DEFAULT_NG_PROPS.position);
|
|
31
|
-
expect(e.projectionOrientation).toEqual(DEFAULT_NG_PROPS.projectionOrientation);
|
|
32
|
-
expect(e.projectionScale).toBe(2048);
|
|
33
|
-
expect(e.crossSectionScale).toBe(DEFAULT_NG_PROPS.crossSectionScale);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
extractDataTypeEntities,
|
|
5
|
-
DEFAULT_NG_PROPS,
|
|
6
|
-
} from './data-hook-ng-utils.js';
|
|
7
|
-
|
|
8
|
-
describe('extractDataTypeEntities (minimal tests)', () => {
|
|
9
|
-
it('returns empty array when internMap is missing or invalid', () => {
|
|
10
|
-
expect(extractDataTypeEntities({}, 'A', 'obsSegmentations')).toEqual([]);
|
|
11
|
-
|
|
12
|
-
expect(
|
|
13
|
-
extractDataTypeEntities({ A: { loaders: {} } }, 'A', 'obsSegmentations'),
|
|
14
|
-
).toEqual([]);
|
|
15
|
-
|
|
16
|
-
expect(
|
|
17
|
-
extractDataTypeEntities({ A: { loaders: { obsSegmentations: {} } } }, 'A', 'obsSegmentations'),
|
|
18
|
-
).toEqual([]);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('builds an entity for a precomputed loader and applies sane defaults', () => {
|
|
22
|
-
const key = { fileUid: 'melanoma-meshes' };
|
|
23
|
-
const loader = {
|
|
24
|
-
fileType: 'obsSegmentations.ng-precomputed',
|
|
25
|
-
url: 'https://www.example.com/example/example_meshes',
|
|
26
|
-
options: { projectionScale: 2048 },
|
|
27
|
-
};
|
|
28
|
-
const internMap = new Map([[key, loader]]);
|
|
29
|
-
const loaders = { A: { loaders: { obsSegmentations: internMap } } };
|
|
30
|
-
|
|
31
|
-
const out = extractDataTypeEntities(loaders, 'A', 'obsSegmentations');
|
|
32
|
-
expect(out).toHaveLength(1);
|
|
33
|
-
|
|
34
|
-
const e = out[0];
|
|
35
|
-
expect(e.key).toBe(key);
|
|
36
|
-
expect(e.type).toBe('segmentation');
|
|
37
|
-
expect(e.fileUid).toBe('melanoma-meshes');
|
|
38
|
-
expect(e.layout).toBe(DEFAULT_NG_PROPS.layout);
|
|
39
|
-
|
|
40
|
-
// URL + source prefixing
|
|
41
|
-
expect(e.url).toBe(loader.url);
|
|
42
|
-
expect(e.source).toBe('precomputed://https://www.example.com/example/example_meshes');
|
|
43
|
-
|
|
44
|
-
expect(e.dimensions).toEqual({ x: [1, 'nm'], y: [1, 'nm'], z: [1, 'nm'] });
|
|
45
|
-
|
|
46
|
-
// camera defaults + single override
|
|
47
|
-
expect(e.position).toEqual(DEFAULT_NG_PROPS.position);
|
|
48
|
-
expect(e.projectionOrientation).toEqual(DEFAULT_NG_PROPS.projectionOrientation);
|
|
49
|
-
expect(e.projectionScale).toBe(2048);
|
|
50
|
-
expect(e.crossSectionScale).toBe(DEFAULT_NG_PROPS.crossSectionScale);
|
|
51
|
-
});
|
|
52
|
-
});
|