@vitessce/scatterplot-embedding 3.5.4 → 3.5.6

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.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { B as BaseDecoder } from "./index-e8cfd624.js";
2
+ import { B as BaseDecoder } from "./index-59d93bea.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -11018,7 +11018,8 @@ const ViewType$1 = {
11018
11018
  DOT_PLOT: "dotPlot",
11019
11019
  FEATURE_BAR_PLOT: "featureBarPlot",
11020
11020
  BIOMARKER_SELECT: "biomarkerSelect",
11021
- LINK_CONTROLLER: "linkController"
11021
+ LINK_CONTROLLER: "linkController",
11022
+ DUAL_SCATTERPLOT: "dualScatterplot"
11022
11023
  };
11023
11024
  const DataType$2 = {
11024
11025
  OBS_LABELS: "obsLabels",
@@ -11197,15 +11198,23 @@ const CoordinationType$1 = {
11197
11198
  HEATMAP_ZOOM_Y: "heatmapZoomY",
11198
11199
  HEATMAP_TARGET_X: "heatmapTargetX",
11199
11200
  HEATMAP_TARGET_Y: "heatmapTargetY",
11200
- OBS_FILTER: "obsFilter",
11201
11201
  OBS_HIGHLIGHT: "obsHighlight",
11202
+ OBS_SELECTION: "obsSelection",
11202
11203
  OBS_SET_SELECTION: "obsSetSelection",
11204
+ OBS_SELECTION_MODE: "obsSelectionMode",
11205
+ OBS_FILTER: "obsFilter",
11206
+ OBS_SET_FILTER: "obsSetFilter",
11207
+ OBS_FILTER_MODE: "obsFilterMode",
11203
11208
  OBS_SET_HIGHLIGHT: "obsSetHighlight",
11204
11209
  OBS_SET_EXPANSION: "obsSetExpansion",
11205
11210
  OBS_SET_COLOR: "obsSetColor",
11206
- FEATURE_FILTER: "featureFilter",
11207
11211
  FEATURE_HIGHLIGHT: "featureHighlight",
11208
11212
  FEATURE_SELECTION: "featureSelection",
11213
+ FEATURE_SET_SELECTION: "featureSetSelection",
11214
+ FEATURE_SELECTION_MODE: "featureSelectionMode",
11215
+ FEATURE_FILTER: "featureFilter",
11216
+ FEATURE_SET_FILTER: "featureSetFilter",
11217
+ FEATURE_FILTER_MODE: "featureFilterMode",
11209
11218
  FEATURE_VALUE_COLORMAP: "featureValueColormap",
11210
11219
  FEATURE_VALUE_TRANSFORM: "featureValueTransform",
11211
11220
  FEATURE_VALUE_COLORMAP_RANGE: "featureValueColormapRange",
@@ -11272,7 +11281,12 @@ const CoordinationType$1 = {
11272
11281
  SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize",
11273
11282
  // Multi-sample / comparative
11274
11283
  SAMPLE_TYPE: "sampleType",
11284
+ SAMPLE_SELECTION: "sampleSelection",
11275
11285
  SAMPLE_SET_SELECTION: "sampleSetSelection",
11286
+ SAMPLE_SELECTION_MODE: "sampleSelectionMode",
11287
+ SAMPLE_FILTER: "sampleFilter",
11288
+ SAMPLE_SET_FILTER: "sampleSetFilter",
11289
+ SAMPLE_FILTER_MODE: "sampleFilterMode",
11276
11290
  SAMPLE_SET_COLOR: "sampleSetColor",
11277
11291
  EMBEDDING_POINTS_VISIBLE: "embeddingPointsVisible",
11278
11292
  EMBEDDING_CONTOURS_VISIBLE: "embeddingContoursVisible",
@@ -11321,6 +11335,7 @@ const COMPONENT_COORDINATION_TYPES = {
11321
11335
  CoordinationType$1.OBS_FILTER,
11322
11336
  CoordinationType$1.OBS_HIGHLIGHT,
11323
11337
  CoordinationType$1.OBS_SET_SELECTION,
11338
+ CoordinationType$1.OBS_SET_FILTER,
11324
11339
  CoordinationType$1.OBS_SET_HIGHLIGHT,
11325
11340
  CoordinationType$1.OBS_SET_COLOR,
11326
11341
  CoordinationType$1.FEATURE_HIGHLIGHT,
@@ -11332,6 +11347,50 @@ const COMPONENT_COORDINATION_TYPES = {
11332
11347
  CoordinationType$1.TOOLTIPS_VISIBLE,
11333
11348
  CoordinationType$1.SAMPLE_TYPE,
11334
11349
  CoordinationType$1.SAMPLE_SET_SELECTION,
11350
+ CoordinationType$1.SAMPLE_SET_FILTER,
11351
+ CoordinationType$1.SAMPLE_SET_COLOR,
11352
+ CoordinationType$1.EMBEDDING_POINTS_VISIBLE,
11353
+ CoordinationType$1.EMBEDDING_CONTOURS_VISIBLE,
11354
+ CoordinationType$1.EMBEDDING_CONTOURS_FILLED,
11355
+ CoordinationType$1.EMBEDDING_CONTOUR_PERCENTILES,
11356
+ CoordinationType$1.CONTOUR_COLOR_ENCODING,
11357
+ CoordinationType$1.CONTOUR_COLOR
11358
+ ],
11359
+ [ViewType$1.DUAL_SCATTERPLOT]: [
11360
+ CoordinationType$1.DATASET,
11361
+ CoordinationType$1.OBS_TYPE,
11362
+ CoordinationType$1.FEATURE_TYPE,
11363
+ CoordinationType$1.FEATURE_VALUE_TYPE,
11364
+ CoordinationType$1.OBS_LABELS_TYPE,
11365
+ CoordinationType$1.EMBEDDING_TYPE,
11366
+ CoordinationType$1.EMBEDDING_ZOOM,
11367
+ CoordinationType$1.EMBEDDING_ROTATION,
11368
+ CoordinationType$1.EMBEDDING_TARGET_X,
11369
+ CoordinationType$1.EMBEDDING_TARGET_Y,
11370
+ CoordinationType$1.EMBEDDING_TARGET_Z,
11371
+ CoordinationType$1.EMBEDDING_OBS_SET_POLYGONS_VISIBLE,
11372
+ CoordinationType$1.EMBEDDING_OBS_SET_LABELS_VISIBLE,
11373
+ CoordinationType$1.EMBEDDING_OBS_SET_LABEL_SIZE,
11374
+ CoordinationType$1.EMBEDDING_OBS_RADIUS,
11375
+ CoordinationType$1.EMBEDDING_OBS_RADIUS_MODE,
11376
+ CoordinationType$1.EMBEDDING_OBS_OPACITY,
11377
+ CoordinationType$1.EMBEDDING_OBS_OPACITY_MODE,
11378
+ CoordinationType$1.OBS_FILTER,
11379
+ CoordinationType$1.OBS_HIGHLIGHT,
11380
+ CoordinationType$1.OBS_SET_SELECTION,
11381
+ CoordinationType$1.OBS_SET_FILTER,
11382
+ CoordinationType$1.OBS_SET_HIGHLIGHT,
11383
+ CoordinationType$1.OBS_SET_COLOR,
11384
+ CoordinationType$1.FEATURE_HIGHLIGHT,
11385
+ CoordinationType$1.FEATURE_SELECTION,
11386
+ CoordinationType$1.FEATURE_VALUE_COLORMAP,
11387
+ CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
11388
+ CoordinationType$1.OBS_COLOR_ENCODING,
11389
+ CoordinationType$1.ADDITIONAL_OBS_SETS,
11390
+ CoordinationType$1.TOOLTIPS_VISIBLE,
11391
+ CoordinationType$1.SAMPLE_TYPE,
11392
+ CoordinationType$1.SAMPLE_SET_SELECTION,
11393
+ CoordinationType$1.SAMPLE_SET_FILTER,
11335
11394
  CoordinationType$1.SAMPLE_SET_COLOR,
11336
11395
  CoordinationType$1.EMBEDDING_POINTS_VISIBLE,
11337
11396
  CoordinationType$1.EMBEDDING_CONTOURS_VISIBLE,
@@ -11398,6 +11457,7 @@ const COMPONENT_COORDINATION_TYPES = {
11398
11457
  CoordinationType$1.OBS_FILTER,
11399
11458
  CoordinationType$1.OBS_HIGHLIGHT,
11400
11459
  CoordinationType$1.OBS_SET_SELECTION,
11460
+ CoordinationType$1.OBS_SET_FILTER,
11401
11461
  CoordinationType$1.OBS_SET_HIGHLIGHT,
11402
11462
  CoordinationType$1.OBS_SET_COLOR,
11403
11463
  CoordinationType$1.FEATURE_HIGHLIGHT,
@@ -11434,6 +11494,7 @@ const COMPONENT_COORDINATION_TYPES = {
11434
11494
  CoordinationType$1.OBS_FILTER,
11435
11495
  CoordinationType$1.OBS_HIGHLIGHT,
11436
11496
  CoordinationType$1.OBS_SET_SELECTION,
11497
+ CoordinationType$1.OBS_SET_FILTER,
11437
11498
  CoordinationType$1.OBS_SET_HIGHLIGHT,
11438
11499
  CoordinationType$1.OBS_SET_COLOR,
11439
11500
  CoordinationType$1.FEATURE_HIGHLIGHT,
@@ -11493,6 +11554,7 @@ const COMPONENT_COORDINATION_TYPES = {
11493
11554
  CoordinationType$1.OBS_FILTER,
11494
11555
  CoordinationType$1.OBS_HIGHLIGHT,
11495
11556
  CoordinationType$1.OBS_SET_SELECTION,
11557
+ CoordinationType$1.OBS_SET_FILTER,
11496
11558
  CoordinationType$1.OBS_SET_HIGHLIGHT,
11497
11559
  CoordinationType$1.OBS_SET_COLOR,
11498
11560
  CoordinationType$1.FEATURE_FILTER,
@@ -11508,6 +11570,7 @@ const COMPONENT_COORDINATION_TYPES = {
11508
11570
  CoordinationType$1.DATASET,
11509
11571
  CoordinationType$1.OBS_TYPE,
11510
11572
  CoordinationType$1.OBS_SET_SELECTION,
11573
+ CoordinationType$1.OBS_SET_FILTER,
11511
11574
  CoordinationType$1.OBS_SET_EXPANSION,
11512
11575
  CoordinationType$1.OBS_SET_HIGHLIGHT,
11513
11576
  CoordinationType$1.OBS_SET_COLOR,
@@ -11519,6 +11582,7 @@ const COMPONENT_COORDINATION_TYPES = {
11519
11582
  CoordinationType$1.DATASET,
11520
11583
  CoordinationType$1.OBS_TYPE,
11521
11584
  CoordinationType$1.OBS_SET_SELECTION,
11585
+ CoordinationType$1.OBS_SET_FILTER,
11522
11586
  CoordinationType$1.OBS_SET_EXPANSION,
11523
11587
  CoordinationType$1.OBS_SET_HIGHLIGHT,
11524
11588
  CoordinationType$1.OBS_SET_COLOR,
@@ -11551,6 +11615,7 @@ const COMPONENT_COORDINATION_TYPES = {
11551
11615
  CoordinationType$1.FEATURE_VALUE_TRANSFORM,
11552
11616
  CoordinationType$1.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
11553
11617
  CoordinationType$1.OBS_SET_SELECTION,
11618
+ CoordinationType$1.OBS_SET_FILTER,
11554
11619
  CoordinationType$1.OBS_SET_HIGHLIGHT,
11555
11620
  CoordinationType$1.OBS_SET_COLOR,
11556
11621
  CoordinationType$1.ADDITIONAL_OBS_SETS,
@@ -11567,7 +11632,8 @@ const COMPONENT_COORDINATION_TYPES = {
11567
11632
  CoordinationType$1.ADDITIONAL_OBS_SETS,
11568
11633
  CoordinationType$1.OBS_SET_COLOR,
11569
11634
  CoordinationType$1.OBS_COLOR_ENCODING,
11570
- CoordinationType$1.OBS_SET_SELECTION
11635
+ CoordinationType$1.OBS_SET_SELECTION,
11636
+ CoordinationType$1.OBS_SET_FILTER
11571
11637
  ],
11572
11638
  [ViewType$1.LAYER_CONTROLLER]: [
11573
11639
  CoordinationType$1.DATASET,
@@ -11682,11 +11748,13 @@ const COMPONENT_COORDINATION_TYPES = {
11682
11748
  CoordinationType$1.FEATURE_VALUE_POSITIVITY_THRESHOLD,
11683
11749
  CoordinationType$1.FEATURE_VALUE_COLORMAP,
11684
11750
  CoordinationType$1.OBS_SET_SELECTION,
11751
+ CoordinationType$1.OBS_SET_FILTER,
11685
11752
  CoordinationType$1.OBS_SET_HIGHLIGHT,
11686
11753
  CoordinationType$1.OBS_SET_COLOR,
11687
11754
  CoordinationType$1.ADDITIONAL_OBS_SETS,
11688
11755
  CoordinationType$1.SAMPLE_TYPE,
11689
11756
  CoordinationType$1.SAMPLE_SET_SELECTION,
11757
+ CoordinationType$1.SAMPLE_SET_FILTER,
11690
11758
  CoordinationType$1.SAMPLE_SET_COLOR
11691
11759
  ],
11692
11760
  higlass: [
@@ -11717,7 +11785,10 @@ const COMPONENT_COORDINATION_TYPES = {
11717
11785
  [ViewType$1.LINK_CONTROLLER]: [],
11718
11786
  [ViewType$1.BIOMARKER_SELECT]: [
11719
11787
  CoordinationType$1.FEATURE_SELECTION,
11720
- CoordinationType$1.SAMPLE_SET_SELECTION
11788
+ CoordinationType$1.SAMPLE_SET_SELECTION,
11789
+ CoordinationType$1.SAMPLE_SET_FILTER,
11790
+ CoordinationType$1.OBS_SET_SELECTION,
11791
+ CoordinationType$1.OBS_SET_FILTER
11721
11792
  // TODO: create coordination types for internal state of the biomarker selection view?
11722
11793
  ]
11723
11794
  };
@@ -123983,16 +124054,16 @@ function addDecoder(cases, importFn) {
123983
124054
  }
123984
124055
  cases.forEach((c2) => registry$1.set(c2, importFn));
123985
124056
  }
123986
- addDecoder([void 0, 1], () => import("./raw-55d1ddac.js").then((m2) => m2.default));
123987
- addDecoder(5, () => import("./lzw-24b336d4.js").then((m2) => m2.default));
124057
+ addDecoder([void 0, 1], () => import("./raw-03df793e.js").then((m2) => m2.default));
124058
+ addDecoder(5, () => import("./lzw-2bf68d77.js").then((m2) => m2.default));
123988
124059
  addDecoder(6, () => {
123989
124060
  throw new Error("old style JPEG compression is not supported.");
123990
124061
  });
123991
- addDecoder(7, () => import("./jpeg-17a85e73.js").then((m2) => m2.default));
123992
- addDecoder([8, 32946], () => import("./deflate-5287db37.js").then((m2) => m2.default));
123993
- addDecoder(32773, () => import("./packbits-44cebc8c.js").then((m2) => m2.default));
123994
- addDecoder(34887, () => import("./lerc-c362fa1c.js").then((m2) => m2.default));
123995
- addDecoder(50001, () => import("./webimage-6f2a65d0.js").then((m2) => m2.default));
124062
+ addDecoder(7, () => import("./jpeg-96119ba3.js").then((m2) => m2.default));
124063
+ addDecoder([8, 32946], () => import("./deflate-d0300d1e.js").then((m2) => m2.default));
124064
+ addDecoder(32773, () => import("./packbits-b40edb17.js").then((m2) => m2.default));
124065
+ addDecoder(34887, () => import("./lerc-c167c85c.js").then((m2) => m2.default));
124066
+ addDecoder(50001, () => import("./webimage-1cf2f04f.js").then((m2) => m2.default));
123996
124067
  function decodeRowAcc(row, stride) {
123997
124068
  let length2 = row.length - stride;
123998
124069
  let offset5 = 0;
@@ -148134,7 +148205,9 @@ function EmbeddingScatterplotSubscriber(props) {
148134
148205
  title: titleOverride,
148135
148206
  helpText = ViewHelpMapping.SCATTERPLOT,
148136
148207
  // Average fill density for dynamic opacity calculation.
148137
- averageFillDensity
148208
+ averageFillDensity,
148209
+ // For the dual scatterplot:
148210
+ sampleSetSelection: sampleSetSelectionFromProps
148138
148211
  } = props;
148139
148212
  const loaders = useLoaders();
148140
148213
  const setComponentHover = useSetComponentHover();
@@ -148167,7 +148240,7 @@ function EmbeddingScatterplotSubscriber(props) {
148167
148240
  featureValueColormap: geneExpressionColormap,
148168
148241
  featureValueColormapRange: geneExpressionColormapRange,
148169
148242
  tooltipsVisible,
148170
- sampleSetSelection,
148243
+ sampleSetSelection: sampleSetSelectionFromCoordination,
148171
148244
  sampleSetColor,
148172
148245
  embeddingPointsVisible,
148173
148246
  embeddingContoursVisible,
@@ -148211,6 +148284,7 @@ function EmbeddingScatterplotSubscriber(props) {
148211
148284
  coordinationScopes
148212
148285
  );
148213
148286
  const observationsLabel = observationsLabelOverride || obsType;
148287
+ const sampleSetSelection = sampleSetSelectionFromProps || sampleSetSelectionFromCoordination;
148214
148288
  const [width, height, deckRef] = useDeckCanvasSize();
148215
148289
  const title = titleOverride || `Scatterplot (${mapping})`;
148216
148290
  const [obsLabelsTypes, obsLabelsData] = useMultiObsLabels(
@@ -148677,8 +148751,36 @@ function EmbeddingScatterplotSubscriber(props) {
148677
148751
  }
148678
148752
  );
148679
148753
  }
148754
+ function DualEmbeddingScatterplotSubscriber(props) {
148755
+ const {
148756
+ coordinationScopes
148757
+ } = props;
148758
+ const [{
148759
+ sampleSetSelection
148760
+ }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.DUAL_SCATTERPLOT], coordinationScopes);
148761
+ const caseSampleSetSelection = useMemo(() => (sampleSetSelection == null ? void 0 : sampleSetSelection[0]) ? [sampleSetSelection[0]] : null, [sampleSetSelection]);
148762
+ const ctrlSampleSetSelection = useMemo(() => (sampleSetSelection == null ? void 0 : sampleSetSelection[1]) ? [sampleSetSelection[1]] : null, [sampleSetSelection]);
148763
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { width: "100%", height: "100%", display: "flex", flexDirection: "row" }, children: [
148764
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "50%", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
148765
+ EmbeddingScatterplotSubscriber,
148766
+ {
148767
+ ...props,
148768
+ sampleSetSelection: caseSampleSetSelection
148769
+ }
148770
+ ) }),
148771
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "50%", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
148772
+ EmbeddingScatterplotSubscriber,
148773
+ {
148774
+ ...props,
148775
+ title: "",
148776
+ sampleSetSelection: ctrlSampleSetSelection
148777
+ }
148778
+ ) })
148779
+ ] });
148780
+ }
148680
148781
  export {
148681
148782
  BaseDecoder as B,
148783
+ DualEmbeddingScatterplotSubscriber as D,
148682
148784
  EmbeddingScatterplotSubscriber as E,
148683
148785
  getDefaultExportFromCjs as g
148684
148786
  };
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
- import { E } from "./index-e8cfd624.js";
1
+ import { D, E } from "./index-59d93bea.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
5
5
  export {
6
+ D as DualEmbeddingScatterplotSubscriber,
6
7
  E as EmbeddingScatterplotSubscriber
7
8
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-e8cfd624.js";
1
+ import { B as BaseDecoder } from "./index-59d93bea.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-e8cfd624.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-59d93bea.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-e8cfd624.js";
1
+ import { B as BaseDecoder } from "./index-59d93bea.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-e8cfd624.js";
1
+ import { B as BaseDecoder } from "./index-59d93bea.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-e8cfd624.js";
1
+ import { B as BaseDecoder } from "./index-59d93bea.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-e8cfd624.js";
1
+ import { B as BaseDecoder } from "./index-59d93bea.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * A subscriber component for a pair of embedding scatterplots.
3
+ * This dual implementation
4
+ * interprets a user specification of a pair of CoordinationType.SAMPLE_SET_FILTER
5
+ * coordination types to stratify of the data.
6
+ * @param {object} props
7
+ * @param {number} props.uuid The unique identifier for this component.
8
+ * @param {string} props.theme The current theme name.
9
+ * @param {object} props.coordinationScopes The mapping from coordination types to coordination
10
+ * scopes.
11
+ * @param {function} props.removeGridComponent The callback function to pass to TitleInfo,
12
+ * to call when the component has been removed from the grid.
13
+ * @param {string} props.title An override value for the component title.
14
+ * @param {number} props.averageFillDensity Override the average fill density calculation
15
+ * when using dynamic opacity mode.
16
+ */
17
+ export function DualEmbeddingScatterplotSubscriber(props: {
18
+ uuid: number;
19
+ theme: string;
20
+ coordinationScopes: object;
21
+ removeGridComponent: Function;
22
+ title: string;
23
+ averageFillDensity: number;
24
+ }): JSX.Element;
25
+ //# sourceMappingURL=DualEmbeddingScatterplotSubscriber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DualEmbeddingScatterplotSubscriber.d.ts","sourceRoot":"","sources":["../src/DualEmbeddingScatterplotSubscriber.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;GAeG;AACH,0DAVG;IAAsB,IAAI,EAAlB,MAAM;IACQ,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;IAEU,mBAAmB;IAErB,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;CAEhB,eAuCA"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useMemo } from 'react';
3
+ import { useCoordination, } from '@vitessce/vit-s';
4
+ import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
5
+ import { EmbeddingScatterplotSubscriber } from './EmbeddingScatterplotSubscriber.js';
6
+ /**
7
+ * A subscriber component for a pair of embedding scatterplots.
8
+ * This dual implementation
9
+ * interprets a user specification of a pair of CoordinationType.SAMPLE_SET_FILTER
10
+ * coordination types to stratify of the data.
11
+ * @param {object} props
12
+ * @param {number} props.uuid The unique identifier for this component.
13
+ * @param {string} props.theme The current theme name.
14
+ * @param {object} props.coordinationScopes The mapping from coordination types to coordination
15
+ * scopes.
16
+ * @param {function} props.removeGridComponent The callback function to pass to TitleInfo,
17
+ * to call when the component has been removed from the grid.
18
+ * @param {string} props.title An override value for the component title.
19
+ * @param {number} props.averageFillDensity Override the average fill density calculation
20
+ * when using dynamic opacity mode.
21
+ */
22
+ export function DualEmbeddingScatterplotSubscriber(props) {
23
+ const { coordinationScopes, } = props;
24
+ // Get "props" from the coordination space.
25
+ const [{ sampleSetSelection, }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.DUAL_SCATTERPLOT], coordinationScopes);
26
+ const caseSampleSetSelection = useMemo(() => (sampleSetSelection?.[0]
27
+ ? [sampleSetSelection[0]]
28
+ : null), [sampleSetSelection]);
29
+ const ctrlSampleSetSelection = useMemo(() => (sampleSetSelection?.[1]
30
+ ? [sampleSetSelection[1]]
31
+ : null), [sampleSetSelection]);
32
+ return (_jsxs("div", { style: { width: '100%', height: '100%', display: 'flex', flexDirection: 'row' }, children: [_jsx("div", { style: { width: '50%', display: 'flex', flexDirection: 'column' }, children: _jsx(EmbeddingScatterplotSubscriber, { ...props, sampleSetSelection: caseSampleSetSelection }) }), _jsx("div", { style: { width: '50%', display: 'flex', flexDirection: 'column' }, children: _jsx(EmbeddingScatterplotSubscriber, { ...props, title: "", sampleSetSelection: ctrlSampleSetSelection }) })] }));
33
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"EmbeddingScatterplotSubscriber.d.ts","sourceRoot":"","sources":["../src/EmbeddingScatterplotSubscriber.js"],"names":[],"mappings":"AA0CA;;;;;;;;;;;;GAYG;AACH,sDAVG;IAAsB,IAAI,EAAlB,MAAM;IACQ,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;IAEU,mBAAmB;IAErB,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;CAEhB,eAihBA"}
1
+ {"version":3,"file":"EmbeddingScatterplotSubscriber.d.ts","sourceRoot":"","sources":["../src/EmbeddingScatterplotSubscriber.js"],"names":[],"mappings":"AA0CA;;;;;;;;;;;;GAYG;AACH,sDAVG;IAAsB,IAAI,EAAlB,MAAM;IACQ,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;IAEU,mBAAmB;IAErB,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;CAEhB,eAshBA"}
@@ -25,14 +25,17 @@ import { DEFAULT_CONTOUR_PERCENTILES } from './constants.js';
25
25
  export function EmbeddingScatterplotSubscriber(props) {
26
26
  const { uuid, coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, observationsLabelOverride, title: titleOverride, helpText = ViewHelpMapping.SCATTERPLOT,
27
27
  // Average fill density for dynamic opacity calculation.
28
- averageFillDensity, } = props;
28
+ averageFillDensity,
29
+ // For the dual scatterplot:
30
+ sampleSetSelection: sampleSetSelectionFromProps, } = props;
29
31
  const loaders = useLoaders();
30
32
  const setComponentHover = useSetComponentHover();
31
33
  const setComponentViewInfo = useSetComponentViewInfo(uuid);
32
34
  // Get "props" from the coordination space.
33
- const [{ dataset, obsType, featureType, featureValueType, sampleType, embeddingZoom: zoom, embeddingTargetX: targetX, embeddingTargetY: targetY, embeddingTargetZ: targetZ, embeddingType: mapping, obsFilter: cellFilter, obsHighlight: cellHighlight, featureSelection: geneSelection, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, obsColorEncoding: cellColorEncoding, additionalObsSets: additionalCellSets, embeddingObsSetPolygonsVisible: cellSetPolygonsVisible, embeddingObsSetLabelsVisible: cellSetLabelsVisible, embeddingObsSetLabelSize: cellSetLabelSize, embeddingObsRadius: cellRadiusFixed, embeddingObsRadiusMode: cellRadiusMode, embeddingObsOpacity: cellOpacityFixed, embeddingObsOpacityMode: cellOpacityMode, featureValueColormap: geneExpressionColormap, featureValueColormapRange: geneExpressionColormapRange, tooltipsVisible, sampleSetSelection, sampleSetColor, embeddingPointsVisible, embeddingContoursVisible, embeddingContoursFilled, embeddingContourPercentiles: contourPercentiles, contourColorEncoding, contourColor, }, { setEmbeddingZoom: setZoom, setEmbeddingTargetX: setTargetX, setEmbeddingTargetY: setTargetY, setEmbeddingTargetZ: setTargetZ, setObsFilter: setCellFilter, setObsSetSelection: setCellSetSelection, setObsHighlight: setCellHighlight, setObsSetColor: setCellSetColor, setObsColorEncoding: setCellColorEncoding, setAdditionalObsSets: setAdditionalCellSets, setEmbeddingObsSetPolygonsVisible: setCellSetPolygonsVisible, setEmbeddingObsSetLabelsVisible: setCellSetLabelsVisible, setEmbeddingObsSetLabelSize: setCellSetLabelSize, setEmbeddingObsRadius: setCellRadiusFixed, setEmbeddingObsRadiusMode: setCellRadiusMode, setEmbeddingObsOpacity: setCellOpacityFixed, setEmbeddingObsOpacityMode: setCellOpacityMode, setFeatureValueColormap: setGeneExpressionColormap, setFeatureValueColormapRange: setGeneExpressionColormapRange, setTooltipsVisible, setEmbeddingPointsVisible, setEmbeddingContoursVisible, setEmbeddingContoursFilled, setEmbeddingContourPercentiles: setContourPercentiles, setContourColorEncoding, }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.SCATTERPLOT], coordinationScopes);
35
+ const [{ dataset, obsType, featureType, featureValueType, sampleType, embeddingZoom: zoom, embeddingTargetX: targetX, embeddingTargetY: targetY, embeddingTargetZ: targetZ, embeddingType: mapping, obsFilter: cellFilter, obsHighlight: cellHighlight, featureSelection: geneSelection, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, obsColorEncoding: cellColorEncoding, additionalObsSets: additionalCellSets, embeddingObsSetPolygonsVisible: cellSetPolygonsVisible, embeddingObsSetLabelsVisible: cellSetLabelsVisible, embeddingObsSetLabelSize: cellSetLabelSize, embeddingObsRadius: cellRadiusFixed, embeddingObsRadiusMode: cellRadiusMode, embeddingObsOpacity: cellOpacityFixed, embeddingObsOpacityMode: cellOpacityMode, featureValueColormap: geneExpressionColormap, featureValueColormapRange: geneExpressionColormapRange, tooltipsVisible, sampleSetSelection: sampleSetSelectionFromCoordination, sampleSetColor, embeddingPointsVisible, embeddingContoursVisible, embeddingContoursFilled, embeddingContourPercentiles: contourPercentiles, contourColorEncoding, contourColor, }, { setEmbeddingZoom: setZoom, setEmbeddingTargetX: setTargetX, setEmbeddingTargetY: setTargetY, setEmbeddingTargetZ: setTargetZ, setObsFilter: setCellFilter, setObsSetSelection: setCellSetSelection, setObsHighlight: setCellHighlight, setObsSetColor: setCellSetColor, setObsColorEncoding: setCellColorEncoding, setAdditionalObsSets: setAdditionalCellSets, setEmbeddingObsSetPolygonsVisible: setCellSetPolygonsVisible, setEmbeddingObsSetLabelsVisible: setCellSetLabelsVisible, setEmbeddingObsSetLabelSize: setCellSetLabelSize, setEmbeddingObsRadius: setCellRadiusFixed, setEmbeddingObsRadiusMode: setCellRadiusMode, setEmbeddingObsOpacity: setCellOpacityFixed, setEmbeddingObsOpacityMode: setCellOpacityMode, setFeatureValueColormap: setGeneExpressionColormap, setFeatureValueColormapRange: setGeneExpressionColormapRange, setTooltipsVisible, setEmbeddingPointsVisible, setEmbeddingContoursVisible, setEmbeddingContoursFilled, setEmbeddingContourPercentiles: setContourPercentiles, setContourColorEncoding, }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.SCATTERPLOT], coordinationScopes);
34
36
  const { embeddingZoom: initialZoom, embeddingTargetX: initialTargetX, embeddingTargetY: initialTargetY, } = useInitialCoordination(COMPONENT_COORDINATION_TYPES[ViewType.SCATTERPLOT], coordinationScopes);
35
37
  const observationsLabel = observationsLabelOverride || obsType;
38
+ const sampleSetSelection = (sampleSetSelectionFromProps || sampleSetSelectionFromCoordination);
36
39
  const [width, height, deckRef] = useDeckCanvasSize();
37
40
  const title = titleOverride || `Scatterplot (${mapping})`;
38
41
  const [obsLabelsTypes, obsLabelsData] = useMultiObsLabels(coordinationScopes, obsType, loaders, dataset);
@@ -1,2 +1,3 @@
1
1
  export { EmbeddingScatterplotSubscriber } from "./EmbeddingScatterplotSubscriber.js";
2
+ export { DualEmbeddingScatterplotSubscriber } from "./DualEmbeddingScatterplotSubscriber.js";
2
3
  //# sourceMappingURL=index.d.ts.map
package/dist-tsc/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export { EmbeddingScatterplotSubscriber } from './EmbeddingScatterplotSubscriber.js';
2
+ export { DualEmbeddingScatterplotSubscriber } from './DualEmbeddingScatterplotSubscriber.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/scatterplot-embedding",
3
- "version": "3.5.4",
3
+ "version": "3.5.6",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -20,12 +20,12 @@
20
20
  "d3-array": "^2.4.0",
21
21
  "lodash-es": "^4.17.21",
22
22
  "react-aria": "^3.28.0",
23
- "@vitessce/constants-internal": "3.5.4",
24
- "@vitessce/legend": "3.5.4",
25
- "@vitessce/scatterplot": "3.5.4",
26
- "@vitessce/sets-utils": "3.5.4",
27
- "@vitessce/utils": "3.5.4",
28
- "@vitessce/vit-s": "3.5.4"
23
+ "@vitessce/constants-internal": "3.5.6",
24
+ "@vitessce/legend": "3.5.6",
25
+ "@vitessce/scatterplot": "3.5.6",
26
+ "@vitessce/sets-utils": "3.5.6",
27
+ "@vitessce/utils": "3.5.6",
28
+ "@vitessce/vit-s": "3.5.6"
29
29
  },
30
30
  "devDependencies": {
31
31
  "react": "^18.0.0",
@@ -0,0 +1,63 @@
1
+ import React, { useMemo } from 'react';
2
+ import {
3
+ useCoordination,
4
+ } from '@vitessce/vit-s';
5
+ import { ViewType, COMPONENT_COORDINATION_TYPES } from '@vitessce/constants-internal';
6
+ import { EmbeddingScatterplotSubscriber } from './EmbeddingScatterplotSubscriber.js';
7
+
8
+
9
+ /**
10
+ * A subscriber component for a pair of embedding scatterplots.
11
+ * This dual implementation
12
+ * interprets a user specification of a pair of CoordinationType.SAMPLE_SET_FILTER
13
+ * coordination types to stratify of the data.
14
+ * @param {object} props
15
+ * @param {number} props.uuid The unique identifier for this component.
16
+ * @param {string} props.theme The current theme name.
17
+ * @param {object} props.coordinationScopes The mapping from coordination types to coordination
18
+ * scopes.
19
+ * @param {function} props.removeGridComponent The callback function to pass to TitleInfo,
20
+ * to call when the component has been removed from the grid.
21
+ * @param {string} props.title An override value for the component title.
22
+ * @param {number} props.averageFillDensity Override the average fill density calculation
23
+ * when using dynamic opacity mode.
24
+ */
25
+ export function DualEmbeddingScatterplotSubscriber(props) {
26
+ const {
27
+ coordinationScopes,
28
+ } = props;
29
+
30
+ // Get "props" from the coordination space.
31
+ const [{
32
+ sampleSetSelection,
33
+ }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType.DUAL_SCATTERPLOT], coordinationScopes);
34
+
35
+ const caseSampleSetSelection = useMemo(() => (
36
+ sampleSetSelection?.[0]
37
+ ? [sampleSetSelection[0]]
38
+ : null
39
+ ), [sampleSetSelection]);
40
+ const ctrlSampleSetSelection = useMemo(() => (
41
+ sampleSetSelection?.[1]
42
+ ? [sampleSetSelection[1]]
43
+ : null
44
+ ), [sampleSetSelection]);
45
+
46
+ return (
47
+ <div style={{ width: '100%', height: '100%', display: 'flex', flexDirection: 'row' }}>
48
+ <div style={{ width: '50%', display: 'flex', flexDirection: 'column' }}>
49
+ <EmbeddingScatterplotSubscriber
50
+ {...props}
51
+ sampleSetSelection={caseSampleSetSelection}
52
+ />
53
+ </div>
54
+ <div style={{ width: '50%', display: 'flex', flexDirection: 'column' }}>
55
+ <EmbeddingScatterplotSubscriber
56
+ {...props}
57
+ title=""
58
+ sampleSetSelection={ctrlSampleSetSelection}
59
+ />
60
+ </div>
61
+ </div>
62
+ );
63
+ }
@@ -66,6 +66,9 @@ export function EmbeddingScatterplotSubscriber(props) {
66
66
  helpText = ViewHelpMapping.SCATTERPLOT,
67
67
  // Average fill density for dynamic opacity calculation.
68
68
  averageFillDensity,
69
+
70
+ // For the dual scatterplot:
71
+ sampleSetSelection: sampleSetSelectionFromProps,
69
72
  } = props;
70
73
 
71
74
  const loaders = useLoaders();
@@ -101,7 +104,7 @@ export function EmbeddingScatterplotSubscriber(props) {
101
104
  featureValueColormap: geneExpressionColormap,
102
105
  featureValueColormapRange: geneExpressionColormapRange,
103
106
  tooltipsVisible,
104
- sampleSetSelection,
107
+ sampleSetSelection: sampleSetSelectionFromCoordination,
105
108
  sampleSetColor,
106
109
  embeddingPointsVisible,
107
110
  embeddingContoursVisible,
@@ -146,6 +149,8 @@ export function EmbeddingScatterplotSubscriber(props) {
146
149
  );
147
150
 
148
151
  const observationsLabel = observationsLabelOverride || obsType;
152
+ const sampleSetSelection = (sampleSetSelectionFromProps || sampleSetSelectionFromCoordination
153
+ );
149
154
 
150
155
  const [width, height, deckRef] = useDeckCanvasSize();
151
156
 
package/src/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export { EmbeddingScatterplotSubscriber } from './EmbeddingScatterplotSubscriber.js';
2
+ export { DualEmbeddingScatterplotSubscriber } from './DualEmbeddingScatterplotSubscriber.js';