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