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