@vitessce/statistical-plots 2.0.0-beta.1 → 2.0.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.
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
3
3
|
import clamp from 'lodash/clamp';
|
4
4
|
import { VegaPlot, VEGA_THEMES, DATASET_NAME } from '@vitessce/vega';
|
5
|
-
import { colorArrayToString } from '@vitessce/sets';
|
5
|
+
import { colorArrayToString } from '@vitessce/sets-utils';
|
6
6
|
import { capitalize } from '@vitessce/utils';
|
7
7
|
/**
|
8
8
|
* Gene expression histogram displayed as a bar chart,
|
@@ -134,7 +134,7 @@ export default function CellSetExpressionPlot(props) {
|
|
134
134
|
orient: 'left',
|
135
135
|
scale: 'yscale',
|
136
136
|
zindex: 1,
|
137
|
-
title: featureValueTransformName
|
137
|
+
title: (featureValueTransformName && featureValueTransformName !== 'None')
|
138
138
|
? [`${featureValueTransformName}-Transformed`, `Normalized ${capitalize(featureValueType)} Values`]
|
139
139
|
: `Normalized ${capitalize(featureValueType)} Values`,
|
140
140
|
},
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import React, { useMemo } from 'react';
|
3
|
-
import { TitleInfo, useCoordination, useLoaders, useUrls, useReady, useGridItemSize, useFeatureSelection, useObsSetsData, useObsFeatureMatrixIndices, registerPluginViewType, } from '@vitessce/vit-s';
|
3
|
+
import { TitleInfo, useCoordination, useLoaders, useUrls, useReady, useGridItemSize, useFeatureSelection, useObsSetsData, useObsFeatureMatrixIndices, useFeatureLabelsData, registerPluginViewType, } from '@vitessce/vit-s';
|
4
4
|
import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
|
5
5
|
import { VALUE_TRANSFORM_OPTIONS, capitalize, getValueTransformFunction } from '@vitessce/utils';
|
6
|
-
import { treeToObjectsBySetNames, treeToSetSizesBySetNames, mergeObsSets } from '@vitessce/sets';
|
6
|
+
import { treeToObjectsBySetNames, treeToSetSizesBySetNames, mergeObsSets } from '@vitessce/sets-utils';
|
7
7
|
import CellSetExpressionPlotOptions from './CellSetExpressionPlotOptions';
|
8
8
|
import CellSetExpressionPlot from './CellSetExpressionPlot';
|
9
9
|
import { useStyles } from './styles';
|
@@ -89,16 +89,19 @@ export function CellSetExpressionPlotSubscriber(props) {
|
|
89
89
|
// Get data from loaders using the data hooks.
|
90
90
|
// eslint-disable-next-line no-unused-vars
|
91
91
|
const [expressionData, loadedFeatureSelection, featureSelectionStatus] = useFeatureSelection(loaders, dataset, false, geneSelection, { obsType, featureType, featureValueType });
|
92
|
+
// TODO: support multiple feature labels using featureLabelsType coordination values.
|
93
|
+
const [{ featureLabelsMap }, featureLabelsStatus] = useFeatureLabelsData(loaders, dataset, addUrl, false, {}, {}, { featureType });
|
92
94
|
const [{ obsIndex }, matrixIndicesStatus] = useObsFeatureMatrixIndices(loaders, dataset, addUrl, false, { obsType, featureType, featureValueType });
|
93
95
|
const [{ obsSets: cellSets }, obsSetsStatus] = useObsSetsData(loaders, dataset, addUrl, true, {}, {}, { obsType });
|
94
96
|
const isReady = useReady([
|
95
97
|
featureSelectionStatus,
|
96
98
|
matrixIndicesStatus,
|
97
99
|
obsSetsStatus,
|
100
|
+
featureLabelsStatus,
|
98
101
|
]);
|
99
102
|
const [expressionArr, setArr, expressionMax] = useExpressionByCellSet(expressionData, obsIndex, cellSets, additionalCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient, theme);
|
100
103
|
const firstGeneSelected = geneSelection && geneSelection.length >= 1
|
101
|
-
? geneSelection[0]
|
104
|
+
? (featureLabelsMap?.get(geneSelection[0]) || geneSelection[0])
|
102
105
|
: null;
|
103
106
|
const selectedTransformName = transformOptions.find(o => o.value === featureValueTransform)?.name;
|
104
107
|
return (_jsx(TitleInfo, { title: `Expression by ${capitalize(obsType)} Set${(firstGeneSelected ? ` (${firstGeneSelected})` : '')}`, removeGridComponent: removeGridComponent, urls: urls, theme: theme, isReady: isReady, options: (_jsx(CellSetExpressionPlotOptions, { featureValueTransform: featureValueTransform, setFeatureValueTransform: setFeatureValueTransform, featureValueTransformCoefficient: featureValueTransformCoefficient, setFeatureValueTransformCoefficient: setFeatureValueTransformCoefficient, transformOptions: transformOptions })), children: _jsx("div", { ref: containerRef, className: classes.vegaContainer, children: expressionArr ? (_jsx(CellSetExpressionPlot, { domainMax: expressionMax, colors: setArr, data: expressionArr, theme: theme, width: width, height: height, obsType: obsType, featureValueType: featureValueType, featureValueTransformName: selectedTransformName })) : (_jsxs("span", { children: ["Select a ", featureType, "."] })) }) }));
|
package/dist/CellSetSizesPlot.js
CHANGED
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
3
3
|
import clamp from 'lodash/clamp';
|
4
4
|
import { VegaPlot, VEGA_THEMES } from '@vitessce/vega';
|
5
|
-
import { colorArrayToString } from '@vitessce/sets';
|
5
|
+
import { colorArrayToString } from '@vitessce/sets-utils';
|
6
6
|
import { capitalize } from '@vitessce/utils';
|
7
7
|
/**
|
8
8
|
* Cell set sizes displayed as a bar chart,
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React, { useMemo } from 'react';
|
3
3
|
import { TitleInfo, useCoordination, useLoaders, useUrls, useReady, useGridItemSize, useObsSetsData, registerPluginViewType, } from '@vitessce/vit-s';
|
4
4
|
import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
|
5
|
-
import { mergeObsSets, treeToSetSizesBySetNames } from '@vitessce/sets';
|
5
|
+
import { mergeObsSets, treeToSetSizesBySetNames } from '@vitessce/sets-utils';
|
6
6
|
import { capitalize } from '@vitessce/utils';
|
7
7
|
import CellSetSizesPlot from './CellSetSizesPlot';
|
8
8
|
import { useStyles } from './styles';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vitessce/statistical-plots",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.1",
|
4
4
|
"author": "Gehlenborg Lab",
|
5
5
|
"homepage": "http://vitessce.io",
|
6
6
|
"repository": {
|
@@ -14,13 +14,13 @@
|
|
14
14
|
],
|
15
15
|
"dependencies": {
|
16
16
|
"@material-ui/core": "~4.12.3",
|
17
|
-
"@vitessce/constants-internal": "2.0.0-beta.1",
|
18
|
-
"@vitessce/sets": "2.0.0-beta.1",
|
19
|
-
"@vitessce/utils": "2.0.0-beta.1",
|
20
|
-
"@vitessce/vega": "2.0.0-beta.1",
|
21
|
-
"@vitessce/vit-s": "2.0.0-beta.1",
|
22
17
|
"d3-array": "^2.4.0",
|
23
|
-
"lodash": "^4.17.21"
|
18
|
+
"lodash": "^4.17.21",
|
19
|
+
"@vitessce/constants-internal": "2.0.1",
|
20
|
+
"@vitessce/sets-utils": "2.0.1",
|
21
|
+
"@vitessce/utils": "2.0.1",
|
22
|
+
"@vitessce/vega": "2.0.1",
|
23
|
+
"@vitessce/vit-s": "2.0.1"
|
24
24
|
},
|
25
25
|
"devDependencies": {
|
26
26
|
"react": "^18.0.0",
|