@abi-software/mapintegratedvuer 1.16.2 → 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-DiDiS2Ct.js → ContentMixin-CXBghkG4.js} +224 -455
  2. package/dist/{style-t77Cw_0W.js → DynamicMarkerMixin-C077TWyL.js} +1 -1
  3. package/dist/Flatmap-CKWEbXwI.js +103454 -0
  4. package/dist/{Iframe-Drf0INka.js → Iframe-CImGKtGq.js} +2 -2
  5. package/dist/{MultiFlatmap-ZODnXOPU.js → MultiFlatmap-jLxHqKwa.js} +15 -15
  6. package/dist/{Plot-DrEUpK5N.js → Plot-CZP1T3yL.js} +2 -2
  7. package/dist/{Scaffold-BiDz1Mwi.js → Scaffold-Z2Jv6mwD.js} +79 -53
  8. package/dist/Simulation-OtmfB6BF.js +72 -0
  9. package/dist/{index-C753e18_.js → index-Bym6cokq.js} +19683 -20021
  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-Dh0ybLSL.js +0 -202
  40. package/dist/Simulation-lEXXSWRc.js +0 -28
  41. package/src/components/EventBus.js +0 -3
package/src/App.vue CHANGED
@@ -1,38 +1,58 @@
1
1
  <template>
2
2
  <div id="app">
3
- <link rel="stylesheet"
4
- href="https://fonts.googleapis.com/css?family=Asap:400,400i,500,600,700&display=swap">
5
- <div class="button-container">
6
- <el-popover
7
- placement="bottom"
8
- trigger="click"
9
- width=500
10
- class="popover"
11
- :teleported=false
3
+ <link
4
+ rel="stylesheet"
5
+ href="https://fonts.googleapis.com/css?family=Asap:400,400i,500,600,700&display=swap"
6
+ />
7
+ <div class="button-container">
8
+ <el-popover
9
+ placement="bottom"
10
+ trigger="click"
11
+ width="500"
12
+ class="popover"
13
+ :teleported="false"
14
+ >
15
+ <div class="options-container">
16
+ <div class="row">
17
+ <el-button @click="saveSettings()" size="small"
18
+ >Save Settings</el-button
19
+ >
20
+ <el-button @click="restoreSettings()" size="small"
21
+ >Restore Settings</el-button
22
+ >
23
+ <el-button @click="getShareableURL()" size="small"
24
+ >Get Link</el-button
25
+ >
26
+ </div>
27
+ <div class="row">
28
+ <el-button @click="setRatFlatmap()" size="small"
29
+ >Set Rat Flatmap</el-button
30
+ >
31
+ <el-button @click="setMultiFlatmap()" size="small"
32
+ >Set MultiFlatmap</el-button
33
+ >
34
+ <el-button @click="setLegacyMultiFlatmap()" size="small"
35
+ >Set Legacy MultiFlatmap</el-button
36
+ >
37
+ <el-button @click="setScaffold()" size="small"
38
+ >Set To Scaffold</el-button
39
+ >
40
+ <el-button @click="setWholebody()" size="small"
41
+ >Set to Wholebody</el-button
42
+ >
43
+ <el-button @click="setFlatmap()" size="small"
44
+ >Set Flatmap</el-button
45
+ >
46
+ <el-button @click="setSearch()" size="small">Set Search</el-button>
47
+ </div>
48
+ </div>
49
+ <template #reference>
50
+ <el-button class="options-button" :icon="ElIconSetting"
51
+ >Options</el-button
12
52
  >
13
- <div class="options-container">
14
- <div class="row">
15
- <el-button @click="saveSettings()" size="small">Save Settings</el-button>
16
- <el-button @click="restoreSettings()" size="small">Restore Settings</el-button>
17
- <el-button @click="getShareableURL()" size="small">Get Link</el-button>
18
- </div>
19
- <div class="row">
20
- <el-button @click="setRatFlatmap()" size="small">Set Rat Flatmap</el-button>
21
- <el-button @click="setMultiFlatmap()" size="small">Set MultiFlatmap</el-button>
22
- <el-button @click="setLegacyMultiFlatmap()" size="small">Set Legacy MultiFlatmap</el-button>
23
- <el-button @click="setScaffold()" size="small">Set To Scaffold</el-button>
24
- <el-button @click="setWholebody()" size="small">Set to Wholebody</el-button>
25
- <el-button @click="setFlatmap()" size="small">Set Flatmap</el-button>
26
- <el-button @click="setSearch()" size="small">Set Search</el-button>
27
- </div>
28
- </div>
29
- <template #reference>
30
-
31
- <el-button class="options-button" :icon="ElIconSetting">Options</el-button>
32
-
33
- </template>
34
- </el-popover>
35
- </div>
53
+ </template>
54
+ </el-popover>
55
+ </div>
36
56
  <div class="map-app">
37
57
  <MapContent
38
58
  v-if="routerIsReady"
@@ -43,7 +63,7 @@
43
63
  :shareLink="shareLink"
44
64
  :useHelpModeDialog="true"
45
65
  :connectivityInfoSidebar="true"
46
- :allClosable="false"
66
+ :allClosable="true"
47
67
  :showGlobalSettings="true"
48
68
  :showOpenMapButton="true"
49
69
  @updateShareLinkRequested="updateUUID"
@@ -56,8 +76,8 @@
56
76
 
57
77
  <script>
58
78
  /* eslint-disable no-alert, no-console */
59
- import { shallowRef } from 'vue';
60
- import MapContent from './components/MapContent.vue';
79
+ import { shallowRef } from 'vue'
80
+ import MapContent from './components/MapContent.vue'
61
81
  import { Setting as ElIconSetting } from '@element-plus/icons-vue'
62
82
  import {
63
83
  ElButton as Button,
@@ -65,15 +85,17 @@ import {
65
85
  ElPopover as Popover,
66
86
  ElRow as Row,
67
87
  ElMessage as Message,
68
- } from 'element-plus';
69
- import 'element-plus/es/components/message/style/css';
88
+ } from 'element-plus'
89
+ import 'element-plus/es/components/message/style/css'
90
+ import { useSimulationPlotStore } from './stores/simulationPlotStore'
70
91
 
71
92
  const getAnnotationId = (api, withAnnotation) => {
72
93
  return new Promise((resolve) => {
73
- let anonymousAnnotations = JSON.parse(sessionStorage.getItem('anonymous-annotation')) || undefined;
94
+ let anonymousAnnotations =
95
+ JSON.parse(sessionStorage.getItem('anonymous-annotation')) || undefined
74
96
  if (withAnnotation && anonymousAnnotations) {
75
- let maxRetry = 3;
76
- const annotationUrl = api + '/annotation/getshareid';
97
+ let maxRetry = 3
98
+ const annotationUrl = api + '/annotation/getshareid'
77
99
  const getId = (attempt) => {
78
100
  fetch(annotationUrl, {
79
101
  method: 'POST',
@@ -81,34 +103,35 @@ const getAnnotationId = (api, withAnnotation) => {
81
103
  'Content-type': 'application/json',
82
104
  },
83
105
  body: JSON.stringify({ state: anonymousAnnotations }),
84
- }).then((response) => {
85
- if (response.ok) {
86
- return response.json();
87
- }
88
- throw new Error('Unsuccessful attempt to get annotation id')
89
- })
90
- .then((data) => {
91
- resolve(data.uuid);
92
- })
93
- .catch((error) => {
94
- if (maxRetry > attempt) {
95
- getId(attempt + 1);
96
- } else {
97
- resolve(undefined);
98
- }
99
106
  })
107
+ .then((response) => {
108
+ if (response.ok) {
109
+ return response.json()
110
+ }
111
+ throw new Error('Unsuccessful attempt to get annotation id')
112
+ })
113
+ .then((data) => {
114
+ resolve(data.uuid)
115
+ })
116
+ .catch((error) => {
117
+ if (maxRetry > attempt) {
118
+ getId(attempt + 1)
119
+ } else {
120
+ resolve(undefined)
121
+ }
122
+ })
100
123
  }
101
- getId(1);
124
+ getId(1)
102
125
  } else {
103
- resolve(undefined);
126
+ resolve(undefined)
104
127
  }
105
- });
128
+ })
106
129
  }
107
130
 
108
131
  const getAnnotationState = (api, annotationId) => {
109
132
  return new Promise((resolve) => {
110
- let maxRetry = 3;
111
- const annotationUrl = api + '/annotation/getstate';
133
+ let maxRetry = 3
134
+ const annotationUrl = api + '/annotation/getstate'
112
135
  const getState = (attempt) => {
113
136
  fetch(annotationUrl, {
114
137
  method: 'POST',
@@ -116,26 +139,29 @@ const getAnnotationState = (api, annotationId) => {
116
139
  'Content-type': 'application/json',
117
140
  },
118
141
  body: JSON.stringify({ uuid: annotationId }),
119
- }).then((response) => {
120
- if (response.ok) {
121
- return response.json();
122
- }
123
- throw new Error('Unsuccessful attempt to get annotations');
124
- })
125
- .then((data) => {
126
- resolve(data);
127
- })
128
- .catch((error) => {
129
- console.log(`Unable to get annotation state: attempt ${attempt} of ${maxRetry}`);
130
- if (maxRetry > attempt) {
131
- getState(attempt + 1);
132
- } else {
133
- resolve(undefined);
134
- }
135
142
  })
143
+ .then((response) => {
144
+ if (response.ok) {
145
+ return response.json()
146
+ }
147
+ throw new Error('Unsuccessful attempt to get annotations')
148
+ })
149
+ .then((data) => {
150
+ resolve(data)
151
+ })
152
+ .catch((error) => {
153
+ console.log(
154
+ `Unable to get annotation state: attempt ${attempt} of ${maxRetry}`
155
+ )
156
+ if (maxRetry > attempt) {
157
+ getState(attempt + 1)
158
+ } else {
159
+ resolve(undefined)
160
+ }
161
+ })
136
162
  }
137
- getState(1);
138
- });
163
+ getState(1)
164
+ })
139
165
  }
140
166
 
141
167
  export default {
@@ -147,26 +173,29 @@ export default {
147
173
  Row,
148
174
  MapContent,
149
175
  },
150
- data: function() {
176
+ data: function () {
177
+ const simulationPlotStore = useSimulationPlotStore()
151
178
  return {
152
179
  uuid: undefined,
153
180
  state: undefined,
154
- prefix: "/map",
181
+ prefix: '/map',
155
182
  api: import.meta.env.VITE_API_LOCATION,
156
- discover_api: import.meta.env.PENNSIEVE_DISCOVER_API || 'https://api.pennsieve.io/discover',
183
+ discover_api:
184
+ import.meta.env.PENNSIEVE_DISCOVER_API ||
185
+ 'https://api.pennsieve.io/discover',
157
186
  mapSettings: [],
158
- startingMap: "AC",
187
+ startingMap: 'AC',
159
188
  ElIconSetting: shallowRef(ElIconSetting),
160
189
  routerIsReady: false,
190
+ simulationPlotStore,
161
191
  }
162
192
  },
163
193
  computed: {
164
- shareLink: function() {
165
- if (this.uuid)
166
- return this.prefix +"#/?id=" + this.uuid;
167
- return this.prefix;
194
+ shareLink: function () {
195
+ if (this.uuid) return this.prefix + '#/?id=' + this.uuid
196
+ return this.prefix
168
197
  },
169
- options: function() {
198
+ options: function () {
170
199
  return {
171
200
  sparcApi: import.meta.env.VITE_API_LOCATION,
172
201
  algoliaIndex: import.meta.env.VITE_ALGOLIA_INDEX,
@@ -174,37 +203,36 @@ export default {
174
203
  algoliaId: import.meta.env.VITE_ALGOLIA_ID,
175
204
  pennsieveApi: import.meta.env.VITE_PENNSIEVE_API_LOCATION,
176
205
  flatmapAPI: this.$route.query.flatmapserver ? this.$route.query.flatmapserver : import.meta.env.VITE_FLATMAPAPI_LOCATION,
177
- nlLinkPrefix: import.meta.env.VITE_NL_LINK_PREFIX,
178
206
  rootUrl: import.meta.env.VITE_ROOT_URL,
179
207
  }
180
- }
208
+ },
181
209
  },
182
210
  methods: {
183
- changeViewingMode: function(modeName) {
184
- this.$refs.map.changeViewingMode(modeName);
211
+ changeViewingMode: function (modeName) {
212
+ this.$refs.map.changeViewingMode(modeName)
185
213
  },
186
- saveSettings: function() {
187
- const mapState = JSON.parse(JSON.stringify(this.$refs.map.getState()));
188
- this.mapSettings.push(mapState);
214
+ saveSettings: function () {
215
+ const mapState = JSON.parse(JSON.stringify(this.$refs.map.getState()))
216
+ this.mapSettings.push(mapState)
189
217
  Message({
190
218
  message: `Settings saved successfully! There are ${this.mapSettings.length} saved setting(s).`,
191
219
  type: 'success',
192
220
  showClose: true,
193
221
  duration: 1200,
194
- });
222
+ })
195
223
  },
196
- restoreSettings: function() {
224
+ restoreSettings: function () {
197
225
  if (this.mapSettings.length > 0) {
198
- this.$refs.map.$refs.flow.sidebarStateRestored = false; // reset sidebar state flag
199
- this.$refs.map.$refs.flow._externalStateSet = false; // reset state flag
226
+ this.$refs.map.$refs.flow.sidebarStateRestored = false // reset sidebar state flag
227
+ this.$refs.map.$refs.flow._externalStateSet = false // reset state flag
200
228
  // this.$refs.map.setState(this.mapSettings.pop());
201
- this.state = this.mapSettings.pop();
229
+ this.state = this.mapSettings.pop()
202
230
  Message({
203
231
  message: 'Settings restored successfully!',
204
232
  type: 'success',
205
233
  showClose: true,
206
234
  duration: 1200,
207
- });
235
+ })
208
236
  } else {
209
237
  Message({
210
238
  message: 'There are no saved settings to restore.',
@@ -214,11 +242,11 @@ export default {
214
242
  })
215
243
  }
216
244
  },
217
- updateUUID: function(withAnnotation) {
218
- let url = this.api + 'map/getshareid';
219
- let state = this.$refs.map.getState(false);
245
+ updateUUID: function (withAnnotation) {
246
+ let url = this.api + 'map/getshareid'
247
+ let state = this.$refs.map.getState(false)
220
248
 
221
- const maxRetry = 3;
249
+ const maxRetry = 3
222
250
  const getShareLink = (attempt) => {
223
251
  fetch(url, {
224
252
  method: 'POST',
@@ -227,96 +255,83 @@ export default {
227
255
  },
228
256
  body: JSON.stringify({ state: state }),
229
257
  })
230
- .then((response) => {
231
- if (response.ok) {
232
- return response.json()
233
- }
234
- throw new Error('Unsuccessful attempt to get shareid')
235
- })
236
- .then((data) => {
237
- this.uuid = data.uuid
238
- })
239
- .catch((error) => {
240
- console.log(`Unable to create permalink: attempt ${attempt} of ${maxRetry}`)
241
- if (maxRetry > attempt) {
242
- getShareLink(attempt + 1)
243
- }
244
- })
258
+ .then((response) => {
259
+ if (response.ok) {
260
+ return response.json()
261
+ }
262
+ throw new Error('Unsuccessful attempt to get shareid')
263
+ })
264
+ .then((data) => {
265
+ this.uuid = data.uuid
266
+ })
267
+ .catch((error) => {
268
+ console.log(
269
+ `Unable to create permalink: attempt ${attempt} of ${maxRetry}`
270
+ )
271
+ if (maxRetry > attempt) {
272
+ getShareLink(attempt + 1)
273
+ }
274
+ })
245
275
  }
246
276
  getAnnotationId(this.api, withAnnotation).then((annotationId) => {
247
277
  if (annotationId) {
248
- state.annotationId = annotationId;
278
+ state.annotationId = annotationId
249
279
  }
250
280
  getShareLink(1)
251
- });
252
-
281
+ })
253
282
  },
254
- setFlatmap: function() {
255
- this.$refs.map.setCurrentEntry(
256
- {
257
- type: "Flatmap",
258
- resource: "FunctionalConnectivity",
259
- label: "Functional"
260
- }
261
- );
283
+ setFlatmap: function () {
284
+ this.$refs.map.setCurrentEntry({
285
+ type: 'Flatmap',
286
+ resource: 'FunctionalConnectivity',
287
+ label: 'Functional',
288
+ })
262
289
  },
263
- setLegacyMultiFlatmap: function() {
264
- this.$refs.map.setCurrentEntry(
265
- {
266
- type: "MultiFlatmap",
267
- taxo: "NCBITaxon:10114",
268
- uuid: "01fedbf9-d783-509c-a10c-827941ab13da",
269
- }
270
- );
290
+ setLegacyMultiFlatmap: function () {
291
+ this.$refs.map.setCurrentEntry({
292
+ type: 'MultiFlatmap',
293
+ taxo: 'NCBITaxon:10114',
294
+ uuid: '01fedbf9-d783-509c-a10c-827941ab13da',
295
+ })
271
296
  },
272
- setMultiFlatmap: function() {
273
- this.$refs.map.setCurrentEntry(
274
- {
275
- type: "MultiFlatmap",
276
- taxo: "NCBITaxon:9606",
277
- biologicalSex: "PATO:0000384",
278
- //organ: "heart"
279
- organ: "UBERON:0018675"
280
- }
281
- );
297
+ setMultiFlatmap: function () {
298
+ this.$refs.map.setCurrentEntry({
299
+ type: 'MultiFlatmap',
300
+ taxo: 'NCBITaxon:9606',
301
+ biologicalSex: 'PATO:0000384',
302
+ //organ: "heart"
303
+ organ: 'UBERON:0018675',
304
+ })
282
305
  },
283
- setRatFlatmap: function() {
284
- this.$refs.map.setCurrentEntry(
285
- {
286
- type: "MultiFlatmap",
287
- taxo: "NCBITaxon:10114"
288
- }
289
- );
306
+ setRatFlatmap: function () {
307
+ this.$refs.map.setCurrentEntry({
308
+ type: 'MultiFlatmap',
309
+ taxo: 'NCBITaxon:10114',
310
+ })
290
311
  },
291
- setScaffold: function() {
292
- this.$refs.map.setCurrentEntry(
293
- {
294
- type: "Scaffold",
295
- label: "Colon",
296
- url: `${this.api}/s3-resource/76/files/derivative/colonMouse_metadata.json?s3BucketName=prd-sparc-discover50-use1`,
297
- viewUrl: "colonMouse_Layout1_view.json"
298
- }
299
- );
312
+ setScaffold: function () {
313
+ this.$refs.map.setCurrentEntry({
314
+ type: 'Scaffold',
315
+ label: 'Colon',
316
+ url: `${this.api}/s3-resource/76/files/derivative/colonMouse_metadata.json?s3BucketName=prd-sparc-discover50-use1`,
317
+ viewUrl: 'colonMouse_Layout1_view.json',
318
+ })
300
319
  },
301
- setWholebody: function() {
302
- this.$refs.map.setCurrentEntry(
303
- {
304
- type: "Scaffold",
305
- label: "Human",
306
- isBodyScaffold: true
307
- }
308
- );
320
+ setWholebody: function () {
321
+ this.$refs.map.setCurrentEntry({
322
+ type: 'Scaffold',
323
+ label: 'Human',
324
+ isBodyScaffold: true,
325
+ })
309
326
  },
310
- setSearch: function() {
311
- this.$refs.map.openSearch([], "10.26275/1uno-tynt");
327
+ setSearch: function () {
328
+ this.$refs.map.openSearch([], '10.26275/1uno-tynt')
312
329
  },
313
- mapIsLoaded: function(map) {
314
- console.log("map is loaded", map)
330
+ mapIsLoaded: function (map) {
315
331
  // map.changeViewingMode('Annotation')
316
332
  },
317
- viewerIsReady: function() {
318
- console.log("viewer is ready")
319
- this.parseQuery();
333
+ viewerIsReady: function () {
334
+ this.parseQuery()
320
335
  },
321
336
  fetchDataFromApi: async function (url) {
322
337
  const response = await fetch(url, {
@@ -324,38 +339,43 @@ export default {
324
339
  headers: {
325
340
  'Content-Type': 'application/json',
326
341
  },
327
- });
342
+ })
328
343
  if (!response.ok) {
329
- throw new Error(`Error fetching data from API: ${response.statusText}`);
344
+ throw new Error(`Error fetching data from API: ${response.statusText}`)
330
345
  }
331
- return await response.json();
346
+ return await response.json()
332
347
  },
333
348
  getDatasetInfo: async function (discoverApi, datasetId, datasetVersion) {
334
- let url = `${discoverApi}/datasets/${datasetId}`;
349
+ let url = `${discoverApi}/datasets/${datasetId}`
335
350
  if (datasetVersion) {
336
- url = `${discoverApi}/datasets/${datasetId}/versions/${datasetVersion}`;
351
+ url = `${discoverApi}/datasets/${datasetId}/versions/${datasetVersion}`
337
352
  }
338
- return await this.fetchDataFromApi(url);
353
+ return await this.fetchDataFromApi(url)
339
354
  },
340
355
  checkFileExists: async function (path) {
341
- const url = `${this.api}/exists/${path}`;
342
- return await this.fetchDataFromApi(url);
356
+ const url = `${this.api}/exists/${path}`
357
+ return await this.fetchDataFromApi(url)
343
358
  },
344
- extractS3BucketName: function(uri) {
359
+ extractS3BucketName: function (uri) {
345
360
  if (uri) {
346
- const substring = uri.split("//")[1]
361
+ const substring = uri.split('//')[1]
347
362
  if (substring) {
348
- return substring.split("/")[0]
363
+ return substring.split('/')[0]
349
364
  }
350
365
  }
351
- return undefined;
366
+ return undefined
352
367
  },
353
- getScaffoldEntry: async function(dataset_id, file_path, dataset_version, viewUrl) {
368
+ getScaffoldEntry: async function (
369
+ dataset_id,
370
+ file_path,
371
+ dataset_version,
372
+ viewUrl
373
+ ) {
354
374
  const datasetInfo = await this.getDatasetInfo(
355
375
  this.discover_api,
356
376
  dataset_id,
357
- dataset_version,
358
- );
377
+ dataset_version
378
+ )
359
379
  const s3Bucket = datasetInfo
360
380
  ? this.extractS3BucketName(datasetInfo.uri)
361
381
  : undefined
@@ -365,7 +385,7 @@ export default {
365
385
  if (s3Bucket) {
366
386
  path = path + `?s3BucketName=${s3Bucket}`
367
387
  }
368
- const fileCheckResults = await this.checkFileExists(path);
388
+ const fileCheckResults = await this.checkFileExists(path)
369
389
 
370
390
  if (fileCheckResults?.exists) {
371
391
  return {
@@ -375,72 +395,77 @@ export default {
375
395
  viewUrl: viewUrl,
376
396
  dataset_id: dataset_id,
377
397
  dataset_version: dataset_version,
378
- };
398
+ }
379
399
  }
380
400
  }
381
- return null;
401
+ return null
382
402
  },
383
403
  waitForRouter: function () {
384
404
  this.$router.isReady().then(async () => {
385
- this.routerIsReady = true;
386
- });
405
+ this.routerIsReady = true
406
+ })
387
407
  },
388
408
  parseQuery: function () {
389
409
  this.$router.isReady().then(async () => {
390
- this.uuid = this.$route.query.id;
391
- const type = this.$route.query.type;
392
- const taxo = this.$route.query.taxo || this.$route.query.taxon;
393
- const anatomy = this.$route.query.anatomy || this.$route.query.uberonid;
394
- const dataset_id = this.$route.query.dataset_id;
395
- const dataset_version = this.$route.query.dataset_version;
396
- const file_path = this.$route.query.file_path;
397
- const viewUrl = this.$route.query.viewUrl;
410
+ this.uuid = this.$route.query.id
411
+ let type = this.$route.query.type
412
+ const taxo = this.$route.query.taxo || this.$route.query.taxon
413
+ const anatomy = this.$route.query.anatomy || this.$route.query.uberonid
414
+ const dataset_id = this.$route.query.dataset_id
415
+ const dataset_version = this.$route.query.dataset_version
416
+ const file_path = this.$route.query.file_path
417
+ const viewUrl = this.$route.query.viewUrl
398
418
 
399
419
  if (window) {
400
- this.prefix = window.location.origin + window.location.pathname;
420
+ this.prefix = window.location.origin + window.location.pathname
401
421
  }
402
422
  if (this.uuid) {
403
- let xmlhttp = new XMLHttpRequest();
404
- let url = this.api + 'map/getstate';
405
- xmlhttp.open('POST', url, true);
423
+ let xmlhttp = new XMLHttpRequest()
424
+ let url = this.api + 'map/getstate'
425
+ xmlhttp.open('POST', url, true)
406
426
  //Send the proper header information along with the request
407
- xmlhttp.setRequestHeader('Content-type', 'application/json');
408
- xmlhttp.onreadystatechange = () => {//Call a function when the state changes.
409
- if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
410
- let state = JSON.parse(xmlhttp.responseText);
411
- console.log(state)
412
- if (state?.state?.annotationId) {
413
- getAnnotationState(this.api, state.state.annotationId).
414
- then((data) => {
427
+ xmlhttp.setRequestHeader('Content-type', 'application/json')
428
+ xmlhttp.onreadystatechange = () => {
429
+ //Call a function when the state changes.
430
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
431
+ let state = JSON.parse(xmlhttp.responseText)
432
+ if (state?.state?.annotationId) {
433
+ getAnnotationState(this.api, state.state.annotationId).then(
434
+ (data) => {
415
435
  if (data) {
416
- sessionStorage.setItem('anonymous-annotation', JSON.stringify(data.state))
436
+ sessionStorage.setItem(
437
+ 'anonymous-annotation',
438
+ JSON.stringify(data.state)
439
+ )
417
440
  }
418
- this.state = state.state;
419
- });
420
- } else {
421
- this.state = state.state;
422
- }
441
+ this.state = state.state
442
+ }
443
+ )
444
+ } else {
445
+ this.state = state.state
423
446
  }
447
+ }
424
448
  }
425
- xmlhttp.send(JSON.stringify({"uuid": this.uuid}));
449
+ xmlhttp.send(JSON.stringify({ uuid: this.uuid }))
426
450
  }
427
451
 
452
+ type = 'fc'
428
453
  if (type === 'ac') {
429
454
  // Load AC map with different species
430
- this.startingMap = "AC";
455
+ this.startingMap = 'AC'
431
456
  this.$nextTick(() => {
432
457
  const currentEntry = {
433
- type: "MultiFlatmap",
458
+ type: 'MultiFlatmap',
434
459
  taxo: taxo || '',
435
- };
460
+ }
436
461
  if (anatomy) {
437
- currentEntry.organ = anatomy;
462
+ currentEntry.organ = anatomy
438
463
  }
439
- this.$refs.map.setCurrentEntry(currentEntry);
464
+ this.$refs.map.setCurrentEntry(currentEntry)
440
465
  })
441
466
  } else if (type === 'fc') {
442
467
  // Load FC map
443
- this.startingMap = "FC";
468
+ this.startingMap = 'FC'
444
469
  this.$nextTick(() => {
445
470
  const currentEntry = {
446
471
  type: 'Flatmap',
@@ -448,21 +473,23 @@ export default {
448
473
  label: 'Functional',
449
474
  }
450
475
  if (this.$route.query.fid) {
451
- currentEntry.resource = this.$route.query.fid;
476
+ currentEntry.resource = this.$route.query.fid
452
477
  }
453
- this.$refs.map.setCurrentEntry(currentEntry);
478
+ console.log('// --- Debug: Current Entry is hardcoded --- //')
479
+ console.log('currentEntry', currentEntry)
480
+ console.log('e81e3f3a-ed2f-5610-99ae-e019deae614a')
481
+ currentEntry.resource = 'e81e3f3a-ed2f-5610-99ae-e019deae614a' // temp hardcode to test
482
+ this.$refs.map.setCurrentEntry(currentEntry)
454
483
  })
455
484
  } else if (type === 'wholebody') {
456
485
  // Load Wholebody scaffold
457
- this.startingMap = "WholeBody";
486
+ this.startingMap = 'WholeBody'
458
487
  this.$nextTick(() => {
459
- this.$refs.map.setCurrentEntry(
460
- {
461
- type: "Scaffold",
462
- label: "Human",
463
- isBodyScaffold: true
464
- }
465
- );
488
+ this.$refs.map.setCurrentEntry({
489
+ type: 'Scaffold',
490
+ label: 'Human',
491
+ isBodyScaffold: true,
492
+ })
466
493
  })
467
494
  } else if (type === 'scaffold' && dataset_id && file_path) {
468
495
  // Load scaffold from dataset
@@ -471,17 +498,21 @@ export default {
471
498
  dataset_id,
472
499
  file_path,
473
500
  dataset_version,
474
- viewUrl,
475
- );
501
+ viewUrl
502
+ )
476
503
  if (scaffoldEntry) {
477
- this.$refs.map.setCurrentEntry(scaffoldEntry);
504
+ this.$refs.map.setCurrentEntry(scaffoldEntry)
478
505
  }
479
506
  }
480
507
  })
481
508
  },
482
509
  },
483
- mounted: function() {
484
- this.waitForRouter();
510
+ mounted: function () {
511
+ this.waitForRouter()
512
+ this.simulationPlotStore.initListeners()
513
+ },
514
+ beforeUnmount: function () {
515
+ this.simulationPlotStore.cleanupListeners()
485
516
  },
486
517
  }
487
518
  </script>
@@ -491,12 +522,12 @@ $button-container-size: 50px;
491
522
  $gap: 24px;
492
523
 
493
524
  #app {
494
- height:100%;
525
+ height: 100%;
495
526
  width: 100%;
496
- position:absolute;
497
- font-family: "Asap",sans-serif;
527
+ position: absolute;
528
+ font-family: 'Asap', sans-serif;
498
529
  background-color: #f5f7fa;
499
- --el-color-primary: #8300BF;
530
+ --el-color-primary: #8300bf;
500
531
  --el-color-primary-light-7: #dab3ec;
501
532
  --el-color-primary-light-8: #e6ccf2;
502
533
  --el-color-primary-light-9: #f3e6f9;
@@ -516,11 +547,11 @@ body {
516
547
  position: relative;
517
548
  }
518
549
 
519
- .popover{
520
- top:10px;
521
- right:50%;
522
- position:absolute;
523
- z-index:1000;
550
+ .popover {
551
+ top: 10px;
552
+ right: 50%;
553
+ position: absolute;
554
+ z-index: 1000;
524
555
  }
525
556
 
526
557
  .row {
@@ -544,13 +575,12 @@ body {
544
575
  height: $button-container-size;
545
576
  }
546
577
 
547
-
548
- .options-container{
578
+ .options-container {
549
579
  text-align: center;
550
580
  }
551
581
 
552
582
  .map-icon {
553
- color: $app-primary-color!important;
583
+ color: $app-primary-color !important;
554
584
  }
555
585
 
556
586
  .el-message.is-closable {
@@ -559,7 +589,7 @@ body {
559
589
  --el-message-text-color: #{$app-primary-color};
560
590
 
561
591
  .el-message__content {
562
- font-family: "Asap",sans-serif;
592
+ font-family: 'Asap', sans-serif;
563
593
  font-size: 12px;
564
594
  }
565
595
  }