@abi-software/mapintegratedvuer 1.21.1 → 1.22.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/README.md +23 -5
- package/assets/location-icon.html +33 -1
- package/assets/styleguide.css +18 -18
- package/cypress.config.js +7 -9
- package/dist/{ConnectivityGraph-CZMROk9r.js → ConnectivityGraph-BBZ3Dgat.js} +3 -3
- package/dist/{ContentMixin-Vn34n5t2.js → ContentMixin-B-O_IwPg.js} +16 -18
- package/dist/{DynamicMarkerMixin-BS6t7w_i.js → DynamicMarkerMixin-B9iqtP_f.js} +1 -1
- package/dist/{Flatmap-BejxA0uz.js → Flatmap-BoEFI50b.js} +4 -4
- package/dist/{Iframe-BWbhTjCR.js → Iframe-Slj-LQTF.js} +4 -4
- package/dist/{MultiFlatmap-nlmsH-Ib.js → MultiFlatmap-l6aBn6x3.js} +17 -5
- package/dist/{Plot-ChbPsDZX.js → Plot-CIhEip5b.js} +2 -2
- package/dist/{Scaffold-C6f7c7Ha.js → Scaffold-D5ZGCDvt.js} +4 -4
- package/dist/{Simulation-DcJScRYo.js → Simulation-C5o5DXRb.js} +2 -2
- package/dist/{connectivities-UXTqf7_0.js → connectivities-Br3MpoAv.js} +154 -95
- package/dist/index.html +9 -6
- package/dist/mapintegratedvuer.js +5506 -5582
- package/dist/mapintegratedvuer.umd.cjs +196 -196
- package/dist/style.css +1 -1
- package/eslint.config.js +39 -15
- package/package.json +12 -6
- package/public/index.html +9 -6
- package/src/App.vue +224 -255
- package/src/assets/_variables.scss +12 -10
- package/src/assets/header-icon.scss +8 -9
- package/src/assets/mapicon-species-style.css +10 -8
- package/src/assets/styles.scss +1 -1
- package/src/components/ContentBar.vue +99 -106
- package/src/components/ContentVuer.vue +36 -39
- package/src/components/ContextCard.vue +238 -199
- package/src/components/ContextHelp.vue +22 -26
- package/src/components/CustomSplitter.vue +32 -43
- package/src/components/DatasetHeader.vue +37 -41
- package/src/components/DialogToolbarContent.vue +292 -256
- package/src/components/FlatmapContextCard.vue +52 -57
- package/src/components/MapContent.vue +111 -87
- package/src/components/ResizeSensor.vue +8 -13
- package/src/components/SearchControls.vue +26 -35
- package/src/components/SimulatedData.js +196 -219
- package/src/components/SplitDialog.vue +139 -129
- package/src/components/SplitFlow.vue +433 -239
- package/src/components/index.js +1 -3
- package/src/components/scripts/simulation_data.js +393 -397
- package/src/components/scripts/utilities.js +108 -78
- package/src/components/viewers/CellDLViewer.vue +9 -9
- package/src/components/viewers/ConnectivityGraph.vue +9 -12
- package/src/components/viewers/Flatmap.vue +23 -25
- package/src/components/viewers/Iframe.vue +8 -10
- package/src/components/viewers/MultiFlatmap.vue +73 -69
- package/src/components/viewers/Plot.vue +6 -7
- package/src/components/viewers/Scaffold.vue +73 -63
- package/src/components/viewers/Simulation.vue +10 -15
- package/src/main.js +16 -21
- package/src/mixins/ContentMixin.js +208 -178
- package/src/mixins/DynamicMarkerMixin.js +14 -18
- package/src/mixins/RetrieveContextCardMixin.js +35 -30
- package/src/mixins/S3Bucket.vue +10 -13
- package/src/services/knowledgeMapping.js +53 -53
- package/src/services/tagging.js +4 -4
- package/src/stores/connectivities.js +46 -8
- package/src/stores/entries.js +7 -9
- package/src/stores/index.js +7 -7
- package/src/stores/settings.js +23 -31
- package/src/stores/splitFlow.js +395 -298
- package/vite.bundle-build.js +24 -26
- package/vite.config.js +22 -21
- package/vite.static-build.js +4 -4
- package/vitest.workspace.js +1 -3
- package/vuese-generator.js +47 -55
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
:showOpenMapButton="showOpenMapButton"
|
|
38
38
|
@pan-zoom-callback="flatmapPanZoomCallback"
|
|
39
39
|
@open-map="openMap"
|
|
40
|
+
@open-map-species="openMapSpecies"
|
|
40
41
|
@finish-help-mode="endHelp"
|
|
41
42
|
@pathway-selection-changed="onPathwaySelectionChanged"
|
|
42
43
|
@open-pubmed-url="onOpenPubmedUrl"
|
|
@@ -58,47 +59,43 @@
|
|
|
58
59
|
</template>
|
|
59
60
|
|
|
60
61
|
<script>
|
|
61
|
-
/* eslint-disable no-alert, no-console */
|
|
62
62
|
import Tagging from '../../services/tagging.js';
|
|
63
|
-
import ContentMixin from
|
|
64
|
-
import EventBus from
|
|
65
|
-
import {
|
|
66
|
-
|
|
67
|
-
defaultSpecies,
|
|
68
|
-
} from "../scripts/utilities";
|
|
69
|
-
import DyncamicMarkerMixin from "../../mixins/DynamicMarkerMixin";
|
|
63
|
+
import ContentMixin from '../../mixins/ContentMixin';
|
|
64
|
+
import EventBus from '../EventBus';
|
|
65
|
+
import { availableSpecies, defaultSpecies } from '../scripts/utilities';
|
|
66
|
+
import DyncamicMarkerMixin from '../../mixins/DynamicMarkerMixin';
|
|
70
67
|
|
|
71
|
-
import YellowStar from
|
|
68
|
+
import YellowStar from '../../icons/yellowstar';
|
|
72
69
|
|
|
73
|
-
import { MultiFlatmapVuer } from
|
|
74
|
-
import
|
|
75
|
-
import { HelpModeDialog } from '@abi-software/map-utilities'
|
|
76
|
-
import '@abi-software/map-utilities/dist/style.css'
|
|
70
|
+
import { MultiFlatmapVuer } from '@abi-software/flatmapvuer';
|
|
71
|
+
import '@abi-software/flatmapvuer/dist/style.css';
|
|
72
|
+
import { HelpModeDialog } from '@abi-software/map-utilities';
|
|
73
|
+
import '@abi-software/map-utilities/dist/style.css';
|
|
77
74
|
|
|
78
|
-
const getOpenMapOptions = (
|
|
75
|
+
const getOpenMapOptions = (_species) => {
|
|
79
76
|
const options = [
|
|
80
77
|
{
|
|
81
|
-
display:
|
|
82
|
-
key:
|
|
78
|
+
display: 'Open AC Map',
|
|
79
|
+
key: 'AC',
|
|
83
80
|
},
|
|
84
81
|
{
|
|
85
|
-
display:
|
|
86
|
-
key:
|
|
82
|
+
display: 'Open FC Map',
|
|
83
|
+
key: 'FC',
|
|
87
84
|
},
|
|
88
85
|
{
|
|
89
|
-
display:
|
|
90
|
-
key:
|
|
86
|
+
display: 'Open 3D Human Map',
|
|
87
|
+
key: '3D',
|
|
91
88
|
},
|
|
92
89
|
{
|
|
93
|
-
display:
|
|
94
|
-
key:
|
|
90
|
+
display: 'Open Connectivity Graph',
|
|
91
|
+
key: 'CG',
|
|
95
92
|
},
|
|
96
|
-
]
|
|
93
|
+
];
|
|
97
94
|
return options;
|
|
98
|
-
}
|
|
95
|
+
};
|
|
99
96
|
|
|
100
97
|
export default {
|
|
101
|
-
name:
|
|
98
|
+
name: 'MultiFlatmap',
|
|
102
99
|
mixins: [ContentMixin, DyncamicMarkerMixin],
|
|
103
100
|
components: {
|
|
104
101
|
MultiFlatmapVuer,
|
|
@@ -108,12 +105,12 @@ export default {
|
|
|
108
105
|
return {
|
|
109
106
|
availableSpecies: availableSpecies(),
|
|
110
107
|
flatmapReady: false,
|
|
111
|
-
scaffoldResource: {
|
|
108
|
+
scaffoldResource: {},
|
|
112
109
|
showStarInLegend: false,
|
|
113
110
|
speciesHasChanged: false,
|
|
114
111
|
openMapOptions: getOpenMapOptions(defaultSpecies),
|
|
115
112
|
zoomLevel: 6,
|
|
116
|
-
}
|
|
113
|
+
};
|
|
117
114
|
},
|
|
118
115
|
methods: {
|
|
119
116
|
getState: function () {
|
|
@@ -124,11 +121,11 @@ export default {
|
|
|
124
121
|
if (this.mouseHovered) {
|
|
125
122
|
const result = {
|
|
126
123
|
paneIndex: this.entry.id,
|
|
127
|
-
eventType:
|
|
124
|
+
eventType: 'panZoom',
|
|
128
125
|
payload: payload,
|
|
129
126
|
type: this.entry.type,
|
|
130
127
|
};
|
|
131
|
-
this.$emit(
|
|
128
|
+
this.$emit('resource-selected', result);
|
|
132
129
|
}
|
|
133
130
|
},
|
|
134
131
|
/**
|
|
@@ -139,6 +136,19 @@ export default {
|
|
|
139
136
|
//First search and show the result
|
|
140
137
|
return flatmap.searchAndShowResult(term, true, true);
|
|
141
138
|
},
|
|
139
|
+
// Open the given species as a new view.
|
|
140
|
+
openMapSpecies: function (species) {
|
|
141
|
+
EventBus.emit('SetCurrentEntry', {
|
|
142
|
+
resource: species,
|
|
143
|
+
type: 'MultiFlatmap',
|
|
144
|
+
mode: 'main',
|
|
145
|
+
state: undefined,
|
|
146
|
+
label: '',
|
|
147
|
+
discoverId: undefined,
|
|
148
|
+
sourceId: this.entry.id,
|
|
149
|
+
});
|
|
150
|
+
this.trackOpenMap(`open_new_AC_map_${species}`);
|
|
151
|
+
},
|
|
142
152
|
/**
|
|
143
153
|
* Append the list of suggested terms to suggestions
|
|
144
154
|
*/
|
|
@@ -147,10 +157,9 @@ export default {
|
|
|
147
157
|
if (term && flatmap.mapImp) {
|
|
148
158
|
const results = flatmap.mapImp.search(term);
|
|
149
159
|
const featureIds = results.__featureIds || results.featureIds;
|
|
150
|
-
featureIds.forEach(id => {
|
|
160
|
+
featureIds.forEach((id) => {
|
|
151
161
|
const annotation = flatmap.mapImp.annotation(id);
|
|
152
|
-
if (annotation && annotation.label)
|
|
153
|
-
suggestions.push(annotation.label);
|
|
162
|
+
if (annotation && annotation.label) suggestions.push(annotation.label);
|
|
154
163
|
});
|
|
155
164
|
}
|
|
156
165
|
},
|
|
@@ -159,26 +168,26 @@ export default {
|
|
|
159
168
|
// GA Tagging
|
|
160
169
|
// Event tracking for maps' pathway selection change
|
|
161
170
|
Tagging.sendEvent({
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
171
|
+
event: 'interaction_event',
|
|
172
|
+
event_name: 'portal_maps_pathway_change',
|
|
173
|
+
category: label + ' [' + property + '] ' + checked,
|
|
174
|
+
location: selectionsTitle,
|
|
166
175
|
});
|
|
167
176
|
},
|
|
168
|
-
onSidebarAnnotationClose: function() {
|
|
177
|
+
onSidebarAnnotationClose: function () {
|
|
169
178
|
if (this.flatmapReady) {
|
|
170
179
|
const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
|
|
171
|
-
currentFlatmap.annotationEventCallback({}, { type: 'aborted' })
|
|
180
|
+
currentFlatmap.annotationEventCallback({}, { type: 'aborted' });
|
|
172
181
|
}
|
|
173
182
|
},
|
|
174
183
|
onOpenPubmedUrl: function (url) {
|
|
175
184
|
// GA Tagging
|
|
176
185
|
// Event tracking for open pubmed url from popup
|
|
177
186
|
Tagging.sendEvent({
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
187
|
+
event: 'interaction_event',
|
|
188
|
+
event_name: 'portal_maps_pubmed_url',
|
|
189
|
+
file_path: url,
|
|
190
|
+
location: 'map_popup_button',
|
|
182
191
|
});
|
|
183
192
|
},
|
|
184
193
|
zoomToFeatures: function (info, forceSelect) {
|
|
@@ -198,21 +207,21 @@ export default {
|
|
|
198
207
|
flatmap.clearSearchResults();
|
|
199
208
|
}
|
|
200
209
|
},
|
|
201
|
-
updateProvCard: function() {
|
|
210
|
+
updateProvCard: function () {
|
|
202
211
|
const imp = this.getFlatmapImp();
|
|
203
212
|
if (imp) {
|
|
204
|
-
let provClone = {id: this.entry.id, prov: imp.mapMetadata};
|
|
205
|
-
EventBus.emit(
|
|
206
|
-
this.$emit(
|
|
213
|
+
let provClone = { id: this.entry.id, prov: imp.mapMetadata };
|
|
214
|
+
EventBus.emit('mapImpProv', provClone);
|
|
215
|
+
this.$emit('flatmap-provenance-ready', provClone);
|
|
207
216
|
}
|
|
208
217
|
},
|
|
209
|
-
contextRestored: function(flatmap) {
|
|
218
|
+
contextRestored: function (flatmap) {
|
|
210
219
|
if (flatmap) {
|
|
211
220
|
this.flatmapMarkerUpdate(flatmap.mapImp);
|
|
212
221
|
this.updateViewerSettings();
|
|
213
222
|
if (this.speciesHasChanged) {
|
|
214
223
|
this.speciesHasChanged = false;
|
|
215
|
-
this.$emit(
|
|
224
|
+
this.$emit('species-changed', this.activeSpecies);
|
|
216
225
|
}
|
|
217
226
|
}
|
|
218
227
|
},
|
|
@@ -228,7 +237,7 @@ export default {
|
|
|
228
237
|
this.flatmapMarkerUpdate(flatmapImp);
|
|
229
238
|
this.updateViewerSettings();
|
|
230
239
|
this.speciesHasChanged = false;
|
|
231
|
-
this.$emit(
|
|
240
|
+
this.$emit('species-changed', activeSpecies);
|
|
232
241
|
} else {
|
|
233
242
|
this.speciesHasChanged = true;
|
|
234
243
|
}
|
|
@@ -236,9 +245,9 @@ export default {
|
|
|
236
245
|
// GA Tagging
|
|
237
246
|
// Event tracking for maps' species change
|
|
238
247
|
Tagging.sendEvent({
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
248
|
+
event: 'interaction_event',
|
|
249
|
+
event_name: 'portal_maps_species_change',
|
|
250
|
+
category: this.activeSpecies,
|
|
242
251
|
});
|
|
243
252
|
},
|
|
244
253
|
multiFlatmapReady: function (flatmap) {
|
|
@@ -251,13 +260,13 @@ export default {
|
|
|
251
260
|
this.updateViewerSettings();
|
|
252
261
|
// Wait for flatmap's connectivity to load before emitting mapLoaded
|
|
253
262
|
this.loadConnectivityExplorerConfig(flatmap).then(() => {
|
|
254
|
-
EventBus.emit(
|
|
263
|
+
EventBus.emit('mapLoaded', flatmap);
|
|
255
264
|
});
|
|
256
265
|
}
|
|
257
266
|
},
|
|
258
267
|
getFlatmapImp: function () {
|
|
259
|
-
if (this.entry.type ===
|
|
260
|
-
return this.$refs.multiflatmap.getCurrentFlatmap()[
|
|
268
|
+
if (this.entry.type === 'MultiFlatmap' && this.flatmapReady && this.$refs.multiflatmap) {
|
|
269
|
+
return this.$refs.multiflatmap.getCurrentFlatmap()['mapImp'];
|
|
261
270
|
} else {
|
|
262
271
|
return undefined;
|
|
263
272
|
}
|
|
@@ -266,17 +275,16 @@ export default {
|
|
|
266
275
|
const flatmapImp = this.getFlatmapImp();
|
|
267
276
|
let shownMarkers = flatmapImp.visibleMarkerAnatomicalIds();
|
|
268
277
|
let returnedAction = {
|
|
269
|
-
type:
|
|
270
|
-
label:
|
|
271
|
-
val: shownMarkers.map(marker => this.idNamePair[marker]),
|
|
278
|
+
type: 'Facets',
|
|
279
|
+
label: 'Unused',
|
|
280
|
+
val: shownMarkers.map((marker) => this.idNamePair[marker]),
|
|
272
281
|
};
|
|
273
|
-
EventBus.emit(
|
|
282
|
+
EventBus.emit('PopoverActionClick', returnedAction);
|
|
274
283
|
},
|
|
275
284
|
flatmapIsReady() {
|
|
276
285
|
return this.flatmapReady;
|
|
277
286
|
},
|
|
278
287
|
restoreFeaturedMarkers: function (flatmap) {
|
|
279
|
-
|
|
280
288
|
this.settingsStore.resetFeaturedMarkerIdentifier();
|
|
281
289
|
const markers = this.settingsStore.featuredMarkers;
|
|
282
290
|
this.updateFeaturedMarkers(markers, flatmap);
|
|
@@ -286,8 +294,7 @@ export default {
|
|
|
286
294
|
this.showStarInLegend = false; // will show if we have a featured marker
|
|
287
295
|
for (let index = 0; index < markers.length; ++index) {
|
|
288
296
|
if (markers[index]) {
|
|
289
|
-
const markerIdentifier =
|
|
290
|
-
this.settingsStore.featuredMarkerIdentifiers[index];
|
|
297
|
+
const markerIdentifier = this.settingsStore.featuredMarkerIdentifiers[index];
|
|
291
298
|
if (!markerIdentifier) {
|
|
292
299
|
// Add the featured marker to the legend if we have a featured marker
|
|
293
300
|
const markerExists = this.addFeaturedMarker(markers[index], index, flatmap);
|
|
@@ -300,8 +307,7 @@ export default {
|
|
|
300
307
|
},
|
|
301
308
|
// addFeaturedMarker: add a featured marker to the map at the specified uberon location
|
|
302
309
|
addFeaturedMarker: function (marker, index, flatmap) {
|
|
303
|
-
const markerSpecies =
|
|
304
|
-
this.settingsStore.featuredMarkerSpecies[index];
|
|
310
|
+
const markerSpecies = this.settingsStore.featuredMarkerSpecies[index];
|
|
305
311
|
if (markerSpecies && !this.activeSpecies.startsWith(markerSpecies)) {
|
|
306
312
|
return false;
|
|
307
313
|
}
|
|
@@ -312,14 +318,14 @@ export default {
|
|
|
312
318
|
|
|
313
319
|
if (flatmapImp) {
|
|
314
320
|
// create the star marker
|
|
315
|
-
let wrapperElement = document.createElement(
|
|
321
|
+
let wrapperElement = document.createElement('div');
|
|
316
322
|
wrapperElement.innerHTML = YellowStar;
|
|
317
323
|
|
|
318
324
|
// add it to the flatmap
|
|
319
325
|
const markerIdentifier = flatmapImp.addMarker(marker, {
|
|
320
326
|
element: wrapperElement,
|
|
321
|
-
className:
|
|
322
|
-
cluster: false
|
|
327
|
+
className: 'highlight-marker',
|
|
328
|
+
cluster: false,
|
|
323
329
|
});
|
|
324
330
|
|
|
325
331
|
// update the store with the marker identifier
|
|
@@ -445,7 +451,6 @@ export default {
|
|
|
445
451
|
|
|
446
452
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
447
453
|
<style scoped lang="scss">
|
|
448
|
-
|
|
449
454
|
.viewer-container {
|
|
450
455
|
width: 100%;
|
|
451
456
|
height: 100%;
|
|
@@ -470,7 +475,6 @@ export default {
|
|
|
470
475
|
}
|
|
471
476
|
}
|
|
472
477
|
}
|
|
473
|
-
|
|
474
478
|
</style>
|
|
475
479
|
|
|
476
480
|
<style src="../../assets/mapicon-species-style.css"></style>
|
|
@@ -9,16 +9,15 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import ContentMixin from "../../mixins/ContentMixin";
|
|
12
|
+
import { PlotVuer } from '@abi-software/plotvuer';
|
|
13
|
+
import '@abi-software/plotvuer/dist/style.css';
|
|
14
|
+
import ContentMixin from '../../mixins/ContentMixin';
|
|
16
15
|
|
|
17
16
|
export default {
|
|
18
|
-
name:
|
|
19
|
-
mixins: [
|
|
17
|
+
name: 'Plot',
|
|
18
|
+
mixins: [ContentMixin],
|
|
20
19
|
components: {
|
|
21
20
|
PlotVuer,
|
|
22
|
-
}
|
|
21
|
+
},
|
|
23
22
|
};
|
|
24
23
|
</script>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
:showOpenMapButton="showOpenMapButton"
|
|
39
39
|
:usageConfig="{
|
|
40
40
|
showTubeLinesControls: false,
|
|
41
|
-
tubeLines:
|
|
41
|
+
tubeLines: entry.discoverId === '307' || entry.discoverId === 307,
|
|
42
42
|
}"
|
|
43
43
|
/>
|
|
44
44
|
|
|
@@ -54,20 +54,22 @@
|
|
|
54
54
|
</template>
|
|
55
55
|
|
|
56
56
|
<script>
|
|
57
|
-
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import ContentMixin from "../../mixins/ContentMixin";
|
|
57
|
+
import { markRaw } from 'vue';
|
|
58
|
+
import EventBus from '../EventBus';
|
|
59
|
+
import ContentMixin from '../../mixins/ContentMixin';
|
|
61
60
|
|
|
62
|
-
import { ScaffoldVuer } from
|
|
63
|
-
import
|
|
64
|
-
import { HelpModeDialog } from '@abi-software/map-utilities'
|
|
65
|
-
import '@abi-software/map-utilities/dist/style.css'
|
|
66
|
-
import {
|
|
61
|
+
import { ScaffoldVuer } from '@abi-software/scaffoldvuer';
|
|
62
|
+
import '@abi-software/scaffoldvuer/dist/style.css';
|
|
63
|
+
import { HelpModeDialog } from '@abi-software/map-utilities';
|
|
64
|
+
import '@abi-software/map-utilities/dist/style.css';
|
|
65
|
+
import {
|
|
66
|
+
getReferenceConnectivitiesFromStorage,
|
|
67
|
+
getReferenceConnectivitiesByAPI,
|
|
68
|
+
} from '@abi-software/flatmapvuer/src/services/flatmapKnowledge.js';
|
|
67
69
|
|
|
68
70
|
export default {
|
|
69
|
-
name:
|
|
70
|
-
mixins: [
|
|
71
|
+
name: 'Scaffold',
|
|
72
|
+
mixins: [ContentMixin],
|
|
71
73
|
components: {
|
|
72
74
|
ScaffoldVuer,
|
|
73
75
|
HelpModeDialog,
|
|
@@ -76,24 +78,28 @@ export default {
|
|
|
76
78
|
showConnectivitiesByReference: async function (resource) {
|
|
77
79
|
if (this.$refs.scaffold) {
|
|
78
80
|
const flatmapKnowledge = sessionStorage.getItem('flatmap-knowledge');
|
|
79
|
-
let featureIds
|
|
81
|
+
let featureIds;
|
|
80
82
|
if (flatmapKnowledge) {
|
|
81
83
|
featureIds = await getReferenceConnectivitiesFromStorage(resource);
|
|
82
84
|
} else {
|
|
83
|
-
featureIds = await getReferenceConnectivitiesByAPI(
|
|
85
|
+
featureIds = await getReferenceConnectivitiesByAPI(
|
|
86
|
+
this.flatmapService.mapImp,
|
|
87
|
+
resource,
|
|
88
|
+
this.flatmapService.flatmapQueries,
|
|
89
|
+
);
|
|
84
90
|
}
|
|
85
91
|
const nerveLabels = [];
|
|
86
92
|
for (const id of featureIds) {
|
|
87
|
-
const knowledge = this.nervesKnowledge.find(k => k.id === id);
|
|
93
|
+
const knowledge = this.nervesKnowledge.find((k) => k.id === id);
|
|
88
94
|
if (!knowledge) continue;
|
|
89
95
|
|
|
90
96
|
const nerves = knowledge['nerve-label'];
|
|
91
97
|
if (nerves) {
|
|
92
|
-
const subNerves = nerves.flatMap(n => n.subNerves);
|
|
98
|
+
const subNerves = nerves.flatMap((n) => n.subNerves);
|
|
93
99
|
nerveLabels.push(...subNerves);
|
|
94
100
|
}
|
|
95
101
|
}
|
|
96
|
-
this.$refs.scaffold.changeHighlightedByName(nerveLabels,
|
|
102
|
+
this.$refs.scaffold.changeHighlightedByName(nerveLabels, '', false);
|
|
97
103
|
}
|
|
98
104
|
},
|
|
99
105
|
setNerveGreyScale: function () {
|
|
@@ -115,7 +121,7 @@ export default {
|
|
|
115
121
|
const processed = payload ? true : false;
|
|
116
122
|
if (payload) {
|
|
117
123
|
const ids = [];
|
|
118
|
-
payload['OR'].forEach(orData => {
|
|
124
|
+
payload['OR'].forEach((orData) => {
|
|
119
125
|
if ('AND' in orData) {
|
|
120
126
|
if (orData['AND'].length >= 2 && 'models' in orData['AND'][1]) {
|
|
121
127
|
ids.push(...orData['AND'][1]['models']);
|
|
@@ -125,7 +131,7 @@ export default {
|
|
|
125
131
|
for (const id of ids) {
|
|
126
132
|
const nerveKnowledge = this.nervesKnowledge.find((knowledge) => knowledge.id === id);
|
|
127
133
|
if (nerveKnowledge) {
|
|
128
|
-
const nerves = nerveKnowledge['nerve-label'].map(n => n.subNerves).flat(Infinity);
|
|
134
|
+
const nerves = nerveKnowledge['nerve-label'].map((n) => n.subNerves).flat(Infinity);
|
|
129
135
|
names.push(...nerves);
|
|
130
136
|
}
|
|
131
137
|
}
|
|
@@ -134,12 +140,12 @@ export default {
|
|
|
134
140
|
}
|
|
135
141
|
},
|
|
136
142
|
syncFilter: function (data) {
|
|
137
|
-
if (this.$refs.scaffold?.viewingMode ===
|
|
138
|
-
this.filter = data.filter(f => f.facet?.toLowerCase() !== 'show all');
|
|
143
|
+
if (this.$refs.scaffold?.viewingMode === 'Neuron Connection') {
|
|
144
|
+
this.filter = data.filter((f) => f.facet?.toLowerCase() !== 'show all');
|
|
139
145
|
}
|
|
140
146
|
},
|
|
141
147
|
scaffoldResourceSelected: async function (type, resource) {
|
|
142
|
-
this.resourceSelected(type, resource, true)
|
|
148
|
+
this.resourceSelected(type, resource, true);
|
|
143
149
|
// When we directly click on a nerve, there will only be only one resource selected.
|
|
144
150
|
// Both EventBus.emit and getKnowledgeTooltip will trigger sidebar content update
|
|
145
151
|
// Then setVisibilityFilter will be called to zoom to the clicked nerve.
|
|
@@ -147,7 +153,7 @@ export default {
|
|
|
147
153
|
this.clickedObject = resource[0].data;
|
|
148
154
|
if (this.clickedObject.isNerves || this.clickedObject.anatomicalId) {
|
|
149
155
|
const label = this.clickedObject.id.toLowerCase();
|
|
150
|
-
if (this.$refs.scaffold.viewingMode ===
|
|
156
|
+
if (this.$refs.scaffold.viewingMode === 'Neuron Connection') {
|
|
151
157
|
const connectionType = this.settingsStore.globalSettings.connectionType;
|
|
152
158
|
|
|
153
159
|
// nerve click
|
|
@@ -172,7 +178,9 @@ export default {
|
|
|
172
178
|
} else {
|
|
173
179
|
// get filterOptions from store
|
|
174
180
|
const filterOptions = this.connectivitiesStore.filterOptions[this.entry.resource];
|
|
175
|
-
const filterOption = filterOptions.find(
|
|
181
|
+
const filterOption = filterOptions.find(
|
|
182
|
+
(option) => option.key === `flatmap.connectivity.source.${connectionTypeKey}`,
|
|
183
|
+
);
|
|
176
184
|
let neuronFilter;
|
|
177
185
|
|
|
178
186
|
filterOption?.children.forEach((child) => {
|
|
@@ -187,7 +195,10 @@ export default {
|
|
|
187
195
|
});
|
|
188
196
|
|
|
189
197
|
if (neuronFilter) {
|
|
190
|
-
uberonTerm = neuronFilter.key.replace(
|
|
198
|
+
uberonTerm = neuronFilter.key.replace(
|
|
199
|
+
`flatmap.connectivity.source.${connectionTypeKey}.`,
|
|
200
|
+
'',
|
|
201
|
+
);
|
|
191
202
|
this.filter.push({
|
|
192
203
|
facet: uberonTerm,
|
|
193
204
|
facetPropPath: `flatmap.connectivity.source.${connectionTypeKey}`,
|
|
@@ -198,13 +209,14 @@ export default {
|
|
|
198
209
|
}
|
|
199
210
|
}
|
|
200
211
|
|
|
201
|
-
EventBus.emit(
|
|
212
|
+
EventBus.emit('neuron-connection-feature-click', {
|
|
202
213
|
filters: this.filter,
|
|
203
|
-
search: this.filter.length ? '' : label
|
|
204
|
-
})
|
|
205
|
-
} else if (this.$refs.scaffold.viewingMode ===
|
|
206
|
-
const nerveKnowledge = this.nervesKnowledge
|
|
207
|
-
|
|
214
|
+
search: this.filter.length ? '' : label,
|
|
215
|
+
});
|
|
216
|
+
} else if (this.$refs.scaffold.viewingMode === 'Exploration') {
|
|
217
|
+
const nerveKnowledge = this.nervesKnowledge.filter((knowledge) =>
|
|
218
|
+
JSON.stringify(knowledge['nerve-label']).includes(label),
|
|
219
|
+
);
|
|
208
220
|
if (nerveKnowledge.length) {
|
|
209
221
|
this.getKnowledgeTooltip({ data: nerveKnowledge, type: this.entry });
|
|
210
222
|
}
|
|
@@ -215,14 +227,14 @@ export default {
|
|
|
215
227
|
// if multiple resources selected is because of directly clicking on a nerve
|
|
216
228
|
// enable picking again
|
|
217
229
|
// otherwise, it is related to the explorer search
|
|
218
|
-
if (this.$refs.scaffold.viewingMode ===
|
|
230
|
+
if (this.$refs.scaffold.viewingMode === 'Exploration') {
|
|
219
231
|
if (this.clickedObject) {
|
|
220
232
|
this.$refs.scaffold.$module.setIgnorePicking(false);
|
|
221
233
|
}
|
|
222
234
|
}
|
|
223
235
|
} else {
|
|
224
236
|
this.clickedObject = undefined;
|
|
225
|
-
EventBus.emit(
|
|
237
|
+
EventBus.emit('connectivity-info-close');
|
|
226
238
|
}
|
|
227
239
|
},
|
|
228
240
|
onResize: function () {
|
|
@@ -248,37 +260,37 @@ export default {
|
|
|
248
260
|
return this.$refs.scaffold.search(term, true);
|
|
249
261
|
}
|
|
250
262
|
},
|
|
251
|
-
searchSuggestions: function(term, suggestions){
|
|
252
|
-
if (term ===
|
|
263
|
+
searchSuggestions: function (term, suggestions) {
|
|
264
|
+
if (term === '' || !this.$refs.scaffold) {
|
|
253
265
|
return suggestions;
|
|
254
266
|
}
|
|
255
267
|
const items = this.$refs.scaffold.fetchSuggestions(term);
|
|
256
|
-
items.forEach(item => {
|
|
268
|
+
items.forEach((item) => {
|
|
257
269
|
if (item.suggestion) suggestions.push(item.suggestion);
|
|
258
270
|
});
|
|
259
271
|
},
|
|
260
272
|
showConnectivityTooltips: function (payload) {
|
|
261
273
|
if (this.$refs.scaffold) {
|
|
262
274
|
if (payload.label) {
|
|
263
|
-
this.$refs.scaffold.changeHighlightedByName([payload.label],
|
|
275
|
+
this.$refs.scaffold.changeHighlightedByName([payload.label], '', false);
|
|
264
276
|
this.$refs.scaffold.showRegionTooltip(payload.label, false, false);
|
|
265
277
|
} else {
|
|
266
278
|
const nerves = payload.connectivityInfo['nerve-label'];
|
|
267
279
|
if (nerves) {
|
|
268
|
-
const nerveLabels = nerves.flatMap(n => n.subNerves);
|
|
269
|
-
this.$refs.scaffold.changeHighlightedByName(nerveLabels,
|
|
280
|
+
const nerveLabels = nerves.flatMap((n) => n.subNerves);
|
|
281
|
+
this.$refs.scaffold.changeHighlightedByName(nerveLabels, '', false);
|
|
270
282
|
}
|
|
271
283
|
this.$refs.scaffold.hideRegionTooltip();
|
|
272
284
|
}
|
|
273
285
|
}
|
|
274
286
|
},
|
|
275
|
-
zoomToFeatures: function(info, forceSelect) {
|
|
287
|
+
zoomToFeatures: function (info, forceSelect) {
|
|
276
288
|
if (this.$refs.scaffold) {
|
|
277
|
-
let names
|
|
289
|
+
let names;
|
|
278
290
|
if (Array.isArray(info)) names = info;
|
|
279
|
-
else names = [
|
|
291
|
+
else names = [info.name];
|
|
280
292
|
if (forceSelect) {
|
|
281
|
-
this.$refs.scaffold.changeActiveByName(names,
|
|
293
|
+
this.$refs.scaffold.changeActiveByName(names, '', false);
|
|
282
294
|
}
|
|
283
295
|
this.$refs.scaffold.viewRegion(names);
|
|
284
296
|
}
|
|
@@ -296,7 +308,7 @@ export default {
|
|
|
296
308
|
}
|
|
297
309
|
}
|
|
298
310
|
this.updateViewerSettings();
|
|
299
|
-
EventBus.emit(
|
|
311
|
+
EventBus.emit('mapLoaded', this.$refs.scaffold);
|
|
300
312
|
setTimeout(() => {
|
|
301
313
|
this.setNerveGreyScale();
|
|
302
314
|
}, 500);
|
|
@@ -312,13 +324,13 @@ export default {
|
|
|
312
324
|
internalName: undefined,
|
|
313
325
|
};
|
|
314
326
|
if (resource && resource[0]) {
|
|
315
|
-
if (resource[0].data?.id === undefined || resource[0].data?.id ===
|
|
327
|
+
if (resource[0].data?.id === undefined || resource[0].data?.id === '') {
|
|
316
328
|
resource[0].data.id = resource[0].data?.group;
|
|
317
329
|
}
|
|
318
330
|
result.internalName = resource[0].data.id;
|
|
319
|
-
result.eventType =
|
|
331
|
+
result.eventType = 'highlighted';
|
|
320
332
|
}
|
|
321
|
-
this.$emit(
|
|
333
|
+
this.$emit('resource-selected', result);
|
|
322
334
|
},
|
|
323
335
|
/**
|
|
324
336
|
* Callback when the vuers emit a selected event.
|
|
@@ -327,14 +339,14 @@ export default {
|
|
|
327
339
|
if (this.mouseHovered) {
|
|
328
340
|
const result = {
|
|
329
341
|
paneIndex: this.entry.id,
|
|
330
|
-
eventType:
|
|
342
|
+
eventType: 'panZoom',
|
|
331
343
|
payload: resource,
|
|
332
344
|
type: type,
|
|
333
345
|
};
|
|
334
|
-
this.$emit(
|
|
346
|
+
this.$emit('resource-selected', result);
|
|
335
347
|
}
|
|
336
348
|
},
|
|
337
|
-
updateWithViewUrl: function(viewUrl) {
|
|
349
|
+
updateWithViewUrl: function (viewUrl) {
|
|
338
350
|
if (this.$refs.scaffold) {
|
|
339
351
|
this.$refs.scaffold.updateViewURL(viewUrl);
|
|
340
352
|
}
|
|
@@ -349,12 +361,8 @@ export default {
|
|
|
349
361
|
},
|
|
350
362
|
updateViewerSettings: function () {
|
|
351
363
|
if (this.$refs.scaffold) {
|
|
352
|
-
const {
|
|
353
|
-
|
|
354
|
-
organsDisplay,
|
|
355
|
-
outlinesDisplay,
|
|
356
|
-
viewingMode,
|
|
357
|
-
} = this.settingsStore.globalSettings;
|
|
364
|
+
const { backgroundDisplay, organsDisplay, outlinesDisplay, viewingMode } =
|
|
365
|
+
this.settingsStore.globalSettings;
|
|
358
366
|
this.$refs.scaffold.backgroundChangeCallback(backgroundDisplay);
|
|
359
367
|
this.$refs.scaffold.changeViewingMode(viewingMode);
|
|
360
368
|
this.$refs.scaffold.setColour(organsDisplay);
|
|
@@ -363,22 +371,24 @@ export default {
|
|
|
363
371
|
},
|
|
364
372
|
},
|
|
365
373
|
computed: {
|
|
366
|
-
warningMessage: function() {
|
|
367
|
-
if (
|
|
368
|
-
return
|
|
374
|
+
warningMessage: function () {
|
|
375
|
+
if (this.entry.discoverId === '307' || this.entry.discoverId === 307) {
|
|
376
|
+
return 'This map displays the anatomical location and connectivity of nerves, through which the neuron populations from the ApiNATOMY models available in SCKAN can be routed.';
|
|
369
377
|
} else {
|
|
370
|
-
return
|
|
378
|
+
return 'Under active development';
|
|
371
379
|
}
|
|
372
380
|
},
|
|
373
381
|
markerLabels: function () {
|
|
374
|
-
return this.settingsStore.globalSettings.displayMarkers
|
|
382
|
+
return this.settingsStore.globalSettings.displayMarkers
|
|
383
|
+
? this.settingsStore.numberOfDatasetsForFacets
|
|
384
|
+
: {};
|
|
375
385
|
},
|
|
376
386
|
},
|
|
377
387
|
watch: {
|
|
378
388
|
visible: {
|
|
379
389
|
handler(visible) {
|
|
380
390
|
// Only activate scaffoldvuer when the pane becomes active
|
|
381
|
-
if (visible &&
|
|
391
|
+
if (visible && !this.activated) {
|
|
382
392
|
this.activated = true;
|
|
383
393
|
this.$nextTick(() => {
|
|
384
394
|
if (this.$refs.scaffold) {
|
|
@@ -397,7 +407,7 @@ export default {
|
|
|
397
407
|
immediate: true,
|
|
398
408
|
},
|
|
399
409
|
connectivityKnowledge: {
|
|
400
|
-
handler(newVal,
|
|
410
|
+
handler(newVal, _oldVal) {
|
|
401
411
|
// Store scaffold knowledge locally
|
|
402
412
|
if (this.entry.resource in newVal) {
|
|
403
413
|
const scaffoldKnowledge = newVal[this.entry.resource];
|