@vitessce/vit-s 3.5.6 → 3.5.8
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 +768 -111
- package/dist-tsc/CallbackPublisher.js +2 -1
- package/dist-tsc/DebugWindow.d.ts +4 -0
- package/dist-tsc/DebugWindow.d.ts.map +1 -0
- package/dist-tsc/DebugWindow.js +9 -0
- package/dist-tsc/FallbackForView.d.ts +2 -0
- package/dist-tsc/FallbackForView.d.ts.map +1 -0
- package/dist-tsc/FallbackForView.js +13 -0
- package/dist-tsc/FallbackForVitS.d.ts +2 -0
- package/dist-tsc/FallbackForVitS.d.ts.map +1 -0
- package/dist-tsc/FallbackForVitS.js +12 -0
- package/dist-tsc/VitS.d.ts +4 -0
- package/dist-tsc/VitS.d.ts.map +1 -1
- package/dist-tsc/VitS.js +21 -2
- package/dist-tsc/VitSContainer.d.ts +9 -0
- package/dist-tsc/VitSContainer.d.ts.map +1 -0
- package/dist-tsc/VitSContainer.js +15 -0
- package/dist-tsc/Warning.d.ts.map +1 -1
- package/dist-tsc/Warning.js +1 -37
- package/dist-tsc/data-hook-utils.d.ts.map +1 -1
- package/dist-tsc/data-hook-utils.js +3 -2
- package/dist-tsc/data-hooks.d.ts +22 -0
- package/dist-tsc/data-hooks.d.ts.map +1 -1
- package/dist-tsc/data-hooks.js +90 -0
- package/dist-tsc/hooks.d.ts +9 -0
- package/dist-tsc/hooks.d.ts.map +1 -1
- package/dist-tsc/hooks.js +29 -1
- package/dist-tsc/index.d.ts +3 -2
- package/dist-tsc/index.js +3 -2
- package/dist-tsc/shared-warning-styles.d.ts +2 -0
- package/dist-tsc/shared-warning-styles.d.ts.map +1 -0
- package/dist-tsc/shared-warning-styles.js +37 -0
- package/dist-tsc/view-config-utils.d.ts.map +1 -1
- package/dist-tsc/view-config-utils.js +7 -4
- package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.d.ts.map +1 -1
- package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.js +8 -6
- package/dist-tsc/vitessce-grid-utils.js +2 -1
- package/package.json +11 -9
- package/src/CallbackPublisher.js +2 -2
- package/src/DebugWindow.js +35 -0
- package/src/FallbackForView.js +23 -0
- package/src/FallbackForVitS.js +21 -0
- package/src/VitS.js +31 -2
- package/src/VitSContainer.js +19 -0
- package/src/Warning.js +1 -38
- package/src/data-hook-utils.js +3 -2
- package/src/data-hooks.js +122 -0
- package/src/hooks.js +32 -1
- package/src/index.js +7 -0
- package/src/shared-warning-styles.js +38 -0
- package/src/view-config-utils.js +7 -4
- package/src/vitessce-grid-layout/VitessceGridLayout.js +32 -26
- package/src/vitessce-grid-utils.js +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
+
import { log } from '@vitessce/globals';
|
|
2
3
|
import { useViewConfigStoreApi, useLoaders, useWarning } from './state/hooks.js';
|
|
3
4
|
function validateViewConfig(viewConfig, pluginSpecificConfigSchema) {
|
|
4
5
|
// Need the try-catch here since Zustand will actually
|
|
@@ -7,7 +8,7 @@ function validateViewConfig(viewConfig, pluginSpecificConfigSchema) {
|
|
|
7
8
|
pluginSpecificConfigSchema.parse(viewConfig);
|
|
8
9
|
}
|
|
9
10
|
catch (e) {
|
|
10
|
-
|
|
11
|
+
log.error(e);
|
|
11
12
|
}
|
|
12
13
|
// Do nothing if successful.
|
|
13
14
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DebugWindow.d.ts","sourceRoot":"","sources":["../src/DebugWindow.js"],"names":[],"mappings":"AAIA;;gCA8BC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { useStyles } from './shared-warning-styles.js';
|
|
4
|
+
import { VITESSCE_CONTAINER } from './classNames.js';
|
|
5
|
+
export function DebugWindow({ debugErrors }) {
|
|
6
|
+
const classes = useStyles();
|
|
7
|
+
return (_jsx("div", { className: VITESSCE_CONTAINER, children: _jsx("div", { className: clsx(classes.warningLayout, classes.containerFluid), children: _jsx("div", { className: classes.row, children: _jsx("div", { className: classes.warningCard, children: debugErrors.map((error, index) => (_jsxs("div", { children: [index === 0 && (_jsxs("div", { children: [_jsxs("h1", { children: ["Error Type: ", error.name] }), Object.keys(error).map(key => key !== 'name'
|
|
8
|
+
&& key !== 'message' && (_jsxs("p", { children: [key.charAt(0).toUpperCase() + key.slice(1), ": ", error[key]] }, key)))] })), _jsxs("p", { children: ["Error: ", error.message] })] }, error.message || index))) }) }) }) }));
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FallbackForView.d.ts","sourceRoot":"","sources":["../src/FallbackForView.js"],"names":[],"mappings":"AAOA,yDAeC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { getDebugMode } from '@vitessce/globals';
|
|
4
|
+
// TODO: Improve styling - perhaps style similar to ./TitleInfo.js
|
|
5
|
+
// TODO: Display different info depending on the type of error
|
|
6
|
+
// Reference: https://github.com/bvaughn/react-error-boundary?tab=readme-ov-file#errorboundary-with-fallbackcomponent-prop
|
|
7
|
+
export function FallbackForView(props) {
|
|
8
|
+
const { error,
|
|
9
|
+
// Call resetErrorBoundary() to reset the error boundary and retry the render.
|
|
10
|
+
// resetErrorBoundary,
|
|
11
|
+
} = props;
|
|
12
|
+
return (_jsxs("div", { children: [_jsx("p", { children: "A view-level error occurred." }), getDebugMode() ? (_jsx("pre", { style: { color: 'red' }, children: error.message })) : null] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FallbackForVitS.d.ts","sourceRoot":"","sources":["../src/FallbackForVitS.js"],"names":[],"mappings":"AAMA,yDAcC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// TODO: Improve styling - see ./DebugWindow.js
|
|
4
|
+
// TODO: Display different info depending on the type of error
|
|
5
|
+
// Reference: https://github.com/bvaughn/react-error-boundary?tab=readme-ov-file#errorboundary-with-fallbackcomponent-prop
|
|
6
|
+
export function FallbackForVitS(props) {
|
|
7
|
+
const { error,
|
|
8
|
+
// Call resetErrorBoundary() to reset the error boundary and retry the render.
|
|
9
|
+
// resetErrorBoundary,
|
|
10
|
+
} = props;
|
|
11
|
+
return (_jsxs("div", { children: [_jsx("p", { children: "Error:" }), _jsx("pre", { style: { color: 'red' }, children: error.message })] }));
|
|
12
|
+
}
|
package/dist-tsc/VitS.d.ts
CHANGED
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
* @param {array} props.coordinationTypes Plugin coordination types.
|
|
32
32
|
* @param {null|object} props.warning A warning to render within the Vitessce grid,
|
|
33
33
|
* @param {boolean} props.pageMode Whether to render in page mode. By default, false.
|
|
34
|
+
* @param {boolean} props.debugMode Whether to display the debugWindow. By default, false.
|
|
35
|
+
* @param {null|string} props.logLevel To set the log level in the console.
|
|
34
36
|
* provided by the parent.
|
|
35
37
|
*/
|
|
36
38
|
export function VitS(props: {
|
|
@@ -51,5 +53,7 @@ export function VitS(props: {
|
|
|
51
53
|
coordinationTypes: array;
|
|
52
54
|
warning: null | object;
|
|
53
55
|
pageMode: boolean;
|
|
56
|
+
debugMode: boolean;
|
|
57
|
+
logLevel: null | string;
|
|
54
58
|
}): JSX.Element;
|
|
55
59
|
//# sourceMappingURL=VitS.d.ts.map
|
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":"AAoCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,4BAlCG;IAAsB,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,EAAtB,KAAK;IACQ,SAAS,EAAtB,KAAK;IACQ,cAAc,EAA3B,KAAK;IACQ,iBAAiB,EAA9B,KAAK;IACc,OAAO,EAA1B,IAAI,GAAC,MAAM;IACI,QAAQ,EAAvB,OAAO;IACQ,SAAS,EAAxB,OAAO;IACY,QAAQ,EAA3B,IAAI,GAAC,MAAM;CAErB,eA2OA"}
|
package/dist-tsc/VitS.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useEffect, useMemo, useCallback } from 'react';
|
|
2
|
+
import React, { useState, useEffect, useMemo, useCallback, useLayoutEffect } from 'react';
|
|
3
3
|
import { ThemeProvider, StylesProvider, } from '@material-ui/core';
|
|
4
4
|
import { QueryClient, QueryClientProvider, } from '@tanstack/react-query';
|
|
5
5
|
import { isEqual } from 'lodash-es';
|
|
6
6
|
import { buildConfigSchema, latestConfigSchema } from '@vitessce/schemas';
|
|
7
|
+
import { setLogLevel, setDebugMode, DEFAULT_LOG_LEVEL, DEFAULT_DEBUG_MODE, } from '@vitessce/globals';
|
|
7
8
|
import { muiTheme } from './shared-mui/styles.js';
|
|
8
9
|
import { ViewConfigProvider, createViewConfigStore, AuxiliaryProvider, createAuxiliaryStore, } from './state/hooks.js';
|
|
9
10
|
import VitessceGrid from './VitessceGrid.js';
|
|
10
11
|
import { Warning } from './Warning.js';
|
|
12
|
+
import { DebugWindow } from './DebugWindow.js';
|
|
11
13
|
import CallbackPublisher from './CallbackPublisher.js';
|
|
12
14
|
import { initialize, logConfig, } from './view-config-utils.js';
|
|
13
15
|
import { createLoaders } from './vitessce-grid-utils.js';
|
|
@@ -46,15 +48,26 @@ import { AsyncFunctionsContext } from './contexts.js';
|
|
|
46
48
|
* @param {array} props.coordinationTypes Plugin coordination types.
|
|
47
49
|
* @param {null|object} props.warning A warning to render within the Vitessce grid,
|
|
48
50
|
* @param {boolean} props.pageMode Whether to render in page mode. By default, false.
|
|
51
|
+
* @param {boolean} props.debugMode Whether to display the debugWindow. By default, false.
|
|
52
|
+
* @param {null|string} props.logLevel To set the log level in the console.
|
|
49
53
|
* provided by the parent.
|
|
50
54
|
*/
|
|
51
55
|
export function VitS(props) {
|
|
52
|
-
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, asyncFunctions: asyncFunctionsProp, warning, pageMode = false, children, } = props;
|
|
56
|
+
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, asyncFunctions: asyncFunctionsProp, warning, pageMode = false, children, debugMode = DEFAULT_DEBUG_MODE, logLevel = DEFAULT_LOG_LEVEL, } = props;
|
|
57
|
+
// eslint-disable-next-line no-unused-vars
|
|
58
|
+
const [debugErrors, setDebugErrors] = useState([]);
|
|
53
59
|
const viewTypes = useMemo(() => (viewTypesProp || []), [viewTypesProp]);
|
|
54
60
|
const fileTypes = useMemo(() => (fileTypesProp || []), [fileTypesProp]);
|
|
55
61
|
const jointFileTypes = useMemo(() => (jointFileTypesProp || []), [jointFileTypesProp]);
|
|
56
62
|
const coordinationTypes = useMemo(() => (coordinationTypesProp || []), [coordinationTypesProp]);
|
|
57
63
|
const generateClassName = useMemo(() => createGenerateClassName(uid), [uid]);
|
|
64
|
+
// Set error handling-related globals.
|
|
65
|
+
useLayoutEffect(() => {
|
|
66
|
+
setLogLevel(logLevel);
|
|
67
|
+
}, [logLevel]);
|
|
68
|
+
useLayoutEffect(() => {
|
|
69
|
+
setDebugMode(debugMode);
|
|
70
|
+
}, [debugMode]);
|
|
58
71
|
const configVersion = config?.version;
|
|
59
72
|
// If config.uid exists, then use it for hook dependencies to detect changes
|
|
60
73
|
// (controlled component case). If not, then use the config object itself
|
|
@@ -156,5 +169,11 @@ export function VitS(props) {
|
|
|
156
169
|
return createViewConfigStore(null, null);
|
|
157
170
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
158
171
|
}, [success, configKey]);
|
|
172
|
+
// TODO: use in ErrorBoundary fallback.
|
|
173
|
+
// Will probably need to move a lot to a child of VitS
|
|
174
|
+
// so that when the child throws errors the parent can catch.
|
|
175
|
+
if (debugMode && debugErrors.length > 0) {
|
|
176
|
+
return (_jsx(StylesProvider, { generateClassName: generateClassName, children: _jsx(ThemeProvider, { theme: muiTheme[theme], children: _jsx(DebugWindow, { debugErrors: debugErrors }) }) }));
|
|
177
|
+
}
|
|
159
178
|
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: _jsx(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: _jsxs(AsyncFunctionsContext.Provider, { value: asyncFunctions, children: [_jsx(VitessceGrid, { pageMode: pageMode, success: success, configKey: configKey, viewTypes: viewTypes, fileTypes: fileTypes, coordinationTypes: coordinationTypes, config: configOrWarning, rowHeight: rowHeight, height: height, theme: theme, isBounded: isBounded, stores: stores, children: children }), _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 }) }) }));
|
|
160
179
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This serves as a way to wrap VitS in a React ErrorBoundary.
|
|
3
|
+
* Since there is a lot of logic within the VitS component,
|
|
4
|
+
* we want the ErrorBoundary to be a parent (as opposed to a child)
|
|
5
|
+
* of the VitS component.
|
|
6
|
+
* @param {*} props All props will be passed down to VitS.
|
|
7
|
+
*/
|
|
8
|
+
export function VitSContainer(props: any): JSX.Element;
|
|
9
|
+
//# sourceMappingURL=VitSContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VitSContainer.d.ts","sourceRoot":"","sources":["../src/VitSContainer.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,qCAFW,GAAC,eAQX"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
4
|
+
import { FallbackForVitS } from './FallbackForVitS.js';
|
|
5
|
+
import { VitS } from './VitS.js';
|
|
6
|
+
/**
|
|
7
|
+
* This serves as a way to wrap VitS in a React ErrorBoundary.
|
|
8
|
+
* Since there is a lot of logic within the VitS component,
|
|
9
|
+
* we want the ErrorBoundary to be a parent (as opposed to a child)
|
|
10
|
+
* of the VitS component.
|
|
11
|
+
* @param {*} props All props will be passed down to VitS.
|
|
12
|
+
*/
|
|
13
|
+
export function VitSContainer(props) {
|
|
14
|
+
return (_jsx(ErrorBoundary, { FallbackComponent: FallbackForVitS, children: _jsx(VitS, { ...props }) }));
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Warning.d.ts","sourceRoot":"","sources":["../src/Warning.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Warning.d.ts","sourceRoot":"","sources":["../src/Warning.js"],"names":[],"mappings":"AAIA,iEAoBC"}
|
package/dist-tsc/Warning.js
CHANGED
|
@@ -1,43 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import {
|
|
3
|
+
import { useStyles } from './shared-warning-styles.js';
|
|
4
4
|
import { VITESSCE_CONTAINER } from './classNames.js';
|
|
5
|
-
const useStyles = makeStyles(theme => ({
|
|
6
|
-
warningLayout: {
|
|
7
|
-
backgroundColor: theme.palette.gridLayoutBackground,
|
|
8
|
-
position: 'absolute',
|
|
9
|
-
width: '100%',
|
|
10
|
-
height: '100vh',
|
|
11
|
-
},
|
|
12
|
-
containerFluid: {
|
|
13
|
-
width: '100%',
|
|
14
|
-
padding: '15px',
|
|
15
|
-
marginRight: 'auto',
|
|
16
|
-
marginLeft: 'auto',
|
|
17
|
-
boxSizing: 'border-box',
|
|
18
|
-
display: 'flex',
|
|
19
|
-
},
|
|
20
|
-
row: {
|
|
21
|
-
flexGrow: '1',
|
|
22
|
-
},
|
|
23
|
-
warningCard: {
|
|
24
|
-
border: `1px solid ${theme.palette.cardBorder}`,
|
|
25
|
-
flex: '1 1 auto',
|
|
26
|
-
minHeight: '1px',
|
|
27
|
-
padding: '12px',
|
|
28
|
-
marginTop: '8px',
|
|
29
|
-
marginBottom: '8px',
|
|
30
|
-
position: 'relative',
|
|
31
|
-
display: 'flex',
|
|
32
|
-
flexDirection: 'column',
|
|
33
|
-
minWidth: '0',
|
|
34
|
-
wordWrap: 'break-word',
|
|
35
|
-
backgroundClip: 'border-box',
|
|
36
|
-
borderRadius: '4px',
|
|
37
|
-
backgroundColor: theme.palette.primaryBackground,
|
|
38
|
-
color: theme.palette.primaryForeground,
|
|
39
|
-
},
|
|
40
|
-
}));
|
|
41
5
|
export function Warning(props) {
|
|
42
6
|
const { title, preformatted, unformatted, } = props;
|
|
43
7
|
const classes = useStyles();
|
|
@@ -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":"AAkBA;;;;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,iBAGJ,KAAK,CAiDjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,yDAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,0DAGJ,KAAK,CAsFjB;AAED,+FAGC;oCA1PM,oBAAoB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo } from 'react';
|
|
2
2
|
import { useQuery, useQueries } from '@tanstack/react-query';
|
|
3
3
|
import { capitalize, getInitialCoordinationScopePrefix, } from '@vitessce/utils';
|
|
4
|
+
import { log } from '@vitessce/globals';
|
|
4
5
|
import { STATUS } from '@vitessce/constants-internal';
|
|
5
6
|
import { AbstractLoaderError, LoaderNotFoundError, } from '@vitessce/abstract';
|
|
6
7
|
import { getMatchingLoader, useMatchingLoader, useSetWarning, } from './state/hooks.js';
|
|
@@ -11,8 +12,8 @@ import { getMatchingLoader, useMatchingLoader, useSetWarning, } from './state/ho
|
|
|
11
12
|
*/
|
|
12
13
|
export function warn(error, setWarning) {
|
|
13
14
|
setWarning(error.message);
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
log.warn(error.message);
|
|
16
|
+
log.error(error.stack);
|
|
16
17
|
if (error instanceof AbstractLoaderError) {
|
|
17
18
|
error.warnInConsole();
|
|
18
19
|
}
|
package/dist-tsc/data-hooks.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export function useFeatureLabelsData(loaders: any, dataset: any, isRequired: any
|
|
|
43
43
|
export function useImageData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
44
44
|
export function useGenomicProfilesData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
45
45
|
export function useNeighborhoodsData(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
46
|
+
export function useComparisonMetadata(loaders: any, dataset: any, isRequired: any, coordinationSetters: any, initialCoordinationValues: any, matchOn: any): array;
|
|
46
47
|
/**
|
|
47
48
|
* Get data from the expression matrix data type loader for a given gene selection.
|
|
48
49
|
* Throw warnings if the data is marked as required.
|
|
@@ -58,6 +59,27 @@ export function useNeighborhoodsData(loaders: any, dataset: any, isRequired: any
|
|
|
58
59
|
* for however many genes are in the selection.
|
|
59
60
|
*/
|
|
60
61
|
export function useFeatureSelection(loaders: object, dataset: string, isRequired: boolean, selection: boolean, matchOn: any): array;
|
|
62
|
+
/**
|
|
63
|
+
* Utility hook function which can be used to define
|
|
64
|
+
* dataType-specific data hooks which call a loader.loadMulti
|
|
65
|
+
* method to obtain multiple data frames resulting from
|
|
66
|
+
* multiple comparative analyses.
|
|
67
|
+
* @param {object} loaders The object mapping
|
|
68
|
+
* datasets and data types to loader instances.
|
|
69
|
+
* @param {string} dataset The key for a dataset,
|
|
70
|
+
* used to identify which loader to use.
|
|
71
|
+
* @param {boolean} isRequired Should a warning be thrown if
|
|
72
|
+
* loading is unsuccessful?
|
|
73
|
+
* @param {object} matchOn Coordination values used to obtain a matching loader.
|
|
74
|
+
* @param {object} volcanoOptions Options to pass to the loadMulti function of the loader.
|
|
75
|
+
* @param {string} dataType A data type.
|
|
76
|
+
* @returns {array} [{ df, metadata }] Array of dataframes and their metadata, where
|
|
77
|
+
* df is an object in which each column is stored as an array like { col1: arr1, col2: arr2 }.
|
|
78
|
+
*/
|
|
79
|
+
export function useComparativeDataType(loaders: object, dataset: string, isRequired: boolean, matchOn: object, volcanoOptions: object, dataType: string): array;
|
|
80
|
+
export function useFeatureStatsData(loaders: any, dataset: any, isRequired: any, matchOn: any, volcanoOptions: any): array;
|
|
81
|
+
export function useFeatureSetStatsData(loaders: any, dataset: any, isRequired: any, matchOn: any, volcanoOptions: any): array;
|
|
82
|
+
export function useObsSetStatsData(loaders: any, dataset: any, isRequired: any, matchOn: any, volcanoOptions: any): array;
|
|
61
83
|
/**
|
|
62
84
|
* Get the attributes for the expression matrix data type loader,
|
|
63
85
|
* i.e names of cells and genes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-hooks.d.ts","sourceRoot":"","sources":["../src/data-hooks.js"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,wCAPW,MAAM,WAEN,MAAM,GAEJ,KAAK,CAoBjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,6CAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,iBAGJ,KAAK,CAajB;AAED,4JASC;AAED,6JASC;AAED,gKASC;AAED,6JASC;AAED,oKASC;AAED,2JASC;AAED,8JASC;AAED,+JASC;AAED,oKASC;AAED,iKASC;AAED,yJASC;AAED,mKASC;AAED,iKASC;AAED;;;;;;;;;;;;;GAaG;AACH,6CAVW,MAAM,WAEN,MAAM,cAEN,OAAO,aAEP,OAAO,iBACL,KAAK,CAiFjB;AAED;;;;;;;;;;;;;GAaG;AACH,oDARW,MAAM,WAEN,MAAM,cAEN,OAAO,iBAEL,MAAM,CA2ElB;AAED,+JAuBC;AAED,8JAuBC;AAED,2HAsBC;AAGD,iIAsBC;AAGD,4GAmBC;AAED,sKA2BC;AAED,4JAyBC"}
|
|
1
|
+
{"version":3,"file":"data-hooks.d.ts","sourceRoot":"","sources":["../src/data-hooks.js"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,wCAPW,MAAM,WAEN,MAAM,GAEJ,KAAK,CAoBjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,6CAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,iBAGJ,KAAK,CAajB;AAED,4JASC;AAED,6JASC;AAED,gKASC;AAED,6JASC;AAED,oKASC;AAED,2JASC;AAED,8JASC;AAED,+JASC;AAED,oKASC;AAED,iKASC;AAED,yJASC;AAED,mKASC;AAED,iKASC;AAED,kKASC;AAED;;;;;;;;;;;;;GAaG;AACH,6CAVW,MAAM,WAEN,MAAM,cAEN,OAAO,aAEP,OAAO,iBACL,KAAK,CAiFjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,gDAZW,MAAM,WAEN,MAAM,cAEN,OAAO,WAEP,MAAM,kBACN,MAAM,YACN,MAAM,GACJ,KAAK,CAoEjB;AAED,2HAOC;AAED,8HAOC;AAED,0HAOC;AAED;;;;;;;;;;;;;GAaG;AACH,oDARW,MAAM,WAEN,MAAM,cAEN,OAAO,iBAEL,MAAM,CA2ElB;AAED,+JAuBC;AAED,8JAuBC;AAED,2HAsBC;AAGD,iIAsBC;AAGD,4GAmBC;AAED,sKA2BC;AAED,4JAyBC"}
|
package/dist-tsc/data-hooks.js
CHANGED
|
@@ -92,6 +92,9 @@ export function useGenomicProfilesData(loaders, dataset, isRequired, coordinatio
|
|
|
92
92
|
export function useNeighborhoodsData(loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn) {
|
|
93
93
|
return useDataType(DataType.NEIGHBORHOODS, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn);
|
|
94
94
|
}
|
|
95
|
+
export function useComparisonMetadata(loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn) {
|
|
96
|
+
return useDataType(DataType.COMPARISON_METADATA, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn);
|
|
97
|
+
}
|
|
95
98
|
/**
|
|
96
99
|
* Get data from the expression matrix data type loader for a given gene selection.
|
|
97
100
|
* Throw warnings if the data is marked as required.
|
|
@@ -174,6 +177,93 @@ export function useFeatureSelection(loaders, dataset, isRequired, selection, mat
|
|
|
174
177
|
}, [anyError, setWarning]);
|
|
175
178
|
return [geneData, loadedGeneName, dataStatus];
|
|
176
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Utility hook function which can be used to define
|
|
182
|
+
* dataType-specific data hooks which call a loader.loadMulti
|
|
183
|
+
* method to obtain multiple data frames resulting from
|
|
184
|
+
* multiple comparative analyses.
|
|
185
|
+
* @param {object} loaders The object mapping
|
|
186
|
+
* datasets and data types to loader instances.
|
|
187
|
+
* @param {string} dataset The key for a dataset,
|
|
188
|
+
* used to identify which loader to use.
|
|
189
|
+
* @param {boolean} isRequired Should a warning be thrown if
|
|
190
|
+
* loading is unsuccessful?
|
|
191
|
+
* @param {object} matchOn Coordination values used to obtain a matching loader.
|
|
192
|
+
* @param {object} volcanoOptions Options to pass to the loadMulti function of the loader.
|
|
193
|
+
* @param {string} dataType A data type.
|
|
194
|
+
* @returns {array} [{ df, metadata }] Array of dataframes and their metadata, where
|
|
195
|
+
* df is an object in which each column is stored as an array like { col1: arr1, col2: arr2 }.
|
|
196
|
+
*/
|
|
197
|
+
export function useComparativeDataType(loaders, dataset, isRequired, matchOn, volcanoOptions, dataType) {
|
|
198
|
+
const setWarning = useSetWarning();
|
|
199
|
+
const placeholderObject = useMemo(() => ({}), []);
|
|
200
|
+
const statsQuery = useQuery({
|
|
201
|
+
// TODO: only enable once `loaders` is available?
|
|
202
|
+
structuralSharing: false,
|
|
203
|
+
placeholderData: placeholderObject,
|
|
204
|
+
// Include the hook name in the queryKey to prevent the case in which an identical queryKey
|
|
205
|
+
// in a different hook would cause an accidental cache hit.
|
|
206
|
+
queryKey: [dataset, dataType, matchOn, volcanoOptions, 'useComparativeData'],
|
|
207
|
+
// TODO: use TypeScript to type the return value?
|
|
208
|
+
queryFn: async (ctx) => {
|
|
209
|
+
const loader = getMatchingLoader(ctx.meta.loaders, ctx.queryKey[0], ctx.queryKey[1], ctx.queryKey[2]);
|
|
210
|
+
if (loader) {
|
|
211
|
+
// FeatureStats loader has a special loadMulti function
|
|
212
|
+
// that depends on coordination values such as sampleSetSelection.
|
|
213
|
+
const implementsLoadAttrs = typeof loader.loadMulti === 'function';
|
|
214
|
+
if (implementsLoadAttrs) {
|
|
215
|
+
// Has loadMulti function.
|
|
216
|
+
const payload = await loader.loadMulti(volcanoOptions);
|
|
217
|
+
if (!payload)
|
|
218
|
+
return placeholderObject;
|
|
219
|
+
const { data: payloadData } = payload;
|
|
220
|
+
return {
|
|
221
|
+
data: payloadData,
|
|
222
|
+
urls: null,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
// No loadAttrs function.
|
|
226
|
+
const payload = await loader.load();
|
|
227
|
+
if (!payload)
|
|
228
|
+
return placeholderObject;
|
|
229
|
+
const { data: payloadData } = payload;
|
|
230
|
+
return {
|
|
231
|
+
data: payloadData,
|
|
232
|
+
urls: null,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
// No loader was found.
|
|
236
|
+
if (isRequired) {
|
|
237
|
+
// Status: error
|
|
238
|
+
throw new LoaderNotFoundError(loaders, dataset, dataType, matchOn);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
// Status: success
|
|
242
|
+
return { data: placeholderObject, dataKey: null };
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
meta: { loaders },
|
|
246
|
+
});
|
|
247
|
+
const { data, status, isFetching, error } = statsQuery;
|
|
248
|
+
const loadedData = data?.data || placeholderObject;
|
|
249
|
+
const dataStatus = isFetching ? STATUS.LOADING : status;
|
|
250
|
+
const urls = data?.urls;
|
|
251
|
+
useEffect(() => {
|
|
252
|
+
if (error) {
|
|
253
|
+
setWarning(error.message);
|
|
254
|
+
}
|
|
255
|
+
}, [error, setWarning]);
|
|
256
|
+
return [loadedData, dataStatus, urls];
|
|
257
|
+
}
|
|
258
|
+
export function useFeatureStatsData(loaders, dataset, isRequired, matchOn, volcanoOptions) {
|
|
259
|
+
return useComparativeDataType(loaders, dataset, isRequired, matchOn, volcanoOptions, DataType.FEATURE_STATS);
|
|
260
|
+
}
|
|
261
|
+
export function useFeatureSetStatsData(loaders, dataset, isRequired, matchOn, volcanoOptions) {
|
|
262
|
+
return useComparativeDataType(loaders, dataset, isRequired, matchOn, volcanoOptions, DataType.FEATURE_SET_STATS);
|
|
263
|
+
}
|
|
264
|
+
export function useObsSetStatsData(loaders, dataset, isRequired, matchOn, volcanoOptions) {
|
|
265
|
+
return useComparativeDataType(loaders, dataset, isRequired, matchOn, volcanoOptions, DataType.OBS_SET_STATS);
|
|
266
|
+
}
|
|
177
267
|
/**
|
|
178
268
|
* Get the attributes for the expression matrix data type loader,
|
|
179
269
|
* i.e names of cells and genes.
|
package/dist-tsc/hooks.d.ts
CHANGED
|
@@ -96,4 +96,13 @@ export function useGetObsInfo(obsType: any, obsLabelsTypes: any, obsLabelsData:
|
|
|
96
96
|
export function useExpandedFeatureLabelsMap(featureType: string, featureLabelsMap: Map<any, any> | null, options: any): {
|
|
97
97
|
stripCuriePrefixes: boolean;
|
|
98
98
|
} | null;
|
|
99
|
+
/**
|
|
100
|
+
* Using a loader object's options,
|
|
101
|
+
* return a mapping from group name to column name.
|
|
102
|
+
* @param {*} loader obsSets or sampleSets loader class
|
|
103
|
+
* @param {[boolean]} reverse Optionally, reverse
|
|
104
|
+
* (so, return column name to group name mapping).
|
|
105
|
+
* @returns {Record<string, string>} Mapping from group name to column name.
|
|
106
|
+
*/
|
|
107
|
+
export function useColumnNameMapping(loader: any, reverse?: [boolean]): Record<string, string>;
|
|
99
108
|
//# sourceMappingURL=hooks.d.ts.map
|
package/dist-tsc/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.js"],"names":[],"mappings":"AAqBA,oDAOC;AAED;;;;GAIG;AACH,uCAHa,KAAK,CAmBjB;AAED;;;;GAIG;AACH,mCAHa,KAAK,CAoCjB;AAED;;;;;GAKG;AACH,qCAJa,KAAK,CAqCjB;AAED;;;;;;GAMG;AACH,uCAHW,MAAM,EAAE,GACN,OAAO,CAOnB;AAED;;;;GAIG;AACH,8BAHW,CAAC,IAAI,GAAC,MAAM,EAAE,CAAC,EAAE,GACf,KAAK,CAYjB;AAED;;;;;;GAMG;AACH,qDAJW,GAAG,GACD,KAAK,CA0BjB;AAED;;;;;;;;;;GAUG;AACH,+DARG;IAAuB,gBAAgB,EAA/B,MAAM;CAEd,GAAU,KAAK,CAmBjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,yDAbW,YAAY,EAAE,GAAG,IAAI,GAInB;IACZ,QAAW,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IACjC,OAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACtC,OAAU,EAAE,MAAM,EAAE,CAAA;CACjB,CAwBH;AAED;;;;QA2BC;AAED,iEAOC;AAED,kHA4BC;AAED;;;;;;;;;;GAUG;AACH,yDALW,MAAM,oBACN,gBAAI,IAAI,iBAEN;IAAE,kBAAkB,EAAE,OAAO,CAAA;CAAE,GAAC,IAAI,CAkChD"}
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.js"],"names":[],"mappings":"AAqBA,oDAOC;AAED;;;;GAIG;AACH,uCAHa,KAAK,CAmBjB;AAED;;;;GAIG;AACH,mCAHa,KAAK,CAoCjB;AAED;;;;;GAKG;AACH,qCAJa,KAAK,CAqCjB;AAED;;;;;;GAMG;AACH,uCAHW,MAAM,EAAE,GACN,OAAO,CAOnB;AAED;;;;GAIG;AACH,8BAHW,CAAC,IAAI,GAAC,MAAM,EAAE,CAAC,EAAE,GACf,KAAK,CAYjB;AAED;;;;;;GAMG;AACH,qDAJW,GAAG,GACD,KAAK,CA0BjB;AAED;;;;;;;;;;GAUG;AACH,+DARG;IAAuB,gBAAgB,EAA/B,MAAM;CAEd,GAAU,KAAK,CAmBjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,yDAbW,YAAY,EAAE,GAAG,IAAI,GAInB;IACZ,QAAW,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IACjC,OAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACtC,OAAU,EAAE,MAAM,EAAE,CAAA;CACjB,CAwBH;AAED;;;;QA2BC;AAED,iEAOC;AAED,kHA4BC;AAED;;;;;;;;;;GAUG;AACH,yDALW,MAAM,oBACN,gBAAI,IAAI,iBAEN;IAAE,kBAAkB,EAAE,OAAO,CAAA;CAAE,GAAC,IAAI,CAkChD;AAED;;;;;;;GAOG;AACH,6CALW,GAAC,YACD,CAAC,OAAO,CAAC,GAEP,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuBlC"}
|
package/dist-tsc/hooks.js
CHANGED
|
@@ -4,8 +4,8 @@ import { extent } from 'd3-array';
|
|
|
4
4
|
import { useQuery } from '@tanstack/react-query';
|
|
5
5
|
import { capitalize } from '@vitessce/utils';
|
|
6
6
|
import { STATUS, AsyncFunctionType } from '@vitessce/constants-internal';
|
|
7
|
-
import { useGridResize, useEmitGridResize } from './state/hooks.js';
|
|
8
7
|
import { VITESSCE_CONTAINER } from './classNames.js';
|
|
8
|
+
import { useGridResize, useEmitGridResize } from './state/hooks.js';
|
|
9
9
|
import { useAsyncFunction } from './contexts.js';
|
|
10
10
|
function getWindowDimensions() {
|
|
11
11
|
const { innerWidth: width, innerHeight: height } = window;
|
|
@@ -316,3 +316,31 @@ export function useExpandedFeatureLabelsMap(featureType, featureLabelsMap, optio
|
|
|
316
316
|
: STATUS.SUCCESS);
|
|
317
317
|
return [updatedFeatureLabelsMap, dataStatus];
|
|
318
318
|
}
|
|
319
|
+
/**
|
|
320
|
+
* Using a loader object's options,
|
|
321
|
+
* return a mapping from group name to column name.
|
|
322
|
+
* @param {*} loader obsSets or sampleSets loader class
|
|
323
|
+
* @param {[boolean]} reverse Optionally, reverse
|
|
324
|
+
* (so, return column name to group name mapping).
|
|
325
|
+
* @returns {Record<string, string>} Mapping from group name to column name.
|
|
326
|
+
*/
|
|
327
|
+
export function useColumnNameMapping(loader, reverse = false) {
|
|
328
|
+
return useMemo(() => {
|
|
329
|
+
const result = {};
|
|
330
|
+
if (loader?.options) {
|
|
331
|
+
const optionsArray = loader.options.obsSets
|
|
332
|
+
? loader.options.obsSets
|
|
333
|
+
: loader.options.sampleSets;
|
|
334
|
+
optionsArray.forEach((optionObject) => {
|
|
335
|
+
const { name, path } = optionObject;
|
|
336
|
+
const columnName = path.split('/').at(-1);
|
|
337
|
+
result[name] = columnName;
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
if (reverse) {
|
|
341
|
+
return Object.fromEntries(Object.entries(result)
|
|
342
|
+
.map(([k, v]) => ([v, k])));
|
|
343
|
+
}
|
|
344
|
+
return result;
|
|
345
|
+
}, [loader]);
|
|
346
|
+
}
|
package/dist-tsc/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export { VitS } from "./VitS.js";
|
|
2
|
+
export { VitSContainer } from "./VitSContainer.js";
|
|
2
3
|
export { TitleInfo } from "./TitleInfo.js";
|
|
3
4
|
export { PopperMenu } from "./shared-mui/components.js";
|
|
4
5
|
export { useHasLoader } from "./data-hook-utils.js";
|
|
5
6
|
export { logConfig } from "./view-config-utils.js";
|
|
6
7
|
export { createLoaders } from "./vitessce-grid-utils.js";
|
|
7
|
-
export { useReady, useUrls, useVitessceContainer, useDeckCanvasSize, useUint8ObsFeatureMatrix, useUint8FeatureSelection, useExpressionValueGetter, useGetObsMembership, useGetObsInfo, useClosestVitessceContainerSize, useWindowDimensions, useGridItemSize, useExpandedFeatureLabelsMap } from "./hooks.js";
|
|
8
|
+
export { useReady, useUrls, useVitessceContainer, useDeckCanvasSize, useUint8ObsFeatureMatrix, useUint8FeatureSelection, useExpressionValueGetter, useGetObsMembership, useGetObsInfo, useClosestVitessceContainerSize, useWindowDimensions, useGridItemSize, useExpandedFeatureLabelsMap, useColumnNameMapping } from "./hooks.js";
|
|
8
9
|
export { useCoordinationScopes, useCoordinationScopesBy, useInitialCoordination, useCoordination, useComplexCoordination, useComplexCoordinationSecondary, useMultiCoordinationScopes, useMultiCoordinationScopesNonNull, useMultiCoordinationScopesSecondary, useMultiCoordinationScopesSecondaryNonNull, useMultiCoordinationValues, useMultiDatasetCoordination, useDatasetUids, useLoaders, useMergeCoordination, useMatchingLoader, useViewConfigStore, useViewConfigStoreApi, useViewConfig, useSetViewConfig, useComponentHover, useSetComponentHover, useComponentViewInfo, useSetComponentViewInfo, useWarning, useSetWarning, useAuxiliaryCoordination, useComponentLayout, useRemoveImageChannelInMetaCoordinationScopes, useAddImageChannelInMetaCoordinationScopes } from "./state/hooks.js";
|
|
9
|
-
export { useDescription, useImageData, useObsSetsData, useObsEmbeddingData, useFeatureSelection, useObsFeatureMatrixIndices, useSampleSetsData, useSampleEdgesData, useMultiObsLabels, useMultiObsSpots, useMultiObsPoints, useSpotMultiObsSets, useSpotMultiFeatureLabels, useMultiObsSegmentations, useMultiImages, useObsSpotsData, useObsPointsData, useObsLocationsData, useObsSegmentationsData, useNeighborhoodsData, useObsLabelsData, useObsFeatureMatrixData, useFeatureLabelsData, useGenomicProfilesData } from "./data-hooks.js";
|
|
10
|
+
export { useDescription, useImageData, useObsSetsData, useObsEmbeddingData, useFeatureSelection, useObsFeatureMatrixIndices, useSampleSetsData, useSampleEdgesData, useMultiObsLabels, useMultiObsSpots, useMultiObsPoints, useSpotMultiObsSets, useSpotMultiFeatureLabels, useMultiObsSegmentations, useMultiImages, useObsSpotsData, useObsPointsData, useObsLocationsData, useObsSegmentationsData, useNeighborhoodsData, useObsLabelsData, useObsFeatureMatrixData, useFeatureLabelsData, useGenomicProfilesData, useComparisonMetadata, useFeatureStatsData, useFeatureSetStatsData, useObsSetStatsData } from "./data-hooks.js";
|
|
10
11
|
export { usePointMultiObsLabels, useSpotMultiFeatureSelection, useSpotMultiObsFeatureMatrixIndices, useSegmentationMultiFeatureSelection, useSegmentationMultiObsFeatureMatrixIndices, useSegmentationMultiObsLocations, useSegmentationMultiObsSets } from "./data-hooks-multilevel.js";
|
|
11
12
|
export { CellColorEncodingOption, OptionsContainer, OptionSelect, usePlotOptionsStyles } from "./shared-plot-options/index.js";
|
|
12
13
|
export { useAsyncFunction, usePageModeView } from "./contexts.js";
|
package/dist-tsc/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { VitS } from './VitS.js';
|
|
2
|
+
export { VitSContainer } from './VitSContainer.js';
|
|
2
3
|
export { TitleInfo } from './TitleInfo.js';
|
|
3
4
|
export { PopperMenu } from './shared-mui/components.js';
|
|
4
5
|
// For plugin view types:
|
|
5
|
-
export { useReady, useUrls, useVitessceContainer, useDeckCanvasSize, useUint8ObsFeatureMatrix, useUint8FeatureSelection, useExpressionValueGetter, useGetObsMembership, useGetObsInfo, useClosestVitessceContainerSize, useWindowDimensions, useGridItemSize, useExpandedFeatureLabelsMap, } from './hooks.js';
|
|
6
|
+
export { useReady, useUrls, useVitessceContainer, useDeckCanvasSize, useUint8ObsFeatureMatrix, useUint8FeatureSelection, useExpressionValueGetter, useGetObsMembership, useGetObsInfo, useClosestVitessceContainerSize, useWindowDimensions, useGridItemSize, useExpandedFeatureLabelsMap, useColumnNameMapping, } from './hooks.js';
|
|
6
7
|
export { useCoordinationScopes, useCoordinationScopesBy, useInitialCoordination, useCoordination, useComplexCoordination, useComplexCoordinationSecondary, useMultiCoordinationScopes, useMultiCoordinationScopesNonNull, useMultiCoordinationScopesSecondary, useMultiCoordinationScopesSecondaryNonNull, useMultiCoordinationValues, useMultiDatasetCoordination, useDatasetUids, useLoaders, useMergeCoordination, useMatchingLoader, useViewConfigStore, useViewConfigStoreApi, useViewConfig, useSetViewConfig, useComponentHover, useSetComponentHover, useComponentViewInfo, useSetComponentViewInfo, useWarning, useSetWarning, useAuxiliaryCoordination, useComponentLayout, useRemoveImageChannelInMetaCoordinationScopes, useAddImageChannelInMetaCoordinationScopes, } from './state/hooks.js';
|
|
7
|
-
export { useDescription, useImageData, useObsSetsData, useObsEmbeddingData, useFeatureSelection, useObsFeatureMatrixIndices, useSampleSetsData, useSampleEdgesData, useMultiObsLabels, useMultiObsSpots, useMultiObsPoints, useSpotMultiObsSets, useSpotMultiFeatureLabels, useMultiObsSegmentations, useMultiImages, useObsSpotsData, useObsPointsData, useObsLocationsData, useObsSegmentationsData, useNeighborhoodsData, useObsLabelsData, useObsFeatureMatrixData, useFeatureLabelsData, useGenomicProfilesData, } from './data-hooks.js';
|
|
8
|
+
export { useDescription, useImageData, useObsSetsData, useObsEmbeddingData, useFeatureSelection, useObsFeatureMatrixIndices, useSampleSetsData, useSampleEdgesData, useMultiObsLabels, useMultiObsSpots, useMultiObsPoints, useSpotMultiObsSets, useSpotMultiFeatureLabels, useMultiObsSegmentations, useMultiImages, useObsSpotsData, useObsPointsData, useObsLocationsData, useObsSegmentationsData, useNeighborhoodsData, useObsLabelsData, useObsFeatureMatrixData, useFeatureLabelsData, useGenomicProfilesData, useComparisonMetadata, useFeatureStatsData, useFeatureSetStatsData, useObsSetStatsData, } from './data-hooks.js';
|
|
8
9
|
export { usePointMultiObsLabels, useSpotMultiFeatureSelection, useSpotMultiObsFeatureMatrixIndices, useSegmentationMultiFeatureSelection, useSegmentationMultiObsFeatureMatrixIndices, useSegmentationMultiObsLocations, useSegmentationMultiObsSets, } from './data-hooks-multilevel.js';
|
|
9
10
|
export { useHasLoader, } from './data-hook-utils.js';
|
|
10
11
|
export { CellColorEncodingOption, OptionsContainer, OptionSelect, usePlotOptionsStyles, } from './shared-plot-options/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-warning-styles.d.ts","sourceRoot":"","sources":["../src/shared-warning-styles.js"],"names":[],"mappings":"AAEA,2GAmCI"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core';
|
|
2
|
+
export const useStyles = makeStyles(theme => ({
|
|
3
|
+
warningLayout: {
|
|
4
|
+
backgroundColor: theme.palette.gridLayoutBackground,
|
|
5
|
+
position: 'absolute',
|
|
6
|
+
width: '100%',
|
|
7
|
+
height: '100vh',
|
|
8
|
+
},
|
|
9
|
+
containerFluid: {
|
|
10
|
+
width: '100%',
|
|
11
|
+
padding: '15px',
|
|
12
|
+
marginRight: 'auto',
|
|
13
|
+
marginLeft: 'auto',
|
|
14
|
+
boxSizing: 'border-box',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
},
|
|
17
|
+
row: {
|
|
18
|
+
flexGrow: '1',
|
|
19
|
+
},
|
|
20
|
+
warningCard: {
|
|
21
|
+
border: `1px solid ${theme.palette.cardBorder}`,
|
|
22
|
+
flex: '1 1 auto',
|
|
23
|
+
minHeight: '1px',
|
|
24
|
+
padding: '12px',
|
|
25
|
+
marginTop: '8px',
|
|
26
|
+
marginBottom: '8px',
|
|
27
|
+
position: 'relative',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
minWidth: '0',
|
|
31
|
+
wordWrap: 'break-word',
|
|
32
|
+
backgroundClip: 'border-box',
|
|
33
|
+
borderRadius: '4px',
|
|
34
|
+
backgroundColor: theme.palette.primaryBackground,
|
|
35
|
+
color: theme.palette.primaryForeground,
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-config-utils.d.ts","sourceRoot":"","sources":["../src/view-config-utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view-config-utils.d.ts","sourceRoot":"","sources":["../src/view-config-utils.js"],"names":[],"mappings":"AAUA,wDAOC;AAED;;;;;;;;GAQG;AACH,6DALW,MAAM,oBACN,MAAM,GAEJ,MAAM,EAAE,CAMpB;AAyND;;;;;;;;;;;;;;GAcG;AACH,mCANW,MAAM,kBACN,mBAAmB,EAAE,qBACrB,sBAAsB,EAAE,aACxB,cAAc,EAAE;;;EAY1B"}
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
/* eslint-disable camelcase */
|
|
3
3
|
import { cloneDeep } from 'lodash-es';
|
|
4
4
|
import { getNextScope } from '@vitessce/utils';
|
|
5
|
+
import { atLeastLogLevel, LogLevel } from '@vitessce/globals';
|
|
5
6
|
import { AUTO_INDEPENDENT_COORDINATION_TYPES, META_VERSION, } from '@vitessce/constants-internal';
|
|
6
7
|
export function logConfig(config, name) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
if (atLeastLogLevel(LogLevel.INFO)) {
|
|
9
|
+
console.groupCollapsed(`🚄 VitS (${META_VERSION.version}) ${name}`);
|
|
10
|
+
console.info(`data:,${JSON.stringify(config)}`);
|
|
11
|
+
console.info(JSON.stringify(config, null, 2));
|
|
12
|
+
console.groupEnd();
|
|
13
|
+
}
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* Get a list of all unique scope names for a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VitessceGridLayout.d.ts","sourceRoot":"","sources":["../../src/vitessce-grid-layout/VitessceGridLayout.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VitessceGridLayout.d.ts","sourceRoot":"","sources":["../../src/vitessce-grid-layout/VitessceGridLayout.js"],"names":[],"mappings":"AAkBA,oDAuMC"}
|