@vitessce/statistical-plots 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 +190 -169
- package/dist-tsc/CellSetExpressionPlotSubscriber.d.ts.map +1 -1
- package/dist-tsc/CellSetExpressionPlotSubscriber.js +8 -4
- package/dist-tsc/CellSetSizesPlotSubscriber.d.ts.map +1 -1
- package/dist-tsc/CellSetSizesPlotSubscriber.js +3 -5
- package/dist-tsc/ExpressionHistogramSubscriber.d.ts.map +1 -1
- package/dist-tsc/ExpressionHistogramSubscriber.js +4 -2
- package/package.json +8 -8
- package/src/CellSetExpressionPlotSubscriber.js +11 -7
- package/src/CellSetSizesPlotSubscriber.js +4 -6
- package/src/ExpressionHistogramSubscriber.js +7 -3
| @@ -1 +1 @@ | |
| 1 | 
            -
            {"version":3,"file":"CellSetExpressionPlotSubscriber.d.ts","sourceRoot":"","sources":["../src/CellSetExpressionPlotSubscriber.js"],"names":[],"mappings":"AAiGA;;;;;;;;;GASG;AACH;IAL2B,mBAAmB;IACrB,kBAAkB,EAAhC,MAAM;IAEQ,KAAK,EAAnB,MAAM; | 
| 1 | 
            +
            {"version":3,"file":"CellSetExpressionPlotSubscriber.d.ts","sourceRoot":"","sources":["../src/CellSetExpressionPlotSubscriber.js"],"names":[],"mappings":"AAiGA;;;;;;;;;GASG;AACH;IAL2B,mBAAmB;IACrB,kBAAkB,EAAhC,MAAM;IAEQ,KAAK,EAAnB,MAAM;gBAsHhB"}
         | 
| @@ -83,21 +83,25 @@ export function CellSetExpressionPlotSubscriber(props) { | |
| 83 83 | 
             
                // Get "props" from the coordination space.
         | 
| 84 84 | 
             
                const [{ dataset, obsType, featureType, featureValueType, featureSelection: geneSelection, featureValueTransform, featureValueTransformCoefficient, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets, }, { setFeatureValueTransform, setFeatureValueTransformCoefficient, }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.OBS_SET_FEATURE_VALUE_DISTRIBUTION], coordinationScopes);
         | 
| 85 85 | 
             
                const [width, height, containerRef] = useGridItemSize();
         | 
| 86 | 
            -
                const [urls, addUrl] = useUrls(loaders, dataset);
         | 
| 87 86 | 
             
                const transformOptions = VALUE_TRANSFORM_OPTIONS;
         | 
| 88 87 | 
             
                // Get data from loaders using the data hooks.
         | 
| 89 88 | 
             
                // eslint-disable-next-line no-unused-vars
         | 
| 90 89 | 
             
                const [expressionData, loadedFeatureSelection, featureSelectionStatus] = useFeatureSelection(loaders, dataset, false, geneSelection, { obsType, featureType, featureValueType });
         | 
| 91 90 | 
             
                // TODO: support multiple feature labels using featureLabelsType coordination values.
         | 
| 92 | 
            -
                const [{ featureLabelsMap }, featureLabelsStatus] = useFeatureLabelsData(loaders, dataset,  | 
| 93 | 
            -
                const [{ obsIndex }, matrixIndicesStatus] = useObsFeatureMatrixIndices(loaders, dataset,  | 
| 94 | 
            -
                const [{ obsSets: cellSets }, obsSetsStatus] = useObsSetsData(loaders, dataset,  | 
| 91 | 
            +
                const [{ featureLabelsMap }, featureLabelsStatus, featureLabelsUrls] = useFeatureLabelsData(loaders, dataset, false, {}, {}, { featureType });
         | 
| 92 | 
            +
                const [{ obsIndex }, matrixIndicesStatus, matrixIndicesUrls] = useObsFeatureMatrixIndices(loaders, dataset, false, { obsType, featureType, featureValueType });
         | 
| 93 | 
            +
                const [{ obsSets: cellSets }, obsSetsStatus, obsSetsUrls] = useObsSetsData(loaders, dataset, true, {}, {}, { obsType });
         | 
| 95 94 | 
             
                const isReady = useReady([
         | 
| 96 95 | 
             
                    featureSelectionStatus,
         | 
| 97 96 | 
             
                    matrixIndicesStatus,
         | 
| 98 97 | 
             
                    obsSetsStatus,
         | 
| 99 98 | 
             
                    featureLabelsStatus,
         | 
| 100 99 | 
             
                ]);
         | 
| 100 | 
            +
                const urls = useUrls([
         | 
| 101 | 
            +
                    featureLabelsUrls,
         | 
| 102 | 
            +
                    matrixIndicesUrls,
         | 
| 103 | 
            +
                    obsSetsUrls,
         | 
| 104 | 
            +
                ]);
         | 
| 101 105 | 
             
                const [expressionArr, setArr, expressionMax] = useExpressionByCellSet(expressionData, obsIndex, cellSets, additionalCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient, theme);
         | 
| 102 106 | 
             
                const firstGeneSelected = geneSelection && geneSelection.length >= 1
         | 
| 103 107 | 
             
                    ? (featureLabelsMap?.get(geneSelection[0]) || geneSelection[0])
         | 
| @@ -1 +1 @@ | |
| 1 | 
            -
            {"version":3,"file":"CellSetSizesPlotSubscriber.d.ts","sourceRoot":"","sources":["../src/CellSetSizesPlotSubscriber.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;GAUG;AACH;IAN2B,mBAAmB;IACnB,OAAO;IAET,KAAK,EAAnB,MAAM;IACQ,KAAK,EAAnB,MAAM; | 
| 1 | 
            +
            {"version":3,"file":"CellSetSizesPlotSubscriber.d.ts","sourceRoot":"","sources":["../src/CellSetSizesPlotSubscriber.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;GAUG;AACH;IAN2B,mBAAmB;IACnB,OAAO;IAET,KAAK,EAAnB,MAAM;IACQ,KAAK,EAAnB,MAAM;gBA2HhB"}
         | 
| @@ -26,16 +26,14 @@ export function CellSetSizesPlotSubscriber(props) { | |
| 26 26 | 
             
                const [{ dataset, obsType, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets, obsSetExpansion: cellSetExpansion, }, { setObsSetSelection: setCellSetSelection, setObsSetColor: setCellSetColor, }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.OBS_SET_SIZES], coordinationScopes);
         | 
| 27 27 | 
             
                const title = titleOverride || `${capitalize(obsType)} Set Sizes`;
         | 
| 28 28 | 
             
                const [width, height, containerRef] = useGridItemSize();
         | 
| 29 | 
            -
                const [urls, addUrl] = useUrls(loaders, dataset);
         | 
| 30 29 | 
             
                // the name of the hierarchy that was clicked on last
         | 
| 31 30 | 
             
                const [currentHierarchy, setCurrentHierarchy] = useState([]);
         | 
| 32 31 | 
             
                // the previous cell set that was selected
         | 
| 33 32 | 
             
                const [prevCellSetSelection, setPrevCellSetSelection] = useState([]);
         | 
| 34 33 | 
             
                // Get data from loaders using the data hooks.
         | 
| 35 | 
            -
                const [{ obsSets: cellSets }, obsSetsStatus] = useObsSetsData(loaders, dataset,  | 
| 36 | 
            -
                const isReady = useReady([
         | 
| 37 | 
            -
             | 
| 38 | 
            -
                ]);
         | 
| 34 | 
            +
                const [{ obsSets: cellSets }, obsSetsStatus, obsSetsUrls] = useObsSetsData(loaders, dataset, true, { setObsSetSelection: setCellSetSelection, setObsSetColor: setCellSetColor }, { obsSetSelection: cellSetSelection, obsSetColor: cellSetColor }, { obsType });
         | 
| 35 | 
            +
                const isReady = useReady([obsSetsStatus]);
         | 
| 36 | 
            +
                const urls = useUrls([obsSetsUrls]);
         | 
| 39 37 | 
             
                const mergedCellSets = useMemo(() => mergeObsSets(cellSets, additionalCellSets), [cellSets, additionalCellSets]);
         | 
| 40 38 | 
             
                const data = useMemo(() => {
         | 
| 41 39 | 
             
                    if (cellSetSelection && cellSetColor && mergedCellSets && cellSets) {
         | 
| @@ -1 +1 @@ | |
| 1 | 
            -
            {"version":3,"file":"ExpressionHistogramSubscriber.d.ts","sourceRoot":"","sources":["../src/ExpressionHistogramSubscriber.js"],"names":[],"mappings":"AAcA;;;;;;;;;GASG;AACH;IAL2B,mBAAmB;IACrB,kBAAkB,EAAhC,MAAM;IAEQ,KAAK,EAAnB,MAAM; | 
| 1 | 
            +
            {"version":3,"file":"ExpressionHistogramSubscriber.d.ts","sourceRoot":"","sources":["../src/ExpressionHistogramSubscriber.js"],"names":[],"mappings":"AAcA;;;;;;;;;GASG;AACH;IAL2B,mBAAmB;IACrB,kBAAkB,EAAhC,MAAM;IAEQ,KAAK,EAAnB,MAAM;gBAqHhB"}
         | 
| @@ -23,15 +23,17 @@ export function ExpressionHistogramSubscriber(props) { | |
| 23 23 | 
             
                // Get "props" from the coordination space.
         | 
| 24 24 | 
             
                const [{ dataset, obsType, featureType, featureValueType, featureSelection: geneSelection, additionalObsSets: additionalCellSets, obsSetColor: cellSetColor, }, { setAdditionalObsSets: setAdditionalCellSets, setObsSetColor: setCellSetColor, setObsColorEncoding: setCellColorEncoding, setObsSetSelection: setCellSetSelection, }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.FEATURE_VALUE_HISTOGRAM], coordinationScopes);
         | 
| 25 25 | 
             
                const [width, height, containerRef] = useGridItemSize();
         | 
| 26 | 
            -
                const [urls, addUrl] = useUrls(loaders, dataset);
         | 
| 27 26 | 
             
                // Get data from loaders using the data hooks.
         | 
| 28 | 
            -
                const [{ obsIndex, featureIndex, obsFeatureMatrix }, matrixStatus] = useObsFeatureMatrixData(loaders, dataset,  | 
| 27 | 
            +
                const [{ obsIndex, featureIndex, obsFeatureMatrix }, matrixStatus, matrixUrls,] = useObsFeatureMatrixData(loaders, dataset, true, {}, {}, { obsType, featureType, featureValueType });
         | 
| 29 28 | 
             
                // eslint-disable-next-line no-unused-vars
         | 
| 30 29 | 
             
                const [expressionData, loadedFeatureSelection, featureSelectionStatus] = useFeatureSelection(loaders, dataset, false, geneSelection, { obsType, featureType, featureValueType });
         | 
| 31 30 | 
             
                const isReady = useReady([
         | 
| 32 31 | 
             
                    matrixStatus,
         | 
| 33 32 | 
             
                    featureSelectionStatus,
         | 
| 34 33 | 
             
                ]);
         | 
| 34 | 
            +
                const urls = useUrls([
         | 
| 35 | 
            +
                    matrixUrls,
         | 
| 36 | 
            +
                ]);
         | 
| 35 37 | 
             
                const firstGeneSelected = geneSelection && geneSelection.length >= 1
         | 
| 36 38 | 
             
                    ? geneSelection[0]
         | 
| 37 39 | 
             
                    : null;
         | 
    
        package/package.json
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            {
         | 
| 2 2 | 
             
              "name": "@vitessce/statistical-plots",
         | 
| 3 | 
            -
              "version": "3. | 
| 3 | 
            +
              "version": "3.1.0",
         | 
| 4 4 | 
             
              "author": "Gehlenborg Lab",
         | 
| 5 5 | 
             
              "homepage": "http://vitessce.io",
         | 
| 6 6 | 
             
              "repository": {
         | 
| @@ -19,23 +19,23 @@ | |
| 19 19 | 
             
                "@material-ui/core": "~4.12.3",
         | 
| 20 20 | 
             
                "d3-array": "^2.4.0",
         | 
| 21 21 | 
             
                "lodash-es": "^4.17.21",
         | 
| 22 | 
            -
                "@vitessce/constants-internal": "3. | 
| 23 | 
            -
                "@vitessce/sets-utils": "3. | 
| 24 | 
            -
                "@vitessce/utils": "3. | 
| 25 | 
            -
                "@vitessce/vega": "3. | 
| 26 | 
            -
                "@vitessce/vit-s": "3. | 
| 22 | 
            +
                "@vitessce/constants-internal": "3.1.0",
         | 
| 23 | 
            +
                "@vitessce/sets-utils": "3.1.0",
         | 
| 24 | 
            +
                "@vitessce/utils": "3.1.0",
         | 
| 25 | 
            +
                "@vitessce/vega": "3.1.0",
         | 
| 26 | 
            +
                "@vitessce/vit-s": "3.1.0"
         | 
| 27 27 | 
             
              },
         | 
| 28 28 | 
             
              "devDependencies": {
         | 
| 29 29 | 
             
                "react": "^18.0.0",
         | 
| 30 30 | 
             
                "vite": "^4.3.0",
         | 
| 31 | 
            -
                "vitest": "^0. | 
| 31 | 
            +
                "vitest": "^0.32.2"
         | 
| 32 32 | 
             
              },
         | 
| 33 33 | 
             
              "peerDependencies": {
         | 
| 34 34 | 
             
                "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
         | 
| 35 35 | 
             
              },
         | 
| 36 36 | 
             
              "scripts": {
         | 
| 37 37 | 
             
                "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
         | 
| 38 | 
            -
                "test": "pnpm exec vitest --run | 
| 38 | 
            +
                "test": "pnpm exec vitest --run"
         | 
| 39 39 | 
             
              },
         | 
| 40 40 | 
             
              "module": "dist/index.js",
         | 
| 41 41 | 
             
              "exports": {
         | 
| @@ -136,7 +136,6 @@ export function CellSetExpressionPlotSubscriber(props) { | |
| 136 136 | 
             
              );
         | 
| 137 137 |  | 
| 138 138 | 
             
              const [width, height, containerRef] = useGridItemSize();
         | 
| 139 | 
            -
              const [urls, addUrl] = useUrls(loaders, dataset);
         | 
| 140 139 |  | 
| 141 140 | 
             
              const transformOptions = VALUE_TRANSFORM_OPTIONS;
         | 
| 142 141 |  | 
| @@ -147,16 +146,16 @@ export function CellSetExpressionPlotSubscriber(props) { | |
| 147 146 | 
             
                { obsType, featureType, featureValueType },
         | 
| 148 147 | 
             
              );
         | 
| 149 148 | 
             
              // TODO: support multiple feature labels using featureLabelsType coordination values.
         | 
| 150 | 
            -
              const [{ featureLabelsMap }, featureLabelsStatus] = useFeatureLabelsData(
         | 
| 151 | 
            -
                loaders, dataset,  | 
| 149 | 
            +
              const [{ featureLabelsMap }, featureLabelsStatus, featureLabelsUrls] = useFeatureLabelsData(
         | 
| 150 | 
            +
                loaders, dataset, false, {}, {},
         | 
| 152 151 | 
             
                { featureType },
         | 
| 153 152 | 
             
              );
         | 
| 154 | 
            -
              const [{ obsIndex }, matrixIndicesStatus] = useObsFeatureMatrixIndices(
         | 
| 155 | 
            -
                loaders, dataset,  | 
| 153 | 
            +
              const [{ obsIndex }, matrixIndicesStatus, matrixIndicesUrls] = useObsFeatureMatrixIndices(
         | 
| 154 | 
            +
                loaders, dataset, false,
         | 
| 156 155 | 
             
                { obsType, featureType, featureValueType },
         | 
| 157 156 | 
             
              );
         | 
| 158 | 
            -
              const [{ obsSets: cellSets }, obsSetsStatus] = useObsSetsData(
         | 
| 159 | 
            -
                loaders, dataset,  | 
| 157 | 
            +
              const [{ obsSets: cellSets }, obsSetsStatus, obsSetsUrls] = useObsSetsData(
         | 
| 158 | 
            +
                loaders, dataset, true, {}, {},
         | 
| 160 159 | 
             
                { obsType },
         | 
| 161 160 | 
             
              );
         | 
| 162 161 | 
             
              const isReady = useReady([
         | 
| @@ -165,6 +164,11 @@ export function CellSetExpressionPlotSubscriber(props) { | |
| 165 164 | 
             
                obsSetsStatus,
         | 
| 166 165 | 
             
                featureLabelsStatus,
         | 
| 167 166 | 
             
              ]);
         | 
| 167 | 
            +
              const urls = useUrls([
         | 
| 168 | 
            +
                featureLabelsUrls,
         | 
| 169 | 
            +
                matrixIndicesUrls,
         | 
| 170 | 
            +
                obsSetsUrls,
         | 
| 171 | 
            +
              ]);
         | 
| 168 172 |  | 
| 169 173 | 
             
              const [expressionArr, setArr, expressionMax] = useExpressionByCellSet(
         | 
| 170 174 | 
             
                expressionData, obsIndex, cellSets, additionalCellSets,
         | 
| @@ -53,7 +53,6 @@ export function CellSetSizesPlotSubscriber(props) { | |
| 53 53 | 
             
              const title = titleOverride || `${capitalize(obsType)} Set Sizes`;
         | 
| 54 54 |  | 
| 55 55 | 
             
              const [width, height, containerRef] = useGridItemSize();
         | 
| 56 | 
            -
              const [urls, addUrl] = useUrls(loaders, dataset);
         | 
| 57 56 |  | 
| 58 57 | 
             
              // the name of the hierarchy that was clicked on last
         | 
| 59 58 | 
             
              const [currentHierarchy, setCurrentHierarchy] = useState([]);
         | 
| @@ -61,15 +60,14 @@ export function CellSetSizesPlotSubscriber(props) { | |
| 61 60 | 
             
              const [prevCellSetSelection, setPrevCellSetSelection] = useState([]);
         | 
| 62 61 |  | 
| 63 62 | 
             
              // Get data from loaders using the data hooks.
         | 
| 64 | 
            -
              const [{ obsSets: cellSets }, obsSetsStatus] = useObsSetsData(
         | 
| 65 | 
            -
                loaders, dataset,  | 
| 63 | 
            +
              const [{ obsSets: cellSets }, obsSetsStatus, obsSetsUrls] = useObsSetsData(
         | 
| 64 | 
            +
                loaders, dataset, true,
         | 
| 66 65 | 
             
                { setObsSetSelection: setCellSetSelection, setObsSetColor: setCellSetColor },
         | 
| 67 66 | 
             
                { obsSetSelection: cellSetSelection, obsSetColor: cellSetColor },
         | 
| 68 67 | 
             
                { obsType },
         | 
| 69 68 | 
             
              );
         | 
| 70 | 
            -
              const isReady = useReady([
         | 
| 71 | 
            -
             | 
| 72 | 
            -
              ]);
         | 
| 69 | 
            +
              const isReady = useReady([obsSetsStatus]);
         | 
| 70 | 
            +
              const urls = useUrls([obsSetsUrls]);
         | 
| 73 71 |  | 
| 74 72 | 
             
              const mergedCellSets = useMemo(
         | 
| 75 73 | 
             
                () => mergeObsSets(cellSets, additionalCellSets),
         | 
| @@ -52,11 +52,12 @@ export function ExpressionHistogramSubscriber(props) { | |
| 52 52 | 
             
              );
         | 
| 53 53 |  | 
| 54 54 | 
             
              const [width, height, containerRef] = useGridItemSize();
         | 
| 55 | 
            -
              const [urls, addUrl] = useUrls(loaders, dataset);
         | 
| 56 55 |  | 
| 57 56 | 
             
              // Get data from loaders using the data hooks.
         | 
| 58 | 
            -
              const [ | 
| 59 | 
            -
                 | 
| 57 | 
            +
              const [
         | 
| 58 | 
            +
                { obsIndex, featureIndex, obsFeatureMatrix }, matrixStatus, matrixUrls,
         | 
| 59 | 
            +
              ] = useObsFeatureMatrixData(
         | 
| 60 | 
            +
                loaders, dataset, true, {}, {},
         | 
| 60 61 | 
             
                { obsType, featureType, featureValueType },
         | 
| 61 62 | 
             
              );
         | 
| 62 63 | 
             
              // eslint-disable-next-line no-unused-vars
         | 
| @@ -68,6 +69,9 @@ export function ExpressionHistogramSubscriber(props) { | |
| 68 69 | 
             
                matrixStatus,
         | 
| 69 70 | 
             
                featureSelectionStatus,
         | 
| 70 71 | 
             
              ]);
         | 
| 72 | 
            +
              const urls = useUrls([
         | 
| 73 | 
            +
                matrixUrls,
         | 
| 74 | 
            +
              ]);
         | 
| 71 75 |  | 
| 72 76 | 
             
              const firstGeneSelected = geneSelection && geneSelection.length >= 1
         | 
| 73 77 | 
             
                ? geneSelection[0]
         |