@abi-software/mapintegratedvuer 1.21.1 → 1.21.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/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-DrSaFEDd.js} +3 -3
- package/dist/{ContentMixin-Vn34n5t2.js → ContentMixin-Xg0PjBqG.js} +2 -2
- package/dist/{DynamicMarkerMixin-BS6t7w_i.js → DynamicMarkerMixin-D5Ruu_hd.js} +1 -1
- package/dist/{Flatmap-BejxA0uz.js → Flatmap-CxN8TbnS.js} +4 -4
- package/dist/{Iframe-BWbhTjCR.js → Iframe-CkgbLfJt.js} +4 -4
- package/dist/{MultiFlatmap-nlmsH-Ib.js → MultiFlatmap-CkejvAJe.js} +4 -4
- package/dist/{Plot-ChbPsDZX.js → Plot-BfwoipSl.js} +2 -2
- package/dist/{Scaffold-C6f7c7Ha.js → Scaffold-DCqsTKpg.js} +4 -4
- package/dist/{Simulation-DcJScRYo.js → Simulation-BOtU3kTT.js} +2 -2
- package/dist/{connectivities-UXTqf7_0.js → connectivities-DyeS8w0c.js} +126 -95
- package/dist/index.html +9 -6
- package/dist/mapintegratedvuer.js +5489 -5578
- package/dist/mapintegratedvuer.umd.cjs +196 -196
- package/dist/style.css +1 -1
- package/eslint.config.js +39 -15
- package/package.json +11 -5
- package/public/index.html +9 -6
- package/src/App.vue +234 -249
- 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 +98 -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 +90 -86
- 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 +421 -237
- 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 +59 -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 +364 -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,65 @@
|
|
|
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">
|
|
34
|
+
<div style="font-weight: 600">Connectivity tooltip labels:</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="row">
|
|
37
|
+
<el-checkbox @change="onShowLongLabelChange" v-model="showLongLabel" size="small">
|
|
38
|
+
Show long label
|
|
39
|
+
</el-checkbox>
|
|
40
|
+
<el-checkbox
|
|
41
|
+
@change="onTruncateLongLabelChange"
|
|
42
|
+
:disabled="!showLongLabel"
|
|
43
|
+
v-model="truncateLongLabel"
|
|
44
|
+
size="small"
|
|
45
|
+
>
|
|
46
|
+
Truncate long label
|
|
47
|
+
</el-checkbox>
|
|
48
|
+
<el-checkbox
|
|
49
|
+
@change="onShowIdInTooltipChange"
|
|
50
|
+
:disabled="!showLongLabel"
|
|
51
|
+
v-model="showIdInTooltip"
|
|
52
|
+
size="small"
|
|
53
|
+
>
|
|
54
|
+
Show ID in tooltip
|
|
55
|
+
</el-checkbox>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
<template #reference>
|
|
59
|
+
<el-button class="options-button" :icon="ElIconSetting">Options</el-button>
|
|
60
|
+
</template>
|
|
61
|
+
</el-popover>
|
|
62
|
+
</div>
|
|
49
63
|
<div class="map-app">
|
|
50
64
|
<MapContent
|
|
51
65
|
v-if="routerIsReady"
|
|
@@ -71,22 +85,16 @@
|
|
|
71
85
|
</template>
|
|
72
86
|
|
|
73
87
|
<script>
|
|
74
|
-
/* eslint-disable no-alert, no-console */
|
|
75
88
|
import { shallowRef } from 'vue';
|
|
76
89
|
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';
|
|
90
|
+
import { Setting as ElIconSetting } from '@element-plus/icons-vue';
|
|
91
|
+
import { ElMessage as Message } from 'element-plus';
|
|
85
92
|
import 'element-plus/es/components/message/style/css';
|
|
86
93
|
|
|
87
94
|
const getAnnotationId = (api, withAnnotation) => {
|
|
88
95
|
return new Promise((resolve) => {
|
|
89
|
-
let anonymousAnnotations =
|
|
96
|
+
let anonymousAnnotations =
|
|
97
|
+
JSON.parse(sessionStorage.getItem('anonymous-annotation')) || undefined;
|
|
90
98
|
if (withAnnotation && anonymousAnnotations) {
|
|
91
99
|
let maxRetry = 3;
|
|
92
100
|
const annotationUrl = api + '/annotation/getshareid';
|
|
@@ -97,29 +105,30 @@ const getAnnotationId = (api, withAnnotation) => {
|
|
|
97
105
|
'Content-type': 'application/json',
|
|
98
106
|
},
|
|
99
107
|
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
108
|
})
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
.then((response) => {
|
|
110
|
+
if (response.ok) {
|
|
111
|
+
return response.json();
|
|
112
|
+
}
|
|
113
|
+
throw new Error('Unsuccessful attempt to get annotation id');
|
|
114
|
+
})
|
|
115
|
+
.then((data) => {
|
|
116
|
+
resolve(data.uuid);
|
|
117
|
+
})
|
|
118
|
+
.catch((_error) => {
|
|
119
|
+
if (maxRetry > attempt) {
|
|
120
|
+
getId(attempt + 1);
|
|
121
|
+
} else {
|
|
122
|
+
resolve(undefined);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
};
|
|
117
126
|
getId(1);
|
|
118
127
|
} else {
|
|
119
128
|
resolve(undefined);
|
|
120
129
|
}
|
|
121
130
|
});
|
|
122
|
-
}
|
|
131
|
+
};
|
|
123
132
|
|
|
124
133
|
const getAnnotationState = (api, annotationId) => {
|
|
125
134
|
return new Promise((resolve) => {
|
|
@@ -132,81 +141,79 @@ const getAnnotationState = (api, annotationId) => {
|
|
|
132
141
|
'Content-type': 'application/json',
|
|
133
142
|
},
|
|
134
143
|
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
144
|
})
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
145
|
+
.then((response) => {
|
|
146
|
+
if (response.ok) {
|
|
147
|
+
return response.json();
|
|
148
|
+
}
|
|
149
|
+
throw new Error('Unsuccessful attempt to get annotations');
|
|
150
|
+
})
|
|
151
|
+
.then((data) => {
|
|
152
|
+
resolve(data);
|
|
153
|
+
})
|
|
154
|
+
.catch((_error) => {
|
|
155
|
+
console.log(`Unable to get annotation state: attempt ${attempt} of ${maxRetry}`);
|
|
156
|
+
if (maxRetry > attempt) {
|
|
157
|
+
getState(attempt + 1);
|
|
158
|
+
} else {
|
|
159
|
+
resolve(undefined);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
};
|
|
153
163
|
getState(1);
|
|
154
164
|
});
|
|
155
|
-
}
|
|
165
|
+
};
|
|
156
166
|
|
|
157
167
|
export default {
|
|
158
168
|
name: 'app',
|
|
159
169
|
components: {
|
|
160
|
-
Button,
|
|
161
|
-
Col,
|
|
162
|
-
Popover,
|
|
163
|
-
Row,
|
|
164
170
|
MapContent,
|
|
165
171
|
},
|
|
166
|
-
data: function() {
|
|
172
|
+
data: function () {
|
|
167
173
|
return {
|
|
168
174
|
uuid: undefined,
|
|
169
175
|
state: undefined,
|
|
170
|
-
prefix:
|
|
176
|
+
prefix: '/map',
|
|
171
177
|
api: import.meta.env.VITE_API_LOCATION,
|
|
172
178
|
discover_api: import.meta.env.PENNSIEVE_DISCOVER_API || 'https://api.pennsieve.io/discover',
|
|
173
179
|
mapSettings: [],
|
|
174
|
-
startingMap:
|
|
180
|
+
startingMap: 'AC',
|
|
175
181
|
ElIconSetting: shallowRef(ElIconSetting),
|
|
176
182
|
routerIsReady: false,
|
|
177
183
|
showLongLabel: true,
|
|
178
184
|
truncateLongLabel: true,
|
|
179
185
|
showIdInTooltip: true,
|
|
180
|
-
}
|
|
186
|
+
};
|
|
181
187
|
},
|
|
182
188
|
computed: {
|
|
183
|
-
shareLink: function() {
|
|
184
|
-
if (this.uuid)
|
|
185
|
-
return this.prefix +"#/?id=" + this.uuid;
|
|
189
|
+
shareLink: function () {
|
|
190
|
+
if (this.uuid) return this.prefix + '#/?id=' + this.uuid;
|
|
186
191
|
return this.prefix;
|
|
187
192
|
},
|
|
188
|
-
options: function() {
|
|
193
|
+
options: function () {
|
|
189
194
|
return {
|
|
190
195
|
sparcApi: import.meta.env.VITE_API_LOCATION,
|
|
191
196
|
algoliaIndex: import.meta.env.VITE_ALGOLIA_INDEX,
|
|
192
197
|
algoliaKey: import.meta.env.VITE_ALGOLIA_KEY,
|
|
193
198
|
algoliaId: import.meta.env.VITE_ALGOLIA_ID,
|
|
194
199
|
pennsieveApi: import.meta.env.VITE_PENNSIEVE_API_LOCATION,
|
|
195
|
-
flatmapAPI: this.$route.query.flatmapserver
|
|
200
|
+
flatmapAPI: this.$route.query.flatmapserver
|
|
201
|
+
? this.$route.query.flatmapserver
|
|
202
|
+
: import.meta.env.VITE_FLATMAPAPI_LOCATION,
|
|
196
203
|
rootUrl: import.meta.env.VITE_ROOT_URL,
|
|
197
|
-
}
|
|
198
|
-
}
|
|
204
|
+
};
|
|
205
|
+
},
|
|
199
206
|
},
|
|
200
207
|
methods: {
|
|
201
|
-
closePopover: function() {
|
|
208
|
+
closePopover: function () {
|
|
202
209
|
if (this.$refs.optionsPopover) {
|
|
203
210
|
this.$refs.optionsPopover.hide();
|
|
204
211
|
}
|
|
205
212
|
},
|
|
206
|
-
changeViewingMode: function(modeName) {
|
|
213
|
+
changeViewingMode: function (modeName) {
|
|
207
214
|
this.$refs.map.changeViewingMode(modeName);
|
|
208
215
|
},
|
|
209
|
-
saveSettings: function() {
|
|
216
|
+
saveSettings: function () {
|
|
210
217
|
const mapState = JSON.parse(JSON.stringify(this.$refs.map.getState()));
|
|
211
218
|
this.mapSettings.push(mapState);
|
|
212
219
|
Message({
|
|
@@ -216,7 +223,7 @@ export default {
|
|
|
216
223
|
duration: 1200,
|
|
217
224
|
});
|
|
218
225
|
},
|
|
219
|
-
restoreSettings: function() {
|
|
226
|
+
restoreSettings: function () {
|
|
220
227
|
if (this.mapSettings.length > 0) {
|
|
221
228
|
this.$refs.map.$refs.flow.sidebarStateRestored = false; // reset sidebar state flag
|
|
222
229
|
this.$refs.map.$refs.flow._externalStateSet = false; // reset state flag
|
|
@@ -234,10 +241,10 @@ export default {
|
|
|
234
241
|
type: 'warning',
|
|
235
242
|
showClose: true,
|
|
236
243
|
duration: 1200,
|
|
237
|
-
})
|
|
244
|
+
});
|
|
238
245
|
}
|
|
239
246
|
},
|
|
240
|
-
updateUUID: function(withAnnotation) {
|
|
247
|
+
updateUUID: function (withAnnotation) {
|
|
241
248
|
let url = this.api + 'map/getshareid';
|
|
242
249
|
let state = this.$refs.map.getState(false);
|
|
243
250
|
|
|
@@ -250,111 +257,98 @@ export default {
|
|
|
250
257
|
},
|
|
251
258
|
body: JSON.stringify({ state: state }),
|
|
252
259
|
})
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
260
|
+
.then((response) => {
|
|
261
|
+
if (response.ok) {
|
|
262
|
+
return response.json();
|
|
263
|
+
}
|
|
264
|
+
throw new Error('Unsuccessful attempt to get shareid');
|
|
265
|
+
})
|
|
266
|
+
.then((data) => {
|
|
267
|
+
this.uuid = data.uuid;
|
|
268
|
+
})
|
|
269
|
+
.catch((_error) => {
|
|
270
|
+
console.log(`Unable to create permalink: attempt ${attempt} of ${maxRetry}`);
|
|
271
|
+
if (maxRetry > attempt) {
|
|
272
|
+
getShareLink(attempt + 1);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
};
|
|
269
276
|
getAnnotationId(this.api, withAnnotation).then((annotationId) => {
|
|
270
277
|
if (annotationId) {
|
|
271
278
|
state.annotationId = annotationId;
|
|
272
279
|
}
|
|
273
|
-
getShareLink(1)
|
|
280
|
+
getShareLink(1);
|
|
274
281
|
});
|
|
275
|
-
|
|
276
282
|
},
|
|
277
|
-
setFlatmap: function() {
|
|
278
|
-
this.$refs.map.setCurrentEntry(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
);
|
|
283
|
+
setFlatmap: function () {
|
|
284
|
+
this.$refs.map.setCurrentEntry({
|
|
285
|
+
type: 'Flatmap',
|
|
286
|
+
resource: 'FunctionalConnectivity',
|
|
287
|
+
label: 'Functional',
|
|
288
|
+
});
|
|
285
289
|
this.closePopover();
|
|
286
290
|
},
|
|
287
|
-
setLegacyMultiFlatmap: function() {
|
|
288
|
-
this.$refs.map.setCurrentEntry(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
);
|
|
291
|
+
setLegacyMultiFlatmap: function () {
|
|
292
|
+
this.$refs.map.setCurrentEntry({
|
|
293
|
+
type: 'MultiFlatmap',
|
|
294
|
+
taxo: 'NCBITaxon:10114',
|
|
295
|
+
uuid: '01fedbf9-d783-509c-a10c-827941ab13da',
|
|
296
|
+
});
|
|
295
297
|
this.closePopover();
|
|
296
298
|
},
|
|
297
|
-
setMultiFlatmap: function() {
|
|
298
|
-
this.$refs.map.setCurrentEntry(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
);
|
|
299
|
+
setMultiFlatmap: function () {
|
|
300
|
+
this.$refs.map.setCurrentEntry({
|
|
301
|
+
type: 'MultiFlatmap',
|
|
302
|
+
taxo: 'NCBITaxon:9606',
|
|
303
|
+
biologicalSex: 'PATO:0000384',
|
|
304
|
+
//organ: "heart"
|
|
305
|
+
organ: 'UBERON:0018675',
|
|
306
|
+
});
|
|
307
307
|
this.closePopover();
|
|
308
308
|
},
|
|
309
|
-
setRatFlatmap: function() {
|
|
310
|
-
this.$refs.map.setCurrentEntry(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
315
|
-
);
|
|
309
|
+
setRatFlatmap: function () {
|
|
310
|
+
this.$refs.map.setCurrentEntry({
|
|
311
|
+
type: 'MultiFlatmap',
|
|
312
|
+
taxo: 'NCBITaxon:10114',
|
|
313
|
+
});
|
|
316
314
|
this.closePopover();
|
|
317
315
|
},
|
|
318
|
-
setScaffold: function() {
|
|
319
|
-
this.$refs.map.setCurrentEntry(
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
}
|
|
326
|
-
);
|
|
316
|
+
setScaffold: function () {
|
|
317
|
+
this.$refs.map.setCurrentEntry({
|
|
318
|
+
type: 'Scaffold',
|
|
319
|
+
label: 'Colon',
|
|
320
|
+
url: `${this.api}/s3-resource/76/files/derivative/colonMouse_metadata.json?s3BucketName=prd-sparc-discover50-use1`,
|
|
321
|
+
viewUrl: 'colonMouse_Layout1_view.json',
|
|
322
|
+
});
|
|
327
323
|
this.closePopover();
|
|
328
324
|
},
|
|
329
|
-
setWholebody: function() {
|
|
330
|
-
this.$refs.map.setCurrentEntry(
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
);
|
|
325
|
+
setWholebody: function () {
|
|
326
|
+
this.$refs.map.setCurrentEntry({
|
|
327
|
+
type: 'Scaffold',
|
|
328
|
+
label: 'Human',
|
|
329
|
+
isBodyScaffold: true,
|
|
330
|
+
});
|
|
337
331
|
this.closePopover();
|
|
338
332
|
},
|
|
339
|
-
setSearch: function() {
|
|
340
|
-
this.$refs.map.openSearch([],
|
|
333
|
+
setSearch: function () {
|
|
334
|
+
this.$refs.map.openSearch([], '10.26275/1uno-tynt');
|
|
341
335
|
this.closePopover();
|
|
342
336
|
},
|
|
343
|
-
onShowLongLabelChange: function() {
|
|
337
|
+
onShowLongLabelChange: function () {
|
|
344
338
|
this.closePopover();
|
|
345
339
|
},
|
|
346
|
-
onTruncateLongLabelChange: function() {
|
|
340
|
+
onTruncateLongLabelChange: function () {
|
|
347
341
|
this.closePopover();
|
|
348
342
|
},
|
|
349
|
-
onShowIdInTooltipChange: function() {
|
|
343
|
+
onShowIdInTooltipChange: function () {
|
|
350
344
|
this.closePopover();
|
|
351
345
|
},
|
|
352
|
-
mapIsLoaded: function(map) {
|
|
353
|
-
console.log(
|
|
346
|
+
mapIsLoaded: function (map) {
|
|
347
|
+
console.log('map is loaded', map);
|
|
354
348
|
// map.changeViewingMode('Annotation')
|
|
355
349
|
},
|
|
356
|
-
viewerIsReady: function() {
|
|
357
|
-
console.log(
|
|
350
|
+
viewerIsReady: function () {
|
|
351
|
+
console.log('viewer is ready');
|
|
358
352
|
this.parseQuery();
|
|
359
353
|
},
|
|
360
354
|
fetchDataFromApi: async function (url) {
|
|
@@ -380,29 +374,23 @@ export default {
|
|
|
380
374
|
const url = `${this.api}/exists/${path}`;
|
|
381
375
|
return await this.fetchDataFromApi(url);
|
|
382
376
|
},
|
|
383
|
-
extractS3BucketName: function(uri) {
|
|
377
|
+
extractS3BucketName: function (uri) {
|
|
384
378
|
if (uri) {
|
|
385
|
-
const substring = uri.split(
|
|
379
|
+
const substring = uri.split('//')[1];
|
|
386
380
|
if (substring) {
|
|
387
|
-
return substring.split(
|
|
381
|
+
return substring.split('/')[0];
|
|
388
382
|
}
|
|
389
383
|
}
|
|
390
384
|
return undefined;
|
|
391
385
|
},
|
|
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
|
|
386
|
+
getScaffoldEntry: async function (dataset_id, file_path, dataset_version, viewUrl) {
|
|
387
|
+
const datasetInfo = await this.getDatasetInfo(this.discover_api, dataset_id, dataset_version);
|
|
388
|
+
const s3Bucket = datasetInfo ? this.extractS3BucketName(datasetInfo.uri) : undefined;
|
|
401
389
|
|
|
402
390
|
if (s3Bucket) {
|
|
403
|
-
let path = `${dataset_id}/${file_path}
|
|
391
|
+
let path = `${dataset_id}/${file_path}`;
|
|
404
392
|
if (s3Bucket) {
|
|
405
|
-
path = path + `?s3BucketName=${s3Bucket}
|
|
393
|
+
path = path + `?s3BucketName=${s3Bucket}`;
|
|
406
394
|
}
|
|
407
395
|
const fileCheckResults = await this.checkFileExists(path);
|
|
408
396
|
|
|
@@ -444,65 +432,63 @@ export default {
|
|
|
444
432
|
xmlhttp.open('POST', url, true);
|
|
445
433
|
//Send the proper header information along with the request
|
|
446
434
|
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 {
|
|
435
|
+
xmlhttp.onreadystatechange = () => {
|
|
436
|
+
//Call a function when the state changes.
|
|
437
|
+
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
|
438
|
+
let state = JSON.parse(xmlhttp.responseText);
|
|
439
|
+
console.log(state);
|
|
440
|
+
if (state?.state?.annotationId) {
|
|
441
|
+
getAnnotationState(this.api, state.state.annotationId).then((data) => {
|
|
442
|
+
if (data) {
|
|
443
|
+
sessionStorage.setItem('anonymous-annotation', JSON.stringify(data.state));
|
|
444
|
+
}
|
|
460
445
|
this.state = state.state;
|
|
461
|
-
}
|
|
446
|
+
});
|
|
447
|
+
} else {
|
|
448
|
+
this.state = state.state;
|
|
462
449
|
}
|
|
463
|
-
|
|
464
|
-
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
xmlhttp.send(JSON.stringify({ uuid: this.uuid }));
|
|
465
453
|
}
|
|
466
454
|
|
|
467
455
|
if (type === 'ac') {
|
|
468
456
|
// Load AC map with different species
|
|
469
|
-
this.startingMap =
|
|
457
|
+
this.startingMap = 'AC';
|
|
470
458
|
this.$nextTick(() => {
|
|
471
459
|
const currentEntry = {
|
|
472
|
-
type:
|
|
460
|
+
type: 'MultiFlatmap',
|
|
473
461
|
taxo: taxo || '',
|
|
474
462
|
};
|
|
475
463
|
if (anatomy) {
|
|
476
464
|
currentEntry.organ = anatomy;
|
|
477
465
|
}
|
|
478
466
|
this.$refs.map.setCurrentEntry(currentEntry);
|
|
479
|
-
})
|
|
467
|
+
});
|
|
480
468
|
} else if (type === 'fc') {
|
|
481
469
|
// Load FC map
|
|
482
|
-
this.startingMap =
|
|
470
|
+
this.startingMap = 'FC';
|
|
483
471
|
this.$nextTick(() => {
|
|
484
472
|
const currentEntry = {
|
|
485
473
|
type: 'Flatmap',
|
|
486
474
|
resource: 'FunctionalConnectivity',
|
|
487
475
|
label: 'Functional',
|
|
488
|
-
}
|
|
476
|
+
};
|
|
489
477
|
if (this.$route.query.fid) {
|
|
490
478
|
currentEntry.resource = this.$route.query.fid;
|
|
491
479
|
}
|
|
492
480
|
this.$refs.map.setCurrentEntry(currentEntry);
|
|
493
|
-
})
|
|
481
|
+
});
|
|
494
482
|
} else if (type === 'wholebody') {
|
|
495
483
|
// Load Wholebody scaffold
|
|
496
|
-
this.startingMap =
|
|
484
|
+
this.startingMap = 'WholeBody';
|
|
497
485
|
this.$nextTick(() => {
|
|
498
|
-
this.$refs.map.setCurrentEntry(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
);
|
|
505
|
-
})
|
|
486
|
+
this.$refs.map.setCurrentEntry({
|
|
487
|
+
type: 'Scaffold',
|
|
488
|
+
label: 'Human',
|
|
489
|
+
isBodyScaffold: true,
|
|
490
|
+
});
|
|
491
|
+
});
|
|
506
492
|
} else if (type === 'scaffold' && dataset_id && file_path) {
|
|
507
493
|
// Load scaffold from dataset
|
|
508
494
|
// e.g. type=scaffold&dataset_id=444&dataset_version=1&file_path=[file_path]_metadata.json
|
|
@@ -516,13 +502,13 @@ export default {
|
|
|
516
502
|
this.$refs.map.setCurrentEntry(scaffoldEntry);
|
|
517
503
|
}
|
|
518
504
|
}
|
|
519
|
-
})
|
|
505
|
+
});
|
|
520
506
|
},
|
|
521
507
|
},
|
|
522
|
-
mounted: function() {
|
|
508
|
+
mounted: function () {
|
|
523
509
|
this.waitForRouter();
|
|
524
510
|
},
|
|
525
|
-
}
|
|
511
|
+
};
|
|
526
512
|
</script>
|
|
527
513
|
|
|
528
514
|
<style lang="scss">
|
|
@@ -530,12 +516,12 @@ $button-container-size: 50px;
|
|
|
530
516
|
$gap: 24px;
|
|
531
517
|
|
|
532
518
|
#app {
|
|
533
|
-
height:100%;
|
|
519
|
+
height: 100%;
|
|
534
520
|
width: 100%;
|
|
535
|
-
position:absolute;
|
|
536
|
-
font-family:
|
|
521
|
+
position: absolute;
|
|
522
|
+
font-family: 'Asap', sans-serif;
|
|
537
523
|
background-color: #f5f7fa;
|
|
538
|
-
--el-color-primary: #
|
|
524
|
+
--el-color-primary: #8300bf;
|
|
539
525
|
--el-color-primary-light-7: #dab3ec;
|
|
540
526
|
--el-color-primary-light-8: #e6ccf2;
|
|
541
527
|
--el-color-primary-light-9: #f3e6f9;
|
|
@@ -555,11 +541,11 @@ body {
|
|
|
555
541
|
position: relative;
|
|
556
542
|
}
|
|
557
543
|
|
|
558
|
-
.popover{
|
|
559
|
-
top:10px;
|
|
560
|
-
right:50%;
|
|
561
|
-
position:absolute;
|
|
562
|
-
z-index:1000;
|
|
544
|
+
.popover {
|
|
545
|
+
top: 10px;
|
|
546
|
+
right: 50%;
|
|
547
|
+
position: absolute;
|
|
548
|
+
z-index: 1000;
|
|
563
549
|
}
|
|
564
550
|
|
|
565
551
|
.row {
|
|
@@ -583,13 +569,12 @@ body {
|
|
|
583
569
|
height: $button-container-size;
|
|
584
570
|
}
|
|
585
571
|
|
|
586
|
-
|
|
587
|
-
.options-container{
|
|
572
|
+
.options-container {
|
|
588
573
|
text-align: center;
|
|
589
574
|
}
|
|
590
575
|
|
|
591
576
|
.map-icon {
|
|
592
|
-
color: $app-primary-color!important;
|
|
577
|
+
color: $app-primary-color !important;
|
|
593
578
|
}
|
|
594
579
|
|
|
595
580
|
.el-message.is-closable {
|
|
@@ -598,7 +583,7 @@ body {
|
|
|
598
583
|
--el-message-text-color: #{$app-primary-color};
|
|
599
584
|
|
|
600
585
|
.el-message__content {
|
|
601
|
-
font-family:
|
|
586
|
+
font-family: 'Asap', sans-serif;
|
|
602
587
|
font-size: 12px;
|
|
603
588
|
}
|
|
604
589
|
}
|