@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.
Files changed (44) hide show
  1. package/.eslintrc.js +12 -0
  2. package/.postcssrc.json +6 -0
  3. package/README.md +49 -27
  4. package/dist/favicon.ico +0 -0
  5. package/dist/map-side-bar.js +21139 -0
  6. package/dist/map-side-bar.umd.cjs +462 -0
  7. package/dist/style.css +1 -0
  8. package/package.json +48 -43
  9. package/src/App.vue +123 -57
  10. package/src/algolia/algolia.js +36 -9
  11. package/src/algolia/utils.js +45 -13
  12. package/src/assets/_variables.scss +43 -0
  13. package/src/assets/styles.scss +6 -0
  14. package/src/components/BadgesGroup.vue +56 -78
  15. package/src/components/DatasetCard.vue +147 -144
  16. package/src/components/EventBus.js +2 -2
  17. package/src/components/ImageGallery.vue +184 -229
  18. package/src/components/SearchFilters.vue +679 -292
  19. package/src/components/SearchHistory.vue +175 -0
  20. package/src/components/SideBar.vue +185 -97
  21. package/src/components/SidebarContent.vue +282 -257
  22. package/src/components/Tabs.vue +25 -25
  23. package/src/components.d.ts +35 -0
  24. package/src/main.js +6 -5
  25. package/src/mixins/S3Bucket.vue +6 -0
  26. package/vite.config.js +56 -0
  27. package/vuese-generator.js +65 -0
  28. package/babel.config.js +0 -14
  29. package/dist/demo.html +0 -10
  30. package/dist/img/missing-image.1878d8b8.svg +0 -1
  31. package/dist/map-side-bar.common.js +0 -7798
  32. package/dist/map-side-bar.common.js.map +0 -1
  33. package/dist/map-side-bar.css +0 -1
  34. package/dist/map-side-bar.umd.js +0 -7808
  35. package/dist/map-side-bar.umd.js.map +0 -1
  36. package/dist/map-side-bar.umd.min.js +0 -2
  37. package/dist/map-side-bar.umd.min.js.map +0 -1
  38. package/package-lock.json +0 -13716
  39. package/public/index.html +0 -17
  40. package/src/components/Cascader.vue +0 -49
  41. package/src/components/ContextCard.vue +0 -391
  42. package/src/components/hardcoded-context-info.js +0 -80
  43. package/src/demo/AlternateResponse.js +0 -141
  44. package/vue.config.js +0 -11
@@ -1,53 +1,48 @@
1
1
  <template>
2
2
  <div class="full-size">
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
- />
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("\\").pop().split("/").pop();
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 "@abi-software/gallery/src/mixins/GalleryHelpers";
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 "../mixins/S3Bucket";
35
- import "@abi-software/gallery/dist/gallery.css";
35
+ import S3Bucket from '../mixins/S3Bucket.vue'
36
36
 
37
37
  export default {
38
- name: "ImageGallery",
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: [String, Number],
68
- dataLocation: {
69
- type: String,
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: "All",
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
- 'Dataset': [],
100
- 'Images': [],
101
- 'Scaffolds': [],
102
- 'Segmentations': [],
103
- 'Simulations': [],
104
- 'Videos': [],
105
- 'Plots': [],
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: "never",
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
- if (this.entry.s3uri) this.updateS3Bucket(this.entry.s3uri);
127
- this.createDatasetItem();
128
- if (this.alternateSearch) this.createScaffoldViewItems();
129
- else this.createScaffoldItems();
130
- this.createSimulationItems();
131
- this.createPlotItems();
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.dataLocation;
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: name,
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: "Image",
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
- let thumbnailURL = undefined;
179
- let mimetype = '';
180
- let supplementalData = [];
181
- let sourceUrl = "";
182
- let metadata = undefined;
183
- let filePathPrefix = ""; `${this.envVars.API_LOCATION}/s3-resource/${this.datasetId}/${this.datasetVersion}/files/`;
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
- if (!this.alternateSearch) {
187
- const thumbnail = this.getThumbnailForPlot(plot, this.entry.thumbnails);
188
- if (thumbnail) {
189
- thumbnailURL = this.getImageURLFromS3(this.envVars.API_LOCATION, {
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
- } else {
205
- thumbnailURL = this.datasetThumbnail;
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: "View plot",
233
- type: "Plot",
234
- discoverId: this.datasetId,
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: "Plot",
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.getImageURLFromS3(this.envVars.API_LOCATION, {
247
+ thumbnailURL = this.getImageURL(this.envVars.API_LOCATION, {
265
248
  id,
266
- datasetId: this.datasetId,
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.datasetId}/${this.datasetVersion}/files/${filePath}${this.getS3Args()}`,
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: "Scaffold",
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: "View segmentation",
345
- type: "Segmentation",
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: "Segmentation",
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: "View simulation",
377
- type: "Simulation",
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: "simulation",
385
- title: " ",
386
- type: "Simulation",
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: "Video",
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.datasetId}/${this.datasetVersion}/files/${this.entry.contextualInformation[contextIndex]}${this.getS3Args()}`
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["Dataset"]];
432
- if (this.category === "All") {
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 !== "Dataset")
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 ("dataset_images" in biolucidaData) {
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: "View image",
431
+ title: 'View image',
477
432
  name: capitalise(this.label),
478
- type: "Biolucida",
479
- };
433
+ type: 'Biolucida',
434
+ }
480
435
  return {
481
436
  id: dataset_image.image_id,
482
437
  title: `Image`,
483
- type: "Image",
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
- destroyed() {
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 #8300bf solid;
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 >>> .el-card {
535
+ .full-size :deep(.el-card) {
581
536
  border: 0px;
582
537
  }
583
538
  </style>