@abi-software/mapintegratedvuer 1.7.2 → 1.8.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/{ContentMixin-CdE8AlUJ.js → ContentMixin-C2qirqOb.js} +51 -32
- package/dist/{Flatmap-fO2lvKFX.js → Flatmap-DhRfy22j.js} +58 -55
- package/dist/{Iframe-C8wxLuOy.js → Iframe-D950SSLF.js} +2 -2
- package/dist/{MultiFlatmap-Dijv5l_F.js → MultiFlatmap-DZCpHYe8.js} +10 -5
- package/dist/{Plot-iXTevaO7.js → Plot-CJkqVQ9B.js} +2 -2
- package/dist/{Scaffold-_QafxYws.js → Scaffold-qgEXkDkn.js} +14560 -14514
- package/dist/{Simulation-CJ-9g74P.js → Simulation-kw9PXVaE.js} +2 -2
- package/dist/{index-DcTjoXV1.js → index-BphdIf2T.js} +13394 -13147
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +471 -467
- package/dist/{style-C2GyLbPa.js → style-9eo2qwu6.js} +22832 -25530
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/src/App.vue +49 -17
- package/src/components/DialogToolbarContent.vue +18 -1
- package/src/components/MapContent.vue +65 -39
- package/src/components/SplitFlow.vue +8 -7
- package/src/components/viewers/Flatmap.vue +7 -1
- package/src/components/viewers/MultiFlatmap.vue +10 -1
- package/src/components/viewers/Scaffold.vue +2 -2
- package/src/mixins/ContentMixin.js +55 -5
- package/src/mixins/DynamicMarkerMixin.js +1 -1
- package/src/stores/settings.js +28 -5
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@abi-software/mapintegratedvuer",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.8.0",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"scripts": {
|
6
6
|
"serve": "vite --host --force",
|
@@ -50,11 +50,11 @@
|
|
50
50
|
"*.js"
|
51
51
|
],
|
52
52
|
"dependencies": {
|
53
|
-
"@abi-software/flatmapvuer": "1.
|
54
|
-
"@abi-software/map-side-bar": "2.
|
55
|
-
"@abi-software/map-utilities": "1.
|
53
|
+
"@abi-software/flatmapvuer": "^1.8.0",
|
54
|
+
"@abi-software/map-side-bar": "^2.7.1",
|
55
|
+
"@abi-software/map-utilities": "^1.4.0",
|
56
56
|
"@abi-software/plotvuer": "^1.0.3",
|
57
|
-
"@abi-software/scaffoldvuer": "1.
|
57
|
+
"@abi-software/scaffoldvuer": "^1.8.0",
|
58
58
|
"@abi-software/simulationvuer": "1.0.1",
|
59
59
|
"@abi-software/sparc-annotation": "0.3.2",
|
60
60
|
"@abi-software/svg-sprite": "^1.0.1",
|
package/src/App.vue
CHANGED
@@ -11,18 +11,21 @@
|
|
11
11
|
:teleported=false
|
12
12
|
>
|
13
13
|
<div class="options-container">
|
14
|
-
<
|
14
|
+
<div class="row">
|
15
15
|
<el-button @click="saveSettings()" size="small">Save Settings</el-button>
|
16
16
|
<el-button @click="restoreSettings()" size="small">Restore Settings</el-button>
|
17
17
|
<el-button @click="getShareableURL()" size="small">Get Link</el-button>
|
18
|
-
</
|
19
|
-
<
|
18
|
+
</div>
|
19
|
+
<div class="row">
|
20
20
|
<el-button @click="setMultiFlatmap()" size="small">Set MultiFlatmap</el-button>
|
21
21
|
<el-button @click="setLegacyMultiFlatmap()" size="small">Set Legacy MultiFlatmap</el-button>
|
22
22
|
<el-button @click="setScaffold()" size="small">Set To Scaffold</el-button>
|
23
|
+
<el-button @click="setWholebody()" size="small">Set to Wholebody</el-button>
|
23
24
|
<el-button @click="setFlatmap()" size="small">Set Flatmap</el-button>
|
24
25
|
<el-button @click="setSearch()" size="small">Set Search</el-button>
|
25
|
-
|
26
|
+
<el-button @click="toggleHighlightConnectedPaths()" size="small">Toggle Highlight Connected Paths</el-button>
|
27
|
+
<el-button @click="toggleHighlightDOIPaths()" size="small">Toggle Highlight DOI Paths</el-button>
|
28
|
+
</div>
|
26
29
|
</div>
|
27
30
|
<template #reference>
|
28
31
|
|
@@ -40,6 +43,7 @@
|
|
40
43
|
:shareLink="shareLink"
|
41
44
|
:useHelpModeDialog="true"
|
42
45
|
:connectivityInfoSidebar="true"
|
46
|
+
:hoverHighlightOptions="hoverHighlightOptions"
|
43
47
|
@updateShareLinkRequested="updateUUID"
|
44
48
|
@isReady="viewerIsReady"
|
45
49
|
@mapLoaded="mapIsLoaded"
|
@@ -77,13 +81,17 @@ export default {
|
|
77
81
|
api: import.meta.env.VITE_API_LOCATION,
|
78
82
|
mapSettings: [],
|
79
83
|
startingMap: "AC",
|
80
|
-
ElIconSetting: shallowRef(ElIconSetting)
|
84
|
+
ElIconSetting: shallowRef(ElIconSetting),
|
85
|
+
hoverHighlightOptions: {
|
86
|
+
highlightConnectedPaths: true,
|
87
|
+
highlightDOIPaths: false,
|
88
|
+
},
|
81
89
|
}
|
82
90
|
},
|
83
91
|
computed: {
|
84
92
|
shareLink: function() {
|
85
93
|
if (this.uuid)
|
86
|
-
return this.prefix +"
|
94
|
+
return this.prefix +"#/?id=" + this.uuid;
|
87
95
|
return this.prefix;
|
88
96
|
},
|
89
97
|
options: function() {
|
@@ -96,7 +104,6 @@ export default {
|
|
96
104
|
flatmapAPI: import.meta.env.VITE_FLATMAPAPI_LOCATION,
|
97
105
|
nlLinkPrefix: import.meta.env.VITE_NL_LINK_PREFIX,
|
98
106
|
rootUrl: import.meta.env.VITE_ROOT_URL,
|
99
|
-
flatmapAPI2: import.meta.env.VITE_FLATMAPAPI_LOCATION2,
|
100
107
|
}
|
101
108
|
}
|
102
109
|
},
|
@@ -166,9 +173,24 @@ export default {
|
|
166
173
|
}
|
167
174
|
);
|
168
175
|
},
|
176
|
+
setWholebody: function() {
|
177
|
+
this.$refs.map.setCurrentEntry(
|
178
|
+
{
|
179
|
+
type: "Scaffold",
|
180
|
+
label: "Human",
|
181
|
+
isBodyScaffold: true
|
182
|
+
}
|
183
|
+
);
|
184
|
+
},
|
169
185
|
setSearch: function() {
|
170
186
|
this.$refs.map.openSearch([], "10.26275/1uno-tynt");
|
171
187
|
},
|
188
|
+
toggleHighlightConnectedPaths: function () {
|
189
|
+
this.hoverHighlightOptions.highlightConnectedPaths = !this.hoverHighlightOptions.highlightConnectedPaths;
|
190
|
+
},
|
191
|
+
toggleHighlightDOIPaths: function () {
|
192
|
+
this.hoverHighlightOptions.highlightDOIPaths = !this.hoverHighlightOptions.highlightDOIPaths;
|
193
|
+
},
|
172
194
|
mapIsLoaded: function(map) {
|
173
195
|
console.log("map is loaded", map)
|
174
196
|
// map.changeViewingMode('Annotation')
|
@@ -206,11 +228,15 @@ export default {
|
|
206
228
|
</script>
|
207
229
|
|
208
230
|
<style lang="scss">
|
231
|
+
$button-container-size: 50px;
|
232
|
+
$gap: 24px;
|
233
|
+
|
209
234
|
#app {
|
210
235
|
height:100%;
|
211
236
|
width: 100%;
|
212
237
|
position:absolute;
|
213
238
|
font-family: "Asap",sans-serif;
|
239
|
+
background-color: #f5f7fa;
|
214
240
|
--el-color-primary: #8300BF;
|
215
241
|
--el-color-primary-light-7: #dab3ec;
|
216
242
|
--el-color-primary-light-8: #e6ccf2;
|
@@ -222,14 +248,13 @@ body {
|
|
222
248
|
}
|
223
249
|
|
224
250
|
.map-app {
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
margin-top:20px;
|
229
|
-
margin-left:26px;
|
230
|
-
margin-right:26px;
|
251
|
+
margin: 0 auto;
|
252
|
+
width: calc(100% - #{$gap * 2});
|
253
|
+
height: calc(100% - #{$button-container-size + $gap});
|
231
254
|
border: solid 1px #dcdfe6;
|
232
255
|
box-shadow: 0 1px 8px 0 rgba(0, 0, 0, 0.06);
|
256
|
+
box-sizing: border-box;
|
257
|
+
position: relative;
|
233
258
|
}
|
234
259
|
|
235
260
|
.popover{
|
@@ -240,9 +265,16 @@ body {
|
|
240
265
|
}
|
241
266
|
|
242
267
|
.row {
|
243
|
-
|
244
|
-
|
245
|
-
|
268
|
+
display: flex;
|
269
|
+
flex-wrap: wrap;
|
270
|
+
gap: 12px;
|
271
|
+
|
272
|
+
+ .row {
|
273
|
+
margin-top: 12px;
|
274
|
+
}
|
275
|
+
|
276
|
+
.el-button + .el-button {
|
277
|
+
margin: 0;
|
246
278
|
}
|
247
279
|
}
|
248
280
|
|
@@ -250,7 +282,7 @@ body {
|
|
250
282
|
display: flex;
|
251
283
|
align-items: center;
|
252
284
|
justify-content: center;
|
253
|
-
height:
|
285
|
+
height: $button-container-size;
|
254
286
|
}
|
255
287
|
|
256
288
|
|
@@ -265,10 +265,23 @@ export default {
|
|
265
265
|
failedSearch: undefined,
|
266
266
|
activeViewRef: undefined,
|
267
267
|
permalinkRef: undefined,
|
268
|
-
ElIconCopyDocument: shallowRef(ElIconCopyDocument)
|
268
|
+
ElIconCopyDocument: shallowRef(ElIconCopyDocument),
|
269
269
|
}
|
270
270
|
},
|
271
271
|
methods: {
|
272
|
+
updateGlobalSettings: function(globalSettings) {
|
273
|
+
this.settingsStore.updateGlobalSettings(globalSettings)
|
274
|
+
},
|
275
|
+
setDisplayMarkerFlag: function(displayMarker) {
|
276
|
+
if (displayMarker !== undefined) {
|
277
|
+
let incomingSettings = { displayMarker };
|
278
|
+
const updatedSettings = this.settingsStore.getUpdatedGlobalSettingsKey(incomingSettings);
|
279
|
+
if (updatedSettings.includes('displayMarker')) {
|
280
|
+
this.settingsStore.updateGlobalSettings(incomingSettings);
|
281
|
+
EventBus.emit("markerUpdate");
|
282
|
+
}
|
283
|
+
}
|
284
|
+
},
|
272
285
|
titleClicked: function(id) {
|
273
286
|
this.$emit("titleClicked", id);
|
274
287
|
},
|
@@ -452,6 +465,9 @@ export default {
|
|
452
465
|
top:2px;
|
453
466
|
left: calc(50% - 60px);
|
454
467
|
position: absolute;
|
468
|
+
display: flex;
|
469
|
+
align-items: center;
|
470
|
+
|
455
471
|
.sync-help {
|
456
472
|
left:5px;
|
457
473
|
stroke: $app-primary-color;
|
@@ -465,6 +481,7 @@ export default {
|
|
465
481
|
border: 1px solid rgb(220, 223, 230);
|
466
482
|
vertical-align: super;
|
467
483
|
height: 28px;
|
484
|
+
box-sizing: border-box;
|
468
485
|
}
|
469
486
|
|
470
487
|
.sync-help {
|
@@ -27,7 +27,7 @@ import { useSettingsStore } from '../stores/settings';
|
|
27
27
|
import { useSplitFlowStore } from '../stores/splitFlow';
|
28
28
|
import { findSpeciesKey } from './scripts/utilities.js';
|
29
29
|
import { MapSvgSpriteColor} from '@abi-software/svg-sprite';
|
30
|
-
import { initialState } from "./scripts/utilities.js";
|
30
|
+
import { initialState, getBodyScaffoldInfo } from "./scripts/utilities.js";
|
31
31
|
import RetrieveContextCardMixin from "../mixins/RetrieveContextCardMixin.js"
|
32
32
|
import {
|
33
33
|
ElLoading as Loading
|
@@ -99,6 +99,17 @@ export default {
|
|
99
99
|
type: Boolean,
|
100
100
|
default: true,
|
101
101
|
},
|
102
|
+
/**
|
103
|
+
* The options to highlight features and paths on maps and scaffolds
|
104
|
+
* when hover over the dataset cards on sidebar.
|
105
|
+
*/
|
106
|
+
hoverHighlightOptions: {
|
107
|
+
type: Object,
|
108
|
+
default: () => ({
|
109
|
+
highlightConnectedPaths: false,
|
110
|
+
highlightDOIPaths: false,
|
111
|
+
}),
|
112
|
+
},
|
102
113
|
},
|
103
114
|
data: function () {
|
104
115
|
return {
|
@@ -201,7 +212,7 @@ export default {
|
|
201
212
|
*/
|
202
213
|
setCurrentEntry: async function(state) {
|
203
214
|
if (state && state.type) {
|
204
|
-
if (state.type === "Scaffold" && state.url) {
|
215
|
+
if (state.type === "Scaffold" && (state.url || state.isBodyScaffold)) {
|
205
216
|
//State for scaffold containing the following items:
|
206
217
|
// label - Setting the name of the dialog
|
207
218
|
// region - Which region/group currently focusing on
|
@@ -216,52 +227,67 @@ export default {
|
|
216
227
|
state: state.state,
|
217
228
|
viewUrl: state.viewUrl
|
218
229
|
};
|
219
|
-
|
220
|
-
|
221
|
-
|
230
|
+
if (state.isBodyScaffold) {
|
231
|
+
const data = await getBodyScaffoldInfo(this.options.sparcApi, state.label);
|
232
|
+
newView = { ...newView, ...data.datasetInfo, resource: data.url };
|
233
|
+
} else {
|
234
|
+
// Add content from scicrunch for the context card
|
235
|
+
const contextCardInfo = await this.retrieveContextCardFromUrl(state.url);
|
236
|
+
newView = { ...newView, ...contextCardInfo };
|
237
|
+
}
|
222
238
|
this.$refs.flow.createNewEntry(newView);
|
223
239
|
} else if (state.type === "MultiFlatmap") {
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
240
|
+
if (state.resource) {
|
241
|
+
//State for new multiflatmap containing the following items:
|
242
|
+
// label - Setting the name of the dialog
|
243
|
+
// resource - the url to metadata
|
244
|
+
// state - state to restore (viewport)
|
245
|
+
const newView = {
|
246
|
+
type: state.type,
|
247
|
+
resource: state.resource,
|
248
|
+
state: state.state,
|
249
|
+
label: state.label
|
250
|
+
};
|
251
|
+
this.$refs.flow.createNewEntry(newView);
|
252
|
+
} else {
|
253
|
+
//State for multiflatmap containing the following items:
|
254
|
+
// taxo - taxo of species to set
|
255
|
+
// biologicalSex - biological sex to be displayed (PATO)
|
256
|
+
// organ - Target organ, flatmap will conduct a local search
|
257
|
+
// using this
|
258
|
+
|
259
|
+
//Look for the key in the available species array,
|
260
|
+
//it will use the taxo and biologicalSex as hints.
|
261
|
+
const key = findSpeciesKey(state);
|
262
|
+
if (key) {
|
263
|
+
const currentState = this.getState();
|
264
|
+
if (currentState && currentState.entries) {
|
265
|
+
for (let i = 0; i < currentState.entries.length; i++) {
|
266
|
+
const entry = currentState.entries[i];
|
267
|
+
if (entry.type === "MultiFlatmap") {
|
268
|
+
entry.resource = key;
|
269
|
+
entry.state = { species: key };
|
270
|
+
if (state.organ || state.uuid) {
|
271
|
+
entry.state.state = { searchTerm: state.organ, uuid: state.uuid };
|
272
|
+
//if it contains an uuid, use the taxo to help identify if the uuid
|
273
|
+
//is current
|
274
|
+
if (state.uuid) entry.state.state.entry = state.taxo;
|
275
|
+
}
|
276
|
+
this.$refs.flow.setState(currentState);
|
277
|
+
//Do not create a new entry, instead set the multiflatmap viewer
|
278
|
+
//to the primary slot
|
279
|
+
this.$refs.flow.setIdToPrimaryPane(entry.id);
|
280
|
+
break;
|
247
281
|
}
|
248
|
-
this.$refs.flow.setState(currentState);
|
249
|
-
//Do not create a new entry, instead set the multiflatmap viewer
|
250
|
-
//to the primary slot
|
251
|
-
this.$refs.flow.setIdToPrimaryPane(entry.id);
|
252
|
-
break;
|
253
282
|
}
|
254
283
|
}
|
255
284
|
}
|
256
285
|
}
|
257
|
-
}
|
258
|
-
|
259
|
-
//State for scaffold containing the following items:
|
286
|
+
} else if (state.type === "Flatmap") {
|
287
|
+
//State for flatmap containing the following items:
|
260
288
|
// label - Setting the name of the dialog
|
261
|
-
// region - Which region/group currently focusing on
|
262
289
|
// resource - the url to metadata
|
263
290
|
// state - state to restore (viewport)
|
264
|
-
// viewUrl - relative path of the view file to metadata
|
265
291
|
const newView = {
|
266
292
|
type: state.type,
|
267
293
|
resource: state.resource,
|
@@ -325,7 +351,6 @@ export default {
|
|
325
351
|
this.options.algoliaId ? this.settingsStore.updateAlgoliaId(this.options.algoliaId) : null
|
326
352
|
this.options.pennsieveApi ? this.settingsStore.updatePennsieveApi(this.options.pennsieveApi) : null
|
327
353
|
this.options.flatmapAPI ? this.settingsStore.updateFlatmapAPI(this.options.flatmapAPI) : null,
|
328
|
-
this.options.flatmapAPI2 ? this.settingsStore.updateFlatmapAPI2(this.options.flatmapAPI2) : null,
|
329
354
|
this.options.nlLinkPrefix ? this.settingsStore.updateNLLinkPrefix(this.options.nlLinkPrefix) : null
|
330
355
|
this.options.rootUrl ? this.settingsStore.updateRootUrl(this.options.rootUrl) : null
|
331
356
|
}
|
@@ -358,6 +383,7 @@ export default {
|
|
358
383
|
this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog);
|
359
384
|
this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar);
|
360
385
|
this.settingsStore.updateAnnotationSidebar(this.annotationSidebar);
|
386
|
+
this.settingsStore.updateHoverHighlightOptions(this.hoverHighlightOptions);
|
361
387
|
}
|
362
388
|
}
|
363
389
|
|
@@ -42,6 +42,7 @@
|
|
42
42
|
@contextUpdate="contextUpdate($event)"
|
43
43
|
@datalink-clicked="datalinkClicked($event)"
|
44
44
|
@show-connectivity="onShowConnectivity"
|
45
|
+
@show-reference-connectivities="onShowReferenceConnectivities"
|
45
46
|
@connectivity-component-click="onConnectivityComponentClick"
|
46
47
|
/>
|
47
48
|
<SplitDialog
|
@@ -306,6 +307,9 @@ export default {
|
|
306
307
|
offset: activeView === 'singlepanel' || activeView === '2horpanel'
|
307
308
|
});
|
308
309
|
},
|
310
|
+
onShowReferenceConnectivities: function (refSource) {
|
311
|
+
EventBus.emit('show-reference-connectivities', refSource);
|
312
|
+
},
|
309
313
|
onConnectivityComponentClick: function (data) {
|
310
314
|
EventBus.emit('connectivity-component-click', {
|
311
315
|
connectivityInfo: this.connectivityInfo,
|
@@ -315,7 +319,8 @@ export default {
|
|
315
319
|
hoverChanged: function (data) {
|
316
320
|
const hoverAnatomies = data && data.anatomy ? data.anatomy : [];
|
317
321
|
const hoverOrgans = data && data.organs ? data.organs : [];
|
318
|
-
|
322
|
+
const hoverDOI = data && data.doi ? data.doi : '';
|
323
|
+
this.settingsStore.updateHoverFeatures(hoverAnatomies, hoverOrgans, hoverDOI);
|
319
324
|
EventBus.emit("hoverUpdate");
|
320
325
|
},
|
321
326
|
searchChanged: function (data) {
|
@@ -558,11 +563,7 @@ export default {
|
|
558
563
|
if (id === 3) EventBus.emit('annotation-close', { tabClose: true });
|
559
564
|
},
|
560
565
|
resetActivePathways: function () {
|
561
|
-
|
562
|
-
const activeCanvas = containerEl.querySelector('.maplibregl-canvas');
|
563
|
-
if (activeCanvas) {
|
564
|
-
activeCanvas.click();
|
565
|
-
}
|
566
|
+
this.hoverChanged(undefined);
|
566
567
|
},
|
567
568
|
},
|
568
569
|
created: function () {
|
@@ -650,7 +651,7 @@ export default {
|
|
650
651
|
PENNSIEVE_API_LOCATION: this.settingsStore.pennsieveApi,
|
651
652
|
NL_LINK_PREFIX: this.settingsStore.nlLinkPrefix,
|
652
653
|
ROOT_URL: this.settingsStore.rootUrl,
|
653
|
-
FLATMAPAPI_LOCATION: this.settingsStore.
|
654
|
+
FLATMAPAPI_LOCATION: this.settingsStore.flatmapAPI,
|
654
655
|
};
|
655
656
|
},
|
656
657
|
entries: function() {
|
@@ -183,7 +183,7 @@ export default {
|
|
183
183
|
this.flatmapMarkerUpdate(undefined);
|
184
184
|
});
|
185
185
|
EventBus.on("hoverUpdate", () => {
|
186
|
-
this.mapHoverHighlight(
|
186
|
+
this.mapHoverHighlight();
|
187
187
|
});
|
188
188
|
EventBus.on('show-connectivity', (payload) => {
|
189
189
|
const { featureIds, offset } = payload;
|
@@ -195,6 +195,12 @@ export default {
|
|
195
195
|
});
|
196
196
|
}
|
197
197
|
});
|
198
|
+
EventBus.on('show-reference-connectivities', (payload) => {
|
199
|
+
const currentFlatmap = this.$refs.flatmap;
|
200
|
+
if (currentFlatmap) {
|
201
|
+
currentFlatmap.showConnectivitiesByReference(payload);
|
202
|
+
}
|
203
|
+
});
|
198
204
|
},
|
199
205
|
};
|
200
206
|
</script>
|
@@ -471,6 +471,15 @@ export default {
|
|
471
471
|
}
|
472
472
|
});
|
473
473
|
|
474
|
+
EventBus.on('show-reference-connectivities', (payload) => {
|
475
|
+
if (this.flatmapReady && this.$refs.multiflatmap) {
|
476
|
+
const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
|
477
|
+
if (currentFlatmap) {
|
478
|
+
currentFlatmap.showConnectivitiesByReference(payload);
|
479
|
+
}
|
480
|
+
}
|
481
|
+
});
|
482
|
+
|
474
483
|
EventBus.on('connectivity-component-click', (payload) => {
|
475
484
|
this.showConnectivityTooltips(payload);
|
476
485
|
});
|
@@ -482,7 +491,7 @@ export default {
|
|
482
491
|
});
|
483
492
|
EventBus.on("hoverUpdate", () => {
|
484
493
|
if (this.flatmapReady) {
|
485
|
-
this.mapHoverHighlight(
|
494
|
+
this.mapHoverHighlight();
|
486
495
|
}
|
487
496
|
});
|
488
497
|
},
|
@@ -201,7 +201,7 @@ export default {
|
|
201
201
|
}
|
202
202
|
},
|
203
203
|
markerLabels: function () {
|
204
|
-
return this.settingsStore.numberOfDatasetsForFacets;
|
204
|
+
return this.settingsStore.globalSettings.displayMarker ? this.settingsStore.numberOfDatasetsForFacets : {};
|
205
205
|
},
|
206
206
|
},
|
207
207
|
data: function () {
|
@@ -219,7 +219,7 @@ export default {
|
|
219
219
|
});
|
220
220
|
EventBus.on("hoverUpdate", () => {
|
221
221
|
if (this.scaffoldLoaded) {
|
222
|
-
this.mapHoverHighlight(
|
222
|
+
this.mapHoverHighlight();
|
223
223
|
}
|
224
224
|
});
|
225
225
|
},
|
@@ -248,7 +248,7 @@ export default {
|
|
248
248
|
return fetch(`${this.apiLocation}get-related-terms/${id}`)
|
249
249
|
.then(response => response.json())
|
250
250
|
.then(data => {
|
251
|
-
if (data.uberon
|
251
|
+
if (data.uberon?.array.length > 0) {
|
252
252
|
name =
|
253
253
|
data.uberon.array[0].name.charAt(0).toUpperCase() +
|
254
254
|
data.uberon.array[0].name.slice(1);
|
@@ -458,23 +458,73 @@ export default {
|
|
458
458
|
this.endHelp();
|
459
459
|
}
|
460
460
|
},
|
461
|
-
|
461
|
+
getConnectivitiesByDOI: async function (hoverDOI) {
|
462
|
+
const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
|
463
|
+
const response = await currentFlatmap.searchConnectivitiesByReference(hoverDOI);
|
464
|
+
return response;
|
465
|
+
},
|
466
|
+
highlightAnatomies: async function (mapImp, hoverAnatomies, hoverDOI) {
|
467
|
+
const itemsToHighlight = [...hoverAnatomies];
|
468
|
+
const hoverHighlightOptions = this.settingsStore.hoverHighlightOptions;
|
469
|
+
|
470
|
+
// to highlight connected paths
|
471
|
+
if (hoverHighlightOptions.highlightConnectedPaths) {
|
472
|
+
const connectionsFromFeatures = await mapImp.queryPathsForFeatures(hoverAnatomies);
|
473
|
+
if (connectionsFromFeatures) {
|
474
|
+
itemsToHighlight.push(...connectionsFromFeatures);
|
475
|
+
}
|
476
|
+
}
|
477
|
+
|
478
|
+
// to highlight related paths from reference DOI
|
479
|
+
if (hoverHighlightOptions.highlightDOIPaths) {
|
480
|
+
const connectionsFromDOI = await this.getConnectivitiesByDOI(hoverDOI);
|
481
|
+
if (connectionsFromDOI) {
|
482
|
+
itemsToHighlight.push(...connectionsFromDOI);
|
483
|
+
}
|
484
|
+
}
|
485
|
+
|
486
|
+
return itemsToHighlight;
|
487
|
+
},
|
488
|
+
mapHoverHighlight: function () {
|
462
489
|
if (this.visible) {
|
463
490
|
const hoverAnatomies = this.settingsStore.hoverAnatomies;
|
464
491
|
const hoverOrgans = this.settingsStore.hoverOrgans;
|
492
|
+
const hoverDOI = this.settingsStore.hoverDOI;
|
493
|
+
let mapImp = null;
|
494
|
+
let scaffold = null;
|
495
|
+
|
496
|
+
if (this.flatmapRef) {
|
497
|
+
mapImp = this.$refs.flatmap.mapImp;
|
498
|
+
}
|
499
|
+
|
500
|
+
if (this.multiflatmapRef) {
|
501
|
+
mapImp = this.$refs.multiflatmap.getCurrentFlatmap().mapImp;
|
502
|
+
}
|
503
|
+
|
504
|
+
if (this.scaffoldRef) {
|
505
|
+
scaffold = this.$refs.scaffold;
|
506
|
+
}
|
507
|
+
|
508
|
+
// reset
|
509
|
+
if (mapImp) {
|
510
|
+
mapImp.clearSearchResults();
|
511
|
+
}
|
512
|
+
|
465
513
|
if (hoverAnatomies.length || hoverOrgans.length) {
|
466
514
|
clearTimeout(this.hoverDelay);
|
467
515
|
if (this.multiflatmapRef || this.flatmapRef) {
|
468
|
-
mapImp
|
516
|
+
this.highlightAnatomies(mapImp, hoverAnatomies, hoverDOI).then((itemsToHighlight) => {
|
517
|
+
mapImp.selectFeatures(itemsToHighlight);
|
518
|
+
});
|
469
519
|
} else if (this.scaffoldRef) {
|
470
|
-
|
520
|
+
scaffold?.changeHighlightedByName(hoverOrgans, "", false);
|
471
521
|
}
|
472
522
|
} else {
|
473
523
|
this.hoverDelay = setTimeout(() => {
|
474
524
|
if (this.multiflatmapRef || this.flatmapRef) {
|
475
525
|
mapImp?.clearSearchResults();
|
476
526
|
} else if (this.scaffoldRef) {
|
477
|
-
|
527
|
+
scaffold?.changeHighlightedByName(hoverOrgans, "", false);
|
478
528
|
}
|
479
529
|
}, 500);
|
480
530
|
}
|
@@ -40,7 +40,7 @@ export default {
|
|
40
40
|
|
41
41
|
if (flatmapImp) {
|
42
42
|
// Set the dataset markers
|
43
|
-
let markers = this.settingsStore.markers;
|
43
|
+
let markers = this.settingsStore.globalSettings.displayMarker ? this.settingsStore.markers : [];
|
44
44
|
markers = removeDuplicates(markers);
|
45
45
|
let fmMarkers = this.removeMarkersNotOnFlatmap(flatmapImp, markers);
|
46
46
|
flatmapImp.clearMarkers();
|
package/src/stores/settings.js
CHANGED
@@ -13,7 +13,6 @@ export const useSettingsStore = defineStore('settings', {
|
|
13
13
|
pennsieveApi: undefined,
|
14
14
|
flatmapAPI: undefined,
|
15
15
|
nlLinkPrefix: undefined,
|
16
|
-
flatmapAPI2: "https://mapcore-demo.org/curation/flatmap/",
|
17
16
|
mapManager: undefined,
|
18
17
|
rootUrl: undefined,
|
19
18
|
facets: { species: [], gender: [], organ: [] },
|
@@ -21,6 +20,7 @@ export const useSettingsStore = defineStore('settings', {
|
|
21
20
|
markers: [],
|
22
21
|
hoverAnatomies: [],
|
23
22
|
hoverOrgans: [],
|
23
|
+
hoverDOI: '',
|
24
24
|
featuredMarkers: [],
|
25
25
|
featuredMarkerIdentifiers: [],
|
26
26
|
featuredMarkerDois: [],
|
@@ -30,6 +30,13 @@ export const useSettingsStore = defineStore('settings', {
|
|
30
30
|
useHelpModeDialog: false,
|
31
31
|
connectivityInfoSidebar: true,
|
32
32
|
annotationSidebar: true,
|
33
|
+
hoverHighlightOptions: {
|
34
|
+
highlightConnectedPaths: false,
|
35
|
+
highlightDOIPaths: false,
|
36
|
+
},
|
37
|
+
globalSettings: {
|
38
|
+
displayMarker: true,
|
39
|
+
},
|
33
40
|
}
|
34
41
|
},
|
35
42
|
getters: {
|
@@ -42,6 +49,16 @@ export const useSettingsStore = defineStore('settings', {
|
|
42
49
|
);
|
43
50
|
return state.featuredMarkerDois[index];
|
44
51
|
},
|
52
|
+
getUpdatedGlobalSettingsKey: state => settings => {
|
53
|
+
let updatedSettings = [];
|
54
|
+
for (const [key, value] of Object.entries(settings)) {
|
55
|
+
const attribute = state.globalSettings[key];
|
56
|
+
if (!attribute || (attribute !== value)) {
|
57
|
+
updatedSettings.push(key);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return updatedSettings;
|
61
|
+
},
|
45
62
|
},
|
46
63
|
actions: {
|
47
64
|
updateShareLink(newLink) {
|
@@ -65,9 +82,6 @@ export const useSettingsStore = defineStore('settings', {
|
|
65
82
|
updateFlatmapAPI(flatmapAPI) {
|
66
83
|
this.flatmapAPI = flatmapAPI;
|
67
84
|
},
|
68
|
-
updateFlatmapAPI2(flatmapAPI2) {
|
69
|
-
this.flatmapAPI2 = flatmapAPI2;
|
70
|
-
},
|
71
85
|
updateMapManager(mapManager) {
|
72
86
|
this.mapManager = mapManager;
|
73
87
|
},
|
@@ -80,9 +94,10 @@ export const useSettingsStore = defineStore('settings', {
|
|
80
94
|
updateMarkers(markers) {
|
81
95
|
this.markers = markers;
|
82
96
|
},
|
83
|
-
updateHoverFeatures(anatomies, organs) {
|
97
|
+
updateHoverFeatures(anatomies, organs, doi) {
|
84
98
|
this.hoverAnatomies = anatomies;
|
85
99
|
this.hoverOrgans = organs;
|
100
|
+
this.hoverDOI = doi;
|
86
101
|
},
|
87
102
|
updateFeatured(datasetIdentifiers) {
|
88
103
|
this.featuredMarkerIdentifiers = new Array(datasetIdentifiers.length);
|
@@ -166,5 +181,13 @@ export const useSettingsStore = defineStore('settings', {
|
|
166
181
|
updateAnnotationSidebar(annotationSidebar) {
|
167
182
|
this.annotationSidebar = annotationSidebar;
|
168
183
|
},
|
184
|
+
updateHoverHighlightOptions(hoverHighlightOptions) {
|
185
|
+
this.hoverHighlightOptions = hoverHighlightOptions;
|
186
|
+
},
|
187
|
+
updateGlobalSettings(globalSettings) {
|
188
|
+
for (const [key, value] of Object.entries(globalSettings)) {
|
189
|
+
this.globalSettings[key] = value;
|
190
|
+
}
|
191
|
+
},
|
169
192
|
}
|
170
193
|
});
|