@vitessce/comparative 4.1.2 → 4.2.0

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 (55) hide show
  1. package/dist/{GeometryAndMeshXR-CMf0dkQy.js → GeometryAndMeshXR-CYO2tqUV.js} +1 -1
  2. package/dist/ReactNeuroglancer-pk3hhe45.js +68657 -0
  3. package/dist/{XREnterButton-DpxW774d.js → XREnterButton-BdEVWrV7.js} +1 -1
  4. package/dist/{XRSceneComponents-C-VbCXlG.js → XRSceneComponents-DYeS3CwE.js} +1 -1
  5. package/dist/{XRWrapper-CoSbWhS_.js → XRWrapper-DbheKuSQ.js} +2 -2
  6. package/dist/{deflate-SFB4ekzB.js → deflate-D76idIbp.js} +1 -1
  7. package/dist/{higlass-D5qxYkfx.js → higlass-HE5ijNPv.js} +1 -1
  8. package/dist/{index-Dhz9cE6Y.js → index-CSfNzXQa.js} +126748 -124747
  9. package/dist/index-DOITJzp5.js +30089 -0
  10. package/dist/{index-iUzEaM0X.js → index-DeGz6Kci.js} +1 -1
  11. package/dist/{index-CPs7SJQa.js → index-YJLqH5aL.js} +4 -4
  12. package/dist/index.min.js +20 -20
  13. package/dist/{jpeg-X9rWVd_G.js → jpeg-CtV9axAi.js} +1 -1
  14. package/dist/{lerc-C1sD5A4o.js → lerc-C2iyBV3P.js} +1 -1
  15. package/dist/{lzw-8I9_xt6F.js → lzw-BDK3wuTu.js} +1 -1
  16. package/dist/{packbits-C2cIjHBj.js → packbits-BmhmFJpE.js} +1 -1
  17. package/dist/{raw-D7AJ-PIv.js → raw-AV6N1HZT.js} +1 -1
  18. package/dist/{webimage-DmbCXIUf.js → webimage-D8fd9G2X.js} +1 -1
  19. package/dist/{xrStore-CHRZYO3f.js → xrStore-B_SjnbWm.js} +1 -1
  20. package/dist-tsc/BiomarkerSelect.d.ts +19 -1
  21. package/dist-tsc/BiomarkerSelect.d.ts.map +1 -1
  22. package/dist-tsc/BiomarkerSelect.js +46 -39
  23. package/dist-tsc/BiomarkerSelect.js.map +1 -1
  24. package/dist-tsc/ComparativeConfig.d.ts +112 -3
  25. package/dist-tsc/ComparativeConfig.d.ts.map +1 -1
  26. package/dist-tsc/ComparativeConfig.js +255 -13
  27. package/dist-tsc/ComparativeConfig.js.map +1 -1
  28. package/dist-tsc/ComparativeConfig.test.d.ts +2 -0
  29. package/dist-tsc/ComparativeConfig.test.d.ts.map +1 -0
  30. package/dist-tsc/ComparativeConfig.test.js +119 -0
  31. package/dist-tsc/ComparativeConfig.test.js.map +1 -0
  32. package/dist-tsc/ControlledComparative.d.ts +13 -3
  33. package/dist-tsc/ControlledComparative.d.ts.map +1 -1
  34. package/dist-tsc/ControlledComparative.js +32 -14
  35. package/dist-tsc/ControlledComparative.js.map +1 -1
  36. package/dist-tsc/UncontrolledComparative.d.ts.map +1 -1
  37. package/dist-tsc/UncontrolledComparative.js +39 -12
  38. package/dist-tsc/UncontrolledComparative.js.map +1 -1
  39. package/dist-tsc/url-params.d.ts +24 -0
  40. package/dist-tsc/url-params.d.ts.map +1 -0
  41. package/dist-tsc/url-params.js +32 -0
  42. package/dist-tsc/url-params.js.map +1 -0
  43. package/dist-tsc/url-params.test.d.ts +2 -0
  44. package/dist-tsc/url-params.test.d.ts.map +1 -0
  45. package/dist-tsc/url-params.test.js +18 -0
  46. package/dist-tsc/url-params.test.js.map +1 -0
  47. package/package.json +15 -13
  48. package/src/BiomarkerSelect.jsx +70 -45
  49. package/src/ComparativeConfig.jsx +295 -13
  50. package/src/ComparativeConfig.test.jsx +151 -0
  51. package/src/ControlledComparative.jsx +47 -13
  52. package/src/UncontrolledComparative.jsx +62 -16
  53. package/src/url-params.js +34 -0
  54. package/src/url-params.test.js +20 -0
  55. package/dist/ReactNeuroglancer-DzBGJFIe.js +0 -43644
@@ -4,7 +4,7 @@ import { useThree as ve, useFrame as Me, Canvas as Pe } from "@react-three/fiber
4
4
  import { OrbitControls as me } from "@react-three/drei";
5
5
  import * as M from "three";
6
6
  import { Data3DTexture as ge, RedFormat as Ae, UnsignedByteType as Be, LinearFilter as pe, RedIntegerFormat as Ne, UnsignedIntType as Ue, NearestFilter as xe, Vector3 as R, Vector2 as _, Vector4 as j, UniformsUtils as Le } from "three";
7
- import { l as n, i as Oe, c as ue, d as he, C as P, u as K } from "./index-Dhz9cE6Y.js";
7
+ import { l as n, i as Oe, c as ue, d as he, C as P, u as K } from "./index-CSfNzXQa.js";
8
8
  const w = 32, B = 64, Z = 64, fe = 4, ce = B * Z * fe, be = B * w, _e = Z * w, Ce = fe * w, V = {
9
9
  NOT_STARTED: "not_started",
10
10
  IN_PROGRESS: "in_progress",
@@ -6,7 +6,7 @@ import ae, { useRef as Q, useState as X, useEffect as q, Suspense as ee, forward
6
6
  import { Canvas as Ce } from "@react-three/fiber";
7
7
  import { Center as ze, Text as ve, Line as Te, Bvh as we, OrbitControls as Me } from "@react-three/drei";
8
8
  import { Matrix3 as Le, Matrix4 as ie, Vector3 as P, Vector2 as G, UniformsUtils as Pe, Data3DTexture as Ae, RedFormat as De, FloatType as Ie, LinearFilter as ge, FrontSide as _e, Scene as Fe, Group as Ee, MeshPhysicalMaterial as Re, MeshBasicMaterial as Ve, MeshStandardMaterial as Oe, BackSide as ke } from "three";
9
- import { C as j, b as Ue } from "./index-Dhz9cE6Y.js";
9
+ import { C as j, b as Ue } from "./index-CSfNzXQa.js";
10
10
  function Ne({ currentLine: t, scale: e }) {
11
11
  const a = Q(null);
12
12
  return H("group", { children: [_(ze, { bottom: !0, right: !0, position: [t.midPoint.x, t.midPoint.y, t.midPoint.z], rotation: [0, 0, 0], children: _(ve, { color: "gray", scale: 0.05, ref: a, children: `${(t.startPoint.distanceTo(t.endPoint) * e).toFixed(2)} µm` }) }), _(Te, {
@@ -762,7 +762,7 @@ function re(t) {
762
762
  g(c.object.name);
763
763
  }, onPointerOut: () => g(null) }) })] }) : null, i.uniforms && i.shader && i.meshScale && i.geometrySize ? _("group", { children: H("mesh", { scale: i.meshScale, ref: l, children: [_("boxGeometry", { args: i.geometrySize }), _("shaderMaterial", { customProgramCacheKey: () => "1", side: _e, uniforms: i.uniforms, needsUpdate: !0, transparent: !0, vertexShader: i.shader.vertexShader, fragmentShader: i.shader.fragmentShader })] }) }) : null] }), _("group", { name: "lines", children: m.map((c) => _(Ne, { currentLine: c, scale: 1 }, tt(c))) })] });
764
764
  }
765
- const at = ae.lazy(() => import("./GeometryAndMeshXR-CMf0dkQy.js").catch(() => ({ default: re }))), lt = ae.lazy(() => import("./XRSceneComponents-C-VbCXlG.js").catch(() => ({ default: () => null })));
765
+ const at = ae.lazy(() => import("./GeometryAndMeshXR-CYO2tqUV.js").catch(() => ({ default: re }))), lt = ae.lazy(() => import("./XRSceneComponents-DYeS3CwE.js").catch(() => ({ default: () => null })));
766
766
  function oe(t) {
767
767
  const e = Q(null), a = Q(null), [o, i] = X(!1), [l, n] = X(!1), [g, p] = X(null), [m, c] = X([1, 1, 1]), [s, w] = X({
768
768
  uniforms: null,
@@ -976,12 +976,12 @@ function pt() {
976
976
  }
977
977
  const it = ae.lazy(
978
978
  // eslint-disable-next-line implicit-arrow-linebreak, function-paren-newline
979
- () => import("./XRWrapper-CoSbWhS_.js").catch(() => ({
979
+ () => import("./XRWrapper-DbheKuSQ.js").catch(() => ({
980
980
  default: ({ children: t }) => t
981
981
  }))
982
982
  ), ot = ae.lazy(
983
983
  // eslint-disable-next-line implicit-arrow-linebreak, function-paren-newline
984
- () => import("./XREnterButton-DpxW774d.js").catch(() => ({
984
+ () => import("./XREnterButton-BdEVWrV7.js").catch(() => ({
985
985
  default: () => null
986
986
  }))
987
987
  ), rt = Se((t, e) => {
package/dist/index.min.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aQ as e, ah as s, ac as t, aa as r, ab as l, al as d, am as C, ad as p, ay as c, aw as g, au as u, ax as y, av as T, aR as m, a9 as A, at as S, ae as P, aB as f, a8 as F, aG as I, aF as N, a7 as V, as as w, aj as E, ap as v, ai as _, ak as h, ao as x, an as M, aA as O, aD as U, ag as G, aE as H, aq as L, ar as b, aC as z, aK as B, aN as D, aH as J, aO as R, aP as Y, aI as j, aL as k, aM as q, aJ as K, af as Q, az as W } from "./index-Dhz9cE6Y.js";
1
+ import { aa as e, w as s, p as t, D as r, F as l, H as d, A as C, q as p, T as c, R as g, P as u, S as y, Q as T, ab as S, V as A, O as m, r as P, X as f, o as F, a0 as I, $ as N, n as V, N as w, y as E, J as _, x as v, z as U, I as x, E as M, W as O, Z as h, s as H, _ as b, K as z, M as G, Y as L, a4 as Y, a7 as D, a1 as J, a8 as R, a9 as q, a2 as B, a5 as K, a6 as Q, a3 as W, v as X, U as Z } from "./index-CSfNzXQa.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  export {
@@ -15,9 +15,9 @@ export {
15
15
  u as PluginFileType,
16
16
  y as PluginJointFileType,
17
17
  T as PluginViewType,
18
- m as UncontrolledComparative,
18
+ S as UncontrolledComparative,
19
19
  A as ViewType,
20
- S as Vitessce,
20
+ m as Vitessce,
21
21
  P as VitessceConfig,
22
22
  f as addAnnotationControllerView,
23
23
  F as decodeURLParamsToConf,
@@ -26,27 +26,27 @@ export {
26
26
  V as encodeConfInUrl,
27
27
  w as fetchConfigFromGist,
28
28
  E as generateConfig,
29
- v as generateConfigAlt,
30
- _ as getCoordinationSpaceAndScopes,
31
- h as getHintOptions,
29
+ _ as generateConfigAlt,
30
+ v as getCoordinationSpaceAndScopes,
31
+ U as getHintOptions,
32
32
  x as getInitialCoordinationScopeName,
33
33
  M as getInitialCoordinationScopePrefix,
34
34
  O as hasAnnotationControllerView,
35
- U as hasAnyAnnotationStory,
36
- G as hconcat,
37
- H as isAnyAnnotationEditing,
38
- L as parseUrls,
39
- b as parseUrlsFromString,
40
- z as removeAnnotationControllerView,
41
- B as useComplexCoordination,
35
+ h as hasAnyAnnotationStory,
36
+ H as hconcat,
37
+ b as isAnyAnnotationEditing,
38
+ z as parseUrls,
39
+ G as parseUrlsFromString,
40
+ L as removeAnnotationControllerView,
41
+ Y as useComplexCoordination,
42
42
  D as useComplexCoordinationSecondary,
43
43
  J as useCoordination,
44
44
  R as useCoordinationScopes,
45
- Y as useCoordinationScopesBy,
46
- j as useGridItemSize,
47
- k as useMultiCoordinationScopesNonNull,
48
- q as useMultiCoordinationScopesSecondaryNonNull,
49
- K as usePageModeView,
50
- Q as vconcat,
51
- W as z
45
+ q as useCoordinationScopesBy,
46
+ B as useGridItemSize,
47
+ K as useMultiCoordinationScopesNonNull,
48
+ Q as useMultiCoordinationScopesSecondaryNonNull,
49
+ W as usePageModeView,
50
+ X as vconcat,
51
+ Z as z
52
52
  };
@@ -1,4 +1,4 @@
1
- import { B as re } from "./index-Dhz9cE6Y.js";
1
+ import { B as re } from "./index-CSfNzXQa.js";
2
2
  const O = new Int32Array([
3
3
  0,
4
4
  1,
@@ -1,5 +1,5 @@
1
1
  import { i as sA } from "./pako.esm-D68R8YXe.js";
2
- import { g as DA, B as nA, L as fA, a as gA } from "./index-Dhz9cE6Y.js";
2
+ import { g as DA, B as nA, L as fA, a as gA } from "./index-CSfNzXQa.js";
3
3
  var BA = { exports: {} }, iA;
4
4
  function tA() {
5
5
  return iA || (iA = 1, function(j) {
@@ -1,4 +1,4 @@
1
- import { B as b } from "./index-Dhz9cE6Y.js";
1
+ import { B as b } from "./index-CSfNzXQa.js";
2
2
  const B = 9, E = 256, p = 257, k = 12;
3
3
  function x(c, o, r) {
4
4
  const i = o % 8, n = Math.floor(o / 8), h = 8 - i, g = o + r - (n + 1) * 8;
@@ -1,4 +1,4 @@
1
- import { B as c } from "./index-Dhz9cE6Y.js";
1
+ import { B as c } from "./index-CSfNzXQa.js";
2
2
  class l extends c {
3
3
  decodeBlock(s) {
4
4
  const n = new DataView(s), r = [];
@@ -1,4 +1,4 @@
1
- import { B as o } from "./index-Dhz9cE6Y.js";
1
+ import { B as o } from "./index-CSfNzXQa.js";
2
2
  class d extends o {
3
3
  decodeBlock(e) {
4
4
  return e;
@@ -1,4 +1,4 @@
1
- import { B as r } from "./index-Dhz9cE6Y.js";
1
+ import { B as r } from "./index-CSfNzXQa.js";
2
2
  class s extends r {
3
3
  constructor() {
4
4
  if (super(), typeof createImageBitmap > "u")
@@ -1,4 +1,4 @@
1
- import { g as t } from "./index-CPs7SJQa.js";
1
+ import { g as t } from "./index-YJLqH5aL.js";
2
2
  let e = null;
3
3
  function o() {
4
4
  return e || (e = t().createXRStore({
@@ -1,2 +1,20 @@
1
- export function BiomarkerSelect(props: any): any;
1
+ /**
2
+ * Renders the biomarkerSelectAlt view, synchronizing
3
+ * biomarker selection, gene selection, sample set selection, and modality selection
4
+ * state with its parent.
5
+ * See the ControlledComparative component for documentation of the props.
6
+ * @param {object} props
7
+ * @param {{ label: string, nodeType: string } | null} [props.biomarkerSelection]
8
+ * The selected modality-agnostic item (e.g., gene or pathway),
9
+ * which is transformed into a list of genes (geneSelection) internally.
10
+ * @param {Function} [props.setBiomarkerSelection] Setter function
11
+ * called when the biomarker selection has been updated from inside.
12
+ */
13
+ export function BiomarkerSelect(props: {
14
+ biomarkerSelection?: {
15
+ label: string;
16
+ nodeType: string;
17
+ } | null | undefined;
18
+ setBiomarkerSelection?: Function | undefined;
19
+ }): any;
2
20
  //# sourceMappingURL=BiomarkerSelect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BiomarkerSelect.d.ts","sourceRoot":"","sources":["../src/BiomarkerSelect.jsx"],"names":[],"mappings":"AAOA,iDAmGC"}
1
+ {"version":3,"file":"BiomarkerSelect.d.ts","sourceRoot":"","sources":["../src/BiomarkerSelect.jsx"],"names":[],"mappings":"AAcA;;;;;;;;;;;GAWG;AACH,uCANG;IAA2D,kBAAkB;eAA5D,MAAM;kBAAY,MAAM;;IAGhB,qBAAqB;CAEhD,OA0GA"}
@@ -4,40 +4,36 @@ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import React, { useMemo, useState, useCallback } from 'react';
5
5
  import { Vitessce } from '@vitessce/all';
6
6
  import { isEqual } from 'lodash-es';
7
- import { BiomarkerSelectPageComponent, generateComparativeConfig } from './ComparativeConfig.jsx';
7
+ import { BiomarkerSelectPageComponent, generateComparativeConfig, getSelectedModality, getBiomarkerSelection, resolveSelectedModality, mergeBiomarkerSelectConfig, } from './ComparativeConfig.jsx';
8
+ /**
9
+ * Renders the biomarkerSelectAlt view, synchronizing
10
+ * biomarker selection, gene selection, sample set selection, and modality selection
11
+ * state with its parent.
12
+ * See the ControlledComparative component for documentation of the props.
13
+ * @param {object} props
14
+ * @param {{ label: string, nodeType: string } | null} [props.biomarkerSelection]
15
+ * The selected modality-agnostic item (e.g., gene or pathway),
16
+ * which is transformed into a list of genes (geneSelection) internally.
17
+ * @param {Function} [props.setBiomarkerSelection] Setter function
18
+ * called when the biomarker selection has been updated from inside.
19
+ */
8
20
  export function BiomarkerSelect(props) {
9
- const { datasetUrl = 'https://data-2.vitessce.io/kpmp-atlas-v2/sc-rna-seq/processed/kpmp-aug-2026.adata.zarr', geneSelection, sampleSetSelection, setGeneSelection, setSampleSetSelection, theme = 'light2', debugMode = false, logLevel = undefined, } = props;
10
- const initialConfig = useMemo(() => generateComparativeConfig(datasetUrl, true), [datasetUrl]);
21
+ const { singleCellDatasetUrl, singleNucleusDatasetUrl, selectedModality: selectedModalityProp, setSelectedModality, biomarkerSelection, setBiomarkerSelection, geneSelection, sampleSetSelection, setGeneSelection, setSampleSetSelection, theme = 'light2', debugMode = false, logLevel = undefined, } = props;
22
+ const initialConfig = useMemo(() => generateComparativeConfig({ singleCellDatasetUrl, singleNucleusDatasetUrl }, true), [singleCellDatasetUrl, singleNucleusDatasetUrl]);
23
+ // Fall back to the first available modality if the selected one is not available.
24
+ const selectedModality = useMemo(() => resolveSelectedModality(initialConfig.datasets.map(d => d.uid), selectedModalityProp), [initialConfig, selectedModalityProp]);
11
25
  const [currentConfig, setCurrentConfig] = useState(null);
12
- // Merge currentConfig with geneSelection and sampleSetSelection,
13
- // which may have been updated from outside Vitessce (e.g., from URL params).
14
- const mergedConfig = useMemo(() => {
15
- if (!currentConfig) {
16
- return initialConfig;
17
- }
18
- // Merge currentConfig with geneSelection and sampleSetSelection.
19
- const isValidGeneSelection = Array.isArray(geneSelection) && geneSelection.every(g => typeof g === 'string');
20
- const isValidSampleSetSelection = Array.isArray(sampleSetSelection) && sampleSetSelection.every(s => Array.isArray(s) && s.every(t => typeof t === 'string'));
21
- const newConfig = {
22
- ...currentConfig,
23
- coordinationSpace: {
24
- ...currentConfig.coordinationSpace,
25
- featureSelection: {
26
- ...currentConfig.coordinationSpace?.featureSelection,
27
- __comparison__: (isValidGeneSelection
28
- ? geneSelection
29
- : currentConfig.coordinationSpace?.featureSelection?.__comparison__),
30
- },
31
- sampleSetSelection: {
32
- ...currentConfig.coordinationSpace?.sampleSetSelection,
33
- __comparison__: (isValidSampleSetSelection
34
- ? sampleSetSelection
35
- : currentConfig.coordinationSpace?.sampleSetSelection?.__comparison__),
36
- },
37
- },
38
- };
39
- return newConfig;
40
- }, [initialConfig, currentConfig, geneSelection, sampleSetSelection]);
26
+ // Merge currentConfig with the selections that may have been
27
+ // updated from outside Vitessce (e.g., from URL params or ControlledComparative).
28
+ const mergedConfig = useMemo(() => mergeBiomarkerSelectConfig({
29
+ currentConfig,
30
+ initialConfig,
31
+ geneSelection,
32
+ sampleSetSelection,
33
+ biomarkerSelection,
34
+ selectedModality,
35
+ createUid: () => `biomarker-select-${Date.now()}`,
36
+ }), [initialConfig, currentConfig, biomarkerSelection, geneSelection, sampleSetSelection, selectedModality]);
41
37
  const onConfigChange = useCallback((newConfig) => {
42
38
  // Listen for changes to the config from inside vITESSCE
43
39
  setCurrentConfig(newConfig);
@@ -45,13 +41,12 @@ export function BiomarkerSelect(props) {
45
41
  const newFeatureSelection = newConfig.coordinationSpace?.featureSelection?.__comparison__;
46
42
  const newSampleSetSelection = newConfig.coordinationSpace?.sampleSetSelection?.__comparison__;
47
43
  // Was there a new selection made from inside Vitessce?
48
- // Note: this will prevent from CLEARING the selections from inside Vitessce
49
- // (any clearing will need to be done from the BiomarkerSelect UI).
50
- const hasNewGeneSelection = (Array.isArray(newFeatureSelection)
51
- && newFeatureSelection.length > 0
44
+ // Note: unlike in ControlledComparative, here we allow CLEARING the selections
45
+ // (i.e., null or empty array values), since this is the UI from which
46
+ // selections are cleared (e.g., selecting "All" in the "In group" dropdown).
47
+ const hasNewGeneSelection = (newFeatureSelection !== undefined
52
48
  && !isEqual(newFeatureSelection, geneSelection));
53
- const hasNewSampleSetSelection = (Array.isArray(newSampleSetSelection)
54
- && newSampleSetSelection.length > 0
49
+ const hasNewSampleSetSelection = (newSampleSetSelection !== undefined
55
50
  && !isEqual(newSampleSetSelection, sampleSetSelection));
56
51
  if (hasNewGeneSelection) {
57
52
  setGeneSelection(newFeatureSelection);
@@ -59,7 +54,19 @@ export function BiomarkerSelect(props) {
59
54
  if (hasNewSampleSetSelection) {
60
55
  setSampleSetSelection(newSampleSetSelection);
61
56
  }
62
- }, [geneSelection, sampleSetSelection]);
57
+ // Was a different biomarker (e.g., gene or pathway) selected from inside Vitessce?
58
+ const newBiomarkerSelection = getBiomarkerSelection(newConfig);
59
+ if (newBiomarkerSelection !== undefined
60
+ && !isEqual(newBiomarkerSelection, biomarkerSelection)) {
61
+ setBiomarkerSelection?.(newBiomarkerSelection);
62
+ }
63
+ // Was a different modality (i.e., dataset) selected from inside Vitessce?
64
+ const newModality = getSelectedModality(newConfig);
65
+ if (typeof newModality === 'string' && newModality !== selectedModality) {
66
+ setSelectedModality?.(newModality);
67
+ }
68
+ }, [biomarkerSelection, geneSelection, sampleSetSelection, selectedModality,
69
+ setBiomarkerSelection, setGeneSelection, setSampleSetSelection, setSelectedModality]);
63
70
  const didFirstValidation = currentConfig !== null;
64
71
  return (_jsx("div", { children: _jsx(Vitessce, { config: mergedConfig, onConfigChange: onConfigChange, remountOnUidChange: false, validateConfig: !didFirstValidation, validateOnConfigChange: false, rowHeight: null, theme: theme, pageMode: true, debugMode: debugMode, logLevel: logLevel, children: _jsx(BiomarkerSelectPageCompon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;QACrC,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB;QACzE,qBAAqB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAExF,MAAM,kBAAkB,GAAG,aAAa,KAAK,IAAI,CAAC;IAElD,OAAO,CACL,wBACE,KAAC,QAAQ,IACP,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,KAAK,EACzB,cAAc,EAAE,CAAC,kBAAkB,EACnC,sBAAsB,EAAE,KAAK,EAC7B,SAAS,EAAE,IAAI,EACf,KAAK,EAAE,KAAK,EACZ,QAAQ,QACR,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,YAElB,KAAC,4BAA4B,KAAG,GACvB,GACP,CACP,CAAC;AACJ,CAAC"}
@@ -1,12 +1,121 @@
1
+ /**
2
+ * Get the list of modalities for which a dataset URL was provided.
3
+ * @param {object} datasetUrls
4
+ * @param {string|undefined} datasetUrls.singleCellDatasetUrl
5
+ * @param {string|undefined} datasetUrls.singleNucleusDatasetUrl
6
+ * @returns {{ uid: string, name: string, url: string, circleScaleFactor: number }[]}
7
+ */
8
+ export function getAvailableModalities(datasetUrls: {
9
+ singleCellDatasetUrl: string | undefined;
10
+ singleNucleusDatasetUrl: string | undefined;
11
+ }): {
12
+ uid: string;
13
+ name: string;
14
+ url: string;
15
+ circleScaleFactor: number;
16
+ }[];
17
+ /**
18
+ * Resolve the modality to view, falling back to the first available modality
19
+ * if the requested one is not available.
20
+ * @param {string[]} availableModalityUids
21
+ * @param {string|null|undefined} requestedModality
22
+ * @returns {string|undefined}
23
+ */
24
+ export function resolveSelectedModality(availableModalityUids: string[], requestedModality: string | null | undefined): string | undefined;
25
+ /**
26
+ * Get the currently-selected modality (dataset uid) from a view config.
27
+ * @param {object|null} config
28
+ * @returns {string|undefined}
29
+ */
30
+ export function getSelectedModality(config: object | null): string | undefined;
31
+ /**
32
+ * Return a new view config in which the given modality is selected.
33
+ * Upon a change of modality, all obsSetSelection values are reset to null,
34
+ * so that the selected cell types become re-initialized
35
+ * (since the new modality may contain different cell type categories).
36
+ * @param {object} config A view config generated by generateComparativeConfig.
37
+ * @param {string} modality The modality (dataset uid) to select.
38
+ * @returns {object} The updated view config (or the original
39
+ * config if the modality is not present in the config
40
+ * or is already selected).
41
+ */
42
+ export function withSelectedModality(config: object, modality: string): object;
43
+ /**
44
+ * Get the biomarkerSelection value from the props of the biomarkerSelectAlt view.
45
+ * @param {object|null} config
46
+ * @returns {{ label: string, nodeType: string } | null | undefined}
47
+ */
48
+ export function getBiomarkerSelection(config: object | null): {
49
+ label: string;
50
+ nodeType: string;
51
+ } | null | undefined;
52
+ /**
53
+ * Return a new view config in which the biomarkerSelectAlt view
54
+ * has the given biomarkerSelection prop value.
55
+ * @param {object} config A view config generated by generateComparativeConfig.
56
+ * @param {{ label: string, nodeType: string } | null} biomarkerSelection
57
+ * @returns {object} The updated view config (or the original config if unchanged).
58
+ */
59
+ export function withBiomarkerSelection(config: object, biomarkerSelection: {
60
+ label: string;
61
+ nodeType: string;
62
+ } | null): object;
63
+ /**
64
+ * Merge the selections from outside Vitessce (e.g., from URL params)
65
+ * into the view config for the biomarkerSelectAlt view.
66
+ * @param {object} params
67
+ * @param {object|null} params.currentConfig The most recent config emitted via onConfigChange
68
+ * (or null prior to the first onConfigChange).
69
+ * @param {object} params.initialConfig The generated initial config.
70
+ * @param {string[]|null} params.geneSelection
71
+ * @param {string[][]|null} params.sampleSetSelection
72
+ * @param {{ label: string, nodeType: string } | null} params.biomarkerSelection
73
+ * @param {string} params.selectedModality
74
+ * @param {() => string} params.createUid Function that returns a new unique config uid.
75
+ * @returns {object} The merged config. Returns currentConfig itself
76
+ * if it already reflects all of the outside selections.
77
+ */
78
+ export function mergeBiomarkerSelectConfig({ currentConfig, initialConfig, geneSelection, sampleSetSelection, biomarkerSelection, selectedModality, createUid, }: {
79
+ currentConfig: object | null;
80
+ initialConfig: object;
81
+ geneSelection: string[] | null;
82
+ sampleSetSelection: string[][] | null;
83
+ biomarkerSelection: {
84
+ label: string;
85
+ nodeType: string;
86
+ } | null;
87
+ selectedModality: string;
88
+ createUid: () => string;
89
+ }): object;
1
90
  /**
2
91
  * Generate a Vitessce config for comparative visualization.
92
+ * One dataset is defined per data modality (single-cell and/or single-nucleus),
93
+ * and all views are linked to a shared `dataset` coordination scope
94
+ * so that the currently-viewed modality can be switched.
3
95
  * If isBiomarkerSelectOnly is true, only the biomarkerSelect view is included.
4
96
  * Otherwise, a config without the biomarkerSelect view is generated.
5
- * @param {string} baseUrl
97
+ * @param {object} datasetUrls
98
+ * @param {string|undefined} datasetUrls.singleCellDatasetUrl URL to the
99
+ * single-cell AnnData-Zarr store.
100
+ * @param {string|undefined} datasetUrls.singleNucleusDatasetUrl URL to the
101
+ * single-nucleus AnnData-Zarr store.
6
102
  * @param {boolean} isBiomarkerSelectOnly
7
- * @returns
103
+ * @param {string|undefined} selectedModality The modality to view initially.
104
+ * By default, the first available modality.
105
+ * @returns {object} The view config JSON.
8
106
  */
9
- export function generateComparativeConfig(baseUrl: string, isBiomarkerSelectOnly: boolean): object;
107
+ export function generateComparativeConfig(datasetUrls: {
108
+ singleCellDatasetUrl: string | undefined;
109
+ singleNucleusDatasetUrl: string | undefined;
110
+ }, isBiomarkerSelectOnly: boolean, selectedModality?: string | undefined): object;
10
111
  export function BiomarkerSelectPageComponent(): any;
11
112
  export function ComparativePageComponent(): any;
113
+ export const COMPARATIVE_DATASET_SCOPE: "__comparison__";
114
+ export const BIOMARKER_SELECT_VIEW_UID: "biomarker-select";
115
+ export const COMPARATIVE_MODALITIES: {
116
+ uid: string;
117
+ name: string;
118
+ urlKey: string;
119
+ circleScaleFactor: number;
120
+ }[];
12
121
  //# sourceMappingURL=ComparativeConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComparativeConfig.d.ts","sourceRoot":"","sources":["../src/ComparativeConfig.jsx"],"names":[],"mappings":"AAiBA;;;;;;;GAOG;AACH,mDAJW,MAAM,yBACN,OAAO,UA0SjB;AAED,oDAkDC;AAED,gDAmQC"}
1
+ {"version":3,"file":"ComparativeConfig.d.ts","sourceRoot":"","sources":["../src/ComparativeConfig.jsx"],"names":[],"mappings":"AA6CA;;;;;;GAMG;AACH,oDAJG;IAAsC,oBAAoB,EAAlD,MAAM,GAAC,SAAS;IACc,uBAAuB,EAArD,MAAM,GAAC,SAAS;CACxB,GAAU;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,EAAE,CAMnF;AAED;;;;;;GAMG;AACH,+DAJW,MAAM,EAAE,qBACR,MAAM,GAAC,IAAI,GAAC,SAAS,GACnB,MAAM,GAAC,SAAS,CAO5B;AAED;;;;GAIG;AACH,4CAHW,MAAM,GAAC,IAAI,GACT,MAAM,GAAC,SAAS,CAI5B;AAED;;;;;;;;;;GAUG;AACH,6CANW,MAAM,YACN,MAAM,GACJ,MAAM,CA+BlB;AAED;;;;GAIG;AACH,8CAHW,MAAM,GAAC,IAAI,GACT;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,CAIlE;AAED;;;;;;GAMG;AACH,+CAJW,MAAM,sBACN;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GACxC,MAAM,CAclB;AAiCD;;;;;;;;;;;;;;GAcG;AACH,kKAXG;IAA4B,aAAa,EAAjC,MAAM,GAAC,IAAI;IAEI,aAAa,EAA5B,MAAM;IACgB,aAAa,EAAnC,MAAM,EAAE,GAAC,IAAI;IACW,kBAAkB,EAA1C,MAAM,EAAE,EAAE,GAAC,IAAI;IACoC,kBAAkB,EAArE;QAAE,KAAK,EA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