@vitessce/config 3.4.14 → 3.5.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 +28 -7
- package/dist-tsc/VitessceConfig.d.ts +2 -1
- package/dist-tsc/VitessceConfig.d.ts.map +1 -1
- package/dist-tsc/VitessceConfig.js +26 -9
- package/package.json +4 -4
- package/src/VitessceConfig.js +29 -10
package/dist/index.js
CHANGED
|
@@ -817,7 +817,7 @@ class VitessceConfigView {
|
|
|
817
817
|
* @param {number} w The width of the view in the layout.
|
|
818
818
|
* @param {number} h The height of the view in the layout.
|
|
819
819
|
*/
|
|
820
|
-
constructor(component, coordinationScopes, x, y, w, h) {
|
|
820
|
+
constructor(component, coordinationScopes, x, y, w, h, uid) {
|
|
821
821
|
this.view = {
|
|
822
822
|
component,
|
|
823
823
|
coordinationScopes,
|
|
@@ -826,7 +826,8 @@ class VitessceConfigView {
|
|
|
826
826
|
x,
|
|
827
827
|
y,
|
|
828
828
|
w,
|
|
829
|
-
h
|
|
829
|
+
h,
|
|
830
|
+
uid
|
|
830
831
|
};
|
|
831
832
|
}
|
|
832
833
|
/**
|
|
@@ -1110,6 +1111,7 @@ class VitessceConfig {
|
|
|
1110
1111
|
y = 0,
|
|
1111
1112
|
w = 1,
|
|
1112
1113
|
h = 1,
|
|
1114
|
+
uid = void 0,
|
|
1113
1115
|
mapping = null
|
|
1114
1116
|
} = options || {};
|
|
1115
1117
|
const datasetMatches = this.config.coordinationSpace[CoordinationType.DATASET] ? Object.entries(this.config.coordinationSpace[CoordinationType.DATASET]).filter(([scopeName, datasetScope2]) => datasetScope2.cValue === dataset.dataset.uid).map(([scopeName]) => scopeName) : [];
|
|
@@ -1122,7 +1124,7 @@ class VitessceConfig {
|
|
|
1122
1124
|
const coordinationScopes = {
|
|
1123
1125
|
[CoordinationType.DATASET]: datasetScope
|
|
1124
1126
|
};
|
|
1125
|
-
const newView = new VitessceConfigView(component, coordinationScopes, x, y, w, h);
|
|
1127
|
+
const newView = new VitessceConfigView(component, coordinationScopes, x, y, w, h, uid);
|
|
1126
1128
|
if (mapping) {
|
|
1127
1129
|
const [etScope] = this.addCoordination(CoordinationType.EMBEDDING_TYPE);
|
|
1128
1130
|
etScope.setValue(mapping);
|
|
@@ -1140,9 +1142,20 @@ class VitessceConfig {
|
|
|
1140
1142
|
addCoordination(...args) {
|
|
1141
1143
|
const cTypes = args;
|
|
1142
1144
|
const result = [];
|
|
1143
|
-
cTypes.forEach((
|
|
1144
|
-
|
|
1145
|
-
|
|
1145
|
+
cTypes.forEach((cTypeOrObj) => {
|
|
1146
|
+
let cType;
|
|
1147
|
+
let cScope;
|
|
1148
|
+
let cValue;
|
|
1149
|
+
if (typeof cTypeOrObj === "string") {
|
|
1150
|
+
cType = cTypeOrObj;
|
|
1151
|
+
const prevScopes = this.config.coordinationSpace[cType] ? Object.keys(this.config.coordinationSpace[cType]) : [];
|
|
1152
|
+
cScope = this.getNextScope(prevScopes);
|
|
1153
|
+
} else {
|
|
1154
|
+
cType = cTypeOrObj.cType;
|
|
1155
|
+
cScope = cTypeOrObj.cScope;
|
|
1156
|
+
cValue = cTypeOrObj.cValue;
|
|
1157
|
+
}
|
|
1158
|
+
const scope = new VitessceConfigCoordinationScope(cType, cScope, cValue);
|
|
1146
1159
|
if (!this.config.coordinationSpace[scope.cType]) {
|
|
1147
1160
|
this.config.coordinationSpace[scope.cType] = {};
|
|
1148
1161
|
}
|
|
@@ -1396,7 +1409,15 @@ class VitessceConfig {
|
|
|
1396
1409
|
}
|
|
1397
1410
|
});
|
|
1398
1411
|
config.layout.forEach((c) => {
|
|
1399
|
-
const newView = new VitessceConfigView(
|
|
1412
|
+
const newView = new VitessceConfigView(
|
|
1413
|
+
c.component,
|
|
1414
|
+
c.coordinationScopes,
|
|
1415
|
+
c.x,
|
|
1416
|
+
c.y,
|
|
1417
|
+
c.w,
|
|
1418
|
+
c.h,
|
|
1419
|
+
c.uid
|
|
1420
|
+
);
|
|
1400
1421
|
vc.config.layout.push(newView);
|
|
1401
1422
|
});
|
|
1402
1423
|
return vc;
|
|
@@ -96,7 +96,7 @@ export class VitessceConfigView {
|
|
|
96
96
|
* @param {number} w The width of the view in the layout.
|
|
97
97
|
* @param {number} h The height of the view in the layout.
|
|
98
98
|
*/
|
|
99
|
-
constructor(component: string, coordinationScopes: object, x: number, y: number, w: number, h: number);
|
|
99
|
+
constructor(component: string, coordinationScopes: object, x: number, y: number, w: number, h: number, uid: any);
|
|
100
100
|
view: {
|
|
101
101
|
component: string;
|
|
102
102
|
coordinationScopes: object;
|
|
@@ -105,6 +105,7 @@ export class VitessceConfigView {
|
|
|
105
105
|
y: number;
|
|
106
106
|
w: number;
|
|
107
107
|
h: number;
|
|
108
|
+
uid: any;
|
|
108
109
|
};
|
|
109
110
|
/**
|
|
110
111
|
* Attach coordination scopes to this view.
|
|
@@ -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":"AA2XA;;;;;GAKG;AACH,kCAJe,CAAC,kBAAkB,GAAC,yBAAyB,GAAC,yBAAyB,CAAC,EAAA,GAE1E,yBAAyB,CAKrC;AAED;;;;;GAKG;AACH,kCAJe,CAAC,kBAAkB,GAAC,yBAAyB,GAAC,yBAAyB,CAAC,EAAA,GAE1E,yBAAyB,CAKrC;AAsBD,kDAEC;AAgmBD;;;;EAiBC;AAphCD;;GAEG;AACH;IACE;;;;;;;;OAQG;IACH,iBAPW,MAAM,YAEN,MAAM,oCACN,MAAM,GAAC,KAAK,GAAC,IAAI,EAW3B;IANC;;;;;MAKC;IAGH;;OAEG;IACH,UAFa,MAAM,CAIlB;CACF;AAED;;GAEG;AACH;IACE;;;;;OAKG;IACH,iBAJW,MAAM,QACN,MAAM,eACN,MAAM,EAShB;IANC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B;IAClB,iBAAuB;IAGzB,qCAEC;IAED,iBAEC;IAED,oBAEC;CACF"}
|
|
@@ -236,7 +236,7 @@ export class VitessceConfigView {
|
|
|
236
236
|
* @param {number} w The width of the view in the layout.
|
|
237
237
|
* @param {number} h The height of the view in the layout.
|
|
238
238
|
*/
|
|
239
|
-
constructor(component, coordinationScopes, x, y, w, h) {
|
|
239
|
+
constructor(component, coordinationScopes, x, y, w, h, uid) {
|
|
240
240
|
this.view = {
|
|
241
241
|
component,
|
|
242
242
|
coordinationScopes,
|
|
@@ -245,6 +245,7 @@ export class VitessceConfigView {
|
|
|
245
245
|
y,
|
|
246
246
|
w,
|
|
247
247
|
h,
|
|
248
|
+
uid,
|
|
248
249
|
};
|
|
249
250
|
}
|
|
250
251
|
/**
|
|
@@ -543,7 +544,7 @@ export class VitessceConfig {
|
|
|
543
544
|
* @returns {VitessceConfigView} A new view instance.
|
|
544
545
|
*/
|
|
545
546
|
addView(dataset, component, options) {
|
|
546
|
-
const { x = 0, y = 0, w = 1, h = 1, mapping = null, } = options || {};
|
|
547
|
+
const { x = 0, y = 0, w = 1, h = 1, uid = undefined, mapping = null, } = options || {};
|
|
547
548
|
const datasetMatches = (this.config.coordinationSpace[CoordinationType.DATASET]
|
|
548
549
|
? Object.entries(this.config.coordinationSpace[CoordinationType.DATASET])
|
|
549
550
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -560,7 +561,7 @@ export class VitessceConfig {
|
|
|
560
561
|
const coordinationScopes = {
|
|
561
562
|
[CoordinationType.DATASET]: datasetScope,
|
|
562
563
|
};
|
|
563
|
-
const newView = new VitessceConfigView(component, coordinationScopes, x, y, w, h);
|
|
564
|
+
const newView = new VitessceConfigView(component, coordinationScopes, x, y, w, h, uid);
|
|
564
565
|
if (mapping) {
|
|
565
566
|
const [etScope] = this.addCoordination(CoordinationType.EMBEDDING_TYPE);
|
|
566
567
|
etScope.setValue(mapping);
|
|
@@ -578,11 +579,27 @@ export class VitessceConfig {
|
|
|
578
579
|
addCoordination(...args) {
|
|
579
580
|
const cTypes = args;
|
|
580
581
|
const result = [];
|
|
581
|
-
cTypes.forEach((
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
582
|
+
cTypes.forEach((cTypeOrObj) => {
|
|
583
|
+
let cType;
|
|
584
|
+
let cScope;
|
|
585
|
+
let cValue;
|
|
586
|
+
if (typeof cTypeOrObj === 'string') {
|
|
587
|
+
cType = cTypeOrObj;
|
|
588
|
+
const prevScopes = (this.config.coordinationSpace[cType]
|
|
589
|
+
? Object.keys(this.config.coordinationSpace[cType])
|
|
590
|
+
: []);
|
|
591
|
+
cScope = this.getNextScope(prevScopes);
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
// If not a string, assume it is an object like { cType: string, cScope: string }.
|
|
595
|
+
// eslint-disable-next-line prefer-destructuring
|
|
596
|
+
cType = cTypeOrObj.cType;
|
|
597
|
+
// eslint-disable-next-line prefer-destructuring
|
|
598
|
+
cScope = cTypeOrObj.cScope;
|
|
599
|
+
// eslint-disable-next-line prefer-destructuring
|
|
600
|
+
cValue = cTypeOrObj.cValue;
|
|
601
|
+
}
|
|
602
|
+
const scope = new VitessceConfigCoordinationScope(cType, cScope, cValue);
|
|
586
603
|
if (!this.config.coordinationSpace[scope.cType]) {
|
|
587
604
|
this.config.coordinationSpace[scope.cType] = {};
|
|
588
605
|
}
|
|
@@ -925,7 +942,7 @@ export class VitessceConfig {
|
|
|
925
942
|
}
|
|
926
943
|
});
|
|
927
944
|
config.layout.forEach((c) => {
|
|
928
|
-
const newView = new VitessceConfigView(c.component, c.coordinationScopes, c.x, c.y, c.w, c.h);
|
|
945
|
+
const newView = new VitessceConfigView(c.component, c.coordinationScopes, c.x, c.y, c.w, c.h, c.uid);
|
|
929
946
|
vc.config.layout.push(newView);
|
|
930
947
|
});
|
|
931
948
|
return vc;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/config",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"author": "
|
|
3
|
+
"version": "3.5.0",
|
|
4
|
+
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"dist-tsc"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@vitessce/constants-internal": "3.
|
|
20
|
-
"@vitessce/utils": "3.
|
|
19
|
+
"@vitessce/constants-internal": "3.5.0",
|
|
20
|
+
"@vitessce/utils": "3.5.0"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"bundle": "pnpm exec vite build -c ../../scripts/vite.config.js",
|
package/src/VitessceConfig.js
CHANGED
|
@@ -252,7 +252,7 @@ export class VitessceConfigView {
|
|
|
252
252
|
* @param {number} w The width of the view in the layout.
|
|
253
253
|
* @param {number} h The height of the view in the layout.
|
|
254
254
|
*/
|
|
255
|
-
constructor(component, coordinationScopes, x, y, w, h) {
|
|
255
|
+
constructor(component, coordinationScopes, x, y, w, h, uid) {
|
|
256
256
|
this.view = {
|
|
257
257
|
component,
|
|
258
258
|
coordinationScopes,
|
|
@@ -261,6 +261,7 @@ export class VitessceConfigView {
|
|
|
261
261
|
y,
|
|
262
262
|
w,
|
|
263
263
|
h,
|
|
264
|
+
uid,
|
|
264
265
|
};
|
|
265
266
|
}
|
|
266
267
|
|
|
@@ -599,6 +600,7 @@ export class VitessceConfig {
|
|
|
599
600
|
y = 0,
|
|
600
601
|
w = 1,
|
|
601
602
|
h = 1,
|
|
603
|
+
uid = undefined,
|
|
602
604
|
mapping = null,
|
|
603
605
|
} = options || {};
|
|
604
606
|
const datasetMatches = (
|
|
@@ -618,7 +620,7 @@ export class VitessceConfig {
|
|
|
618
620
|
const coordinationScopes = {
|
|
619
621
|
[CoordinationType.DATASET]: datasetScope,
|
|
620
622
|
};
|
|
621
|
-
const newView = new VitessceConfigView(component, coordinationScopes, x, y, w, h);
|
|
623
|
+
const newView = new VitessceConfigView(component, coordinationScopes, x, y, w, h, uid);
|
|
622
624
|
if (mapping) {
|
|
623
625
|
const [etScope] = this.addCoordination(CoordinationType.EMBEDDING_TYPE);
|
|
624
626
|
etScope.setValue(mapping);
|
|
@@ -637,13 +639,28 @@ export class VitessceConfig {
|
|
|
637
639
|
addCoordination(...args) {
|
|
638
640
|
const cTypes = args;
|
|
639
641
|
const result = [];
|
|
640
|
-
cTypes.forEach((
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
642
|
+
cTypes.forEach((cTypeOrObj) => {
|
|
643
|
+
let cType;
|
|
644
|
+
let cScope;
|
|
645
|
+
let cValue;
|
|
646
|
+
if (typeof cTypeOrObj === 'string') {
|
|
647
|
+
cType = cTypeOrObj;
|
|
648
|
+
const prevScopes = (
|
|
649
|
+
this.config.coordinationSpace[cType]
|
|
650
|
+
? Object.keys(this.config.coordinationSpace[cType])
|
|
651
|
+
: []
|
|
652
|
+
);
|
|
653
|
+
cScope = this.getNextScope(prevScopes);
|
|
654
|
+
} else {
|
|
655
|
+
// If not a string, assume it is an object like { cType: string, cScope: string }.
|
|
656
|
+
// eslint-disable-next-line prefer-destructuring
|
|
657
|
+
cType = cTypeOrObj.cType;
|
|
658
|
+
// eslint-disable-next-line prefer-destructuring
|
|
659
|
+
cScope = cTypeOrObj.cScope;
|
|
660
|
+
// eslint-disable-next-line prefer-destructuring
|
|
661
|
+
cValue = cTypeOrObj.cValue;
|
|
662
|
+
}
|
|
663
|
+
const scope = new VitessceConfigCoordinationScope(cType, cScope, cValue);
|
|
647
664
|
if (!this.config.coordinationSpace[scope.cType]) {
|
|
648
665
|
this.config.coordinationSpace[scope.cType] = {};
|
|
649
666
|
}
|
|
@@ -1002,7 +1019,9 @@ export class VitessceConfig {
|
|
|
1002
1019
|
}
|
|
1003
1020
|
});
|
|
1004
1021
|
config.layout.forEach((c) => {
|
|
1005
|
-
const newView = new VitessceConfigView(
|
|
1022
|
+
const newView = new VitessceConfigView(
|
|
1023
|
+
c.component, c.coordinationScopes, c.x, c.y, c.w, c.h, c.uid,
|
|
1024
|
+
);
|
|
1006
1025
|
vc.config.layout.push(newView);
|
|
1007
1026
|
});
|
|
1008
1027
|
return vc;
|