@vitessce/vit-s 3.0.0 → 3.1.0
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 +28430 -25685
- package/dist-tsc/VitS.d.ts +7 -2
- package/dist-tsc/VitS.d.ts.map +1 -1
- package/dist-tsc/VitS.js +43 -23
- package/dist-tsc/VitessceGrid.d.ts.map +1 -1
- package/dist-tsc/VitessceGrid.js +14 -11
- package/dist-tsc/VitessceGrid.test.js +5 -2
- package/dist-tsc/Warning.js +2 -2
- package/dist-tsc/data/LoaderResult.d.ts +8 -3
- package/dist-tsc/data/LoaderResult.d.ts.map +1 -1
- package/dist-tsc/data/LoaderResult.js +5 -0
- package/dist-tsc/data-hook-utils.d.ts +3 -7
- package/dist-tsc/data-hook-utils.d.ts.map +1 -1
- package/dist-tsc/data-hook-utils.js +97 -79
- package/dist-tsc/data-hooks.d.ts +12 -16
- package/dist-tsc/data-hooks.d.ts.map +1 -1
- package/dist-tsc/data-hooks.js +140 -127
- package/dist-tsc/errors/DataSourceFetchError.js +1 -1
- package/dist-tsc/hooks.d.ts +3 -7
- package/dist-tsc/hooks.d.ts.map +1 -1
- package/dist-tsc/hooks.js +12 -18
- package/dist-tsc/index.d.ts +2 -1
- package/dist-tsc/index.js +2 -1
- package/dist-tsc/mui-utils.d.ts +2 -0
- package/dist-tsc/mui-utils.d.ts.map +1 -0
- package/dist-tsc/mui-utils.js +44 -0
- package/dist-tsc/shared-plot-options/OptionSelect.js +1 -1
- package/dist-tsc/shared-plot-options/styles.js +1 -1
- package/dist-tsc/state/hooks.d.ts +27 -1
- package/dist-tsc/state/hooks.d.ts.map +1 -1
- package/dist-tsc/state/hooks.js +61 -21
- package/dist-tsc/view-config-utils.d.ts +1 -0
- package/dist-tsc/view-config-utils.d.ts.map +1 -1
- package/dist-tsc/view-config-utils.js +7 -1
- package/dist-tsc/view-config-utils.test.js +1 -0
- package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.test.js +1 -1
- package/dist-tsc/vitessce-grid-layout/layout-utils.test.js +1 -0
- package/package.json +10 -9
- package/src/VitS.js +79 -43
- package/src/VitessceGrid.js +16 -10
- package/src/VitessceGrid.test.jsx +8 -2
- package/src/Warning.js +2 -2
- package/src/data/LoaderResult.js +5 -0
- package/src/data-hook-utils.js +116 -81
- package/src/data-hooks.js +148 -129
- package/src/errors/DataSourceFetchError.js +1 -1
- package/src/hooks.js +14 -21
- package/src/index.js +2 -0
- package/src/mui-utils.js +52 -0
- package/src/shared-plot-options/OptionSelect.js +1 -1
- package/src/shared-plot-options/styles.js +1 -1
- package/src/state/hooks.js +66 -21
- package/src/view-config-utils.js +8 -0
- package/src/view-config-utils.test.jsx +1 -0
- package/src/vitessce-grid-layout/VitessceGridLayout.test.jsx +1 -1
- package/src/vitessce-grid-layout/layout-utils.test.js +1 -0
- package/dist-tsc/schemas/config-0.1.0.schema.json +0 -84
- package/dist-tsc/schemas/config-1.0.0.schema.json +0 -733
- package/dist-tsc/schemas/config-1.0.1.schema.json +0 -909
- package/dist-tsc/schemas/config-1.0.10.schema.json +0 -969
- package/dist-tsc/schemas/config-1.0.11.schema.json +0 -990
- package/dist-tsc/schemas/config-1.0.12.schema.json +0 -997
- package/dist-tsc/schemas/config-1.0.13.schema.json +0 -1013
- package/dist-tsc/schemas/config-1.0.14.schema.json +0 -1048
- package/dist-tsc/schemas/config-1.0.15.schema.json +0 -1048
- package/dist-tsc/schemas/config-1.0.16.schema.json +0 -1089
- package/dist-tsc/schemas/config-1.0.2.schema.json +0 -910
- package/dist-tsc/schemas/config-1.0.3.schema.json +0 -910
- package/dist-tsc/schemas/config-1.0.4.schema.json +0 -949
- package/dist-tsc/schemas/config-1.0.5.schema.json +0 -949
- package/dist-tsc/schemas/config-1.0.6.schema.json +0 -949
- package/dist-tsc/schemas/config-1.0.7.schema.json +0 -949
- package/dist-tsc/schemas/config-1.0.8.schema.json +0 -965
- package/dist-tsc/schemas/config-1.0.9.schema.json +0 -965
- package/dist-tsc/schemas/obsSets.schema.d.ts +0 -179
- package/dist-tsc/schemas/obsSets.schema.d.ts.map +0 -1
- package/dist-tsc/schemas/obsSets.schema.js +0 -195
- package/dist-tsc/schemas/obsSetsTabular.schema.d.ts +0 -57
- package/dist-tsc/schemas/obsSetsTabular.schema.d.ts.map +0 -1
- package/dist-tsc/schemas/obsSetsTabular.schema.js +0 -38
- package/dist-tsc/schemas/raster.schema.d.ts +0 -239
- package/dist-tsc/schemas/raster.schema.d.ts.map +0 -1
- package/dist-tsc/schemas/raster.schema.js +0 -120
- package/src/schemas/config-0.1.0.schema.json +0 -85
- package/src/schemas/config-1.0.0.schema.json +0 -733
- package/src/schemas/config-1.0.1.schema.json +0 -909
- package/src/schemas/config-1.0.10.schema.json +0 -969
- package/src/schemas/config-1.0.11.schema.json +0 -990
- package/src/schemas/config-1.0.12.schema.json +0 -997
- package/src/schemas/config-1.0.13.schema.json +0 -1013
- package/src/schemas/config-1.0.14.schema.json +0 -1048
- package/src/schemas/config-1.0.15.schema.json +0 -1048
- package/src/schemas/config-1.0.16.schema.json +0 -1089
- package/src/schemas/config-1.0.2.schema.json +0 -911
- package/src/schemas/config-1.0.3.schema.json +0 -911
- package/src/schemas/config-1.0.4.schema.json +0 -949
- package/src/schemas/config-1.0.5.schema.json +0 -949
- package/src/schemas/config-1.0.6.schema.json +0 -950
- package/src/schemas/config-1.0.7.schema.json +0 -950
- package/src/schemas/config-1.0.8.schema.json +0 -966
- package/src/schemas/config-1.0.9.schema.json +0 -965
- package/src/schemas/obsSets.schema.js +0 -195
- package/src/schemas/obsSetsTabular.schema.js +0 -39
- package/src/schemas/raster.schema.js +0 -121
- package/src/schemas/schema-schema.sh +0 -34
package/dist-tsc/VitS.d.ts
CHANGED
|
@@ -13,10 +13,14 @@
|
|
|
13
13
|
* updates. Optional.
|
|
14
14
|
* @param {function} props.onLoaderChange A callback for loader
|
|
15
15
|
* updates. Optional.
|
|
16
|
+
* @param {boolean} props.validateConfig Whether to validate or not. Only to be
|
|
17
|
+
* set to false in controlled component situations, where bypassing validation
|
|
18
|
+
* is required for performance, and the parent knows the config
|
|
19
|
+
* is already valid (e.g., it originated from onConfigChange). By default, true.
|
|
16
20
|
* @param {boolean} props.validateOnConfigChange Whether to validate
|
|
17
21
|
* against the view config schema when publishing changes. Use for debugging
|
|
18
22
|
* purposes, as this may have a performance impact. By default, false.
|
|
19
|
-
* @param {
|
|
23
|
+
* @param {null|string} props.uid A unique identifier for this Vitessce instance,
|
|
20
24
|
* for the purpose of avoiding CSS autogenerated class name conflicts. Must be valid as part
|
|
21
25
|
* of a CSS class name string.
|
|
22
26
|
* @param {array} props.viewTypes Plugin view types.
|
|
@@ -34,8 +38,9 @@ export function VitS(props: {
|
|
|
34
38
|
onWarn: Function;
|
|
35
39
|
onConfigChange: Function;
|
|
36
40
|
onLoaderChange: Function;
|
|
41
|
+
validateConfig: boolean;
|
|
37
42
|
validateOnConfigChange: boolean;
|
|
38
|
-
uid:
|
|
43
|
+
uid: null | string;
|
|
39
44
|
viewTypes: array;
|
|
40
45
|
fileTypes: array;
|
|
41
46
|
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":"
|
|
1
|
+
{"version":3,"file":"VitS.d.ts","sourceRoot":"","sources":["../src/VitS.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH;IA7ByB,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;IAGE,SAAS;IACT,SAAS;IACT,cAAc;IACd,iBAAiB;IACX,OAAO,EAA1B,IAAI,GAAC,MAAM;gBAkLrB"}
|
package/dist-tsc/VitS.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useEffect, useMemo } from 'react';
|
|
3
|
-
import { ThemeProvider, StylesProvider,
|
|
2
|
+
import React, { useEffect, useMemo, useCallback } from 'react';
|
|
3
|
+
import { ThemeProvider, StylesProvider, } from '@material-ui/core';
|
|
4
|
+
import { QueryClient, QueryClientProvider, } from '@tanstack/react-query';
|
|
4
5
|
import { isEqual } from 'lodash-es';
|
|
5
|
-
import { META_VERSION } from '@vitessce/constants-internal';
|
|
6
6
|
import { buildConfigSchema, latestConfigSchema } from '@vitessce/schemas';
|
|
7
7
|
import { muiTheme } from './shared-mui/styles.js';
|
|
8
8
|
import { ViewConfigProvider, createViewConfigStore, AuxiliaryProvider, createAuxiliaryStore, } from './state/hooks.js';
|
|
9
9
|
import VitessceGrid from './VitessceGrid.js';
|
|
10
10
|
import { Warning } from './Warning.js';
|
|
11
11
|
import CallbackPublisher from './CallbackPublisher.js';
|
|
12
|
-
import { initialize, } from './view-config-utils.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
console.info(`data:,${JSON.stringify(config)}`);
|
|
16
|
-
console.info(JSON.stringify(config, null, 2));
|
|
17
|
-
console.groupEnd();
|
|
18
|
-
}
|
|
12
|
+
import { initialize, logConfig, } from './view-config-utils.js';
|
|
13
|
+
import { createLoaders } from './vitessce-grid-utils.js';
|
|
14
|
+
import { createGenerateClassName } from './mui-utils.js';
|
|
19
15
|
/**
|
|
20
16
|
* The Vitessce component.
|
|
21
17
|
* @param {object} props
|
|
@@ -31,10 +27,14 @@ function logConfig(config, name) {
|
|
|
31
27
|
* updates. Optional.
|
|
32
28
|
* @param {function} props.onLoaderChange A callback for loader
|
|
33
29
|
* updates. Optional.
|
|
30
|
+
* @param {boolean} props.validateConfig Whether to validate or not. Only to be
|
|
31
|
+
* set to false in controlled component situations, where bypassing validation
|
|
32
|
+
* is required for performance, and the parent knows the config
|
|
33
|
+
* is already valid (e.g., it originated from onConfigChange). By default, true.
|
|
34
34
|
* @param {boolean} props.validateOnConfigChange Whether to validate
|
|
35
35
|
* against the view config schema when publishing changes. Use for debugging
|
|
36
36
|
* purposes, as this may have a performance impact. By default, false.
|
|
37
|
-
* @param {
|
|
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
40
|
* @param {array} props.viewTypes Plugin view types.
|
|
@@ -45,19 +45,17 @@ function logConfig(config, name) {
|
|
|
45
45
|
* provided by the parent.
|
|
46
46
|
*/
|
|
47
47
|
export function VitS(props) {
|
|
48
|
-
const { config, rowHeight, height, theme, onWarn, onConfigChange, onLoaderChange, validateOnConfigChange = false, isBounded = false, uid, viewTypes: viewTypesProp, fileTypes: fileTypesProp, jointFileTypes: jointFileTypesProp, coordinationTypes: coordinationTypesProp, warning, } = props;
|
|
48
|
+
const { config, rowHeight, height, theme, onWarn, onConfigChange, onLoaderChange, validateConfig = true, validateOnConfigChange = false, isBounded = false, uid = null, viewTypes: viewTypesProp, fileTypes: fileTypesProp, jointFileTypes: jointFileTypesProp, coordinationTypes: coordinationTypesProp, warning, } = props;
|
|
49
49
|
const viewTypes = useMemo(() => (viewTypesProp || []), [viewTypesProp]);
|
|
50
50
|
const fileTypes = useMemo(() => (fileTypesProp || []), [fileTypesProp]);
|
|
51
51
|
const jointFileTypes = useMemo(() => (jointFileTypesProp || []), [jointFileTypesProp]);
|
|
52
52
|
const coordinationTypes = useMemo(() => (coordinationTypesProp || []), [coordinationTypesProp]);
|
|
53
|
-
const generateClassName = useMemo(() => createGenerateClassName(
|
|
54
|
-
disableGlobal: false,
|
|
55
|
-
// Avoid conflicts with portal-ui MUI class names,
|
|
56
|
-
// and allow setting a UID.
|
|
57
|
-
productionPrefix: (uid ? `vit${uid}` : 'vit'),
|
|
58
|
-
}), [uid]);
|
|
59
|
-
const configUid = config?.uid;
|
|
53
|
+
const generateClassName = useMemo(() => createGenerateClassName(uid), [uid]);
|
|
60
54
|
const configVersion = config?.version;
|
|
55
|
+
// If config.uid exists, then use it for hook dependencies to detect changes
|
|
56
|
+
// (controlled component case). If not, then use the config object itself
|
|
57
|
+
// and assume the un-controlled component case.
|
|
58
|
+
const configKey = config?.uid || config;
|
|
61
59
|
const pluginSpecificConfigSchema = useMemo(() => buildConfigSchema(fileTypes, jointFileTypes, coordinationTypes, viewTypes), [viewTypes, fileTypes, jointFileTypes, coordinationTypes]);
|
|
62
60
|
// Process the view config and memoize the result:
|
|
63
61
|
// - Validate.
|
|
@@ -69,10 +67,13 @@ export function VitS(props) {
|
|
|
69
67
|
return [warning, false];
|
|
70
68
|
}
|
|
71
69
|
logConfig(config, 'input view config');
|
|
70
|
+
if (!validateConfig) {
|
|
71
|
+
return [config, true];
|
|
72
|
+
}
|
|
72
73
|
const result = latestConfigSchema.safeParse(config);
|
|
73
74
|
if (result.success) {
|
|
74
75
|
const upgradedConfig = result.data;
|
|
75
|
-
logConfig(upgradedConfig, '
|
|
76
|
+
logConfig(upgradedConfig, 'parsed view config');
|
|
76
77
|
// Perform second round of parsing against plugin-specific config schema.
|
|
77
78
|
const pluginSpecificResult = pluginSpecificConfigSchema.safeParse(upgradedConfig);
|
|
78
79
|
// Initialize the view config according to the initStrategy.
|
|
@@ -106,7 +107,16 @@ export function VitS(props) {
|
|
|
106
107
|
unformatted: result.error.message,
|
|
107
108
|
}, result.success];
|
|
108
109
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
109
|
-
}, [
|
|
110
|
+
}, [configKey, configVersion, pluginSpecificConfigSchema, warning]);
|
|
111
|
+
const queryClient = useMemo(() => new QueryClient({
|
|
112
|
+
// Reference: https://tanstack.com/query/latest/docs/react/guides/window-focus-refetching
|
|
113
|
+
defaultOptions: {
|
|
114
|
+
queries: {
|
|
115
|
+
refetchOnWindowFocus: false,
|
|
116
|
+
retry: 2,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
}), [configKey]);
|
|
110
120
|
// Emit the upgraded/initialized view config
|
|
111
121
|
// to onConfigChange if necessary.
|
|
112
122
|
useEffect(() => {
|
|
@@ -114,6 +124,16 @@ export function VitS(props) {
|
|
|
114
124
|
onConfigChange(configOrWarning);
|
|
115
125
|
}
|
|
116
126
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
117
|
-
}, [success,
|
|
118
|
-
|
|
127
|
+
}, [success, configKey, configOrWarning, onConfigChange]);
|
|
128
|
+
// Initialize the view config and loaders in the global state.
|
|
129
|
+
const createViewConfigStoreClosure = useCallback(() => {
|
|
130
|
+
if (success) {
|
|
131
|
+
const loaders = createLoaders(configOrWarning.datasets, configOrWarning.description, fileTypes, coordinationTypes);
|
|
132
|
+
return createViewConfigStore(loaders, configOrWarning);
|
|
133
|
+
}
|
|
134
|
+
// No config found, so clear the loaders.
|
|
135
|
+
return createViewConfigStore(null, null);
|
|
136
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
137
|
+
}, [success, configKey]);
|
|
138
|
+
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 }), _jsx(CallbackPublisher, { onWarn: onWarn, onConfigChange: onConfigChange, onLoaderChange: onLoaderChange, validateOnConfigChange: validateOnConfigChange, pluginSpecificConfigSchema: pluginSpecificConfigSchema })] }) }, configKey) }) }) })) : (_jsx(StylesProvider, { generateClassName: generateClassName, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(Warning, { ...configOrWarning }) }) }));
|
|
119
139
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VitessceGrid.d.ts","sourceRoot":"","sources":["../src/VitessceGrid.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;;GAWG;AACH;IATyB,SAAS,EAAvB,MAAM;IACQ,MAAM,EAApB,MAAM;IACQ,KAAK,EAAnB,MAAM;IACQ,MAAM,EAApB,MAAM;IACU,MAAM;IACE,SAAS,EAAjC,gBAAgB;IACQ,SAAS,EAAjC,gBAAgB;IACgB,iBAAiB,EAAjD,wBAAwB;
|
|
1
|
+
{"version":3,"file":"VitessceGrid.d.ts","sourceRoot":"","sources":["../src/VitessceGrid.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;;GAWG;AACH;IATyB,SAAS,EAAvB,MAAM;IACQ,MAAM,EAApB,MAAM;IACQ,KAAK,EAAnB,MAAM;IACQ,MAAM,EAApB,MAAM;IACU,MAAM;IACE,SAAS,EAAjC,gBAAgB;IACQ,SAAS,EAAjC,gBAAgB;IACgB,iBAAiB,EAAjD,wBAAwB;gBAuFlC"}
|
package/dist-tsc/VitessceGrid.js
CHANGED
|
@@ -23,7 +23,7 @@ const margin = 5;
|
|
|
23
23
|
* @param {PluginCoordinationType[]} props.coordinationTypes
|
|
24
24
|
*/
|
|
25
25
|
export default function VitessceGrid(props) {
|
|
26
|
-
const { rowHeight: initialRowHeight, config, theme, height, isBounded, viewTypes, fileTypes, coordinationTypes, } = props;
|
|
26
|
+
const { success, configKey, rowHeight: initialRowHeight, config, theme, height, isBounded, viewTypes, fileTypes, coordinationTypes, } = props;
|
|
27
27
|
const [rowHeight, containerRef] = useRowHeight(config, initialRowHeight, height, margin, padding);
|
|
28
28
|
const onResize = useEmitGridResize();
|
|
29
29
|
const [componentWidth] = useClosestVitessceContainerSize(containerRef);
|
|
@@ -45,16 +45,19 @@ export default function VitessceGrid(props) {
|
|
|
45
45
|
}
|
|
46
46
|
}, [changeLayout, componentWidth]);
|
|
47
47
|
// Update the view config and loaders in the global state.
|
|
48
|
+
// This effect is needed for the controlled component case in which
|
|
49
|
+
// the store has already been initialized with a view config,
|
|
50
|
+
// and we want to replace it with a new view config.
|
|
48
51
|
useEffect(() => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
let newLoaders = null;
|
|
53
|
+
let newConfig = null;
|
|
54
|
+
if (success) {
|
|
55
|
+
newLoaders = createLoaders(config.datasets, config.description, fileTypes, coordinationTypes);
|
|
56
|
+
newConfig = config;
|
|
53
57
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return (_jsx("div", { ref: containerRef, className: clsx(VITESSCE_CONTAINER, classes.vitessceContainer), children: layout && (_jsx(VitessceGridLayout, { layout: layout, height: height, rowHeight: rowHeight, theme: theme, viewTypes: viewTypes, draggableHandle: titleClasses.title, margin: margin, padding: padding, onRemoveComponent: removeComponent, onLayoutChange: changeLayoutPostMount, isBounded: isBounded, onResize: onResize, onResizeStop: onResize })) }));
|
|
58
|
+
setViewConfig(newConfig);
|
|
59
|
+
setLoaders(newLoaders);
|
|
60
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
+
}, [success, configKey]);
|
|
62
|
+
return (_jsx("div", { ref: containerRef, className: clsx(VITESSCE_CONTAINER, classes.vitessceContainer), children: layout ? (_jsx(VitessceGridLayout, { layout: layout, height: height, rowHeight: rowHeight, theme: theme, viewTypes: viewTypes, draggableHandle: titleClasses.title, margin: margin, padding: padding, onRemoveComponent: removeComponent, onLayoutChange: changeLayoutPostMount, isBounded: isBounded, onResize: onResize, onResizeStop: onResize })) : null }));
|
|
60
63
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { describe, it, expect, afterEach } from 'vitest';
|
|
2
3
|
import '@testing-library/jest-dom';
|
|
3
4
|
import { cleanup, render, screen } from '@testing-library/react';
|
|
4
|
-
import { afterEach } from 'vitest';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { PluginViewType } from '@vitessce/plugins';
|
|
7
7
|
import VitessceGrid from './VitessceGrid.js';
|
|
@@ -27,13 +27,16 @@ describe('VitessceGrid.js', () => {
|
|
|
27
27
|
},
|
|
28
28
|
],
|
|
29
29
|
};
|
|
30
|
+
function createViewConfigStoreClosure() {
|
|
31
|
+
return createViewConfigStore(null, config);
|
|
32
|
+
}
|
|
30
33
|
function FakeComponent() {
|
|
31
34
|
return _jsx("p", { children: "FakeComponent!" });
|
|
32
35
|
}
|
|
33
36
|
const viewTypes = [new PluginViewType('FakeComponent', FakeComponent, [])];
|
|
34
37
|
const fileTypes = [];
|
|
35
38
|
const coordinationTypes = [];
|
|
36
|
-
render(_jsx(ViewConfigProvider, { createStore:
|
|
39
|
+
render(_jsx(ViewConfigProvider, { createStore: createViewConfigStoreClosure, children: _jsx(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: _jsx(VitessceGrid, { success: true, configKey: null, config: config, viewTypes: viewTypes, fileTypes: fileTypes, coordinationTypes: coordinationTypes }) }) }));
|
|
37
40
|
expect(await screen.findByText('FakeComponent!'));
|
|
38
41
|
});
|
|
39
42
|
});
|
package/dist-tsc/Warning.js
CHANGED
|
@@ -20,7 +20,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
20
20
|
row: {
|
|
21
21
|
flexGrow: '1',
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
warningCard: {
|
|
24
24
|
border: `1px solid ${theme.palette.cardBorder}`,
|
|
25
25
|
flex: '1 1 auto',
|
|
26
26
|
minHeight: '1px',
|
|
@@ -41,5 +41,5 @@ const useStyles = makeStyles(theme => ({
|
|
|
41
41
|
export function Warning(props) {
|
|
42
42
|
const { title, preformatted, unformatted, } = props;
|
|
43
43
|
const classes = useStyles();
|
|
44
|
-
return (_jsx("div", { className: VITESSCE_CONTAINER, children: _jsx("div", { className: clsx(classes.warningLayout, classes.containerFluid), children: _jsx("div", { className: classes.row, children: _jsxs("div", { className: classes.
|
|
44
|
+
return (_jsx("div", { className: VITESSCE_CONTAINER, children: _jsx("div", { className: clsx(classes.warningLayout, classes.containerFluid), children: _jsx("div", { className: classes.row, children: _jsxs("div", { className: classes.warningCard, children: [_jsx("h1", { children: title }), preformatted ? (_jsx("pre", { children: preformatted })) : null, _jsx("p", { children: unformatted })] }) }) }) }));
|
|
45
45
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export default class LoaderResult {
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @param {*} data
|
|
4
|
+
* @param {object[]|string|null} url Single URL or array of { url, name } objects.
|
|
5
|
+
* @param {object} coordinationValues
|
|
6
|
+
*/
|
|
7
|
+
constructor(data: any, url: object[] | string | null, coordinationValues?: object);
|
|
3
8
|
data: any;
|
|
4
|
-
url:
|
|
5
|
-
coordinationValues:
|
|
9
|
+
url: string | object[] | null;
|
|
10
|
+
coordinationValues: object;
|
|
6
11
|
}
|
|
7
12
|
//# sourceMappingURL=LoaderResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoaderResult.d.ts","sourceRoot":"","sources":["../../src/data/LoaderResult.js"],"names":[],"mappings":"AACA;IACE,
|
|
1
|
+
{"version":3,"file":"LoaderResult.d.ts","sourceRoot":"","sources":["../../src/data/LoaderResult.js"],"names":[],"mappings":"AACA;IACE;;;;OAIG;IACH,4BAHW,MAAM,EAAE,GAAC,MAAM,GAAC,IAAI,uBACpB,MAAM,EAMhB;IAHC,UAAgB;IAChB,8BAAc;IACd,2BAA4C;CAE/C"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export default class LoaderResult {
|
|
2
|
+
/**
|
|
3
|
+
* @param {*} data
|
|
4
|
+
* @param {object[]|string|null} url Single URL or array of { url, name } objects.
|
|
5
|
+
* @param {object} coordinationValues
|
|
6
|
+
*/
|
|
2
7
|
constructor(data, url, coordinationValues = null) {
|
|
3
8
|
this.data = data;
|
|
4
9
|
this.url = url;
|
|
@@ -25,8 +25,6 @@ export function initCoordinationSpace(values: object, setters: object, initialVa
|
|
|
25
25
|
* datasets and data types to loader instances.
|
|
26
26
|
* @param {string} dataset The key for a dataset,
|
|
27
27
|
* used to identify which loader to use.
|
|
28
|
-
* @param {function} addUrl A function to call to update
|
|
29
|
-
* the URL list.
|
|
30
28
|
* @param {boolean} isRequired Should a warning be thrown if
|
|
31
29
|
* loading is unsuccessful?
|
|
32
30
|
* @param {object} coordinationSetters Object where
|
|
@@ -35,11 +33,11 @@ export function initCoordinationSpace(values: object, setters: object, initialVa
|
|
|
35
33
|
* @param {object} initialCoordinationValues Object where
|
|
36
34
|
* keys are coordination type names with the prefix 'initialize',
|
|
37
35
|
* values are initialization preferences as boolean values.
|
|
38
|
-
* @returns {array} [
|
|
36
|
+
* @returns {array} [data, status, urls] where
|
|
39
37
|
* cells is an object and cellsCount is the
|
|
40
38
|
* number of items in the cells object.
|
|
41
39
|
*/
|
|
42
|
-
export function useDataType(dataType: any, loaders: object, dataset: string,
|
|
40
|
+
export function useDataType(dataType: any, loaders: object, dataset: string, isRequired: boolean, coordinationSetters: object, initialCoordinationValues: object, matchOn: any): array;
|
|
43
41
|
/**
|
|
44
42
|
* Get data from a cells data type loader,
|
|
45
43
|
* updating "ready" and URL state appropriately.
|
|
@@ -49,8 +47,6 @@ export function useDataType(dataType: any, loaders: object, dataset: string, add
|
|
|
49
47
|
* datasets and data types to loader instances.
|
|
50
48
|
* @param {string} dataset The key for a dataset,
|
|
51
49
|
* used to identify which loader to use.
|
|
52
|
-
* @param {function} addUrl A function to call to update
|
|
53
|
-
* the URL list.
|
|
54
50
|
* @param {boolean} isRequired Should a warning be thrown if
|
|
55
51
|
* loading is unsuccessful?
|
|
56
52
|
* @param {object} coordinationSetters Object where
|
|
@@ -63,7 +59,7 @@ export function useDataType(dataType: any, loaders: object, dataset: string, add
|
|
|
63
59
|
* cells is an object and cellsCount is the
|
|
64
60
|
* number of items in the cells object.
|
|
65
61
|
*/
|
|
66
|
-
export function useDataTypeMulti(dataType: any, loaders: object, dataset: string,
|
|
62
|
+
export function useDataTypeMulti(dataType: any, loaders: object, dataset: string, isRequired: boolean, coordinationSetters: object, initialCoordinationValues: object, matchOnObj: any): array;
|
|
67
63
|
export function useHasLoader(loaders: any, dataset: any, dataType: any, matchOn: any): boolean;
|
|
68
64
|
import { AbstractLoaderError } from "./errors/index.js";
|
|
69
65
|
//# sourceMappingURL=data-hook-utils.d.ts.map
|
|
@@ -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":"AAcA;;;;GAIG;AACH,4BAFW,mBAAmB,yBAS7B;AAED;;;;;;;;;;GAUG;AACH,8CATW,MAAM,WAGN,MAAM,iBAGN,MAAM,QAiBhB;AA4BD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oDAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,uBA+ChB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,yDAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,0BAkEhB;AAED,+FAGC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { capitalize } from '@vitessce/utils';
|
|
1
|
+
import { useEffect, useMemo } from 'react';
|
|
2
|
+
import { capitalize, fromEntries } from '@vitessce/utils';
|
|
3
3
|
import { STATUS } from '@vitessce/constants-internal';
|
|
4
|
-
import {
|
|
4
|
+
import { useQuery, useQueries } from '@tanstack/react-query';
|
|
5
|
+
import { getMatchingLoader, useMatchingLoader, useSetWarning, } from './state/hooks.js';
|
|
5
6
|
import { AbstractLoaderError, LoaderNotFoundError, } from './errors/index.js';
|
|
6
7
|
/**
|
|
7
8
|
* Warn via publishing to the console
|
|
@@ -42,6 +43,32 @@ export function initCoordinationSpace(values, setters, initialValues) {
|
|
|
42
43
|
}
|
|
43
44
|
});
|
|
44
45
|
}
|
|
46
|
+
async function dataQueryFn(ctx) {
|
|
47
|
+
const { placeholderObject, loaders } = ctx.meta;
|
|
48
|
+
// This ordering of the queryKey must match.
|
|
49
|
+
const [dataset, dataType, matchOn, isRequired] = ctx.queryKey;
|
|
50
|
+
const loader = getMatchingLoader(loaders, dataset, dataType, matchOn);
|
|
51
|
+
if (loader) {
|
|
52
|
+
// TODO: can cacheing logic be removed from all loaders?
|
|
53
|
+
const payload = await loader.load();
|
|
54
|
+
if (!payload)
|
|
55
|
+
return placeholderObject; // TODO: throw error instead?
|
|
56
|
+
const { data, url, coordinationValues } = payload;
|
|
57
|
+
// Status: success
|
|
58
|
+
// Array of objects like { url, name }.
|
|
59
|
+
const urls = Array.isArray(url) ? url : [{ url, name: dataType }];
|
|
60
|
+
return { data, coordinationValues, urls };
|
|
61
|
+
}
|
|
62
|
+
// No loader was found.
|
|
63
|
+
if (isRequired) {
|
|
64
|
+
// Status: error
|
|
65
|
+
throw new LoaderNotFoundError(loaders, dataset, dataType, matchOn);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// Status: success
|
|
69
|
+
return { data: placeholderObject };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
45
72
|
/**
|
|
46
73
|
* Get data from a cells data type loader,
|
|
47
74
|
* updating "ready" and URL state appropriately.
|
|
@@ -51,8 +78,6 @@ export function initCoordinationSpace(values, setters, initialValues) {
|
|
|
51
78
|
* datasets and data types to loader instances.
|
|
52
79
|
* @param {string} dataset The key for a dataset,
|
|
53
80
|
* used to identify which loader to use.
|
|
54
|
-
* @param {function} addUrl A function to call to update
|
|
55
|
-
* the URL list.
|
|
56
81
|
* @param {boolean} isRequired Should a warning be thrown if
|
|
57
82
|
* loading is unsuccessful?
|
|
58
83
|
* @param {object} coordinationSetters Object where
|
|
@@ -61,48 +86,39 @@ export function initCoordinationSpace(values, setters, initialValues) {
|
|
|
61
86
|
* @param {object} initialCoordinationValues Object where
|
|
62
87
|
* keys are coordination type names with the prefix 'initialize',
|
|
63
88
|
* values are initialization preferences as boolean values.
|
|
64
|
-
* @returns {array} [
|
|
89
|
+
* @returns {array} [data, status, urls] where
|
|
65
90
|
* cells is an object and cellsCount is the
|
|
66
91
|
* number of items in the cells object.
|
|
67
92
|
*/
|
|
68
|
-
export function useDataType(dataType, loaders, dataset,
|
|
69
|
-
const [data, setData] = useState({});
|
|
70
|
-
const [status, setStatus] = useState(STATUS.LOADING);
|
|
93
|
+
export function useDataType(dataType, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn) {
|
|
71
94
|
const setWarning = useSetWarning();
|
|
72
|
-
const
|
|
95
|
+
const placeholderObject = useMemo(() => ({}), []);
|
|
96
|
+
const dataQuery = useQuery({
|
|
97
|
+
// TODO: only enable when loaders has been initialized?
|
|
98
|
+
structuralSharing: false,
|
|
99
|
+
placeholderData: placeholderObject,
|
|
100
|
+
// Include the hook name in the queryKey to prevent the case in which an identical queryKey
|
|
101
|
+
// in a different hook would cause an accidental cache hit.
|
|
102
|
+
queryKey: [dataset, dataType, matchOn, isRequired, 'useDataType'],
|
|
103
|
+
// Query function should return an object
|
|
104
|
+
// { data, dataKey } where dataKey is the loaded gene selection.
|
|
105
|
+
queryFn: dataQueryFn,
|
|
106
|
+
meta: { loaders, placeholderObject },
|
|
107
|
+
});
|
|
108
|
+
const { data, status, isFetching, error } = dataQuery;
|
|
109
|
+
const loadedData = data?.data || placeholderObject;
|
|
110
|
+
const coordinationValues = data?.coordinationValues;
|
|
111
|
+
const urls = data?.urls;
|
|
73
112
|
useEffect(() => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const { data: payloadData, url, coordinationValues } = payload;
|
|
80
|
-
setData(payloadData);
|
|
81
|
-
if (Array.isArray(url)) {
|
|
82
|
-
url.forEach(([val, name]) => {
|
|
83
|
-
addUrl(val, name);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
else if (url) {
|
|
87
|
-
addUrl(url, dataType);
|
|
88
|
-
}
|
|
89
|
-
initCoordinationSpace(coordinationValues, coordinationSetters, initialCoordinationValues);
|
|
90
|
-
setStatus(STATUS.SUCCESS);
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
setData({});
|
|
95
|
-
if (isRequired) {
|
|
96
|
-
warn(new LoaderNotFoundError(loaders, dataset, dataType, matchOn), setWarning);
|
|
97
|
-
setStatus(STATUS.ERROR);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
setStatus(STATUS.SUCCESS);
|
|
101
|
-
}
|
|
113
|
+
initCoordinationSpace(coordinationValues, coordinationSetters, initialCoordinationValues);
|
|
114
|
+
}, [coordinationValues]);
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (error) {
|
|
117
|
+
warn(error, setWarning);
|
|
102
118
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return [
|
|
119
|
+
}, [error, setWarning]);
|
|
120
|
+
const dataStatus = isFetching ? STATUS.LOADING : status;
|
|
121
|
+
return [loadedData, dataStatus, urls];
|
|
106
122
|
}
|
|
107
123
|
/**
|
|
108
124
|
* Get data from a cells data type loader,
|
|
@@ -113,8 +129,6 @@ export function useDataType(dataType, loaders, dataset, addUrl, isRequired, coor
|
|
|
113
129
|
* datasets and data types to loader instances.
|
|
114
130
|
* @param {string} dataset The key for a dataset,
|
|
115
131
|
* used to identify which loader to use.
|
|
116
|
-
* @param {function} addUrl A function to call to update
|
|
117
|
-
* the URL list.
|
|
118
132
|
* @param {boolean} isRequired Should a warning be thrown if
|
|
119
133
|
* loading is unsuccessful?
|
|
120
134
|
* @param {object} coordinationSetters Object where
|
|
@@ -127,45 +141,49 @@ export function useDataType(dataType, loaders, dataset, addUrl, isRequired, coor
|
|
|
127
141
|
* cells is an object and cellsCount is the
|
|
128
142
|
* number of items in the cells object.
|
|
129
143
|
*/
|
|
130
|
-
export function useDataTypeMulti(dataType, loaders, dataset,
|
|
131
|
-
const
|
|
132
|
-
const [status, setStatus] = useState(STATUS.LOADING);
|
|
144
|
+
export function useDataTypeMulti(dataType, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOnObj) {
|
|
145
|
+
const placeholderObject = useMemo(() => ({}), []);
|
|
133
146
|
const setWarning = useSetWarning();
|
|
134
|
-
const
|
|
147
|
+
const matchOnEntries = matchOnObj ? Object.entries(matchOnObj) : [];
|
|
148
|
+
const dataQueries = useQueries({
|
|
149
|
+
// eslint-disable-next-line no-unused-vars
|
|
150
|
+
queries: matchOnEntries.map(([scopeKey, matchOn]) => ({
|
|
151
|
+
structuralSharing: false,
|
|
152
|
+
placeholderData: placeholderObject,
|
|
153
|
+
// Query key should match useDataType for shared cacheing
|
|
154
|
+
// and correctness of dataQueryFn.
|
|
155
|
+
queryKey: [dataset, dataType, matchOn, isRequired, 'useDataType'],
|
|
156
|
+
// Query function should return an object
|
|
157
|
+
// { data, dataKey } where dataKey is the loaded gene selection.
|
|
158
|
+
queryFn: dataQueryFn,
|
|
159
|
+
meta: { loaders, placeholderObject },
|
|
160
|
+
})),
|
|
161
|
+
});
|
|
162
|
+
const anyLoading = dataQueries.some(q => q.isFetching);
|
|
163
|
+
const anyError = dataQueries.some(q => q.isError);
|
|
164
|
+
// eslint-disable-next-line no-nested-ternary
|
|
165
|
+
const dataStatus = anyLoading ? STATUS.LOADING : (anyError ? STATUS.ERROR : STATUS.SUCCESS);
|
|
166
|
+
const isSuccess = dataStatus === STATUS.SUCCESS;
|
|
135
167
|
useEffect(() => {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
initCoordinationSpace(coordinationValues, coordinationSetters, initialCoordinationValues);
|
|
151
|
-
setStatus(STATUS.SUCCESS);
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
setData({});
|
|
158
|
-
if (isRequired) {
|
|
159
|
-
warn(new LoaderNotFoundError(loaders, dataset, dataType, matchOnObj), setWarning);
|
|
160
|
-
setStatus(STATUS.ERROR);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
setStatus(STATUS.SUCCESS);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
168
|
+
dataQueries
|
|
169
|
+
.map(q => q.data?.coordinationValues)
|
|
170
|
+
.filter(v => Boolean(v))
|
|
171
|
+
.forEach((coordinationValues) => {
|
|
172
|
+
initCoordinationSpace(coordinationValues, coordinationSetters, initialCoordinationValues);
|
|
173
|
+
});
|
|
174
|
+
// Deliberate dependency omissions: use indirect dependencies for efficiency.
|
|
175
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
176
|
+
}, [isSuccess]);
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
dataQueries.map(q => q.error).filter(e => Boolean(e)).forEach((error) => {
|
|
179
|
+
warn(error, setWarning);
|
|
180
|
+
});
|
|
181
|
+
// Deliberate dependency omissions: use indirect dependencies for efficiency.
|
|
166
182
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
167
|
-
}, [
|
|
168
|
-
|
|
183
|
+
}, [anyError, setWarning]);
|
|
184
|
+
// Convert data to object keyed by scopeKey.
|
|
185
|
+
const data = useMemo(() => fromEntries(matchOnEntries.map(([scopeKey], i) => ([scopeKey, dataQueries[i].data?.data]))), [dataQueries]);
|
|
186
|
+
return [data, dataStatus];
|
|
169
187
|
}
|
|
170
188
|
export function useHasLoader(loaders, dataset, dataType, matchOn) {
|
|
171
189
|
const loader = useMatchingLoader(loaders, dataset, dataType, matchOn);
|
package/dist-tsc/data-hooks.d.ts
CHANGED
|
@@ -17,8 +17,6 @@ export function useDescription(loaders: object, dataset: string): array;
|
|
|
17
17
|
* datasets and data types to loader instances.
|
|
18
18
|
* @param {string} dataset The key for a dataset,
|
|
19
19
|
* used to identify which loader to use.
|
|
20
|
-
* @param {function} addUrl A function to call to update
|
|
21
|
-
* the URL list.
|
|
22
20
|
* @param {boolean} isRequired Should a warning be thrown if
|
|
23
21
|
* loading is unsuccessful?
|
|
24
22
|
* @param {object} coordinationSetters Object where
|
|
@@ -31,16 +29,16 @@ export function useDescription(loaders: object, dataset: string): array;
|
|
|
31
29
|
* cells is an object and cellsCount is the
|
|
32
30
|
* number of items in the cells object.
|
|
33
31
|
*/
|
|
34
|
-
export function useObsEmbeddingData(loaders: object, dataset: string,
|
|
35
|
-
export function useObsLocationsData(loaders: any, dataset: any,
|
|
36
|
-
export function useObsLabelsData(loaders: any, dataset: any,
|
|
37
|
-
export function useObsSegmentationsData(loaders: any, dataset: any,
|
|
38
|
-
export function useObsSetsData(loaders: any, dataset: any,
|
|
39
|
-
export function useObsFeatureMatrixData(loaders: any, dataset: any,
|
|
40
|
-
export function useFeatureLabelsData(loaders: any, dataset: any,
|
|
41
|
-
export function useImageData(loaders: any, dataset: any,
|
|
42
|
-
export function useGenomicProfilesData(loaders: any, dataset: any,
|
|
43
|
-
export function useNeighborhoodsData(loaders: any, dataset: any,
|
|
32
|
+
export function useObsEmbeddingData(loaders: object, dataset: string, isRequired: boolean, coordinationSetters: object, initialCoordinationValues: object, matchOn: any): array;
|
|
33
|
+
export function useObsLocationsData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
34
|
+
export function useObsLabelsData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
35
|
+
export function useObsSegmentationsData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
36
|
+
export function useObsSetsData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
37
|
+
export function useObsFeatureMatrixData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
38
|
+
export function useFeatureLabelsData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
39
|
+
export function useImageData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
40
|
+
export function useGenomicProfilesData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
41
|
+
export function useNeighborhoodsData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
44
42
|
/**
|
|
45
43
|
* Get data from the expression matrix data type loader for a given gene selection.
|
|
46
44
|
* Throw warnings if the data is marked as required.
|
|
@@ -66,12 +64,10 @@ export function useFeatureSelection(loaders: object, dataset: string, isRequired
|
|
|
66
64
|
* datasets and data types to loader instances.
|
|
67
65
|
* @param {string} dataset The key for a dataset,
|
|
68
66
|
* used to identify which loader to use.
|
|
69
|
-
* @param {function} addUrl A function to call to update
|
|
70
|
-
* the URL list.
|
|
71
67
|
* @param {boolean} isRequired Should a warning be thrown if
|
|
72
68
|
* loading is unsuccessful?
|
|
73
69
|
* @returns {object} [attrs] { rows, cols } object containing cell and gene names.
|
|
74
70
|
*/
|
|
75
|
-
export function useObsFeatureMatrixIndices(loaders: object, dataset: string,
|
|
76
|
-
export function useMultiObsLabels(coordinationScopes: any, obsType: any, loaders: any, dataset: any
|
|
71
|
+
export function useObsFeatureMatrixIndices(loaders: object, dataset: string, isRequired: boolean, matchOn: any): object;
|
|
72
|
+
export function useMultiObsLabels(coordinationScopes: any, obsType: any, loaders: any, dataset: any): any[];
|
|
77
73
|
//# sourceMappingURL=data-hooks.d.ts.map
|
|
@@ -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,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,CAyElB;AAED,4GAoBC"}
|