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