@abi-software/mapintegratedvuer 1.1.1 → 1.2.0-beta.2
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/{ContentMixin-mZX2duoM.js → ContentMixin-B6Dt-gIO.js} +5 -5
- package/dist/{Flatmap-9QQ19krS.js → Flatmap-BXFp07NV.js} +7 -7
- package/dist/{Iframe-c0h0PhkG.js → Iframe-V17rWVEo.js} +2 -2
- package/dist/{MultiFlatmap-ft_NGtN3.js → MultiFlatmap-IPV-kW9S.js} +22 -20
- package/dist/{Plot-BmyzQ7ix.js → Plot-gbrHVZqT.js} +2 -2
- package/dist/{Scaffold-B7UCL6S4.js → Scaffold-iZP8Wbdq.js} +5 -5
- package/dist/{Simulation-OLJ83BaS.js → Simulation-nCrQs5q-.js} +2 -2
- package/dist/{flatmapvuer-BAx-xO4L.js → flatmapvuer-DR46R-h5.js} +41890 -36875
- package/dist/{index-nmieCwQF.js → index-B4DnOYh7.js} +11302 -11479
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +530 -583
- package/dist/style-DirL9q7N.js +53 -0
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/components/SplitFlow.vue +18 -8
- package/src/components/viewers/Flatmap.vue +1 -1
- package/src/components/viewers/MultiFlatmap.vue +16 -15
- package/src/components/viewers/Scaffold.vue +1 -1
- package/src/mixins/ContentMixin.js +4 -2
- package/src/mixins/DynamicMarkerMixin.js +36 -45
- package/src/stores/settings.js +5 -3
- package/dist/style-UwGHggI4.js +0 -62
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@abi-software/mapintegratedvuer",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.2.0-beta.2",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"scripts": {
|
6
6
|
"serve": "vite --host --force",
|
@@ -48,8 +48,8 @@
|
|
48
48
|
"*.js"
|
49
49
|
],
|
50
50
|
"dependencies": {
|
51
|
-
"@abi-software/flatmapvuer": "1.1.
|
52
|
-
"@abi-software/map-side-bar": "^2.2.
|
51
|
+
"@abi-software/flatmapvuer": "^1.1.2-alpha-3",
|
52
|
+
"@abi-software/map-side-bar": "^2.2.1-alpha-3",
|
53
53
|
"@abi-software/plotvuer": "1.0.0",
|
54
54
|
"@abi-software/scaffoldvuer": "^1.1.0",
|
55
55
|
"@abi-software/simulationvuer": "1.0.0",
|
@@ -28,6 +28,8 @@
|
|
28
28
|
@actionClick="actionClick"
|
29
29
|
@tabClicked="tabClicked"
|
30
30
|
@search-changed="searchChanged($event)"
|
31
|
+
@anatomy-in-datasets="updateMarkers($event)"
|
32
|
+
@number-of-datasets-for-anatomies="updateScaffoldMarkers($event)"
|
31
33
|
@hover-changed="hoverChanged($event)"
|
32
34
|
@contextUpdate="contextUpdate($event)"
|
33
35
|
@datalink-clicked="datalinkClicked($event)"
|
@@ -93,6 +95,7 @@ export default {
|
|
93
95
|
startUp: true,
|
94
96
|
search: '',
|
95
97
|
activeDockedId : 1,
|
98
|
+
hoveredMarkerDelay: undefined,
|
96
99
|
filterTriggered: false,
|
97
100
|
availableFacets: [],
|
98
101
|
}
|
@@ -257,7 +260,14 @@ export default {
|
|
257
260
|
hoverChanged: function (data) {
|
258
261
|
const hoverEntries = data && data.anatomy ? data.anatomy : []
|
259
262
|
this.settingsStore.updateHoveredMarkers(hoverEntries);
|
260
|
-
|
263
|
+
if (!hoverEntries.length) {
|
264
|
+
this.hoveredMarkerDelay = setTimeout(() => {
|
265
|
+
EventBus.emit("markerUpdate");
|
266
|
+
}, 500)
|
267
|
+
} else {
|
268
|
+
clearTimeout(this.hoveredMarkerDelay)
|
269
|
+
EventBus.emit("markerUpdate");
|
270
|
+
}
|
261
271
|
},
|
262
272
|
searchChanged: function (data) {
|
263
273
|
if (data && data.type == "query-update") {
|
@@ -296,13 +306,13 @@ export default {
|
|
296
306
|
}
|
297
307
|
this.filterTriggered = false; // reset for next action
|
298
308
|
}
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
309
|
+
},
|
310
|
+
updateMarkers: function (data) {
|
311
|
+
this.settingsStore.updateMarkers(data);
|
312
|
+
EventBus.emit("markerUpdate");
|
313
|
+
},
|
314
|
+
updateScaffoldMarkers: function (data) {
|
315
|
+
this.settingsStore.updateNumberOfDatasetsForFacets(data);
|
306
316
|
},
|
307
317
|
getNewEntryId: function() {
|
308
318
|
if (this.entries.length) {
|
@@ -155,7 +155,6 @@ export default {
|
|
155
155
|
payload: payload,
|
156
156
|
type: this.entry.type,
|
157
157
|
};
|
158
|
-
this.flatmapMarkerZoomUpdate(false, undefined);
|
159
158
|
this.$emit("resource-selected", result);
|
160
159
|
}
|
161
160
|
},
|
@@ -245,7 +244,6 @@ export default {
|
|
245
244
|
this.$refs.multiflatmap
|
246
245
|
.getCurrentFlatmap()
|
247
246
|
.mapImp.panZoomTo(origin, [sW, sH]);
|
248
|
-
this.flatmapMarkerZoomUpdate(false, undefined);
|
249
247
|
}
|
250
248
|
}
|
251
249
|
},
|
@@ -322,7 +320,7 @@ export default {
|
|
322
320
|
flatmap.enablePanZoomEvents(true); // Use zoom events for dynamic markers
|
323
321
|
this.flatmapReady = true;
|
324
322
|
const flatmapImp = flatmap.mapImp;
|
325
|
-
this.
|
323
|
+
this.flatmapMarkerUpdate(flatmapImp);
|
326
324
|
this.updateProvCard();
|
327
325
|
}
|
328
326
|
},
|
@@ -344,11 +342,13 @@ export default {
|
|
344
342
|
EventBus.emit("PopoverActionClick", returnedAction);
|
345
343
|
},
|
346
344
|
restoreFeaturedMarkers: function (flatmap) {
|
345
|
+
|
347
346
|
this.settingsStore.resetFeaturedMarkerIdentifier();
|
348
347
|
const markers = this.settingsStore.featuredMarkers;
|
349
|
-
this.
|
348
|
+
this.updateFeaturedMarkers(markers, flatmap);
|
350
349
|
},
|
351
|
-
|
350
|
+
// updateFeaturedMarkers will step through the featured markers and add them to the map
|
351
|
+
updateFeaturedMarkers: function (markers, flatmap) {
|
352
352
|
this.showStarInLegend = false; // will show if we have a featured marker
|
353
353
|
for (let index = 0; index < markers.length; ++index) {
|
354
354
|
if (markers[index]) {
|
@@ -364,6 +364,7 @@ export default {
|
|
364
364
|
}
|
365
365
|
}
|
366
366
|
},
|
367
|
+
// addFeaturedMarker: add a featured marker to the map at the specified uberon location
|
367
368
|
addFeaturedMarker: function (marker, index, flatmap) {
|
368
369
|
const markerSpecies =
|
369
370
|
this.settingsStore.featuredMarkerSpecies[index];
|
@@ -415,7 +416,7 @@ export default {
|
|
415
416
|
return;
|
416
417
|
}
|
417
418
|
|
418
|
-
this.
|
419
|
+
this.updateFeaturedMarkers(markers, undefined);
|
419
420
|
},
|
420
421
|
},
|
421
422
|
mounted: function () {
|
@@ -423,7 +424,9 @@ export default {
|
|
423
424
|
this.getFeaturedDatasets();
|
424
425
|
|
425
426
|
EventBus.on("markerUpdate", () => {
|
426
|
-
this.
|
427
|
+
if (this.flatmapReady) {
|
428
|
+
this.flatmapMarkerUpdate(this.$refs.multiflatmap.getCurrentFlatmap().mapImp);
|
429
|
+
}
|
427
430
|
});
|
428
431
|
},
|
429
432
|
};
|
@@ -446,6 +449,12 @@ export default {
|
|
446
449
|
cursor: pointer !important;
|
447
450
|
z-index: 2;
|
448
451
|
}
|
452
|
+
&.hovered {
|
453
|
+
div {
|
454
|
+
scale: 2;
|
455
|
+
transform: translate(0px, -5px);
|
456
|
+
}
|
457
|
+
}
|
449
458
|
&.highlight-marker {
|
450
459
|
visibility: visible !important;
|
451
460
|
cursor: pointer !important;
|
@@ -455,14 +464,6 @@ export default {
|
|
455
464
|
transform: translate(45px, -7px);
|
456
465
|
}
|
457
466
|
}
|
458
|
-
&.hovered-marker {
|
459
|
-
cursor: pointer !important;
|
460
|
-
z-index: 2;
|
461
|
-
div {
|
462
|
-
scale: 2;
|
463
|
-
transform: translate(0px, -5px);
|
464
|
-
}
|
465
|
-
}
|
466
467
|
}
|
467
468
|
|
468
469
|
</style>
|
@@ -268,6 +268,7 @@ export default {
|
|
268
268
|
}
|
269
269
|
return { id, name };
|
270
270
|
},
|
271
|
+
// Get the species and andaotmy info for the featured datasets
|
271
272
|
getDatasetAnatomyInfo: function (identifier) {
|
272
273
|
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${identifier}`)
|
273
274
|
.then(response => response.json())
|
@@ -300,7 +301,8 @@ export default {
|
|
300
301
|
} catch (error) {
|
301
302
|
markerSpecies = undefined;
|
302
303
|
}
|
303
|
-
|
304
|
+
// can test the featured marker by uncommenting the line below:
|
305
|
+
// markerSpecies = "Rat"
|
304
306
|
this.settingsStore.updateFeaturedMarker({
|
305
307
|
identifier,
|
306
308
|
marker: markerCurie,
|
@@ -412,7 +414,7 @@ export default {
|
|
412
414
|
});
|
413
415
|
}
|
414
416
|
},
|
415
|
-
|
417
|
+
flatmapMarkerUpdate() {
|
416
418
|
return;
|
417
419
|
},
|
418
420
|
onResize: function () {
|
@@ -4,36 +4,13 @@ import { mapStores } from 'pinia';
|
|
4
4
|
import { useSettingsStore } from '../stores/settings';
|
5
5
|
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
markers.forEach(id => {
|
15
|
-
let foundInArray = false;
|
16
|
-
// First check if uberon is in the list, check for zoom level
|
17
|
-
// if true. Note: markerZoomLevels is imported.
|
18
|
-
for (let i = 0; i < markerZoomLevels.length; i++) {
|
19
|
-
if (markerZoomLevels[i].id === id) {
|
20
|
-
foundInArray = true;
|
21
|
-
if (zoomLevel >= markerZoomLevels[i].showAtZoom) {
|
22
|
-
let markerClass = "standard-marker"
|
23
|
-
if (hoveredMarkers.includes(id)) markerClass = "hovered-marker"
|
24
|
-
flatmapImp.addMarker(id, { className: markerClass, cluster: false});
|
25
|
-
}
|
26
|
-
break;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
// Did not match, add it regardless so we do not lose any
|
30
|
-
// markers.
|
31
|
-
if (!foundInArray) {
|
32
|
-
flatmapImp.addMarker(id, {className: "standard-marker", cluster: false});
|
33
|
-
}
|
34
|
-
});
|
35
|
-
}
|
36
|
-
};
|
7
|
+
// remove duplicates by stringifying the objects
|
8
|
+
const removeDuplicates = function (arrayOfAnything) {
|
9
|
+
if (!arrayOfAnything) return []
|
10
|
+
return [...new Set(arrayOfAnything.map((e) => JSON.stringify(e)))].map((e) =>
|
11
|
+
JSON.parse(e)
|
12
|
+
)
|
13
|
+
}
|
37
14
|
|
38
15
|
/* eslint-disable no-alert, no-console */
|
39
16
|
export default {
|
@@ -49,16 +26,14 @@ export default {
|
|
49
26
|
payload: payload,
|
50
27
|
type: this.entry.type,
|
51
28
|
};
|
52
|
-
this.flatmapMarkerZoomUpdate(false, undefined);
|
53
29
|
this.$emit("resource-selected", result);
|
54
30
|
}
|
55
31
|
},
|
56
32
|
/**
|
57
33
|
* Function used for updating the flatmap markers.
|
58
|
-
*
|
59
|
-
* the force flag is true.
|
34
|
+
* We set the markers based on what was searched and the flatmap clusters them.
|
60
35
|
*/
|
61
|
-
|
36
|
+
flatmapMarkerUpdate(flatmap) {
|
62
37
|
if (!this.flatmapReady) return;
|
63
38
|
|
64
39
|
let flatmapImp = flatmap;
|
@@ -66,16 +41,32 @@ export default {
|
|
66
41
|
flatmapImp = this.getFlatmapImp();
|
67
42
|
|
68
43
|
if (flatmapImp) {
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
44
|
+
// Set the dataset markers
|
45
|
+
let markers = this.settingsStore.markers;
|
46
|
+
markers = removeDuplicates(markers);
|
47
|
+
flatmapImp.clearMarkers();
|
48
|
+
flatmapImp.clearDatasetMarkers();
|
49
|
+
flatmapImp.addDatasetMarkers(markers);
|
50
|
+
|
51
|
+
// Set the hovered markers
|
52
|
+
let hoveredMarkers = this.settingsStore.hoveredMarkers
|
53
|
+
let previousHoveredMarkers = this.settingsStore.previousHoveredMarkers
|
54
|
+
hoveredMarkers.forEach(id => {
|
55
|
+
let markerClass = "standard-marker" + " hovered" // Space-separated CSS class names
|
56
|
+
let markerCluster = false // Disable cluster when related dataset is hovered
|
57
|
+
flatmapImp.addMarker(id, { className: markerClass, cluster: markerCluster })
|
58
|
+
})
|
59
|
+
if (previousHoveredMarkers !== null && previousHoveredMarkers.length >= 0) {
|
60
|
+
previousHoveredMarkers.forEach(id => {
|
61
|
+
let markerClass = "standard-marker"
|
62
|
+
let markerCluster = true
|
63
|
+
flatmapImp.addMarker(id, { className: markerClass, cluster: markerCluster })
|
64
|
+
})
|
65
|
+
}
|
66
|
+
|
67
|
+
// Set the featured markers
|
68
|
+
if (this.entry.type === "MultiFlatmap") {
|
69
|
+
this.restoreFeaturedMarkers(flatmapImp);
|
79
70
|
}
|
80
71
|
}
|
81
72
|
},
|
@@ -84,7 +75,7 @@ export default {
|
|
84
75
|
flatmap.enablePanZoomEvents(true); // Use zoom events for dynamic markers
|
85
76
|
this.flatmapReady = true;
|
86
77
|
const flatmapImp = flatmap.mapImp;
|
87
|
-
this.
|
78
|
+
this.flatmapMarkerUpdate(flatmapImp);
|
88
79
|
}
|
89
80
|
},
|
90
81
|
}
|
package/src/stores/settings.js
CHANGED
@@ -15,9 +15,10 @@ export const useSettingsStore = defineStore('settings', {
|
|
15
15
|
nlLinkPrefix: undefined,
|
16
16
|
rootUrl: undefined,
|
17
17
|
facets: { species: [], gender: [], organ: [] },
|
18
|
-
|
18
|
+
numberOfDatasetsForFacets: [],
|
19
19
|
markers: [],
|
20
20
|
hoveredMarkers: [],
|
21
|
+
previousHoveredMarkers: null,
|
21
22
|
featuredMarkers: [],
|
22
23
|
featuredMarkerIdentifiers: [],
|
23
24
|
featuredMarkerDois: [],
|
@@ -70,6 +71,7 @@ export const useSettingsStore = defineStore('settings', {
|
|
70
71
|
this.markers = markers;
|
71
72
|
},
|
72
73
|
updateHoveredMarkers(markers) {
|
74
|
+
this.previousHoveredMarkers = this.hoveredMarkers;
|
73
75
|
this.hoveredMarkers = markers;
|
74
76
|
},
|
75
77
|
updateFeatured(datasetIdentifiers) {
|
@@ -142,8 +144,8 @@ export const useSettingsStore = defineStore('settings', {
|
|
142
144
|
}
|
143
145
|
}
|
144
146
|
},
|
145
|
-
|
146
|
-
this.
|
147
|
+
updateNumberOfDatasetsForFacets(numberOfDatasetsForFacets) {
|
148
|
+
this.numberOfDatasetsForFacets = numberOfDatasetsForFacets;
|
147
149
|
},
|
148
150
|
updateUseHelpModeDialog(helpModeOption) {
|
149
151
|
this.useHelpModeDialog = helpModeOption;
|
package/dist/style-UwGHggI4.js
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
import { m as i } from "./ContentMixin-mZX2duoM.js";
|
2
|
-
import { mapStores as n } from "pinia";
|
3
|
-
import { u as f } from "./index-nmieCwQF.js";
|
4
|
-
const p = (e, r, t, o) => {
|
5
|
-
r && r.forEach((a) => {
|
6
|
-
let s = !1;
|
7
|
-
for (let m = 0; m < i.length; m++)
|
8
|
-
if (i[m].id === a) {
|
9
|
-
if (s = !0, t >= i[m].showAtZoom) {
|
10
|
-
let l = "standard-marker";
|
11
|
-
o.includes(a) && (l = "hovered-marker"), e.addMarker(a, { className: l, cluster: !1 });
|
12
|
-
}
|
13
|
-
break;
|
14
|
-
}
|
15
|
-
s || e.addMarker(a, { className: "standard-marker", cluster: !1 });
|
16
|
-
});
|
17
|
-
}, k = {
|
18
|
-
computed: {
|
19
|
-
...n(f)
|
20
|
-
},
|
21
|
-
methods: {
|
22
|
-
flatmapPanZoomCallback: function(e) {
|
23
|
-
if (this.mouseHovered) {
|
24
|
-
const r = {
|
25
|
-
paneIndex: this.entry.id,
|
26
|
-
eventType: "panZoom",
|
27
|
-
payload: e,
|
28
|
-
type: this.entry.type
|
29
|
-
};
|
30
|
-
this.flatmapMarkerZoomUpdate(!1, void 0), this.$emit("resource-selected", r);
|
31
|
-
}
|
32
|
-
},
|
33
|
-
/**
|
34
|
-
* Function used for updating the flatmap markers.
|
35
|
-
* It will only update the markers if zoom level has changed or
|
36
|
-
* the force flag is true.
|
37
|
-
*/
|
38
|
-
flatmapMarkerZoomUpdate(e, r) {
|
39
|
-
if (!this.flatmapReady)
|
40
|
-
return;
|
41
|
-
let t = r;
|
42
|
-
if (t || (t = this.getFlatmapImp()), t) {
|
43
|
-
let o = t.getZoom().zoom;
|
44
|
-
if (e || this.zoomLevel !== o) {
|
45
|
-
this.zoomLevel = o, t.clearMarkers();
|
46
|
-
let a = this.settingsStore.markers, s = this.settingsStore.hoveredMarkers;
|
47
|
-
p(t, a, this.zoomLevel, s), this.entry.type === "MultiFlatmap" && this.restoreFeaturedMarkers(t);
|
48
|
-
}
|
49
|
-
}
|
50
|
-
},
|
51
|
-
flatmapReadyForMarkerUpdates: function(e) {
|
52
|
-
if (e) {
|
53
|
-
e.enablePanZoomEvents(!0), this.flatmapReady = !0;
|
54
|
-
const r = e.mapImp;
|
55
|
-
this.flatmapMarkerZoomUpdate(!0, r);
|
56
|
-
}
|
57
|
-
}
|
58
|
-
}
|
59
|
-
};
|
60
|
-
export {
|
61
|
-
k as D
|
62
|
-
};
|