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