@vitessce/sets-utils 3.5.8 → 3.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +23 -29
- package/dist-tsc/cell-set-utils.js +1 -1
- package/dist-tsc/expr-utils.d.ts.map +1 -1
- package/dist-tsc/expr-utils.js +3 -1
- package/package.json +6 -6
- package/src/cell-set-utils.js +1 -1
- package/src/expr-utils.js +3 -1
package/dist/index.js
CHANGED
|
@@ -1154,11 +1154,8 @@ function createRange(fromRight) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
var range$1 = createRange();
|
|
1156
1156
|
const range$2 = range$1;
|
|
1157
|
-
function feature(geom, properties, options) {
|
|
1158
|
-
|
|
1159
|
-
options = {};
|
|
1160
|
-
}
|
|
1161
|
-
var feat = { type: "Feature" };
|
|
1157
|
+
function feature(geom, properties, options = {}) {
|
|
1158
|
+
const feat = { type: "Feature" };
|
|
1162
1159
|
if (options.id === 0 || options.id) {
|
|
1163
1160
|
feat.id = options.id;
|
|
1164
1161
|
}
|
|
@@ -1169,10 +1166,7 @@ function feature(geom, properties, options) {
|
|
|
1169
1166
|
feat.geometry = geom;
|
|
1170
1167
|
return feat;
|
|
1171
1168
|
}
|
|
1172
|
-
function point(coordinates, properties, options) {
|
|
1173
|
-
if (options === void 0) {
|
|
1174
|
-
options = {};
|
|
1175
|
-
}
|
|
1169
|
+
function point(coordinates, properties, options = {}) {
|
|
1176
1170
|
if (!coordinates) {
|
|
1177
1171
|
throw new Error("coordinates is required");
|
|
1178
1172
|
}
|
|
@@ -1185,17 +1179,14 @@ function point(coordinates, properties, options) {
|
|
|
1185
1179
|
if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {
|
|
1186
1180
|
throw new Error("coordinates must contain numbers");
|
|
1187
1181
|
}
|
|
1188
|
-
|
|
1182
|
+
const geom = {
|
|
1189
1183
|
type: "Point",
|
|
1190
1184
|
coordinates
|
|
1191
1185
|
};
|
|
1192
1186
|
return feature(geom, properties, options);
|
|
1193
1187
|
}
|
|
1194
|
-
function featureCollection(features, options) {
|
|
1195
|
-
|
|
1196
|
-
options = {};
|
|
1197
|
-
}
|
|
1198
|
-
var fc = { type: "FeatureCollection" };
|
|
1188
|
+
function featureCollection(features, options = {}) {
|
|
1189
|
+
const fc = { type: "FeatureCollection" };
|
|
1199
1190
|
if (options.id) {
|
|
1200
1191
|
fc.id = options.id;
|
|
1201
1192
|
}
|
|
@@ -1311,18 +1302,19 @@ function coordEach(geojson, callback, excludeWrapCoord) {
|
|
|
1311
1302
|
}
|
|
1312
1303
|
}
|
|
1313
1304
|
}
|
|
1314
|
-
function centroid(geojson, options) {
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1305
|
+
function centroid(geojson, options = {}) {
|
|
1306
|
+
let xSum = 0;
|
|
1307
|
+
let ySum = 0;
|
|
1308
|
+
let len = 0;
|
|
1309
|
+
coordEach(
|
|
1310
|
+
geojson,
|
|
1311
|
+
function(coord) {
|
|
1312
|
+
xSum += coord[0];
|
|
1313
|
+
ySum += coord[1];
|
|
1314
|
+
len++;
|
|
1315
|
+
},
|
|
1316
|
+
true
|
|
1317
|
+
);
|
|
1326
1318
|
return point([xSum / len, ySum / len], options.properties);
|
|
1327
1319
|
}
|
|
1328
1320
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -9380,7 +9372,9 @@ const ViewType$1 = {
|
|
|
9380
9372
|
LINK_CONTROLLER: "linkController",
|
|
9381
9373
|
NEUROGLANCER: "neuroglancer",
|
|
9382
9374
|
DUAL_SCATTERPLOT: "dualScatterplot",
|
|
9383
|
-
TREEMAP: "treemap"
|
|
9375
|
+
TREEMAP: "treemap",
|
|
9376
|
+
SAMPLE_SET_PAIR_MANAGER: "sampleSetPairManager",
|
|
9377
|
+
FEATURE_STATS_TABLE: "featureStatsTable"
|
|
9384
9378
|
};
|
|
9385
9379
|
const DataType$1 = {
|
|
9386
9380
|
OBS_LABELS: "obsLabels",
|
|
@@ -17874,7 +17868,7 @@ function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, exp
|
|
|
17874
17868
|
const obsId = obsIndex[i];
|
|
17875
17869
|
const cellSet = cellIdToSetMap == null ? void 0 : cellIdToSetMap.get(obsId);
|
|
17876
17870
|
const sampleId = sampleEdges == null ? void 0 : sampleEdges.get(obsId);
|
|
17877
|
-
const sampleSet = sampleId ? sampleIdToSetMap == null ? void 0 : sampleIdToSetMap.get(sampleId) : null;
|
|
17871
|
+
const sampleSet = sampleId && hasSampleSetSelection ? sampleIdToSetMap == null ? void 0 : sampleIdToSetMap.get(sampleId) : null;
|
|
17878
17872
|
if (hasSampleSetSelection && !sampleSet) {
|
|
17879
17873
|
continue;
|
|
17880
17874
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
3
|
import { isNil, isEqual, range } from 'lodash-es';
|
|
4
4
|
import { featureCollection as turfFeatureCollection, point as turfPoint } from '@turf/helpers';
|
|
5
|
-
import centroid from '@turf/centroid';
|
|
5
|
+
import { centroid } from '@turf/centroid';
|
|
6
6
|
import concaveman from 'concaveman';
|
|
7
7
|
import { getDefaultColor, PALETTE } from '@vitessce/utils';
|
|
8
8
|
import { HIERARCHICAL_SCHEMAS, } from './constants.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expr-utils.d.ts","sourceRoot":"","sources":["../src/expr-utils.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,4CAbW,GAAC,wCACD,GAAC,sBACD,GAAC,YAED,GAAC,kBACD,GAAC,oBAED,GAAC,8BAoIX;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oDAbW,GAAC,cACD,GAAC,sBACD,GAAC,kBACD,GAAC,YACD,GAAC,kBACD,GAAC,iBACD,GAAC,oBACD,GAAC,gBACD,GAAC,yBACD,GAAC,oCACD,GAAC,
|
|
1
|
+
{"version":3,"file":"expr-utils.d.ts","sourceRoot":"","sources":["../src/expr-utils.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,4CAbW,GAAC,wCACD,GAAC,sBACD,GAAC,YAED,GAAC,kBACD,GAAC,oBAED,GAAC,8BAoIX;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oDAbW,GAAC,cACD,GAAC,sBACD,GAAC,kBACD,GAAC,YACD,GAAC,kBACD,GAAC,iBACD,GAAC,oBACD,GAAC,gBACD,GAAC,yBACD,GAAC,oCACD,GAAC,SAmFX;AAED;;;;;;;;;;GAUG;AACH,oEAJW,GAAC,iBACD,GAAC,OAiBX"}
|
package/dist-tsc/expr-utils.js
CHANGED
|
@@ -190,7 +190,9 @@ featureValueTransform, featureValueTransformCoefficient) {
|
|
|
190
190
|
const obsId = obsIndex[i];
|
|
191
191
|
const cellSet = cellIdToSetMap?.get(obsId);
|
|
192
192
|
const sampleId = sampleEdges?.get(obsId);
|
|
193
|
-
const sampleSet = sampleId
|
|
193
|
+
const sampleSet = sampleId && hasSampleSetSelection
|
|
194
|
+
? sampleIdToSetMap?.get(sampleId)
|
|
195
|
+
: null;
|
|
194
196
|
if (hasSampleSetSelection && !sampleSet) {
|
|
195
197
|
// Skip this sample if it is not in the selected sample set.
|
|
196
198
|
// eslint-disable-next-line no-continue
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/sets-utils",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.10",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"dist-tsc"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@turf/centroid": "^
|
|
20
|
-
"@turf/helpers": "^
|
|
19
|
+
"@turf/centroid": "^7.2.0",
|
|
20
|
+
"@turf/helpers": "^7.2.0",
|
|
21
21
|
"concaveman": "^1.2.1",
|
|
22
22
|
"d3-dsv": "^1.1.1",
|
|
23
23
|
"internmap": "^2.0.3",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"lodash-es": "^4.17.21",
|
|
26
26
|
"tinycolor2": "^1.4.1",
|
|
27
27
|
"uuid": "^9.0.0",
|
|
28
|
-
"@vitessce/schemas": "3.5.
|
|
29
|
-
"@vitessce/utils": "3.5.
|
|
30
|
-
"@vitessce/globals": "3.5.
|
|
28
|
+
"@vitessce/schemas": "3.5.10",
|
|
29
|
+
"@vitessce/utils": "3.5.10",
|
|
30
|
+
"@vitessce/globals": "3.5.10"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
|
package/src/cell-set-utils.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
3
|
import { isNil, isEqual, range } from 'lodash-es';
|
|
4
4
|
import { featureCollection as turfFeatureCollection, point as turfPoint } from '@turf/helpers';
|
|
5
|
-
import centroid from '@turf/centroid';
|
|
5
|
+
import { centroid } from '@turf/centroid';
|
|
6
6
|
import concaveman from 'concaveman';
|
|
7
7
|
import { getDefaultColor, PALETTE } from '@vitessce/utils';
|
|
8
8
|
import {
|
package/src/expr-utils.js
CHANGED
|
@@ -235,7 +235,9 @@ export function stratifyExpressionData(
|
|
|
235
235
|
|
|
236
236
|
const cellSet = cellIdToSetMap?.get(obsId);
|
|
237
237
|
const sampleId = sampleEdges?.get(obsId);
|
|
238
|
-
const sampleSet = sampleId
|
|
238
|
+
const sampleSet = sampleId && hasSampleSetSelection
|
|
239
|
+
? sampleIdToSetMap?.get(sampleId)
|
|
240
|
+
: null;
|
|
239
241
|
|
|
240
242
|
if (hasSampleSetSelection && !sampleSet) {
|
|
241
243
|
// Skip this sample if it is not in the selected sample set.
|