@abi-software/mapintegratedvuer 1.21.1 → 1.22.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.
- package/README.md +23 -5
- package/assets/location-icon.html +33 -1
- package/assets/styleguide.css +18 -18
- package/cypress.config.js +7 -9
- package/dist/{ConnectivityGraph-CZMROk9r.js → ConnectivityGraph-BBZ3Dgat.js} +3 -3
- package/dist/{ContentMixin-Vn34n5t2.js → ContentMixin-B-O_IwPg.js} +16 -18
- package/dist/{DynamicMarkerMixin-BS6t7w_i.js → DynamicMarkerMixin-B9iqtP_f.js} +1 -1
- package/dist/{Flatmap-BejxA0uz.js → Flatmap-BoEFI50b.js} +4 -4
- package/dist/{Iframe-BWbhTjCR.js → Iframe-Slj-LQTF.js} +4 -4
- package/dist/{MultiFlatmap-nlmsH-Ib.js → MultiFlatmap-l6aBn6x3.js} +17 -5
- package/dist/{Plot-ChbPsDZX.js → Plot-CIhEip5b.js} +2 -2
- package/dist/{Scaffold-C6f7c7Ha.js → Scaffold-D5ZGCDvt.js} +4 -4
- package/dist/{Simulation-DcJScRYo.js → Simulation-C5o5DXRb.js} +2 -2
- package/dist/{connectivities-UXTqf7_0.js → connectivities-Br3MpoAv.js} +154 -95
- package/dist/index.html +9 -6
- package/dist/mapintegratedvuer.js +5506 -5582
- package/dist/mapintegratedvuer.umd.cjs +196 -196
- package/dist/style.css +1 -1
- package/eslint.config.js +39 -15
- package/package.json +12 -6
- package/public/index.html +9 -6
- package/src/App.vue +224 -255
- package/src/assets/_variables.scss +12 -10
- package/src/assets/header-icon.scss +8 -9
- package/src/assets/mapicon-species-style.css +10 -8
- package/src/assets/styles.scss +1 -1
- package/src/components/ContentBar.vue +99 -106
- package/src/components/ContentVuer.vue +36 -39
- package/src/components/ContextCard.vue +238 -199
- package/src/components/ContextHelp.vue +22 -26
- package/src/components/CustomSplitter.vue +32 -43
- package/src/components/DatasetHeader.vue +37 -41
- package/src/components/DialogToolbarContent.vue +292 -256
- package/src/components/FlatmapContextCard.vue +52 -57
- package/src/components/MapContent.vue +111 -87
- package/src/components/ResizeSensor.vue +8 -13
- package/src/components/SearchControls.vue +26 -35
- package/src/components/SimulatedData.js +196 -219
- package/src/components/SplitDialog.vue +139 -129
- package/src/components/SplitFlow.vue +433 -239
- package/src/components/index.js +1 -3
- package/src/components/scripts/simulation_data.js +393 -397
- package/src/components/scripts/utilities.js +108 -78
- package/src/components/viewers/CellDLViewer.vue +9 -9
- package/src/components/viewers/ConnectivityGraph.vue +9 -12
- package/src/components/viewers/Flatmap.vue +23 -25
- package/src/components/viewers/Iframe.vue +8 -10
- package/src/components/viewers/MultiFlatmap.vue +73 -69
- package/src/components/viewers/Plot.vue +6 -7
- package/src/components/viewers/Scaffold.vue +73 -63
- package/src/components/viewers/Simulation.vue +10 -15
- package/src/main.js +16 -21
- package/src/mixins/ContentMixin.js +208 -178
- package/src/mixins/DynamicMarkerMixin.js +14 -18
- package/src/mixins/RetrieveContextCardMixin.js +35 -30
- package/src/mixins/S3Bucket.vue +10 -13
- package/src/services/knowledgeMapping.js +53 -53
- package/src/services/tagging.js +4 -4
- package/src/stores/connectivities.js +46 -8
- package/src/stores/entries.js +7 -9
- package/src/stores/index.js +7 -7
- package/src/stores/settings.js +23 -31
- package/src/stores/splitFlow.js +395 -298
- package/vite.bundle-build.js +24 -26
- package/vite.config.js +22 -21
- package/vite.static-build.js +4 -4
- package/vitest.workspace.js +1 -3
- package/vuese-generator.js +47 -55
package/src/App.vue
CHANGED
|
@@ -1,51 +1,48 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app">
|
|
3
|
-
<link
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</
|
|
20
|
-
<
|
|
21
|
-
<el-button @click="setRatFlatmap()" size="small">Set Rat Flatmap</el-button>
|
|
22
|
-
<el-button @click="setMultiFlatmap()" size="small">Set MultiFlatmap</el-button>
|
|
23
|
-
<el-button @click="setLegacyMultiFlatmap()" size="small">Set Legacy MultiFlatmap</el-button>
|
|
24
|
-
<el-button @click="setScaffold()" size="small">Set To Scaffold</el-button>
|
|
25
|
-
<el-button @click="setWholebody()" size="small">Set to Wholebody</el-button>
|
|
26
|
-
<el-button @click="setFlatmap()" size="small">Set Flatmap</el-button>
|
|
27
|
-
<el-button @click="setSearch()" size="small">Set Search</el-button>
|
|
28
|
-
</div>
|
|
29
|
-
<div class="row">
|
|
30
|
-
<div style="font-weight: 600">Connectivity tooltip labels:</div>
|
|
31
|
-
</div>
|
|
32
|
-
<div class="row">
|
|
33
|
-
<el-checkbox @change="onShowLongLabelChange" v-model="showLongLabel" size="small">
|
|
34
|
-
Show long label
|
|
35
|
-
</el-checkbox>
|
|
36
|
-
<el-checkbox @change="onTruncateLongLabelChange" :disabled="!showLongLabel" v-model="truncateLongLabel" size="small">
|
|
37
|
-
Truncate long label
|
|
38
|
-
</el-checkbox>
|
|
39
|
-
<el-checkbox @change="onShowIdInTooltipChange" :disabled="!showLongLabel" v-model="showIdInTooltip" size="small">
|
|
40
|
-
Show ID in tooltip
|
|
41
|
-
</el-checkbox>
|
|
42
|
-
</div>
|
|
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
|
+
ref="optionsPopover"
|
|
10
|
+
placement="bottom"
|
|
11
|
+
trigger="click"
|
|
12
|
+
width="500"
|
|
13
|
+
class="popover"
|
|
14
|
+
:teleported="false"
|
|
15
|
+
>
|
|
16
|
+
<div class="options-container">
|
|
17
|
+
<div class="row">
|
|
18
|
+
<el-button @click="saveSettings()" size="small">Save Settings</el-button>
|
|
19
|
+
<el-button @click="restoreSettings()" size="small">Restore Settings</el-button>
|
|
20
|
+
<el-button @click="getShareableURL()" size="small">Get Link</el-button>
|
|
43
21
|
</div>
|
|
44
|
-
<
|
|
45
|
-
<el-button
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
22
|
+
<div class="row">
|
|
23
|
+
<el-button @click="setRatFlatmap()" size="small">Set Rat Flatmap</el-button>
|
|
24
|
+
<el-button @click="setMultiFlatmap()" size="small">Set MultiFlatmap</el-button>
|
|
25
|
+
<el-button @click="setLegacyMultiFlatmap()" size="small">
|
|
26
|
+
Set Legacy MultiFlatmap
|
|
27
|
+
</el-button>
|
|
28
|
+
<el-button @click="setScaffold()" size="small">Set To Scaffold</el-button>
|
|
29
|
+
<el-button @click="setWholebody()" size="small">Set to Wholebody</el-button>
|
|
30
|
+
<el-button @click="setFlatmap()" size="small">Set Flatmap</el-button>
|
|
31
|
+
<el-button @click="setSearch()" size="small">Set Search</el-button>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="row radio-row">
|
|
34
|
+
<span class="radio-label">Open new species in:</span>
|
|
35
|
+
<el-radio-group v-model="openNewSpeciesInSplitView" size="small">
|
|
36
|
+
<el-radio :value="false">Current view</el-radio>
|
|
37
|
+
<el-radio :value="true">Split view</el-radio>
|
|
38
|
+
</el-radio-group>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<template #reference>
|
|
42
|
+
<el-button class="options-button" :icon="ElIconSetting">Options</el-button>
|
|
43
|
+
</template>
|
|
44
|
+
</el-popover>
|
|
45
|
+
</div>
|
|
49
46
|
<div class="map-app">
|
|
50
47
|
<MapContent
|
|
51
48
|
v-if="routerIsReady"
|
|
@@ -62,6 +59,7 @@
|
|
|
62
59
|
:allClosable="false"
|
|
63
60
|
:showGlobalSettings="true"
|
|
64
61
|
:showOpenMapButton="true"
|
|
62
|
+
:openNewSpeciesInSplitView="openNewSpeciesInSplitView"
|
|
65
63
|
@updateShareLinkRequested="updateUUID"
|
|
66
64
|
@isReady="viewerIsReady"
|
|
67
65
|
@mapLoaded="mapIsLoaded"
|
|
@@ -71,22 +69,16 @@
|
|
|
71
69
|
</template>
|
|
72
70
|
|
|
73
71
|
<script>
|
|
74
|
-
/* eslint-disable no-alert, no-console */
|
|
75
72
|
import { shallowRef } from 'vue';
|
|
76
73
|
import MapContent from './components/MapContent.vue';
|
|
77
|
-
import { Setting as ElIconSetting } from '@element-plus/icons-vue'
|
|
78
|
-
import {
|
|
79
|
-
ElButton as Button,
|
|
80
|
-
ElCol as Col,
|
|
81
|
-
ElPopover as Popover,
|
|
82
|
-
ElRow as Row,
|
|
83
|
-
ElMessage as Message,
|
|
84
|
-
} from 'element-plus';
|
|
74
|
+
import { Setting as ElIconSetting } from '@element-plus/icons-vue';
|
|
75
|
+
import { ElMessage as Message } from 'element-plus';
|
|
85
76
|
import 'element-plus/es/components/message/style/css';
|
|
86
77
|
|
|
87
78
|
const getAnnotationId = (api, withAnnotation) => {
|
|
88
79
|
return new Promise((resolve) => {
|
|
89
|
-
let anonymousAnnotations =
|
|
80
|
+
let anonymousAnnotations =
|
|
81
|
+
JSON.parse(sessionStorage.getItem('anonymous-annotation')) || undefined;
|
|
90
82
|
if (withAnnotation && anonymousAnnotations) {
|
|
91
83
|
let maxRetry = 3;
|
|
92
84
|
const annotationUrl = api + '/annotation/getshareid';
|
|
@@ -97,29 +89,30 @@ const getAnnotationId = (api, withAnnotation) => {
|
|
|
97
89
|
'Content-type': 'application/json',
|
|
98
90
|
},
|
|
99
91
|
body: JSON.stringify({ state: anonymousAnnotations }),
|
|
100
|
-
}).then((response) => {
|
|
101
|
-
if (response.ok) {
|
|
102
|
-
return response.json();
|
|
103
|
-
}
|
|
104
|
-
throw new Error('Unsuccessful attempt to get annotation id')
|
|
105
|
-
})
|
|
106
|
-
.then((data) => {
|
|
107
|
-
resolve(data.uuid);
|
|
108
|
-
})
|
|
109
|
-
.catch((error) => {
|
|
110
|
-
if (maxRetry > attempt) {
|
|
111
|
-
getId(attempt + 1);
|
|
112
|
-
} else {
|
|
113
|
-
resolve(undefined);
|
|
114
|
-
}
|
|
115
92
|
})
|
|
116
|
-
|
|
93
|
+
.then((response) => {
|
|
94
|
+
if (response.ok) {
|
|
95
|
+
return response.json();
|
|
96
|
+
}
|
|
97
|
+
throw new Error('Unsuccessful attempt to get annotation id');
|
|
98
|
+
})
|
|
99
|
+
.then((data) => {
|
|
100
|
+
resolve(data.uuid);
|
|
101
|
+
})
|
|
102
|
+
.catch((_error) => {
|
|
103
|
+
if (maxRetry > attempt) {
|
|
104
|
+
getId(attempt + 1);
|
|
105
|
+
} else {
|
|
106
|
+
resolve(undefined);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
};
|
|
117
110
|
getId(1);
|
|
118
111
|
} else {
|
|
119
112
|
resolve(undefined);
|
|
120
113
|
}
|
|
121
114
|
});
|
|
122
|
-
}
|
|
115
|
+
};
|
|
123
116
|
|
|
124
117
|
const getAnnotationState = (api, annotationId) => {
|
|
125
118
|
return new Promise((resolve) => {
|
|
@@ -132,81 +125,80 @@ const getAnnotationState = (api, annotationId) => {
|
|
|
132
125
|
'Content-type': 'application/json',
|
|
133
126
|
},
|
|
134
127
|
body: JSON.stringify({ uuid: annotationId }),
|
|
135
|
-
}).then((response) => {
|
|
136
|
-
if (response.ok) {
|
|
137
|
-
return response.json();
|
|
138
|
-
}
|
|
139
|
-
throw new Error('Unsuccessful attempt to get annotations');
|
|
140
|
-
})
|
|
141
|
-
.then((data) => {
|
|
142
|
-
resolve(data);
|
|
143
128
|
})
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
129
|
+
.then((response) => {
|
|
130
|
+
if (response.ok) {
|
|
131
|
+
return response.json();
|
|
132
|
+
}
|
|
133
|
+
throw new Error('Unsuccessful attempt to get annotations');
|
|
134
|
+
})
|
|
135
|
+
.then((data) => {
|
|
136
|
+
resolve(data);
|
|
137
|
+
})
|
|
138
|
+
.catch((_error) => {
|
|
139
|
+
console.log(`Unable to get annotation state: attempt ${attempt} of ${maxRetry}`);
|
|
140
|
+
if (maxRetry > attempt) {
|
|
141
|
+
getState(attempt + 1);
|
|
142
|
+
} else {
|
|
143
|
+
resolve(undefined);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
};
|
|
153
147
|
getState(1);
|
|
154
148
|
});
|
|
155
|
-
}
|
|
149
|
+
};
|
|
156
150
|
|
|
157
151
|
export default {
|
|
158
152
|
name: 'app',
|
|
159
153
|
components: {
|
|
160
|
-
Button,
|
|
161
|
-
Col,
|
|
162
|
-
Popover,
|
|
163
|
-
Row,
|
|
164
154
|
MapContent,
|
|
165
155
|
},
|
|
166
|
-
data: function() {
|
|
156
|
+
data: function () {
|
|
167
157
|
return {
|
|
168
158
|
uuid: undefined,
|
|
169
159
|
state: undefined,
|
|
170
|
-
prefix:
|
|
160
|
+
prefix: '/map',
|
|
171
161
|
api: import.meta.env.VITE_API_LOCATION,
|
|
172
162
|
discover_api: import.meta.env.PENNSIEVE_DISCOVER_API || 'https://api.pennsieve.io/discover',
|
|
173
163
|
mapSettings: [],
|
|
174
|
-
startingMap:
|
|
164
|
+
startingMap: 'AC',
|
|
175
165
|
ElIconSetting: shallowRef(ElIconSetting),
|
|
176
166
|
routerIsReady: false,
|
|
177
167
|
showLongLabel: true,
|
|
178
168
|
truncateLongLabel: true,
|
|
179
169
|
showIdInTooltip: true,
|
|
180
|
-
|
|
170
|
+
openNewSpeciesInSplitView: true,
|
|
171
|
+
};
|
|
181
172
|
},
|
|
182
173
|
computed: {
|
|
183
|
-
shareLink: function() {
|
|
184
|
-
if (this.uuid)
|
|
185
|
-
return this.prefix +"#/?id=" + this.uuid;
|
|
174
|
+
shareLink: function () {
|
|
175
|
+
if (this.uuid) return this.prefix + '#/?id=' + this.uuid;
|
|
186
176
|
return this.prefix;
|
|
187
177
|
},
|
|
188
|
-
options: function() {
|
|
178
|
+
options: function () {
|
|
189
179
|
return {
|
|
190
180
|
sparcApi: import.meta.env.VITE_API_LOCATION,
|
|
191
181
|
algoliaIndex: import.meta.env.VITE_ALGOLIA_INDEX,
|
|
192
182
|
algoliaKey: import.meta.env.VITE_ALGOLIA_KEY,
|
|
193
183
|
algoliaId: import.meta.env.VITE_ALGOLIA_ID,
|
|
194
184
|
pennsieveApi: import.meta.env.VITE_PENNSIEVE_API_LOCATION,
|
|
195
|
-
flatmapAPI: this.$route.query.flatmapserver
|
|
185
|
+
flatmapAPI: this.$route.query.flatmapserver
|
|
186
|
+
? this.$route.query.flatmapserver
|
|
187
|
+
: import.meta.env.VITE_FLATMAPAPI_LOCATION,
|
|
196
188
|
rootUrl: import.meta.env.VITE_ROOT_URL,
|
|
197
|
-
}
|
|
198
|
-
}
|
|
189
|
+
};
|
|
190
|
+
},
|
|
199
191
|
},
|
|
200
192
|
methods: {
|
|
201
|
-
closePopover: function() {
|
|
193
|
+
closePopover: function () {
|
|
202
194
|
if (this.$refs.optionsPopover) {
|
|
203
195
|
this.$refs.optionsPopover.hide();
|
|
204
196
|
}
|
|
205
197
|
},
|
|
206
|
-
changeViewingMode: function(modeName) {
|
|
198
|
+
changeViewingMode: function (modeName) {
|
|
207
199
|
this.$refs.map.changeViewingMode(modeName);
|
|
208
200
|
},
|
|
209
|
-
saveSettings: function() {
|
|
201
|
+
saveSettings: function () {
|
|
210
202
|
const mapState = JSON.parse(JSON.stringify(this.$refs.map.getState()));
|
|
211
203
|
this.mapSettings.push(mapState);
|
|
212
204
|
Message({
|
|
@@ -216,7 +208,7 @@ export default {
|
|
|
216
208
|
duration: 1200,
|
|
217
209
|
});
|
|
218
210
|
},
|
|
219
|
-
restoreSettings: function() {
|
|
211
|
+
restoreSettings: function () {
|
|
220
212
|
if (this.mapSettings.length > 0) {
|
|
221
213
|
this.$refs.map.$refs.flow.sidebarStateRestored = false; // reset sidebar state flag
|
|
222
214
|
this.$refs.map.$refs.flow._externalStateSet = false; // reset state flag
|
|
@@ -234,10 +226,10 @@ export default {
|
|
|
234
226
|
type: 'warning',
|
|
235
227
|
showClose: true,
|
|
236
228
|
duration: 1200,
|
|
237
|
-
})
|
|
229
|
+
});
|
|
238
230
|
}
|
|
239
231
|
},
|
|
240
|
-
updateUUID: function(withAnnotation) {
|
|
232
|
+
updateUUID: function (withAnnotation) {
|
|
241
233
|
let url = this.api + 'map/getshareid';
|
|
242
234
|
let state = this.$refs.map.getState(false);
|
|
243
235
|
|
|
@@ -250,111 +242,89 @@ export default {
|
|
|
250
242
|
},
|
|
251
243
|
body: JSON.stringify({ state: state }),
|
|
252
244
|
})
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
245
|
+
.then((response) => {
|
|
246
|
+
if (response.ok) {
|
|
247
|
+
return response.json();
|
|
248
|
+
}
|
|
249
|
+
throw new Error('Unsuccessful attempt to get shareid');
|
|
250
|
+
})
|
|
251
|
+
.then((data) => {
|
|
252
|
+
this.uuid = data.uuid;
|
|
253
|
+
})
|
|
254
|
+
.catch((_error) => {
|
|
255
|
+
console.log(`Unable to create permalink: attempt ${attempt} of ${maxRetry}`);
|
|
256
|
+
if (maxRetry > attempt) {
|
|
257
|
+
getShareLink(attempt + 1);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
};
|
|
269
261
|
getAnnotationId(this.api, withAnnotation).then((annotationId) => {
|
|
270
262
|
if (annotationId) {
|
|
271
263
|
state.annotationId = annotationId;
|
|
272
264
|
}
|
|
273
|
-
getShareLink(1)
|
|
265
|
+
getShareLink(1);
|
|
274
266
|
});
|
|
275
|
-
|
|
276
|
-
},
|
|
277
|
-
setFlatmap: function() {
|
|
278
|
-
this.$refs.map.setCurrentEntry(
|
|
279
|
-
{
|
|
280
|
-
type: "Flatmap",
|
|
281
|
-
resource: "FunctionalConnectivity",
|
|
282
|
-
label: "Functional"
|
|
283
|
-
}
|
|
284
|
-
);
|
|
285
|
-
this.closePopover();
|
|
286
|
-
},
|
|
287
|
-
setLegacyMultiFlatmap: function() {
|
|
288
|
-
this.$refs.map.setCurrentEntry(
|
|
289
|
-
{
|
|
290
|
-
type: "MultiFlatmap",
|
|
291
|
-
taxo: "NCBITaxon:10114",
|
|
292
|
-
uuid: "01fedbf9-d783-509c-a10c-827941ab13da",
|
|
293
|
-
}
|
|
294
|
-
);
|
|
295
|
-
this.closePopover();
|
|
296
|
-
},
|
|
297
|
-
setMultiFlatmap: function() {
|
|
298
|
-
this.$refs.map.setCurrentEntry(
|
|
299
|
-
{
|
|
300
|
-
type: "MultiFlatmap",
|
|
301
|
-
taxo: "NCBITaxon:9606",
|
|
302
|
-
biologicalSex: "PATO:0000384",
|
|
303
|
-
//organ: "heart"
|
|
304
|
-
organ: "UBERON:0018675"
|
|
305
|
-
}
|
|
306
|
-
);
|
|
307
|
-
this.closePopover();
|
|
308
267
|
},
|
|
309
|
-
|
|
310
|
-
this.$refs.map.setCurrentEntry(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
);
|
|
268
|
+
setFlatmap: function () {
|
|
269
|
+
this.$refs.map.setCurrentEntry({
|
|
270
|
+
type: 'Flatmap',
|
|
271
|
+
resource: 'FunctionalConnectivity',
|
|
272
|
+
label: 'Functional',
|
|
273
|
+
});
|
|
316
274
|
this.closePopover();
|
|
317
275
|
},
|
|
318
|
-
|
|
319
|
-
this.$refs.map.setCurrentEntry(
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
viewUrl: "colonMouse_Layout1_view.json"
|
|
325
|
-
}
|
|
326
|
-
);
|
|
276
|
+
setLegacyMultiFlatmap: function () {
|
|
277
|
+
this.$refs.map.setCurrentEntry({
|
|
278
|
+
type: 'MultiFlatmap',
|
|
279
|
+
taxo: 'NCBITaxon:10114',
|
|
280
|
+
uuid: '01fedbf9-d783-509c-a10c-827941ab13da',
|
|
281
|
+
});
|
|
327
282
|
this.closePopover();
|
|
328
283
|
},
|
|
329
|
-
|
|
330
|
-
this.$refs.map.setCurrentEntry(
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
);
|
|
284
|
+
setMultiFlatmap: function () {
|
|
285
|
+
this.$refs.map.setCurrentEntry({
|
|
286
|
+
type: 'MultiFlatmap',
|
|
287
|
+
taxo: 'NCBITaxon:9606',
|
|
288
|
+
biologicalSex: 'PATO:0000384',
|
|
289
|
+
//organ: "heart"
|
|
290
|
+
organ: 'UBERON:0018675',
|
|
291
|
+
});
|
|
337
292
|
this.closePopover();
|
|
338
293
|
},
|
|
339
|
-
|
|
340
|
-
this.$refs.map.
|
|
294
|
+
setRatFlatmap: function () {
|
|
295
|
+
this.$refs.map.setCurrentEntry({
|
|
296
|
+
type: 'MultiFlatmap',
|
|
297
|
+
taxo: 'NCBITaxon:10114',
|
|
298
|
+
});
|
|
341
299
|
this.closePopover();
|
|
342
300
|
},
|
|
343
|
-
|
|
301
|
+
setScaffold: function () {
|
|
302
|
+
this.$refs.map.setCurrentEntry({
|
|
303
|
+
type: 'Scaffold',
|
|
304
|
+
label: 'Colon',
|
|
305
|
+
url: `${this.api}/s3-resource/76/files/derivative/colonMouse_metadata.json?s3BucketName=prd-sparc-discover50-use1`,
|
|
306
|
+
viewUrl: 'colonMouse_Layout1_view.json',
|
|
307
|
+
});
|
|
344
308
|
this.closePopover();
|
|
345
309
|
},
|
|
346
|
-
|
|
310
|
+
setWholebody: function () {
|
|
311
|
+
this.$refs.map.setCurrentEntry({
|
|
312
|
+
type: 'Scaffold',
|
|
313
|
+
label: 'Human',
|
|
314
|
+
isBodyScaffold: true,
|
|
315
|
+
});
|
|
347
316
|
this.closePopover();
|
|
348
317
|
},
|
|
349
|
-
|
|
318
|
+
setSearch: function () {
|
|
319
|
+
this.$refs.map.openSearch([], '10.26275/1uno-tynt');
|
|
350
320
|
this.closePopover();
|
|
351
321
|
},
|
|
352
|
-
mapIsLoaded: function(map) {
|
|
353
|
-
console.log(
|
|
322
|
+
mapIsLoaded: function (map) {
|
|
323
|
+
console.log('map is loaded', map);
|
|
354
324
|
// map.changeViewingMode('Annotation')
|
|
355
325
|
},
|
|
356
|
-
viewerIsReady: function() {
|
|
357
|
-
console.log(
|
|
326
|
+
viewerIsReady: function () {
|
|
327
|
+
console.log('viewer is ready');
|
|
358
328
|
this.parseQuery();
|
|
359
329
|
},
|
|
360
330
|
fetchDataFromApi: async function (url) {
|
|
@@ -380,29 +350,23 @@ export default {
|
|
|
380
350
|
const url = `${this.api}/exists/${path}`;
|
|
381
351
|
return await this.fetchDataFromApi(url);
|
|
382
352
|
},
|
|
383
|
-
extractS3BucketName: function(uri) {
|
|
353
|
+
extractS3BucketName: function (uri) {
|
|
384
354
|
if (uri) {
|
|
385
|
-
const substring = uri.split(
|
|
355
|
+
const substring = uri.split('//')[1];
|
|
386
356
|
if (substring) {
|
|
387
|
-
return substring.split(
|
|
357
|
+
return substring.split('/')[0];
|
|
388
358
|
}
|
|
389
359
|
}
|
|
390
360
|
return undefined;
|
|
391
361
|
},
|
|
392
|
-
getScaffoldEntry: async function(dataset_id, file_path, dataset_version, viewUrl) {
|
|
393
|
-
const datasetInfo = await this.getDatasetInfo(
|
|
394
|
-
|
|
395
|
-
dataset_id,
|
|
396
|
-
dataset_version,
|
|
397
|
-
);
|
|
398
|
-
const s3Bucket = datasetInfo
|
|
399
|
-
? this.extractS3BucketName(datasetInfo.uri)
|
|
400
|
-
: undefined
|
|
362
|
+
getScaffoldEntry: async function (dataset_id, file_path, dataset_version, viewUrl) {
|
|
363
|
+
const datasetInfo = await this.getDatasetInfo(this.discover_api, dataset_id, dataset_version);
|
|
364
|
+
const s3Bucket = datasetInfo ? this.extractS3BucketName(datasetInfo.uri) : undefined;
|
|
401
365
|
|
|
402
366
|
if (s3Bucket) {
|
|
403
|
-
let path = `${dataset_id}/${file_path}
|
|
367
|
+
let path = `${dataset_id}/${file_path}`;
|
|
404
368
|
if (s3Bucket) {
|
|
405
|
-
path = path + `?s3BucketName=${s3Bucket}
|
|
369
|
+
path = path + `?s3BucketName=${s3Bucket}`;
|
|
406
370
|
}
|
|
407
371
|
const fileCheckResults = await this.checkFileExists(path);
|
|
408
372
|
|
|
@@ -444,65 +408,63 @@ export default {
|
|
|
444
408
|
xmlhttp.open('POST', url, true);
|
|
445
409
|
//Send the proper header information along with the request
|
|
446
410
|
xmlhttp.setRequestHeader('Content-type', 'application/json');
|
|
447
|
-
xmlhttp.onreadystatechange = () => {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
this.state = state.state;
|
|
458
|
-
});
|
|
459
|
-
} else {
|
|
411
|
+
xmlhttp.onreadystatechange = () => {
|
|
412
|
+
//Call a function when the state changes.
|
|
413
|
+
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
|
414
|
+
let state = JSON.parse(xmlhttp.responseText);
|
|
415
|
+
console.log(state);
|
|
416
|
+
if (state?.state?.annotationId) {
|
|
417
|
+
getAnnotationState(this.api, state.state.annotationId).then((data) => {
|
|
418
|
+
if (data) {
|
|
419
|
+
sessionStorage.setItem('anonymous-annotation', JSON.stringify(data.state));
|
|
420
|
+
}
|
|
460
421
|
this.state = state.state;
|
|
461
|
-
}
|
|
422
|
+
});
|
|
423
|
+
} else {
|
|
424
|
+
this.state = state.state;
|
|
462
425
|
}
|
|
463
|
-
|
|
464
|
-
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
xmlhttp.send(JSON.stringify({ uuid: this.uuid }));
|
|
465
429
|
}
|
|
466
430
|
|
|
467
431
|
if (type === 'ac') {
|
|
468
432
|
// Load AC map with different species
|
|
469
|
-
this.startingMap =
|
|
433
|
+
this.startingMap = 'AC';
|
|
470
434
|
this.$nextTick(() => {
|
|
471
435
|
const currentEntry = {
|
|
472
|
-
type:
|
|
436
|
+
type: 'MultiFlatmap',
|
|
473
437
|
taxo: taxo || '',
|
|
474
438
|
};
|
|
475
439
|
if (anatomy) {
|
|
476
440
|
currentEntry.organ = anatomy;
|
|
477
441
|
}
|
|
478
442
|
this.$refs.map.setCurrentEntry(currentEntry);
|
|
479
|
-
})
|
|
443
|
+
});
|
|
480
444
|
} else if (type === 'fc') {
|
|
481
445
|
// Load FC map
|
|
482
|
-
this.startingMap =
|
|
446
|
+
this.startingMap = 'FC';
|
|
483
447
|
this.$nextTick(() => {
|
|
484
448
|
const currentEntry = {
|
|
485
449
|
type: 'Flatmap',
|
|
486
450
|
resource: 'FunctionalConnectivity',
|
|
487
451
|
label: 'Functional',
|
|
488
|
-
}
|
|
452
|
+
};
|
|
489
453
|
if (this.$route.query.fid) {
|
|
490
454
|
currentEntry.resource = this.$route.query.fid;
|
|
491
455
|
}
|
|
492
456
|
this.$refs.map.setCurrentEntry(currentEntry);
|
|
493
|
-
})
|
|
457
|
+
});
|
|
494
458
|
} else if (type === 'wholebody') {
|
|
495
459
|
// Load Wholebody scaffold
|
|
496
|
-
this.startingMap =
|
|
460
|
+
this.startingMap = 'WholeBody';
|
|
497
461
|
this.$nextTick(() => {
|
|
498
|
-
this.$refs.map.setCurrentEntry(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
);
|
|
505
|
-
})
|
|
462
|
+
this.$refs.map.setCurrentEntry({
|
|
463
|
+
type: 'Scaffold',
|
|
464
|
+
label: 'Human',
|
|
465
|
+
isBodyScaffold: true,
|
|
466
|
+
});
|
|
467
|
+
});
|
|
506
468
|
} else if (type === 'scaffold' && dataset_id && file_path) {
|
|
507
469
|
// Load scaffold from dataset
|
|
508
470
|
// e.g. type=scaffold&dataset_id=444&dataset_version=1&file_path=[file_path]_metadata.json
|
|
@@ -516,13 +478,13 @@ export default {
|
|
|
516
478
|
this.$refs.map.setCurrentEntry(scaffoldEntry);
|
|
517
479
|
}
|
|
518
480
|
}
|
|
519
|
-
})
|
|
481
|
+
});
|
|
520
482
|
},
|
|
521
483
|
},
|
|
522
|
-
mounted: function() {
|
|
484
|
+
mounted: function () {
|
|
523
485
|
this.waitForRouter();
|
|
524
486
|
},
|
|
525
|
-
}
|
|
487
|
+
};
|
|
526
488
|
</script>
|
|
527
489
|
|
|
528
490
|
<style lang="scss">
|
|
@@ -530,12 +492,12 @@ $button-container-size: 50px;
|
|
|
530
492
|
$gap: 24px;
|
|
531
493
|
|
|
532
494
|
#app {
|
|
533
|
-
height:100%;
|
|
495
|
+
height: 100%;
|
|
534
496
|
width: 100%;
|
|
535
|
-
position:absolute;
|
|
536
|
-
font-family:
|
|
497
|
+
position: absolute;
|
|
498
|
+
font-family: 'Asap', sans-serif;
|
|
537
499
|
background-color: #f5f7fa;
|
|
538
|
-
--el-color-primary: #
|
|
500
|
+
--el-color-primary: #8300bf;
|
|
539
501
|
--el-color-primary-light-7: #dab3ec;
|
|
540
502
|
--el-color-primary-light-8: #e6ccf2;
|
|
541
503
|
--el-color-primary-light-9: #f3e6f9;
|
|
@@ -555,11 +517,11 @@ body {
|
|
|
555
517
|
position: relative;
|
|
556
518
|
}
|
|
557
519
|
|
|
558
|
-
.popover{
|
|
559
|
-
top:10px;
|
|
560
|
-
right:50%;
|
|
561
|
-
position:absolute;
|
|
562
|
-
z-index:1000;
|
|
520
|
+
.popover {
|
|
521
|
+
top: 10px;
|
|
522
|
+
right: 50%;
|
|
523
|
+
position: absolute;
|
|
524
|
+
z-index: 1000;
|
|
563
525
|
}
|
|
564
526
|
|
|
565
527
|
.row {
|
|
@@ -583,13 +545,20 @@ body {
|
|
|
583
545
|
height: $button-container-size;
|
|
584
546
|
}
|
|
585
547
|
|
|
586
|
-
|
|
587
|
-
.options-container{
|
|
548
|
+
.options-container {
|
|
588
549
|
text-align: center;
|
|
589
550
|
}
|
|
590
551
|
|
|
552
|
+
.radio-row {
|
|
553
|
+
align-items: center;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.radio-label {
|
|
557
|
+
font-size: 12px;
|
|
558
|
+
}
|
|
559
|
+
|
|
591
560
|
.map-icon {
|
|
592
|
-
color: $app-primary-color!important;
|
|
561
|
+
color: $app-primary-color !important;
|
|
593
562
|
}
|
|
594
563
|
|
|
595
564
|
.el-message.is-closable {
|
|
@@ -598,7 +567,7 @@ body {
|
|
|
598
567
|
--el-message-text-color: #{$app-primary-color};
|
|
599
568
|
|
|
600
569
|
.el-message__content {
|
|
601
|
-
font-family:
|
|
570
|
+
font-family: 'Asap', sans-serif;
|
|
602
571
|
font-size: 12px;
|
|
603
572
|
}
|
|
604
573
|
}
|