@vitessce/spatial-accelerated 3.9.9 → 4.0.0-test.1
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-tsc/SpatialWrapper.d.ts +1 -1
- package/dist-tsc/SpatialWrapper.d.ts.map +1 -1
- package/dist-tsc/VolumeDataManager.d.ts.map +1 -1
- package/dist-tsc/VolumeDataManager.js +6 -2
- package/dist-tsc/VolumeView.d.ts +1 -1
- package/dist-tsc/VolumeView.d.ts.map +1 -1
- package/dist-tsc/VolumeView.js +8 -3
- package/package.json +32 -19
- package/src/VolumeDataManager.js +7 -2
- package/src/VolumeView.js +7 -3
- package/dist/index.js +0 -63347
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function SpatialWrapper(props: any):
|
|
1
|
+
export function SpatialWrapper(props: any): any;
|
|
2
2
|
//# sourceMappingURL=SpatialWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpatialWrapper.d.ts","sourceRoot":"","sources":["../src/SpatialWrapper.js"],"names":[],"mappings":"AAOA,
|
|
1
|
+
{"version":3,"file":"SpatialWrapper.d.ts","sourceRoot":"","sources":["../src/SpatialWrapper.js"],"names":[],"mappings":"AAOA,gDAoDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VolumeDataManager.d.ts","sourceRoot":"","sources":["../src/VolumeDataManager.js"],"names":[],"mappings":"AA8DA,yEAaC;AACD,8EAeC;AAED;;;;GAIG;AACH,kDAHW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,8BAC1B,MAAM;;;;;;;;;;;;;EAyHhB;AAMD,kFAaC;AAqBD;;;;;;EA2DC;AAKD;;;;;;;EAuDC;;;;;;;AAzDD,4CAA6C;AA6D7C;IACE,0BAgLC;IAjKG,QAAyB;IAa3B,cAAwB;IAyBxB,sBAA+B;IAC/B,wBAA2B;IAC3B,iCAAmC;IAenC;;;;;MAKC;IAED;;;;;;;;;;;;MAcC;IAED,8BAAmB;IACnB,8BAAmB;IAEnB;;;;;;MAMC;IAED;;;;;;;;;MAiBC;IAQD,2BAAiC;IAYjC,gBAAmB;IAGnB,oBAAuD;IACvD,gBAAwD;IACxD,gBAAmB;IACnB,sBAAsB;IAGtB,aAAmD;IAGnD,gBAAkB;IAElB,sBAAwB;IACxB,wBAA2B;IAC3B,kBAAkB;IAClB,UAAW;IACX,uBAA0B;IAC1B,yBAA4B;IAE5B,sBAAyB;IAGzB,mBAAyC;IACzC,eAAqB;IAGrB;;;;;;;;;;aAA8B;IAG9B,4BAA4B;IAC5B,6BAA6B;IAK/B;;;OAGG;IACH,sBAFa,MAAM,CAiBlB;IAED;;OAEG;IACH,oBAQC;IAED;;OAEG;IACH,uBASC;IAED;;OAEG;IACH,qCAeC;IAED;;OAEG;IACH,yCAqCC;IAED;;OAEG;IACH,qBAMC;IAED;;OAEG;IACH,uCAIC;IAED,qDAIC;IAFC,YAAoB;IACpB,sBAAwC;IAG1C;;;;;OAKG;IACH,mBAFa,OAAO,CAAC,MAAM,CAAC,CA8S3B;IAjQG,kBAAmD;IAmQvD;;;;;;;;OAQG;IACH,mBAkBC;IAGD,6BAMC;IAED,wCAqHC;IAED;;;;;OAKG;IAqBH;;;OAGG;IACH,kCAQC;IAED;;;OAGG;IACH,uBAFa,MAAM,CAUlB;IAED,+BAQC;IAED,kCASC;IAED,gCASC;IAED;;;;;;;;;OASG;IACH,iBARW,MAAM,iBACN,MAAM,iBACN,MAAM,KACN,MAAM,KACN,MAAM,cACN,MAAM,GACJ,OAAO,CAAC,UAAU,CAAC,CA+B/B;IAED;;;;;;;;;;;OAWG;IACH,2BATW,UAAU,oBAGlB;QAAiC,KAAK,EAA9B,MAAM;QACmB,MAAM,EAA/B,MAAM;QACmB,eAAe,EAAxC,MAAM;KAGhB,
|
|
1
|
+
{"version":3,"file":"VolumeDataManager.d.ts","sourceRoot":"","sources":["../src/VolumeDataManager.js"],"names":[],"mappings":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IACH,iBARW,MAAM,iBACN,MAAM,iBACN,MAAM,KACN,MAAM,KACN,MAAM,cACN,MAAM,GACJ,OAAO,CAAC,UAAU,CAAC,CA+B/B;IAED;;;;;;;;;;;OAWG;IACH,2BATW,UAAU,oBAGlB;QAAiC,KAAK,EAA9B,MAAM;QACmB,MAAM,EAA/B,MAAM;QACmB,eAAe,EAAxC,MAAM;KAGhB,iBAsCA;IAGD,6CA0DC;IAGD,gCAcC;IAED,yCAmDC;IAGD,+DAqBC;IAKD;;;;OAIG;IACH,oBAHW,MAAM,GACJ;QAAE,OAAO,MAAC;QAAC,CAAC,MAAC;QAAC,CAAC,MAAC;QAAC,CAAC,MAAA;KAAE,EAAE,CAyClC;IAKD,uDA6LC;IAKD,oDAwDC;IAKD,kBAWC;CACF;8BAvwDM,OAAO"}
|
|
@@ -306,8 +306,8 @@ export function _requestBufferToRequestObjects(buffer, k, optsForWeighting) {
|
|
|
306
306
|
counts.set(packed, (counts.get(packed) || 0) + weight);
|
|
307
307
|
}
|
|
308
308
|
// Get the top K (potentially fewer than K) page table requests by weighted count.
|
|
309
|
-
const
|
|
310
|
-
|
|
309
|
+
const sorted = Array.from(counts.entries()).toSorted((a, b) => b[1] - a[1]);
|
|
310
|
+
const requests = sorted
|
|
311
311
|
.slice(0, k)
|
|
312
312
|
.map(([packed]) => ({
|
|
313
313
|
x: (packed >> 22) & 0x3FF,
|
|
@@ -1108,6 +1108,10 @@ export class VolumeDataManager {
|
|
|
1108
1108
|
* the center of the render target.
|
|
1109
1109
|
*/
|
|
1110
1110
|
async processRequestData(buffer, optsForWeighting) {
|
|
1111
|
+
if (this.initStatus !== INIT_STATUS.COMPLETE) {
|
|
1112
|
+
log.debug('processRequestData: not yet initialized, skipping');
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1111
1115
|
if (this.isBusy) {
|
|
1112
1116
|
log.debug('processRequestData: already busy, skipping');
|
|
1113
1117
|
return;
|
package/dist-tsc/VolumeView.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function VolumeView(props: any):
|
|
1
|
+
export function VolumeView(props: any): any;
|
|
2
2
|
//# sourceMappingURL=VolumeView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VolumeView.d.ts","sourceRoot":"","sources":["../src/VolumeView.js"],"names":[],"mappings":"AAkMA,
|
|
1
|
+
{"version":3,"file":"VolumeView.d.ts","sourceRoot":"","sources":["../src/VolumeView.js"],"names":[],"mappings":"AAkMA,4CAihBC"}
|
package/dist-tsc/VolumeView.js
CHANGED
|
@@ -179,6 +179,7 @@ export function VolumeView(props) {
|
|
|
179
179
|
// const [lastRes, setLastRes] = useState(null);
|
|
180
180
|
// const [lastChannels, setLastChannels] = useState([]);
|
|
181
181
|
const is3D = spatialRenderingMode === '3D';
|
|
182
|
+
const [dmInitComplete, setDmInitComplete] = useState(false);
|
|
182
183
|
// const [loading, setLoading] = useState(false);
|
|
183
184
|
// Add new refs for screen quad setup
|
|
184
185
|
const screenSceneRef = useRef(null);
|
|
@@ -277,6 +278,7 @@ export function VolumeView(props) {
|
|
|
277
278
|
const initializeDataManager = async () => {
|
|
278
279
|
if (dataManager.initStatus === INIT_STATUS.COMPLETE) {
|
|
279
280
|
log.debug('dataManager already initialized, skipping');
|
|
281
|
+
setDmInitComplete(true);
|
|
280
282
|
return;
|
|
281
283
|
}
|
|
282
284
|
// TODO(mark): separate the initialization which depends on gl, from the initialization which depends on images, from the dm.init(firstImageLayer)
|
|
@@ -296,6 +298,7 @@ export function VolumeView(props) {
|
|
|
296
298
|
// if (onInitComplete) {
|
|
297
299
|
// onInitComplete({ zarrStoreInfo: dm.zarrStore, deviceLimits: dm.deviceLimits });
|
|
298
300
|
// }
|
|
301
|
+
setDmInitComplete(true);
|
|
299
302
|
invalidate();
|
|
300
303
|
};
|
|
301
304
|
initializeDataManager();
|
|
@@ -346,7 +349,7 @@ export function VolumeView(props) {
|
|
|
346
349
|
// TODO(mark): convert to a useMemo?
|
|
347
350
|
useEffect(() => {
|
|
348
351
|
const on3D = spatialRenderingMode === '3D';
|
|
349
|
-
if (on3D && dataManager && renderManager) {
|
|
352
|
+
if (on3D && dataManager && renderManager && dmInitComplete) {
|
|
350
353
|
logWithColor('useEffect spatialRenderingMode');
|
|
351
354
|
// Direct call, no callbacks needed
|
|
352
355
|
const propsForRenderManager = {
|
|
@@ -388,7 +391,7 @@ export function VolumeView(props) {
|
|
|
388
391
|
}
|
|
389
392
|
}
|
|
390
393
|
}
|
|
391
|
-
}, [dataManager, renderManager, images, imageLayerScopes, imageLayerCoordination, imageChannelScopesByLayer, imageChannelCoordination, spatialRenderingMode]);
|
|
394
|
+
}, [dataManager, renderManager, images, imageLayerScopes, imageLayerCoordination, imageChannelScopesByLayer, imageChannelCoordination, spatialRenderingMode, dmInitComplete]);
|
|
392
395
|
// Execute code on every rendered frame.
|
|
393
396
|
// A numerical renderPriority value will cause React Three Fiber
|
|
394
397
|
// to disable automatic rendering altogether.
|
|
@@ -514,6 +517,8 @@ export function VolumeView(props) {
|
|
|
514
517
|
// Set isInteracting while the user is sliding the channel slider
|
|
515
518
|
// for smooth updates.
|
|
516
519
|
useEffect(() => {
|
|
520
|
+
if (!dmInitComplete)
|
|
521
|
+
return;
|
|
517
522
|
logWithColor('useEffect firstImageLayerChannelCoordination');
|
|
518
523
|
setIsInteracting(true);
|
|
519
524
|
log.debug('something about channels changed');
|
|
@@ -523,7 +528,7 @@ export function VolumeView(props) {
|
|
|
523
528
|
interactionTimeoutRef.current = setTimeout(() => {
|
|
524
529
|
setIsInteracting(false);
|
|
525
530
|
}, 300);
|
|
526
|
-
}, [dataManager, firstImageLayerChannelCoordination, renderManager, setIsInteracting]);
|
|
531
|
+
}, [dataManager, firstImageLayerChannelCoordination, renderManager, setIsInteracting, dmInitComplete]);
|
|
527
532
|
const stopLoading = useEventCallback(() => {
|
|
528
533
|
if (dataManager) {
|
|
529
534
|
dataManager.stopLoading();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/spatial-accelerated",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-test.1",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -16,9 +16,6 @@
|
|
|
16
16
|
"dist-tsc"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@react-three/fiber": "^8.15.19",
|
|
20
|
-
"@react-three/drei": "^9.99.7",
|
|
21
|
-
"@react-three/xr": "^5.7.1",
|
|
22
19
|
"d3-array": "^2.4.0",
|
|
23
20
|
"internmap": "^2.0.3",
|
|
24
21
|
"lodash-es": "^4.17.21",
|
|
@@ -26,28 +23,44 @@
|
|
|
26
23
|
"mathjs": "^9.2.0",
|
|
27
24
|
"plur": "^5.1.0",
|
|
28
25
|
"short-number": "^1.0.6",
|
|
29
|
-
"three": "^0.154.0",
|
|
30
26
|
"zarrita": "0.6.1",
|
|
31
|
-
"@vitessce/
|
|
32
|
-
"@vitessce/
|
|
33
|
-
"@vitessce/legend": "
|
|
34
|
-
"@vitessce/
|
|
35
|
-
"@vitessce/
|
|
36
|
-
"@vitessce/tooltip": "
|
|
37
|
-
"@vitessce/utils": "
|
|
38
|
-
"@vitessce/vit-s": "
|
|
39
|
-
"@vitessce/styles": "
|
|
40
|
-
"@vitessce/globals": "
|
|
27
|
+
"@vitessce/gl": "4.0.0-test.1",
|
|
28
|
+
"@vitessce/constants-internal": "4.0.0-test.1",
|
|
29
|
+
"@vitessce/legend": "4.0.0-test.1",
|
|
30
|
+
"@vitessce/spatial-utils": "4.0.0-test.1",
|
|
31
|
+
"@vitessce/sets-utils": "4.0.0-test.1",
|
|
32
|
+
"@vitessce/tooltip": "4.0.0-test.1",
|
|
33
|
+
"@vitessce/utils": "4.0.0-test.1",
|
|
34
|
+
"@vitessce/vit-s": "4.0.0-test.1",
|
|
35
|
+
"@vitessce/styles": "4.0.0-test.1",
|
|
36
|
+
"@vitessce/globals": "4.0.0-test.1"
|
|
41
37
|
},
|
|
42
38
|
"devDependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"react": "
|
|
45
|
-
"
|
|
39
|
+
"@react-three/fiber": "^9.0.0",
|
|
40
|
+
"@react-three/drei": "^10.0.0",
|
|
41
|
+
"@types/three": "^0.159.0",
|
|
42
|
+
"three": "^0.159.0",
|
|
43
|
+
"react": "19.1.0",
|
|
44
|
+
"react-dom": "19.1.0",
|
|
46
45
|
"vite": "^7.0.0",
|
|
47
46
|
"vitest": "^3.1.4"
|
|
48
47
|
},
|
|
49
48
|
"peerDependencies": {
|
|
50
|
-
"react": "^
|
|
49
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
50
|
+
"@react-three/fiber": "^8.0.0 || ^9.0.0",
|
|
51
|
+
"@react-three/drei": "^9.0.0 || ^10.0.0",
|
|
52
|
+
"three": ">=0.159.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"@react-three/fiber": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
58
|
+
"@react-three/drei": {
|
|
59
|
+
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"three": {
|
|
62
|
+
"optional": true
|
|
63
|
+
}
|
|
51
64
|
},
|
|
52
65
|
"scripts": {
|
|
53
66
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.mjs",
|
package/src/VolumeDataManager.js
CHANGED
|
@@ -364,8 +364,8 @@ export function _requestBufferToRequestObjects(buffer, k, optsForWeighting) {
|
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
// Get the top K (potentially fewer than K) page table requests by weighted count.
|
|
367
|
-
const
|
|
368
|
-
|
|
367
|
+
const sorted = Array.from(counts.entries()).toSorted((a, b) => b[1] - a[1]);
|
|
368
|
+
const requests = sorted
|
|
369
369
|
.slice(0, k)
|
|
370
370
|
.map(([packed]) => ({
|
|
371
371
|
x: (packed >> 22) & 0x3FF,
|
|
@@ -1298,6 +1298,11 @@ export class VolumeDataManager {
|
|
|
1298
1298
|
* the center of the render target.
|
|
1299
1299
|
*/
|
|
1300
1300
|
async processRequestData(buffer, optsForWeighting) {
|
|
1301
|
+
if (this.initStatus !== INIT_STATUS.COMPLETE) {
|
|
1302
|
+
log.debug('processRequestData: not yet initialized, skipping');
|
|
1303
|
+
return;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1301
1306
|
if (this.isBusy) {
|
|
1302
1307
|
log.debug('processRequestData: already busy, skipping');
|
|
1303
1308
|
return;
|
package/src/VolumeView.js
CHANGED
|
@@ -229,6 +229,7 @@ export function VolumeView(props) {
|
|
|
229
229
|
// const [lastRes, setLastRes] = useState(null);
|
|
230
230
|
// const [lastChannels, setLastChannels] = useState([]);
|
|
231
231
|
const is3D = spatialRenderingMode === '3D';
|
|
232
|
+
const [dmInitComplete, setDmInitComplete] = useState(false);
|
|
232
233
|
// const [loading, setLoading] = useState(false);
|
|
233
234
|
|
|
234
235
|
// Add new refs for screen quad setup
|
|
@@ -356,6 +357,7 @@ export function VolumeView(props) {
|
|
|
356
357
|
const initializeDataManager = async () => {
|
|
357
358
|
if (dataManager.initStatus === INIT_STATUS.COMPLETE) {
|
|
358
359
|
log.debug('dataManager already initialized, skipping');
|
|
360
|
+
setDmInitComplete(true);
|
|
359
361
|
return;
|
|
360
362
|
}
|
|
361
363
|
// TODO(mark): separate the initialization which depends on gl, from the initialization which depends on images, from the dm.init(firstImageLayer)
|
|
@@ -380,6 +382,7 @@ export function VolumeView(props) {
|
|
|
380
382
|
// onInitComplete({ zarrStoreInfo: dm.zarrStore, deviceLimits: dm.deviceLimits });
|
|
381
383
|
// }
|
|
382
384
|
|
|
385
|
+
setDmInitComplete(true);
|
|
383
386
|
invalidate();
|
|
384
387
|
};
|
|
385
388
|
initializeDataManager();
|
|
@@ -437,7 +440,7 @@ export function VolumeView(props) {
|
|
|
437
440
|
useEffect(() => {
|
|
438
441
|
const on3D = spatialRenderingMode === '3D';
|
|
439
442
|
|
|
440
|
-
if (on3D && dataManager && renderManager) {
|
|
443
|
+
if (on3D && dataManager && renderManager && dmInitComplete) {
|
|
441
444
|
logWithColor('useEffect spatialRenderingMode');
|
|
442
445
|
// Direct call, no callbacks needed
|
|
443
446
|
const propsForRenderManager = {
|
|
@@ -482,7 +485,7 @@ export function VolumeView(props) {
|
|
|
482
485
|
}
|
|
483
486
|
}
|
|
484
487
|
}
|
|
485
|
-
}, [dataManager, renderManager, images, imageLayerScopes, imageLayerCoordination, imageChannelScopesByLayer, imageChannelCoordination, spatialRenderingMode]);
|
|
488
|
+
}, [dataManager, renderManager, images, imageLayerScopes, imageLayerCoordination, imageChannelScopesByLayer, imageChannelCoordination, spatialRenderingMode, dmInitComplete]);
|
|
486
489
|
|
|
487
490
|
|
|
488
491
|
// Execute code on every rendered frame.
|
|
@@ -629,6 +632,7 @@ export function VolumeView(props) {
|
|
|
629
632
|
// Set isInteracting while the user is sliding the channel slider
|
|
630
633
|
// for smooth updates.
|
|
631
634
|
useEffect(() => {
|
|
635
|
+
if (!dmInitComplete) return;
|
|
632
636
|
logWithColor('useEffect firstImageLayerChannelCoordination');
|
|
633
637
|
setIsInteracting(true);
|
|
634
638
|
log.debug('something about channels changed');
|
|
@@ -640,7 +644,7 @@ export function VolumeView(props) {
|
|
|
640
644
|
interactionTimeoutRef.current = setTimeout(() => {
|
|
641
645
|
setIsInteracting(false);
|
|
642
646
|
}, 300);
|
|
643
|
-
}, [dataManager, firstImageLayerChannelCoordination, renderManager, setIsInteracting]);
|
|
647
|
+
}, [dataManager, firstImageLayerChannelCoordination, renderManager, setIsInteracting, dmInitComplete]);
|
|
644
648
|
|
|
645
649
|
const stopLoading = useEventCallback(() => {
|
|
646
650
|
if (dataManager) {
|