@vitessce/statistical-plots 3.5.5 → 3.5.7
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-69817aa2.js → deflate-287e693d.js} +1 -1
- package/dist/{index-00d0a4a2.js → index-1f1b6355.js} +956 -53
- package/dist/index.js +3 -2
- package/dist/{jpeg-89e89436.js → jpeg-1b2c1d25.js} +1 -1
- package/dist/{lerc-f5f67eb4.js → lerc-4f010cd7.js} +1 -1
- package/dist/{lzw-202c1994.js → lzw-e60fb582.js} +1 -1
- package/dist/{packbits-4038eb16.js → packbits-a8bfe098.js} +1 -1
- package/dist/{raw-1068ab16.js → raw-01dff90e.js} +1 -1
- package/dist/{webimage-e7e86b49.js → webimage-6b926ce3.js} +1 -1
- package/dist-tsc/CellSetExpressionPlot.d.ts.map +1 -1
- package/dist-tsc/CellSetExpressionPlot.js +2 -1
- package/dist-tsc/Treemap.d.ts +11 -0
- package/dist-tsc/Treemap.d.ts.map +1 -0
- package/dist-tsc/Treemap.js +164 -0
- package/dist-tsc/TreemapOptions.d.ts +2 -0
- package/dist-tsc/TreemapOptions.d.ts.map +1 -0
- package/dist-tsc/TreemapOptions.js +29 -0
- package/dist-tsc/TreemapSubscriber.d.ts +2 -0
- package/dist-tsc/TreemapSubscriber.d.ts.map +1 -0
- package/dist-tsc/TreemapSubscriber.js +102 -0
- package/dist-tsc/index.d.ts +1 -0
- package/dist-tsc/index.js +1 -0
- package/package.json +8 -7
- package/src/CellSetExpressionPlot.js +4 -1
- package/src/Treemap.js +217 -0
- package/src/TreemapOptions.js +90 -0
- package/src/TreemapSubscriber.js +261 -0
- package/src/index.js +1 -0
@@ -959,7 +959,9 @@ const ViewType$1 = {
|
|
959
959
|
DOT_PLOT: "dotPlot",
|
960
960
|
FEATURE_BAR_PLOT: "featureBarPlot",
|
961
961
|
BIOMARKER_SELECT: "biomarkerSelect",
|
962
|
-
LINK_CONTROLLER: "linkController"
|
962
|
+
LINK_CONTROLLER: "linkController",
|
963
|
+
DUAL_SCATTERPLOT: "dualScatterplot",
|
964
|
+
TREEMAP: "treemap"
|
963
965
|
};
|
964
966
|
const DataType$2 = {
|
965
967
|
OBS_LABELS: "obsLabels",
|
@@ -1013,6 +1015,7 @@ const FileType$1 = {
|
|
1013
1015
|
OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
|
1014
1016
|
FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
|
1015
1017
|
SAMPLE_EDGES_ANNDATA_ZARR: "sampleEdges.anndata.zarr",
|
1018
|
+
SAMPLE_SETS_ANNDATA_ZARR: "sampleSets.anndata.zarr",
|
1016
1019
|
// AnnData - zipped
|
1017
1020
|
OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: "obsFeatureMatrix.anndata.zarr.zip",
|
1018
1021
|
OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: "obsFeatureColumns.anndata.zarr.zip",
|
@@ -1025,6 +1028,7 @@ const FileType$1 = {
|
|
1025
1028
|
OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
|
1026
1029
|
FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
|
1027
1030
|
SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
|
1031
|
+
SAMPLE_SETS_ANNDATA_ZARR_ZIP: "sampleSets.anndata.zarr.zip",
|
1028
1032
|
// AnnData - h5ad via reference spec
|
1029
1033
|
OBS_FEATURE_MATRIX_ANNDATA_H5AD: "obsFeatureMatrix.anndata.h5ad",
|
1030
1034
|
OBS_FEATURE_COLUMNS_ANNDATA_H5AD: "obsFeatureColumns.anndata.h5ad",
|
@@ -1037,6 +1041,7 @@ const FileType$1 = {
|
|
1037
1041
|
OBS_LABELS_ANNDATA_H5AD: "obsLabels.anndata.h5ad",
|
1038
1042
|
FEATURE_LABELS_ANNDATA_H5AD: "featureLabels.anndata.h5ad",
|
1039
1043
|
SAMPLE_EDGES_ANNDATA_H5AD: "sampleEdges.anndata.h5ad",
|
1044
|
+
SAMPLE_SETS_ANNDATA_H5AD: "sampleSets.anndata.h5ad",
|
1040
1045
|
// SpatialData
|
1041
1046
|
IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
|
1042
1047
|
LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
|
@@ -1138,15 +1143,23 @@ const CoordinationType$1 = {
|
|
1138
1143
|
HEATMAP_ZOOM_Y: "heatmapZoomY",
|
1139
1144
|
HEATMAP_TARGET_X: "heatmapTargetX",
|
1140
1145
|
HEATMAP_TARGET_Y: "heatmapTargetY",
|
1141
|
-
OBS_FILTER: "obsFilter",
|
1142
1146
|
OBS_HIGHLIGHT: "obsHighlight",
|
1147
|
+
OBS_SELECTION: "obsSelection",
|
1143
1148
|
OBS_SET_SELECTION: "obsSetSelection",
|
1149
|
+
OBS_SELECTION_MODE: "obsSelectionMode",
|
1150
|
+
OBS_FILTER: "obsFilter",
|
1151
|
+
OBS_SET_FILTER: "obsSetFilter",
|
1152
|
+
OBS_FILTER_MODE: "obsFilterMode",
|
1144
1153
|
OBS_SET_HIGHLIGHT: "obsSetHighlight",
|
1145
1154
|
OBS_SET_EXPANSION: "obsSetExpansion",
|
1146
1155
|
OBS_SET_COLOR: "obsSetColor",
|
1147
|
-
FEATURE_FILTER: "featureFilter",
|
1148
1156
|
FEATURE_HIGHLIGHT: "featureHighlight",
|
1149
1157
|
FEATURE_SELECTION: "featureSelection",
|
1158
|
+
FEATURE_SET_SELECTION: "featureSetSelection",
|
1159
|
+
FEATURE_SELECTION_MODE: "featureSelectionMode",
|
1160
|
+
FEATURE_FILTER: "featureFilter",
|
1161
|
+
FEATURE_SET_FILTER: "featureSetFilter",
|
1162
|
+
FEATURE_FILTER_MODE: "featureFilterMode",
|
1150
1163
|
FEATURE_VALUE_COLORMAP: "featureValueColormap",
|
1151
1164
|
FEATURE_VALUE_TRANSFORM: "featureValueTransform",
|
1152
1165
|
FEATURE_VALUE_COLORMAP_RANGE: "featureValueColormapRange",
|
@@ -1213,14 +1226,22 @@ const CoordinationType$1 = {
|
|
1213
1226
|
SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize",
|
1214
1227
|
// Multi-sample / comparative
|
1215
1228
|
SAMPLE_TYPE: "sampleType",
|
1229
|
+
SAMPLE_SELECTION: "sampleSelection",
|
1216
1230
|
SAMPLE_SET_SELECTION: "sampleSetSelection",
|
1231
|
+
SAMPLE_SELECTION_MODE: "sampleSelectionMode",
|
1232
|
+
SAMPLE_FILTER: "sampleFilter",
|
1233
|
+
SAMPLE_SET_FILTER: "sampleSetFilter",
|
1234
|
+
SAMPLE_FILTER_MODE: "sampleFilterMode",
|
1217
1235
|
SAMPLE_SET_COLOR: "sampleSetColor",
|
1236
|
+
SAMPLE_HIGHLIGHT: "sampleHighlight",
|
1218
1237
|
EMBEDDING_POINTS_VISIBLE: "embeddingPointsVisible",
|
1219
1238
|
EMBEDDING_CONTOURS_VISIBLE: "embeddingContoursVisible",
|
1220
1239
|
EMBEDDING_CONTOURS_FILLED: "embeddingContoursFilled",
|
1221
1240
|
EMBEDDING_CONTOUR_PERCENTILES: "embeddingContourPercentiles",
|
1222
1241
|
CONTOUR_COLOR_ENCODING: "contourColorEncoding",
|
1223
|
-
CONTOUR_COLOR: "contourColor"
|
1242
|
+
CONTOUR_COLOR: "contourColor",
|
1243
|
+
// Treemap
|
1244
|
+
HIERARCHY_LEVELS: "hierarchyLevels"
|
1224
1245
|
};
|
1225
1246
|
const ViewHelpMapping = {
|
1226
1247
|
SCATTERPLOT: "The scatterplot displays two-dimensional (pre-computed) dimensionality reduction results (such as from t-SNE or UMAP). Each point on the scatterplot represents an observation (e.g., cell).",
|
@@ -1237,7 +1258,8 @@ const ViewHelpMapping = {
|
|
1237
1258
|
OBS_SET_FEATURE_VALUE_DISTRIBUTION: "The observation set feature value distribution view displays a violin plot with values (e.g., expression values) per set (e.g., cell type) for the selected feature (e.g., gene).",
|
1238
1259
|
FEATURE_VALUE_HISTOGRAM: "The feature value histogram displays the distribution of values (e.g., expression) for the selected feature (e.g., gene).",
|
1239
1260
|
DOT_PLOT: "The dot plot displays summary information about expression of the selected features (e.g., genes) for each selected observation set (e.g., cell type).",
|
1240
|
-
FEATURE_BAR_PLOT: "The feature bar plot displays one bar per observation (e.g., cell) along the x-axis, where the value of a selected feature (e.g., gene) is encoded along the y-axis."
|
1261
|
+
FEATURE_BAR_PLOT: "The feature bar plot displays one bar per observation (e.g., cell) along the x-axis, where the value of a selected feature (e.g., gene) is encoded along the y-axis.",
|
1262
|
+
TREEMAP: "The treemap provides an overview of the current state of sample-level or cell-level selection and filtering."
|
1241
1263
|
};
|
1242
1264
|
const COMPONENT_COORDINATION_TYPES = {
|
1243
1265
|
[ViewType$1.SCATTERPLOT]: [
|
@@ -1262,6 +1284,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1262
1284
|
CoordinationType$1.OBS_FILTER,
|
1263
1285
|
CoordinationType$1.OBS_HIGHLIGHT,
|
1264
1286
|
CoordinationType$1.OBS_SET_SELECTION,
|
1287
|
+
CoordinationType$1.OBS_SET_FILTER,
|
1265
1288
|
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1266
1289
|
CoordinationType$1.OBS_SET_COLOR,
|
1267
1290
|
CoordinationType$1.FEATURE_HIGHLIGHT,
|
@@ -1273,6 +1296,50 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1273
1296
|
CoordinationType$1.TOOLTIPS_VISIBLE,
|
1274
1297
|
CoordinationType$1.SAMPLE_TYPE,
|
1275
1298
|
CoordinationType$1.SAMPLE_SET_SELECTION,
|
1299
|
+
CoordinationType$1.SAMPLE_SET_FILTER,
|
1300
|
+
CoordinationType$1.SAMPLE_SET_COLOR,
|
1301
|
+
CoordinationType$1.EMBEDDING_POINTS_VISIBLE,
|
1302
|
+
CoordinationType$1.EMBEDDING_CONTOURS_VISIBLE,
|
1303
|
+
CoordinationType$1.EMBEDDING_CONTOURS_FILLED,
|
1304
|
+
CoordinationType$1.EMBEDDING_CONTOUR_PERCENTILES,
|
1305
|
+
CoordinationType$1.CONTOUR_COLOR_ENCODING,
|
1306
|
+
CoordinationType$1.CONTOUR_COLOR
|
1307
|
+
],
|
1308
|
+
[ViewType$1.DUAL_SCATTERPLOT]: [
|
1309
|
+
CoordinationType$1.DATASET,
|
1310
|
+
CoordinationType$1.OBS_TYPE,
|
1311
|
+
CoordinationType$1.FEATURE_TYPE,
|
1312
|
+
CoordinationType$1.FEATURE_VALUE_TYPE,
|
1313
|
+
CoordinationType$1.OBS_LABELS_TYPE,
|
1314
|
+
CoordinationType$1.EMBEDDING_TYPE,
|
1315
|
+
CoordinationType$1.EMBEDDING_ZOOM,
|
1316
|
+
CoordinationType$1.EMBEDDING_ROTATION,
|
1317
|
+
CoordinationType$1.EMBEDDING_TARGET_X,
|
1318
|
+
CoordinationType$1.EMBEDDING_TARGET_Y,
|
1319
|
+
CoordinationType$1.EMBEDDING_TARGET_Z,
|
1320
|
+
CoordinationType$1.EMBEDDING_OBS_SET_POLYGONS_VISIBLE,
|
1321
|
+
CoordinationType$1.EMBEDDING_OBS_SET_LABELS_VISIBLE,
|
1322
|
+
CoordinationType$1.EMBEDDING_OBS_SET_LABEL_SIZE,
|
1323
|
+
CoordinationType$1.EMBEDDING_OBS_RADIUS,
|
1324
|
+
CoordinationType$1.EMBEDDING_OBS_RADIUS_MODE,
|
1325
|
+
CoordinationType$1.EMBEDDING_OBS_OPACITY,
|
1326
|
+
CoordinationType$1.EMBEDDING_OBS_OPACITY_MODE,
|
1327
|
+
CoordinationType$1.OBS_FILTER,
|
1328
|
+
CoordinationType$1.OBS_HIGHLIGHT,
|
1329
|
+
CoordinationType$1.OBS_SET_SELECTION,
|
1330
|
+
CoordinationType$1.OBS_SET_FILTER,
|
1331
|
+
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1332
|
+
CoordinationType$1.OBS_SET_COLOR,
|
1333
|
+
CoordinationType$1.FEATURE_HIGHLIGHT,
|
1334
|
+
CoordinationType$1.FEATURE_SELECTION,
|
1335
|
+
CoordinationType$1.FEATURE_VALUE_COLORMAP,
|
1336
|
+
CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
|
1337
|
+
CoordinationType$1.OBS_COLOR_ENCODING,
|
1338
|
+
CoordinationType$1.ADDITIONAL_OBS_SETS,
|
1339
|
+
CoordinationType$1.TOOLTIPS_VISIBLE,
|
1340
|
+
CoordinationType$1.SAMPLE_TYPE,
|
1341
|
+
CoordinationType$1.SAMPLE_SET_SELECTION,
|
1342
|
+
CoordinationType$1.SAMPLE_SET_FILTER,
|
1276
1343
|
CoordinationType$1.SAMPLE_SET_COLOR,
|
1277
1344
|
CoordinationType$1.EMBEDDING_POINTS_VISIBLE,
|
1278
1345
|
CoordinationType$1.EMBEDDING_CONTOURS_VISIBLE,
|
@@ -1339,6 +1406,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1339
1406
|
CoordinationType$1.OBS_FILTER,
|
1340
1407
|
CoordinationType$1.OBS_HIGHLIGHT,
|
1341
1408
|
CoordinationType$1.OBS_SET_SELECTION,
|
1409
|
+
CoordinationType$1.OBS_SET_FILTER,
|
1342
1410
|
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1343
1411
|
CoordinationType$1.OBS_SET_COLOR,
|
1344
1412
|
CoordinationType$1.FEATURE_HIGHLIGHT,
|
@@ -1375,6 +1443,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1375
1443
|
CoordinationType$1.OBS_FILTER,
|
1376
1444
|
CoordinationType$1.OBS_HIGHLIGHT,
|
1377
1445
|
CoordinationType$1.OBS_SET_SELECTION,
|
1446
|
+
CoordinationType$1.OBS_SET_FILTER,
|
1378
1447
|
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1379
1448
|
CoordinationType$1.OBS_SET_COLOR,
|
1380
1449
|
CoordinationType$1.FEATURE_HIGHLIGHT,
|
@@ -1434,6 +1503,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1434
1503
|
CoordinationType$1.OBS_FILTER,
|
1435
1504
|
CoordinationType$1.OBS_HIGHLIGHT,
|
1436
1505
|
CoordinationType$1.OBS_SET_SELECTION,
|
1506
|
+
CoordinationType$1.OBS_SET_FILTER,
|
1437
1507
|
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1438
1508
|
CoordinationType$1.OBS_SET_COLOR,
|
1439
1509
|
CoordinationType$1.FEATURE_FILTER,
|
@@ -1449,6 +1519,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1449
1519
|
CoordinationType$1.DATASET,
|
1450
1520
|
CoordinationType$1.OBS_TYPE,
|
1451
1521
|
CoordinationType$1.OBS_SET_SELECTION,
|
1522
|
+
CoordinationType$1.OBS_SET_FILTER,
|
1452
1523
|
CoordinationType$1.OBS_SET_EXPANSION,
|
1453
1524
|
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1454
1525
|
CoordinationType$1.OBS_SET_COLOR,
|
@@ -1460,6 +1531,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1460
1531
|
CoordinationType$1.DATASET,
|
1461
1532
|
CoordinationType$1.OBS_TYPE,
|
1462
1533
|
CoordinationType$1.OBS_SET_SELECTION,
|
1534
|
+
CoordinationType$1.OBS_SET_FILTER,
|
1463
1535
|
CoordinationType$1.OBS_SET_EXPANSION,
|
1464
1536
|
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1465
1537
|
CoordinationType$1.OBS_SET_COLOR,
|
@@ -1492,6 +1564,7 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1492
1564
|
CoordinationType$1.FEATURE_VALUE_TRANSFORM,
|
1493
1565
|
CoordinationType$1.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
|
1494
1566
|
CoordinationType$1.OBS_SET_SELECTION,
|
1567
|
+
CoordinationType$1.OBS_SET_FILTER,
|
1495
1568
|
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1496
1569
|
CoordinationType$1.OBS_SET_COLOR,
|
1497
1570
|
CoordinationType$1.ADDITIONAL_OBS_SETS,
|
@@ -1508,7 +1581,8 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1508
1581
|
CoordinationType$1.ADDITIONAL_OBS_SETS,
|
1509
1582
|
CoordinationType$1.OBS_SET_COLOR,
|
1510
1583
|
CoordinationType$1.OBS_COLOR_ENCODING,
|
1511
|
-
CoordinationType$1.OBS_SET_SELECTION
|
1584
|
+
CoordinationType$1.OBS_SET_SELECTION,
|
1585
|
+
CoordinationType$1.OBS_SET_FILTER
|
1512
1586
|
],
|
1513
1587
|
[ViewType$1.LAYER_CONTROLLER]: [
|
1514
1588
|
CoordinationType$1.DATASET,
|
@@ -1623,11 +1697,13 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1623
1697
|
CoordinationType$1.FEATURE_VALUE_POSITIVITY_THRESHOLD,
|
1624
1698
|
CoordinationType$1.FEATURE_VALUE_COLORMAP,
|
1625
1699
|
CoordinationType$1.OBS_SET_SELECTION,
|
1700
|
+
CoordinationType$1.OBS_SET_FILTER,
|
1626
1701
|
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1627
1702
|
CoordinationType$1.OBS_SET_COLOR,
|
1628
1703
|
CoordinationType$1.ADDITIONAL_OBS_SETS,
|
1629
1704
|
CoordinationType$1.SAMPLE_TYPE,
|
1630
1705
|
CoordinationType$1.SAMPLE_SET_SELECTION,
|
1706
|
+
CoordinationType$1.SAMPLE_SET_FILTER,
|
1631
1707
|
CoordinationType$1.SAMPLE_SET_COLOR
|
1632
1708
|
],
|
1633
1709
|
higlass: [
|
@@ -1658,8 +1734,37 @@ const COMPONENT_COORDINATION_TYPES = {
|
|
1658
1734
|
[ViewType$1.LINK_CONTROLLER]: [],
|
1659
1735
|
[ViewType$1.BIOMARKER_SELECT]: [
|
1660
1736
|
CoordinationType$1.FEATURE_SELECTION,
|
1661
|
-
CoordinationType$1.SAMPLE_SET_SELECTION
|
1737
|
+
CoordinationType$1.SAMPLE_SET_SELECTION,
|
1738
|
+
CoordinationType$1.SAMPLE_SET_FILTER,
|
1739
|
+
CoordinationType$1.OBS_SET_SELECTION,
|
1740
|
+
CoordinationType$1.OBS_SET_FILTER
|
1662
1741
|
// TODO: create coordination types for internal state of the biomarker selection view?
|
1742
|
+
],
|
1743
|
+
[ViewType$1.TREEMAP]: [
|
1744
|
+
CoordinationType$1.DATASET,
|
1745
|
+
CoordinationType$1.OBS_TYPE,
|
1746
|
+
CoordinationType$1.FEATURE_TYPE,
|
1747
|
+
CoordinationType$1.FEATURE_VALUE_TYPE,
|
1748
|
+
CoordinationType$1.OBS_FILTER,
|
1749
|
+
CoordinationType$1.OBS_HIGHLIGHT,
|
1750
|
+
CoordinationType$1.OBS_SET_SELECTION,
|
1751
|
+
CoordinationType$1.OBS_SET_FILTER,
|
1752
|
+
CoordinationType$1.OBS_SELECTION,
|
1753
|
+
CoordinationType$1.OBS_SELECTION_MODE,
|
1754
|
+
CoordinationType$1.OBS_SET_HIGHLIGHT,
|
1755
|
+
CoordinationType$1.OBS_SET_COLOR,
|
1756
|
+
CoordinationType$1.OBS_COLOR_ENCODING,
|
1757
|
+
CoordinationType$1.ADDITIONAL_OBS_SETS,
|
1758
|
+
CoordinationType$1.SAMPLE_TYPE,
|
1759
|
+
CoordinationType$1.SAMPLE_SET_SELECTION,
|
1760
|
+
CoordinationType$1.SAMPLE_SET_FILTER,
|
1761
|
+
CoordinationType$1.SAMPLE_SET_COLOR,
|
1762
|
+
CoordinationType$1.SAMPLE_SELECTION,
|
1763
|
+
CoordinationType$1.SAMPLE_SELECTION_MODE,
|
1764
|
+
CoordinationType$1.SAMPLE_FILTER,
|
1765
|
+
CoordinationType$1.SAMPLE_FILTER_MODE,
|
1766
|
+
CoordinationType$1.SAMPLE_HIGHLIGHT,
|
1767
|
+
CoordinationType$1.HIERARCHY_LEVELS
|
1663
1768
|
]
|
1664
1769
|
};
|
1665
1770
|
function commonjsRequire(path2) {
|
@@ -2019,6 +2124,10 @@ var pluralizeExports = pluralize$1.exports;
|
|
2019
2124
|
const plur = /* @__PURE__ */ getDefaultExportFromCjs(pluralizeExports);
|
2020
2125
|
plur.addPluralRule("glomerulus", "glomeruli");
|
2021
2126
|
plur.addPluralRule("interstitium", "interstitia");
|
2127
|
+
function commaNumber(n2) {
|
2128
|
+
const nf = new Intl.NumberFormat("en-US");
|
2129
|
+
return nf.format(n2);
|
2130
|
+
}
|
2022
2131
|
function capitalize$2(word) {
|
2023
2132
|
return word ? word.charAt(0).toUpperCase() + word.slice(1) : "";
|
2024
2133
|
}
|
@@ -2060,6 +2169,279 @@ function getNextScope(prevScopes) {
|
|
2060
2169
|
} while (prevScopes.includes(nextScope));
|
2061
2170
|
return nextScope;
|
2062
2171
|
}
|
2172
|
+
const identityFunc = (d) => d;
|
2173
|
+
function unnestMap(map2, keys3, aggFunc) {
|
2174
|
+
if (keys3.length < 2) {
|
2175
|
+
throw new Error("Insufficient number of keys passed to flattenInternMap");
|
2176
|
+
}
|
2177
|
+
const aggFuncToUse = !aggFunc ? identityFunc : aggFunc;
|
2178
|
+
return Array.from(map2.entries()).flatMap(([k, v]) => {
|
2179
|
+
if (v instanceof Map) {
|
2180
|
+
const keysWithoutFirst = [...keys3];
|
2181
|
+
keysWithoutFirst.splice(0, 1);
|
2182
|
+
return unnestMap(v, keysWithoutFirst, aggFuncToUse).map((childObj) => ({
|
2183
|
+
[keys3[0]]: k,
|
2184
|
+
...childObj
|
2185
|
+
}));
|
2186
|
+
}
|
2187
|
+
return {
|
2188
|
+
[keys3[0]]: k,
|
2189
|
+
[keys3[1]]: aggFuncToUse(v)
|
2190
|
+
};
|
2191
|
+
});
|
2192
|
+
}
|
2193
|
+
var loglevel = { exports: {} };
|
2194
|
+
(function(module2) {
|
2195
|
+
(function(root2, definition2) {
|
2196
|
+
if (module2.exports) {
|
2197
|
+
module2.exports = definition2();
|
2198
|
+
} else {
|
2199
|
+
root2.log = definition2();
|
2200
|
+
}
|
2201
|
+
})(commonjsGlobal, function() {
|
2202
|
+
var noop2 = function() {
|
2203
|
+
};
|
2204
|
+
var undefinedType2 = "undefined";
|
2205
|
+
var isIE = typeof window !== undefinedType2 && typeof window.navigator !== undefinedType2 && /Trident\/|MSIE /.test(window.navigator.userAgent);
|
2206
|
+
var logMethods = [
|
2207
|
+
"trace",
|
2208
|
+
"debug",
|
2209
|
+
"info",
|
2210
|
+
"warn",
|
2211
|
+
"error"
|
2212
|
+
];
|
2213
|
+
var _loggersByName = {};
|
2214
|
+
var defaultLogger = null;
|
2215
|
+
function bindMethod(obj, methodName) {
|
2216
|
+
var method2 = obj[methodName];
|
2217
|
+
if (typeof method2.bind === "function") {
|
2218
|
+
return method2.bind(obj);
|
2219
|
+
} else {
|
2220
|
+
try {
|
2221
|
+
return Function.prototype.bind.call(method2, obj);
|
2222
|
+
} catch (e3) {
|
2223
|
+
return function() {
|
2224
|
+
return Function.prototype.apply.apply(method2, [obj, arguments]);
|
2225
|
+
};
|
2226
|
+
}
|
2227
|
+
}
|
2228
|
+
}
|
2229
|
+
function traceForIE() {
|
2230
|
+
if (console.log) {
|
2231
|
+
if (console.log.apply) {
|
2232
|
+
console.log.apply(console, arguments);
|
2233
|
+
} else {
|
2234
|
+
Function.prototype.apply.apply(console.log, [console, arguments]);
|
2235
|
+
}
|
2236
|
+
}
|
2237
|
+
if (console.trace)
|
2238
|
+
console.trace();
|
2239
|
+
}
|
2240
|
+
function realMethod(methodName) {
|
2241
|
+
if (methodName === "debug") {
|
2242
|
+
methodName = "log";
|
2243
|
+
}
|
2244
|
+
if (typeof console === undefinedType2) {
|
2245
|
+
return false;
|
2246
|
+
} else if (methodName === "trace" && isIE) {
|
2247
|
+
return traceForIE;
|
2248
|
+
} else if (console[methodName] !== void 0) {
|
2249
|
+
return bindMethod(console, methodName);
|
2250
|
+
} else if (console.log !== void 0) {
|
2251
|
+
return bindMethod(console, "log");
|
2252
|
+
} else {
|
2253
|
+
return noop2;
|
2254
|
+
}
|
2255
|
+
}
|
2256
|
+
function replaceLoggingMethods() {
|
2257
|
+
var level = this.getLevel();
|
2258
|
+
for (var i2 = 0; i2 < logMethods.length; i2++) {
|
2259
|
+
var methodName = logMethods[i2];
|
2260
|
+
this[methodName] = i2 < level ? noop2 : this.methodFactory(methodName, level, this.name);
|
2261
|
+
}
|
2262
|
+
this.log = this.debug;
|
2263
|
+
if (typeof console === undefinedType2 && level < this.levels.SILENT) {
|
2264
|
+
return "No console available for logging";
|
2265
|
+
}
|
2266
|
+
}
|
2267
|
+
function enableLoggingWhenConsoleArrives(methodName) {
|
2268
|
+
return function() {
|
2269
|
+
if (typeof console !== undefinedType2) {
|
2270
|
+
replaceLoggingMethods.call(this);
|
2271
|
+
this[methodName].apply(this, arguments);
|
2272
|
+
}
|
2273
|
+
};
|
2274
|
+
}
|
2275
|
+
function defaultMethodFactory(methodName, _level, _loggerName) {
|
2276
|
+
return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
|
2277
|
+
}
|
2278
|
+
function Logger(name2, factory) {
|
2279
|
+
var self2 = this;
|
2280
|
+
var inheritedLevel;
|
2281
|
+
var defaultLevel;
|
2282
|
+
var userLevel;
|
2283
|
+
var storageKey = "loglevel";
|
2284
|
+
if (typeof name2 === "string") {
|
2285
|
+
storageKey += ":" + name2;
|
2286
|
+
} else if (typeof name2 === "symbol") {
|
2287
|
+
storageKey = void 0;
|
2288
|
+
}
|
2289
|
+
function persistLevelIfPossible(levelNum) {
|
2290
|
+
var levelName = (logMethods[levelNum] || "silent").toUpperCase();
|
2291
|
+
if (typeof window === undefinedType2 || !storageKey)
|
2292
|
+
return;
|
2293
|
+
try {
|
2294
|
+
window.localStorage[storageKey] = levelName;
|
2295
|
+
return;
|
2296
|
+
} catch (ignore) {
|
2297
|
+
}
|
2298
|
+
try {
|
2299
|
+
window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
|
2300
|
+
} catch (ignore) {
|
2301
|
+
}
|
2302
|
+
}
|
2303
|
+
function getPersistedLevel() {
|
2304
|
+
var storedLevel;
|
2305
|
+
if (typeof window === undefinedType2 || !storageKey)
|
2306
|
+
return;
|
2307
|
+
try {
|
2308
|
+
storedLevel = window.localStorage[storageKey];
|
2309
|
+
} catch (ignore) {
|
2310
|
+
}
|
2311
|
+
if (typeof storedLevel === undefinedType2) {
|
2312
|
+
try {
|
2313
|
+
var cookie = window.document.cookie;
|
2314
|
+
var cookieName = encodeURIComponent(storageKey);
|
2315
|
+
var location = cookie.indexOf(cookieName + "=");
|
2316
|
+
if (location !== -1) {
|
2317
|
+
storedLevel = /^([^;]+)/.exec(
|
2318
|
+
cookie.slice(location + cookieName.length + 1)
|
2319
|
+
)[1];
|
2320
|
+
}
|
2321
|
+
} catch (ignore) {
|
2322
|
+
}
|
2323
|
+
}
|
2324
|
+
if (self2.levels[storedLevel] === void 0) {
|
2325
|
+
storedLevel = void 0;
|
2326
|
+
}
|
2327
|
+
return storedLevel;
|
2328
|
+
}
|
2329
|
+
function clearPersistedLevel() {
|
2330
|
+
if (typeof window === undefinedType2 || !storageKey)
|
2331
|
+
return;
|
2332
|
+
try {
|
2333
|
+
window.localStorage.removeItem(storageKey);
|
2334
|
+
} catch (ignore) {
|
2335
|
+
}
|
2336
|
+
try {
|
2337
|
+
window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
2338
|
+
} catch (ignore) {
|
2339
|
+
}
|
2340
|
+
}
|
2341
|
+
function normalizeLevel(input) {
|
2342
|
+
var level = input;
|
2343
|
+
if (typeof level === "string" && self2.levels[level.toUpperCase()] !== void 0) {
|
2344
|
+
level = self2.levels[level.toUpperCase()];
|
2345
|
+
}
|
2346
|
+
if (typeof level === "number" && level >= 0 && level <= self2.levels.SILENT) {
|
2347
|
+
return level;
|
2348
|
+
} else {
|
2349
|
+
throw new TypeError("log.setLevel() called with invalid level: " + input);
|
2350
|
+
}
|
2351
|
+
}
|
2352
|
+
self2.name = name2;
|
2353
|
+
self2.levels = {
|
2354
|
+
"TRACE": 0,
|
2355
|
+
"DEBUG": 1,
|
2356
|
+
"INFO": 2,
|
2357
|
+
"WARN": 3,
|
2358
|
+
"ERROR": 4,
|
2359
|
+
"SILENT": 5
|
2360
|
+
};
|
2361
|
+
self2.methodFactory = factory || defaultMethodFactory;
|
2362
|
+
self2.getLevel = function() {
|
2363
|
+
if (userLevel != null) {
|
2364
|
+
return userLevel;
|
2365
|
+
} else if (defaultLevel != null) {
|
2366
|
+
return defaultLevel;
|
2367
|
+
} else {
|
2368
|
+
return inheritedLevel;
|
2369
|
+
}
|
2370
|
+
};
|
2371
|
+
self2.setLevel = function(level, persist) {
|
2372
|
+
userLevel = normalizeLevel(level);
|
2373
|
+
if (persist !== false) {
|
2374
|
+
persistLevelIfPossible(userLevel);
|
2375
|
+
}
|
2376
|
+
return replaceLoggingMethods.call(self2);
|
2377
|
+
};
|
2378
|
+
self2.setDefaultLevel = function(level) {
|
2379
|
+
defaultLevel = normalizeLevel(level);
|
2380
|
+
if (!getPersistedLevel()) {
|
2381
|
+
self2.setLevel(level, false);
|
2382
|
+
}
|
2383
|
+
};
|
2384
|
+
self2.resetLevel = function() {
|
2385
|
+
userLevel = null;
|
2386
|
+
clearPersistedLevel();
|
2387
|
+
replaceLoggingMethods.call(self2);
|
2388
|
+
};
|
2389
|
+
self2.enableAll = function(persist) {
|
2390
|
+
self2.setLevel(self2.levels.TRACE, persist);
|
2391
|
+
};
|
2392
|
+
self2.disableAll = function(persist) {
|
2393
|
+
self2.setLevel(self2.levels.SILENT, persist);
|
2394
|
+
};
|
2395
|
+
self2.rebuild = function() {
|
2396
|
+
if (defaultLogger !== self2) {
|
2397
|
+
inheritedLevel = normalizeLevel(defaultLogger.getLevel());
|
2398
|
+
}
|
2399
|
+
replaceLoggingMethods.call(self2);
|
2400
|
+
if (defaultLogger === self2) {
|
2401
|
+
for (var childName in _loggersByName) {
|
2402
|
+
_loggersByName[childName].rebuild();
|
2403
|
+
}
|
2404
|
+
}
|
2405
|
+
};
|
2406
|
+
inheritedLevel = normalizeLevel(
|
2407
|
+
defaultLogger ? defaultLogger.getLevel() : "WARN"
|
2408
|
+
);
|
2409
|
+
var initialLevel = getPersistedLevel();
|
2410
|
+
if (initialLevel != null) {
|
2411
|
+
userLevel = normalizeLevel(initialLevel);
|
2412
|
+
}
|
2413
|
+
replaceLoggingMethods.call(self2);
|
2414
|
+
}
|
2415
|
+
defaultLogger = new Logger();
|
2416
|
+
defaultLogger.getLogger = function getLogger(name2) {
|
2417
|
+
if (typeof name2 !== "symbol" && typeof name2 !== "string" || name2 === "") {
|
2418
|
+
throw new TypeError("You must supply a name when creating a logger.");
|
2419
|
+
}
|
2420
|
+
var logger2 = _loggersByName[name2];
|
2421
|
+
if (!logger2) {
|
2422
|
+
logger2 = _loggersByName[name2] = new Logger(
|
2423
|
+
name2,
|
2424
|
+
defaultLogger.methodFactory
|
2425
|
+
);
|
2426
|
+
}
|
2427
|
+
return logger2;
|
2428
|
+
};
|
2429
|
+
var _log = typeof window !== undefinedType2 ? window.log : void 0;
|
2430
|
+
defaultLogger.noConflict = function() {
|
2431
|
+
if (typeof window !== undefinedType2 && window.log === defaultLogger) {
|
2432
|
+
window.log = _log;
|
2433
|
+
}
|
2434
|
+
return defaultLogger;
|
2435
|
+
};
|
2436
|
+
defaultLogger.getLoggers = function getLoggers2() {
|
2437
|
+
return _loggersByName;
|
2438
|
+
};
|
2439
|
+
defaultLogger["default"] = defaultLogger;
|
2440
|
+
return defaultLogger;
|
2441
|
+
});
|
2442
|
+
})(loglevel);
|
2443
|
+
var loglevelExports = loglevel.exports;
|
2444
|
+
const log$b = /* @__PURE__ */ getDefaultExportFromCjs(loglevelExports);
|
2063
2445
|
const DEFAULT_DARK_COLOR = [50, 50, 50];
|
2064
2446
|
const DEFAULT_LIGHT_COLOR$3 = [200, 200, 200];
|
2065
2447
|
const DEFAULT_LIGHT2_COLOR = [235, 235, 235];
|
@@ -9436,7 +9818,7 @@ function upgradeFrom1_0_14(config2) {
|
|
9436
9818
|
Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
|
9437
9819
|
var _a2;
|
9438
9820
|
if ((_a2 = viewDef.props) == null ? void 0 : _a2[oldProp]) {
|
9439
|
-
|
9821
|
+
log$b.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
|
9440
9822
|
}
|
9441
9823
|
});
|
9442
9824
|
});
|
@@ -9459,7 +9841,7 @@ function upgradeFrom1_0_15(config2) {
|
|
9459
9841
|
Object.entries(coordinationScopes).forEach(([coordinationType, coordinationScope]) => {
|
9460
9842
|
if (!Array.isArray(coordinationScope) && typeof coordinationScope === "object") {
|
9461
9843
|
if (coordinationType === "dataset") {
|
9462
|
-
|
9844
|
+
log$b.error("Expected coordinationScopes.dataset value to be either string or string[], but got object.");
|
9463
9845
|
}
|
9464
9846
|
coordinationScopesBy.dataset[coordinationType] = coordinationScope;
|
9465
9847
|
} else if (Array.isArray(coordinationScope) || typeof coordinationScope === "string") {
|
@@ -11818,7 +12200,7 @@ function makeConstantWithDeprecationMessage(currObj, oldObj) {
|
|
11818
12200
|
const oldKeys = Object.keys(oldObj);
|
11819
12201
|
const propKey = String(prop);
|
11820
12202
|
if (oldKeys.includes(propKey)) {
|
11821
|
-
|
12203
|
+
log$b.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
|
11822
12204
|
${oldObj[propKey][1]}`);
|
11823
12205
|
return oldObj[propKey];
|
11824
12206
|
}
|
@@ -11916,6 +12298,9 @@ const annDataObsSetsArr = z.array(z.object({
|
|
11916
12298
|
z.object({
|
11917
12299
|
obsSets: annDataObsSetsArr
|
11918
12300
|
});
|
12301
|
+
z.object({
|
12302
|
+
sampleSets: annDataObsSetsArr
|
12303
|
+
});
|
11919
12304
|
const annDataObsFeatureColumnsArr = z.array(z.object({
|
11920
12305
|
path: z.string()
|
11921
12306
|
}));
|
@@ -18801,8 +19186,8 @@ var json2csv_umd = { exports: {} };
|
|
18801
19186
|
Object.defineProperty(exports3, "__esModule", { value: true });
|
18802
19187
|
});
|
18803
19188
|
})(json2csv_umd, json2csv_umd.exports);
|
18804
|
-
class InternMap extends Map {
|
18805
|
-
constructor(entries2, key2 = keyof) {
|
19189
|
+
let InternMap$1 = class InternMap extends Map {
|
19190
|
+
constructor(entries2, key2 = keyof$1) {
|
18806
19191
|
super();
|
18807
19192
|
Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
|
18808
19193
|
if (entries2 != null)
|
@@ -18810,20 +19195,20 @@ class InternMap extends Map {
|
|
18810
19195
|
this.set(key22, value2);
|
18811
19196
|
}
|
18812
19197
|
get(key2) {
|
18813
|
-
return super.get(intern_get(this, key2));
|
19198
|
+
return super.get(intern_get$1(this, key2));
|
18814
19199
|
}
|
18815
19200
|
has(key2) {
|
18816
|
-
return super.has(intern_get(this, key2));
|
19201
|
+
return super.has(intern_get$1(this, key2));
|
18817
19202
|
}
|
18818
19203
|
set(key2, value2) {
|
18819
|
-
return super.set(intern_set(this, key2), value2);
|
19204
|
+
return super.set(intern_set$1(this, key2), value2);
|
18820
19205
|
}
|
18821
19206
|
delete(key2) {
|
18822
|
-
return super.delete(intern_delete(this, key2));
|
19207
|
+
return super.delete(intern_delete$1(this, key2));
|
18823
19208
|
}
|
18824
|
-
}
|
19209
|
+
};
|
18825
19210
|
class InternSet extends Set {
|
18826
|
-
constructor(values2, key2 = keyof) {
|
19211
|
+
constructor(values2, key2 = keyof$1) {
|
18827
19212
|
super();
|
18828
19213
|
Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
|
18829
19214
|
if (values2 != null)
|
@@ -18831,27 +19216,27 @@ class InternSet extends Set {
|
|
18831
19216
|
this.add(value2);
|
18832
19217
|
}
|
18833
19218
|
has(value2) {
|
18834
|
-
return super.has(intern_get(this, value2));
|
19219
|
+
return super.has(intern_get$1(this, value2));
|
18835
19220
|
}
|
18836
19221
|
add(value2) {
|
18837
|
-
return super.add(intern_set(this, value2));
|
19222
|
+
return super.add(intern_set$1(this, value2));
|
18838
19223
|
}
|
18839
19224
|
delete(value2) {
|
18840
|
-
return super.delete(intern_delete(this, value2));
|
19225
|
+
return super.delete(intern_delete$1(this, value2));
|
18841
19226
|
}
|
18842
19227
|
}
|
18843
|
-
function intern_get({ _intern, _key }, value2) {
|
19228
|
+
function intern_get$1({ _intern, _key }, value2) {
|
18844
19229
|
const key2 = _key(value2);
|
18845
19230
|
return _intern.has(key2) ? _intern.get(key2) : value2;
|
18846
19231
|
}
|
18847
|
-
function intern_set({ _intern, _key }, value2) {
|
19232
|
+
function intern_set$1({ _intern, _key }, value2) {
|
18848
19233
|
const key2 = _key(value2);
|
18849
19234
|
if (_intern.has(key2))
|
18850
19235
|
return _intern.get(key2);
|
18851
19236
|
_intern.set(key2, value2);
|
18852
19237
|
return value2;
|
18853
19238
|
}
|
18854
|
-
function intern_delete({ _intern, _key }, value2) {
|
19239
|
+
function intern_delete$1({ _intern, _key }, value2) {
|
18855
19240
|
const key2 = _key(value2);
|
18856
19241
|
if (_intern.has(key2)) {
|
18857
19242
|
value2 = _intern.get(key2);
|
@@ -18859,7 +19244,7 @@ function intern_delete({ _intern, _key }, value2) {
|
|
18859
19244
|
}
|
18860
19245
|
return value2;
|
18861
19246
|
}
|
18862
|
-
function keyof(value2) {
|
19247
|
+
function keyof$1(value2) {
|
18863
19248
|
return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2;
|
18864
19249
|
}
|
18865
19250
|
const schemeRdBu = [[103, 0, 31], [178, 24, 43], [214, 96, 77], [244, 165, 130], [253, 219, 199], [247, 247, 247], [209, 229, 240], [146, 197, 222], [67, 147, 195], [33, 102, 172], [5, 48, 97]];
|
@@ -18908,7 +19293,7 @@ function interpolateSequentialMulti(range2) {
|
|
18908
19293
|
interpolateRgbBasis(schemeRdBu);
|
18909
19294
|
interpolateSequentialMulti(schemePlasma);
|
18910
19295
|
function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, expressionData, obsIndex, mergedCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient) {
|
18911
|
-
const result = new InternMap([], JSON.stringify);
|
19296
|
+
const result = new InternMap$1([], JSON.stringify);
|
18912
19297
|
const hasSampleSetSelection = Array.isArray(sampleSetSelection) && sampleSetSelection.length > 0;
|
18913
19298
|
const hasCellSetSelection = Array.isArray(cellSetSelection) && cellSetSelection.length > 0;
|
18914
19299
|
const hasGeneSelection = Array.isArray(geneSelection) && geneSelection.length > 0;
|
@@ -18916,9 +19301,9 @@ function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, exp
|
|
18916
19301
|
const cellSetKeys = hasCellSetSelection ? cellSetSelection : [null];
|
18917
19302
|
const geneKeys = hasGeneSelection ? geneSelection : [null];
|
18918
19303
|
cellSetKeys.forEach((cellSetKey) => {
|
18919
|
-
result.set(cellSetKey, new InternMap([], JSON.stringify));
|
19304
|
+
result.set(cellSetKey, new InternMap$1([], JSON.stringify));
|
18920
19305
|
sampleSetKeys.forEach((sampleSetKey) => {
|
18921
|
-
result.get(cellSetKey).set(sampleSetKey, new InternMap([], JSON.stringify));
|
19306
|
+
result.get(cellSetKey).set(sampleSetKey, new InternMap$1([], JSON.stringify));
|
18922
19307
|
geneKeys.forEach((geneKey) => {
|
18923
19308
|
result.get(cellSetKey).get(sampleSetKey).set(geneKey, []);
|
18924
19309
|
});
|
@@ -18950,9 +19335,9 @@ function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, exp
|
|
18950
19335
|
return [null, null];
|
18951
19336
|
}
|
18952
19337
|
function aggregateStratifiedExpressionData(stratifiedResult, geneSelection) {
|
18953
|
-
const result = new InternMap([], JSON.stringify);
|
19338
|
+
const result = new InternMap$1([], JSON.stringify);
|
18954
19339
|
Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
|
18955
|
-
result.set(cellSetKey, new InternMap([], JSON.stringify));
|
19340
|
+
result.set(cellSetKey, new InternMap$1([], JSON.stringify));
|
18956
19341
|
Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
|
18957
19342
|
const values2 = secondLevelInternMap.get(geneSelection[0]);
|
18958
19343
|
result.get(cellSetKey).set(sampleSetKey, values2);
|
@@ -133122,16 +133507,16 @@ function addDecoder(cases2, importFn) {
|
|
133122
133507
|
}
|
133123
133508
|
cases2.forEach((c2) => registry$1.set(c2, importFn));
|
133124
133509
|
}
|
133125
|
-
addDecoder([void 0, 1], () => import("./raw-
|
133126
|
-
addDecoder(5, () => import("./lzw-
|
133510
|
+
addDecoder([void 0, 1], () => import("./raw-01dff90e.js").then((m2) => m2.default));
|
133511
|
+
addDecoder(5, () => import("./lzw-e60fb582.js").then((m2) => m2.default));
|
133127
133512
|
addDecoder(6, () => {
|
133128
133513
|
throw new Error("old style JPEG compression is not supported.");
|
133129
133514
|
});
|
133130
|
-
addDecoder(7, () => import("./jpeg-
|
133131
|
-
addDecoder([8, 32946], () => import("./deflate-
|
133132
|
-
addDecoder(32773, () => import("./packbits-
|
133133
|
-
addDecoder(34887, () => import("./lerc-
|
133134
|
-
addDecoder(50001, () => import("./webimage-
|
133515
|
+
addDecoder(7, () => import("./jpeg-1b2c1d25.js").then((m2) => m2.default));
|
133516
|
+
addDecoder([8, 32946], () => import("./deflate-287e693d.js").then((m2) => m2.default));
|
133517
|
+
addDecoder(32773, () => import("./packbits-a8bfe098.js").then((m2) => m2.default));
|
133518
|
+
addDecoder(34887, () => import("./lerc-4f010cd7.js").then((m2) => m2.default));
|
133519
|
+
addDecoder(50001, () => import("./webimage-6b926ce3.js").then((m2) => m2.default));
|
133135
133520
|
function decodeRowAcc(row, stride) {
|
133136
133521
|
let length2 = row.length - stride;
|
133137
133522
|
let offset5 = 0;
|
@@ -143347,9 +143732,76 @@ function extent$1(values2, valueof) {
|
|
143347
143732
|
}
|
143348
143733
|
return [min2, max2];
|
143349
143734
|
}
|
143735
|
+
class InternMap2 extends Map {
|
143736
|
+
constructor(entries2, key2 = keyof) {
|
143737
|
+
super();
|
143738
|
+
Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
|
143739
|
+
if (entries2 != null)
|
143740
|
+
for (const [key22, value2] of entries2)
|
143741
|
+
this.set(key22, value2);
|
143742
|
+
}
|
143743
|
+
get(key2) {
|
143744
|
+
return super.get(intern_get(this, key2));
|
143745
|
+
}
|
143746
|
+
has(key2) {
|
143747
|
+
return super.has(intern_get(this, key2));
|
143748
|
+
}
|
143749
|
+
set(key2, value2) {
|
143750
|
+
return super.set(intern_set(this, key2), value2);
|
143751
|
+
}
|
143752
|
+
delete(key2) {
|
143753
|
+
return super.delete(intern_delete(this, key2));
|
143754
|
+
}
|
143755
|
+
}
|
143756
|
+
function intern_get({ _intern, _key }, value2) {
|
143757
|
+
const key2 = _key(value2);
|
143758
|
+
return _intern.has(key2) ? _intern.get(key2) : value2;
|
143759
|
+
}
|
143760
|
+
function intern_set({ _intern, _key }, value2) {
|
143761
|
+
const key2 = _key(value2);
|
143762
|
+
if (_intern.has(key2))
|
143763
|
+
return _intern.get(key2);
|
143764
|
+
_intern.set(key2, value2);
|
143765
|
+
return value2;
|
143766
|
+
}
|
143767
|
+
function intern_delete({ _intern, _key }, value2) {
|
143768
|
+
const key2 = _key(value2);
|
143769
|
+
if (_intern.has(key2)) {
|
143770
|
+
value2 = _intern.get(value2);
|
143771
|
+
_intern.delete(key2);
|
143772
|
+
}
|
143773
|
+
return value2;
|
143774
|
+
}
|
143775
|
+
function keyof(value2) {
|
143776
|
+
return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2;
|
143777
|
+
}
|
143350
143778
|
function identity$c(x2) {
|
143351
143779
|
return x2;
|
143352
143780
|
}
|
143781
|
+
function rollup(values2, reduce2, ...keys3) {
|
143782
|
+
return nest$1(values2, identity$c, reduce2, keys3);
|
143783
|
+
}
|
143784
|
+
function nest$1(values2, map2, reduce2, keys3) {
|
143785
|
+
return function regroup(values22, i2) {
|
143786
|
+
if (i2 >= keys3.length)
|
143787
|
+
return reduce2(values22);
|
143788
|
+
const groups2 = new InternMap2();
|
143789
|
+
const keyof2 = keys3[i2++];
|
143790
|
+
let index2 = -1;
|
143791
|
+
for (const value2 of values22) {
|
143792
|
+
const key2 = keyof2(value2, ++index2, values22);
|
143793
|
+
const group2 = groups2.get(key2);
|
143794
|
+
if (group2)
|
143795
|
+
group2.push(value2);
|
143796
|
+
else
|
143797
|
+
groups2.set(key2, [value2]);
|
143798
|
+
}
|
143799
|
+
for (const [key2, values3] of groups2) {
|
143800
|
+
groups2.set(key2, regroup(values3, i2));
|
143801
|
+
}
|
143802
|
+
return map2(groups2);
|
143803
|
+
}(values2, 0);
|
143804
|
+
}
|
143353
143805
|
var array$8 = Array.prototype;
|
143354
143806
|
var slice$4 = array$8.slice;
|
143355
143807
|
function constant$8(x2) {
|
@@ -143597,10 +144049,10 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
|
|
143597
144049
|
const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
|
143598
144050
|
const colorTexHeight = Math.max(2, Math.ceil(totalColorsLength / texSize));
|
143599
144051
|
if (valueTexHeight > texSize) {
|
143600
|
-
|
144052
|
+
log$b.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
|
143601
144053
|
}
|
143602
144054
|
if (colorTexHeight > texSize) {
|
143603
|
-
|
144055
|
+
log$b.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
|
143604
144056
|
}
|
143605
144057
|
const totalData = new Uint8Array(texSize * valueTexHeight);
|
143606
144058
|
const totalColors = new Uint8Array(texSize * colorTexHeight);
|
@@ -144469,7 +144921,7 @@ function initInterpolator$1(domain2, interpolator) {
|
|
144469
144921
|
}
|
144470
144922
|
const implicit$1 = Symbol("implicit");
|
144471
144923
|
function ordinal$1() {
|
144472
|
-
var index2 = new InternMap(), domain2 = [], range2 = [], unknown = implicit$1;
|
144924
|
+
var index2 = new InternMap$1(), domain2 = [], range2 = [], unknown = implicit$1;
|
144473
144925
|
function scale2(d) {
|
144474
144926
|
let i2 = index2.get(d);
|
144475
144927
|
if (i2 === void 0) {
|
@@ -144482,7 +144934,7 @@ function ordinal$1() {
|
|
144482
144934
|
scale2.domain = function(_) {
|
144483
144935
|
if (!arguments.length)
|
144484
144936
|
return domain2.slice();
|
144485
|
-
domain2 = [], index2 = new InternMap();
|
144937
|
+
domain2 = [], index2 = new InternMap$1();
|
144486
144938
|
for (const value2 of _) {
|
144487
144939
|
if (index2.has(value2))
|
144488
144940
|
continue;
|
@@ -153542,7 +153994,10 @@ function CellSetExpressionPlot(props) {
|
|
153542
153994
|
stratificationSide = ordinal$1().domain(sampleSetNames).range(["left", "right"]);
|
153543
153995
|
stratificationColor = ordinal$1().domain(sampleSetNames).range(
|
153544
153996
|
// TODO: check for full path equality here.
|
153545
|
-
sampleSetNames.map((name2) =>
|
153997
|
+
sampleSetNames.map((name2) => {
|
153998
|
+
var _a2;
|
153999
|
+
return ((_a2 = sampleSetColor == null ? void 0 : sampleSetColor.find((d) => d.path.at(-1) === name2)) == null ? void 0 : _a2.color) || [125, 125, 125];
|
154000
|
+
}).map(colorArrayToString)
|
153546
154001
|
);
|
153547
154002
|
}
|
153548
154003
|
const {
|
@@ -153679,11 +154134,11 @@ function summarize(iterable, keepZeros) {
|
|
153679
154134
|
};
|
153680
154135
|
}
|
153681
154136
|
function dotStratifiedExpressionData(stratifiedResult, posThreshold) {
|
153682
|
-
const result = new InternMap([], JSON.stringify);
|
154137
|
+
const result = new InternMap$1([], JSON.stringify);
|
153683
154138
|
Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
|
153684
|
-
result.set(cellSetKey, new InternMap([], JSON.stringify));
|
154139
|
+
result.set(cellSetKey, new InternMap$1([], JSON.stringify));
|
153685
154140
|
Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
|
153686
|
-
result.get(cellSetKey).set(sampleSetKey, new InternMap([], JSON.stringify));
|
154141
|
+
result.get(cellSetKey).set(sampleSetKey, new InternMap$1([], JSON.stringify));
|
153687
154142
|
Array.from(secondLevelInternMap.entries()).forEach(([geneKey, values2]) => {
|
153688
154143
|
if (values2) {
|
153689
154144
|
const exprMean = mean$1(values2);
|
@@ -153701,9 +154156,9 @@ function dotStratifiedExpressionData(stratifiedResult, posThreshold) {
|
|
153701
154156
|
return result;
|
153702
154157
|
}
|
153703
154158
|
function summarizeStratifiedExpressionData(stratifiedResult, keepZeros) {
|
153704
|
-
const summarizedResult = new InternMap([], JSON.stringify);
|
154159
|
+
const summarizedResult = new InternMap$1([], JSON.stringify);
|
153705
154160
|
Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
|
153706
|
-
summarizedResult.set(cellSetKey, new InternMap([], JSON.stringify));
|
154161
|
+
summarizedResult.set(cellSetKey, new InternMap$1([], JSON.stringify));
|
153707
154162
|
Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
|
153708
154163
|
const values2 = secondLevelInternMap;
|
153709
154164
|
const summary = summarize(values2, keepZeros);
|
@@ -173065,10 +173520,10 @@ const Tiles = {
|
|
173065
173520
|
resquarify: treemapResquarify
|
173066
173521
|
};
|
173067
173522
|
const Output$4 = ["x0", "y0", "x1", "y1", "depth", "children"];
|
173068
|
-
function Treemap(params2) {
|
173523
|
+
function Treemap$1(params2) {
|
173069
173524
|
HierarchyLayout.call(this, params2);
|
173070
173525
|
}
|
173071
|
-
Treemap.Definition = {
|
173526
|
+
Treemap$1.Definition = {
|
173072
173527
|
"type": "Treemap",
|
173073
173528
|
"metadata": {
|
173074
173529
|
"tree": true,
|
@@ -173134,7 +173589,7 @@ Treemap.Definition = {
|
|
173134
173589
|
"default": Output$4
|
173135
173590
|
}]
|
173136
173591
|
};
|
173137
|
-
inherits(Treemap, HierarchyLayout, {
|
173592
|
+
inherits(Treemap$1, HierarchyLayout, {
|
173138
173593
|
/**
|
173139
173594
|
* Treemap layout generator. Adds 'method' and 'ratio' parameters
|
173140
173595
|
* to configure the underlying tile method.
|
@@ -173165,7 +173620,7 @@ const tree = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
173165
173620
|
stratify: Stratify,
|
173166
173621
|
tree: Tree,
|
173167
173622
|
treelinks: TreeLinks,
|
173168
|
-
treemap: Treemap
|
173623
|
+
treemap: Treemap$1
|
173169
173624
|
}, Symbol.toStringTag, { value: "Module" }));
|
173170
173625
|
const ALPHA_MASK = 4278190080;
|
173171
173626
|
function baseBitmaps($2, data2) {
|
@@ -206141,11 +206596,11 @@ function useExpressionSummaries(sampleEdges, sampleSets, sampleSetSelection, exp
|
|
206141
206596
|
posThreshold
|
206142
206597
|
);
|
206143
206598
|
const geneToUuid = new Map(geneSelection == null ? void 0 : geneSelection.map((gene) => [gene, v4$1()]));
|
206144
|
-
const cellSetToUuid = new InternMap(
|
206599
|
+
const cellSetToUuid = new InternMap$1(
|
206145
206600
|
cellSetSelection == null ? void 0 : cellSetSelection.map((sampleSet) => [sampleSet, v4$1()]),
|
206146
206601
|
JSON.stringify
|
206147
206602
|
);
|
206148
|
-
const sampleSetToUuid = new InternMap(
|
206603
|
+
const sampleSetToUuid = new InternMap$1(
|
206149
206604
|
sampleSetSelection == null ? void 0 : sampleSetSelection.map((sampleSet) => [sampleSet, v4$1()]),
|
206150
206605
|
JSON.stringify
|
206151
206606
|
);
|
@@ -206647,12 +207102,460 @@ function FeatureBarPlotSubscriber(props) {
|
|
206647
207102
|
}
|
206648
207103
|
);
|
206649
207104
|
}
|
207105
|
+
function uidGenerator(prefix2) {
|
207106
|
+
let i2 = 0;
|
207107
|
+
return () => {
|
207108
|
+
i2 += 1;
|
207109
|
+
return { id: `${prefix2}-${i2}`, href: `#${prefix2}-${i2}` };
|
207110
|
+
};
|
207111
|
+
}
|
207112
|
+
function getColorScale(setSelectionArr, setColorArr, theme) {
|
207113
|
+
var _a2;
|
207114
|
+
return ordinal$1().domain(setSelectionArr || []).range(
|
207115
|
+
((_a2 = setSelectionArr == null ? void 0 : setSelectionArr.map((setNamePath) => {
|
207116
|
+
var _a3;
|
207117
|
+
return ((_a3 = setColorArr == null ? void 0 : setColorArr.find((d) => isEqual$2(d.path, setNamePath))) == null ? void 0 : _a3.color) || getDefaultColor(theme);
|
207118
|
+
})) == null ? void 0 : _a2.map(colorArrayToString)) || []
|
207119
|
+
);
|
207120
|
+
}
|
207121
|
+
function Treemap(props) {
|
207122
|
+
const {
|
207123
|
+
obsCounts,
|
207124
|
+
obsColorEncoding,
|
207125
|
+
hierarchyLevels,
|
207126
|
+
theme,
|
207127
|
+
width: width2,
|
207128
|
+
height: height2,
|
207129
|
+
obsType,
|
207130
|
+
sampleType,
|
207131
|
+
obsSetColor,
|
207132
|
+
sampleSetColor,
|
207133
|
+
obsSetSelection,
|
207134
|
+
sampleSetSelection,
|
207135
|
+
marginTop = 5,
|
207136
|
+
marginRight = 5,
|
207137
|
+
marginLeft = 80,
|
207138
|
+
marginBottom
|
207139
|
+
} = props;
|
207140
|
+
const hierarchyData = useMemo(() => {
|
207141
|
+
if (!obsCounts) {
|
207142
|
+
return null;
|
207143
|
+
}
|
207144
|
+
let map2;
|
207145
|
+
if (isEqual$2(hierarchyLevels, ["sampleSet", "obsSet"])) {
|
207146
|
+
map2 = rollup(
|
207147
|
+
obsCounts,
|
207148
|
+
(D2) => D2[0].value,
|
207149
|
+
(d) => d.sampleSetPath,
|
207150
|
+
(d) => d.obsSetPath
|
207151
|
+
);
|
207152
|
+
} else if (isEqual$2(hierarchyLevels, ["obsSet", "sampleSet"])) {
|
207153
|
+
map2 = rollup(
|
207154
|
+
obsCounts,
|
207155
|
+
(D2) => D2[0].value,
|
207156
|
+
(d) => d.obsSetPath,
|
207157
|
+
(d) => d.sampleSetPath
|
207158
|
+
);
|
207159
|
+
} else {
|
207160
|
+
throw new Error("Unexpected levels value.");
|
207161
|
+
}
|
207162
|
+
return hierarchy(map2);
|
207163
|
+
}, [obsCounts, hierarchyLevels]);
|
207164
|
+
const [obsSetColorScale, sampleSetColorScale] = useMemo(() => [
|
207165
|
+
getColorScale(obsSetSelection, obsSetColor, theme),
|
207166
|
+
getColorScale(sampleSetSelection, sampleSetColor, theme)
|
207167
|
+
], [obsSetSelection, sampleSetSelection, sampleSetColor, obsSetColor, theme]);
|
207168
|
+
const treemapLeaves = useMemo(() => {
|
207169
|
+
const treemapFunc = treemap().tile(treemapBinary).size([width2, height2]).padding(1).round(true);
|
207170
|
+
const treemapLayout = treemapFunc(hierarchyData.sum((d) => d[1]).sort((a2, b2) => b2[1] - a2[1]));
|
207171
|
+
return treemapLayout.leaves();
|
207172
|
+
}, [hierarchyData, width2, height2]);
|
207173
|
+
const svgRef = useRef();
|
207174
|
+
useEffect(() => {
|
207175
|
+
const domElement = svgRef.current;
|
207176
|
+
const svg = select$1(domElement);
|
207177
|
+
svg.selectAll("g").remove();
|
207178
|
+
svg.attr("width", width2).attr("height", height2).attr("viewBox", [0, 0, width2, height2]).attr("style", "font: 10px sans-serif");
|
207179
|
+
if (!treemapLeaves || !obsSetSelection || !sampleSetSelection) {
|
207180
|
+
return;
|
207181
|
+
}
|
207182
|
+
const leaf = svg.selectAll("g").data(treemapLeaves).join("g").attr("transform", (d) => `translate(${d.x0},${d.y0})`);
|
207183
|
+
leaf.append("title").text((d) => {
|
207184
|
+
var _a2;
|
207185
|
+
const cellCount = (_a2 = d.data) == null ? void 0 : _a2[1];
|
207186
|
+
const primaryPathString = JSON.stringify(d.data[0]);
|
207187
|
+
const secondaryPathString = JSON.stringify(d.parent.data[0]);
|
207188
|
+
return `${cellCount.toLocaleString()} ${pluralize(obsType, cellCount)} in ${primaryPathString} and ${secondaryPathString}`;
|
207189
|
+
});
|
207190
|
+
const getLeafUid = uidGenerator("leaf");
|
207191
|
+
const getClipUid = uidGenerator("clip");
|
207192
|
+
const colorScale2 = obsColorEncoding === "sampleSetSelection" ? sampleSetColorScale : obsSetColorScale;
|
207193
|
+
const getPathForColoring = (d) => {
|
207194
|
+
var _a2, _b, _c, _d, _e, _f;
|
207195
|
+
return (
|
207196
|
+
// eslint-disable-next-line no-nested-ternary
|
207197
|
+
obsColorEncoding === "sampleSetSelection" ? hierarchyLevels[0] === "obsSet" ? (_a2 = d.data) == null ? void 0 : _a2[0] : (_c = (_b = d.parent) == null ? void 0 : _b.data) == null ? void 0 : _c[0] : hierarchyLevels[0] === "sampleSet" ? (_d = d.data) == null ? void 0 : _d[0] : (_f = (_e = d.parent) == null ? void 0 : _e.data) == null ? void 0 : _f[0]
|
207198
|
+
);
|
207199
|
+
};
|
207200
|
+
leaf.append("rect").attr("id", (d) => {
|
207201
|
+
d.leafUid = getLeafUid();
|
207202
|
+
return d.leafUid.id;
|
207203
|
+
}).attr("fill", (d) => colorScale2(getPathForColoring(d))).attr("fill-opacity", 0.8).attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0);
|
207204
|
+
leaf.append("clipPath").attr("id", (d) => {
|
207205
|
+
d.clipUid = getClipUid();
|
207206
|
+
return d.clipUid.id;
|
207207
|
+
}).append("use").attr("xlink:href", (d) => d.leafUid.href);
|
207208
|
+
leaf.append("text").attr("clip-path", (d) => `url(${d.clipUid.href})`).selectAll("tspan").data((d) => {
|
207209
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
207210
|
+
return [
|
207211
|
+
// Each element in this array corresponds to a line of text.
|
207212
|
+
(_b = (_a2 = d.data) == null ? void 0 : _a2[0]) == null ? void 0 : _b.at(-1),
|
207213
|
+
(_e = (_d = (_c = d.parent) == null ? void 0 : _c.data) == null ? void 0 : _d[0]) == null ? void 0 : _e.at(-1),
|
207214
|
+
`${(_f = d.data) == null ? void 0 : _f[1].toLocaleString()} ${pluralize(obsType, (_g = d.data) == null ? void 0 : _g[1])}`
|
207215
|
+
];
|
207216
|
+
}).join("tspan").attr("x", 3).attr("y", (d, i2, nodes) => `${(i2 === nodes.length - 1) * 0.3 + 1.1 + i2 * 0.9}em`).text((d) => d);
|
207217
|
+
}, [
|
207218
|
+
width2,
|
207219
|
+
height2,
|
207220
|
+
marginLeft,
|
207221
|
+
marginBottom,
|
207222
|
+
theme,
|
207223
|
+
marginTop,
|
207224
|
+
marginRight,
|
207225
|
+
obsType,
|
207226
|
+
sampleType,
|
207227
|
+
treemapLeaves,
|
207228
|
+
sampleSetColor,
|
207229
|
+
sampleSetSelection,
|
207230
|
+
obsSetSelection,
|
207231
|
+
obsSetColor,
|
207232
|
+
obsSetColorScale,
|
207233
|
+
sampleSetColorScale,
|
207234
|
+
obsColorEncoding,
|
207235
|
+
hierarchyLevels
|
207236
|
+
]);
|
207237
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
207238
|
+
"svg",
|
207239
|
+
{
|
207240
|
+
ref: svgRef,
|
207241
|
+
style: {
|
207242
|
+
top: 0,
|
207243
|
+
left: 0,
|
207244
|
+
width: `${width2}px`,
|
207245
|
+
height: `${height2}px`,
|
207246
|
+
position: "relative"
|
207247
|
+
}
|
207248
|
+
}
|
207249
|
+
);
|
207250
|
+
}
|
207251
|
+
function TreemapOptions(props) {
|
207252
|
+
const {
|
207253
|
+
children: children2,
|
207254
|
+
obsType,
|
207255
|
+
sampleType,
|
207256
|
+
hierarchyLevels,
|
207257
|
+
setHierarchyLevels,
|
207258
|
+
obsColorEncoding,
|
207259
|
+
setObsColorEncoding
|
207260
|
+
} = props;
|
207261
|
+
const treemapOptionsId = $bdb11010cef70236$export$f680877a34711e37();
|
207262
|
+
const classes = usePlotOptionsStyles();
|
207263
|
+
function handleColorEncodingChange(event2) {
|
207264
|
+
setObsColorEncoding(event2.target.value);
|
207265
|
+
}
|
207266
|
+
function handleHierarchyLevelsOrderingChange(event2) {
|
207267
|
+
if (event2.target.value === "sampleSet") {
|
207268
|
+
setHierarchyLevels(["sampleSet", "obsSet"]);
|
207269
|
+
} else {
|
207270
|
+
setHierarchyLevels(["obsSet", "sampleSet"]);
|
207271
|
+
}
|
207272
|
+
}
|
207273
|
+
const primaryHierarchyLevel = isEqual$2(hierarchyLevels, ["sampleSet", "obsSet"]) ? "sampleSet" : "obsSet";
|
207274
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(OptionsContainer, { children: [
|
207275
|
+
children2,
|
207276
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow$1, { children: [
|
207277
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell$1, { className: classes.labelCell, variant: "head", scope: "row", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
207278
|
+
"label",
|
207279
|
+
{
|
207280
|
+
htmlFor: `cell-color-encoding-select-${treemapOptionsId}`,
|
207281
|
+
children: "Color Encoding"
|
207282
|
+
}
|
207283
|
+
) }),
|
207284
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell$1, { className: classes.inputCell, variant: "body", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
207285
|
+
OptionSelect,
|
207286
|
+
{
|
207287
|
+
className: classes.select,
|
207288
|
+
value: obsColorEncoding,
|
207289
|
+
onChange: handleColorEncodingChange,
|
207290
|
+
inputProps: {
|
207291
|
+
id: `cell-color-encoding-select-${treemapOptionsId}`
|
207292
|
+
},
|
207293
|
+
children: [
|
207294
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("option", { value: "cellSetSelection", children: [
|
207295
|
+
capitalize$2(obsType),
|
207296
|
+
" Sets"
|
207297
|
+
] }),
|
207298
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("option", { value: "sampleSetSelection", children: [
|
207299
|
+
capitalize$2(sampleType),
|
207300
|
+
" Sets"
|
207301
|
+
] })
|
207302
|
+
]
|
207303
|
+
}
|
207304
|
+
) })
|
207305
|
+
] }),
|
207306
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow$1, { children: [
|
207307
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell$1, { className: classes.labelCell, variant: "head", scope: "row", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
207308
|
+
"label",
|
207309
|
+
{
|
207310
|
+
htmlFor: `treemap-set-hierarchy-levels-${treemapOptionsId}`,
|
207311
|
+
children: "Primary Hierarchy Level"
|
207312
|
+
}
|
207313
|
+
) }),
|
207314
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TableCell$1, { className: classes.inputCell, variant: "body", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
207315
|
+
OptionSelect,
|
207316
|
+
{
|
207317
|
+
className: classes.select,
|
207318
|
+
value: primaryHierarchyLevel,
|
207319
|
+
onChange: handleHierarchyLevelsOrderingChange,
|
207320
|
+
inputProps: {
|
207321
|
+
id: `hierarchy-level-select-${treemapOptionsId}`
|
207322
|
+
},
|
207323
|
+
children: [
|
207324
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("option", { value: "obsSet", children: [
|
207325
|
+
capitalize$2(obsType),
|
207326
|
+
" Sets"
|
207327
|
+
] }),
|
207328
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("option", { value: "sampleSet", children: [
|
207329
|
+
capitalize$2(sampleType),
|
207330
|
+
" Sets"
|
207331
|
+
] })
|
207332
|
+
]
|
207333
|
+
}
|
207334
|
+
) })
|
207335
|
+
] })
|
207336
|
+
] });
|
207337
|
+
}
|
207338
|
+
const DEFAULT_HIERARCHY_LEVELS = ["obsSet", "sampleSet"];
|
207339
|
+
function TreemapSubscriber(props) {
|
207340
|
+
const {
|
207341
|
+
coordinationScopes,
|
207342
|
+
removeGridComponent,
|
207343
|
+
theme,
|
207344
|
+
helpText = ViewHelpMapping.TREEMAP
|
207345
|
+
} = props;
|
207346
|
+
const classes = useStyles$1();
|
207347
|
+
const loaders = useLoaders();
|
207348
|
+
const [{
|
207349
|
+
dataset,
|
207350
|
+
obsType,
|
207351
|
+
featureType,
|
207352
|
+
featureValueType,
|
207353
|
+
obsFilter,
|
207354
|
+
obsHighlight,
|
207355
|
+
obsSetSelection,
|
207356
|
+
obsSetFilter,
|
207357
|
+
obsSelection,
|
207358
|
+
obsSelectionMode,
|
207359
|
+
obsSetHighlight,
|
207360
|
+
obsSetColor,
|
207361
|
+
obsColorEncoding,
|
207362
|
+
additionalObsSets,
|
207363
|
+
sampleType,
|
207364
|
+
sampleSetSelection,
|
207365
|
+
sampleSetFilter,
|
207366
|
+
sampleSetColor,
|
207367
|
+
sampleSelection,
|
207368
|
+
sampleSelectionMode,
|
207369
|
+
sampleFilter,
|
207370
|
+
sampleFilterMode,
|
207371
|
+
sampleHighlight,
|
207372
|
+
hierarchyLevels
|
207373
|
+
}, {
|
207374
|
+
setObsFilter,
|
207375
|
+
setObsSelection: setObsSelection2,
|
207376
|
+
setObsSetFilter,
|
207377
|
+
setObsSetSelection,
|
207378
|
+
setObsSelectionMode,
|
207379
|
+
setObsFilterMode,
|
207380
|
+
setObsHighlight,
|
207381
|
+
setObsSetColor,
|
207382
|
+
setObsColorEncoding,
|
207383
|
+
setAdditionalObsSets,
|
207384
|
+
setSampleFilter,
|
207385
|
+
setSampleSetFilter,
|
207386
|
+
setSampleFilterMode,
|
207387
|
+
setSampleSelection,
|
207388
|
+
setSampleSetSelection,
|
207389
|
+
setSampleSelectionMode,
|
207390
|
+
setSampleHighlight,
|
207391
|
+
setSampleSetColor,
|
207392
|
+
setHierarchyLevels
|
207393
|
+
}] = useCoordination(
|
207394
|
+
COMPONENT_COORDINATION_TYPES[ViewType$1.TREEMAP],
|
207395
|
+
coordinationScopes
|
207396
|
+
);
|
207397
|
+
const [width2, height2, containerRef] = useGridItemSize();
|
207398
|
+
const [{ obsIndex }, matrixIndicesStatus, matrixIndicesUrls] = useObsFeatureMatrixIndices(
|
207399
|
+
loaders,
|
207400
|
+
dataset,
|
207401
|
+
false,
|
207402
|
+
{ obsType, featureType, featureValueType }
|
207403
|
+
);
|
207404
|
+
const [{ obsSets }, obsSetsStatus, obsSetsUrls] = useObsSetsData(
|
207405
|
+
loaders,
|
207406
|
+
dataset,
|
207407
|
+
true,
|
207408
|
+
{},
|
207409
|
+
{},
|
207410
|
+
{ obsType }
|
207411
|
+
);
|
207412
|
+
const [{ sampleIndex, sampleSets }, sampleSetsStatus, sampleSetsUrls] = useSampleSetsData(
|
207413
|
+
loaders,
|
207414
|
+
dataset,
|
207415
|
+
// TODO: support `false`, i.e., configurations in which
|
207416
|
+
// there are no sampleSets
|
207417
|
+
true,
|
207418
|
+
{ setSampleSetColor },
|
207419
|
+
{ sampleSetColor },
|
207420
|
+
{ sampleType }
|
207421
|
+
);
|
207422
|
+
const [{ sampleEdges }, sampleEdgesStatus, sampleEdgesUrls] = useSampleEdgesData(
|
207423
|
+
loaders,
|
207424
|
+
dataset,
|
207425
|
+
// TODO: support `false`, i.e., configurations in which
|
207426
|
+
// there are no sampleEdges
|
207427
|
+
true,
|
207428
|
+
{},
|
207429
|
+
{},
|
207430
|
+
{ obsType, sampleType }
|
207431
|
+
);
|
207432
|
+
const isReady = useReady([
|
207433
|
+
matrixIndicesStatus,
|
207434
|
+
obsSetsStatus,
|
207435
|
+
sampleSetsStatus,
|
207436
|
+
sampleEdgesStatus
|
207437
|
+
]);
|
207438
|
+
const urls = useUrls([
|
207439
|
+
matrixIndicesUrls,
|
207440
|
+
obsSetsUrls,
|
207441
|
+
sampleSetsUrls,
|
207442
|
+
sampleEdgesUrls
|
207443
|
+
]);
|
207444
|
+
const mergedObsSets = useMemo(
|
207445
|
+
() => mergeObsSets(obsSets, additionalObsSets),
|
207446
|
+
[obsSets, additionalObsSets]
|
207447
|
+
);
|
207448
|
+
const mergedSampleSets = useMemo(
|
207449
|
+
() => mergeObsSets(sampleSets, null),
|
207450
|
+
[sampleSets]
|
207451
|
+
);
|
207452
|
+
const obsCount = (obsIndex == null ? void 0 : obsIndex.length) || 0;
|
207453
|
+
const sampleCount = (sampleIndex == null ? void 0 : sampleIndex.length) || 0;
|
207454
|
+
const [obsCounts, sampleCounts] = useMemo(() => {
|
207455
|
+
var _a2, _b;
|
207456
|
+
const obsResult = new InternMap$1([], JSON.stringify);
|
207457
|
+
const sampleResult = new InternMap$1([], JSON.stringify);
|
207458
|
+
const hasSampleSetSelection = Array.isArray(sampleSetSelection) && sampleSetSelection.length > 0;
|
207459
|
+
const hasCellSetSelection = Array.isArray(obsSetSelection) && obsSetSelection.length > 0;
|
207460
|
+
const sampleSetKeys = hasSampleSetSelection ? sampleSetSelection : [null];
|
207461
|
+
const cellSetKeys = hasCellSetSelection ? obsSetSelection : [null];
|
207462
|
+
cellSetKeys.forEach((cellSetKey) => {
|
207463
|
+
obsResult.set(cellSetKey, new InternMap$1([], JSON.stringify));
|
207464
|
+
sampleSetKeys.forEach((sampleSetKey) => {
|
207465
|
+
obsResult.get(cellSetKey).set(sampleSetKey, 0);
|
207466
|
+
});
|
207467
|
+
});
|
207468
|
+
const sampleSetSizes = treeToSetSizesBySetNames(
|
207469
|
+
mergedSampleSets,
|
207470
|
+
sampleSetSelection,
|
207471
|
+
sampleSetSelection,
|
207472
|
+
sampleSetColor,
|
207473
|
+
theme
|
207474
|
+
);
|
207475
|
+
sampleSetKeys.forEach((sampleSetKey) => {
|
207476
|
+
var _a3;
|
207477
|
+
const sampleSetSize = (_a3 = sampleSetSizes.find((d) => isEqual$2(d.setNamePath, sampleSetKey))) == null ? void 0 : _a3.size;
|
207478
|
+
sampleResult.set(sampleSetKey, sampleSetSize || 0);
|
207479
|
+
});
|
207480
|
+
if (mergedObsSets && obsSetSelection) {
|
207481
|
+
const sampleIdToSetMap = sampleSets && sampleSetSelection ? treeToSelectedSetMap(sampleSets, sampleSetSelection) : null;
|
207482
|
+
const cellIdToSetMap = treeToSelectedSetMap(mergedObsSets, obsSetSelection);
|
207483
|
+
for (let i2 = 0; i2 < obsIndex.length; i2 += 1) {
|
207484
|
+
const obsId = obsIndex[i2];
|
207485
|
+
const cellSet = cellIdToSetMap == null ? void 0 : cellIdToSetMap.get(obsId);
|
207486
|
+
const sampleId = sampleEdges == null ? void 0 : sampleEdges.get(obsId);
|
207487
|
+
const sampleSet = sampleId ? sampleIdToSetMap == null ? void 0 : sampleIdToSetMap.get(sampleId) : null;
|
207488
|
+
if (hasSampleSetSelection && !sampleSet) {
|
207489
|
+
continue;
|
207490
|
+
}
|
207491
|
+
const prevObsCount = (_a2 = obsResult.get(cellSet)) == null ? void 0 : _a2.get(sampleSet);
|
207492
|
+
(_b = obsResult.get(cellSet)) == null ? void 0 : _b.set(sampleSet, prevObsCount + 1);
|
207493
|
+
}
|
207494
|
+
}
|
207495
|
+
return [
|
207496
|
+
unnestMap(obsResult, ["obsSetPath", "sampleSetPath", "value"]),
|
207497
|
+
unnestMap(sampleResult, ["sampleSetPath", "value"])
|
207498
|
+
];
|
207499
|
+
}, [
|
207500
|
+
obsIndex,
|
207501
|
+
sampleEdges,
|
207502
|
+
sampleSets,
|
207503
|
+
obsSetColor,
|
207504
|
+
sampleSetColor,
|
207505
|
+
mergedObsSets,
|
207506
|
+
obsSetSelection,
|
207507
|
+
mergedSampleSets
|
207508
|
+
// TODO: consider filtering-related coordination values
|
207509
|
+
]);
|
207510
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
207511
|
+
TitleInfo,
|
207512
|
+
{
|
207513
|
+
title: `Treemap of ${capitalize$2(pluralize(obsType, 2))}`,
|
207514
|
+
info: `${commaNumber(obsCount)} ${pluralize(obsType, obsCount)} from ${commaNumber(sampleCount)} ${pluralize(sampleType, sampleCount)}`,
|
207515
|
+
removeGridComponent,
|
207516
|
+
urls,
|
207517
|
+
theme,
|
207518
|
+
isReady,
|
207519
|
+
helpText,
|
207520
|
+
options: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
207521
|
+
TreemapOptions,
|
207522
|
+
{
|
207523
|
+
obsType,
|
207524
|
+
sampleType,
|
207525
|
+
obsColorEncoding,
|
207526
|
+
setObsColorEncoding,
|
207527
|
+
hierarchyLevels: hierarchyLevels || DEFAULT_HIERARCHY_LEVELS,
|
207528
|
+
setHierarchyLevels
|
207529
|
+
}
|
207530
|
+
),
|
207531
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
207532
|
+
Treemap,
|
207533
|
+
{
|
207534
|
+
obsCounts,
|
207535
|
+
sampleCounts,
|
207536
|
+
obsColorEncoding,
|
207537
|
+
hierarchyLevels: hierarchyLevels || DEFAULT_HIERARCHY_LEVELS,
|
207538
|
+
theme,
|
207539
|
+
width: width2,
|
207540
|
+
height: height2,
|
207541
|
+
obsType,
|
207542
|
+
sampleType,
|
207543
|
+
obsSetColor,
|
207544
|
+
sampleSetColor,
|
207545
|
+
obsSetSelection,
|
207546
|
+
sampleSetSelection
|
207547
|
+
}
|
207548
|
+
) })
|
207549
|
+
}
|
207550
|
+
);
|
207551
|
+
}
|
206650
207552
|
export {
|
206651
207553
|
BaseDecoder as B,
|
206652
207554
|
CellSetExpressionPlotSubscriber as C,
|
206653
207555
|
DotPlotSubscriber as D,
|
206654
207556
|
ExpressionHistogramSubscriber as E,
|
206655
207557
|
FeatureBarPlotSubscriber as F,
|
207558
|
+
TreemapSubscriber as T,
|
206656
207559
|
CellSetSizesPlotSubscriber as a,
|
206657
207560
|
CellSetSizesPlot as b,
|
206658
207561
|
CellSetExpressionPlot as c,
|