@vitessce/biomarker-select 3.5.12 → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +58865 -28077
- package/dist-tsc/ComparativeHeadingSubscriber.js +3 -3
- package/dist-tsc/SampleSetPairManagerSubscriber.js +3 -3
- package/dist-tsc/cart.d.ts.map +1 -1
- package/dist-tsc/cart.js +2 -3
- package/dist-tsc/scmd-ui.js +3 -3
- package/dist-tsc/select-agnostic.d.ts.map +1 -1
- package/dist-tsc/select-agnostic.js +17 -12
- package/dist-tsc/select-specific.d.ts.map +1 -1
- package/dist-tsc/select-specific.js +17 -7
- package/dist-tsc/select-stratification.js +2 -2
- package/dist-tsc/stepper-confirmatory.js +4 -4
- package/dist-tsc/stepper-exploratory.js +4 -4
- package/dist-tsc/styles.d.ts +9 -1
- package/dist-tsc/styles.d.ts.map +1 -1
- package/dist-tsc/styles.js +2 -2
- package/package.json +12 -14
- package/src/ComparativeHeadingSubscriber.js +3 -3
- package/src/SampleSetPairManagerSubscriber.js +3 -3
- package/src/cart.js +2 -3
- package/src/scmd-ui.js +6 -6
- package/src/select-agnostic.js +32 -23
- package/src/select-specific.js +25 -14
- package/src/select-stratification.js +2 -2
- package/src/stepper-confirmatory.js +7 -7
- package/src/stepper-exploratory.js +7 -7
- package/src/styles.js +2 -2
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React, { useCallback } from 'react';
|
|
3
3
|
import { useCoordination, } from '@vitessce/vit-s';
|
|
4
4
|
import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
|
|
5
|
-
import { makeStyles } from '@
|
|
6
|
-
const useStyles = makeStyles(theme => ({
|
|
5
|
+
import { makeStyles } from '@vitessce/styles';
|
|
6
|
+
const useStyles = makeStyles()(theme => ({
|
|
7
7
|
buttonContainer: {
|
|
8
8
|
position: 'absolute',
|
|
9
9
|
right: 0,
|
|
@@ -36,7 +36,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
36
36
|
export function ComparativeHeadingSubscriber(props) {
|
|
37
37
|
const { coordinationScopes, } = props;
|
|
38
38
|
const [{ sampleSetSelection, featureSelection, }, { setSampleSetSelection, setFeatureSelection, }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.COMPARATIVE_HEADING], coordinationScopes);
|
|
39
|
-
const classes = useStyles();
|
|
39
|
+
const { classes } = useStyles();
|
|
40
40
|
const swapSampleSets = useCallback(() => {
|
|
41
41
|
if (sampleSetSelection?.length === 2) {
|
|
42
42
|
setSampleSetSelection([
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React, { useMemo, useCallback } from 'react';
|
|
3
3
|
import { isEqual } from 'lodash-es';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { makeStyles } from '@
|
|
5
|
+
import { makeStyles } from '@vitessce/styles';
|
|
6
6
|
import { TitleInfo, useReady, useCoordination, useLoaders, useComparisonMetadata, useMatchingLoader, useColumnNameMapping, } from '@vitessce/vit-s';
|
|
7
7
|
import { ViewType, DataType, COMPONENT_COORDINATION_TYPES, ViewHelpMapping } from '@vitessce/constants-internal';
|
|
8
|
-
const useStyles = makeStyles(() => ({
|
|
8
|
+
const useStyles = makeStyles()(() => ({
|
|
9
9
|
selectedPair: {
|
|
10
10
|
fontWeight: 'bold',
|
|
11
11
|
},
|
|
@@ -20,7 +20,7 @@ const useStyles = makeStyles(() => ({
|
|
|
20
20
|
}));
|
|
21
21
|
export function SampleSetPairManagerSubscriber(props) {
|
|
22
22
|
const { coordinationScopes, removeGridComponent, theme, title = 'Sample Sets', closeButtonVisible, helpText = ViewHelpMapping.SAMPLE_SET_PAIR_MANAGER, } = props;
|
|
23
|
-
const classes = useStyles();
|
|
23
|
+
const { classes } = useStyles();
|
|
24
24
|
const loaders = useLoaders();
|
|
25
25
|
// Get "props" from the coordination space.
|
|
26
26
|
const [{ dataset, obsType, sampleType, sampleSetSelection, }, { setSampleSetSelection, }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.SAMPLE_SET_PAIR_MANAGER], coordinationScopes);
|
package/dist-tsc/cart.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../src/cart.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../src/cart.js"],"names":[],"mappings":"AAKA,0DAwFC"}
|
package/dist-tsc/cart.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Accordion, AccordionDetails, AccordionSummary, Typography } from '@
|
|
4
|
-
import { ExpandMore as ExpandMoreIcon } from '@material-ui/icons';
|
|
3
|
+
import { Accordion, AccordionDetails, AccordionSummary, Typography, ExpandMore as ExpandMoreIcon } from '@vitessce/styles';
|
|
5
4
|
import { useStyles } from './styles.js';
|
|
6
5
|
export function ConfirmatoryCart(props) {
|
|
7
6
|
const { currentModalityAgnosticSelection,
|
|
@@ -11,7 +10,7 @@ export function ConfirmatoryCart(props) {
|
|
|
11
10
|
setCurrentModalitySpecificSelection, currentStratificationSelection,
|
|
12
11
|
// eslint-disable-next-line no-unused-vars
|
|
13
12
|
setCurrentStratificationSelection, } = props;
|
|
14
|
-
const classes = useStyles();
|
|
13
|
+
const { classes } = useStyles();
|
|
15
14
|
const [expandedAccordions, setExpandedAccordions] = React.useState([
|
|
16
15
|
'agnostic', 'specific', 'stratification',
|
|
17
16
|
]);
|
package/dist-tsc/scmd-ui.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable no-unused-vars */
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
-
import { Button, ButtonGroup, Grid, Tooltip } from '@
|
|
4
|
+
import { Button, ButtonGroup, Grid, Tooltip } from '@vitessce/styles';
|
|
5
5
|
import { ConfirmatoryStepper } from './stepper-confirmatory.js';
|
|
6
6
|
import { ExploratoryStepper } from './stepper-exploratory.js';
|
|
7
7
|
import { useStyles } from './styles.js';
|
|
8
8
|
export function ScmdUi(props) {
|
|
9
9
|
const { mode: modeProp, setMode, step: stepProp, setStep, currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection, currentModalitySpecificSelection, setCurrentModalitySpecificSelection, currentStratificationSelection, setCurrentStratificationSelection, autocompleteNode, getEdges, stratifications, onFinish, } = props;
|
|
10
|
-
const classes = useStyles();
|
|
10
|
+
const { classes } = useStyles();
|
|
11
11
|
const mode = modeProp || 'confirmatory';
|
|
12
12
|
const step = mode === 'confirmatory' ? (stepProp || 'select-biomarkers') : (stepProp || 'define-stratification');
|
|
13
13
|
const [tempIsVisible, setTempIsVisible] = useState(true);
|
|
14
14
|
const isConfirmatoryMode = mode === 'confirmatory';
|
|
15
|
-
return (_jsxs(Grid, { container: true,
|
|
15
|
+
return (_jsxs(Grid, { container: true, sx: { border: '0px solid red' }, children: [_jsxs(Grid, { container: true, size: 12, className: classes.header, children: [_jsx(Grid, { size: 8 }), _jsx(Grid, { container: true, size: 4, justifyContent: "flex-end", children: _jsxs(ButtonGroup, { variant: "outlined", size: "small", color: "secondary", "aria-label": "Toggle between confirmatory and exploratory modes", children: [_jsx(Tooltip, { arrow: true, title: "Start from biomarker(s) of interest", children: _jsx(Button, { variant: isConfirmatoryMode ? 'contained' : 'outlined', onClick: () => setMode('confirmatory'), children: "Confirmatory (Hypothesis-driven)" }) }), _jsx(Tooltip, { arrow: true, title: "Lacking biomarker(s) of interest", children: _jsx(Button, { variant: !isConfirmatoryMode ? 'contained' : 'outlined', onClick: () => setMode('exploratory'), children: "Exploratory (Hypothesis-generating)" }) })] }) })] }), tempIsVisible ? (_jsxs("div", { style: { border: '2px solid #eee', borderRadius: '5px' }, children: [mode === 'confirmatory' ? (_jsx(ConfirmatoryStepper, { autocompleteNode: autocompleteNode, currentModalityAgnosticSelection: currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection: setCurrentModalityAgnosticSelection, currentModalitySpecificSelection: currentModalitySpecificSelection, setCurrentModalitySpecificSelection: setCurrentModalitySpecificSelection, currentStratificationSelection: currentStratificationSelection, setCurrentStratificationSelection: setCurrentStratificationSelection, getEdges: getEdges, stratifications: stratifications, onFinish: onFinish })) : null, mode === 'exploratory' ? (_jsx(ExploratoryStepper, { autocompleteNode: autocompleteNode, currentModalityAgnosticSelection: currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection: setCurrentModalityAgnosticSelection, currentModalitySpecificSelection: currentModalitySpecificSelection, setCurrentModalitySpecificSelection: setCurrentModalitySpecificSelection, currentStratificationSelection: currentStratificationSelection, setCurrentStratificationSelection: setCurrentStratificationSelection, getEdges: getEdges, stratifications: stratifications, onFinish: onFinish })) : null] })) : null] }));
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-agnostic.d.ts","sourceRoot":"","sources":["../src/select-agnostic.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select-agnostic.d.ts","sourceRoot":"","sources":["../src/select-agnostic.js"],"names":[],"mappings":"AA0EA,wDA0GC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useRef, useEffect } from 'react';
|
|
3
|
-
import { Grid, Button, TextField, Typography } from '@
|
|
4
|
-
import { Add as AddIcon, Info as InfoIcon } from '@material-ui/icons';
|
|
5
|
-
import { Autocomplete } from '@material-ui/lab';
|
|
3
|
+
import { Grid, Button, TextField, Typography, Add as AddIcon, Info as InfoIcon, Autocomplete } from '@vitessce/styles';
|
|
6
4
|
import { VariableSizeList } from 'react-window';
|
|
7
5
|
import { useStyles } from './styles.js';
|
|
8
6
|
const LIST_ROW_HEIGHT = 48;
|
|
@@ -14,12 +12,15 @@ const OuterElementType = React.forwardRef((props, ref) => {
|
|
|
14
12
|
});
|
|
15
13
|
function ListRow(props) {
|
|
16
14
|
const { data, index, style } = props;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const dataSet = data[index];
|
|
16
|
+
const inlineStyle = {
|
|
17
|
+
...style,
|
|
18
|
+
top: style.top + 8,
|
|
19
|
+
};
|
|
20
|
+
// This array is created by the renderOption function in the Autocomplete component.
|
|
21
|
+
const [props0, option] = dataSet;
|
|
22
|
+
const { key, ...optionProps } = props0;
|
|
23
|
+
return (_jsxs(Typography, { component: "li", ...optionProps, noWrap: true, style: inlineStyle, children: [option.label, " (", option.nodeType, ")"] }, key));
|
|
23
24
|
}
|
|
24
25
|
function useResetCache(itemCount) {
|
|
25
26
|
const ref = useRef(null);
|
|
@@ -39,7 +40,7 @@ const ListboxComponent = React.forwardRef((props, ref) => {
|
|
|
39
40
|
});
|
|
40
41
|
export function SelectAgnostic(props) {
|
|
41
42
|
const { autocompleteNode, currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection, } = props;
|
|
42
|
-
const classes = useStyles();
|
|
43
|
+
const { classes } = useStyles();
|
|
43
44
|
const [selectedItem, setSelectedItem] = React.useState(null);
|
|
44
45
|
const [potentialItems, setPotentialItems] = React.useState([]);
|
|
45
46
|
const handleChange = async (event) => {
|
|
@@ -59,8 +60,12 @@ export function SelectAgnostic(props) {
|
|
|
59
60
|
]);
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
return (_jsxs(_Fragment, { children: [_jsx(Grid, {
|
|
63
|
+
return (_jsxs(_Fragment, { children: [_jsx(Grid, { container: true, size: 12, children: _jsx(Typography, { variant: "h6", children: "Search by gene, protein, pathway (by term name), or cell type:" }) }), _jsxs(Grid, { container: true, size: 12, children: [_jsx(Grid, { size: 4, children: _jsx(Autocomplete, { options: potentialItems, autoComplete: true, includeInputInList: true, onInputChange: handleChange, onChange: (event, item) => setSelectedItem(item), classes: { input: classes.searchInput }, renderInput: params => (_jsx(TextField, { label: "Search", variant: "outlined", onChange: handleChange, ...params })), getOptionLabel: option => option.label, renderOption: (props0, option, state) => ([props0, option, state.index]), slotProps: {
|
|
64
|
+
listbox: {
|
|
65
|
+
component: ListboxComponent,
|
|
66
|
+
},
|
|
67
|
+
} }) }), _jsx(Grid, { size: 8, style: {
|
|
63
68
|
border: selectedItem ? '1px solid gray' : '1px solid transparent',
|
|
64
69
|
borderRadius: '4px',
|
|
65
|
-
}, children: selectedItem ? (_jsxs(_Fragment, { children: [_jsxs(Grid, { container: true,
|
|
70
|
+
}, children: selectedItem ? (_jsxs(_Fragment, { children: [_jsxs(Grid, { container: true, size: 12, children: [_jsx(Grid, { size: 9, children: _jsx(Typography, { variant: "h4", title: selectedItem.term, children: selectedItem.label }) }), _jsx(Grid, { size: 3, sx: { position: 'relative' }, children: _jsx(Button, { className: classes.selectButton, variant: "contained", startIcon: _jsx(AddIcon, {}), onClick: confirmSelectedItem, children: "Select" }) })] }), _jsxs(Grid, { container: true, size: 12, children: [_jsx(InfoIcon, {}), _jsxs(Typography, { variant: "h6", children: ["About this ", selectedItem.nodeType] })] }), _jsx(Grid, { container: true, size: 12, children: _jsx("iframe", { title: `Embedded metadata page for ontology term ${selectedItem.term}`, src: `https://identifiers.org/${selectedItem.term}`, width: "100%", height: "500", style: { border: 0 } }) }, selectedItem.term)] })) : null })] })] }));
|
|
66
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-specific.d.ts","sourceRoot":"","sources":["../src/select-specific.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select-specific.d.ts","sourceRoot":"","sources":["../src/select-specific.js"],"names":[],"mappings":"AA+BA,wDA0FC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { useQueries } from '@tanstack/react-query';
|
|
4
|
-
import { Grid, FormHelperText, Typography,
|
|
5
|
-
import { DataGrid } from '@mui/x-data-grid';
|
|
4
|
+
import { Grid, FormHelperText, Typography, NativeSelect, FormControl, DataGrid } from '@vitessce/styles';
|
|
6
5
|
import { useStyles } from './styles.js';
|
|
7
6
|
const columns = [
|
|
8
7
|
{
|
|
@@ -18,9 +17,17 @@ const columns = [
|
|
|
18
17
|
editable: false,
|
|
19
18
|
},
|
|
20
19
|
];
|
|
20
|
+
const initialState = {
|
|
21
|
+
pagination: {
|
|
22
|
+
paginationModel: {
|
|
23
|
+
pageSize: 10,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const pageSizeOptions = [10];
|
|
21
28
|
export function SelectSpecific(props) {
|
|
22
29
|
const { currentModalityAgnosticSelection, currentModalitySpecificSelection, setCurrentModalitySpecificSelection, getEdges, } = props;
|
|
23
|
-
const classes = useStyles();
|
|
30
|
+
const { classes } = useStyles();
|
|
24
31
|
const queries = useQueries({
|
|
25
32
|
queries: currentModalityAgnosticSelection?.map(item => ({
|
|
26
33
|
queryKey: [item.nodeType, item.kgId],
|
|
@@ -47,15 +54,18 @@ export function SelectSpecific(props) {
|
|
|
47
54
|
})), [currentModalityAgnosticSelection, dataStatus]);
|
|
48
55
|
// Derive the set of selected row ids from the
|
|
49
56
|
// currentModalitySpecificSelection.
|
|
50
|
-
const rowSelectionModel = useMemo(() =>
|
|
57
|
+
const rowSelectionModel = useMemo(() => ({
|
|
58
|
+
ids: new Set(currentModalitySpecificSelection?.map(d => d.kgId) || []),
|
|
59
|
+
type: 'include',
|
|
60
|
+
}), [rows, currentModalitySpecificSelection]);
|
|
51
61
|
function handleSelection(newRowSelectionModel) {
|
|
52
|
-
const newSelection = newRowSelectionModel
|
|
62
|
+
const newSelection = Array.from(newRowSelectionModel.ids)
|
|
53
63
|
.map(kgId => data.find(d => d.target.kgId === kgId)?.target)
|
|
54
64
|
.filter(Boolean);
|
|
55
65
|
setCurrentModalitySpecificSelection(newSelection);
|
|
56
66
|
}
|
|
57
|
-
return (_jsxs(_Fragment, { children: [_jsx(Grid, {
|
|
67
|
+
return (_jsxs(_Fragment, { children: [_jsx(Grid, { size: 6, children: _jsx(Typography, { variant: "h6", children: "Select a feature type:" }) }), _jsx(Grid, { container: true, size: 6, children: _jsx(Grid, { children: _jsxs(FormControl, { fullWidth: true, children: [_jsx(NativeSelect, { defaultValue: "gene", classes: { select: classes.selectInput }, inputProps: {
|
|
58
68
|
name: 'age',
|
|
59
69
|
id: 'uncontrolled-native',
|
|
60
|
-
}, children: _jsx("option", { value: "gene", children: "Gene (RNA-seq)" }) }), _jsx(FormHelperText, { children: "Feature type (experimental modality)" })] }) }) }), _jsx(Grid, {
|
|
70
|
+
}, children: _jsx("option", { value: "gene", children: "Gene (RNA-seq)" }) }), _jsx(FormHelperText, { children: "Feature type (experimental modality)" })] }) }) }), _jsx(Grid, { container: true, size: 12, sx: { height: '450px' }, children: _jsx(DataGrid, { rows: rows, columns: columns, initialState: initialState, pageSizeOptions: pageSizeOptions, checkboxSelection: true, onRowSelectionModelChange: handleSelection, rowSelectionModel: rowSelectionModel }) })] }));
|
|
61
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Grid, RadioGroup, FormControl, FormLabel, Radio, FormControlLabel, Typography } from '@
|
|
3
|
+
import { Grid, RadioGroup, FormControl, FormLabel, Radio, FormControlLabel, Typography } from '@vitessce/styles';
|
|
4
4
|
export function SelectStratification(props) {
|
|
5
5
|
const { stratifications, currentStratificationSelection: currentStratificationSelectionProp, setCurrentStratificationSelection: setCurrentStratificationSelectionProp, } = props;
|
|
6
6
|
// Convert back and forth from the special value '__all__' to null.
|
|
@@ -14,5 +14,5 @@ export function SelectStratification(props) {
|
|
|
14
14
|
const structuralRegionOptions = stratifications?.filter(s => s.stratificationType === 'structural-region');
|
|
15
15
|
const hasSampleSetOptions = sampleSetOptions && sampleSetOptions.length > 0;
|
|
16
16
|
const hasStructuralRegionOptions = structuralRegionOptions && structuralRegionOptions.length > 0;
|
|
17
|
-
return (_jsxs(Grid, {
|
|
17
|
+
return (_jsxs(Grid, { size: 12, children: [_jsx(Typography, { variant: "h6", children: "Select a stratification option:" }), _jsx(FormControl, { children: _jsxs(RadioGroup, { "aria-labelledby": "demo-radio-buttons-group-label", value: currentStratificationSelection, onChange: setCurrentStratificationSelection, name: "radio-buttons-group", children: [_jsx(FormControlLabel, { value: "__all__", control: _jsx(Radio, {}), label: "No stratification" }), hasSampleSetOptions ? (_jsxs(_Fragment, { children: [_jsx(FormLabel, { children: "By participant group (clinical):" }), sampleSetOptions.map(s => (_jsx(FormControlLabel, { value: s.stratificationId, control: _jsx(Radio, {}), label: s.name }, s.name)))] })) : null, hasStructuralRegionOptions ? (_jsxs(_Fragment, { children: [_jsx(FormLabel, { children: "By segmentation-defined spatial region (structural):" }), structuralRegionOptions.map(s => (_jsx(FormControlLabel, { value: s.stratificationId, control: _jsx(Radio, {}), label: s.name }, s.name)))] })) : null] }) })] }));
|
|
18
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
|
-
import { Stepper, Step, StepLabel, Button, Grid, Box, Typography } from '@
|
|
3
|
+
import { Stepper, Step, StepLabel, Button, Grid, Box, Typography } from '@vitessce/styles';
|
|
4
4
|
import { ConfirmatoryCart } from './cart.js';
|
|
5
5
|
import { SelectAgnostic } from './select-agnostic.js';
|
|
6
6
|
import { SelectSpecific } from './select-specific.js';
|
|
@@ -13,7 +13,7 @@ const steps = [
|
|
|
13
13
|
];
|
|
14
14
|
export function ConfirmatoryStepper(props) {
|
|
15
15
|
const { autocompleteNode, currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection, currentModalitySpecificSelection, setCurrentModalitySpecificSelection, currentStratificationSelection, setCurrentStratificationSelection, getEdges, stratifications, onFinish, } = props;
|
|
16
|
-
const classes = useStyles();
|
|
16
|
+
const { classes } = useStyles();
|
|
17
17
|
const [activeStep, setActiveStep] = React.useState(0);
|
|
18
18
|
const [skipped, setSkipped] = React.useState(new Set());
|
|
19
19
|
const isStepOptional = step => step === 2;
|
|
@@ -51,7 +51,7 @@ export function ConfirmatoryStepper(props) {
|
|
|
51
51
|
onFinish();
|
|
52
52
|
}
|
|
53
53
|
}, [activeStep, steps]);
|
|
54
|
-
return (_jsxs(Grid, {
|
|
54
|
+
return (_jsxs(Grid, { container: true, size: 12, children: [_jsx(Grid, { container: true, size: 12, children: _jsx(Box, { className: classes.fullWidthBox, children: _jsx(Stepper, { activeStep: activeStep, children: steps.map((label, index) => {
|
|
55
55
|
const stepProps = {};
|
|
56
56
|
const labelProps = {};
|
|
57
57
|
if (isStepOptional(index)) {
|
|
@@ -61,5 +61,5 @@ export function ConfirmatoryStepper(props) {
|
|
|
61
61
|
stepProps.completed = false;
|
|
62
62
|
}
|
|
63
63
|
return (_jsx(Step, { ...stepProps, children: _jsx(StepLabel, { ...labelProps, children: label }) }, label));
|
|
64
|
-
}) }) }) }), _jsxs(Grid, {
|
|
64
|
+
}) }) }) }), _jsxs(Grid, { container: true, size: 12, sx: { marginTop: '20px' }, alignItems: "flex-start", children: [_jsx(Grid, { container: true, size: 8, children: activeStep === steps.length ? (_jsx(_Fragment, { children: _jsx(Typography, { style: { marginTop: '20px', marginBottom: '10px' }, children: "All steps completed - you're finished" }) })) : (_jsxs(_Fragment, { children: [activeStep === 0 ? (_jsx(SelectAgnostic, { autocompleteNode: autocompleteNode, currentModalityAgnosticSelection: currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection: setCurrentModalityAgnosticSelection, currentModalitySpecificSelection: currentModalitySpecificSelection, setCurrentModalitySpecificSelection: setCurrentModalitySpecificSelection, currentStratificationSelection: currentStratificationSelection, setCurrentStratificationSelection: setCurrentStratificationSelection, getEdges: getEdges, stratifications: stratifications })) : null, activeStep === 1 ? (_jsx(SelectSpecific, { autocompleteNode: autocompleteNode, currentModalityAgnosticSelection: currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection: setCurrentModalityAgnosticSelection, currentModalitySpecificSelection: currentModalitySpecificSelection, setCurrentModalitySpecificSelection: setCurrentModalitySpecificSelection, currentStratificationSelection: currentStratificationSelection, setCurrentStratificationSelection: setCurrentStratificationSelection, getEdges: getEdges, stratifications: stratifications })) : null, activeStep === 2 ? (_jsx(SelectStratification, { autocompleteNode: autocompleteNode, currentModalityAgnosticSelection: currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection: setCurrentModalityAgnosticSelection, currentModalitySpecificSelection: currentModalitySpecificSelection, setCurrentModalitySpecificSelection: setCurrentModalitySpecificSelection, currentStratificationSelection: currentStratificationSelection, setCurrentStratificationSelection: setCurrentStratificationSelection, getEdges: getEdges, stratifications: stratifications })) : null] })) }), _jsx(Grid, { container: true, size: 4, children: _jsx(ConfirmatoryCart, { currentModalityAgnosticSelection: currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection: setCurrentModalityAgnosticSelection, currentModalitySpecificSelection: currentModalitySpecificSelection, setCurrentModalitySpecificSelection: setCurrentModalitySpecificSelection, currentStratificationSelection: currentStratificationSelection, setCurrentStratificationSelection: setCurrentStratificationSelection, stratifications: stratifications }) }), _jsx(Box, { className: classes.fullWidthBox, children: activeStep === steps.length ? (_jsx(_Fragment, { children: _jsxs(Box, { style: { display: 'flex', flexDirection: 'row', paddingTop: '20px' }, children: [_jsx(Box, { style: { flex: '1 1 auto' } }), _jsx(Button, { onClick: handleReset, children: "Reset" })] }) })) : (_jsxs(Box, { style: { display: 'flex', flexDirection: 'row', paddingTop: '20px' }, children: [_jsx(Button, { color: "inherit", disabled: activeStep === 0, onClick: handleBack, style: { mr: 1 }, children: "Back" }), _jsx(Box, { style: { flex: '1 1 auto' } }), isStepOptional(activeStep) && (_jsx(Button, { color: "inherit", onClick: handleSkip, style: { marginRight: '10px' }, children: "Skip" })), _jsx(Button, { onClick: handleNext, children: activeStep === steps.length - 1 ? 'Finish' : 'Next' })] })) })] })] }));
|
|
65
65
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
|
-
import { Stepper, Step, StepLabel, Button, Grid, Box, Typography } from '@
|
|
3
|
+
import { Stepper, Step, StepLabel, Button, Grid, Box, Typography } from '@vitessce/styles';
|
|
4
4
|
import { ConfirmatoryCart } from './cart.js';
|
|
5
5
|
import { SelectStratification } from './select-stratification.js';
|
|
6
6
|
import { useStyles } from './styles.js';
|
|
@@ -9,7 +9,7 @@ const steps = [
|
|
|
9
9
|
];
|
|
10
10
|
export function ExploratoryStepper(props) {
|
|
11
11
|
const { autocompleteNode, currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection, currentModalitySpecificSelection, setCurrentModalitySpecificSelection, currentStratificationSelection, setCurrentStratificationSelection, getEdges, stratifications, onFinish, } = props;
|
|
12
|
-
const classes = useStyles();
|
|
12
|
+
const { classes } = useStyles();
|
|
13
13
|
const [activeStep, setActiveStep] = React.useState(0);
|
|
14
14
|
const [skipped, setSkipped] = React.useState(new Set());
|
|
15
15
|
const isStepOptional = step => step === 2;
|
|
@@ -47,7 +47,7 @@ export function ExploratoryStepper(props) {
|
|
|
47
47
|
onFinish();
|
|
48
48
|
}
|
|
49
49
|
}, [activeStep, steps]);
|
|
50
|
-
return (_jsxs(Grid, {
|
|
50
|
+
return (_jsxs(Grid, { container: true, size: 12, children: [_jsx(Grid, { container: true, size: 12, children: _jsx(Box, { className: classes.fullWidthBox, children: _jsx(Stepper, { activeStep: activeStep, children: steps.map((label, index) => {
|
|
51
51
|
const stepProps = {};
|
|
52
52
|
const labelProps = {};
|
|
53
53
|
if (isStepOptional(index)) {
|
|
@@ -57,5 +57,5 @@ export function ExploratoryStepper(props) {
|
|
|
57
57
|
stepProps.completed = false;
|
|
58
58
|
}
|
|
59
59
|
return (_jsx(Step, { ...stepProps, children: _jsx(StepLabel, { ...labelProps, children: label }) }, label));
|
|
60
|
-
}) }) }) }), _jsxs(Grid, {
|
|
60
|
+
}) }) }) }), _jsxs(Grid, { container: true, size: 12, sx: { marginTop: '20px' }, alignItems: "flex-start", children: [_jsx(Grid, { container: true, size: 8, children: activeStep === steps.length ? (_jsx(_Fragment, { children: _jsx(Typography, { style: { marginTop: '20px', marginBottom: '10px' }, children: "All steps completed - you're finished" }) })) : (_jsx(_Fragment, { children: activeStep === 0 ? (_jsx(SelectStratification, { autocompleteNode: autocompleteNode, currentModalityAgnosticSelection: currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection: setCurrentModalityAgnosticSelection, currentModalitySpecificSelection: currentModalitySpecificSelection, setCurrentModalitySpecificSelection: setCurrentModalitySpecificSelection, currentStratificationSelection: currentStratificationSelection, setCurrentStratificationSelection: setCurrentStratificationSelection, getEdges: getEdges, stratifications: stratifications })) : null })) }), _jsx(Grid, { container: true, size: 4, children: _jsx(ConfirmatoryCart, { currentModalityAgnosticSelection: currentModalityAgnosticSelection, setCurrentModalityAgnosticSelection: setCurrentModalityAgnosticSelection, currentModalitySpecificSelection: currentModalitySpecificSelection, setCurrentModalitySpecificSelection: setCurrentModalitySpecificSelection, currentStratificationSelection: currentStratificationSelection, setCurrentStratificationSelection: setCurrentStratificationSelection, stratifications: stratifications }) }), _jsx(Box, { className: classes.fullWidthBox, children: activeStep === steps.length ? (_jsx(_Fragment, { children: _jsxs(Box, { style: { display: 'flex', flexDirection: 'row', paddingTop: '20px' }, children: [_jsx(Box, { style: { flex: '1 1 auto' } }), _jsx(Button, { onClick: handleReset, children: "Reset" })] }) })) : (_jsxs(Box, { style: { display: 'flex', flexDirection: 'row', paddingTop: '20px' }, children: [_jsx(Button, { color: "inherit", disabled: activeStep === 0, onClick: handleBack, style: { mr: 1 }, children: "Back" }), _jsx(Box, { style: { flex: '1 1 auto' } }), isStepOptional(activeStep) && (_jsx(Button, { color: "inherit", onClick: handleSkip, style: { marginRight: '10px' }, children: "Skip" })), _jsx(Button, { onClick: handleNext, children: activeStep === steps.length - 1 ? 'Finish' : 'Next' })] })) })] })] }));
|
|
61
61
|
}
|
package/dist-tsc/styles.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
export const useStyles: (
|
|
1
|
+
export const useStyles: (params: void, muiStyleOverridesParams?: {
|
|
2
|
+
props: Record<string, unknown>;
|
|
3
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
4
|
+
} | undefined) => {
|
|
5
|
+
classes: Record<"header" | "fullWidthBox" | "selectButton" | "accordion" | "accordionDetails" | "cartUl" | "selectInput" | "searchInput", string>;
|
|
6
|
+
theme: import("@mui/material").Theme;
|
|
7
|
+
css: import("tss-react").Css;
|
|
8
|
+
cx: import("tss-react").Cx;
|
|
9
|
+
};
|
|
2
10
|
//# sourceMappingURL=styles.d.ts.map
|
package/dist-tsc/styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.js"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.js"],"names":[],"mappings":"AAEA;;cA+B+J,CAAC;;;kBAAoH,eAAsB;gBAAyB,WAAU;eAAsB,WAAU;EADzW"}
|
package/dist-tsc/styles.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/biomarker-select",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"author": "Gehlenborg Lab",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -16,28 +16,26 @@
|
|
|
16
16
|
"dist-tsc"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@
|
|
20
|
-
"@material-ui/icons": "~4.11.2",
|
|
21
|
-
"@material-ui/lab": "^4.0.0-alpha.61",
|
|
22
|
-
"@mui/x-data-grid": "^4.0.2",
|
|
23
|
-
"@tanstack/react-query": "^4.29.12",
|
|
19
|
+
"@tanstack/react-query": "^5.80.2",
|
|
24
20
|
"react-window": "^1.8.10",
|
|
25
21
|
"fuse.js": "^7.0.0",
|
|
26
22
|
"d3-dsv": "^1.1.1",
|
|
27
23
|
"clsx": "^1.1.1",
|
|
28
|
-
"@vitessce/
|
|
29
|
-
"@vitessce/
|
|
30
|
-
"@vitessce/
|
|
24
|
+
"@vitessce/styles": "3.6.1",
|
|
25
|
+
"@vitessce/constants-internal": "3.6.1",
|
|
26
|
+
"@vitessce/vit-s": "3.6.1",
|
|
27
|
+
"@vitessce/types": "3.6.1"
|
|
31
28
|
},
|
|
32
29
|
"devDependencies": {
|
|
33
|
-
"@testing-library/jest-dom": "^
|
|
34
|
-
"@testing-library/react": "^
|
|
30
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
31
|
+
"@testing-library/react": "^16.3.0",
|
|
35
32
|
"react": "^18.0.0",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
33
|
+
"react-dom": "^18.0.0",
|
|
34
|
+
"vite": "^6.3.5",
|
|
35
|
+
"vitest": "^3.1.4"
|
|
38
36
|
},
|
|
39
37
|
"peerDependencies": {
|
|
40
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
38
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
41
39
|
},
|
|
42
40
|
"scripts": {
|
|
43
41
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
useCoordination,
|
|
4
4
|
} from '@vitessce/vit-s';
|
|
5
5
|
import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
|
|
6
|
-
import { makeStyles } from '@
|
|
6
|
+
import { makeStyles } from '@vitessce/styles';
|
|
7
7
|
|
|
8
|
-
const useStyles = makeStyles(theme => ({
|
|
8
|
+
const useStyles = makeStyles()(theme => ({
|
|
9
9
|
buttonContainer: {
|
|
10
10
|
position: 'absolute',
|
|
11
11
|
right: 0,
|
|
@@ -52,7 +52,7 @@ export function ComparativeHeadingSubscriber(props) {
|
|
|
52
52
|
coordinationScopes,
|
|
53
53
|
);
|
|
54
54
|
|
|
55
|
-
const classes = useStyles();
|
|
55
|
+
const { classes } = useStyles();
|
|
56
56
|
|
|
57
57
|
const swapSampleSets = useCallback(() => {
|
|
58
58
|
if (sampleSetSelection?.length === 2) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useCallback } from 'react';
|
|
2
2
|
import { isEqual } from 'lodash-es';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import { makeStyles } from '@
|
|
4
|
+
import { makeStyles } from '@vitessce/styles';
|
|
5
5
|
import {
|
|
6
6
|
TitleInfo,
|
|
7
7
|
useReady,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from '@vitessce/vit-s';
|
|
14
14
|
import { ViewType, DataType, COMPONENT_COORDINATION_TYPES, ViewHelpMapping } from '@vitessce/constants-internal';
|
|
15
15
|
|
|
16
|
-
const useStyles = makeStyles(() => ({
|
|
16
|
+
const useStyles = makeStyles()(() => ({
|
|
17
17
|
selectedPair: {
|
|
18
18
|
fontWeight: 'bold',
|
|
19
19
|
},
|
|
@@ -37,7 +37,7 @@ export function SampleSetPairManagerSubscriber(props) {
|
|
|
37
37
|
helpText = ViewHelpMapping.SAMPLE_SET_PAIR_MANAGER,
|
|
38
38
|
} = props;
|
|
39
39
|
|
|
40
|
-
const classes = useStyles();
|
|
40
|
+
const { classes } = useStyles();
|
|
41
41
|
const loaders = useLoaders();
|
|
42
42
|
|
|
43
43
|
// Get "props" from the coordination space.
|
package/src/cart.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Accordion, AccordionDetails, AccordionSummary, Typography } from '@
|
|
3
|
-
import { ExpandMore as ExpandMoreIcon } from '@material-ui/icons';
|
|
2
|
+
import { Accordion, AccordionDetails, AccordionSummary, Typography, ExpandMore as ExpandMoreIcon } from '@vitessce/styles';
|
|
4
3
|
import { useStyles } from './styles.js';
|
|
5
4
|
|
|
6
5
|
|
|
@@ -16,7 +15,7 @@ export function ConfirmatoryCart(props) {
|
|
|
16
15
|
// eslint-disable-next-line no-unused-vars
|
|
17
16
|
setCurrentStratificationSelection,
|
|
18
17
|
} = props;
|
|
19
|
-
const classes = useStyles();
|
|
18
|
+
const { classes } = useStyles();
|
|
20
19
|
const [expandedAccordions, setExpandedAccordions] = React.useState([
|
|
21
20
|
'agnostic', 'specific', 'stratification',
|
|
22
21
|
]);
|
package/src/scmd-ui.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import { Button, ButtonGroup, Grid, Tooltip } from '@
|
|
3
|
+
import { Button, ButtonGroup, Grid, Tooltip } from '@vitessce/styles';
|
|
4
4
|
import { ConfirmatoryStepper } from './stepper-confirmatory.js';
|
|
5
5
|
import { ExploratoryStepper } from './stepper-exploratory.js';
|
|
6
6
|
import { useStyles } from './styles.js';
|
|
@@ -25,7 +25,7 @@ export function ScmdUi(props) {
|
|
|
25
25
|
stratifications,
|
|
26
26
|
onFinish,
|
|
27
27
|
} = props;
|
|
28
|
-
const classes = useStyles();
|
|
28
|
+
const { classes } = useStyles();
|
|
29
29
|
|
|
30
30
|
const mode = modeProp || 'confirmatory';
|
|
31
31
|
const step = mode === 'confirmatory' ? (stepProp || 'select-biomarkers') : (stepProp || 'define-stratification');
|
|
@@ -34,11 +34,11 @@ export function ScmdUi(props) {
|
|
|
34
34
|
|
|
35
35
|
const isConfirmatoryMode = mode === 'confirmatory';
|
|
36
36
|
return (
|
|
37
|
-
<Grid container
|
|
37
|
+
<Grid container sx={{ border: '0px solid red' }}>
|
|
38
38
|
{/* Header */}
|
|
39
|
-
<Grid
|
|
40
|
-
<Grid
|
|
41
|
-
<Grid
|
|
39
|
+
<Grid container size={12} className={classes.header}>
|
|
40
|
+
<Grid size={8} />
|
|
41
|
+
<Grid container size={4} justifyContent="flex-end">
|
|
42
42
|
<ButtonGroup variant="outlined" size="small" color="secondary" aria-label="Toggle between confirmatory and exploratory modes">
|
|
43
43
|
<Tooltip arrow title="Start from biomarker(s) of interest">
|
|
44
44
|
<Button variant={isConfirmatoryMode ? 'contained' : 'outlined'} onClick={() => setMode('confirmatory')}>Confirmatory (Hypothesis-driven)</Button>
|