@vitessce/statistical-plots 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.
Files changed (35) hide show
  1. package/dist/{deflate-ad0dcbe4.js → deflate-9e272e07.js} +1 -1
  2. package/dist/{index-b8398176.js → index-fa429ace.js} +230 -83
  3. package/dist/index.js +1 -1
  4. package/dist/{jpeg-81bd1053.js → jpeg-affe217d.js} +1 -1
  5. package/dist/{lerc-b15c3a4c.js → lerc-eeb05714.js} +1 -1
  6. package/dist/{lzw-503cb795.js → lzw-fdf7d374.js} +1 -1
  7. package/dist/{packbits-40cbad40.js → packbits-530d3977.js} +1 -1
  8. package/dist/{raw-9b8d9daf.js → raw-5d9364f4.js} +1 -1
  9. package/dist/{webimage-bbc59b4a.js → webimage-57a383de.js} +1 -1
  10. package/dist-tsc/CellSetCompositionBarPlot.d.ts.map +1 -1
  11. package/dist-tsc/CellSetCompositionBarPlot.js +28 -7
  12. package/dist-tsc/CellSetExpressionPlotOptions.d.ts.map +1 -1
  13. package/dist-tsc/CellSetExpressionPlotOptions.js +11 -4
  14. package/dist-tsc/CellSetExpressionPlotSubscriber.d.ts.map +1 -1
  15. package/dist-tsc/CellSetExpressionPlotSubscriber.js +43 -11
  16. package/dist-tsc/DotPlot.d.ts.map +1 -1
  17. package/dist-tsc/DotPlot.js +6 -2
  18. package/dist-tsc/FeatureSetEnrichmentBarPlot.d.ts.map +1 -1
  19. package/dist-tsc/FeatureSetEnrichmentBarPlot.js +7 -6
  20. package/dist-tsc/FeatureSetEnrichmentBarPlotSubscriber.d.ts.map +1 -1
  21. package/dist-tsc/FeatureSetEnrichmentBarPlotSubscriber.js +5 -2
  22. package/dist-tsc/TreemapSubscriber.d.ts.map +1 -1
  23. package/dist-tsc/TreemapSubscriber.js +10 -6
  24. package/dist-tsc/expr-hooks.d.ts.map +1 -1
  25. package/dist-tsc/expr-hooks.test.js +2 -1
  26. package/package.json +7 -7
  27. package/src/CellSetCompositionBarPlot.js +35 -9
  28. package/src/CellSetExpressionPlotOptions.js +39 -2
  29. package/src/CellSetExpressionPlotSubscriber.js +47 -11
  30. package/src/DotPlot.js +4 -2
  31. package/src/FeatureSetEnrichmentBarPlot.js +7 -6
  32. package/src/FeatureSetEnrichmentBarPlotSubscriber.js +5 -2
  33. package/src/TreemapSubscriber.js +20 -7
  34. package/src/expr-hooks.js +0 -1
  35. package/src/expr-hooks.test.js +2 -1
@@ -1215,6 +1215,7 @@ const CoordinationType$1 = {
1215
1215
  FEATURE_VALUE_COLORMAP: "featureValueColormap",
1216
1216
  FEATURE_VALUE_TRANSFORM: "featureValueTransform",
1217
1217
  FEATURE_VALUE_COLORMAP_RANGE: "featureValueColormapRange",
1218
+ FEATURE_AGGREGATION_STRATEGY: "featureAggregationStrategy",
1218
1219
  OBS_COLOR_ENCODING: "obsColorEncoding",
1219
1220
  SPATIAL_IMAGE_LAYER: "spatialImageLayer",
1220
1221
  SPATIAL_SEGMENTATION_LAYER: "spatialSegmentationLayer",
@@ -1357,6 +1358,7 @@ const COMPONENT_COORDINATION_TYPES = {
1357
1358
  CoordinationType$1.FEATURE_SELECTION,
1358
1359
  CoordinationType$1.FEATURE_VALUE_COLORMAP,
1359
1360
  CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
1361
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
1360
1362
  CoordinationType$1.OBS_COLOR_ENCODING,
1361
1363
  CoordinationType$1.ADDITIONAL_OBS_SETS,
1362
1364
  CoordinationType$1.TOOLTIPS_VISIBLE,
@@ -1400,6 +1402,7 @@ const COMPONENT_COORDINATION_TYPES = {
1400
1402
  CoordinationType$1.FEATURE_SELECTION,
1401
1403
  CoordinationType$1.FEATURE_VALUE_COLORMAP,
1402
1404
  CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
1405
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
1403
1406
  CoordinationType$1.OBS_COLOR_ENCODING,
1404
1407
  CoordinationType$1.ADDITIONAL_OBS_SETS,
1405
1408
  CoordinationType$1.TOOLTIPS_VISIBLE,
@@ -1479,10 +1482,12 @@ const COMPONENT_COORDINATION_TYPES = {
1479
1482
  CoordinationType$1.FEATURE_SELECTION,
1480
1483
  CoordinationType$1.FEATURE_VALUE_COLORMAP,
1481
1484
  CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
1485
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
1482
1486
  CoordinationType$1.OBS_COLOR_ENCODING,
1483
1487
  CoordinationType$1.ADDITIONAL_OBS_SETS,
1484
1488
  CoordinationType$1.MOLECULE_HIGHLIGHT,
1485
- CoordinationType$1.TOOLTIPS_VISIBLE
1489
+ CoordinationType$1.TOOLTIPS_VISIBLE,
1490
+ CoordinationType$1.PHOTOMETRIC_INTERPRETATION
1486
1491
  ],
1487
1492
  [ViewType$1.SPATIAL_BETA]: [
1488
1493
  CoordinationType$1.META_COORDINATION_SCOPES,
@@ -1516,6 +1521,7 @@ const COMPONENT_COORDINATION_TYPES = {
1516
1521
  CoordinationType$1.FEATURE_SELECTION,
1517
1522
  CoordinationType$1.FEATURE_VALUE_COLORMAP,
1518
1523
  CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
1524
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
1519
1525
  CoordinationType$1.OBS_COLOR_ENCODING,
1520
1526
  CoordinationType$1.ADDITIONAL_OBS_SETS,
1521
1527
  CoordinationType$1.MOLECULE_HIGHLIGHT,
@@ -1554,7 +1560,8 @@ const COMPONENT_COORDINATION_TYPES = {
1554
1560
  CoordinationType$1.LEGEND_VISIBLE,
1555
1561
  CoordinationType$1.SPATIAL_CHANNEL_LABELS_VISIBLE,
1556
1562
  CoordinationType$1.SPATIAL_CHANNEL_LABELS_ORIENTATION,
1557
- CoordinationType$1.SPATIAL_CHANNEL_LABEL_SIZE
1563
+ CoordinationType$1.SPATIAL_CHANNEL_LABEL_SIZE,
1564
+ CoordinationType$1.PHOTOMETRIC_INTERPRETATION
1558
1565
  ],
1559
1566
  [ViewType$1.HEATMAP]: [
1560
1567
  CoordinationType$1.DATASET,
@@ -1629,6 +1636,7 @@ const COMPONENT_COORDINATION_TYPES = {
1629
1636
  CoordinationType$1.FEATURE_SELECTION,
1630
1637
  CoordinationType$1.FEATURE_VALUE_TRANSFORM,
1631
1638
  CoordinationType$1.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
1639
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
1632
1640
  CoordinationType$1.OBS_SET_SELECTION,
1633
1641
  CoordinationType$1.OBS_SET_FILTER,
1634
1642
  CoordinationType$1.OBS_SET_HIGHLIGHT,
@@ -1644,6 +1652,7 @@ const COMPONENT_COORDINATION_TYPES = {
1644
1652
  CoordinationType$1.FEATURE_TYPE,
1645
1653
  CoordinationType$1.FEATURE_VALUE_TYPE,
1646
1654
  CoordinationType$1.FEATURE_SELECTION,
1655
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
1647
1656
  CoordinationType$1.ADDITIONAL_OBS_SETS,
1648
1657
  CoordinationType$1.OBS_SET_COLOR,
1649
1658
  CoordinationType$1.OBS_COLOR_ENCODING,
@@ -1667,7 +1676,8 @@ const COMPONENT_COORDINATION_TYPES = {
1667
1676
  CoordinationType$1.SPATIAL_ROTATION_Y,
1668
1677
  CoordinationType$1.SPATIAL_ROTATION_Z,
1669
1678
  CoordinationType$1.SPATIAL_ROTATION_ORBIT,
1670
- CoordinationType$1.SPATIAL_ORBIT_AXIS
1679
+ CoordinationType$1.SPATIAL_ORBIT_AXIS,
1680
+ CoordinationType$1.PHOTOMETRIC_INTERPRETATION
1671
1681
  ],
1672
1682
  [ViewType$1.LAYER_CONTROLLER_BETA]: [
1673
1683
  CoordinationType$1.META_COORDINATION_SCOPES,
@@ -1722,6 +1732,7 @@ const COMPONENT_COORDINATION_TYPES = {
1722
1732
  CoordinationType$1.FEATURE_VALUE_COLORMAP,
1723
1733
  CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
1724
1734
  CoordinationType$1.FEATURE_SELECTION,
1735
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
1725
1736
  CoordinationType$1.TOOLTIPS_VISIBLE,
1726
1737
  CoordinationType$1.TOOLTIP_CROSSHAIRS_VISIBLE,
1727
1738
  CoordinationType$1.LEGEND_VISIBLE,
@@ -1762,6 +1773,7 @@ const COMPONENT_COORDINATION_TYPES = {
1762
1773
  CoordinationType$1.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
1763
1774
  CoordinationType$1.FEATURE_VALUE_POSITIVITY_THRESHOLD,
1764
1775
  CoordinationType$1.FEATURE_VALUE_COLORMAP,
1776
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
1765
1777
  CoordinationType$1.OBS_SET_SELECTION,
1766
1778
  CoordinationType$1.OBS_SET_FILTER,
1767
1779
  CoordinationType$1.OBS_SET_HIGHLIGHT,
@@ -1790,6 +1802,7 @@ const COMPONENT_COORDINATION_TYPES = {
1790
1802
  CoordinationType$1.FEATURE_SELECTION,
1791
1803
  CoordinationType$1.FEATURE_VALUE_TRANSFORM,
1792
1804
  CoordinationType$1.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
1805
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
1793
1806
  CoordinationType$1.OBS_SET_SELECTION,
1794
1807
  CoordinationType$1.OBS_SET_HIGHLIGHT,
1795
1808
  CoordinationType$1.OBS_HIGHLIGHT,
@@ -1894,6 +1907,7 @@ const COMPONENT_COORDINATION_TYPES = {
1894
1907
  CoordinationType$1.OBS_TYPE,
1895
1908
  CoordinationType$1.SAMPLE_TYPE,
1896
1909
  CoordinationType$1.FEATURE_SELECTION,
1910
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
1897
1911
  CoordinationType$1.SAMPLE_SET_SELECTION,
1898
1912
  CoordinationType$1.SAMPLE_SET_FILTER,
1899
1913
  CoordinationType$1.OBS_SET_SELECTION,
@@ -12420,6 +12434,7 @@ z.object({
12420
12434
  termColumn: z.string().optional(),
12421
12435
  pValueColumn: z.string(),
12422
12436
  pValueAdjusted: z.boolean().optional(),
12437
+ featureSetLibrary: z.string().optional().describe("Optionally, provide a feature set library name. By default, Reactome_2022."),
12423
12438
  analysisType: z.string().optional().describe("Optionally, provide an analysis_type name. By default, pertpy_hypergeometric.")
12424
12439
  });
12425
12440
  z.object({
@@ -12430,7 +12445,6 @@ z.object({
12430
12445
  foldChangeColumn: z.string().describe("The log-fold change is then calculated between this expected sample and the expected sample with no active covariates from the intercept section."),
12431
12446
  foldChangeTransformation: z.enum(["log2"]).optional(),
12432
12447
  isCredibleEffectColumn: z.string().describe("Column which annotates effects as being credible or not (boolean)."),
12433
- covariateColumn: z.string().describe("Column which defines the covariate used in the analysis."),
12434
12448
  analysisType: z.string().optional().describe("Optionally, provide an analysis_type name. By default, sccoda_df.")
12435
12449
  });
12436
12450
  const annDataObsLabels = annDataObs;
@@ -19488,12 +19502,38 @@ function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, exp
19488
19502
  }
19489
19503
  return [null, null];
19490
19504
  }
19491
- function aggregateStratifiedExpressionData(stratifiedResult, geneSelection) {
19505
+ function aggregateStratifiedExpressionData(stratifiedResult, geneSelection, featureAggregationStrategy) {
19492
19506
  const result = new InternMap$1([], JSON.stringify);
19493
19507
  Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
19494
19508
  result.set(cellSetKey, new InternMap$1([], JSON.stringify));
19495
19509
  Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
19496
- const values2 = secondLevelInternMap.get(geneSelection[0]);
19510
+ let values2;
19511
+ if (featureAggregationStrategy === "first") {
19512
+ values2 = secondLevelInternMap.get(geneSelection[0]);
19513
+ } else if (featureAggregationStrategy === "last") {
19514
+ values2 = secondLevelInternMap.get(geneSelection.at(-1));
19515
+ } else if (typeof featureAggregationStrategy === "number") {
19516
+ const i2 = featureAggregationStrategy;
19517
+ if (i2 >= 0 && i2 < geneSelection.length) {
19518
+ values2 = secondLevelInternMap.get(geneSelection[i2]);
19519
+ } else {
19520
+ throw new Error("Feature index used for featureAggregationStrategy is invalid.");
19521
+ }
19522
+ } else if (featureAggregationStrategy === "sum" || featureAggregationStrategy === "mean") {
19523
+ const subarrays = geneSelection.map((geneId) => secondLevelInternMap.get(geneId));
19524
+ values2 = subarrays.reduce((acc, curr) => acc.map((val, idx) => val + curr[idx]));
19525
+ if (featureAggregationStrategy === "mean") {
19526
+ const N2 = geneSelection.length;
19527
+ values2 = values2.map((val) => val / N2);
19528
+ }
19529
+ } else if (featureAggregationStrategy === "difference") {
19530
+ if (geneSelection.length === 2) {
19531
+ const subarrays = geneSelection.map((geneId) => secondLevelInternMap.get(geneId));
19532
+ values2 = subarrays.reduce((acc, curr) => acc.map((val, idx) => val - curr[idx]));
19533
+ } else {
19534
+ throw new Error("Expected exactly two selected features when featureAggregationStrategy is difference.");
19535
+ }
19536
+ }
19497
19537
  result.get(cellSetKey).set(sampleSetKey, values2);
19498
19538
  });
19499
19539
  });
@@ -120439,7 +120479,7 @@ function clipExtent(x02, y02, x12, y12) {
120439
120479
  return clipStream;
120440
120480
  };
120441
120481
  }
120442
- function extent$1() {
120482
+ function extent$2() {
120443
120483
  var x02 = 0, y02 = 0, x12 = 960, y12 = 500, cache2, cacheStream, clip2;
120444
120484
  return clip2 = {
120445
120485
  stream: function(stream2) {
@@ -121846,7 +121886,7 @@ const d3Geo$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
121846
121886
  geoBounds: bounds$1,
121847
121887
  geoCentroid: centroid$4,
121848
121888
  geoCircle: circle$5,
121849
- geoClipExtent: extent$1,
121889
+ geoClipExtent: extent$2,
121850
121890
  geoConicConformal: conicConformal,
121851
121891
  geoConicConformalRaw: conicConformalRaw$1,
121852
121892
  geoConicEqualArea: conicEqualArea,
@@ -145162,8 +145202,15 @@ class SelectionLayer extends CompositeLayer {
145162
145202
  if (!nodePolygonContainsSelectedPolygon && !nodePolygonWithinSelectedPolygon && !nodePolygonOverlapsSelectedPolgyon) {
145163
145203
  return true;
145164
145204
  }
145165
- if (node.data && booleanPointInPolygon$1(point$a([].slice.call(getObsCoords(node.data))), selectedPolygon)) {
145166
- pickingInfos.push(node.data);
145205
+ if (node.data) {
145206
+ let current2 = node;
145207
+ while (current2) {
145208
+ const pointCoords = [].slice.call(getObsCoords(current2.data));
145209
+ if (booleanPointInPolygon$1(point$a(pointCoords), selectedPolygon)) {
145210
+ pickingInfos.push(current2.data);
145211
+ }
145212
+ current2 = current2.next;
145213
+ }
145167
145214
  }
145168
145215
  return false;
145169
145216
  });
@@ -146341,16 +146388,16 @@ function addDecoder(cases2, importFn) {
146341
146388
  }
146342
146389
  cases2.forEach((c2) => registry$1.set(c2, importFn));
146343
146390
  }
146344
- addDecoder([void 0, 1], () => import("./raw-9b8d9daf.js").then((m2) => m2.default));
146345
- addDecoder(5, () => import("./lzw-503cb795.js").then((m2) => m2.default));
146391
+ addDecoder([void 0, 1], () => import("./raw-5d9364f4.js").then((m2) => m2.default));
146392
+ addDecoder(5, () => import("./lzw-fdf7d374.js").then((m2) => m2.default));
146346
146393
  addDecoder(6, () => {
146347
146394
  throw new Error("old style JPEG compression is not supported.");
146348
146395
  });
146349
- addDecoder(7, () => import("./jpeg-81bd1053.js").then((m2) => m2.default));
146350
- addDecoder([8, 32946], () => import("./deflate-ad0dcbe4.js").then((m2) => m2.default));
146351
- addDecoder(32773, () => import("./packbits-40cbad40.js").then((m2) => m2.default));
146352
- addDecoder(34887, () => import("./lerc-b15c3a4c.js").then((m2) => m2.default));
146353
- addDecoder(50001, () => import("./webimage-bbc59b4a.js").then((m2) => m2.default));
146396
+ addDecoder(7, () => import("./jpeg-affe217d.js").then((m2) => m2.default));
146397
+ addDecoder([8, 32946], () => import("./deflate-9e272e07.js").then((m2) => m2.default));
146398
+ addDecoder(32773, () => import("./packbits-530d3977.js").then((m2) => m2.default));
146399
+ addDecoder(34887, () => import("./lerc-eeb05714.js").then((m2) => m2.default));
146400
+ addDecoder(50001, () => import("./webimage-57a383de.js").then((m2) => m2.default));
146354
146401
  function decodeRowAcc(row, stride) {
146355
146402
  let length2 = row.length - stride;
146356
146403
  let offset5 = 0;
@@ -156492,7 +156539,7 @@ function deviation$1(values2, valueof) {
156492
156539
  const v2 = variance$1(values2, valueof);
156493
156540
  return v2 ? Math.sqrt(v2) : v2;
156494
156541
  }
156495
- function d3_extent(values2, valueof) {
156542
+ function extent$1(values2, valueof) {
156496
156543
  let min2;
156497
156544
  let max2;
156498
156545
  if (valueof === void 0) {
@@ -156713,7 +156760,7 @@ function sturges(values2) {
156713
156760
  return Math.ceil(Math.log(count$1(values2)) / Math.LN2) + 1;
156714
156761
  }
156715
156762
  function bin$3() {
156716
- var value2 = identity$c, domain2 = d3_extent, threshold2 = sturges;
156763
+ var value2 = identity$c, domain2 = extent$1, threshold2 = sturges;
156717
156764
  function histogram(data2) {
156718
156765
  if (!Array.isArray(data2))
156719
156766
  data2 = Array.from(data2);
@@ -156724,11 +156771,11 @@ function bin$3() {
156724
156771
  var xz = domain2(values2), x02 = xz[0], x12 = xz[1], tz = threshold2(values2, x02, x12);
156725
156772
  if (!Array.isArray(tz)) {
156726
156773
  const max2 = x12, tn2 = +tz;
156727
- if (domain2 === d3_extent)
156774
+ if (domain2 === extent$1)
156728
156775
  [x02, x12] = nice$3(x02, x12, tn2);
156729
156776
  tz = ticks(x02, x12, tn2);
156730
156777
  if (tz[tz.length - 1] >= x12) {
156731
- if (max2 >= x12 && domain2 === d3_extent) {
156778
+ if (max2 >= x12 && domain2 === extent$1) {
156732
156779
  const step = tickIncrement(x02, x12, tn2);
156733
156780
  if (isFinite(step)) {
156734
156781
  if (step > 0) {
@@ -156873,7 +156920,7 @@ function sum$2(values2, valueof) {
156873
156920
  return sum2;
156874
156921
  }
156875
156922
  function normalize$4(arr) {
156876
- const [min2, max2] = d3_extent(arr);
156923
+ const [min2, max2] = extent$1(arr);
156877
156924
  const ratio = 255 / (max2 - min2);
156878
156925
  const data2 = new Uint8Array(arr.map((i2) => Math.floor((i2 - min2) * ratio)));
156879
156926
  return data2;
@@ -157495,6 +157542,7 @@ class ContourLayerWithText extends ContourLayer {
157495
157542
  }
157496
157543
  ContourLayerWithText.layerName = "ContourLayerWithText";
157497
157544
  ContourLayerWithText.defaultProps = defaultProps;
157545
+ const FEATURE_AGGREGATION_STRATEGIES = ["first", "last", "sum", "mean"];
157498
157546
  function CellSetExpressionPlotOptions(props) {
157499
157547
  const {
157500
157548
  featureValueTransform,
@@ -157505,16 +157553,21 @@ function CellSetExpressionPlotOptions(props) {
157505
157553
  featureValuePositivityThreshold,
157506
157554
  setFeatureValuePositivityThreshold,
157507
157555
  featureValueColormap,
157508
- setFeatureValueColormap
157556
+ setFeatureValueColormap,
157557
+ featureAggregationStrategy,
157558
+ setFeatureAggregationStrategy
157509
157559
  } = props;
157510
157560
  const cellSetExpressionPlotOptionsId = $bdb11010cef70236$export$f680877a34711e37();
157511
157561
  const classes = usePlotOptionsStyles();
157512
157562
  function handleFeatureValueColormapChange(event2) {
157513
157563
  setFeatureValueColormap(event2.target.value);
157514
157564
  }
157515
- const handleTransformChange = (event2) => {
157565
+ function handleTransformChange(event2) {
157516
157566
  setFeatureValueTransform(event2.target.value === "" ? null : event2.target.value);
157517
- };
157567
+ }
157568
+ function handleFeatureAggregationStrategyChange(event2) {
157569
+ setFeatureAggregationStrategy(event2.target.value);
157570
+ }
157518
157571
  function handlePositivityThresholdChange(event2, value2) {
157519
157572
  setFeatureValuePositivityThreshold(value2);
157520
157573
  }
@@ -157589,6 +157642,27 @@ function CellSetExpressionPlotOptions(props) {
157589
157642
  }
157590
157643
  ) })
157591
157644
  ] }),
157645
+ setFeatureAggregationStrategy ? /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow$1, { children: [
157646
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell$1, { className: classes.labelCell, variant: "head", scope: "row", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
157647
+ "label",
157648
+ {
157649
+ htmlFor: `feature-aggregation-strategy-${cellSetExpressionPlotOptionsId}`,
157650
+ children: "Feature Aggregation Strategy"
157651
+ }
157652
+ ) }),
157653
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell$1, { className: classes.inputCell, variant: "body", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
157654
+ OptionSelect,
157655
+ {
157656
+ className: classes.select,
157657
+ value: featureAggregationStrategy ?? "first",
157658
+ onChange: handleFeatureAggregationStrategyChange,
157659
+ inputProps: {
157660
+ id: `feature-aggregation-strategy-${cellSetExpressionPlotOptionsId}`
157661
+ },
157662
+ children: FEATURE_AGGREGATION_STRATEGIES.map((opt) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: opt, children: capitalize$2(opt) }, opt))
157663
+ }
157664
+ ) })
157665
+ ] }) : null,
157592
157666
  setFeatureValuePositivityThreshold ? /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow$1, { children: [
157593
157667
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell$1, { className: classes.labelCell, children: "Positivity Threshold" }),
157594
157668
  /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell$1, { className: classes.inputCell, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -167022,7 +167096,30 @@ function histogramStratifiedExpressionData(summarizedResult, binCount, yMinProp)
167022
167096
  // d3.scaleLinear without a range set
167023
167097
  };
167024
167098
  }
167025
- function useExpressionByCellSet(sampleEdges, sampleSets, sampleSetSelection, expressionData, obsIndex, cellSets, additionalCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient, theme, yMinProp) {
167099
+ const DEFAULT_FEATURE_AGGREGATION_STRATEGY = "first";
167100
+ function featureSummary(geneSelection, featureAggregationStrategy) {
167101
+ if (featureAggregationStrategy === "first") {
167102
+ return geneSelection == null ? void 0 : geneSelection[0];
167103
+ }
167104
+ if (featureAggregationStrategy === "last") {
167105
+ return geneSelection == null ? void 0 : geneSelection.at(-1);
167106
+ }
167107
+ if (typeof featureAggregationStrategy === "number") {
167108
+ const i2 = featureAggregationStrategy;
167109
+ return geneSelection == null ? void 0 : geneSelection[i2];
167110
+ }
167111
+ if (featureAggregationStrategy === "sum") {
167112
+ return geneSelection == null ? void 0 : geneSelection.join(" + ");
167113
+ }
167114
+ if (featureAggregationStrategy === "mean") {
167115
+ return `Mean of ${geneSelection == null ? void 0 : geneSelection.join(", ")}`;
167116
+ }
167117
+ if (featureAggregationStrategy === "difference") {
167118
+ return geneSelection == null ? void 0 : geneSelection.join(" - ");
167119
+ }
167120
+ return "";
167121
+ }
167122
+ function useExpressionByCellSet(sampleEdges, sampleSets, sampleSetSelection, expressionData, obsIndex, cellSets, additionalCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient, theme, yMinProp, featureAggregationStrategy) {
167026
167123
  const mergedCellSets = useMemo(
167027
167124
  () => mergeObsSets(cellSets, additionalCellSets),
167028
167125
  [cellSets, additionalCellSets]
@@ -167044,7 +167141,8 @@ function useExpressionByCellSet(sampleEdges, sampleSets, sampleSetSelection, exp
167044
167141
  if (stratifiedData) {
167045
167142
  const aggregateData = aggregateStratifiedExpressionData(
167046
167143
  stratifiedData,
167047
- geneSelection
167144
+ geneSelection,
167145
+ featureAggregationStrategy
167048
167146
  );
167049
167147
  const summarizedData = summarizeStratifiedExpressionData(
167050
167148
  aggregateData,
@@ -167071,7 +167169,8 @@ function useExpressionByCellSet(sampleEdges, sampleSets, sampleSetSelection, exp
167071
167169
  yMinProp,
167072
167170
  sampleEdges,
167073
167171
  sampleSets,
167074
- sampleSetSelection
167172
+ sampleSetSelection,
167173
+ featureAggregationStrategy
167075
167174
  ]);
167076
167175
  const setArr = useMemo(() => mergedCellSets && cellSetSelection && cellSetColor ? treeToSetSizesBySetNames(
167077
167176
  mergedCellSets,
@@ -167112,11 +167211,13 @@ function CellSetExpressionPlotSubscriber(props) {
167112
167211
  additionalObsSets: additionalCellSets,
167113
167212
  sampleType,
167114
167213
  sampleSetSelection,
167115
- sampleSetColor
167214
+ sampleSetColor,
167215
+ featureAggregationStrategy
167116
167216
  }, {
167117
167217
  setFeatureValueTransform,
167118
167218
  setFeatureValueTransformCoefficient,
167119
- setSampleSetColor
167219
+ setSampleSetColor,
167220
+ setFeatureAggregationStrategy
167120
167221
  }] = useCoordination(
167121
167222
  COMPONENT_COORDINATION_TYPES[ViewType$1.OBS_SET_FEATURE_VALUE_DISTRIBUTION],
167122
167223
  coordinationScopes
@@ -167189,6 +167290,7 @@ function CellSetExpressionPlotSubscriber(props) {
167189
167290
  sampleSetsUrls,
167190
167291
  sampleEdgesUrls
167191
167292
  ]);
167293
+ const featureAggregationStrategyToUse = featureAggregationStrategy ?? DEFAULT_FEATURE_AGGREGATION_STRATEGY;
167192
167294
  const [histogramData, setArr, exprMax] = useExpressionByCellSet(
167193
167295
  sampleEdges,
167194
167296
  sampleSets,
@@ -167203,13 +167305,20 @@ function CellSetExpressionPlotSubscriber(props) {
167203
167305
  featureValueTransform,
167204
167306
  featureValueTransformCoefficient,
167205
167307
  theme,
167206
- yMin
167308
+ yMin,
167309
+ featureAggregationStrategyToUse
167207
167310
  );
167208
- const firstGeneSelected = geneSelection && geneSelection.length >= 1 ? (featureLabelsMap == null ? void 0 : featureLabelsMap.get(geneSelection[0])) || (featureLabelsMap == null ? void 0 : featureLabelsMap.get(cleanFeatureId(geneSelection[0]))) || geneSelection[0] : null;
167311
+ const featureSuffix = useMemo(() => {
167312
+ const cleanedGeneSelection = geneSelection == null ? void 0 : geneSelection.map((geneName) => (featureLabelsMap == null ? void 0 : featureLabelsMap.get(geneName)) || (featureLabelsMap == null ? void 0 : featureLabelsMap.get(cleanFeatureId(geneName))) || geneName);
167313
+ if (Array.isArray(cleanedGeneSelection)) {
167314
+ return featureSummary(cleanedGeneSelection, featureAggregationStrategyToUse);
167315
+ }
167316
+ return null;
167317
+ }, [geneSelection, featureAggregationStrategyToUse]);
167209
167318
  const selectedTransformName = (_a3 = transformOptions.find(
167210
167319
  (o2) => o2.value === featureValueTransform
167211
167320
  )) == null ? void 0 : _a3.name;
167212
- const titleSuffix = firstGeneSelected ? ` (${firstGeneSelected})` : "";
167321
+ const titleSuffix = featureSuffix ? ` (${featureSuffix})` : "";
167213
167322
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
167214
167323
  TitleInfo,
167215
167324
  {
@@ -167228,7 +167337,9 @@ function CellSetExpressionPlotSubscriber(props) {
167228
167337
  setFeatureValueTransform,
167229
167338
  featureValueTransformCoefficient,
167230
167339
  setFeatureValueTransformCoefficient,
167231
- transformOptions
167340
+ transformOptions,
167341
+ featureAggregationStrategy,
167342
+ setFeatureAggregationStrategy
167232
167343
  }
167233
167344
  ),
167234
167345
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: histogramData ? /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -219572,7 +219683,8 @@ function DotPlot(props) {
219572
219683
  featureType,
219573
219684
  featureValueType,
219574
219685
  featureValueTransformName,
219575
- featureValueColormap,
219686
+ // TODO: re-enable featureValueColormap coordination
219687
+ // featureValueColormap,
219576
219688
  obsSetSelection,
219577
219689
  obsSetColor
219578
219690
  } = props;
@@ -219634,7 +219746,8 @@ function DotPlot(props) {
219634
219746
  type: "quantitative",
219635
219747
  title: meanTransform,
219636
219748
  scale: {
219637
- scheme: featureValueColormap
219749
+ // scheme: featureValueColormap,
219750
+ scheme: "greys"
219638
219751
  },
219639
219752
  legend: {
219640
219753
  direction: "horizontal",
@@ -220603,8 +220716,6 @@ function TreemapSubscriber(props) {
220603
220716
  () => mergeObsSets(sampleSets, null),
220604
220717
  [sampleSets]
220605
220718
  );
220606
- const obsCount = (obsIndex == null ? void 0 : obsIndex.length) || 0;
220607
- const sampleCount = (sampleIndex == null ? void 0 : sampleIndex.length) || 0;
220608
220719
  const [obsCounts, sampleCounts] = useMemo(() => {
220609
220720
  var _a3, _b2;
220610
220721
  const obsResult = new InternMap$1([], JSON.stringify);
@@ -220631,7 +220742,7 @@ function TreemapSubscriber(props) {
220631
220742
  const sampleSetSize = (_a4 = sampleSetSizes == null ? void 0 : sampleSetSizes.find((d) => isEqual$2(d.setNamePath, sampleSetKey))) == null ? void 0 : _a4.size;
220632
220743
  sampleResult.set(sampleSetKey, sampleSetSize || 0);
220633
220744
  });
220634
- if (mergedObsSets && obsSetSelection) {
220745
+ if (mergedObsSets && obsSetSelection && obsIndex) {
220635
220746
  const sampleIdToSetMap = sampleSets && sampleSetSelection ? treeToSelectedSetMap(sampleSets, sampleSetSelection) : null;
220636
220747
  const cellIdToSetMap = treeToSelectedSetMap(mergedObsSets, obsSetSelection);
220637
220748
  for (let i2 = 0; i2 < obsIndex.length; i2 += 1) {
@@ -220659,22 +220770,30 @@ function TreemapSubscriber(props) {
220659
220770
  mergedObsSets,
220660
220771
  obsSetSelection,
220661
220772
  mergedSampleSets,
220662
- sampleSetSelection
220773
+ sampleSetSelection,
220774
+ obsIndex
220663
220775
  // TODO: consider filtering-related coordination values
220664
220776
  ]);
220777
+ const totalObsCount = (obsIndex == null ? void 0 : obsIndex.length) || 0;
220778
+ const totalSampleCount = (sampleIndex == null ? void 0 : sampleIndex.length) || 0;
220779
+ const selectedObsCount = obsCounts.reduce((a2, h2) => a2 + h2.value, 0);
220780
+ const selectedSampleCount = sampleCounts.reduce((a2, h2) => a2 + h2.value, 0);
220781
+ const unselectedObsCount = totalObsCount - selectedObsCount;
220782
+ const unselectedSampleCount = totalSampleCount - selectedSampleCount;
220665
220783
  const onNodeClick = useCallback((obsSetPath) => {
220666
220784
  setObsSetSelection([obsSetPath]);
220667
220785
  }, [setObsSetSelection]);
220668
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
220786
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
220669
220787
  TitleInfo,
220670
220788
  {
220671
220789
  title: `Treemap of ${capitalize$2(pluralize(obsType, 2))}`,
220672
- info: `${commaNumber(obsCount)} ${pluralize(obsType, obsCount)} from ${commaNumber(sampleCount)} ${pluralize(sampleType, sampleCount)}`,
220790
+ info: `${commaNumber(selectedObsCount)} ${pluralize(obsType, selectedObsCount)} from ${commaNumber(selectedSampleCount)} ${pluralize(sampleType, selectedSampleCount)}`,
220673
220791
  removeGridComponent,
220674
220792
  urls,
220675
220793
  theme,
220676
220794
  isReady,
220677
220795
  helpText,
220796
+ withPadding: false,
220678
220797
  options: /* @__PURE__ */ jsxRuntimeExports.jsx(
220679
220798
  TreemapOptions,
220680
220799
  {
@@ -220686,25 +220805,28 @@ function TreemapSubscriber(props) {
220686
220805
  setHierarchyLevels
220687
220806
  }
220688
220807
  ),
220689
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
220690
- Treemap,
220691
- {
220692
- obsCounts,
220693
- sampleCounts,
220694
- obsColorEncoding,
220695
- hierarchyLevels: hierarchyLevels || DEFAULT_HIERARCHY_LEVELS,
220696
- theme,
220697
- width: width2,
220698
- height: height2,
220699
- obsType,
220700
- sampleType,
220701
- obsSetColor,
220702
- sampleSetColor,
220703
- obsSetSelection,
220704
- sampleSetSelection,
220705
- onNodeClick
220706
- }
220707
- ) })
220808
+ children: [
220809
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
220810
+ Treemap,
220811
+ {
220812
+ obsCounts,
220813
+ sampleCounts,
220814
+ obsColorEncoding,
220815
+ hierarchyLevels: hierarchyLevels || DEFAULT_HIERARCHY_LEVELS,
220816
+ theme,
220817
+ width: width2,
220818
+ height: Math.max(height2 * (selectedObsCount / totalObsCount), 40),
220819
+ obsType,
220820
+ sampleType,
220821
+ obsSetColor,
220822
+ sampleSetColor,
220823
+ obsSetSelection,
220824
+ sampleSetSelection,
220825
+ onNodeClick
220826
+ }
220827
+ ) }),
220828
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { position: "absolute", right: "2px", bottom: "2px", fontSize: "10px" }, children: unselectedObsCount > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: `${commaNumber(unselectedObsCount)} ${pluralize(obsType, unselectedObsCount)} from ${commaNumber(unselectedSampleCount)} ${pluralize(sampleType, unselectedSampleCount)} currently omitted` }) : null })
220829
+ ]
220708
220830
  }
220709
220831
  );
220710
220832
  }
@@ -220745,13 +220867,13 @@ function VolcanoPlot(props) {
220745
220867
  if (!computedData) {
220746
220868
  return [null, null];
220747
220869
  }
220748
- let xExtentResult = d3_extent(
220749
- computedData.flatMap((d) => d3_extent(d.df.logFoldChange))
220870
+ let xExtentResult = extent$1(
220871
+ computedData.flatMap((d) => extent$1(d.df.logFoldChange))
220750
220872
  );
220751
220873
  const xAbsMax = Math.max(Math.abs(xExtentResult[0]), Math.abs(xExtentResult[1]));
220752
220874
  xExtentResult = [-xAbsMax, xAbsMax];
220753
- const yExtentResult = d3_extent(
220754
- computedData.flatMap((d) => d3_extent(d.df.minusLog10p.filter((v2) => Number.isFinite(v2))))
220875
+ const yExtentResult = extent$1(
220876
+ computedData.flatMap((d) => extent$1(d.df.minusLog10p.filter((v2) => Number.isFinite(v2))))
220755
220877
  );
220756
220878
  return [xExtentResult, yExtentResult];
220757
220879
  }, [computedData]);
@@ -221113,14 +221235,15 @@ function VolcanoPlotSubscriber(props) {
221113
221235
  }
221114
221236
  );
221115
221237
  }
221238
+ const MAX_BAR_SIZE = 40;
221116
221239
  function CellSetCompositionBarPlot(props) {
221117
221240
  const {
221118
221241
  data: data2,
221119
221242
  theme,
221120
221243
  width: width2,
221121
- height: height2,
221244
+ height: heightProp,
221122
221245
  marginRight = 200,
221123
- marginBottom = 120,
221246
+ marginBottom = 60,
221124
221247
  keyLength = 36,
221125
221248
  obsType,
221126
221249
  onBarSelect,
@@ -221131,25 +221254,25 @@ function CellSetCompositionBarPlot(props) {
221131
221254
  obsSetColor,
221132
221255
  sampleSetColor
221133
221256
  } = props;
221257
+ const height2 = Array.isArray(obsSetSelection) && (heightProp - marginBottom) / obsSetSelection.length >= MAX_BAR_SIZE ? MAX_BAR_SIZE * obsSetSelection.length + marginBottom : heightProp;
221134
221258
  const [obsSetColorScale, sampleSetColorScale] = useMemo(() => [
221135
221259
  getColorScale(obsSetSelection, obsSetColor, theme),
221136
221260
  getColorScale(sampleSetSelection, sampleSetColor, theme)
221137
221261
  ], [obsSetSelection, sampleSetSelection, sampleSetColor, obsSetColor, theme]);
221138
221262
  const computedData = useMemo(() => {
221139
- var _a3, _b2, _c, _d, _e2, _f, _g;
221263
+ var _a3, _b2, _c, _d, _e2, _f;
221140
221264
  if (Array.isArray(data2) && data2.length === 1) {
221141
221265
  const { df, metadata: metadata2 } = data2[0];
221142
221266
  const referenceCellType = (_a3 = metadata2 == null ? void 0 : metadata2.analysis_params) == null ? void 0 : _a3.reference_cell_type;
221267
+ const covariateValue = (_b2 = metadata2 == null ? void 0 : metadata2.analysis_params) == null ? void 0 : _b2.covariate_value;
221143
221268
  const coordinationValues = metadata2 == null ? void 0 : metadata2.coordination_values;
221144
- const obsSetColumnName = (_c = (_b2 = coordinationValues == null ? void 0 : coordinationValues.obsSetSelection) == null ? void 0 : _b2[0]) == null ? void 0 : _c[0];
221269
+ const obsSetColumnName = (_d = (_c = coordinationValues == null ? void 0 : coordinationValues.obsSetSelection) == null ? void 0 : _c[0]) == null ? void 0 : _d[0];
221145
221270
  const obsSetGroupName = obsSetsColumnNameMappingReversed == null ? void 0 : obsSetsColumnNameMappingReversed[obsSetColumnName];
221146
- const sampleSetColumnName = (_e2 = (_d = coordinationValues == null ? void 0 : coordinationValues.sampleSetFilter) == null ? void 0 : _d[0]) == null ? void 0 : _e2[0];
221271
+ const sampleSetColumnName = (_f = (_e2 = coordinationValues == null ? void 0 : coordinationValues.sampleSetFilter) == null ? void 0 : _e2[0]) == null ? void 0 : _f[0];
221147
221272
  const sampleSetGroupName = sampleSetsColumnNameMappingReversed == null ? void 0 : sampleSetsColumnNameMappingReversed[sampleSetColumnName];
221148
- const covariatePrefix = `${sampleSetColumnName}T.`;
221149
- const firstCovariateValue = (_g = (_f = df.covariate) == null ? void 0 : _f[0]) == null ? void 0 : _g.substring(covariatePrefix.length);
221150
- const firstCovariateSetPath = [sampleSetGroupName, firstCovariateValue];
221273
+ const covariateSetPath = [sampleSetGroupName, covariateValue];
221151
221274
  let shouldSwapFoldChangeDirection = false;
221152
- if (isEqual$2(firstCovariateSetPath, sampleSetSelection[0])) {
221275
+ if (isEqual$2(covariateSetPath, sampleSetSelection[0])) {
221153
221276
  shouldSwapFoldChangeDirection = true;
221154
221277
  }
221155
221278
  return df.obsSetId.map((obsSetId, i2) => {
@@ -221206,6 +221329,22 @@ function CellSetCompositionBarPlot(props) {
221206
221329
  domain: [true, false],
221207
221330
  range: [2, 0.5]
221208
221331
  };
221332
+ const xExtent = useMemo(() => {
221333
+ if (computedData) {
221334
+ const [min2, max2] = extent$1(computedData.map((d) => d.logFoldChange));
221335
+ const buffer2 = 1.05;
221336
+ const minAbs = Math.abs(min2) * buffer2;
221337
+ const maxAbs = Math.abs(max2) * buffer2;
221338
+ if (minAbs > maxAbs) {
221339
+ return [-minAbs, minAbs];
221340
+ }
221341
+ return [-maxAbs, maxAbs];
221342
+ }
221343
+ return void 0;
221344
+ }, [computedData]);
221345
+ const xScale = {
221346
+ domain: xExtent
221347
+ };
221209
221348
  const spec = {
221210
221349
  mark: { type: "bar", stroke: "black", cursor: "pointer" },
221211
221350
  params: [
@@ -221240,7 +221379,8 @@ function CellSetCompositionBarPlot(props) {
221240
221379
  // TODO: support using intercept+effect here based on user-selected options?
221241
221380
  field: "logFoldChange",
221242
221381
  type: "quantitative",
221243
- title: "Log fold-change"
221382
+ title: "Log fold-change",
221383
+ scale: xScale
221244
221384
  },
221245
221385
  color: {
221246
221386
  field: "key",
@@ -221256,7 +221396,8 @@ function CellSetCompositionBarPlot(props) {
221256
221396
  strokeWidth: {
221257
221397
  field: "isReferenceSet",
221258
221398
  type: "nominal",
221259
- scale: strokeWidthScale
221399
+ scale: strokeWidthScale,
221400
+ legend: null
221260
221401
  },
221261
221402
  tooltip: {
221262
221403
  field: "effectExpectedSample",
@@ -221421,7 +221562,7 @@ function FeatureSetEnrichmentBarPlot(props) {
221421
221562
  theme,
221422
221563
  width: width2,
221423
221564
  height: height2,
221424
- marginRight = 200,
221565
+ marginRight = 300,
221425
221566
  marginBottom = 120,
221426
221567
  keyLength = 36,
221427
221568
  featureType,
@@ -221478,7 +221619,7 @@ function FeatureSetEnrichmentBarPlot(props) {
221478
221619
  }
221479
221620
  return [...a2, h2];
221480
221621
  }, []);
221481
- const MAX_ROWS = 25;
221622
+ const MAX_ROWS = 50;
221482
221623
  result = result.slice(0, MAX_ROWS);
221483
221624
  return result;
221484
221625
  }
@@ -221509,7 +221650,7 @@ function FeatureSetEnrichmentBarPlot(props) {
221509
221650
  select: {
221510
221651
  type: "point",
221511
221652
  on: "click[event.shiftKey === false]",
221512
- fields: ["name"],
221653
+ fields: ["name", "term"],
221513
221654
  empty: "none"
221514
221655
  }
221515
221656
  },
@@ -221518,7 +221659,7 @@ function FeatureSetEnrichmentBarPlot(props) {
221518
221659
  select: {
221519
221660
  type: "point",
221520
221661
  on: "click[event.shiftKey]",
221521
- fields: ["name"],
221662
+ fields: ["name", "term"],
221522
221663
  empty: "none"
221523
221664
  }
221524
221665
  }
@@ -221565,10 +221706,11 @@ function FeatureSetEnrichmentBarPlot(props) {
221565
221706
  config: VEGA_THEMES[theme]
221566
221707
  };
221567
221708
  const handleSignal = (name2, value2) => {
221709
+ var _a3, _b2;
221568
221710
  if (name2 === "bar_select") {
221569
- onBarSelect(value2.obsSetPath);
221711
+ onBarSelect((_a3 = value2.name) == null ? void 0 : _a3[0], (_b2 = value2.term) == null ? void 0 : _b2[0]);
221570
221712
  } else if (name2 === "shift_bar_select") {
221571
- onBarSelect(value2.obsSetPath, true);
221713
+ onBarSelect(value2.name, value2.term, true);
221572
221714
  }
221573
221715
  };
221574
221716
  const signalListeners = { bar_select: handleSignal, shift_bar_select: handleSignal };
@@ -221601,7 +221743,7 @@ function FeatureSetEnrichmentBarPlotSubscriber(props) {
221601
221743
  } = props;
221602
221744
  const classes = useStyles$1();
221603
221745
  const loaders = useLoaders();
221604
- useAsyncFunction(AsyncFunctionType.TRANSFORM_FEATURE);
221746
+ const transformFeature = useAsyncFunction(AsyncFunctionType.TRANSFORM_FEATURE);
221605
221747
  const [{
221606
221748
  dataset,
221607
221749
  obsType,
@@ -221678,6 +221820,11 @@ function FeatureSetEnrichmentBarPlotSubscriber(props) {
221678
221820
  featureSetStatsStatus
221679
221821
  ]);
221680
221822
  const onBarSelect = useCallback(async (featureSetName, featureSetTerm, isShiftDown = false) => {
221823
+ const kgNode = { nodeType: "pathway", term: featureSetTerm };
221824
+ const targetFeatureType = featureType;
221825
+ const targetsInPathway = await transformFeature(kgNode, targetFeatureType);
221826
+ const featureIds = targetsInPathway.filter((d, i2) => i2 < 10).map((d) => d.label);
221827
+ setFeatureSelection(featureIds);
221681
221828
  }, [setFeatureSelection]);
221682
221829
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
221683
221830
  TitleInfo,