@vitessce/config 3.1.2 → 3.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.
- package/dist/index.js +168 -26
- package/dist-tsc/VitessceConfig.d.ts +49 -8
- package/dist-tsc/VitessceConfig.d.ts.map +1 -1
- package/dist-tsc/VitessceConfig.js +106 -27
- package/dist-tsc/VitessceConfig.test.js +151 -15
- package/dist-tsc/index.d.ts +1 -1
- package/dist-tsc/index.js +1 -1
- package/package.json +3 -3
- package/src/VitessceConfig.js +108 -28
- package/src/VitessceConfig.test.js +158 -15
- package/src/index.js +1 -1
package/dist/index.js
CHANGED
|
@@ -3,8 +3,10 @@ const ViewType$1 = {
|
|
|
3
3
|
STATUS: "status",
|
|
4
4
|
SCATTERPLOT: "scatterplot",
|
|
5
5
|
SPATIAL: "spatial",
|
|
6
|
+
SPATIAL_BETA: "spatialBeta",
|
|
6
7
|
HEATMAP: "heatmap",
|
|
7
8
|
LAYER_CONTROLLER: "layerController",
|
|
9
|
+
LAYER_CONTROLLER_BETA: "layerControllerBeta",
|
|
8
10
|
GENOMIC_PROFILES: "genomicProfiles",
|
|
9
11
|
GATING: "gating",
|
|
10
12
|
FEATURE_LIST: "featureList",
|
|
@@ -16,20 +18,24 @@ const ViewType$1 = {
|
|
|
16
18
|
const DataType$1 = {
|
|
17
19
|
OBS_LABELS: "obsLabels",
|
|
18
20
|
OBS_EMBEDDING: "obsEmbedding",
|
|
19
|
-
OBS_LOCATIONS: "obsLocations",
|
|
20
21
|
OBS_FEATURE_MATRIX: "obsFeatureMatrix",
|
|
21
22
|
OBS_SETS: "obsSets",
|
|
22
23
|
FEATURE_LABELS: "featureLabels",
|
|
23
24
|
IMAGE: "image",
|
|
24
25
|
OBS_SEGMENTATIONS: "obsSegmentations",
|
|
25
26
|
NEIGHBORHOODS: "neighborhoods",
|
|
26
|
-
GENOMIC_PROFILES: "genomic-profiles"
|
|
27
|
+
GENOMIC_PROFILES: "genomic-profiles",
|
|
28
|
+
OBS_SPOTS: "obsSpots",
|
|
29
|
+
OBS_POINTS: "obsPoints",
|
|
30
|
+
OBS_LOCATIONS: "obsLocations"
|
|
27
31
|
};
|
|
28
32
|
const FileType$1 = {
|
|
29
33
|
// Joint file types
|
|
30
34
|
ANNDATA_ZARR: "anndata.zarr",
|
|
31
35
|
// Atomic file types
|
|
32
36
|
OBS_EMBEDDING_CSV: "obsEmbedding.csv",
|
|
37
|
+
OBS_SPOTS_CSV: "obsSpots.csv",
|
|
38
|
+
OBS_POINTS_CSV: "obsPoints.csv",
|
|
33
39
|
OBS_LOCATIONS_CSV: "obsLocations.csv",
|
|
34
40
|
OBS_LABELS_CSV: "obsLabels.csv",
|
|
35
41
|
FEATURE_LABELS_CSV: "featureLabels.csv",
|
|
@@ -42,6 +48,8 @@ const FileType$1 = {
|
|
|
42
48
|
OBS_FEATURE_MATRIX_ANNDATA_ZARR: "obsFeatureMatrix.anndata.zarr",
|
|
43
49
|
OBS_SETS_ANNDATA_ZARR: "obsSets.anndata.zarr",
|
|
44
50
|
OBS_EMBEDDING_ANNDATA_ZARR: "obsEmbedding.anndata.zarr",
|
|
51
|
+
OBS_SPOTS_ANNDATA_ZARR: "obsSpots.anndata.zarr",
|
|
52
|
+
OBS_POINTS_ANNDATA_ZARR: "obsPoints.anndata.zarr",
|
|
45
53
|
OBS_LOCATIONS_ANNDATA_ZARR: "obsLocations.anndata.zarr",
|
|
46
54
|
OBS_SEGMENTATIONS_ANNDATA_ZARR: "obsSegmentations.anndata.zarr",
|
|
47
55
|
OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
|
|
@@ -50,6 +58,8 @@ const FileType$1 = {
|
|
|
50
58
|
OBS_FEATURE_MATRIX_MUDATA_ZARR: "obsFeatureMatrix.mudata.zarr",
|
|
51
59
|
OBS_SETS_MUDATA_ZARR: "obsSets.mudata.zarr",
|
|
52
60
|
OBS_EMBEDDING_MUDATA_ZARR: "obsEmbedding.mudata.zarr",
|
|
61
|
+
OBS_SPOTS_MUDATA_ZARR: "obsSpots.mudata.zarr",
|
|
62
|
+
OBS_POINTS_MUDATA_ZARR: "obsPoints.mudata.zarr",
|
|
53
63
|
OBS_LOCATIONS_MUDATA_ZARR: "obsLocations.mudata.zarr",
|
|
54
64
|
OBS_SEGMENTATIONS_MUDATA_ZARR: "obsSegmentations.mudata.zarr",
|
|
55
65
|
OBS_LABELS_MUDATA_ZARR: "obsLabels.mudata.zarr",
|
|
@@ -93,10 +103,8 @@ const FileType$1 = {
|
|
|
93
103
|
ANNDATA_EXPRESSION_MATRIX_ZARR: "anndata-expression-matrix.zarr"
|
|
94
104
|
};
|
|
95
105
|
const CoordinationType$1 = {
|
|
96
|
-
// Meta coordination scopes
|
|
97
106
|
META_COORDINATION_SCOPES: "metaCoordinationScopes",
|
|
98
107
|
META_COORDINATION_SCOPES_BY: "metaCoordinationScopesBy",
|
|
99
|
-
// Other coordination scopes
|
|
100
108
|
DATASET: "dataset",
|
|
101
109
|
// Entity types
|
|
102
110
|
OBS_TYPE: "obsType",
|
|
@@ -122,6 +130,7 @@ const CoordinationType$1 = {
|
|
|
122
130
|
SPATIAL_TARGET_X: "spatialTargetX",
|
|
123
131
|
SPATIAL_TARGET_Y: "spatialTargetY",
|
|
124
132
|
SPATIAL_TARGET_Z: "spatialTargetZ",
|
|
133
|
+
SPATIAL_TARGET_T: "spatialTargetT",
|
|
125
134
|
SPATIAL_ROTATION_X: "spatialRotationX",
|
|
126
135
|
SPATIAL_ROTATION_Y: "spatialRotationY",
|
|
127
136
|
SPATIAL_ROTATION_Z: "spatialRotationZ",
|
|
@@ -159,7 +168,46 @@ const CoordinationType$1 = {
|
|
|
159
168
|
GATING_FEATURE_SELECTION_X: "gatingFeatureSelectionX",
|
|
160
169
|
GATING_FEATURE_SELECTION_Y: "gatingFeatureSelectionY",
|
|
161
170
|
FEATURE_VALUE_TRANSFORM_COEFFICIENT: "featureValueTransformCoefficient",
|
|
162
|
-
TOOLTIPS_VISIBLE: "tooltipsVisible"
|
|
171
|
+
TOOLTIPS_VISIBLE: "tooltipsVisible",
|
|
172
|
+
FILE_UID: "fileUid",
|
|
173
|
+
IMAGE_LAYER: "imageLayer",
|
|
174
|
+
IMAGE_CHANNEL: "imageChannel",
|
|
175
|
+
SEGMENTATION_LAYER: "segmentationLayer",
|
|
176
|
+
SEGMENTATION_CHANNEL: "segmentationChannel",
|
|
177
|
+
SPATIAL_TARGET_C: "spatialTargetC",
|
|
178
|
+
SPATIAL_LAYER_VISIBLE: "spatialLayerVisible",
|
|
179
|
+
SPATIAL_LAYER_OPACITY: "spatialLayerOpacity",
|
|
180
|
+
SPATIAL_LAYER_COLORMAP: "spatialLayerColormap",
|
|
181
|
+
SPATIAL_LAYER_TRANSPARENT_COLOR: "spatialLayerTransparentColor",
|
|
182
|
+
SPATIAL_LAYER_MODEL_MATRIX: "spatialLayerModelMatrix",
|
|
183
|
+
SPATIAL_SEGMENTATION_FILLED: "spatialSegmentationFilled",
|
|
184
|
+
SPATIAL_SEGMENTATION_STROKE_WIDTH: "spatialSegmentationStrokeWidth",
|
|
185
|
+
SPATIAL_CHANNEL_COLOR: "spatialChannelColor",
|
|
186
|
+
SPATIAL_CHANNEL_VISIBLE: "spatialChannelVisible",
|
|
187
|
+
SPATIAL_CHANNEL_OPACITY: "spatialChannelOpacity",
|
|
188
|
+
SPATIAL_CHANNEL_WINDOW: "spatialChannelWindow",
|
|
189
|
+
PHOTOMETRIC_INTERPRETATION: "photometricInterpretation",
|
|
190
|
+
// For 3D volume rendering
|
|
191
|
+
SPATIAL_RENDERING_MODE: "spatialRenderingMode",
|
|
192
|
+
VOLUMETRIC_RENDERING_ALGORITHM: "volumetricRenderingAlgorithm",
|
|
193
|
+
SPATIAL_TARGET_RESOLUTION: "spatialTargetResolution",
|
|
194
|
+
// For clipping plane sliders
|
|
195
|
+
SPATIAL_SLICE_X: "spatialSliceX",
|
|
196
|
+
SPATIAL_SLICE_Y: "spatialSliceY",
|
|
197
|
+
SPATIAL_SLICE_Z: "spatialSliceZ",
|
|
198
|
+
// For spatial spot and point layers
|
|
199
|
+
SPOT_LAYER: "spotLayer",
|
|
200
|
+
POINT_LAYER: "pointLayer",
|
|
201
|
+
SPATIAL_SPOT_RADIUS: "spatialSpotRadius",
|
|
202
|
+
SPATIAL_SPOT_FILLED: "spatialSpotFilled",
|
|
203
|
+
SPATIAL_SPOT_STROKE_WIDTH: "spatialSpotStrokeWidth",
|
|
204
|
+
SPATIAL_LAYER_COLOR: "spatialLayerColor",
|
|
205
|
+
PIXEL_HIGHLIGHT: "pixelHighlight",
|
|
206
|
+
TOOLTIP_CROSSHAIRS_VISIBLE: "tooltipCrosshairsVisible",
|
|
207
|
+
LEGEND_VISIBLE: "legendVisible",
|
|
208
|
+
SPATIAL_CHANNEL_LABELS_VISIBLE: "spatialChannelLabelsVisible",
|
|
209
|
+
SPATIAL_CHANNEL_LABELS_ORIENTATION: "spatialChannelLabelsOrientation",
|
|
210
|
+
SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize"
|
|
163
211
|
};
|
|
164
212
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
165
213
|
function getDefaultExportFromCjs(x) {
|
|
@@ -8913,6 +8961,8 @@ const annDataObsSets = z.array(z.object({
|
|
|
8913
8961
|
]),
|
|
8914
8962
|
scorePath: z.string().optional().describe("The location in the AnnData store for the set confidence scores, like 'obs/celltype_prediction_score.'")
|
|
8915
8963
|
}));
|
|
8964
|
+
const annDataObsSpots = annDataObsm;
|
|
8965
|
+
const annDataObsPoints = annDataObsm;
|
|
8916
8966
|
const annDataObsLocations = annDataObsm;
|
|
8917
8967
|
const annDataObsEmbedding = annDataObsm;
|
|
8918
8968
|
const annDataObsSegmentations = annDataObs;
|
|
@@ -8939,10 +8989,21 @@ z.object({
|
|
|
8939
8989
|
z.object({
|
|
8940
8990
|
obsIndex: z.string(),
|
|
8941
8991
|
obsEmbedding: z.array(z.string()).length(2)
|
|
8992
|
+
// TODO: support 3D?
|
|
8993
|
+
});
|
|
8994
|
+
z.object({
|
|
8995
|
+
obsIndex: z.string(),
|
|
8996
|
+
obsSpots: z.array(z.string()).length(2)
|
|
8997
|
+
// TODO: support 3D?
|
|
8998
|
+
});
|
|
8999
|
+
z.object({
|
|
9000
|
+
obsIndex: z.string(),
|
|
9001
|
+
obsPoints: z.array(z.string()).length(3)
|
|
8942
9002
|
});
|
|
8943
9003
|
z.object({
|
|
8944
9004
|
obsIndex: z.string(),
|
|
8945
9005
|
obsLocations: z.array(z.string()).length(2)
|
|
9006
|
+
// TODO: support 3D?
|
|
8946
9007
|
});
|
|
8947
9008
|
z.object({
|
|
8948
9009
|
obsIndex: z.string(),
|
|
@@ -8974,6 +9035,8 @@ z.object({
|
|
|
8974
9035
|
]),
|
|
8975
9036
|
obsFeatureMatrix: annDataObsFeatureMatrix,
|
|
8976
9037
|
obsSets: annDataObsSets,
|
|
9038
|
+
obsSpots: annDataObsSpots,
|
|
9039
|
+
obsPoints: annDataObsPoints,
|
|
8977
9040
|
obsLocations: annDataObsLocations,
|
|
8978
9041
|
obsSegmentations: annDataObsSegmentations,
|
|
8979
9042
|
obsEmbedding: z.union([
|
|
@@ -15609,7 +15672,7 @@ class VitessceConfigDataset {
|
|
|
15609
15672
|
};
|
|
15610
15673
|
}
|
|
15611
15674
|
}
|
|
15612
|
-
function
|
|
15675
|
+
function useCoordinationByObjectHelper(scopes, coordinationScopes, coordinationScopesBy) {
|
|
15613
15676
|
function processLevel(parentType, parentScope, levelType, levelVal) {
|
|
15614
15677
|
var _a, _b;
|
|
15615
15678
|
if (Array.isArray(levelVal)) {
|
|
@@ -15711,14 +15774,20 @@ class VitessceConfigView {
|
|
|
15711
15774
|
});
|
|
15712
15775
|
return this;
|
|
15713
15776
|
}
|
|
15714
|
-
|
|
15777
|
+
/**
|
|
15778
|
+
* Attach potentially multi-level coordination scopes to this view.
|
|
15779
|
+
* @param {object} scopes A value returned by `VitessceConfig.addCoordinationByObject`.
|
|
15780
|
+
* Not intended to be a manually-constructed object.
|
|
15781
|
+
* @returns {VitessceConfigView} This, to allow chaining.
|
|
15782
|
+
*/
|
|
15783
|
+
useCoordinationByObject(scopes) {
|
|
15715
15784
|
if (!this.view.coordinationScopes) {
|
|
15716
15785
|
this.view.coordinationScopes = {};
|
|
15717
15786
|
}
|
|
15718
15787
|
if (!this.view.coordinationScopesBy) {
|
|
15719
15788
|
this.view.coordinationScopesBy = {};
|
|
15720
15789
|
}
|
|
15721
|
-
const [nextCoordinationScopes, nextCoordinationScopesBy] =
|
|
15790
|
+
const [nextCoordinationScopes, nextCoordinationScopesBy] = useCoordinationByObjectHelper(
|
|
15722
15791
|
scopes,
|
|
15723
15792
|
this.view.coordinationScopes,
|
|
15724
15793
|
this.view.coordinationScopesBy
|
|
@@ -15800,7 +15869,20 @@ function vconcat(...views) {
|
|
|
15800
15869
|
class CoordinationLevel {
|
|
15801
15870
|
constructor(value) {
|
|
15802
15871
|
this.value = value;
|
|
15872
|
+
this.cachedValue = null;
|
|
15873
|
+
}
|
|
15874
|
+
setCached(processedLevel) {
|
|
15875
|
+
this.cachedValue = processedLevel;
|
|
15876
|
+
}
|
|
15877
|
+
getCached() {
|
|
15878
|
+
return this.cachedValue;
|
|
15803
15879
|
}
|
|
15880
|
+
isCached() {
|
|
15881
|
+
return this.cachedValue !== null;
|
|
15882
|
+
}
|
|
15883
|
+
}
|
|
15884
|
+
function CL(value) {
|
|
15885
|
+
return new CoordinationLevel(value);
|
|
15804
15886
|
}
|
|
15805
15887
|
class VitessceConfigCoordinationScope {
|
|
15806
15888
|
/**
|
|
@@ -15854,14 +15936,21 @@ class VitessceConfigMetaCoordinationScope {
|
|
|
15854
15936
|
this.metaScope.setValue(metaScopesVal);
|
|
15855
15937
|
return this;
|
|
15856
15938
|
}
|
|
15857
|
-
|
|
15939
|
+
/**
|
|
15940
|
+
* Attach potentially multi-level coordination scopes to this meta coordination
|
|
15941
|
+
* scope instance.
|
|
15942
|
+
* @param {object} scopes A value returned by `VitessceConfig.addCoordinationByObject`.
|
|
15943
|
+
* Not intended to be a manually-constructed object.
|
|
15944
|
+
* @returns {VitessceConfigView} This, to allow chaining.
|
|
15945
|
+
*/
|
|
15946
|
+
useCoordinationByObject(scopes) {
|
|
15858
15947
|
if (!this.metaScope.cValue) {
|
|
15859
15948
|
this.metaScope.setValue({});
|
|
15860
15949
|
}
|
|
15861
15950
|
if (!this.metaByScope.cValue) {
|
|
15862
15951
|
this.metaByScope.setValue({});
|
|
15863
15952
|
}
|
|
15864
|
-
const [metaScopesVal, metaByScopesVal] =
|
|
15953
|
+
const [metaScopesVal, metaByScopesVal] = useCoordinationByObjectHelper(
|
|
15865
15954
|
scopes,
|
|
15866
15955
|
this.metaScope.cValue,
|
|
15867
15956
|
this.metaByScope.cValue
|
|
@@ -15870,15 +15959,6 @@ class VitessceConfigMetaCoordinationScope {
|
|
|
15870
15959
|
this.metaByScope.setValue(metaByScopesVal);
|
|
15871
15960
|
return this;
|
|
15872
15961
|
}
|
|
15873
|
-
/**
|
|
15874
|
-
* Set the coordination value of the coordination scope.
|
|
15875
|
-
* @param {any} cValue The value to set.
|
|
15876
|
-
* @returns {VitessceConfigCoordinationScope} This, to allow chaining.
|
|
15877
|
-
*/
|
|
15878
|
-
setValue(cValue) {
|
|
15879
|
-
this.cValue = cValue;
|
|
15880
|
-
return this;
|
|
15881
|
-
}
|
|
15882
15962
|
}
|
|
15883
15963
|
class VitessceConfig {
|
|
15884
15964
|
/**
|
|
@@ -16001,6 +16081,11 @@ class VitessceConfig {
|
|
|
16001
16081
|
});
|
|
16002
16082
|
return result;
|
|
16003
16083
|
}
|
|
16084
|
+
/**
|
|
16085
|
+
* Initialize a new meta coordination scope in the coordination space,
|
|
16086
|
+
* and get a reference to it in the form of a meta coordination scope instance.
|
|
16087
|
+
* @returns {VitessceConfigMetaCoordinationScope} A new meta coordination scope instance.
|
|
16088
|
+
*/
|
|
16004
16089
|
addMetaCoordination() {
|
|
16005
16090
|
const prevMetaScopes = this.config.coordinationSpace[CoordinationType$1.META_COORDINATION_SCOPES] ? Object.keys(this.config.coordinationSpace[CoordinationType$1.META_COORDINATION_SCOPES]) : [];
|
|
16006
16091
|
const prevMetaByScopes = this.config.coordinationSpace[CoordinationType$1.META_COORDINATION_SCOPES_BY] ? Object.keys(this.config.coordinationSpace[CoordinationType$1.META_COORDINATION_SCOPES_BY]) : [];
|
|
@@ -16018,14 +16103,29 @@ class VitessceConfig {
|
|
|
16018
16103
|
this.config.coordinationSpace[CoordinationType$1.META_COORDINATION_SCOPES_BY][metaContainer.metaByScope.cScope] = metaContainer.metaByScope;
|
|
16019
16104
|
return metaContainer;
|
|
16020
16105
|
}
|
|
16021
|
-
|
|
16106
|
+
/**
|
|
16107
|
+
* Set up the initial values for multi-level coordination in the coordination space.
|
|
16108
|
+
* Get a reference to these values to pass to the `useCoordinationByObject` method
|
|
16109
|
+
* of either view or meta coordination scope instances.
|
|
16110
|
+
* @param {object} input A (potentially nested) object with coordination types as keys
|
|
16111
|
+
* and values being either the initial coordination value, a `VitessceConfigCoordinationScope`
|
|
16112
|
+
* instance, or a `CoordinationLevel` instance.
|
|
16113
|
+
* The CL function takes an array of objects as its argument, and returns a CoordinationLevel
|
|
16114
|
+
* instance, to support nesting.
|
|
16115
|
+
* @returns {object} A (potentially nested) object with coordination types as keys and values
|
|
16116
|
+
* being either { scope }, { scope, children }, or an array of these. Not intended to be
|
|
16117
|
+
* manipulated before being passed to a `useCoordinationByObject` function.
|
|
16118
|
+
*/
|
|
16119
|
+
addCoordinationByObject(input) {
|
|
16022
16120
|
const processLevel = (level) => {
|
|
16023
16121
|
const result = {};
|
|
16024
16122
|
Object.entries(level).forEach(([cType, nextLevelOrInitialValue]) => {
|
|
16025
16123
|
if (nextLevelOrInitialValue instanceof CoordinationLevel) {
|
|
16026
16124
|
const nextLevel = nextLevelOrInitialValue.value;
|
|
16027
|
-
if (
|
|
16028
|
-
result[cType] =
|
|
16125
|
+
if (nextLevelOrInitialValue.isCached()) {
|
|
16126
|
+
result[cType] = nextLevelOrInitialValue.getCached();
|
|
16127
|
+
} else if (Array.isArray(nextLevel)) {
|
|
16128
|
+
const processedLevel = nextLevel.map((nextEl) => {
|
|
16029
16129
|
const [dummyScope] = this.addCoordination(cType);
|
|
16030
16130
|
dummyScope.setValue("__dummy__");
|
|
16031
16131
|
return {
|
|
@@ -16033,14 +16133,28 @@ class VitessceConfig {
|
|
|
16033
16133
|
children: processLevel(nextEl)
|
|
16034
16134
|
};
|
|
16035
16135
|
});
|
|
16136
|
+
nextLevelOrInitialValue.setCached(processedLevel);
|
|
16137
|
+
result[cType] = processedLevel;
|
|
16036
16138
|
} else {
|
|
16037
|
-
|
|
16139
|
+
const nextEl = nextLevel;
|
|
16140
|
+
const [dummyScope] = this.addCoordination(cType);
|
|
16141
|
+
dummyScope.setValue("__dummy__");
|
|
16142
|
+
const processedLevel = {
|
|
16143
|
+
scope: dummyScope,
|
|
16144
|
+
children: processLevel(nextEl)
|
|
16145
|
+
};
|
|
16146
|
+
nextLevelOrInitialValue.setCached(processedLevel);
|
|
16147
|
+
result[cType] = processedLevel;
|
|
16038
16148
|
}
|
|
16039
16149
|
} else {
|
|
16040
16150
|
const initialValue = nextLevelOrInitialValue;
|
|
16041
|
-
|
|
16042
|
-
|
|
16043
|
-
|
|
16151
|
+
if (initialValue instanceof VitessceConfigCoordinationScope) {
|
|
16152
|
+
result[cType] = { scope: initialValue };
|
|
16153
|
+
} else {
|
|
16154
|
+
const [scope] = this.addCoordination(cType);
|
|
16155
|
+
scope.setValue(initialValue);
|
|
16156
|
+
result[cType] = { scope };
|
|
16157
|
+
}
|
|
16044
16158
|
}
|
|
16045
16159
|
});
|
|
16046
16160
|
return result;
|
|
@@ -16070,6 +16184,33 @@ class VitessceConfig {
|
|
|
16070
16184
|
}
|
|
16071
16185
|
return this;
|
|
16072
16186
|
}
|
|
16187
|
+
/**
|
|
16188
|
+
* A convenience function for setting up multi-level and meta-coordination scopes
|
|
16189
|
+
* across a set of views.
|
|
16190
|
+
* @param {VitessceConfigView[]} views An array of view objects to link together.
|
|
16191
|
+
* @param {object} input A (potentially nested) object with coordination types as keys
|
|
16192
|
+
* and values being either the initial coordination value, a `VitessceConfigCoordinationScope`
|
|
16193
|
+
* instance, or a `CoordinationLevel` instance.
|
|
16194
|
+
* The CL function takes an array of objects as its argument, and returns a CoordinationLevel
|
|
16195
|
+
* instance, to support nesting.
|
|
16196
|
+
* @param {boolean} meta Should meta-coordination be used? Optional. By default, true.
|
|
16197
|
+
* @returns {VitessceConfig} This, to allow chaining.
|
|
16198
|
+
*/
|
|
16199
|
+
linkViewsByObject(views, input, meta = true) {
|
|
16200
|
+
const scopes = this.addCoordinationByObject(input);
|
|
16201
|
+
if (meta) {
|
|
16202
|
+
const metaScope = this.addMetaCoordination();
|
|
16203
|
+
metaScope.useCoordinationByObject(scopes);
|
|
16204
|
+
views.forEach((view) => {
|
|
16205
|
+
view.useMetaCoordination(metaScope);
|
|
16206
|
+
});
|
|
16207
|
+
} else {
|
|
16208
|
+
views.forEach((view) => {
|
|
16209
|
+
view.useCoordinationByObject(scopes);
|
|
16210
|
+
});
|
|
16211
|
+
}
|
|
16212
|
+
return this;
|
|
16213
|
+
}
|
|
16073
16214
|
/**
|
|
16074
16215
|
* Set the layout of views.
|
|
16075
16216
|
* @param {VitessceConfigView|VitessceConfigViewHConcat|VitessceConfigViewVConcat} viewConcat A
|
|
@@ -16770,6 +16911,7 @@ async function generateConfig(fileUrls, hintTitle = null) {
|
|
|
16770
16911
|
});
|
|
16771
16912
|
}
|
|
16772
16913
|
export {
|
|
16914
|
+
CL as CoordinationLevel,
|
|
16773
16915
|
HINTS_CONFIG,
|
|
16774
16916
|
HINT_TYPE_TO_FILE_TYPE_MAP,
|
|
16775
16917
|
VitessceConfig,
|
|
@@ -108,7 +108,13 @@ export class VitessceConfigView {
|
|
|
108
108
|
* @returns {VitessceConfigView} This, to allow chaining.
|
|
109
109
|
*/
|
|
110
110
|
useCoordination(...args: VitessceConfigCoordinationScope[]): VitessceConfigView;
|
|
111
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Attach potentially multi-level coordination scopes to this view.
|
|
113
|
+
* @param {object} scopes A value returned by `VitessceConfig.addCoordinationByObject`.
|
|
114
|
+
* Not intended to be a manually-constructed object.
|
|
115
|
+
* @returns {VitessceConfigView} This, to allow chaining.
|
|
116
|
+
*/
|
|
117
|
+
useCoordinationByObject(scopes: object): VitessceConfigView;
|
|
112
118
|
/**
|
|
113
119
|
* Attach meta coordination scopes to this view.
|
|
114
120
|
* @param {VitessceConfigMetaCoordinationScope} metaScope A meta coordination scope instance.
|
|
@@ -189,14 +195,14 @@ export class VitessceConfigMetaCoordinationScope {
|
|
|
189
195
|
* @returns {VitessceConfigMetaCoordinationScope} This, to allow chaining.
|
|
190
196
|
*/
|
|
191
197
|
useCoordination(...args: VitessceConfigCoordinationScope[]): VitessceConfigMetaCoordinationScope;
|
|
192
|
-
useComplexCoordination(scopes: any): VitessceConfigMetaCoordinationScope;
|
|
193
198
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* @
|
|
199
|
+
* Attach potentially multi-level coordination scopes to this meta coordination
|
|
200
|
+
* scope instance.
|
|
201
|
+
* @param {object} scopes A value returned by `VitessceConfig.addCoordinationByObject`.
|
|
202
|
+
* Not intended to be a manually-constructed object.
|
|
203
|
+
* @returns {VitessceConfigView} This, to allow chaining.
|
|
197
204
|
*/
|
|
198
|
-
|
|
199
|
-
cValue: any;
|
|
205
|
+
useCoordinationByObject(scopes: object): VitessceConfigView;
|
|
200
206
|
}
|
|
201
207
|
/**
|
|
202
208
|
* Class representing a Vitessce view config.
|
|
@@ -271,8 +277,26 @@ export class VitessceConfig {
|
|
|
271
277
|
* @returns {VitessceConfigCoordinationScope[]} An array of coordination scope instances.
|
|
272
278
|
*/
|
|
273
279
|
addCoordination(...args: string[]): VitessceConfigCoordinationScope[];
|
|
280
|
+
/**
|
|
281
|
+
* Initialize a new meta coordination scope in the coordination space,
|
|
282
|
+
* and get a reference to it in the form of a meta coordination scope instance.
|
|
283
|
+
* @returns {VitessceConfigMetaCoordinationScope} A new meta coordination scope instance.
|
|
284
|
+
*/
|
|
274
285
|
addMetaCoordination(): VitessceConfigMetaCoordinationScope;
|
|
275
|
-
|
|
286
|
+
/**
|
|
287
|
+
* Set up the initial values for multi-level coordination in the coordination space.
|
|
288
|
+
* Get a reference to these values to pass to the `useCoordinationByObject` method
|
|
289
|
+
* of either view or meta coordination scope instances.
|
|
290
|
+
* @param {object} input A (potentially nested) object with coordination types as keys
|
|
291
|
+
* and values being either the initial coordination value, a `VitessceConfigCoordinationScope`
|
|
292
|
+
* instance, or a `CoordinationLevel` instance.
|
|
293
|
+
* The CL function takes an array of objects as its argument, and returns a CoordinationLevel
|
|
294
|
+
* instance, to support nesting.
|
|
295
|
+
* @returns {object} A (potentially nested) object with coordination types as keys and values
|
|
296
|
+
* being either { scope }, { scope, children }, or an array of these. Not intended to be
|
|
297
|
+
* manipulated before being passed to a `useCoordinationByObject` function.
|
|
298
|
+
*/
|
|
299
|
+
addCoordinationByObject(input: object): object;
|
|
276
300
|
/**
|
|
277
301
|
* A convenience function for setting up new coordination scopes across a set of views.
|
|
278
302
|
* @param {VitessceConfigView[]} views An array of view objects to link together.
|
|
@@ -282,6 +306,19 @@ export class VitessceConfig {
|
|
|
282
306
|
* @returns {VitessceConfig} This, to allow chaining.
|
|
283
307
|
*/
|
|
284
308
|
linkViews(views: VitessceConfigView[], cTypes: string[], cValues?: any[]): VitessceConfig;
|
|
309
|
+
/**
|
|
310
|
+
* A convenience function for setting up multi-level and meta-coordination scopes
|
|
311
|
+
* across a set of views.
|
|
312
|
+
* @param {VitessceConfigView[]} views An array of view objects to link together.
|
|
313
|
+
* @param {object} input A (potentially nested) object with coordination types as keys
|
|
314
|
+
* and values being either the initial coordination value, a `VitessceConfigCoordinationScope`
|
|
315
|
+
* instance, or a `CoordinationLevel` instance.
|
|
316
|
+
* The CL function takes an array of objects as its argument, and returns a CoordinationLevel
|
|
317
|
+
* instance, to support nesting.
|
|
318
|
+
* @param {boolean} meta Should meta-coordination be used? Optional. By default, true.
|
|
319
|
+
* @returns {VitessceConfig} This, to allow chaining.
|
|
320
|
+
*/
|
|
321
|
+
linkViewsByObject(views: VitessceConfigView[], input: object, meta?: boolean): VitessceConfig;
|
|
285
322
|
/**
|
|
286
323
|
* Set the layout of views.
|
|
287
324
|
* @param {VitessceConfigView|VitessceConfigViewHConcat|VitessceConfigViewVConcat} viewConcat A
|
|
@@ -298,6 +335,10 @@ export class VitessceConfig {
|
|
|
298
335
|
declare class CoordinationLevel {
|
|
299
336
|
constructor(value: any);
|
|
300
337
|
value: any;
|
|
338
|
+
cachedValue: any;
|
|
339
|
+
setCached(processedLevel: any): void;
|
|
340
|
+
getCached(): any;
|
|
341
|
+
isCached(): boolean;
|
|
301
342
|
}
|
|
302
343
|
export {};
|
|
303
344
|
//# sourceMappingURL=VitessceConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VitessceConfig.d.ts","sourceRoot":"","sources":["../src/VitessceConfig.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VitessceConfig.d.ts","sourceRoot":"","sources":["../src/VitessceConfig.js"],"names":[],"mappings":"AA0XA;;;;;GAKG;AACH,kCAJe,CAAC,kBAAkB,GAAC,yBAAyB,GAAC,yBAAyB,CAAC,KAE1E,yBAAyB,CAKrC;AAED;;;;;GAKG;AACH,kCAJe,CAAC,kBAAkB,GAAC,yBAAyB,GAAC,yBAAyB,CAAC,KAE1E,yBAAyB,CAKrC;AAsBD,kDAEC;AAlaD;;GAEG;AACH;IACE;;;;;;;;OAQG;IACH,iBAPW,MAAM,YAEN,MAAM,oCACN,MAAM,WAAO,IAAI,EAW3B;IANC;;;;;MAKC;IAGH;;OAEG;IACH,UAFa,MAAM,CAIlB;CACF;A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