@vitessce/scatterplot 3.5.10 → 3.5.12
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/{deflate-c5f0776b.js → deflate-f6d73584.js} +1 -1
- package/dist/{index-d522aebb.js → index-54d5c6e0.js} +59 -12
- package/dist/index.js +1 -1
- package/dist/{jpeg-59437681.js → jpeg-8d0a6c28.js} +1 -1
- package/dist/{lerc-124acb2f.js → lerc-71eafedf.js} +1 -1
- package/dist/{lzw-723527e2.js → lzw-7efc2185.js} +1 -1
- package/dist/{packbits-74a934fa.js → packbits-4c889da6.js} +1 -1
- package/dist/{raw-8fb6d135.js → raw-4aa2df23.js} +1 -1
- package/dist/{webimage-cdc82395.js → webimage-19762a61.js} +1 -1
- package/dist-tsc/Scatterplot.d.ts.map +1 -1
- package/dist-tsc/Scatterplot.js +11 -1
- package/dist-tsc/ScatterplotOptions.d.ts.map +1 -1
- package/dist-tsc/ScatterplotOptions.js +8 -2
- package/package.json +7 -7
- package/src/Scatterplot.js +12 -1
- package/src/ScatterplotOptions.js +36 -0
|
@@ -110842,8 +110842,15 @@ class SelectionLayer extends CompositeLayer {
|
|
|
110842
110842
|
if (!nodePolygonContainsSelectedPolygon && !nodePolygonWithinSelectedPolygon && !nodePolygonOverlapsSelectedPolgyon) {
|
|
110843
110843
|
return true;
|
|
110844
110844
|
}
|
|
110845
|
-
if (node.data
|
|
110846
|
-
|
|
110845
|
+
if (node.data) {
|
|
110846
|
+
let current = node;
|
|
110847
|
+
while (current) {
|
|
110848
|
+
const pointCoords = [].slice.call(getObsCoords(current.data));
|
|
110849
|
+
if (booleanPointInPolygon$1(point$1(pointCoords), selectedPolygon)) {
|
|
110850
|
+
pickingInfos.push(current.data);
|
|
110851
|
+
}
|
|
110852
|
+
current = current.next;
|
|
110853
|
+
}
|
|
110847
110854
|
}
|
|
110848
110855
|
return false;
|
|
110849
110856
|
});
|
|
@@ -112055,16 +112062,16 @@ function addDecoder(cases, importFn) {
|
|
|
112055
112062
|
}
|
|
112056
112063
|
cases.forEach((c2) => registry$1.set(c2, importFn));
|
|
112057
112064
|
}
|
|
112058
|
-
addDecoder([void 0, 1], () => import("./raw-
|
|
112059
|
-
addDecoder(5, () => import("./lzw-
|
|
112065
|
+
addDecoder([void 0, 1], () => import("./raw-4aa2df23.js").then((m2) => m2.default));
|
|
112066
|
+
addDecoder(5, () => import("./lzw-7efc2185.js").then((m2) => m2.default));
|
|
112060
112067
|
addDecoder(6, () => {
|
|
112061
112068
|
throw new Error("old style JPEG compression is not supported.");
|
|
112062
112069
|
});
|
|
112063
|
-
addDecoder(7, () => import("./jpeg-
|
|
112064
|
-
addDecoder([8, 32946], () => import("./deflate-
|
|
112065
|
-
addDecoder(32773, () => import("./packbits-
|
|
112066
|
-
addDecoder(34887, () => import("./lerc-
|
|
112067
|
-
addDecoder(50001, () => import("./webimage-
|
|
112070
|
+
addDecoder(7, () => import("./jpeg-8d0a6c28.js").then((m2) => m2.default));
|
|
112071
|
+
addDecoder([8, 32946], () => import("./deflate-f6d73584.js").then((m2) => m2.default));
|
|
112072
|
+
addDecoder(32773, () => import("./packbits-4c889da6.js").then((m2) => m2.default));
|
|
112073
|
+
addDecoder(34887, () => import("./lerc-71eafedf.js").then((m2) => m2.default));
|
|
112074
|
+
addDecoder(50001, () => import("./webimage-19762a61.js").then((m2) => m2.default));
|
|
112068
112075
|
function decodeRowAcc(row, stride) {
|
|
112069
112076
|
let length2 = row.length - stride;
|
|
112070
112077
|
let offset5 = 0;
|
|
@@ -137484,7 +137491,10 @@ const getPosition = (object2, { index: index2, data, target }) => {
|
|
|
137484
137491
|
target[2] = POINT_LAYER_Z_INDEX;
|
|
137485
137492
|
return target;
|
|
137486
137493
|
};
|
|
137487
|
-
const contourGetWeight = (object2, { index: index2, data }) =>
|
|
137494
|
+
const contourGetWeight = (object2, { index: index2, data }) => {
|
|
137495
|
+
var _a3;
|
|
137496
|
+
return (_a3 = data.src.featureValues) == null ? void 0 : _a3[index2];
|
|
137497
|
+
};
|
|
137488
137498
|
const contourGetPosition = (object2, { index: index2, data, target }) => {
|
|
137489
137499
|
target[0] = data.src.embeddingX[index2];
|
|
137490
137500
|
target[1] = -data.src.embeddingY[index2];
|
|
@@ -137822,6 +137832,16 @@ class Scatterplot extends AbstractSpatialOrScatterplot {
|
|
|
137822
137832
|
makeFlippedGetObsCoords
|
|
137823
137833
|
);
|
|
137824
137834
|
}
|
|
137835
|
+
componentWillUnmount() {
|
|
137836
|
+
delete this.cellsQuadTree;
|
|
137837
|
+
delete this.cellsLayer;
|
|
137838
|
+
delete this.cellsData;
|
|
137839
|
+
delete this.stratifiedData;
|
|
137840
|
+
delete this.cellSetsForceSimulation;
|
|
137841
|
+
delete this.cellSetsLabelPrevZoom;
|
|
137842
|
+
delete this.cellSetsLayers;
|
|
137843
|
+
delete this.contourLayers;
|
|
137844
|
+
}
|
|
137825
137845
|
/**
|
|
137826
137846
|
* Here, asynchronously check whether props have
|
|
137827
137847
|
* updated which require re-computing memoized variables,
|
|
@@ -138035,6 +138055,7 @@ if (typeof document !== "undefined") {
|
|
|
138035
138055
|
else
|
|
138036
138056
|
document.addEventListener("DOMContentLoaded", $bbed8b41f857bcc0$var$setupGlobalEvents);
|
|
138037
138057
|
}
|
|
138058
|
+
const FEATURE_AGGREGATION_STRATEGIES = ["first", "last", "sum", "mean"];
|
|
138038
138059
|
function ScatterplotOptions(props) {
|
|
138039
138060
|
const {
|
|
138040
138061
|
children,
|
|
@@ -138071,7 +138092,9 @@ function ScatterplotOptions(props) {
|
|
|
138071
138092
|
setContourPercentiles,
|
|
138072
138093
|
defaultContourPercentiles,
|
|
138073
138094
|
contourColorEncoding,
|
|
138074
|
-
setContourColorEncoding
|
|
138095
|
+
setContourColorEncoding,
|
|
138096
|
+
featureAggregationStrategy,
|
|
138097
|
+
setFeatureAggregationStrategy
|
|
138075
138098
|
} = props;
|
|
138076
138099
|
const scatterplotOptionsId = $bdb11010cef70236$export$f680877a34711e37();
|
|
138077
138100
|
const observationsLabelNice = capitalize$1(observationsLabel);
|
|
@@ -138129,6 +138152,9 @@ function ScatterplotOptions(props) {
|
|
|
138129
138152
|
debounce$2(handlePercentilesChange, 5, { trailing: true }),
|
|
138130
138153
|
[handlePercentilesChange]
|
|
138131
138154
|
);
|
|
138155
|
+
function handleFeatureAggregationStrategyChange(event) {
|
|
138156
|
+
setFeatureAggregationStrategy(event.target.value);
|
|
138157
|
+
}
|
|
138132
138158
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(OptionsContainer, { children: [
|
|
138133
138159
|
children,
|
|
138134
138160
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -138515,7 +138541,28 @@ function ScatterplotOptions(props) {
|
|
|
138515
138541
|
max: 0.999
|
|
138516
138542
|
}
|
|
138517
138543
|
) })
|
|
138518
|
-
] })
|
|
138544
|
+
] }),
|
|
138545
|
+
setFeatureAggregationStrategy ? /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow$1, { children: [
|
|
138546
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell$1, { className: classes.labelCell, variant: "head", scope: "row", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
138547
|
+
"label",
|
|
138548
|
+
{
|
|
138549
|
+
htmlFor: `feature-aggregation-strategy-${scatterplotOptionsId}`,
|
|
138550
|
+
children: "Feature Aggregation Strategy"
|
|
138551
|
+
}
|
|
138552
|
+
) }),
|
|
138553
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell$1, { className: classes.inputCell, variant: "body", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
138554
|
+
OptionSelect,
|
|
138555
|
+
{
|
|
138556
|
+
className: classes.select,
|
|
138557
|
+
value: featureAggregationStrategy ?? "first",
|
|
138558
|
+
onChange: handleFeatureAggregationStrategyChange,
|
|
138559
|
+
inputProps: {
|
|
138560
|
+
id: `feature-aggregation-strategy-${scatterplotOptionsId}`
|
|
138561
|
+
},
|
|
138562
|
+
children: FEATURE_AGGREGATION_STRATEGIES.map((opt) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: opt, children: capitalize$1(opt) }, opt))
|
|
138563
|
+
}
|
|
138564
|
+
) })
|
|
138565
|
+
] }) : null
|
|
138519
138566
|
] });
|
|
138520
138567
|
}
|
|
138521
138568
|
const styles10 = makeStyles((theme) => ({
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
|
|
2
|
-
import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-
|
|
2
|
+
import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-54d5c6e0.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "@vitessce/vit-s";
|
|
5
5
|
import "react-dom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scatterplot.d.ts","sourceRoot":"","sources":["../src/Scatterplot.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Scatterplot.d.ts","sourceRoot":"","sources":["../src/Scatterplot.js"],"names":[],"mappings":";AA0kBA;;;;;;GAMG;AACH,sCAKG"}
|
package/dist-tsc/Scatterplot.js
CHANGED
|
@@ -41,7 +41,7 @@ const getPosition = (object, { index, data, target }) => {
|
|
|
41
41
|
target[2] = POINT_LAYER_Z_INDEX;
|
|
42
42
|
return target;
|
|
43
43
|
};
|
|
44
|
-
const contourGetWeight = (object, { index, data }) => data.src.featureValues[index];
|
|
44
|
+
const contourGetWeight = (object, { index, data }) => data.src.featureValues?.[index];
|
|
45
45
|
const contourGetPosition = (object, { index, data, target }) => {
|
|
46
46
|
target[0] = data.src.embeddingX[index];
|
|
47
47
|
target[1] = -data.src.embeddingY[index];
|
|
@@ -399,6 +399,16 @@ class Scatterplot extends AbstractSpatialOrScatterplot {
|
|
|
399
399
|
const { obsEmbeddingIndex, obsEmbedding, } = this.props;
|
|
400
400
|
super.viewInfoDidUpdate(obsEmbeddingIndex, obsEmbedding, makeFlippedGetObsCoords);
|
|
401
401
|
}
|
|
402
|
+
componentWillUnmount() {
|
|
403
|
+
delete this.cellsQuadTree;
|
|
404
|
+
delete this.cellsLayer;
|
|
405
|
+
delete this.cellsData;
|
|
406
|
+
delete this.stratifiedData;
|
|
407
|
+
delete this.cellSetsForceSimulation;
|
|
408
|
+
delete this.cellSetsLabelPrevZoom;
|
|
409
|
+
delete this.cellSetsLayers;
|
|
410
|
+
delete this.contourLayers;
|
|
411
|
+
}
|
|
402
412
|
/**
|
|
403
413
|
* Here, asynchronously check whether props have
|
|
404
414
|
* updated which require re-computing memoized variables,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterplotOptions.d.ts","sourceRoot":"","sources":["../src/ScatterplotOptions.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScatterplotOptions.d.ts","sourceRoot":"","sources":["../src/ScatterplotOptions.js"],"names":[],"mappings":"AAYA,oEAufC"}
|
|
@@ -6,8 +6,9 @@ import { Checkbox, Slider, TableCell, TableRow } from '@material-ui/core';
|
|
|
6
6
|
import { capitalize } from '@vitessce/utils';
|
|
7
7
|
import { usePlotOptionsStyles, CellColorEncodingOption, OptionsContainer, OptionSelect, } from '@vitessce/vit-s';
|
|
8
8
|
import { GLSL_COLORMAPS } from '@vitessce/gl';
|
|
9
|
+
const FEATURE_AGGREGATION_STRATEGIES = ['first', 'last', 'sum', 'mean'];
|
|
9
10
|
export default function ScatterplotOptions(props) {
|
|
10
|
-
const { children, observationsLabel, cellRadius, setCellRadius, cellRadiusMode, setCellRadiusMode, cellOpacity, setCellOpacity, cellOpacityMode, setCellOpacityMode, cellSetLabelsVisible, setCellSetLabelsVisible, tooltipsVisible, setTooltipsVisible, cellSetLabelSize, setCellSetLabelSize, cellSetPolygonsVisible, setCellSetPolygonsVisible, cellColorEncoding, setCellColorEncoding, geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange, embeddingPointsVisible, setEmbeddingPointsVisible, embeddingContoursVisible, setEmbeddingContoursVisible, embeddingContoursFilled, setEmbeddingContoursFilled, contourPercentiles, setContourPercentiles, defaultContourPercentiles, contourColorEncoding, setContourColorEncoding, } = props;
|
|
11
|
+
const { children, observationsLabel, cellRadius, setCellRadius, cellRadiusMode, setCellRadiusMode, cellOpacity, setCellOpacity, cellOpacityMode, setCellOpacityMode, cellSetLabelsVisible, setCellSetLabelsVisible, tooltipsVisible, setTooltipsVisible, cellSetLabelSize, setCellSetLabelSize, cellSetPolygonsVisible, setCellSetPolygonsVisible, cellColorEncoding, setCellColorEncoding, geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange, embeddingPointsVisible, setEmbeddingPointsVisible, embeddingContoursVisible, setEmbeddingContoursVisible, embeddingContoursFilled, setEmbeddingContoursFilled, contourPercentiles, setContourPercentiles, defaultContourPercentiles, contourColorEncoding, setContourColorEncoding, featureAggregationStrategy, setFeatureAggregationStrategy, } = props;
|
|
11
12
|
const scatterplotOptionsId = useId();
|
|
12
13
|
const observationsLabelNice = capitalize(observationsLabel);
|
|
13
14
|
const classes = usePlotOptionsStyles();
|
|
@@ -58,6 +59,9 @@ export default function ScatterplotOptions(props) {
|
|
|
58
59
|
setContourPercentiles(values);
|
|
59
60
|
}
|
|
60
61
|
const handlePercentilesChangeDebounced = useCallback(debounce(handlePercentilesChange, 5, { trailing: true }), [handlePercentilesChange]);
|
|
62
|
+
function handleFeatureAggregationStrategyChange(event) {
|
|
63
|
+
setFeatureAggregationStrategy(event.target.value);
|
|
64
|
+
}
|
|
61
65
|
return (_jsxs(OptionsContainer, { children: [children, _jsx(CellColorEncodingOption, { observationsLabel: observationsLabel, cellColorEncoding: cellColorEncoding, setCellColorEncoding: setCellColorEncoding }), _jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.labelCell, variant: "head", scope: "row", children: _jsxs("label", { htmlFor: `scatterplot-set-labels-visible-${scatterplotOptionsId}`, children: [observationsLabelNice, " Set Labels Visible"] }) }), _jsx(TableCell, { className: classes.inputCell, variant: "body", children: _jsx(Checkbox, { className: classes.checkbox, checked: cellSetLabelsVisible, onChange: handleLabelVisibilityChange, name: "scatterplot-option-cell-set-labels", color: "default", inputProps: {
|
|
62
66
|
'aria-label': 'Show or hide set labels',
|
|
63
67
|
id: `scatterplot-set-labels-visible-${scatterplotOptionsId}`,
|
|
@@ -93,5 +97,7 @@ export default function ScatterplotOptions(props) {
|
|
|
93
97
|
id: `scatterplot-contours-filled-${scatterplotOptionsId}`,
|
|
94
98
|
} }) })] }), _jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.labelCell, variant: "head", scope: "row", children: _jsx("label", { htmlFor: `scatterplot-contour-color-encoding-${scatterplotOptionsId}`, children: "Contour Color Encoding" }) }), _jsx(TableCell, { className: classes.inputCell, variant: "body", children: _jsxs(OptionSelect, { className: classes.select, value: contourColorEncoding, onChange: handleContourColorEncodingChange, inputProps: {
|
|
95
99
|
id: `scatterplot-contour-color-encoding-${scatterplotOptionsId}`,
|
|
96
|
-
}, children: [_jsx("option", { value: "sampleSetSelection", children: "Sample Sets" }), _jsxs("option", { value: "cellSetSelection", children: [observationsLabelNice, " Sets"] }), _jsx("option", { value: "staticColor", children: "Static Color" })] }) })] }), _jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.labelCell, variant: "head", scope: "row", children: _jsx("label", { htmlFor: `scatterplot-contour-percentiles-${scatterplotOptionsId}`, children: "Contour Percentiles" }) }), _jsx(TableCell, { className: classes.inputCell, variant: "body", children: _jsx(Slider, { classes: { root: classes.slider, valueLabel: classes.sliderValueLabel }, value: contourPercentiles || defaultContourPercentiles, onChange: handlePercentilesChangeDebounced, "aria-label": "Scatterplot sliders for contour percentile thresholds", id: `scatterplot-contour-percentiles-${scatterplotOptionsId}`, valueLabelDisplay: "auto", step: 0.005, min: 0.009, max: 0.999 }) })] })
|
|
100
|
+
}, children: [_jsx("option", { value: "sampleSetSelection", children: "Sample Sets" }), _jsxs("option", { value: "cellSetSelection", children: [observationsLabelNice, " Sets"] }), _jsx("option", { value: "staticColor", children: "Static Color" })] }) })] }), _jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.labelCell, variant: "head", scope: "row", children: _jsx("label", { htmlFor: `scatterplot-contour-percentiles-${scatterplotOptionsId}`, children: "Contour Percentiles" }) }), _jsx(TableCell, { className: classes.inputCell, variant: "body", children: _jsx(Slider, { classes: { root: classes.slider, valueLabel: classes.sliderValueLabel }, value: contourPercentiles || defaultContourPercentiles, onChange: handlePercentilesChangeDebounced, "aria-label": "Scatterplot sliders for contour percentile thresholds", id: `scatterplot-contour-percentiles-${scatterplotOptionsId}`, valueLabelDisplay: "auto", step: 0.005, min: 0.009, max: 0.999 }) })] }), setFeatureAggregationStrategy ? (_jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.labelCell, variant: "head", scope: "row", children: _jsx("label", { htmlFor: `feature-aggregation-strategy-${scatterplotOptionsId}`, children: "Feature Aggregation Strategy" }) }), _jsx(TableCell, { className: classes.inputCell, variant: "body", children: _jsx(OptionSelect, { className: classes.select, value: featureAggregationStrategy ?? 'first', onChange: handleFeatureAggregationStrategyChange, inputProps: {
|
|
101
|
+
id: `feature-aggregation-strategy-${scatterplotOptionsId}`,
|
|
102
|
+
}, children: FEATURE_AGGREGATION_STRATEGIES.map(opt => (_jsx("option", { value: opt, children: capitalize(opt) }, opt))) }) })] })) : null] }));
|
|
97
103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/scatterplot",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.12",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"d3-quadtree": "^1.0.7",
|
|
24
24
|
"lodash-es": "^4.17.21",
|
|
25
25
|
"react-aria": "^3.28.0",
|
|
26
|
-
"@vitessce/constants-internal": "3.5.
|
|
27
|
-
"@vitessce/gl": "3.5.
|
|
28
|
-
"@vitessce/icons": "3.5.
|
|
29
|
-
"@vitessce/tooltip": "3.5.
|
|
30
|
-
"@vitessce/utils": "3.5.
|
|
31
|
-
"@vitessce/vit-s": "3.5.
|
|
26
|
+
"@vitessce/constants-internal": "3.5.12",
|
|
27
|
+
"@vitessce/gl": "3.5.12",
|
|
28
|
+
"@vitessce/icons": "3.5.12",
|
|
29
|
+
"@vitessce/tooltip": "3.5.12",
|
|
30
|
+
"@vitessce/utils": "3.5.12",
|
|
31
|
+
"@vitessce/vit-s": "3.5.12"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.4",
|
package/src/Scatterplot.js
CHANGED
|
@@ -50,7 +50,7 @@ const getPosition = (object, { index, data, target }) => {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
const contourGetWeight = (object, { index, data }) => data.src.featureValues[index];
|
|
53
|
+
const contourGetWeight = (object, { index, data }) => data.src.featureValues?.[index];
|
|
54
54
|
|
|
55
55
|
const contourGetPosition = (object, { index, data, target }) => {
|
|
56
56
|
target[0] = data.src.embeddingX[index];
|
|
@@ -496,6 +496,17 @@ class Scatterplot extends AbstractSpatialOrScatterplot {
|
|
|
496
496
|
);
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
+
componentWillUnmount() {
|
|
500
|
+
delete this.cellsQuadTree;
|
|
501
|
+
delete this.cellsLayer;
|
|
502
|
+
delete this.cellsData;
|
|
503
|
+
delete this.stratifiedData;
|
|
504
|
+
delete this.cellSetsForceSimulation;
|
|
505
|
+
delete this.cellSetsLabelPrevZoom;
|
|
506
|
+
delete this.cellSetsLayers;
|
|
507
|
+
delete this.contourLayers;
|
|
508
|
+
}
|
|
509
|
+
|
|
499
510
|
/**
|
|
500
511
|
* Here, asynchronously check whether props have
|
|
501
512
|
* updated which require re-computing memoized variables,
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
} from '@vitessce/vit-s';
|
|
9
9
|
import { GLSL_COLORMAPS } from '@vitessce/gl';
|
|
10
10
|
|
|
11
|
+
const FEATURE_AGGREGATION_STRATEGIES = ['first', 'last', 'sum', 'mean'];
|
|
12
|
+
|
|
11
13
|
export default function ScatterplotOptions(props) {
|
|
12
14
|
const {
|
|
13
15
|
children,
|
|
@@ -48,6 +50,9 @@ export default function ScatterplotOptions(props) {
|
|
|
48
50
|
|
|
49
51
|
contourColorEncoding,
|
|
50
52
|
setContourColorEncoding,
|
|
53
|
+
|
|
54
|
+
featureAggregationStrategy,
|
|
55
|
+
setFeatureAggregationStrategy,
|
|
51
56
|
} = props;
|
|
52
57
|
|
|
53
58
|
const scatterplotOptionsId = useId();
|
|
@@ -124,6 +129,10 @@ export default function ScatterplotOptions(props) {
|
|
|
124
129
|
[handlePercentilesChange],
|
|
125
130
|
);
|
|
126
131
|
|
|
132
|
+
function handleFeatureAggregationStrategyChange(event) {
|
|
133
|
+
setFeatureAggregationStrategy(event.target.value);
|
|
134
|
+
}
|
|
135
|
+
|
|
127
136
|
return (
|
|
128
137
|
<OptionsContainer>
|
|
129
138
|
{children}
|
|
@@ -475,6 +484,33 @@ export default function ScatterplotOptions(props) {
|
|
|
475
484
|
/>
|
|
476
485
|
</TableCell>
|
|
477
486
|
</TableRow>
|
|
487
|
+
{setFeatureAggregationStrategy ? (
|
|
488
|
+
<TableRow>
|
|
489
|
+
<TableCell className={classes.labelCell} variant="head" scope="row">
|
|
490
|
+
<label
|
|
491
|
+
htmlFor={`feature-aggregation-strategy-${scatterplotOptionsId}`}
|
|
492
|
+
>
|
|
493
|
+
Feature Aggregation Strategy
|
|
494
|
+
</label>
|
|
495
|
+
</TableCell>
|
|
496
|
+
<TableCell className={classes.inputCell} variant="body">
|
|
497
|
+
<OptionSelect
|
|
498
|
+
className={classes.select}
|
|
499
|
+
value={featureAggregationStrategy ?? 'first'}
|
|
500
|
+
onChange={handleFeatureAggregationStrategyChange}
|
|
501
|
+
inputProps={{
|
|
502
|
+
id: `feature-aggregation-strategy-${scatterplotOptionsId}`,
|
|
503
|
+
}}
|
|
504
|
+
>
|
|
505
|
+
{FEATURE_AGGREGATION_STRATEGIES.map(opt => (
|
|
506
|
+
<option key={opt} value={opt}>
|
|
507
|
+
{capitalize(opt)}
|
|
508
|
+
</option>
|
|
509
|
+
))}
|
|
510
|
+
</OptionSelect>
|
|
511
|
+
</TableCell>
|
|
512
|
+
</TableRow>
|
|
513
|
+
) : null}
|
|
478
514
|
</OptionsContainer>
|
|
479
515
|
);
|
|
480
516
|
}
|