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