@vitessce/vit-s 3.3.4 → 3.3.6
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/index.js +445 -427
- package/dist-tsc/VitS.d.ts +3 -0
- package/dist-tsc/VitS.d.ts.map +1 -1
- package/dist-tsc/VitS.js +4 -2
- package/dist-tsc/data-hook-utils.d.ts.map +1 -1
- package/dist-tsc/data-hook-utils.js +3 -3
- package/dist-tsc/data-hooks-multilevel.d.ts.map +1 -1
- package/dist-tsc/data-hooks-multilevel.js +3 -4
- package/dist-tsc/data-hooks.d.ts.map +1 -1
- package/dist-tsc/data-hooks.js +1 -2
- package/dist-tsc/hooks.d.ts.map +1 -1
- package/dist-tsc/hooks.js +4 -3
- package/dist-tsc/shared-mui/styles.d.ts +1 -0
- package/dist-tsc/shared-mui/styles.js +38 -19
- package/dist-tsc/state/hooks.d.ts +1 -3
- package/dist-tsc/state/hooks.d.ts.map +1 -1
- package/dist-tsc/state/hooks.js +15 -15
- package/dist-tsc/title-styles.js +1 -1
- package/dist-tsc/view-config-utils.js +6 -6
- package/dist-tsc/vitessce-grid-utils.d.ts.map +1 -1
- package/dist-tsc/vitessce-grid-utils.js +1 -2
- package/package.json +6 -6
- package/src/VitS.js +7 -1
- package/src/data-hook-utils.js +2 -3
- package/src/data-hooks-multilevel.js +17 -14
- package/src/data-hooks.js +1 -2
- package/src/hooks.js +19 -14
- package/src/shared-mui/styles.js +39 -19
- package/src/state/hooks.js +15 -15
- package/src/title-styles.js +1 -1
- package/src/view-config-utils.js +6 -6
- package/src/vitessce-grid-utils.js +1 -2
package/dist-tsc/VitS.d.ts
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
* @param {null|string} props.uid A unique identifier for this Vitessce instance,
|
|
24
24
|
* for the purpose of avoiding CSS autogenerated class name conflicts. Must be valid as part
|
|
25
25
|
* of a CSS class name string.
|
|
26
|
+
* @param {boolean} props.remountOnUidChange Whether to remount the coordination provider
|
|
27
|
+
* upon changes to config.uid. By default, true.
|
|
26
28
|
* @param {array} props.viewTypes Plugin view types.
|
|
27
29
|
* @param {array} props.fileTypes Plugin file types.
|
|
28
30
|
* @param {array} props.jointFileTypes Plugin joint file types.
|
|
@@ -41,6 +43,7 @@ export function VitS(props: {
|
|
|
41
43
|
validateConfig: boolean;
|
|
42
44
|
validateOnConfigChange: boolean;
|
|
43
45
|
uid: null | string;
|
|
46
|
+
remountOnUidChange: boolean;
|
|
44
47
|
viewTypes: array;
|
|
45
48
|
fileTypes: array;
|
|
46
49
|
jointFileTypes: array;
|
package/dist-tsc/VitS.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VitS.d.ts","sourceRoot":"","sources":["../src/VitS.js"],"names":[],"mappings":"AA8BA
|
|
1
|
+
{"version":3,"file":"VitS.d.ts","sourceRoot":"","sources":["../src/VitS.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;IA/ByB,MAAM,EAApB,MAAM;IAGkB,SAAS,EAAjC,SAAS,GAAC,MAAM;IACF,MAAM,EAApB,MAAM;IACQ,KAAK,EAAnB,MAAM;IAEU,MAAM;IACN,cAAc;IAEd,cAAc;IAEf,cAAc,EAA7B,OAAO;IAIQ,sBAAsB,EAArC,OAAO;IAGY,GAAG,EAAtB,IAAI,GAAC,MAAM;IAGI,kBAAkB,EAAjC,OAAO;IAEM,SAAS;IACT,SAAS;IACT,cAAc;IACd,iBAAiB;IACX,OAAO,EAA1B,IAAI,GAAC,MAAM;gBAgMrB"}
|
package/dist-tsc/VitS.js
CHANGED
|
@@ -37,6 +37,8 @@ import { createGenerateClassName } from './mui-utils.js';
|
|
|
37
37
|
* @param {null|string} props.uid A unique identifier for this Vitessce instance,
|
|
38
38
|
* for the purpose of avoiding CSS autogenerated class name conflicts. Must be valid as part
|
|
39
39
|
* of a CSS class name string.
|
|
40
|
+
* @param {boolean} props.remountOnUidChange Whether to remount the coordination provider
|
|
41
|
+
* upon changes to config.uid. By default, true.
|
|
40
42
|
* @param {array} props.viewTypes Plugin view types.
|
|
41
43
|
* @param {array} props.fileTypes Plugin file types.
|
|
42
44
|
* @param {array} props.jointFileTypes Plugin joint file types.
|
|
@@ -45,7 +47,7 @@ import { createGenerateClassName } from './mui-utils.js';
|
|
|
45
47
|
* provided by the parent.
|
|
46
48
|
*/
|
|
47
49
|
export function VitS(props) {
|
|
48
|
-
const { config, stores, rowHeight, height, theme, onWarn, onConfigChange, onLoaderChange, validateConfig = true, validateOnConfigChange = false, isBounded = false, uid = null, viewTypes: viewTypesProp, fileTypes: fileTypesProp, jointFileTypes: jointFileTypesProp, coordinationTypes: coordinationTypesProp, warning, } = props;
|
|
50
|
+
const { config, stores, rowHeight, height, theme, onWarn, onConfigChange, onLoaderChange, validateConfig = true, validateOnConfigChange = false, isBounded = false, uid = null, remountOnUidChange = true, viewTypes: viewTypesProp, fileTypes: fileTypesProp, jointFileTypes: jointFileTypesProp, coordinationTypes: coordinationTypesProp, warning, } = props;
|
|
49
51
|
const viewTypes = useMemo(() => (viewTypesProp || []), [viewTypesProp]);
|
|
50
52
|
const fileTypes = useMemo(() => (fileTypesProp || []), [fileTypesProp]);
|
|
51
53
|
const jointFileTypes = useMemo(() => (jointFileTypesProp || []), [jointFileTypesProp]);
|
|
@@ -142,5 +144,5 @@ export function VitS(props) {
|
|
|
142
144
|
return createViewConfigStore(null, null);
|
|
143
145
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
144
146
|
}, [success, configKey]);
|
|
145
|
-
return success ? (_jsx(StylesProvider, { generateClassName: generateClassName, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(ViewConfigProvider, { createStore: createViewConfigStoreClosure, children: _jsxs(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: [_jsx(VitessceGrid, { success: success, configKey: configKey, viewTypes: viewTypes, fileTypes: fileTypes, coordinationTypes: coordinationTypes, config: configOrWarning, rowHeight: rowHeight, height: height, theme: theme, isBounded: isBounded, stores: stores }), _jsx(CallbackPublisher, { onWarn: onWarn, onConfigChange: onConfigChange, onLoaderChange: onLoaderChange, validateOnConfigChange: validateOnConfigChange, pluginSpecificConfigSchema: pluginSpecificConfigSchema })] }) }
|
|
147
|
+
return success ? (_jsx(StylesProvider, { generateClassName: generateClassName, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(ViewConfigProvider, { createStore: createViewConfigStoreClosure, ...(remountOnUidChange ? ({ key: configKey }) : {}), children: _jsxs(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: [_jsx(VitessceGrid, { success: success, configKey: configKey, viewTypes: viewTypes, fileTypes: fileTypes, coordinationTypes: coordinationTypes, config: configOrWarning, rowHeight: rowHeight, height: height, theme: theme, isBounded: isBounded, stores: stores }), _jsx(CallbackPublisher, { onWarn: onWarn, onConfigChange: onConfigChange, onLoaderChange: onLoaderChange, validateOnConfigChange: validateOnConfigChange, pluginSpecificConfigSchema: pluginSpecificConfigSchema })] }) }) }) }) })) : (_jsx(StylesProvider, { generateClassName: generateClassName, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(Warning, { ...configOrWarning }) }) }));
|
|
146
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-hook-utils.d.ts","sourceRoot":"","sources":["../src/data-hook-utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-hook-utils.d.ts","sourceRoot":"","sources":["../src/data-hook-utils.js"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,4BAFW,mBAAmB,yBAS7B;AAED;;;;;;;;;;GAUG;AACH,8CATW,MAAM,WAGN,MAAM,iBAGN,MAAM,QAiBhB;AAGD,oDAuBC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oDAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,uBAkDhB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,yDAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,gEAyFhB;AAED,+FAGC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useMemo } from 'react';
|
|
2
2
|
import { useQuery, useQueries } from '@tanstack/react-query';
|
|
3
|
-
import { capitalize,
|
|
3
|
+
import { capitalize, getInitialCoordinationScopePrefix, } from '@vitessce/utils';
|
|
4
4
|
import { STATUS } from '@vitessce/constants-internal';
|
|
5
5
|
import { getMatchingLoader, useMatchingLoader, useSetWarning, } from './state/hooks.js';
|
|
6
6
|
import { AbstractLoaderError, LoaderNotFoundError, } from './errors/index.js';
|
|
@@ -195,9 +195,9 @@ export function useDataTypeMulti(dataType, loaders, dataset, isRequired, coordin
|
|
|
195
195
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
196
196
|
}, [anyError, setWarning]);
|
|
197
197
|
// Convert data to object keyed by scopeKey.
|
|
198
|
-
const data = useMemo(() => fromEntries(matchOnEntries.map(([scopeKey], i) => ([scopeKey, dataQueries[i].data?.data]))), [matchOnObj, dataStatus]);
|
|
198
|
+
const data = useMemo(() => Object.fromEntries(matchOnEntries.map(([scopeKey], i) => ([scopeKey, dataQueries[i].data?.data]))), [matchOnObj, dataStatus]);
|
|
199
199
|
// Convert data to object keyed by scopeKey.
|
|
200
|
-
const urls = useMemo(() => fromEntries(matchOnEntries.map(([scopeKey], i) => ([scopeKey, dataQueries[i].data?.urls]))), [dataQueries]);
|
|
200
|
+
const urls = useMemo(() => Object.fromEntries(matchOnEntries.map(([scopeKey], i) => ([scopeKey, dataQueries[i].data?.urls]))), [dataQueries]);
|
|
201
201
|
return [data, dataStatus, urls];
|
|
202
202
|
}
|
|
203
203
|
export function useHasLoader(loaders, dataset, dataType, matchOn) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-hooks-multilevel.d.ts","sourceRoot":"","sources":["../src/data-hooks-multilevel.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-hooks-multilevel.d.ts","sourceRoot":"","sources":["../src/data-hooks-multilevel.js"],"names":[],"mappings":"AAeA,4IAoDC;AAED,oIA4CC;AAED,mJAuBC;AAED,2IAsBC;AAED,8HAqBC;AAED,wIAqBC;AAED,mIAqBC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { CoordinationType } from '@vitessce/constants-internal';
|
|
3
|
-
import { fromEntries } from '@vitessce/utils';
|
|
4
3
|
import { useComplexCoordination, useComplexCoordinationSecondary, } from './state/hooks.js';
|
|
5
4
|
import { useFeatureSelectionMultiLevel, useObsFeatureMatrixIndicesMultiLevel, useObsLocationsMultiLevel, useObsSetsMultiLevel, useObsLabelsMultiLevel, } from './data-hooks-multilevel-utils.js';
|
|
6
5
|
export function useSegmentationMultiFeatureSelection(coordinationScopes, coordinationScopesBy, loaders, dataset) {
|
|
@@ -19,10 +18,10 @@ export function useSegmentationMultiFeatureSelection(coordinationScopes, coordin
|
|
|
19
18
|
[coordinationScopes, coordinationScopesBy]);
|
|
20
19
|
const useMemoDependency = Object.values(featureSelectionCoordination[0] || {})
|
|
21
20
|
.flatMap(layerVal => Object.values(layerVal).map(cVal => cVal.featureSelection));
|
|
22
|
-
const selections = useMemo(() => fromEntries(Object.entries(featureSelectionCoordination[0])
|
|
21
|
+
const selections = useMemo(() => Object.fromEntries(Object.entries(featureSelectionCoordination[0])
|
|
23
22
|
.map(([layerScope, layerVal]) => ([
|
|
24
23
|
layerScope,
|
|
25
|
-
fromEntries(Object.entries(layerVal)
|
|
24
|
+
Object.fromEntries(Object.entries(layerVal)
|
|
26
25
|
.map(([cScope, cVal]) => ([cScope, cVal.featureSelection]))),
|
|
27
26
|
]))),
|
|
28
27
|
// Need to execute this more frequently, whenever the featureSelections update.
|
|
@@ -48,7 +47,7 @@ export function useSpotMultiFeatureSelection(coordinationScopes, coordinationSco
|
|
|
48
47
|
// use coordinationScopes and coordinationScopesBy which are
|
|
49
48
|
// indirect dependencies here.
|
|
50
49
|
[coordinationScopes, coordinationScopesBy]);
|
|
51
|
-
const selections = useMemo(() => fromEntries(Object.entries(featureSelectionCoordination[0])
|
|
50
|
+
const selections = useMemo(() => Object.fromEntries(Object.entries(featureSelectionCoordination[0])
|
|
52
51
|
.map(([layerScope, layerVal]) => ([
|
|
53
52
|
layerScope,
|
|
54
53
|
layerVal.featureSelection,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-hooks.d.ts","sourceRoot":"","sources":["../src/data-hooks.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-hooks.d.ts","sourceRoot":"","sources":["../src/data-hooks.js"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,wCAPW,MAAM,WAEN,MAAM,SAsBhB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,6CAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,uBAgBhB;AAED,4JASC;AAED,6JASC;AAED,gKASC;AAED,6JASC;AAED,oKASC;AAED,2JASC;AAED,oKASC;AAED,iKASC;AAED,yJASC;AAED,mKASC;AAED,iKASC;AAED;;;;;;;;;;;;;GAaG;AACH,6CAVW,MAAM,WAEN,MAAM,cAEN,OAAO,aAEP,OAAO,uBA4EjB;AAED;;;;;;;;;;;;;GAaG;AACH,oDARW,MAAM,WAEN,MAAM,cAEN,OAAO,iBAEL,MAAM,CA2ElB;AAED,+JAuBC;AAED,8JAuBC;AAED,2HAsBC;AAED,4GAmBC;AAED,sKA2BC;AAED,4JAyBC"}
|
package/dist-tsc/data-hooks.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect, useMemo } from 'react';
|
|
2
2
|
import { CoordinationType, DataType, STATUS } from '@vitessce/constants-internal';
|
|
3
|
-
import { fromEntries } from '@vitessce/utils';
|
|
4
3
|
import { useQuery, useQueries } from '@tanstack/react-query';
|
|
5
4
|
import { useMultiCoordinationValues, useComplexCoordination, useSetWarning, getMatchingLoader, } from './state/hooks.js';
|
|
6
5
|
import { LoaderNotFoundError, } from './errors/index.js';
|
|
@@ -288,7 +287,7 @@ export function useSpotMultiObsSets(coordinationScopes, coordinationScopesBy, lo
|
|
|
288
287
|
}
|
|
289
288
|
export function useMultiObsLabels(coordinationScopes, obsType, loaders, dataset) {
|
|
290
289
|
const obsLabelsTypes = useMultiCoordinationValues(CoordinationType.OBS_LABELS_TYPE, coordinationScopes);
|
|
291
|
-
const obsLabelsMatchOnObj = useMemo(() => fromEntries(Object.entries(obsLabelsTypes).map(([scope, obsLabelsType]) => ([
|
|
290
|
+
const obsLabelsMatchOnObj = useMemo(() => Object.fromEntries(Object.entries(obsLabelsTypes).map(([scope, obsLabelsType]) => ([
|
|
292
291
|
scope,
|
|
293
292
|
{ obsLabelsType, obsType },
|
|
294
293
|
]))), [obsLabelsTypes, obsType]);
|
package/dist-tsc/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.js"],"names":[],"mappings":"AAkBA,oDAOC;AAED;;;;GAIG;AACH,6CAgBC;AAED;;;;GAIG;AACH,yCAiCC;AAED;;;;;GAKG;AACH,2CAiCC;AAED;;;;;;GAMG;AACH,uCAHW,MAAM,EAAE,GACN,OAAO,CAOnB;AAED;;;;GAIG;AACH,8BAHW,CAAC,IAAI,GAAC,MAAM,EAAE,CAAC,EAAE,SAa3B;AAED;;;;;;GAMG;AACH,iEAuBC;AAED;;;;;;;;;;GAUG;AACH;IAR0B,gBAAgB,EAA/B,MAAM;UAqBhB;AAED;;;;;;;;;;GAUG;AACH,yDARW,QAAM,IAAI,SAuBpB;AAED;;;;QA2BC;AAED,iEAOC;AAED,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.js"],"names":[],"mappings":"AAkBA,oDAOC;AAED;;;;GAIG;AACH,6CAgBC;AAED;;;;GAIG;AACH,yCAiCC;AAED;;;;;GAKG;AACH,2CAiCC;AAED;;;;;;GAMG;AACH,uCAHW,MAAM,EAAE,GACN,OAAO,CAOnB;AAED;;;;GAIG;AACH,8BAHW,CAAC,IAAI,GAAC,MAAM,EAAE,CAAC,EAAE,SAa3B;AAED;;;;;;GAMG;AACH,iEAuBC;AAED;;;;;;;;;;GAUG;AACH;IAR0B,gBAAgB,EAA/B,MAAM;UAqBhB;AAED;;;;;;;;;;GAUG;AACH,yDARW,QAAM,IAAI,SAuBpB;AAED;;;;QA2BC;AAED,iEAOC;AAED,kHA4BC"}
|
package/dist-tsc/hooks.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRef, useState, useEffect, useCallback, useMemo, } from 'react';
|
|
2
2
|
import { debounce, every } from 'lodash-es';
|
|
3
3
|
import { extent } from 'd3-array';
|
|
4
|
-
import { capitalize
|
|
4
|
+
import { capitalize } from '@vitessce/utils';
|
|
5
5
|
import { STATUS } from '@vitessce/constants-internal';
|
|
6
6
|
import { useGridResize, useEmitGridResize } from './state/hooks.js';
|
|
7
7
|
import { VITESSCE_CONTAINER } from './classNames.js';
|
|
@@ -246,11 +246,12 @@ export function useGetObsInfo(obsType, obsLabelsTypes, obsLabelsData, obsSetsMem
|
|
|
246
246
|
const obsMembership = obsSetsMembership?.get(obsId) || [];
|
|
247
247
|
return {
|
|
248
248
|
[`${capitalize(obsType)} ID`]: obsId,
|
|
249
|
-
...fromEntries(obsMembership
|
|
249
|
+
...Object.fromEntries(obsMembership
|
|
250
|
+
.flatMap(path => path.slice(1).map((pathEl, elLevel) => ([
|
|
250
251
|
`${path[0]}${path.length > 2 ? ` L${elLevel + 1}` : ''}`,
|
|
251
252
|
pathEl,
|
|
252
253
|
])))),
|
|
253
|
-
...fromEntries(Object.entries(obsLabelsTypes).map(([scopeKey, obsLabelsType]) => ([
|
|
254
|
+
...Object.fromEntries(Object.entries(obsLabelsTypes).map(([scopeKey, obsLabelsType]) => ([
|
|
254
255
|
obsLabelsType,
|
|
255
256
|
obsLabelsData?.[scopeKey]?.obsLabels?.[
|
|
256
257
|
// TODO: Maybe all loaders that return obsIndex should also return an obsIndexMap
|
|
@@ -53,6 +53,28 @@ const sharedThemeOptions = {
|
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
|
+
const lightPalette = {
|
|
57
|
+
type: 'light',
|
|
58
|
+
primary: grey,
|
|
59
|
+
secondary: grey,
|
|
60
|
+
primaryBackground: '#F1F1F1',
|
|
61
|
+
primaryBackgroundHighlight: '#FFFFFF',
|
|
62
|
+
primaryBackgroundInput: '#FFFFFF',
|
|
63
|
+
primaryBackgroundDim: '#8A8A8A',
|
|
64
|
+
primaryBackgroundLight: '#e0e0e0',
|
|
65
|
+
primaryForeground: '#333333',
|
|
66
|
+
primaryForegroundL5: 'rgb(64, 64, 64)',
|
|
67
|
+
primaryForegroundL10: 'rgb(77, 77, 77)',
|
|
68
|
+
primaryForegroundD15: 'rgb(13, 13, 13)',
|
|
69
|
+
primaryForegroundDim: '#808080',
|
|
70
|
+
primaryForegroundActive: '#0074D9',
|
|
71
|
+
secondaryBackground: '#F1F1F1',
|
|
72
|
+
secondaryBackgroundDim: '#C0C0C0',
|
|
73
|
+
secondaryForeground: '#222222',
|
|
74
|
+
gridLayoutBackground: '#FFFFFF',
|
|
75
|
+
cardBorder: 'rgba(241, 241, 241, 0.125)',
|
|
76
|
+
tooltipText: 'rgba(0, 0, 0, 0.87)',
|
|
77
|
+
};
|
|
56
78
|
export const muiTheme = {
|
|
57
79
|
dark: createTheme({
|
|
58
80
|
palette: {
|
|
@@ -79,31 +101,28 @@ export const muiTheme = {
|
|
|
79
101
|
...globalColors,
|
|
80
102
|
},
|
|
81
103
|
...sharedThemeOptions,
|
|
104
|
+
cardBorderSize: '1px',
|
|
82
105
|
}),
|
|
83
106
|
light: createTheme({
|
|
84
107
|
palette: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
primaryForegroundActive: '#0074D9',
|
|
99
|
-
secondaryBackground: '#F1F1F1',
|
|
100
|
-
secondaryBackgroundDim: '#C0C0C0',
|
|
101
|
-
secondaryForeground: '#222222',
|
|
108
|
+
...lightPalette,
|
|
109
|
+
...globalColors,
|
|
110
|
+
},
|
|
111
|
+
...sharedThemeOptions,
|
|
112
|
+
cardBorderSize: '1px',
|
|
113
|
+
}),
|
|
114
|
+
light2: createTheme({
|
|
115
|
+
palette: {
|
|
116
|
+
...lightPalette,
|
|
117
|
+
primaryBackground: '#FFFFFF',
|
|
118
|
+
primaryBackgroundHighlight: '#F1F1F1',
|
|
119
|
+
primaryBackgroundInput: '#F1F1F1',
|
|
120
|
+
secondaryBackground: '#FFFFFF',
|
|
102
121
|
gridLayoutBackground: '#FFFFFF',
|
|
103
|
-
cardBorder: '
|
|
104
|
-
tooltipText: 'rgba(0, 0, 0, 0.87)',
|
|
122
|
+
cardBorder: '#ccc',
|
|
105
123
|
...globalColors,
|
|
106
124
|
},
|
|
107
125
|
...sharedThemeOptions,
|
|
126
|
+
cardBorderSize: '2px',
|
|
108
127
|
}),
|
|
109
128
|
};
|
|
@@ -62,9 +62,7 @@ export function useMultiCoordinationScopes(parameter: any, coordinationScopes: a
|
|
|
62
62
|
export function useMultiCoordinationScopesNonNull(parameter: any, coordinationScopes: any): any;
|
|
63
63
|
export function useMultiCoordinationScopesSecondary(parameter: any, byType: any, coordinationScopes: any, coordinationScopesBy: any): any;
|
|
64
64
|
export function useMultiCoordinationScopesSecondaryNonNull(parameter: any, byType: any, coordinationScopes: any, coordinationScopesBy: any): any;
|
|
65
|
-
export function useMultiCoordinationValues(parameter: any, coordinationScopes: any):
|
|
66
|
-
[key: string]: any;
|
|
67
|
-
};
|
|
65
|
+
export function useMultiCoordinationValues(parameter: any, coordinationScopes: any): any;
|
|
68
66
|
/**
|
|
69
67
|
* Get a mapping from dataset coordination scopes to dataset UIDs.
|
|
70
68
|
* @param {object} coordinationScopes The coordination scope mapping object for a view.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/state/hooks.js"],"names":[],"mappings":"AAmCA;;;;;;GAMG;AACH,oEAFa,MAAM,GAAC,SAAS,CA4B5B;AAED;;;;;;;GAOG;AACH,mGAFa,MAAM,GAAC,SAAS,CA0C5B;AAED;;;;;GAKG;AACH,6CAJW,MAAM,4BAEJ,MAAM,GAAC,SAAS,CAI5B;AAED;;;;;;GAMG;AACH,+CALW,MAAM,oFAGJ,MAAM,GAAC,SAAS,CAc5B;AA4RD;;;;;;;;;GASG;AACH,mDALW,MAAM,EAAE,sBACR,MAAM,GAEJ,MAAM,CAclB;AAED;;;;;;;;;;;;;;;GAeG;AACH,4CATW,MAAM,EAAE,sBACR,MAAM,SAqChB;AAED,yFAKC;AAED,gGAqBC;AAED,0IA4BC;AAED,iJAkEC;AAED
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/state/hooks.js"],"names":[],"mappings":"AAmCA;;;;;;GAMG;AACH,oEAFa,MAAM,GAAC,SAAS,CA4B5B;AAED;;;;;;;GAOG;AACH,mGAFa,MAAM,GAAC,SAAS,CA0C5B;AAED;;;;;GAKG;AACH,6CAJW,MAAM,4BAEJ,MAAM,GAAC,SAAS,CAI5B;AAED;;;;;;GAMG;AACH,+CALW,MAAM,oFAGJ,MAAM,GAAC,SAAS,CAc5B;AA4RD;;;;;;;;;GASG;AACH,mDALW,MAAM,EAAE,sBACR,MAAM,GAEJ,MAAM,CAclB;AAED;;;;;;;;;;;;;;;GAeG;AACH,4CATW,MAAM,EAAE,sBACR,MAAM,SAqChB;AAED,yFAKC;AAED,gGAqBC;AAED,0IA4BC;AAED,iJAkEC;AAED,yFAmBC;AAED;;;;GAIG;AACH,mDAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;;;;;;;;GAaG;AACH,mDAXW,MAAM,EAAE,sBACR,MAAM,wBACN,MAAM,UAEN,MAAM,SA6EhB;AAED;;;;;GAKG;AACH,0DAHW,MAAM,GACJ,MAAM,CAiBlB;AAED;;;;;;GAMG;AACH,4DAJW,MAAM,wBACN,MAAM,GACJ,MAAM,CAgBlB;AAED;;;;;;;GAOG;AACH,4DANW,MAAM,EAAE,iDACR,MAAM,eACN,MAAM,iBACN,MAAM,SAuEhB;AAGD;;;;;;;;;;;GAWG;AACH,wDATW,MAAM,EAAE,sBACR,MAAM,wBACN,MAAM,SAYhB;AA6BD;;;;;;;;;;;;;;;GAeG;AACH,qDATW,MAAM,EAAE,sBACR,MAAM,SAkChB;AAED;;;;;GAKG;AACH,8BAHa,MAAM,CAKlB;AAGD;;;;;;;;;;;;GAYG;AACH,2CARW,MAAM,WACN,MAAM,YACN,MAAM,0BACN,MAAM,OAoBhB;AAED;;;;;;;;;;;;GAYG;AACH,2CARW,MAAM,WACN,MAAM,YACN,MAAM,0BACN,MAAM,OAShB;AAED;;;;;GAKG;AACH,6BAHa,MAAM,EAAE,CAKpB;AAED;;;;;GAKG;AACH,+CAEC;AAED;;;;;GAKG;AACH,0EAEC;AAED;;;;;GAKG;AACH,uEAEC;AAED;;;;;GAKG;AACH,4CAEC;AAED;;;;;GAKG;AACH,0CAEC;AAED;;;;;GAKG;AACH,iDAEC;AAED;;;;;GAKG;AACH,oEAIC;AAED;;;;;GAKG;AACH,qCAHa,MAAM,CAKlB;AAED;;;;;GAKG;AACH,iDAEC;AAED;;;;;GAKG;AACH,8BAHa,MAAM,CAKlB;AAED;;;;;GAKG;AACH,0CAEC;AAED;;;;;GAKG;AACH,iDAHa,MAAM,CAKlB;AAED;;;;;GAKG;AACH,6DAOC;AAED;;;;GAIG;AACH,iCAFa,MAAM,CAIlB;AAED;;;;;GAKG;AACH,8CAEC;AA5oCD;;;;+QAA0D;AAC1D,sFAA0D;AAC1D;;;;;EAAgE;AAOhE;;;;+QAAwD;AACxD,qFAAwD;AAiIjD,yFA+KJ;AAOI,0FAFM,MAAM,CAOlB;AAcM,iDAUJ"}
|
package/dist-tsc/state/hooks.js
CHANGED
|
@@ -6,7 +6,7 @@ import createContext from 'zustand/context';
|
|
|
6
6
|
import shallow from 'zustand/shallow';
|
|
7
7
|
import { isMatch, cloneDeep } from 'lodash-es';
|
|
8
8
|
import { CoordinationType } from '@vitessce/constants-internal';
|
|
9
|
-
import {
|
|
9
|
+
import { capitalize } from '@vitessce/utils';
|
|
10
10
|
import { getCoordinationSpaceAndScopes } from '@vitessce/config';
|
|
11
11
|
import { removeImageChannelInMetaCoordinationScopesHelper, addImageChannelInMetaCoordinationScopesHelper, } from './spatial-reducers.js';
|
|
12
12
|
// Reference: https://github.com/pmndrs/zustand#react-context
|
|
@@ -395,7 +395,7 @@ const useGridSizeStore = create(set => ({
|
|
|
395
395
|
export function useInitialCoordination(parameters, coordinationScopes) {
|
|
396
396
|
const values = useViewConfigStore((state) => {
|
|
397
397
|
const { coordinationSpace } = state.initialViewConfig;
|
|
398
|
-
return fromEntries(parameters.map((parameter) => {
|
|
398
|
+
return Object.fromEntries(parameters.map((parameter) => {
|
|
399
399
|
if (coordinationSpace && coordinationSpace[parameter]) {
|
|
400
400
|
const value = coordinationSpace[parameter][coordinationScopes[parameter]];
|
|
401
401
|
return [parameter, value];
|
|
@@ -425,7 +425,7 @@ export function useCoordination(parameters, coordinationScopes) {
|
|
|
425
425
|
const setCoordinationValue = useViewConfigStore(state => state.setCoordinationValue);
|
|
426
426
|
const values = useViewConfigStore((state) => {
|
|
427
427
|
const { coordinationSpace } = state.viewConfig;
|
|
428
|
-
return fromEntries(parameters.map((parameter) => {
|
|
428
|
+
return Object.fromEntries(parameters.map((parameter) => {
|
|
429
429
|
if (coordinationSpace) {
|
|
430
430
|
const parameterScope = getParameterScope(parameter, coordinationScopes);
|
|
431
431
|
if (coordinationSpace && coordinationSpace[parameter]) {
|
|
@@ -436,7 +436,7 @@ export function useCoordination(parameters, coordinationScopes) {
|
|
|
436
436
|
return [parameter, undefined];
|
|
437
437
|
}));
|
|
438
438
|
}, shallow);
|
|
439
|
-
const setters = useMemo(() => fromEntries(parameters.map((parameter) => {
|
|
439
|
+
const setters = useMemo(() => Object.fromEntries(parameters.map((parameter) => {
|
|
440
440
|
const setterName = `set${capitalize(parameter)}`;
|
|
441
441
|
const setterFunc = value => setCoordinationValue({
|
|
442
442
|
parameter,
|
|
@@ -480,7 +480,7 @@ export function useMultiCoordinationScopesSecondary(parameter, byType, coordinat
|
|
|
480
480
|
const scopes = getParameterScope(byType, coordinationScopes);
|
|
481
481
|
if (scopes && coordinationScopesBy?.[byType]?.[parameter]) {
|
|
482
482
|
const scopesArr = Array.isArray(scopes) ? scopes : [scopes];
|
|
483
|
-
return [scopesArr, fromEntries(scopesArr.map((scope) => {
|
|
483
|
+
return [scopesArr, Object.fromEntries(scopesArr.map((scope) => {
|
|
484
484
|
const secondaryScopes = coordinationScopesBy[byType][parameter][scope];
|
|
485
485
|
const secondaryScopesArr = Array.isArray(secondaryScopes)
|
|
486
486
|
? secondaryScopes
|
|
@@ -491,7 +491,7 @@ export function useMultiCoordinationScopesSecondary(parameter, byType, coordinat
|
|
|
491
491
|
// Fallback from fine-grained to coarse-grained.
|
|
492
492
|
if (scopes && !coordinationScopesBy?.[byType]?.[parameter] && coordinationScopes?.[parameter]) {
|
|
493
493
|
const scopesArr = Array.isArray(scopes) ? scopes : [scopes];
|
|
494
|
-
return [scopesArr, fromEntries(scopesArr.map((scope) => {
|
|
494
|
+
return [scopesArr, Object.fromEntries(scopesArr.map((scope) => {
|
|
495
495
|
const secondaryScopes = coordinationScopes?.[parameter];
|
|
496
496
|
const secondaryScopesArr = Array.isArray(secondaryScopes)
|
|
497
497
|
? secondaryScopes
|
|
@@ -522,7 +522,7 @@ export function useMultiCoordinationScopesSecondaryNonNull(parameter, byType, co
|
|
|
522
522
|
}
|
|
523
523
|
return false;
|
|
524
524
|
});
|
|
525
|
-
return [scopesNonNull, fromEntries(scopesNonNull.map((scope) => {
|
|
525
|
+
return [scopesNonNull, Object.fromEntries(scopesNonNull.map((scope) => {
|
|
526
526
|
const secondaryScopes = coordinationScopesBy[byType][parameter][scope];
|
|
527
527
|
const secondaryScopesArr = Array.isArray(secondaryScopes)
|
|
528
528
|
? secondaryScopes
|
|
@@ -547,7 +547,7 @@ export function useMultiCoordinationScopesSecondaryNonNull(parameter, byType, co
|
|
|
547
547
|
}
|
|
548
548
|
return false;
|
|
549
549
|
});
|
|
550
|
-
return [scopesNonNull, fromEntries(scopesNonNull.map((scope) => {
|
|
550
|
+
return [scopesNonNull, Object.fromEntries(scopesNonNull.map((scope) => {
|
|
551
551
|
const secondaryScopes = coordinationScopes?.[parameter];
|
|
552
552
|
const secondaryScopesArr = Array.isArray(secondaryScopes)
|
|
553
553
|
? secondaryScopes
|
|
@@ -572,7 +572,7 @@ export function useMultiCoordinationValues(parameter, coordinationScopes) {
|
|
|
572
572
|
const { coordinationSpace } = state.viewConfig;
|
|
573
573
|
// Convert a single scope to an array of scopes to be consistent.
|
|
574
574
|
const scopesArr = Array.isArray(scopes) ? scopes : [scopes];
|
|
575
|
-
return fromEntries(scopesArr.map((scope) => {
|
|
575
|
+
return Object.fromEntries(scopesArr.map((scope) => {
|
|
576
576
|
if (coordinationSpace && coordinationSpace[parameter]) {
|
|
577
577
|
const value = coordinationSpace[parameter][scope];
|
|
578
578
|
return [scope, value];
|
|
@@ -616,8 +616,8 @@ export function useComplexCoordination(parameters, coordinationScopes, coordinat
|
|
|
616
616
|
if (typeScopes) {
|
|
617
617
|
// Convert a single scope to an array of scopes to be consistent.
|
|
618
618
|
const typeScopesArr = Array.isArray(typeScopes) ? typeScopes : [typeScopes];
|
|
619
|
-
return fromEntries(typeScopesArr.map((datasetScope) => {
|
|
620
|
-
const datasetValues = fromEntries(parameters.map((parameter, i) => {
|
|
619
|
+
return Object.fromEntries(typeScopesArr.map((datasetScope) => {
|
|
620
|
+
const datasetValues = Object.fromEntries(parameters.map((parameter, i) => {
|
|
621
621
|
if (parameterSpaces[i]) {
|
|
622
622
|
const parameterSpace = parameterSpaces[i];
|
|
623
623
|
const parameterScope = getParameterScopeBy(parameter, byType, datasetScope, coordinationScopes, coordinationScopesBy);
|
|
@@ -642,8 +642,8 @@ export function useComplexCoordination(parameters, coordinationScopes, coordinat
|
|
|
642
642
|
if (typeScopes) {
|
|
643
643
|
// Convert a single scope to an array of scopes to be consistent.
|
|
644
644
|
const typeScopesArr = Array.isArray(typeScopes) ? typeScopes : [typeScopes];
|
|
645
|
-
return fromEntries(typeScopesArr.map((datasetScope) => {
|
|
646
|
-
const datasetSetters = fromEntries(parameters.map((parameter) => {
|
|
645
|
+
return Object.fromEntries(typeScopesArr.map((datasetScope) => {
|
|
646
|
+
const datasetSetters = Object.fromEntries(parameters.map((parameter) => {
|
|
647
647
|
const setterName = `set${capitalize(parameter)}`;
|
|
648
648
|
const setterFunc = value => setCoordinationValue({
|
|
649
649
|
parameter,
|
|
@@ -836,7 +836,7 @@ export function useAuxiliaryCoordination(parameters, coordinationScopes) {
|
|
|
836
836
|
const mappedParameters = mapParameters(parameters);
|
|
837
837
|
const values = useAuxiliaryStore((state) => {
|
|
838
838
|
const { auxiliaryStore } = state;
|
|
839
|
-
return fromEntries(mappedParameters.map((parameter) => {
|
|
839
|
+
return Object.fromEntries(mappedParameters.map((parameter) => {
|
|
840
840
|
if (auxiliaryStore && auxiliaryStore[parameter]) {
|
|
841
841
|
const value = auxiliaryStore[parameter][mappedCoordinationScopes[parameter]];
|
|
842
842
|
return [parameter, value];
|
|
@@ -844,7 +844,7 @@ export function useAuxiliaryCoordination(parameters, coordinationScopes) {
|
|
|
844
844
|
return [parameter, undefined];
|
|
845
845
|
}));
|
|
846
846
|
}, shallow);
|
|
847
|
-
const setters = useMemo(() => fromEntries(mappedParameters.map((parameter) => {
|
|
847
|
+
const setters = useMemo(() => Object.fromEntries(mappedParameters.map((parameter) => {
|
|
848
848
|
const setterName = `set${capitalize(parameter)}`;
|
|
849
849
|
const setterFunc = value => setCoordinationValue({
|
|
850
850
|
parameter,
|
package/dist-tsc/title-styles.js
CHANGED
|
@@ -36,7 +36,7 @@ export const useTitleStyles = makeStyles(theme => ({
|
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
card: {
|
|
39
|
-
border:
|
|
39
|
+
border: `${theme.cardBorderSize} solid ${theme.palette.cardBorder}`,
|
|
40
40
|
flex: '1 1 auto',
|
|
41
41
|
minHeight: '1px',
|
|
42
42
|
padding: '12px',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-plusplus */
|
|
2
2
|
/* eslint-disable camelcase */
|
|
3
3
|
import { cloneDeep } from 'lodash-es';
|
|
4
|
-
import {
|
|
4
|
+
import { getNextScope } from '@vitessce/utils';
|
|
5
5
|
import { AUTO_INDEPENDENT_COORDINATION_TYPES, META_VERSION, } from '@vitessce/constants-internal';
|
|
6
6
|
export function logConfig(config, name) {
|
|
7
7
|
console.groupCollapsed(`🚄 VitS (${META_VERSION.version}) ${name}`);
|
|
@@ -33,7 +33,7 @@ export function getExistingScopesForCoordinationType(config, coordinationType) {
|
|
|
33
33
|
* @returns {object} The new view config.
|
|
34
34
|
*/
|
|
35
35
|
function coordinateComponentsTogether(config, coordinationType, scopeValue, viewTypes) {
|
|
36
|
-
const componentCoordinationTypes = fromEntries(viewTypes.map(vt => ([vt.name, vt.coordinationTypes])));
|
|
36
|
+
const componentCoordinationTypes = Object.fromEntries(viewTypes.map(vt => ([vt.name, vt.coordinationTypes])));
|
|
37
37
|
const scopeName = getNextScope(getExistingScopesForCoordinationType(config, coordinationType));
|
|
38
38
|
const newConfig = {
|
|
39
39
|
...config,
|
|
@@ -72,7 +72,7 @@ function coordinateComponentsTogether(config, coordinationType, scopeValue, view
|
|
|
72
72
|
* @returns {object} The new view config.
|
|
73
73
|
*/
|
|
74
74
|
function coordinateComponentsIndependent(config, coordinationType, scopeValue, viewTypes) {
|
|
75
|
-
const componentCoordinationTypes = fromEntries(viewTypes.map(vt => ([vt.name, vt.coordinationTypes])));
|
|
75
|
+
const componentCoordinationTypes = Object.fromEntries(viewTypes.map(vt => ([vt.name, vt.coordinationTypes])));
|
|
76
76
|
const newConfig = {
|
|
77
77
|
...config,
|
|
78
78
|
layout: [...config.layout],
|
|
@@ -117,8 +117,8 @@ function coordinateComponentsIndependent(config, coordinationType, scopeValue, v
|
|
|
117
117
|
function initializeAuto(config, coordinationTypeObjs, viewTypeObjs) {
|
|
118
118
|
let newConfig = config;
|
|
119
119
|
const { layout, datasets } = newConfig;
|
|
120
|
-
const componentCoordinationTypes = fromEntries(viewTypeObjs.map(vt => ([vt.name, vt.coordinationTypes])));
|
|
121
|
-
const defaultCoordinationValues = fromEntries(coordinationTypeObjs.map(ct => ([ct.name, ct.defaultValue])));
|
|
120
|
+
const componentCoordinationTypes = Object.fromEntries(viewTypeObjs.map(vt => ([vt.name, vt.coordinationTypes])));
|
|
121
|
+
const defaultCoordinationValues = Object.fromEntries(coordinationTypeObjs.map(ct => ([ct.name, ct.defaultValue])));
|
|
122
122
|
const coordinationTypes = coordinationTypeObjs.map(ct => ct.name);
|
|
123
123
|
// For each coordination type, check whether it requires initialization.
|
|
124
124
|
coordinationTypes.forEach((coordinationType) => {
|
|
@@ -186,7 +186,7 @@ function assignViewUids(config) {
|
|
|
186
186
|
* @returns The view config containing expanded minimal file types.
|
|
187
187
|
*/
|
|
188
188
|
function expandConvenienceFileDefs(config, jointFileTypes) {
|
|
189
|
-
const convenienceFileTypes = fromEntries(jointFileTypes.map(ft => ([ft.name, ft.expandFunction])));
|
|
189
|
+
const convenienceFileTypes = Object.fromEntries(jointFileTypes.map(ft => ([ft.name, ft.expandFunction])));
|
|
190
190
|
const { datasets: currDatasets } = config;
|
|
191
191
|
const datasets = cloneDeep(currDatasets);
|
|
192
192
|
currDatasets.forEach((dataset, i) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitessce-grid-utils.d.ts","sourceRoot":"","sources":["../src/vitessce-grid-utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vitessce-grid-utils.d.ts","sourceRoot":"","sources":["../src/vitessce-grid-utils.js"],"names":[],"mappings":"AAyCA,gHA6CC;AA4BD;;;;;;;;;;GAUG;AACH,wCATW,MAAM,EAAE,qBACR,MAAM,aAEN,gBAAgB,qBAChB,wBAAwB,UACxB,MAAM,GACJ,MAAM,CA4DlB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect, useRef, } from 'react';
|
|
2
2
|
import { InternMap } from 'internmap';
|
|
3
3
|
import { isEqual, pick } from 'lodash-es';
|
|
4
|
-
import { fromEntries } from '@vitessce/utils';
|
|
5
4
|
import { DATA_TYPE_COORDINATION_VALUE_USAGE } from '@vitessce/constants-internal';
|
|
6
5
|
import { getSourceAndLoaderFromFileType, getDataTypeFromFileType } from './data/loader-registry.js';
|
|
7
6
|
/**
|
|
@@ -109,7 +108,7 @@ function withDefaults(coordinationValues, dataType, fileType, datasetUid, defaul
|
|
|
109
108
|
export function createLoaders(datasets, configDescription, fileTypes, coordinationTypes, stores) {
|
|
110
109
|
const result = {};
|
|
111
110
|
const dataSources = new InternMap([], JSON.stringify);
|
|
112
|
-
const defaultCoordinationValues = fromEntries(coordinationTypes.map(ct => ([ct.name, ct.defaultValue])));
|
|
111
|
+
const defaultCoordinationValues = Object.fromEntries(coordinationTypes.map(ct => ([ct.name, ct.defaultValue])));
|
|
113
112
|
datasets.forEach((dataset) => {
|
|
114
113
|
const datasetLoaders = {
|
|
115
114
|
name: dataset.name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/vit-s",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.6",
|
|
4
4
|
"author": "Gehlenborg Lab",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"uuid": "^9.0.0",
|
|
30
30
|
"zustand": "^3.5.10",
|
|
31
31
|
"react-aria": "^3.28.0",
|
|
32
|
-
"@vitessce/constants-internal": "3.3.
|
|
33
|
-
"@vitessce/
|
|
34
|
-
"@vitessce/
|
|
35
|
-
"@vitessce/utils": "3.3.
|
|
36
|
-
"@vitessce/config": "3.3.
|
|
32
|
+
"@vitessce/constants-internal": "3.3.6",
|
|
33
|
+
"@vitessce/schemas": "3.3.6",
|
|
34
|
+
"@vitessce/plugins": "3.3.6",
|
|
35
|
+
"@vitessce/utils": "3.3.6",
|
|
36
|
+
"@vitessce/config": "3.3.6"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@testing-library/jest-dom": "^5.16.4",
|
package/src/VitS.js
CHANGED
|
@@ -53,6 +53,8 @@ import { createGenerateClassName } from './mui-utils.js';
|
|
|
53
53
|
* @param {null|string} props.uid A unique identifier for this Vitessce instance,
|
|
54
54
|
* for the purpose of avoiding CSS autogenerated class name conflicts. Must be valid as part
|
|
55
55
|
* of a CSS class name string.
|
|
56
|
+
* @param {boolean} props.remountOnUidChange Whether to remount the coordination provider
|
|
57
|
+
* upon changes to config.uid. By default, true.
|
|
56
58
|
* @param {array} props.viewTypes Plugin view types.
|
|
57
59
|
* @param {array} props.fileTypes Plugin file types.
|
|
58
60
|
* @param {array} props.jointFileTypes Plugin joint file types.
|
|
@@ -74,6 +76,7 @@ export function VitS(props) {
|
|
|
74
76
|
validateOnConfigChange = false,
|
|
75
77
|
isBounded = false,
|
|
76
78
|
uid = null,
|
|
79
|
+
remountOnUidChange = true,
|
|
77
80
|
viewTypes: viewTypesProp,
|
|
78
81
|
fileTypes: fileTypesProp,
|
|
79
82
|
jointFileTypes: jointFileTypesProp,
|
|
@@ -211,7 +214,10 @@ export function VitS(props) {
|
|
|
211
214
|
<StylesProvider generateClassName={generateClassName}>
|
|
212
215
|
<ThemeProvider theme={muiTheme[theme]}>
|
|
213
216
|
<QueryClientProvider client={queryClient}>
|
|
214
|
-
<ViewConfigProvider
|
|
217
|
+
<ViewConfigProvider
|
|
218
|
+
createStore={createViewConfigStoreClosure}
|
|
219
|
+
{...(remountOnUidChange ? ({ key: configKey }) : {})}
|
|
220
|
+
>
|
|
215
221
|
<AuxiliaryProvider createStore={createAuxiliaryStore}>
|
|
216
222
|
<VitessceGrid
|
|
217
223
|
success={success}
|
package/src/data-hook-utils.js
CHANGED
|
@@ -2,7 +2,6 @@ import { useEffect, useMemo } from 'react';
|
|
|
2
2
|
import { useQuery, useQueries } from '@tanstack/react-query';
|
|
3
3
|
import {
|
|
4
4
|
capitalize,
|
|
5
|
-
fromEntries,
|
|
6
5
|
getInitialCoordinationScopePrefix,
|
|
7
6
|
} from '@vitessce/utils';
|
|
8
7
|
import { STATUS } from '@vitessce/constants-internal';
|
|
@@ -236,7 +235,7 @@ export function useDataTypeMulti(
|
|
|
236
235
|
}, [anyError, setWarning]);
|
|
237
236
|
|
|
238
237
|
// Convert data to object keyed by scopeKey.
|
|
239
|
-
const data = useMemo(() => fromEntries(
|
|
238
|
+
const data = useMemo(() => Object.fromEntries(
|
|
240
239
|
matchOnEntries.map(([scopeKey], i) => ([scopeKey, dataQueries[i].data?.data])),
|
|
241
240
|
// Deliberate dependency omissions: dataQueries and matchOnEntries,
|
|
242
241
|
// since dataQueries changes every re-render. We use the in-direct
|
|
@@ -245,7 +244,7 @@ export function useDataTypeMulti(
|
|
|
245
244
|
), [matchOnObj, dataStatus]);
|
|
246
245
|
|
|
247
246
|
// Convert data to object keyed by scopeKey.
|
|
248
|
-
const urls = useMemo(() => fromEntries(
|
|
247
|
+
const urls = useMemo(() => Object.fromEntries(
|
|
249
248
|
matchOnEntries.map(([scopeKey], i) => ([scopeKey, dataQueries[i].data?.urls])),
|
|
250
249
|
// Deliberate dependency omissions: matchOnEntries, since dataQueries depends on it.
|
|
251
250
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { CoordinationType } from '@vitessce/constants-internal';
|
|
3
|
-
import { fromEntries } from '@vitessce/utils';
|
|
4
3
|
import {
|
|
5
4
|
useComplexCoordination,
|
|
6
5
|
useComplexCoordinationSecondary,
|
|
@@ -44,14 +43,16 @@ export function useSegmentationMultiFeatureSelection(
|
|
|
44
43
|
[coordinationScopes, coordinationScopesBy]);
|
|
45
44
|
const useMemoDependency = Object.values(featureSelectionCoordination[0] || {})
|
|
46
45
|
.flatMap(layerVal => Object.values(layerVal).map(cVal => cVal.featureSelection));
|
|
47
|
-
const selections = useMemo(() =>
|
|
48
|
-
.
|
|
49
|
-
layerScope,
|
|
50
|
-
|
|
51
|
-
Object.
|
|
52
|
-
.
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
const selections = useMemo(() => Object.fromEntries(
|
|
47
|
+
Object.entries(featureSelectionCoordination[0])
|
|
48
|
+
.map(([layerScope, layerVal]) => ([
|
|
49
|
+
layerScope,
|
|
50
|
+
Object.fromEntries(
|
|
51
|
+
Object.entries(layerVal)
|
|
52
|
+
.map(([cScope, cVal]) => ([cScope, cVal.featureSelection])),
|
|
53
|
+
),
|
|
54
|
+
])),
|
|
55
|
+
),
|
|
55
56
|
// Need to execute this more frequently, whenever the featureSelections update.
|
|
56
57
|
[coordinationScopes, coordinationScopesBy,
|
|
57
58
|
// We need to ensure there are always the same number of
|
|
@@ -92,11 +93,13 @@ export function useSpotMultiFeatureSelection(
|
|
|
92
93
|
// use coordinationScopes and coordinationScopesBy which are
|
|
93
94
|
// indirect dependencies here.
|
|
94
95
|
[coordinationScopes, coordinationScopesBy]);
|
|
95
|
-
const selections = useMemo(() =>
|
|
96
|
-
.
|
|
97
|
-
layerScope,
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
const selections = useMemo(() => Object.fromEntries(
|
|
97
|
+
Object.entries(featureSelectionCoordination[0])
|
|
98
|
+
.map(([layerScope, layerVal]) => ([
|
|
99
|
+
layerScope,
|
|
100
|
+
layerVal.featureSelection,
|
|
101
|
+
])),
|
|
102
|
+
),
|
|
100
103
|
// Need to execute this more frequently, whenever the featureSelections update.
|
|
101
104
|
[coordinationScopes, coordinationScopesBy,
|
|
102
105
|
...Object.values(featureSelectionCoordination[0] || {})
|
package/src/data-hooks.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect, useMemo } from 'react';
|
|
2
2
|
import { CoordinationType, DataType, STATUS } from '@vitessce/constants-internal';
|
|
3
|
-
import { fromEntries } from '@vitessce/utils';
|
|
4
3
|
import { useQuery, useQueries } from '@tanstack/react-query';
|
|
5
4
|
import {
|
|
6
5
|
useMultiCoordinationValues,
|
|
@@ -456,7 +455,7 @@ export function useMultiObsLabels(
|
|
|
456
455
|
CoordinationType.OBS_LABELS_TYPE,
|
|
457
456
|
coordinationScopes,
|
|
458
457
|
);
|
|
459
|
-
const obsLabelsMatchOnObj = useMemo(() => fromEntries(
|
|
458
|
+
const obsLabelsMatchOnObj = useMemo(() => Object.fromEntries(
|
|
460
459
|
Object.entries(obsLabelsTypes).map(([scope, obsLabelsType]) => ([
|
|
461
460
|
scope,
|
|
462
461
|
{ obsLabelsType, obsType },
|