@abi-software/map-side-bar 2.0.0-response.0 → 2.0.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/.eslintrc.js +12 -0
- package/.postcssrc.json +6 -0
- package/README.md +49 -27
- package/dist/favicon.ico +0 -0
- package/dist/map-side-bar.js +21139 -0
- package/dist/map-side-bar.umd.cjs +462 -0
- package/dist/style.css +1 -0
- package/package.json +48 -43
- package/src/App.vue +123 -57
- package/src/algolia/algolia.js +36 -9
- package/src/algolia/utils.js +45 -13
- package/src/assets/_variables.scss +43 -0
- package/src/assets/styles.scss +6 -0
- package/src/components/BadgesGroup.vue +56 -78
- package/src/components/DatasetCard.vue +147 -144
- package/src/components/EventBus.js +2 -2
- package/src/components/ImageGallery.vue +184 -229
- package/src/components/SearchFilters.vue +679 -292
- package/src/components/SearchHistory.vue +175 -0
- package/src/components/SideBar.vue +185 -97
- package/src/components/SidebarContent.vue +282 -257
- package/src/components/Tabs.vue +25 -25
- package/src/components.d.ts +35 -0
- package/src/main.js +6 -5
- package/src/mixins/S3Bucket.vue +6 -0
- package/vite.config.js +56 -0
- package/vuese-generator.js +65 -0
- package/babel.config.js +0 -14
- package/dist/demo.html +0 -10
- package/dist/img/missing-image.1878d8b8.svg +0 -1
- package/dist/map-side-bar.common.js +0 -7798
- package/dist/map-side-bar.common.js.map +0 -1
- package/dist/map-side-bar.css +0 -1
- package/dist/map-side-bar.umd.js +0 -7808
- package/dist/map-side-bar.umd.js.map +0 -1
- package/dist/map-side-bar.umd.min.js +0 -2
- package/dist/map-side-bar.umd.min.js.map +0 -1
- package/package-lock.json +0 -13716
- package/public/index.html +0 -17
- package/src/components/Cascader.vue +0 -49
- package/src/components/ContextCard.vue +0 -391
- package/src/components/hardcoded-context-info.js +0 -80
- package/src/demo/AlternateResponse.js +0 -141
- package/vue.config.js +0 -11
|
@@ -1,53 +1,48 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="full-size">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
<Gallery
|
|
4
|
+
:bottomSpacer="bottomSpacer"
|
|
5
|
+
:cardWidth="10"
|
|
6
|
+
:items="galleryItems"
|
|
7
|
+
:max-width="maxWidth"
|
|
8
|
+
:show-indicator-bar="false"
|
|
9
|
+
:show-card-details="true"
|
|
10
|
+
:highlight-active="false"
|
|
11
|
+
:image-style="imageStyle"
|
|
12
|
+
:image-container-style="imageContainerStyle"
|
|
13
|
+
:body-style="bodyStyle"
|
|
14
|
+
:shadow="shadow"
|
|
15
|
+
@card-clicked="cardClicked"
|
|
16
|
+
ref="gallery"
|
|
17
|
+
/>
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script>
|
|
22
22
|
/* eslint-disable no-alert, no-console */
|
|
23
23
|
const baseName = (str) => {
|
|
24
|
-
return str.split(
|
|
25
|
-
}
|
|
24
|
+
return str.split('\\').pop().split('/').pop()
|
|
25
|
+
}
|
|
26
26
|
|
|
27
27
|
const capitalise = function (string) {
|
|
28
|
-
return string.replace(/\b\w/g, (v) => v.toUpperCase())
|
|
29
|
-
}
|
|
28
|
+
return string.replace(/\b\w/g, (v) => v.toUpperCase())
|
|
29
|
+
}
|
|
30
30
|
|
|
31
|
-
import GalleryHelper from
|
|
31
|
+
import GalleryHelper from '@abi-software/gallery/src/mixins/GalleryHelpers.js'
|
|
32
32
|
import Gallery from "@abi-software/gallery";
|
|
33
|
+
import "@abi-software/gallery/dist/style.css";
|
|
33
34
|
//provide the s3Bucket related methods and data.
|
|
34
|
-
import S3Bucket from
|
|
35
|
-
import "@abi-software/gallery/dist/gallery.css";
|
|
35
|
+
import S3Bucket from '../mixins/S3Bucket.vue'
|
|
36
36
|
|
|
37
37
|
export default {
|
|
38
|
-
name:
|
|
38
|
+
name: 'ImageGallery',
|
|
39
39
|
components: { Gallery },
|
|
40
|
-
inject: {
|
|
41
|
-
'alternateSearch' : {
|
|
42
|
-
default: undefined,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
40
|
mixins: [GalleryHelper, S3Bucket],
|
|
46
41
|
props: {
|
|
47
42
|
datasetBiolucida: {
|
|
48
43
|
type: Object,
|
|
49
44
|
default: () => {
|
|
50
|
-
return {}
|
|
45
|
+
return {}
|
|
51
46
|
},
|
|
52
47
|
},
|
|
53
48
|
envVars: {
|
|
@@ -56,18 +51,17 @@ export default {
|
|
|
56
51
|
},
|
|
57
52
|
label: {
|
|
58
53
|
type: String,
|
|
59
|
-
default:
|
|
54
|
+
default: '',
|
|
60
55
|
},
|
|
61
56
|
plots: {
|
|
62
57
|
type: Array,
|
|
63
58
|
default: () => {
|
|
64
|
-
return []
|
|
59
|
+
return []
|
|
65
60
|
},
|
|
66
61
|
},
|
|
67
|
-
datasetId:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
default: "",
|
|
62
|
+
datasetId: {
|
|
63
|
+
type: Number,
|
|
64
|
+
default: -1,
|
|
71
65
|
},
|
|
72
66
|
datasetVersion: {
|
|
73
67
|
type: Number,
|
|
@@ -75,16 +69,16 @@ export default {
|
|
|
75
69
|
},
|
|
76
70
|
datasetThumbnail: {
|
|
77
71
|
type: String,
|
|
78
|
-
default:
|
|
72
|
+
default: '',
|
|
79
73
|
},
|
|
80
74
|
category: {
|
|
81
75
|
type: String,
|
|
82
|
-
default:
|
|
76
|
+
default: 'All',
|
|
83
77
|
},
|
|
84
|
-
entry:
|
|
78
|
+
entry: {
|
|
85
79
|
type: Object,
|
|
86
80
|
default: () => {
|
|
87
|
-
return {}
|
|
81
|
+
return {}
|
|
88
82
|
},
|
|
89
83
|
},
|
|
90
84
|
},
|
|
@@ -96,13 +90,13 @@ export default {
|
|
|
96
90
|
items: {
|
|
97
91
|
//Use the Images instead for Biolucida Images
|
|
98
92
|
//"Biolucida Images": [],
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
93
|
+
Dataset: [],
|
|
94
|
+
Images: [],
|
|
95
|
+
Scaffolds: [],
|
|
96
|
+
Segmentations: [],
|
|
97
|
+
Simulations: [],
|
|
98
|
+
Videos: [],
|
|
99
|
+
Plots: [],
|
|
106
100
|
},
|
|
107
101
|
bodyStyle: { padding: '0px', background: '#ffffff' },
|
|
108
102
|
imageContainerStyle: {
|
|
@@ -112,167 +106,155 @@ export default {
|
|
|
112
106
|
alignItems: 'center',
|
|
113
107
|
justifyContent: 'center',
|
|
114
108
|
},
|
|
115
|
-
imageStyle: { maxWidth: '160px', maxHeight: '160px'},
|
|
116
|
-
shadow:
|
|
109
|
+
imageStyle: { maxWidth: '160px', maxHeight: '160px' },
|
|
110
|
+
shadow: 'never',
|
|
117
111
|
bottomSpacer: { minHeight: '0rem' },
|
|
118
112
|
resetIndex: false,
|
|
119
|
-
}
|
|
113
|
+
}
|
|
120
114
|
},
|
|
121
115
|
methods: {
|
|
122
|
-
cardClicked: function(payload) {
|
|
123
|
-
this.$emit('card-clicked', payload)
|
|
116
|
+
cardClicked: function (payload) {
|
|
117
|
+
this.$emit('card-clicked', payload)
|
|
124
118
|
},
|
|
125
119
|
createSciCurnchItems: function () {
|
|
126
|
-
|
|
127
|
-
this.createDatasetItem()
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
132
|
-
this.createSegmentationItems();
|
|
120
|
+
this.updateS3Bucket(this.entry.s3uri)
|
|
121
|
+
this.createDatasetItem()
|
|
122
|
+
this.createScaffoldItems()
|
|
123
|
+
this.createSimulationItems()
|
|
124
|
+
this.createPlotItems()
|
|
125
|
+
this.createSegmentationItems()
|
|
133
126
|
/* Disable these two
|
|
134
127
|
this.createImageItems();
|
|
135
128
|
this.createVideoItems();
|
|
136
129
|
*/
|
|
137
130
|
},
|
|
138
131
|
createDatasetItem: function () {
|
|
139
|
-
const link = this.
|
|
140
|
-
let name = String(this.datasetId);
|
|
141
|
-
if (name.length <= 5) name = `Dataset ${name}`;
|
|
142
|
-
else name = "Dataset";
|
|
143
|
-
|
|
132
|
+
const link = `${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`
|
|
144
133
|
if (this.datasetThumbnail) {
|
|
145
134
|
this.items['Dataset'].push({
|
|
146
135
|
id: -1,
|
|
147
136
|
//Work around gallery requires a truthy string
|
|
148
|
-
title:
|
|
149
|
-
type:
|
|
137
|
+
title: ' ',
|
|
138
|
+
type: `Dataset ${this.datasetId}`,
|
|
150
139
|
thumbnail: this.datasetThumbnail,
|
|
151
140
|
link,
|
|
152
141
|
hideType: true,
|
|
153
142
|
hideTitle: true,
|
|
154
|
-
})
|
|
143
|
+
})
|
|
155
144
|
}
|
|
156
145
|
},
|
|
157
146
|
createImageItems: function () {
|
|
158
147
|
if (this.entry.images) {
|
|
159
148
|
this.entry.images.forEach((image) => {
|
|
160
|
-
const filePath = image.dataset.path
|
|
161
|
-
const id = image.identifier
|
|
162
|
-
const linkUrl = `${this.envVars.ROOT_URL}/datasets/imageviewer?dataset_id=${this.datasetId}&dataset_version=${this.datasetVersion}&file_path=${filePath}&mimetype=${image.mimetype.name}
|
|
149
|
+
const filePath = image.dataset.path
|
|
150
|
+
const id = image.identifier
|
|
151
|
+
const linkUrl = `${this.envVars.ROOT_URL}/datasets/imageviewer?dataset_id=${this.datasetId}&dataset_version=${this.datasetVersion}&file_path=${filePath}&mimetype=${image.mimetype.name}`
|
|
163
152
|
this.items['Images'].push({
|
|
164
153
|
id,
|
|
165
154
|
title: baseName(filePath),
|
|
166
|
-
type:
|
|
155
|
+
type: 'Image',
|
|
167
156
|
link: linkUrl,
|
|
168
157
|
hideType: true,
|
|
169
|
-
})
|
|
170
|
-
})
|
|
158
|
+
})
|
|
159
|
+
})
|
|
171
160
|
}
|
|
172
161
|
},
|
|
173
162
|
createPlotItems: function () {
|
|
174
163
|
if (this.entry.plots) {
|
|
175
164
|
this.entry.plots.forEach((plot) => {
|
|
176
|
-
const filePath = plot.dataset.path
|
|
177
|
-
const id = plot.identifier
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
let
|
|
183
|
-
let
|
|
165
|
+
const filePath = plot.dataset.path
|
|
166
|
+
const id = plot.identifier
|
|
167
|
+
const thumbnail = this.getThumbnailForPlot(
|
|
168
|
+
plot,
|
|
169
|
+
this.entry.thumbnails
|
|
170
|
+
)
|
|
171
|
+
let thumbnailURL = undefined
|
|
172
|
+
let mimetype = ''
|
|
173
|
+
if (thumbnail) {
|
|
174
|
+
|
|
175
|
+
thumbnailURL = this.getImageURL(this.envVars.API_LOCATION, {
|
|
176
|
+
id,
|
|
177
|
+
prefix: this.getS3Prefix(),
|
|
178
|
+
file_path: thumbnail.dataset.path,
|
|
179
|
+
s3Bucket: this.s3Bucket,
|
|
180
|
+
})
|
|
181
|
+
mimetype = thumbnail.mimetype.name
|
|
182
|
+
}
|
|
184
183
|
const plotAnnotation = plot.datacite;
|
|
184
|
+
const filePathPrefix = `${this.envVars.API_LOCATION}/s3-resource/${this.getS3Prefix()}files/`;
|
|
185
|
+
const sourceUrl = filePathPrefix + plot.dataset.path + this.getS3Args();
|
|
185
186
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
id,
|
|
191
|
-
datasetId: this.datasetId,
|
|
192
|
-
datasetVersion: this.datasetVersion,
|
|
193
|
-
file_path: thumbnail.dataset.path,
|
|
194
|
-
s3Bucket: this.s3Bucket,
|
|
195
|
-
});
|
|
196
|
-
mimetype = thumbnail.mimetype.name;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
filePathPrefix = `${this.envVars.API_LOCATION}/s3-resource/${this.datasetId}/${this.datasetVersion}/files/`;
|
|
200
|
-
sourceUrl = filePathPrefix + plot.dataset.path + this.getS3Args();
|
|
187
|
+
//plotAnnotation.supplemental_json_metadata.description can be undefined or
|
|
188
|
+
//contain an empty string causing an error with JSON.parse
|
|
189
|
+
let metadata = {}
|
|
190
|
+
try {
|
|
201
191
|
metadata = JSON.parse(
|
|
202
192
|
plotAnnotation.supplemental_json_metadata.description
|
|
203
|
-
)
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
mimetype = plot.additional_mimetype.name;
|
|
207
|
-
sourceUrl = this.entry.source_url_prefix + plot.dataset.path;
|
|
208
|
-
metadata = plotAnnotation.supplemental_json_metadata.description;
|
|
209
|
-
if (metadata !== "") {
|
|
210
|
-
metadata = JSON.parse(
|
|
211
|
-
plotAnnotation.supplemental_json_metadata.description.replaceAll("'", '"'));
|
|
212
|
-
}
|
|
213
|
-
filePathPrefix = this.entry.source_url_prefix;
|
|
193
|
+
)
|
|
194
|
+
} catch (error) {
|
|
195
|
+
console.warn(error)
|
|
214
196
|
}
|
|
215
197
|
|
|
198
|
+
let supplementalData = []
|
|
216
199
|
if (plotAnnotation.isDescribedBy) {
|
|
217
200
|
supplementalData.push({
|
|
218
|
-
url: filePathPrefix + plotAnnotation.isDescribedBy.path
|
|
219
|
-
})
|
|
201
|
+
url: filePathPrefix + plotAnnotation.isDescribedBy.path,
|
|
202
|
+
})
|
|
220
203
|
}
|
|
221
204
|
|
|
222
205
|
const resource = {
|
|
223
|
-
dataSource: {url: sourceUrl},
|
|
206
|
+
dataSource: { url: sourceUrl },
|
|
224
207
|
metadata,
|
|
225
|
-
supplementalData
|
|
208
|
+
supplementalData,
|
|
226
209
|
}
|
|
227
210
|
|
|
228
211
|
let action = {
|
|
229
212
|
label: capitalise(this.label),
|
|
230
213
|
resource: resource,
|
|
231
214
|
s3uri: this.entry.s3uri,
|
|
232
|
-
title:
|
|
233
|
-
type:
|
|
234
|
-
discoverId: this.
|
|
215
|
+
title: 'View plot',
|
|
216
|
+
type: 'Plot',
|
|
217
|
+
discoverId: this.discoverId,
|
|
235
218
|
version: this.datasetVersion,
|
|
236
|
-
}
|
|
219
|
+
}
|
|
237
220
|
this.items['Plots'].push({
|
|
238
221
|
id,
|
|
239
222
|
title: baseName(filePath),
|
|
240
|
-
type:
|
|
223
|
+
type: 'Plot',
|
|
241
224
|
thumbnail: thumbnailURL,
|
|
242
225
|
userData: action,
|
|
243
226
|
hideType: true,
|
|
244
|
-
mimetype
|
|
245
|
-
})
|
|
246
|
-
})
|
|
227
|
+
mimetype,
|
|
228
|
+
})
|
|
229
|
+
})
|
|
247
230
|
}
|
|
248
231
|
},
|
|
249
232
|
createScaffoldItems: function () {
|
|
250
233
|
if (this.entry.scaffolds) {
|
|
251
|
-
let index = 0
|
|
234
|
+
let index = 0
|
|
252
235
|
this.entry.scaffolds.forEach((scaffold, i) => {
|
|
253
|
-
const filePath = scaffold.dataset.path
|
|
254
|
-
const id = scaffold.identifier
|
|
236
|
+
const filePath = scaffold.dataset.path
|
|
237
|
+
const id = scaffold.identifier
|
|
255
238
|
const thumbnail = this.getThumbnailForScaffold(
|
|
256
239
|
scaffold,
|
|
257
240
|
this.entry.scaffoldViews,
|
|
258
241
|
this.entry.thumbnails,
|
|
259
242
|
index
|
|
260
|
-
)
|
|
261
|
-
let mimetype = ''
|
|
262
|
-
let thumbnailURL = undefined
|
|
243
|
+
)
|
|
244
|
+
let mimetype = ''
|
|
245
|
+
let thumbnailURL = undefined
|
|
263
246
|
if (thumbnail) {
|
|
264
|
-
thumbnailURL = this.
|
|
247
|
+
thumbnailURL = this.getImageURL(this.envVars.API_LOCATION, {
|
|
265
248
|
id,
|
|
266
|
-
|
|
267
|
-
datasetVersion: this.datasetVersion,
|
|
249
|
+
prefix: this.getS3Prefix(),
|
|
268
250
|
file_path: thumbnail.dataset.path,
|
|
269
251
|
s3Bucket: this.s3Bucket,
|
|
270
|
-
})
|
|
271
|
-
mimetype = thumbnail.mimetype.name
|
|
252
|
+
})
|
|
253
|
+
mimetype = thumbnail.mimetype.name
|
|
272
254
|
}
|
|
273
255
|
let action = {
|
|
274
256
|
label: capitalise(this.label),
|
|
275
|
-
resource: `${this.envVars.API_LOCATION}s3-resource/${this.
|
|
257
|
+
resource: `${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${filePath}${this.getS3Args()}`,
|
|
276
258
|
title: "View 3D scaffold",
|
|
277
259
|
type: "Scaffold",
|
|
278
260
|
discoverId: this.datasetId,
|
|
@@ -280,70 +262,39 @@ export default {
|
|
|
280
262
|
version: this.datasetVersion,
|
|
281
263
|
banner: this.datasetThumbnail,
|
|
282
264
|
s3uri: this.entry.s3uri,
|
|
283
|
-
contextCardUrl: this.getContextCardUrl(i)
|
|
284
|
-
}
|
|
265
|
+
contextCardUrl: this.getContextCardUrl(i),
|
|
266
|
+
}
|
|
285
267
|
this.items['Scaffolds'].push({
|
|
286
268
|
id,
|
|
287
269
|
title: baseName(filePath),
|
|
288
|
-
type:
|
|
270
|
+
type: 'Scaffold',
|
|
289
271
|
thumbnail: thumbnailURL,
|
|
290
272
|
userData: action,
|
|
291
273
|
hideType: true,
|
|
292
|
-
mimetype
|
|
293
|
-
})
|
|
294
|
-
})
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
createScaffoldViewItems: function() {
|
|
298
|
-
if (this.entry.scaffoldViews) {
|
|
299
|
-
// let index = 0;
|
|
300
|
-
this.entry.scaffoldViews.forEach((scaffold) => {
|
|
301
|
-
const filePath = scaffold.dataset.path;
|
|
302
|
-
const id = scaffold.identifier;
|
|
303
|
-
let thumbnailURL = scaffold.image_url;
|
|
304
|
-
let action = {
|
|
305
|
-
label: capitalise(this.label),
|
|
306
|
-
resource:
|
|
307
|
-
this.entry.source_url_prefix + scaffold.datacite.isDerivedFrom.path,
|
|
308
|
-
viewUrl: this.entry.source_url_prefix + scaffold.dataset.path,
|
|
309
|
-
title: "View 3D scaffold",
|
|
310
|
-
type: "Scaffold",
|
|
311
|
-
discoverId: this.datasetId,
|
|
312
|
-
apiLocation: this.envVars.API_LOCATION,
|
|
313
|
-
version: this.datasetVersion,
|
|
314
|
-
banner: this.datasetThumbnail,
|
|
315
|
-
// contextCardUrl: this.getContextCardUrl(i),
|
|
316
|
-
};
|
|
317
|
-
this.items["Scaffolds"].push({
|
|
318
|
-
id,
|
|
319
|
-
title: baseName(filePath),
|
|
320
|
-
type: "Scaffold",
|
|
321
|
-
thumbnail: thumbnailURL,
|
|
322
|
-
userData: action,
|
|
323
|
-
hideType: true,
|
|
324
|
-
});
|
|
325
|
-
});
|
|
274
|
+
mimetype,
|
|
275
|
+
})
|
|
276
|
+
})
|
|
326
277
|
}
|
|
327
278
|
},
|
|
328
279
|
createSegmentationItems: function () {
|
|
329
280
|
if (this.entry.segmentation) {
|
|
330
281
|
this.entry.segmentation.forEach((segmentation) => {
|
|
331
|
-
const id = segmentation.id
|
|
332
|
-
let filePath = segmentation.dataset.path
|
|
333
|
-
filePath = filePath.replaceAll(
|
|
334
|
-
filePath = filePath.replaceAll(
|
|
335
|
-
const prefix = this.envVars.NL_LINK_PREFIX
|
|
282
|
+
const id = segmentation.id
|
|
283
|
+
let filePath = segmentation.dataset.path
|
|
284
|
+
filePath = filePath.replaceAll(' ', '_')
|
|
285
|
+
filePath = filePath.replaceAll(',', '_')
|
|
286
|
+
const prefix = this.envVars.NL_LINK_PREFIX
|
|
336
287
|
const resource = {
|
|
337
288
|
share_link: `${prefix}/dataviewer?datasetId=${this.datasetId}&version=${this.datasetVersion}&path=files/${filePath}`,
|
|
338
|
-
}
|
|
289
|
+
}
|
|
339
290
|
let action = {
|
|
340
291
|
label: capitalise(this.label),
|
|
341
292
|
resource: resource,
|
|
342
293
|
datasetId: this.datasetId,
|
|
343
294
|
s3uri: this.entry.s3uri,
|
|
344
|
-
title:
|
|
345
|
-
type:
|
|
346
|
-
}
|
|
295
|
+
title: 'View segmentation',
|
|
296
|
+
type: 'Segmentation',
|
|
297
|
+
}
|
|
347
298
|
const thumbnailURL = this.getSegmentationThumbnailURL(
|
|
348
299
|
this.envVars.API_LOCATION,
|
|
349
300
|
{
|
|
@@ -353,17 +304,17 @@ export default {
|
|
|
353
304
|
segmentationFilePath: filePath,
|
|
354
305
|
s3Bucket: this.s3Bucket,
|
|
355
306
|
}
|
|
356
|
-
)
|
|
307
|
+
)
|
|
357
308
|
this.items['Segmentations'].push({
|
|
358
309
|
id,
|
|
359
310
|
title: baseName(filePath),
|
|
360
|
-
type:
|
|
311
|
+
type: 'Segmentation',
|
|
361
312
|
thumbnail: thumbnailURL,
|
|
362
313
|
userData: action,
|
|
363
314
|
hideType: true,
|
|
364
315
|
mimetype: 'image/png',
|
|
365
|
-
})
|
|
366
|
-
})
|
|
316
|
+
})
|
|
317
|
+
})
|
|
367
318
|
}
|
|
368
319
|
},
|
|
369
320
|
createSimulationItems: function () {
|
|
@@ -373,21 +324,21 @@ export default {
|
|
|
373
324
|
apiLocation: this.envVars.API_LOCATION,
|
|
374
325
|
s3uri: this.entry.s3uri,
|
|
375
326
|
version: this.datasetVersion,
|
|
376
|
-
title:
|
|
377
|
-
type:
|
|
327
|
+
title: 'View simulation',
|
|
328
|
+
type: 'Simulation',
|
|
378
329
|
name: this.entry.name,
|
|
379
330
|
description: this.entry.description,
|
|
380
331
|
discoverId: this.datasetId,
|
|
381
|
-
dataset: `${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset
|
|
382
|
-
}
|
|
332
|
+
dataset: `${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`,
|
|
333
|
+
}
|
|
383
334
|
this.items['Simulations'].push({
|
|
384
|
-
id:
|
|
385
|
-
title:
|
|
386
|
-
type:
|
|
335
|
+
id: 'simulation',
|
|
336
|
+
title: ' ',
|
|
337
|
+
type: 'Simulation',
|
|
387
338
|
hideType: true,
|
|
388
339
|
hideTitle: true,
|
|
389
340
|
userData: action,
|
|
390
|
-
})
|
|
341
|
+
})
|
|
391
342
|
}
|
|
392
343
|
},
|
|
393
344
|
createVideoItems: function () {
|
|
@@ -397,65 +348,69 @@ export default {
|
|
|
397
348
|
this.datasetId,
|
|
398
349
|
this.datasetVersion,
|
|
399
350
|
video.dataset.path
|
|
400
|
-
)
|
|
401
|
-
const linkUrl = `${this.envVars.ROOT_URL}/datasets/videoviewer?dataset_version=${this.datasetVersion}&dataset_id=${this.datasetId}&file_path=${filePath}&mimetype=${video.mimetype.name}
|
|
351
|
+
)
|
|
352
|
+
const linkUrl = `${this.envVars.ROOT_URL}/datasets/videoviewer?dataset_version=${this.datasetVersion}&dataset_id=${this.datasetId}&file_path=${filePath}&mimetype=${video.mimetype.name}`
|
|
402
353
|
this.items['Videos'].push({
|
|
403
354
|
title: video.name,
|
|
404
|
-
type:
|
|
355
|
+
type: 'Video',
|
|
405
356
|
thumbnail: this.defaultVideoImg,
|
|
406
357
|
hideType: true,
|
|
407
358
|
link: linkUrl,
|
|
408
|
-
})
|
|
409
|
-
})
|
|
359
|
+
})
|
|
360
|
+
})
|
|
410
361
|
}
|
|
411
362
|
},
|
|
412
363
|
onResize: function () {
|
|
413
|
-
this.maxWidth = this.$el.clientWidth
|
|
364
|
+
this.maxWidth = this.$el.clientWidth
|
|
414
365
|
// this.$emit('resize', this.$el.clientWidth)
|
|
415
366
|
},
|
|
416
|
-
getContextCardUrl(scaffoldIndex){
|
|
367
|
+
getContextCardUrl: function(scaffoldIndex){
|
|
417
368
|
if(!this.entry.contextualInformation || this.entry.contextualInformation.length == 0){
|
|
418
369
|
return undefined
|
|
419
370
|
} else {
|
|
420
371
|
// The line below checks if there is a context file for each scaffold. If there is not, we use the first context card for each scaffold.
|
|
421
372
|
let contextIndex = this.entry['abi-contextual-information'].length == this.entry.scaffolds.length ? scaffoldIndex : 0
|
|
422
|
-
return `${this.envVars.API_LOCATION}s3-resource/${this.
|
|
373
|
+
return `${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${this.entry.contextualInformation[contextIndex]}${this.getS3Args()}`
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
getImageURL: function(apiEndpoint, info) {
|
|
377
|
+
let url = `${apiEndpoint}/s3-resource/${info.prefix}files/${info.file_path}?encodeBase64=true`
|
|
378
|
+
if (info.s3Bucket) {
|
|
379
|
+
url = url + `&s3BucketName=${info.s3Bucket}`
|
|
423
380
|
}
|
|
381
|
+
return url
|
|
424
382
|
},
|
|
425
|
-
|
|
383
|
+
},
|
|
426
384
|
computed: {
|
|
427
385
|
galleryItems() {
|
|
428
386
|
if (this.resetIndex) {
|
|
429
|
-
this.$refs.gallery.indicatorClicked(0)
|
|
387
|
+
this.$refs.gallery.indicatorClicked(0)
|
|
430
388
|
}
|
|
431
|
-
let items = [...this.items[
|
|
432
|
-
if (this.category ===
|
|
389
|
+
let items = [...this.items['Dataset']]
|
|
390
|
+
if (this.category === 'All') {
|
|
433
391
|
for (const [key, value] of Object.entries(this.items)) {
|
|
434
|
-
if (key !==
|
|
435
|
-
items = items.concat(value);
|
|
392
|
+
if (key !== 'Dataset') items = items.concat(value)
|
|
436
393
|
}
|
|
437
|
-
return items
|
|
438
|
-
}
|
|
439
|
-
else
|
|
440
|
-
return this.items[this.category];
|
|
394
|
+
return items
|
|
395
|
+
} else return [...this.items[this.category]]
|
|
441
396
|
},
|
|
442
397
|
},
|
|
443
398
|
created: function () {
|
|
444
|
-
this.createSciCurnchItems()
|
|
399
|
+
this.createSciCurnchItems()
|
|
445
400
|
},
|
|
446
401
|
watch: {
|
|
447
|
-
category: function() {
|
|
448
|
-
this.resetIndex = true
|
|
402
|
+
category: function () {
|
|
403
|
+
this.resetIndex = true
|
|
449
404
|
},
|
|
450
|
-
galleryItems: function() {
|
|
451
|
-
this.resetIndex = false
|
|
405
|
+
galleryItems: function () {
|
|
406
|
+
this.resetIndex = false
|
|
452
407
|
},
|
|
453
408
|
datasetBiolucida: {
|
|
454
409
|
deep: true,
|
|
455
410
|
immediate: true,
|
|
456
411
|
handler: function (biolucidaData) {
|
|
457
|
-
let items = []
|
|
458
|
-
if (
|
|
412
|
+
let items = []
|
|
413
|
+
if ('dataset_images' in biolucidaData) {
|
|
459
414
|
items.push(
|
|
460
415
|
...Array.from(biolucidaData.dataset_images, (dataset_image) => {
|
|
461
416
|
const thumbnailURL = this.getThumbnailURLFromBiolucida(
|
|
@@ -463,46 +418,46 @@ export default {
|
|
|
463
418
|
{
|
|
464
419
|
id: dataset_image.image_id,
|
|
465
420
|
}
|
|
466
|
-
)
|
|
421
|
+
)
|
|
467
422
|
const resource = {
|
|
468
423
|
share_link: dataset_image.share_link,
|
|
469
424
|
id: dataset_image.image_id,
|
|
470
425
|
itemId: dataset_image.sourcepkg_id,
|
|
471
|
-
}
|
|
426
|
+
}
|
|
472
427
|
let action = {
|
|
473
428
|
label: capitalise(this.label),
|
|
474
429
|
resource: resource,
|
|
475
430
|
datasetId: this.datasetId,
|
|
476
|
-
title:
|
|
431
|
+
title: 'View image',
|
|
477
432
|
name: capitalise(this.label),
|
|
478
|
-
type:
|
|
479
|
-
}
|
|
433
|
+
type: 'Biolucida',
|
|
434
|
+
}
|
|
480
435
|
return {
|
|
481
436
|
id: dataset_image.image_id,
|
|
482
437
|
title: `Image`,
|
|
483
|
-
type:
|
|
438
|
+
type: 'Image',
|
|
484
439
|
thumbnail: thumbnailURL,
|
|
485
440
|
userData: action,
|
|
486
441
|
mimetype: 'image/png',
|
|
487
442
|
hideType: true,
|
|
488
|
-
}
|
|
443
|
+
}
|
|
489
444
|
})
|
|
490
|
-
)
|
|
445
|
+
)
|
|
491
446
|
}
|
|
492
|
-
this.items['Images'] = items
|
|
447
|
+
this.items['Images'] = items
|
|
493
448
|
},
|
|
494
449
|
},
|
|
495
450
|
},
|
|
496
451
|
mounted() {
|
|
497
|
-
this.ro = new ResizeObserver(this.onResize).observe(this.$el)
|
|
452
|
+
this.ro = new ResizeObserver(this.onResize).observe(this.$el)
|
|
498
453
|
},
|
|
499
|
-
|
|
500
|
-
delete this.ro
|
|
454
|
+
unmounted() {
|
|
455
|
+
delete this.ro
|
|
501
456
|
},
|
|
502
|
-
}
|
|
457
|
+
}
|
|
503
458
|
</script>
|
|
504
459
|
|
|
505
|
-
<style scoped>
|
|
460
|
+
<style lang="scss" scoped>
|
|
506
461
|
.full-size {
|
|
507
462
|
height: 100%;
|
|
508
463
|
width: 244px;
|
|
@@ -510,7 +465,7 @@ export default {
|
|
|
510
465
|
|
|
511
466
|
.key-image-span.active {
|
|
512
467
|
transform: scale(1.16);
|
|
513
|
-
border: 4px
|
|
468
|
+
border: 4px $app-primary-color solid;
|
|
514
469
|
}
|
|
515
470
|
|
|
516
471
|
.key-image-span {
|
|
@@ -577,7 +532,7 @@ a.next {
|
|
|
577
532
|
background-color: #555;
|
|
578
533
|
}
|
|
579
534
|
|
|
580
|
-
.full-size
|
|
535
|
+
.full-size :deep(.el-card) {
|
|
581
536
|
border: 0px;
|
|
582
537
|
}
|
|
583
538
|
</style>
|