@abi-software/mapintegratedvuer 1.17.3-simulation.2 → 1.17.4

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.
Files changed (47) hide show
  1. package/dist/{ConnectivityGraph-9pXPgFJR.js → ConnectivityGraph-CNtSLKGZ.js} +19 -21
  2. package/dist/{ContentMixin-DIqgKIz6.js → ContentMixin-BImmmP1E.js} +521 -295
  3. package/dist/Flatmap-CakK_75H.js +202 -0
  4. package/dist/{Iframe-CCEA3d9c.js → Iframe-C7E9XJu7.js} +2 -2
  5. package/dist/{MultiFlatmap-Cuke1uNp.js → MultiFlatmap-DnDXuvTw.js} +3 -3
  6. package/dist/{Plot-B4oTBVAT.js → Plot-CxCj3uTj.js} +2 -2
  7. package/dist/Scaffold-D1NyLNzW.js +304 -0
  8. package/dist/Simulation-Br3Grrd6.js +28 -0
  9. package/dist/{index-_b4VBGHk.js → index-qyfmiqHe.js} +22862 -27602
  10. package/dist/mapintegratedvuer.js +1 -1
  11. package/dist/mapintegratedvuer.umd.cjs +232 -4291
  12. package/dist/style-DezYtA61.js +57 -0
  13. package/dist/style.css +1 -1
  14. package/package.json +5 -10
  15. package/src/App.vue +258 -285
  16. package/src/assets/styles.scss +1 -1
  17. package/src/components/ContextCard.vue +1 -0
  18. package/src/components/EventBus.js +3 -0
  19. package/src/components/MapContent.vue +4 -9
  20. package/src/components/SplitDialog.vue +6 -2
  21. package/src/components/SplitFlow.vue +445 -504
  22. package/src/components/scripts/utilities.js +1 -1
  23. package/src/components/viewers/ConnectivityGraph.vue +1 -9
  24. package/src/components/viewers/Flatmap.vue +83 -166
  25. package/src/components/viewers/Scaffold.vue +130 -78
  26. package/src/components/viewers/Simulation.vue +11 -118
  27. package/src/components.d.ts +0 -3
  28. package/src/main.js +3 -9
  29. package/src/mixins/ContentMixin.js +384 -496
  30. package/src/mixins/DynamicMarkerMixin.js +17 -50
  31. package/src/stores/connectivities.js +10 -1
  32. package/src/stores/entries.js +1 -1
  33. package/src/stores/settings.js +0 -4
  34. package/src/stores/splitFlow.js +352 -425
  35. package/dist/Flatmap-D7GVPV7o.js +0 -103422
  36. package/dist/Scaffold-Czz8X5kL.js +0 -310
  37. package/dist/Simulation-BKmz8zwm.js +0 -107
  38. package/dist/style-CM86xE3J.js +0 -119
  39. package/src/components/DummyRouteComponent.vue +0 -1
  40. package/src/components/EventBus.ts +0 -13
  41. package/src/components/FloatingWindow.vue +0 -142
  42. package/src/components/PlotComponent.vue +0 -56
  43. package/src/services/mapping.js +0 -69
  44. package/src/services/testData.js +0 -71
  45. package/src/stores/mapping.js +0 -29
  46. package/src/stores/simulationPlotStore.js +0 -124
  47. package/src/types/simulation.js +0 -18
@@ -1,6 +1,11 @@
1
1
  <template>
2
2
  <el-container style="height: 100%; background: white">
3
- <el-header ref="header" style="text-align: left; font-size: 14px; padding: 0" height="32px" class="dialog-header">
3
+ <el-header
4
+ ref="header"
5
+ style="text-align: left; font-size: 14px; padding: 0"
6
+ height="32px"
7
+ class="dialog-header"
8
+ >
4
9
  <DialogToolbarContent
5
10
  :numberOfEntries="entries.length"
6
11
  @onFullscreen="onFullscreen"
@@ -10,10 +15,13 @@
10
15
  />
11
16
  </el-header>
12
17
  <el-main class="dialog-main">
13
- <div style="width: 100%; height: 100%; position: relative; overflow: hidden">
18
+ <div
19
+ style="width: 100%; height: 100%; position: relative; overflow: hidden"
20
+ >
14
21
  <SideBar
15
22
  ref="sideBar"
16
23
  :envVars="envVars"
24
+ :visible="sideBarVisibility"
17
25
  :class="['side-bar', { 'start-up': startUp }]"
18
26
  :open-at-start="startUp"
19
27
  :annotationEntry="annotationEntry"
@@ -59,11 +67,11 @@
59
67
 
60
68
  <script>
61
69
  /* eslint-disable no-alert, no-console */
62
- import { provide, markRaw, nextTick } from 'vue'
63
- import Tagging from '../services/tagging.js'
64
- import DialogToolbarContent from './DialogToolbarContent.vue'
65
- import EventBus from './EventBus'
66
- import SplitDialog from './SplitDialog.vue'
70
+ import { provide, markRaw } from 'vue'
71
+ import Tagging from '../services/tagging.js';
72
+ import DialogToolbarContent from "./DialogToolbarContent.vue";
73
+ import EventBus from "./EventBus";
74
+ import SplitDialog from "./SplitDialog.vue";
67
75
  // import contextCards from './context-cards'
68
76
  import { SideBar } from "@abi-software/map-side-bar";
69
77
  import "@abi-software/map-side-bar/dist/style.css";
@@ -77,11 +85,10 @@ import {
77
85
  intersectArrays,
78
86
  } from "./scripts/utilities.js";
79
87
  import { AnnotationService } from '@abi-software/sparc-annotation'
80
- import { mapStores } from 'pinia'
81
- import { useEntriesStore } from '../stores/entries'
88
+ import { mapStores } from 'pinia';
89
+ import { useEntriesStore } from '../stores/entries';
82
90
  import { useMainStore } from '../stores/index'
83
91
  import { useSettingsStore } from '../stores/settings';
84
- import { useSimulationPlotStore } from '../stores/simulationPlotStore'
85
92
  import { useSplitFlowStore } from '../stores/splitFlow';
86
93
  import { useConnectivitiesStore } from '../stores/connectivities';
87
94
  import {
@@ -91,35 +98,36 @@ import {
91
98
  } from "element-plus";
92
99
 
93
100
  const getAllFacetLabels = (children) => {
94
- const labels = []
101
+ const labels = [];
95
102
  if (children) {
96
103
  children.forEach((child) => {
97
104
  if (child.label) {
98
- labels.push(child.label.toLowerCase())
105
+ labels.push(child.label.toLowerCase());
99
106
  }
100
- labels.push(...getAllFacetLabels(child.children))
101
- })
107
+ labels.push(...getAllFacetLabels(child.children));
108
+ });
102
109
  }
103
- return labels
110
+ return labels;
104
111
  }
105
112
 
113
+
106
114
  const getAnatomyTermsForFilters = (action, availableNameCurieMapping) => {
107
- const facets = []
115
+ const facets = [];
108
116
  for (const facet of action.facets) {
109
117
  if (facet in availableNameCurieMapping) {
110
- facets.push(availableNameCurieMapping[facet])
118
+ facets.push(availableNameCurieMapping[facet]);
111
119
  } else {
112
- facets.push(facet)
120
+ facets.push(facet);
113
121
  }
114
122
  }
115
- return facets
123
+ return facets;
116
124
  }
117
125
 
118
126
  /**
119
127
  * Component of the floating dialogs.
120
128
  */
121
129
  export default {
122
- name: 'SplitFlow',
130
+ name: "SplitFlow",
123
131
  components: {
124
132
  Container,
125
133
  Header,
@@ -129,10 +137,10 @@ export default {
129
137
  SideBar,
130
138
  },
131
139
  setup() {
132
- const mainStore = useMainStore()
133
- provide('userApiKey', mainStore.userToken)
134
- const settings = useSettingsStore()
135
- let annotator = markRaw(new AnnotationService(`${settings.flatmapAPI}annotator`))
140
+ const mainStore = useMainStore();
141
+ provide('userApiKey', mainStore.userToken);
142
+ const settings = useSettingsStore();
143
+ let annotator = markRaw(new AnnotationService(`${settings.flatmapAPI}annotator`));
136
144
  provide('$annotator', annotator)
137
145
  return { annotator }
138
146
  },
@@ -150,6 +158,7 @@ export default {
150
158
  return {
151
159
  availableFacets: undefined,
152
160
  availableNameCurieMapping: undefined,
161
+ sideBarVisibility: true,
153
162
  startUp: true,
154
163
  sidebarStateRestored: false,
155
164
  sidebarAnnotationState: false,
@@ -178,330 +187,266 @@ export default {
178
187
  state: {
179
188
  handler: function (value) {
180
189
  if (value) {
181
- if (!this._externalStateSet) this.setState(value)
182
- this._externalStateSet = true
183
- this.updateGlobalSettingsFromState(value)
190
+ if (!this._externalStateSet) this.setState(value);
191
+ this._externalStateSet = true;
192
+ this.updateGlobalSettingsFromState(value);
184
193
  }
185
194
  },
186
195
  immediate: true,
187
196
  },
188
197
  connectivityHighlight: {
189
198
  handler: function () {
190
- this.hoverChanged({ tabType: 'connectivity' })
191
- this.onFilterVisibility(this.filterVisibility)
199
+ this.hoverChanged({ tabType: 'connectivity' });
200
+ this.onFilterVisibility(this.filterVisibility);
192
201
  },
193
202
  },
194
203
  annotationHighlight: {
195
204
  handler: function () {
196
- this.hoverChanged({ tabType: 'annotation' })
205
+ this.hoverChanged({ tabType: 'annotation' });
197
206
  },
198
207
  },
199
208
  },
200
209
  methods: {
201
210
  onFilterVisibility: function (state) {
202
- this.filterVisibility = state
211
+ this.filterVisibility = state;
203
212
  const filterExpression = {
204
213
  OR: [
205
214
  { NOT: { 'tile-layer': 'pathways' } },
206
- { NOT: { HAS: 'nerves' } },
215
+ { NOT: { 'HAS': 'nerves' } },
207
216
  {
208
- AND: [{ 'tile-layer': 'pathways' }, { models: this.connectivityHighlight }],
209
- },
210
- ],
211
- }
212
- const validFilter = this.filterVisibility && this.connectivityProcessed
213
- const payload = validFilter ? filterExpression : undefined
214
- EventBus.emit('filter-visibility', payload)
217
+ AND: [
218
+ { 'tile-layer': 'pathways' },
219
+ { 'models': this.connectivityHighlight }
220
+ ]
221
+ }
222
+ ]
223
+ };
224
+ const validFilter = this.filterVisibility && this.connectivityProcessed;
225
+ const payload = validFilter ? filterExpression : undefined;
226
+ EventBus.emit('filter-visibility', payload);
215
227
  },
216
228
  onConnectivityCollapseChange: function (payload) {
217
229
  this.expanded = payload.id
218
- const splitdialog = this.$refs.splitdialog
230
+ const splitdialog = this.$refs.splitdialog;
219
231
  if (splitdialog) {
220
- const activeContents = splitdialog.getActiveContents()
221
- const hasFlatmap = activeContents.find((c) => c.viewerType.includes('Flatmap'))
222
- const hasHumanMaleFlatmap = activeContents.find((c) => c.activeSpecies === 'Human Male')
232
+ const activeContents = splitdialog.getActiveContents();
233
+ const hasFlatmap = activeContents.find(c => c.viewerType.includes('Flatmap'));
234
+ const hasHumanMaleFlatmap = activeContents.find(c => c.activeSpecies === "Human Male");
223
235
  let nonFlatmapLoad = false
224
- activeContents.forEach((content) => {
225
- const isFlatmap = content.viewerType === 'Flatmap' || content.viewerType === 'MultiFlatmap'
236
+ activeContents.forEach(content => {
237
+ const isFlatmap = content.viewerType === 'Flatmap' || content.viewerType === 'MultiFlatmap';
226
238
  // minimise connectivity detail fetch
227
239
  const shouldLoad =
228
240
  (hasFlatmap && isFlatmap) ||
229
241
  (hasFlatmap && !hasHumanMaleFlatmap && !isFlatmap && !nonFlatmapLoad) ||
230
- (!hasFlatmap && !nonFlatmapLoad)
242
+ (!hasFlatmap && !nonFlatmapLoad);
231
243
 
232
244
  if (shouldLoad) {
233
- this.connectivityExplorerClicked.push(true)
234
- content.onLoadConnectivityDetail({ data: [payload] })
235
- if (!isFlatmap) nonFlatmapLoad = true
245
+ this.connectivityExplorerClicked.push(true);
246
+ content.onLoadConnectivityDetail({ data: [payload] });
247
+ if (!isFlatmap) nonFlatmapLoad = true;
236
248
  }
237
- })
249
+ });
238
250
  }
239
251
  },
240
252
  onConnectivityItemClose: function () {
241
- EventBus.emit('connectivity-item-close')
253
+ EventBus.emit('connectivity-item-close');
242
254
  },
243
255
  getActiveFlatmaps: function () {
244
- const activeFlatmaps = []
245
- let splitdialog = this.$refs.splitdialog
256
+ const activeFlatmaps = [];
257
+ let splitdialog = this.$refs.splitdialog;
246
258
 
247
259
  if (splitdialog) {
248
- const activeContents = splitdialog.getActiveContents()
260
+ const activeContents = splitdialog.getActiveContents();
249
261
 
250
- activeContents.forEach((content) => {
262
+ activeContents.forEach(content => {
251
263
  if (content?.$refs['viewer']) {
252
- const contentViewer = content.$refs['viewer']
253
- const flatmapRef = contentViewer.flatmapRef
254
- const multiflatmapRef = contentViewer.multiflatmapRef
255
- let flatmap = null
264
+ const contentViewer = content.$refs['viewer'];
265
+ const flatmapRef = contentViewer.flatmapRef;
266
+ const multiflatmapRef = contentViewer.multiflatmapRef;
267
+ let flatmap = null;
256
268
 
257
- if (flatmapRef) flatmap = flatmapRef
258
- if (multiflatmapRef) flatmap = multiflatmapRef.getCurrentFlatmap()
269
+ if (flatmapRef) flatmap = flatmapRef;
270
+ if (multiflatmapRef) flatmap = multiflatmapRef.getCurrentFlatmap();
259
271
 
260
272
  if (flatmap) {
261
- activeFlatmaps.push(flatmap)
273
+ activeFlatmaps.push(flatmap);
262
274
  }
263
275
  }
264
- })
276
+ });
265
277
  }
266
- return activeFlatmaps
278
+ return activeFlatmaps;
267
279
  },
268
280
  /**
269
281
  * Callback when an action is performed (open new dialogs).
270
282
  */
271
283
  actionClick: function (action) {
272
284
  if (action) {
273
- if (!this.availableFacets || this.availableFacets.length === 0) {
274
- const availableFacetsRaw = localStorage.getItem('available-anatomy-facets')
275
- const availableFacetsAll = availableFacetsRaw ? JSON.parse(availableFacetsRaw) : []
285
+ if (!this.availableFacets || (this.availableFacets.length === 0)) {
286
+ const availableFacetsRaw = localStorage.getItem('available-anatomy-facets');
287
+ const availableFacetsAll = availableFacetsRaw ? JSON.parse(availableFacetsRaw) : [];
276
288
 
277
289
  // get label values
278
- this.availableFacets = markRaw([...new Set(getAllFacetLabels(availableFacetsAll))])
290
+ this.availableFacets = markRaw([...new Set(getAllFacetLabels(availableFacetsAll))]);
279
291
  }
280
292
 
281
- if (!this.availableNameCurieMapping || Object.keys(this.availableNameCurieMapping).length === 0) {
282
- const availableDataRaw = localStorage.getItem('available-name-curie-mapping')
283
- const availableData = availableDataRaw ? JSON.parse(availableDataRaw) : {}
293
+ if (!this.availableNameCurieMapping || (Object.keys(this.availableNameCurieMapping).length === 0)) {
294
+ const availableDataRaw = localStorage.getItem('available-name-curie-mapping');
295
+ const availableData = availableDataRaw ? JSON.parse(availableDataRaw) : {};
284
296
 
285
297
  // get label values
286
- this.availableNameCurieMapping = markRaw(availableData)
298
+ this.availableNameCurieMapping = markRaw(availableData);
287
299
  }
288
300
 
289
- if (action.type == 'Search') {
301
+ if (action.type == "Search") {
290
302
  if (action.nervePath) {
291
- this.openSearch([action.filter], action.label)
303
+ this.openSearch([action.filter], action.label);
292
304
  } else {
293
- this.openSearch([], action.term)
305
+ this.openSearch([], action.term);
294
306
  // GA Tagging
295
307
  // Event tracking for map action search/filter data
296
308
  const eventName = action.featuredDataset
297
309
  ? 'portal_maps_featured_dataset_search'
298
- : 'portal_maps_action_search'
310
+ : 'portal_maps_action_search';
299
311
  Tagging.sendEvent({
300
- event: 'interaction_event',
301
- event_name: eventName,
302
- category: action.term || 'filter',
303
- location: 'map_location_pin',
304
- })
305
- this.filterTriggered = true
312
+ 'event': 'interaction_event',
313
+ 'event_name': eventName,
314
+ 'category': action.term || 'filter',
315
+ 'location': 'map_location_pin'
316
+ });
317
+ this.filterTriggered = true;
306
318
  }
307
- } else if (action.type == 'URL') {
308
- window.open(action.resource, '_blank')
309
- } else if (action.type == 'Facet') {
319
+ } else if (action.type == "URL") {
320
+ window.open(action.resource, "_blank");
321
+ } else if (action.type == "Facet") {
310
322
  if (this.$refs.sideBar) {
311
323
  const sendAction = {
312
- facetPropPath: 'anatomy.organ.category.name',
313
- facetSubPropPath: 'anatomy.organ.name',
314
- term: 'Anatomical structure',
315
- }
316
- const filters = []
317
- const facets = getAnatomyTermsForFilters(action, this.availableNameCurieMapping)
318
- const facetString = action.facets.join(', ')
319
- facets.forEach((facet) => filters.push({ ...sendAction, facet }))
320
- this.$refs.sideBar.addFilter(filters)
324
+ facetPropPath: "anatomy.organ.category.name",
325
+ facetSubPropPath: "anatomy.organ.name",
326
+ term: "Anatomical structure",
327
+ };
328
+ const filters = [];
329
+ const facets = getAnatomyTermsForFilters(action, this.availableNameCurieMapping);
330
+ const facetString = action.facets.join(', ');
331
+ facets.forEach(facet => filters.push({...sendAction, facet}));
332
+ this.$refs.sideBar.addFilter(filters);
321
333
  // GA Tagging
322
334
  // Event tracking for map action search/filter data
323
335
  Tagging.sendEvent({
324
- event: 'interaction_event',
325
- event_name: 'portal_maps_action_filter',
326
- category: facetString || 'filter_reset',
327
- location: 'map_location_pin',
328
- })
329
- this.filterTriggered = true
336
+ 'event': 'interaction_event',
337
+ 'event_name': 'portal_maps_action_filter',
338
+ 'category': facetString || 'filter_reset',
339
+ 'location': 'map_location_pin'
340
+ });
341
+ this.filterTriggered = true;
330
342
  }
331
- } else if (action.type == 'Facets') {
332
- const facets = []
333
- const facetsArray = getAnatomyTermsForFilters(action, this.availableNameCurieMapping)
334
- const filterValuesArray = intersectArrays(this.availableFacets, facetsArray)
335
- const filterValues = filterValuesArray.join(', ')
343
+ } else if (action.type == "Facets") {
344
+ const facets = [];
345
+ const facetsArray = getAnatomyTermsForFilters(action, this.availableNameCurieMapping);
346
+ const filterValuesArray = intersectArrays(this.availableFacets, facetsArray);
347
+ const filterValues = filterValuesArray.join(', ');
336
348
 
337
- this.settingsStore.facets.species.forEach((e) => {
349
+ this.settingsStore.facets.species.forEach(e => {
338
350
  facets.push({
339
351
  facet: capitalise(e),
340
- term: 'Species',
341
- facetPropPath: 'organisms.primary.species.name',
342
- })
343
- })
352
+ term: "Species",
353
+ facetPropPath: "organisms.primary.species.name",
354
+ });
355
+ });
344
356
  facets.push(
345
- ...filterValuesArray.map((val) => ({
357
+ ...filterValuesArray.map(val => ({
346
358
  facet: capitalise(val),
347
- term: 'Anatomical structure',
348
- facetPropPath: 'anatomy.organ.category.name',
349
- facetSubPropPath: 'anatomy.organ.name',
359
+ term: "Anatomical structure",
360
+ facetPropPath: "anatomy.organ.category.name",
361
+ facetSubPropPath: "anatomy.organ.name",
350
362
  }))
351
- )
352
- this.openSearch(facets, '')
363
+ );
364
+ this.openSearch(facets, "")
353
365
  // GA Tagging
354
366
  // Event tracking for map action search/filter data
355
367
  Tagging.sendEvent({
356
- event: 'interaction_event',
357
- event_name: 'portal_maps_action_filter',
358
- category: filterValues || 'filter_reset',
359
- location: 'map_popup_button',
360
- })
361
- this.filterTriggered = true
362
- } else if (action.type == 'Simulation' && action.flatmapUUID) {
363
- Tagging.sendEvent({
364
- event: 'interaction_event',
365
- event_name: 'flatmaps_simulation_popup_click',
366
- category: 'simulation',
367
- location: 'flatmap_feature',
368
- })
369
- const splitFlowState = this.splitFlowStore.getState()
370
- let entryId = this.simulationPlotStore.getEntryIdWithResource(action)
371
- if (splitFlowState.activeView === 'singlepanel') {
372
- if (!entryId) {
373
- entryId= this.createNewEntry(action)
374
- this.splitFlowStore.setIdToPane(action.requesterEntryId)
375
- }
376
- const newView = {
377
- view: '2vertpanel',
378
- 'pane-1': { id: action.requesterEntryId },
379
- 'pane-2': { id: entryId },
380
- entries: this.entries,
381
- }
382
- this.splitFlowStore.updateActiveView(newView)
383
- this.splitFlowStore.setIdToPane(entryId, 'pane-2')
384
- // nextTick(() => {
385
- // const newView = {
386
- // view: '2vertpanel',
387
- // 'pane-1': { id: action.requesterEntryId },
388
- // 'pane-2': { id: newEntry },
389
- // }
390
- // this.splitFlowStore.updateActiveView(newView)
391
- // })
392
- } else if (splitFlowState.activeView === '2vertpanel') {
393
- if (entryId) {
394
- this.splitFlowStore.setIdToPane(entryId, 'pane-2')
395
- } else {
396
- this.createNewEntry(action, 'pane-2')
397
- }
398
- // const newView = {
399
- // view: splitFlowState.activeView,
400
- // 'pane-1': { id: action.requesterEntryId },
401
- // 'pane-2': { id: newEntryId },
402
- // }
403
- // this.splitFlowStore.updateActiveView(newView, false)
404
- // splitFlowState.customLayout
405
- // this.splitFlowStore.updateActiveView(newView)
406
- }
407
- } else if (action.type == 'ProtocolSearch') {
408
- if (action.protocol) {
409
- this.$refs.sideBar.displayFileInfo(
410
- Number(action.protocol.dataset_id), action.term, "reveal");
411
- }
412
- } else if (action.type == 'Protocol') {
413
- this.trackGalleryClick(action);
414
- let entryId = this.simulationPlotStore.runExperimentalData(action);
415
- if (entryId) {
416
- if (!this.splitFlowStore.isIdVisible(entryId)) {
417
- this.splitFlowStore.setIdToPane(entryId, 'pane-1')
418
- }
419
- this.$refs.sideBar.close()
420
- } else {
421
- const entryId = this.createNewEntry(action);
422
- this.$nextTick(() =>
423
- EventBus.emit('simulation-experimental-data', {
424
- targetEntryId: entryId,
425
- action: action,
426
- })
427
- )
428
- }
368
+ 'event': 'interaction_event',
369
+ 'event_name': 'portal_maps_action_filter',
370
+ 'category': filterValues || 'filter_reset',
371
+ 'location': 'map_popup_button'
372
+ });
373
+ this.filterTriggered = true;
429
374
  } else {
430
- this.trackGalleryClick(action)
431
- this.createNewEntry(action)
375
+ this.trackGalleryClick(action);
376
+ this.createNewEntry(action);
432
377
  }
433
378
  }
434
379
  },
435
380
  trackGalleryClick: function (action) {
436
- const categoryValues = []
437
- const { label, type, datasetId, discoverId, resource } = action
438
- let filePath = ''
439
- let id = datasetId ? datasetId : discoverId
440
- if (label) categoryValues.push(label)
441
- if (type) categoryValues.push(type)
442
- if (datasetId) categoryValues.push('(' + id + ')')
381
+ const categoryValues = [];
382
+ const { label, type, datasetId, discoverId, resource } = action;
383
+ let filePath = '';
384
+ let id = datasetId ? datasetId : discoverId;
385
+ if (label) categoryValues.push(label);
386
+ if (type) categoryValues.push(type);
387
+ if (datasetId) categoryValues.push('(' + id + ')');
443
388
  if (resource) {
444
- if (type === 'Plot') {
445
- filePath = resource.dataSource.url
389
+ if (type === "Plot") {
390
+ filePath = resource.dataSource.url;
446
391
  } else {
447
- filePath = typeof resource === 'string' ? resource : resource.share_link
392
+ filePath = typeof resource === 'string' ? resource : resource.share_link;
448
393
  }
449
394
  }
450
395
 
451
396
  // GA Tagging
452
397
  // Event tracking for map sidebar gallery click
453
398
  Tagging.sendEvent({
454
- event: 'interaction_event',
455
- event_name: 'portal_maps_gallery_click',
456
- category: categoryValues.join(' '),
457
- location: 'map_sidebar_gallery',
458
- dataset_id: id ? id + '' : '', // change to string format
459
- file_path: filePath,
460
- })
399
+ 'event': 'interaction_event',
400
+ 'event_name': 'portal_maps_gallery_click',
401
+ 'category': categoryValues.join(' '),
402
+ 'location': 'map_sidebar_gallery',
403
+ 'dataset_id': id ? id + '' : '', // change to string format
404
+ 'file_path': filePath,
405
+ });
461
406
  },
462
407
  onDisplaySearch: function (payload, tracking = true) {
463
- let searchFound = false
408
+ let searchFound = false;
464
409
  //Search all active viewers when global callback is on
465
- let splitdialog = this.$refs.splitdialog
410
+ let splitdialog = this.$refs.splitdialog;
466
411
  if (splitdialog) {
467
- const activeContents = splitdialog.getActiveContents()
468
- activeContents.forEach((content) => {
412
+ const activeContents = splitdialog.getActiveContents();
413
+ activeContents.forEach(content => {
469
414
  if (content.search(payload.term)) {
470
- searchFound = true
415
+ searchFound = true;
471
416
  }
472
- })
417
+ });
473
418
  }
474
- this.$refs.dialogToolbar.setFailedSearch(searchFound ? undefined : payload.term)
419
+ this.$refs.dialogToolbar.setFailedSearch(searchFound ? undefined : payload.term);
475
420
 
476
421
  if (tracking) {
477
422
  // GA Tagging
478
423
  // Event tracking for map on display search
479
424
  Tagging.sendEvent({
480
- event: 'interaction_event',
481
- event_name: 'portal_maps_display_search',
482
- category: payload.term,
483
- location: 'map_toolbar',
484
- })
425
+ 'event': 'interaction_event',
426
+ 'event_name': 'portal_maps_display_search',
427
+ 'category': payload.term,
428
+ 'location': 'map_toolbar'
429
+ });
485
430
  }
486
431
  },
487
- fetchSuggestions: function (payload) {
488
- const suggestions = []
432
+ fetchSuggestions: function(payload) {
433
+ const suggestions = [];
489
434
  //Search all active viewers when global callback is on
490
- let splitdialog = this.$refs.splitdialog
491
- const activeContents = splitdialog.getActiveContents()
435
+ let splitdialog = this.$refs.splitdialog;
436
+ const activeContents = splitdialog.getActiveContents();
492
437
  //Push new suggestions into the pre-existing suggestions array
493
- activeContents.forEach((content) => content.searchSuggestions(payload.data.term, suggestions))
494
- const parsed = []
438
+ activeContents.forEach(content => content.searchSuggestions(payload.data.term, suggestions));
439
+ const parsed = [];
495
440
  //Remove double quote as it is used as a speical character
496
- suggestions.forEach((suggestion) => {
497
- parsed.push(suggestion.replaceAll('"', ''))
498
- })
499
- const unique = new Set(parsed)
500
- suggestions.length = 0
441
+ suggestions.forEach(suggestion => {
442
+ parsed.push(suggestion.replaceAll("\"", ""));
443
+ });
444
+ const unique = new Set(parsed);
445
+ suggestions.length = 0;
501
446
  for (const item of unique) {
502
- suggestions.push({ value: '"' + item + '"' })
447
+ suggestions.push({"value": "\"" + item +"\""});
503
448
  }
504
- payload.data.cb(suggestions)
449
+ payload.data.cb(suggestions);
505
450
  },
506
451
  /**
507
452
  * This event is emitted when the show connectivity button in sidebar is clicked.
@@ -510,23 +455,23 @@ export default {
510
455
  */
511
456
  onShowConnectivity: function (featureIds) {
512
457
  if (featureIds.length) {
513
- const splitFlowState = this.splitFlowStore.getState()
514
- const activeView = splitFlowState?.activeView || ''
458
+ const splitFlowState = this.splitFlowStore.getState();
459
+ const activeView = splitFlowState?.activeView || '';
515
460
  // offset sidebar only on singlepanel and 2horpanel views
516
461
  EventBus.emit('show-connectivity', {
517
462
  featureIds: featureIds,
518
- offset: activeView === 'singlepanel' || activeView === '2horpanel',
519
- })
463
+ offset: activeView === 'singlepanel' || activeView === '2horpanel'
464
+ });
520
465
  }
521
466
  },
522
467
  openConnectivityInfo: async function (payload) {
523
468
  // expand connectivity card and show connectivity info
524
469
  // if expanded exist, payload should be an array of one element
525
470
  // skip payload not match the expanded in multiple views
526
- const isMatched = payload.some((entry) => entry.featureId[0] === this.expanded)
471
+ const isMatched = payload.some(entry => entry.featureId[0] === this.expanded);
527
472
  if (this.expanded && this.connectivityExplorerClicked.length && !isMatched) {
528
- this.connectivityExplorerClicked.pop()
529
- return
473
+ this.connectivityExplorerClicked.pop();
474
+ return;
530
475
  }
531
476
 
532
477
  // Remove duplicate items from payload
@@ -537,9 +482,9 @@ export default {
537
482
  label: entry.title,
538
483
  id: entry.featureId[0],
539
484
  }
540
- const ck = this.connectivityKnowledge.find((ck) => ck.id === result.id)
485
+ const ck = this.connectivityKnowledge.find(ck => ck.id === result.id);
541
486
  if (entry.ready) {
542
- result['nerve-label'] = entry['nerve-label'] || ck['nerve-label']
487
+ result['nerve-label'] = entry['nerve-label'] || ck['nerve-label'];
543
488
  }
544
489
  if (ck && ck['long-label']) {
545
490
  result['long-label'] = ck['long-label'];
@@ -562,8 +507,8 @@ export default {
562
507
 
563
508
  if (this.connectivityExplorerClicked.length) {
564
509
  // only remove clicked if not placeholder entry
565
- if (this.connectivityEntry.every((entry) => entry.ready)) {
566
- this.connectivityExplorerClicked.pop()
510
+ if (this.connectivityEntry.every(entry => entry.ready)) {
511
+ this.connectivityExplorerClicked.pop();
567
512
  }
568
513
  } else {
569
514
  // click on the flatmap paths/features directly
@@ -603,54 +548,55 @@ export default {
603
548
  }
604
549
 
605
550
  if (this.$refs.sideBar) {
606
- this.$refs.sideBar.tabClicked({ id: 2, type: 'connectivityExplorer' })
607
- this.$refs.sideBar.setDrawerOpen(true)
551
+ this.$refs.sideBar.tabClicked({ id: 2, type: 'connectivityExplorer' });
552
+ this.$refs.sideBar.setDrawerOpen(true);
608
553
  }
609
554
  }
610
555
  },
611
556
  openAnnotation: function (payload) {
612
- this.annotationEntry = payload.annotationEntry
557
+ this.annotationEntry = payload.annotationEntry;
613
558
  // If drawing, `entry.models` may be undefined; use an empty array instead of [undefined]
614
559
  // to prevent errors on highlight
615
- this.annotationHighlight = this.annotationEntry.map((entry) => entry.models).filter(Boolean)
560
+ this.annotationHighlight = this.annotationEntry.map(entry => entry.models).filter(Boolean);
616
561
  if (payload.commitCallback) {
617
- this.annotationCallback = markRaw(payload.commitCallback)
562
+ this.annotationCallback = markRaw(payload.commitCallback);
618
563
  }
619
564
  if (!payload.createData) {
620
- this.createData = markRaw({})
565
+ this.createData = markRaw({});
621
566
  } else {
622
- this.createData = markRaw(payload.createData)
567
+ this.createData = markRaw(payload.createData);
623
568
  }
624
569
  if (payload.confirmCreate) {
625
- this.confirmCreateCallback = markRaw(payload.confirmCreate)
570
+ this.confirmCreateCallback = markRaw(payload.confirmCreate);
626
571
  }
627
572
  if (payload.cancelCreate) {
628
- this.cancelCreateCallback = markRaw(payload.cancelCreate)
573
+ this.cancelCreateCallback = markRaw(payload.cancelCreate);
629
574
  }
630
575
  if (payload.confirmDelete) {
631
- this.confirmDeleteCallback = markRaw(payload.confirmDelete)
576
+ this.confirmDeleteCallback = markRaw(payload.confirmDelete);
632
577
  }
633
578
  if (payload.confirmComment) {
634
- this.confirmCommentCallback = markRaw(payload.confirmComment)
579
+ this.confirmCommentCallback = markRaw(payload.confirmComment);
635
580
  }
636
581
  if (this.$refs.sideBar) {
637
- this.$refs.sideBar.tabClicked({ id: 3, type: 'annotation' })
638
- this.$refs.sideBar.setDrawerOpen(true)
582
+ this.$refs.sideBar.tabClicked({id: 3, type: 'annotation'});
583
+ this.$refs.sideBar.setDrawerOpen(true);
639
584
  }
640
585
  },
641
586
  onShowReferenceConnectivities: function (refSource) {
642
- EventBus.emit('show-reference-connectivities', refSource)
587
+ EventBus.emit('show-reference-connectivities', refSource);
643
588
  },
644
589
  onConnectivityHovered: function (data) {
645
- EventBus.emit('connectivity-hovered', data)
590
+ EventBus.emit('connectivity-hovered', data);
646
591
  },
647
592
  onConnectivitySourceChange: function (data) {
648
- this.connectivityExplorerClicked.push(true)
649
- EventBus.emit('connectivity-source-change', data)
593
+ this.connectivityExplorerClicked.push(true);
594
+ EventBus.emit('connectivity-source-change', data);
650
595
  },
651
596
  onShowConnectivityGraph: function (data) {
652
597
  const previousPrimaryId = this.splitFlowStore.customLayout?.['pane-1']?.id;
653
598
  const connectivityGraphId = this.createNewEntry({
599
+ connectivityInfo: data.connectivityInfo,
654
600
  resource: data.entry,
655
601
  type: 'ConnectivityGraph',
656
602
  label: data.title || data.label || data.entry ||'Connectivity Graph',
@@ -662,7 +608,7 @@ export default {
662
608
  this.splitFlowStore.updateActiveView({
663
609
  view: '2vertpanel',
664
610
  entries: this.entries,
665
- }, true, false);
611
+ }, false);
666
612
 
667
613
  if (previousPrimaryId && previousPrimaryId !== connectivityGraphId) {
668
614
  this.splitFlowStore.assignOrSwapPaneWithIds({
@@ -681,149 +627,141 @@ export default {
681
627
  this.splitFlowStore.updateSplitPanels();
682
628
  },
683
629
  hoverChanged: function (data) {
684
- let hoverAnatomies = [],
685
- hoverOrgans = [],
686
- hoverDOI = '',
687
- hoverConnectivity = []
630
+ let hoverAnatomies = [], hoverOrgans = [], hoverDOI = '', hoverConnectivity = [];
688
631
  if (data.tabType === 'dataset') {
689
- hoverAnatomies = data.anatomy ? data.anatomy : []
690
- hoverOrgans = data.organs ? data.organs : []
691
- hoverDOI = data.doi ? data.doi : ''
632
+ hoverAnatomies = data.anatomy ? data.anatomy : [];
633
+ hoverOrgans = data.organs ? data.organs : [];
634
+ hoverDOI = data.doi ? data.doi : '';
692
635
  } else if (data.tabType === 'connectivity') {
693
- hoverConnectivity = data.id ? [data.id] : this.connectivityHighlight
694
- hoverOrgans = data['nerve-label'] ? data['nerve-label'].flatMap((nerve) => nerve.subNerves) : []
636
+ hoverConnectivity = data.id ? [data.id] : this.connectivityHighlight;
637
+ hoverOrgans = data['nerve-label'] ? data['nerve-label'].flatMap(nerve => nerve.subNerves) : [];
695
638
  } else if (data.tabType === 'annotation') {
696
- hoverConnectivity = data.models ? [data.models] : this.annotationHighlight
639
+ hoverConnectivity = data.models ? [data.models] : this.annotationHighlight;
697
640
  }
698
- this.settingsStore.updateHoverFeatures(hoverAnatomies, hoverOrgans, hoverDOI, hoverConnectivity)
699
- EventBus.emit('hoverUpdate', { connectivityProcessed: this.connectivityProcessed })
641
+ this.settingsStore.updateHoverFeatures(hoverAnatomies, hoverOrgans, hoverDOI, hoverConnectivity);
642
+ EventBus.emit("hoverUpdate", { connectivityProcessed: this.connectivityProcessed });
700
643
  },
701
644
  searchChanged: function (data) {
702
645
  if (data.tabType === 'dataset') {
703
- if (data && data.type == 'reset-update') {
704
- this.settingsStore.updateAppliedFacets([])
646
+ if (data && data.type == "reset-update") {
647
+ this.settingsStore.updateAppliedFacets([]);
705
648
  }
706
- if (data && data.type == 'query-update') {
707
- this.search = data.value
649
+ if (data && data.type == "query-update") {
650
+ this.search = data.value;
708
651
  if (this.search && !this.filterTriggered) {
709
652
  // GA Tagging
710
653
  // Event tracking for map action search/filter data
711
654
  Tagging.sendEvent({
712
- event: 'interaction_event',
713
- event_name: 'portal_maps_action_search',
714
- category: this.search,
715
- location: 'map_sidebar_dataset_search',
716
- })
655
+ 'event': 'interaction_event',
656
+ 'event_name': 'portal_maps_action_search',
657
+ 'category': this.search,
658
+ 'location': 'map_sidebar_dataset_search'
659
+ });
717
660
  }
718
- this.filterTriggered = false // reset for next action
661
+ this.filterTriggered = false; // reset for next action
719
662
  }
720
- if (data && data.type == 'filter-update') {
721
- this.settingsStore.updateFacets(data.value)
663
+ if (data && data.type == "filter-update") {
664
+ this.settingsStore.updateFacets(data.value);
722
665
  // Remove filter event from maps' popup
723
666
  if (!this.filterTriggered) {
724
- const filterValuesArray = data.value
725
- .filter((val) => {
726
- return val.facet && val.facet.toLowerCase() !== 'show all'
727
- })
728
- .map((val) => val.facet)
729
- const labels = filterValuesArray.map((val) => val.toLowerCase())
730
- const newFacets = [...new Set([...labels])]
731
- this.settingsStore.updateAppliedFacets(newFacets)
732
- const filterValues = filterValuesArray.join(', ')
667
+ const filterValuesArray = data.value.filter((val) => {
668
+ return val.facet && val.facet.toLowerCase() !== 'show all';
669
+ }).map((val) => val.facet);
670
+ const labels = filterValuesArray.map((val) => val.toLowerCase());
671
+ const newFacets = [...new Set([...labels])];
672
+ this.settingsStore.updateAppliedFacets(newFacets);
673
+ const filterValues = filterValuesArray.join(', ');
733
674
  // GA Tagging
734
675
  // Event tracking for map action search/filter data
735
676
  Tagging.sendEvent({
736
- event: 'interaction_event',
737
- event_name: 'portal_maps_action_filter',
738
- category: filterValues || 'filter_reset',
739
- location: 'map_sidebar_dataset_filter',
740
- })
677
+ 'event': 'interaction_event',
678
+ 'event_name': 'portal_maps_action_filter',
679
+ 'category': filterValues || 'filter_reset',
680
+ 'location': 'map_sidebar_dataset_filter'
681
+ });
741
682
  }
742
- this.filterTriggered = false // reset for next action
683
+ this.filterTriggered = false; // reset for next action
743
684
  }
744
685
  } else if (data.tabType === 'connectivity') {
745
- if (data && data.type == 'reset-update') {
746
- const activeFlatmaps = this.getActiveFlatmaps()
686
+ if (data && data.type == "reset-update") {
687
+ const activeFlatmaps = this.getActiveFlatmaps();
747
688
  activeFlatmaps.forEach((activeFlatmap) => {
748
- activeFlatmap.resetConnectivityfilters(data.value)
749
- })
689
+ activeFlatmap.resetConnectivityfilters(data.value);
690
+ });
750
691
  } else {
751
- this.expanded = ''
752
- this.connectivityEntry = []
692
+ this.expanded = '';
693
+ this.connectivityEntry = [];
753
694
  // update connectivity filters in flatmap
754
- const activeFlatmaps = this.getActiveFlatmaps()
695
+ const activeFlatmaps = this.getActiveFlatmaps();
755
696
  activeFlatmaps.forEach((activeFlatmap) => {
756
- activeFlatmap.updateConnectivityFilters(data.filter)
757
- })
758
- EventBus.emit('connectivity-query-filter', data)
697
+ activeFlatmap.updateConnectivityFilters(data.filter);
698
+ });
699
+ EventBus.emit("connectivity-query-filter", data);
759
700
 
760
- const filterValues = data.filter
761
- .filter((f) => f.facet && f.facet.toLowerCase() !== 'show all')
701
+ const filterValues = data.filter.filter(f => (f.facet && f.facet.toLowerCase() !== 'show all'))
762
702
  .map((f) => f.tagLabel)
763
- .join(', ')
764
- const searchValue = data.query
703
+ .join(', ');
704
+ const searchValue = data.query;
765
705
 
766
706
  if (filterValues) {
767
707
  Tagging.sendEvent({
768
- event: 'interaction_event',
769
- event_name: 'portal_maps_action_filter',
770
- category: filterValues,
771
- location: 'map_sidebar_connectivity_filter',
772
- })
708
+ 'event': 'interaction_event',
709
+ 'event_name': 'portal_maps_action_filter',
710
+ 'category': filterValues,
711
+ 'location': 'map_sidebar_connectivity_filter'
712
+ });
773
713
  }
774
714
 
775
715
  if (searchValue) {
776
716
  Tagging.sendEvent({
777
- event: 'interaction_event',
778
- event_name: 'portal_maps_action_search',
779
- category: searchValue,
780
- location: 'map_sidebar_connectivity_search',
781
- })
717
+ 'event': 'interaction_event',
718
+ 'event_name': 'portal_maps_action_search',
719
+ 'category': searchValue,
720
+ 'location': 'map_sidebar_connectivity_search'
721
+ });
782
722
  }
783
723
  }
784
724
  }
785
725
  },
786
726
  updateMarkers: function (data) {
787
- this.settingsStore.updateMarkers(data)
788
- EventBus.emit('markerUpdate')
727
+ this.settingsStore.updateMarkers(data);
728
+ EventBus.emit("markerUpdate");
789
729
  },
790
730
  updateScaffoldMarkers: function (data) {
791
- this.settingsStore.updateNumberOfDatasetsForFacets(data)
731
+ this.settingsStore.updateNumberOfDatasetsForFacets(data);
792
732
  },
793
- getNewEntryId: function () {
733
+ getNewEntryId: function() {
794
734
  if (this.entries.length) {
795
- return this.entries[this.entries.length - 1].id + 1
735
+ return (this.entries[this.entries.length - 1]).id + 1;
796
736
  }
797
- return 1
737
+ return 1;
798
738
  },
799
739
  /**
800
740
  * Add new entry which will sequentially create a
801
741
  * new dialog.
802
742
  */
803
- createNewEntry: function (data, pane = 'pane-1') {
804
- let newEntry = {}
805
- newEntry.viewUrl = undefined
806
- newEntry.state = undefined
807
- Object.assign(newEntry, data)
808
- if (newEntry.type === "Protocol") {
809
- newEntry.type = "Simulation"
810
- }
811
- newEntry.mode = 'normal'
812
- newEntry.id = this.getNewEntryId()
813
- newEntry.discoverId = data.discoverId
814
- this.entriesStore.addNewEntry(newEntry)
815
- this.splitFlowStore.setIdToPane(newEntry.id, pane)
743
+ createNewEntry: function (data) {
744
+ let newEntry = {};
745
+ newEntry.viewUrl = undefined;
746
+ newEntry.state = undefined;
747
+ Object.assign(newEntry, data);
748
+ newEntry.mode = "normal";
749
+ newEntry.id = this.getNewEntryId();
750
+ newEntry.discoverId = data.discoverId;
751
+ this.entriesStore.addNewEntry(newEntry);
752
+ this.splitFlowStore.setIdToPrimaryPane(newEntry.id);
816
753
  //close sidebar on entry creation to see the context card
817
754
  if (this.$refs.sideBar) {
818
- this.$refs.sideBar.setDrawerOpen(false)
755
+ this.$refs.sideBar.setDrawerOpen(false);
819
756
  }
820
- return newEntry.id
757
+
758
+ return newEntry.id;
821
759
  },
822
760
  openNewMap: async function (type) {
823
- const entry = await getNewMapEntry(type, this.settingsStore.sparcApi)
824
- this.createNewEntry(entry)
761
+ const entry = await getNewMapEntry(type, this.settingsStore.sparcApi);
762
+ this.createNewEntry(entry);
825
763
  if (entry.contextCard) {
826
- EventBus.emit('contextUpdate', entry.contextCard)
764
+ EventBus.emit("contextUpdate", entry.contextCard);
827
765
  }
828
766
  },
829
767
  openSearch: function (facets, query) {
@@ -832,37 +770,40 @@ export default {
832
770
  // this.settingsStore.facets.species.forEach(e => {
833
771
  // facets.push({facet: e, facetPropPath: 'organisms.primary.species.name', term:'species'});
834
772
  // });
835
- this.search = query
836
- this._facets = facets
773
+ this.search = query;
774
+ this._facets = facets;
837
775
  if (this.$refs && this.$refs.sideBar) {
838
- this.$refs.sideBar.openSearch(facets, query)
839
- this.$refs.sideBar.tabClicked({ id: 1, type: 'datasetExplorer' })
776
+ this.$refs.sideBar.openSearch(facets, query);
777
+ this.$refs.sideBar.tabClicked({id: 1, type: 'datasetExplorer'});
840
778
  }
841
- this.startUp = false
779
+ this.startUp = false;
842
780
  },
843
781
  onFullscreen: function (val) {
844
- this.$emit('onFullscreen', val)
782
+ this.$emit("onFullscreen", val);
845
783
  },
846
784
  resetApp: function () {
847
- this.setState(initialDefaultState())
785
+ this.setState(initialDefaultState());
786
+ },
787
+ setIdToPrimaryPane: function (id) {
788
+ this.splitFlowStore.setIdToPrimaryPane(id);
848
789
  },
849
790
  restoreConnectivityEntries: function (connectivityEntries) {
850
- const activeFlatmaps = this.getActiveFlatmaps()
791
+ const activeFlatmaps = this.getActiveFlatmaps();
851
792
  activeFlatmaps.forEach((activeFlatmap) => {
852
793
  const featureIds = connectivityEntries.map((entry) => {
853
- const featureId = activeFlatmap.mapImp.modelFeatureIds(entry)[0]
854
- const feature = activeFlatmap.mapImp.featureProperties(featureId)
794
+ const featureId = activeFlatmap.mapImp.modelFeatureIds(entry)[0];
795
+ const feature = activeFlatmap.mapImp.featureProperties(featureId);
855
796
  const data = {
856
797
  resource: [feature.models],
857
798
  feature: feature,
858
799
  label: feature.label,
859
800
  provenanceTaxonomy: feature.taxons,
860
801
  alert: feature.alert,
861
- }
862
- return data
863
- })
802
+ };
803
+ return data;
804
+ });
864
805
  activeFlatmap.checkAndCreatePopups(featureIds, true)
865
- })
806
+ });
866
807
  },
867
808
  restoreSidebarState: function (state) {
868
809
  // Restore sidebar state only if
@@ -870,269 +811,269 @@ export default {
870
811
  // - sidebar component is loaded
871
812
  // - connectivity knowledge is loaded
872
813
  // - if sidebar state is not restored yet
873
- const sidebarState = state?.sidebar
814
+ const sidebarState = state?.sidebar;
874
815
  if (!this.sidebarStateRestored && sidebarState && this.$refs.sideBar && this.connectivityKnowledge?.length) {
875
816
  if (sidebarState.connectivityEntries?.length) {
876
- this.restoreConnectivityEntries(sidebarState.connectivityEntries)
817
+ this.restoreConnectivityEntries(sidebarState.connectivityEntries);
877
818
  } else if (sidebarState.annotationEntries?.length && state.annotationId) {
878
819
  // Restore annotation state only if the state has annotationId
879
- this.restoreConnectivityEntries(sidebarState.annotationEntries)
880
- this.sidebarAnnotationState = true
820
+ this.restoreConnectivityEntries(sidebarState.annotationEntries);
821
+ this.sidebarAnnotationState = true;
881
822
  } else {
882
- this.$refs.sideBar.setState(sidebarState)
823
+ this.$refs.sideBar.setState(sidebarState);
883
824
  }
884
- this.sidebarStateRestored = true
825
+ this.sidebarStateRestored = true;
885
826
  }
886
827
  },
887
828
  setState: function (state) {
888
- this.entriesStore.setAll(state.entries)
829
+ this.entriesStore.setAll(state.entries);
889
830
  //Support both old and new permalink.
890
831
  if (state.splitFlow) {
891
- this.splitFlowStore.setState(state.splitFlow)
892
- } else {
893
- this.entries.forEach((entry) => this.splitFlowStore.setIdToPane(entry.id))
832
+ this.splitFlowStore.setState(state.splitFlow);
833
+ }
834
+ else {
835
+ this.entries.forEach(entry => this.splitFlowStore.setIdToPrimaryPane(entry.id));
894
836
  }
895
837
 
896
- this.restoreSidebarState(state)
897
- this.updateGlobalSettingsFromState(state)
838
+ this.restoreSidebarState(state);
839
+ this.updateGlobalSettingsFromState(state);
898
840
  },
899
841
  getState: function (anonymousAnnotations = false) {
900
- let state = JSON.parse(JSON.stringify(this.entriesStore.$state))
901
- let splitdialog = this.$refs.splitdialog
902
- let dialogStates = splitdialog.getContentsState()
842
+ let state = JSON.parse(JSON.stringify(this.entriesStore.$state));
843
+ let splitdialog = this.$refs.splitdialog;
844
+ let dialogStates = splitdialog.getContentsState();
903
845
  if (state.entries.length === dialogStates.length) {
904
846
  for (let i = 0; i < dialogStates.length; i++) {
905
- const entry = state.entries[i]
906
- entry.state = dialogStates[i]
847
+ const entry = state.entries[i];
848
+ entry.state = dialogStates[i];
907
849
  //We do not want to serialise the following properties
908
- if (entry.type === 'Scaffold' && 'viewUrl' in entry) delete entry.viewUrl
909
- if (entry.type === 'MultiFlatmap' && 'uberonId' in entry) delete entry.uberonId
850
+ if (entry.type === "Scaffold" && "viewUrl" in entry)
851
+ delete entry.viewUrl;
852
+ if (entry.type === "MultiFlatmap" && "uberonId" in entry)
853
+ delete entry.uberonId;
910
854
  if (anonymousAnnotations === false) {
911
- if (entry.type === 'Scaffold' && entry?.state?.offlineAnnotations) {
912
- delete entry.state.offlineAnnotations
855
+ if (entry.type === "Scaffold" && entry?.state?.offlineAnnotations) {
856
+ delete entry.state.offlineAnnotations;
913
857
  } else if (entry?.state?.state?.offlineAnnotations) {
914
- delete entry.state.state.offlineAnnotations
858
+ delete entry.state.state.offlineAnnotations;
915
859
  }
916
860
  }
917
861
  }
918
862
  }
919
- state.splitFlow = this.splitFlowStore.getState()
920
- state.globalSettings = this.settingsStore.getGlobalSettings()
863
+ state.splitFlow = this.splitFlowStore.getState();
864
+ state.globalSettings = this.settingsStore.getGlobalSettings();
921
865
  if (this.$refs.sideBar) {
922
- state.sidebar = this.$refs.sideBar.getState()
866
+ state.sidebar = this.$refs.sideBar.getState();
923
867
  }
924
- return state
868
+ return state;
925
869
  },
926
870
  removeEntry: function (id) {
927
- let index = this.entriesStore.findIndexOfId(id)
928
- this.entriesStore.destroyEntry(index)
871
+ let index = this.entriesStore.findIndexOfId(id);
872
+ this.entriesStore.destroyEntry(index);
929
873
  },
930
874
  resourceSelected: function (result) {
931
- this.$emit('resource-selected', result)
875
+ this.$emit("resource-selected", result);
932
876
  },
933
877
  speciesChanged: function (species) {
934
878
  if (this.$refs.sideBar) {
935
879
  // Use to update the connectivity when switch species
936
880
  // Wait for provenance info with uuid update
937
881
  this.$nextTick(() => {
938
- EventBus.emit('species-layout-connectivity-update')
939
- this.$refs.sideBar.close()
882
+ EventBus.emit('species-layout-connectivity-update');
883
+ this.$refs.sideBar.close();
940
884
  })
941
885
  }
942
886
  },
943
887
  contextUpdate: function (payload) {
944
- EventBus.emit('contextUpdate', payload)
888
+ EventBus.emit("contextUpdate", payload);
945
889
  },
946
890
  datalinkClicked: function (payload) {
947
891
  // payload is dataset URL
948
- const datasetURL = payload || ''
949
- const substringA = 'datasets/'
950
- const substringB = '?type=dataset'
892
+ const datasetURL = payload || '';
893
+ const substringA = 'datasets/';
894
+ const substringB = '?type=dataset';
951
895
  const datasetId = datasetURL.substring(
952
896
  datasetURL.indexOf(substringA) + substringA.length,
953
897
  datasetURL.indexOf(substringB)
954
- )
898
+ );
955
899
 
956
900
  // GA Tagging
957
901
  // Event tracking for map sidebar gallery dataset click
958
902
  Tagging.sendEvent({
959
- event: 'interaction_event',
960
- event_name: 'portal_maps_gallery_click',
961
- category: datasetURL,
962
- location: 'map_sidebar_gallery',
963
- dataset_id: datasetId || '',
964
- })
903
+ 'event': 'interaction_event',
904
+ 'event_name': 'portal_maps_gallery_click',
905
+ 'category': datasetURL,
906
+ 'location': 'map_sidebar_gallery',
907
+ 'dataset_id': datasetId || ''
908
+ });
965
909
  },
966
- onAnnotationSubmitted: function (annotation) {
910
+ onAnnotationSubmitted: function(annotation) {
967
911
  if (this.annotationCallback) {
968
- this.annotationCallback(annotation)
912
+ this.annotationCallback(annotation);
969
913
  } else if (this.confirmCommentCallback) {
970
914
  this.confirmCommentCallback(annotation)
971
915
  }
972
916
  },
973
- onConfirmCreate: function (payload) {
917
+ onConfirmCreate: function(payload) {
974
918
  if (this.confirmCreateCallback) {
975
- this.confirmCreateCallback(payload)
919
+ this.confirmCreateCallback(payload);
976
920
  }
977
921
  },
978
- onCancelCreate: function () {
922
+ onCancelCreate: function() {
979
923
  if (this.cancelCreateCallback) {
980
- this.cancelCreateCallback()
924
+ this.cancelCreateCallback();
981
925
  }
982
926
  },
983
- onConfirmDelete: function (payload) {
927
+ onConfirmDelete: function(payload) {
984
928
  if (this.confirmDeleteCallback) {
985
- this.confirmDeleteCallback(payload)
929
+ this.confirmDeleteCallback(payload);
986
930
  }
987
931
  },
988
932
  onSidebarTabClicked: function (tab) {
989
- let globalSettings = { ...this.settingsStore.globalSettings }
933
+ let globalSettings = { ...this.settingsStore.globalSettings };
990
934
 
991
935
  if ('interactiveMode' in globalSettings) {
992
936
  if (tab.id === 1 && tab.type === 'datasetExplorer') {
993
- globalSettings.interactiveMode = 'dataset'
937
+ globalSettings.interactiveMode = 'dataset';
994
938
  } else if (tab.id === 2 && tab.type === 'connectivityExplorer') {
995
- globalSettings.interactiveMode = 'connectivity'
939
+ globalSettings.interactiveMode = 'connectivity';
996
940
  }
997
- this.settingsStore.updateGlobalSettings(globalSettings)
941
+ this.settingsStore.updateGlobalSettings(globalSettings);
998
942
  }
999
943
 
1000
- this.$refs.dialogToolbar.loadGlobalSettings()
944
+ this.$refs.dialogToolbar.loadGlobalSettings();
1001
945
  },
1002
946
  onSidebarTabClosed: function (tab) {
1003
- if (tab.id === 3 && tab.type === 'annotation') {
1004
- EventBus.emit('sidebar-annotation-close')
947
+ if (tab.id === 3 && tab.type === "annotation") {
948
+ EventBus.emit('sidebar-annotation-close');
1005
949
  }
1006
950
  },
1007
951
  updateGlobalSettingsFromState: function (state) {
1008
952
  if (state?.globalSettings) {
1009
- this.settingsStore.updateGlobalSettings(state.globalSettings)
953
+ this.settingsStore.updateGlobalSettings(state.globalSettings);
1010
954
  }
1011
955
  },
1012
956
  trackEvent: function (data) {
1013
- Tagging.sendEvent(data)
957
+ Tagging.sendEvent(data);
1014
958
  },
1015
959
  updateFlatmapMinimap: function () {
1016
- const splitdialog = this.$refs.splitdialog
960
+ const splitdialog = this.$refs.splitdialog;
1017
961
 
1018
962
  if (splitdialog) {
1019
- splitdialog.updateFlatmapMinimap()
963
+ splitdialog.updateFlatmapMinimap();
1020
964
  }
1021
965
  },
1022
966
  },
1023
967
  created: function () {
1024
- this._facets = []
1025
- this._externalStateSet = false
968
+ this._facets = [];
969
+ this._externalStateSet = false;
1026
970
  },
1027
971
  mounted: function () {
1028
- EventBus.on('CreateNewEntry', (newView) => {
1029
- this.createNewEntry(newView)
1030
- })
1031
- EventBus.on('RemoveEntryRequest', (id) => {
1032
- this.removeEntry(id)
1033
- })
1034
- EventBus.on('PopoverActionClick', (payload) => {
1035
- this.actionClick(payload)
1036
- })
1037
- EventBus.on('simulation-open-clicked', (payload) => {
1038
- this.actionClick(payload)
1039
- })
1040
- EventBus.on('annotation-open', (payload) => {
1041
- this.openAnnotation(payload)
1042
- })
972
+ EventBus.on("CreateNewEntry", newView => {
973
+ this.createNewEntry(newView);
974
+ });
975
+ EventBus.on("RemoveEntryRequest", id => {
976
+ this.removeEntry(id);
977
+ });
978
+ EventBus.on("PopoverActionClick", payload => {
979
+ this.actionClick(payload);
980
+ });
981
+ EventBus.on('annotation-open', payload => {
982
+ this.openAnnotation(payload);
983
+ });
1043
984
  EventBus.on('sidebar-annotation-close', () => {
1044
- const globalSettings = { ...this.settingsStore.globalSettings }
1045
- const { interactiveMode, viewingMode } = globalSettings
985
+ const globalSettings = { ...this.settingsStore.globalSettings };
986
+ const { interactiveMode, viewingMode } = globalSettings;
1046
987
 
1047
988
  // Sidebar annotation close event emits whenever viewing mode is changed.
1048
989
  // if annotation state is being restored on first load for annotation viewing mode,
1049
990
  // open the anootation tab and return.
1050
991
  if (this.sidebarAnnotationState && viewingMode === 'Annotation') {
1051
- this.sidebarAnnotationState = false
1052
- this.$refs.sideBar.tabClicked({ id: 3, type: 'annotation' })
1053
- return
992
+ this.sidebarAnnotationState = false;
993
+ this.$refs.sideBar.tabClicked({id: 3, type: 'annotation'});
994
+ return;
1054
995
  }
1055
996
 
1056
- this.annotationEntry = []
1057
- this.createData = {}
997
+ this.annotationEntry = [];
998
+ this.createData = {};
1058
999
 
1059
1000
  if (this.$refs.sideBar) {
1060
- if (interactiveMode === 'dataset') {
1061
- this.$refs.sideBar.tabClicked({ id: 1, type: 'datasetExplorer' })
1062
- } else if (interactiveMode === 'connectivity') {
1063
- this.$refs.sideBar.tabClicked({ id: 2, type: 'connectivityExplorer' })
1001
+ if (interactiveMode === "dataset") {
1002
+ this.$refs.sideBar.tabClicked({id: 1, type: 'datasetExplorer'});
1003
+ } else if (interactiveMode === "connectivity") {
1004
+ this.$refs.sideBar.tabClicked({id: 2, type: 'connectivityExplorer'});
1064
1005
  }
1065
1006
 
1066
- this.$refs.sideBar.closeConnectivity()
1067
- EventBus.emit('connectivity-item-close')
1007
+ this.$refs.sideBar.closeConnectivity();
1008
+ EventBus.emit('connectivity-item-close');
1068
1009
  }
1069
- })
1010
+ });
1070
1011
  EventBus.on('update-offline-annotation-enabled', (payload) => {
1071
- this.settingsStore.updateOfflineAnnotationEnabled(payload)
1072
- })
1073
- EventBus.on('connectivity-info-open', (payload) => {
1074
- this.openConnectivityInfo(payload)
1075
- })
1076
- EventBus.on('connectivity-info-close', (payload) => {
1012
+ this.settingsStore.updateOfflineAnnotationEnabled(payload);
1013
+ });
1014
+ EventBus.on('connectivity-info-open', payload => {
1015
+ this.openConnectivityInfo(payload);
1016
+ });
1017
+ EventBus.on('connectivity-info-close', payload => {
1077
1018
  if (this.$refs.sideBar) {
1078
- this.connectivityProcessed = false
1079
- this.$refs.sideBar.resetConnectivitySearch()
1019
+ this.connectivityProcessed = false;
1020
+ this.$refs.sideBar.resetConnectivitySearch();
1080
1021
  }
1081
- })
1082
- EventBus.on('connectivity-error', (payload) => {
1022
+ });
1023
+ EventBus.on('connectivity-error', payload => {
1083
1024
  if (this.$refs.sideBar) {
1084
- this.$refs.sideBar.updateConnectivityError(payload.data)
1025
+ this.$refs.sideBar.updateConnectivityError(payload.data);
1085
1026
  }
1086
- })
1087
- EventBus.on('neuron-connection-feature-click', (payload) => {
1027
+ });
1028
+ EventBus.on('neuron-connection-feature-click', payload => {
1088
1029
  if (this.$refs.sideBar) {
1089
- const { filters, search } = payload
1090
- this.$refs.sideBar.openConnectivitySearch(filters, search)
1091
- this.$refs.sideBar.tabClicked({ id: 2, type: 'connectivityExplorer' })
1092
- this.$refs.sideBar.setDrawerOpen(true)
1030
+ const { filters, search } = payload;
1031
+ this.$refs.sideBar.openConnectivitySearch(filters, search);
1032
+ this.$refs.sideBar.tabClicked({ id: 2, type: 'connectivityExplorer' });
1033
+ this.$refs.sideBar.setDrawerOpen(true);
1093
1034
  }
1094
- })
1095
- EventBus.on('OpenNewMap', (type) => {
1096
- this.updateFlatmapMinimap()
1097
- this.openNewMap(type)
1098
- })
1099
- EventBus.on('startHelp', () => {
1035
+ });
1036
+ EventBus.on("OpenNewMap", type => {
1037
+ this.updateFlatmapMinimap();
1038
+ this.openNewMap(type);
1039
+ });
1040
+ EventBus.on("startHelp", () => {
1100
1041
  if (this.$refs.sideBar) {
1101
- this.$refs.sideBar.close()
1042
+ this.$refs.sideBar.close();
1102
1043
  }
1103
- })
1104
- EventBus.on('connectivity-knowledge', (payload) => {
1105
- this.connectivityKnowledge = payload.data
1106
- this.connectivityHighlight = payload.highlight
1107
- this.connectivityProcessed = payload.processed
1044
+ });
1045
+ EventBus.on("connectivity-knowledge", payload => {
1046
+ this.connectivityKnowledge = payload.data;
1047
+ this.connectivityHighlight = payload.highlight;
1048
+ this.connectivityProcessed = payload.processed;
1108
1049
 
1109
1050
  // Restore sidebar state if it exists and not restored yet
1110
1051
  // after loading connectivity knowledge
1111
- this.restoreSidebarState(this.state)
1052
+ this.restoreSidebarState(this.state);
1112
1053
  })
1113
- EventBus.on('modeUpdate', (payload) => {
1114
- if (payload === 'dataset') {
1115
- this.$refs.sideBar.tabClicked({ id: 1, type: 'datasetExplorer' })
1116
- } else if (payload === 'connectivity') {
1117
- this.$refs.sideBar.tabClicked({ id: 2, type: 'connectivityExplorer' })
1054
+ EventBus.on("modeUpdate", payload => {
1055
+ if (payload === "dataset") {
1056
+ this.$refs.sideBar.tabClicked({id: 1, type: 'datasetExplorer'});
1057
+ } else if (payload === "connectivity") {
1058
+ this.$refs.sideBar.tabClicked({id: 2, type: 'connectivityExplorer'});
1118
1059
  }
1119
1060
  })
1120
- EventBus.on('connectivity-filter-options', (payload) => {
1121
- this.filterOptions = payload
1061
+ EventBus.on("connectivity-filter-options", payload => {
1062
+ this.filterOptions = payload;
1122
1063
  })
1123
1064
  this.$nextTick(() => {
1124
- if (this.search === '' && this._facets.length === 0) {
1065
+ if (this.search === "" && this._facets.length === 0) {
1125
1066
  if (this.$refs.sideBar) {
1126
- this.$refs.sideBar.close()
1067
+ this.$refs.sideBar.close();
1127
1068
  }
1128
1069
  setTimeout(() => {
1129
- this.startUp = false
1130
- }, 2000)
1131
- } else this.openSearch(this._facets, this.search)
1132
- })
1070
+ this.startUp = false;
1071
+ }, 2000);
1072
+ } else this.openSearch(this._facets, this.search);
1073
+ });
1133
1074
  },
1134
1075
  computed: {
1135
- ...mapStores(useEntriesStore, useSettingsStore, useSimulationPlotStore, useSplitFlowStore, useConnectivitiesStore),
1076
+ ...mapStores(useEntriesStore, useSettingsStore, useSplitFlowStore, useConnectivitiesStore),
1136
1077
  envVars: function () {
1137
1078
  return {
1138
1079
  API_LOCATION: this.settingsStore.sparcApi,
@@ -1142,14 +1083,13 @@ export default {
1142
1083
  PENNSIEVE_API_LOCATION: this.settingsStore.pennsieveApi,
1143
1084
  ROOT_URL: this.settingsStore.rootUrl,
1144
1085
  FLATMAPAPI_LOCATION: this.settingsStore.flatmapAPI,
1145
- TEST_DATA_LOCATION: this.settingsStore.testDataLocation,
1146
- }
1086
+ };
1147
1087
  },
1148
- entries: function () {
1149
- return this.entriesStore.entries
1088
+ entries: function() {
1089
+ return this.entriesStore.entries;
1150
1090
  },
1151
1091
  },
1152
- }
1092
+ };
1153
1093
  </script>
1154
1094
 
1155
1095
  <style scoped lang="scss">
@@ -1189,4 +1129,5 @@ export default {
1189
1129
  }
1190
1130
  }
1191
1131
  }
1132
+
1192
1133
  </style>