@abi-software/map-side-bar 1.2.0-beta.6 → 1.2.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/map-side-bar.common.js +543 -275
- package/dist/map-side-bar.common.js.map +1 -1
- package/dist/map-side-bar.css +1 -1
- package/dist/map-side-bar.umd.js +543 -275
- package/dist/map-side-bar.umd.js.map +1 -1
- package/dist/map-side-bar.umd.min.js +1 -1
- package/dist/map-side-bar.umd.min.js.map +1 -1
- package/package-lock.json +7 -7
- package/package.json +2 -2
- package/src/components/BadgesGroup.vue +141 -0
- package/src/components/ContextCard.vue +94 -11
- package/src/components/DatasetCard.vue +24 -147
- package/src/components/ImageGallery.vue +55 -29
- package/src/components/SidebarContent.vue +2 -3
- package/src/components/hardcoded-context-info.js +80 -0
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
:body-style="bodyStyle"
|
|
14
14
|
:shadow="shadow"
|
|
15
15
|
@card-clicked="cardClicked"
|
|
16
|
+
ref="gallery"
|
|
16
17
|
/>
|
|
17
18
|
</div>
|
|
18
19
|
</template>
|
|
@@ -123,19 +124,38 @@ export default {
|
|
|
123
124
|
type: String,
|
|
124
125
|
default: "",
|
|
125
126
|
},
|
|
127
|
+
category: {
|
|
128
|
+
type: String,
|
|
129
|
+
default: "All",
|
|
130
|
+
},
|
|
126
131
|
},
|
|
127
132
|
data() {
|
|
128
133
|
return {
|
|
129
134
|
currentIndex: 0,
|
|
130
135
|
ro: null,
|
|
131
136
|
maxWidth: 3,
|
|
132
|
-
|
|
133
|
-
|
|
137
|
+
items: {
|
|
138
|
+
"Biolucida Images": [],
|
|
139
|
+
'Dataset': [],
|
|
140
|
+
'Images': [],
|
|
141
|
+
'Scaffolds': [],
|
|
142
|
+
'Segmentations': [],
|
|
143
|
+
'Simulations': [],
|
|
144
|
+
'Videos': [],
|
|
145
|
+
'Plots': [],
|
|
146
|
+
},
|
|
134
147
|
bodyStyle: { padding: '0px', background: '#ffffff' },
|
|
135
|
-
imageContainerStyle: {
|
|
148
|
+
imageContainerStyle: {
|
|
149
|
+
width: '160px',
|
|
150
|
+
height: '160px',
|
|
151
|
+
display: 'flex',
|
|
152
|
+
alignItems: 'center',
|
|
153
|
+
justifyContent: 'center',
|
|
154
|
+
},
|
|
136
155
|
imageStyle: { maxWidth: '160px', maxHeight: '160px'},
|
|
137
156
|
shadow: "never",
|
|
138
157
|
bottomSpacer: { minHeight: '1.5rem' },
|
|
158
|
+
resetIndex: false
|
|
139
159
|
};
|
|
140
160
|
},
|
|
141
161
|
methods: {
|
|
@@ -154,7 +174,7 @@ export default {
|
|
|
154
174
|
createDatasetItem: function () {
|
|
155
175
|
const link = `${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`
|
|
156
176
|
if (this.datasetThumbnail) {
|
|
157
|
-
this.
|
|
177
|
+
this.items['Dataset'].push({
|
|
158
178
|
id: -1,
|
|
159
179
|
title: link,
|
|
160
180
|
type: `Dataset ${this.datasetId}`,
|
|
@@ -169,7 +189,7 @@ export default {
|
|
|
169
189
|
const filePath = image.dataset.path;
|
|
170
190
|
const id = image.identifier;
|
|
171
191
|
const linkUrl = `${this.envVars.ROOT_URL}/datasets/imageviewer?dataset_id=${this.datasetId}&dataset_version=${this.datasetVersion}&file_path=${filePath}&mimetype=${image.mimetype.name}`;
|
|
172
|
-
this.
|
|
192
|
+
this.items['Images'].push({
|
|
173
193
|
id,
|
|
174
194
|
title: baseName(filePath),
|
|
175
195
|
type: "Image",
|
|
@@ -197,13 +217,13 @@ export default {
|
|
|
197
217
|
}
|
|
198
218
|
let action = {
|
|
199
219
|
label: capitalise(this.label),
|
|
200
|
-
resource: `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}
|
|
220
|
+
resource: `${this.envVars.API_LOCATION}s3-resource/${this.datasetId}/${this.datasetVersion}/${filePath}`,
|
|
201
221
|
title: "View plot",
|
|
202
222
|
type: "Plot",
|
|
203
223
|
discoverId: this.discoverId,
|
|
204
224
|
version: this.datasetVersion,
|
|
205
225
|
};
|
|
206
|
-
this.
|
|
226
|
+
this.items['Plots'].push({
|
|
207
227
|
id,
|
|
208
228
|
title: baseName(filePath),
|
|
209
229
|
type: "Plot",
|
|
@@ -246,7 +266,7 @@ export default {
|
|
|
246
266
|
apiLocation: this.envVars.API_LOCATION,
|
|
247
267
|
version: this.datasetVersion,
|
|
248
268
|
};
|
|
249
|
-
this.
|
|
269
|
+
this.items['Scaffolds'].push({
|
|
250
270
|
id,
|
|
251
271
|
title: baseName(filePath),
|
|
252
272
|
type: "Scaffold",
|
|
@@ -266,7 +286,7 @@ export default {
|
|
|
266
286
|
filePath = filePath.replaceAll(",", "_");
|
|
267
287
|
const prefix = this.envVars.NL_LINK_PREFIX;
|
|
268
288
|
const resource = {
|
|
269
|
-
share_link: `${prefix}/dataviewer?datasetId=${this.datasetId}&version=${this.datasetVersion}&path
|
|
289
|
+
share_link: `${prefix}/dataviewer?datasetId=${this.datasetId}&version=${this.datasetVersion}&path=files/${filePath}`,
|
|
270
290
|
};
|
|
271
291
|
let action = {
|
|
272
292
|
label: capitalise(this.label),
|
|
@@ -284,7 +304,7 @@ export default {
|
|
|
284
304
|
segmentationFilePath: filePath,
|
|
285
305
|
}
|
|
286
306
|
);
|
|
287
|
-
this.
|
|
307
|
+
this.items['Segmentations'].push({
|
|
288
308
|
id,
|
|
289
309
|
title: baseName(filePath),
|
|
290
310
|
type: "Segmentation",
|
|
@@ -296,14 +316,10 @@ export default {
|
|
|
296
316
|
}
|
|
297
317
|
},
|
|
298
318
|
createSimulationItems: function () {
|
|
299
|
-
let isSedmlResource = false;
|
|
300
319
|
let resource = undefined;
|
|
301
320
|
if (this.additionalLinks) {
|
|
302
|
-
this.additionalLinks.forEach(
|
|
303
|
-
if (el.description == "SED-ML file") {
|
|
304
|
-
isSedmlResource = true;
|
|
305
|
-
resource = el.uri;
|
|
306
|
-
} else if (!isSedmlResource && (el.description == "CellML file")) {
|
|
321
|
+
this.additionalLinks.forEach(el => {
|
|
322
|
+
if (el.description == "SED-ML file" || el.description == "CellML file") {
|
|
307
323
|
resource = el.uri;
|
|
308
324
|
}
|
|
309
325
|
});
|
|
@@ -320,7 +336,7 @@ export default {
|
|
|
320
336
|
discoverId: this.datasetId,
|
|
321
337
|
dataset: `${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`
|
|
322
338
|
};
|
|
323
|
-
this.
|
|
339
|
+
this.items['Simulations'].push({
|
|
324
340
|
id: "simulation",
|
|
325
341
|
title: resource,
|
|
326
342
|
type: "Simulation",
|
|
@@ -339,7 +355,7 @@ export default {
|
|
|
339
355
|
video.dataset.path
|
|
340
356
|
);
|
|
341
357
|
const linkUrl = `${this.envVars.ROOT_URL}/datasets/videoviewer?dataset_version=${this.datasetVersion}&dataset_id=${this.datasetId}&file_path=${filePath}&mimetype=${video.mimetype.name}`;
|
|
342
|
-
this.
|
|
358
|
+
this.items['Videos'].push({
|
|
343
359
|
title: video.name,
|
|
344
360
|
type: "Video",
|
|
345
361
|
thumbnail: this.defaultVideoImg,
|
|
@@ -355,13 +371,31 @@ export default {
|
|
|
355
371
|
},
|
|
356
372
|
computed: {
|
|
357
373
|
galleryItems() {
|
|
358
|
-
|
|
374
|
+
if (this.resetIndex) {
|
|
375
|
+
this.$refs.gallery.indicatorClicked(0);
|
|
376
|
+
}
|
|
377
|
+
let items = [...this.items["Dataset"]];
|
|
378
|
+
if (this.category === "All") {
|
|
379
|
+
for (const [key, value] of Object.entries(this.items)) {
|
|
380
|
+
if (key !== "Dataset")
|
|
381
|
+
items = items.concat(value);
|
|
382
|
+
}
|
|
383
|
+
return items;
|
|
384
|
+
}
|
|
385
|
+
else
|
|
386
|
+
return this.items[this.category];
|
|
359
387
|
},
|
|
360
388
|
},
|
|
361
389
|
created: function () {
|
|
362
390
|
this.createSciCurnchItems();
|
|
363
391
|
},
|
|
364
392
|
watch: {
|
|
393
|
+
category: function() {
|
|
394
|
+
this.resetIndex = true;
|
|
395
|
+
},
|
|
396
|
+
galleryItems: function() {
|
|
397
|
+
this.resetIndex = false;
|
|
398
|
+
},
|
|
365
399
|
datasetBiolucida: {
|
|
366
400
|
deep: true,
|
|
367
401
|
immediate: true,
|
|
@@ -376,14 +410,6 @@ export default {
|
|
|
376
410
|
id: dataset_image.image_id,
|
|
377
411
|
}
|
|
378
412
|
);
|
|
379
|
-
this.getImageInfoFromBiolucida(
|
|
380
|
-
this.envVars.API_LOCATION,
|
|
381
|
-
items,
|
|
382
|
-
{
|
|
383
|
-
id: dataset_image.image_id,
|
|
384
|
-
fetchAttempts: 0,
|
|
385
|
-
}
|
|
386
|
-
);
|
|
387
413
|
const resource = {
|
|
388
414
|
share_link: dataset_image.share_link,
|
|
389
415
|
id: dataset_image.image_id,
|
|
@@ -399,7 +425,7 @@ export default {
|
|
|
399
425
|
};
|
|
400
426
|
return {
|
|
401
427
|
id: dataset_image.image_id,
|
|
402
|
-
title:
|
|
428
|
+
title: `Biolucida Image`,
|
|
403
429
|
type: "Image",
|
|
404
430
|
thumbnail: thumbnailURL,
|
|
405
431
|
userData: action,
|
|
@@ -408,7 +434,7 @@ export default {
|
|
|
408
434
|
})
|
|
409
435
|
);
|
|
410
436
|
}
|
|
411
|
-
this.
|
|
437
|
+
this.items['Biolucida Images'] = items;
|
|
412
438
|
},
|
|
413
439
|
},
|
|
414
440
|
},
|
|
@@ -103,7 +103,7 @@ var initial_state = {
|
|
|
103
103
|
hasSearched: false,
|
|
104
104
|
sciCrunchError: false,
|
|
105
105
|
contextCardEntry: undefined,
|
|
106
|
-
contextCardEnabled:
|
|
106
|
+
contextCardEnabled: true,
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
export default {
|
|
@@ -152,7 +152,7 @@ export default {
|
|
|
152
152
|
},
|
|
153
153
|
methods: {
|
|
154
154
|
contextCardUpdate: function(val){
|
|
155
|
-
|
|
155
|
+
this.contextCardEntry = val
|
|
156
156
|
},
|
|
157
157
|
openSearch: function(filter, search='') {
|
|
158
158
|
this.searchInput = search;
|
|
@@ -328,7 +328,6 @@ export default {
|
|
|
328
328
|
// initialise algolia
|
|
329
329
|
this.algoliaClient = new AlgoliaClient(this.envVars.ALGOLIA_ID, this.envVars.ALGOLIA_KEY, this.envVars.PENNSIEVE_API_LOCATION);
|
|
330
330
|
this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX);
|
|
331
|
-
console.log('Algolia initialised in sidebar')
|
|
332
331
|
|
|
333
332
|
// temporarily disable flatmap search since there are no datasets
|
|
334
333
|
if (this.firstSearch === "Flatmap" || this.firstSearch === "flatmap") {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
|
|
3
|
+
}
|
|
4
|
+
// //Uncomment the code below to add in hardcoded data
|
|
5
|
+
// export default {
|
|
6
|
+
// 77: {
|
|
7
|
+
// "description": "This dataset contains single cell scale anatomical map of the rat intrinsic cardiac nervous system (ICNS) across four male and three female hearts. These cell clusters can be seen by the yellow data points on the image as well as spherical markers on the 3D heart scaffold. The dataset provides an integrative framework to visualise the spatial distribution of ICNS across different hearts.",
|
|
8
|
+
// "heading": "Mapped ICN samples",
|
|
9
|
+
// "id": "sparc.science.context_data",
|
|
10
|
+
// "samples": [
|
|
11
|
+
// {
|
|
12
|
+
// "annotation": "",
|
|
13
|
+
// "description": "Spatial location of isolated ICNS mapped onto a generic heart scaffold",
|
|
14
|
+
// "doi": "",
|
|
15
|
+
// "heading": "ICNS from subject M54-8",
|
|
16
|
+
// "id": "Sample 1",
|
|
17
|
+
// "path": "",
|
|
18
|
+
// "view": "View 1",
|
|
19
|
+
// "color": "#FFFF00",
|
|
20
|
+
// "thumbnail": "https://raw.githubusercontent.com/ABI-Software/map-sidebar/main/assets/temp-pics/orange.png"
|
|
21
|
+
// },
|
|
22
|
+
// {
|
|
23
|
+
// "annotation": "",
|
|
24
|
+
// "description": "Spatial location of isolated ICNS mapped onto a generic heart scaffold",
|
|
25
|
+
// "doi": "",
|
|
26
|
+
// "heading": "ICNS from subject M54-5",
|
|
27
|
+
// "id": "Sample 2",
|
|
28
|
+
// "path": "",
|
|
29
|
+
// "view": "View 2",
|
|
30
|
+
// "color": "#FFA500",
|
|
31
|
+
// "thumbnail": "https://raw.githubusercontent.com/ABI-Software/map-sidebar/main/assets/temp-pics/teal.png"
|
|
32
|
+
// }
|
|
33
|
+
// ],
|
|
34
|
+
// "version": "0.1.0",
|
|
35
|
+
// },
|
|
36
|
+
// 221: {
|
|
37
|
+
// "description": "3D digital tracings of the enteric plexus obtained from seven subjects (M11, M16, M162, M163, M164, M168) are mapped randomly on mouse proximal colon. The data depicts individual neural wiring patterns in enteric microcircuits, and revealed both neuron and fiber units wired in a complex organization.",
|
|
38
|
+
// "heading": "Digital tracings of enteric plexus",
|
|
39
|
+
// "id": "sparc.science.context_data",
|
|
40
|
+
// "samples": [
|
|
41
|
+
// {
|
|
42
|
+
// "annotation": "",
|
|
43
|
+
// "description": "Neuronal soma and fibers in a myenteric ganglion in this subject are annotated into the following groups to highlight their interactions:\n\nNeuron1,2,3 Connex: Connections between 3 neurons and cross-ganglionic fibers\n\nNeuron4_Connex: A small neuron contacts fibers passing the ganglion\n\nNeuron5: Multiple projections of a neuron in an myenteric ganglion\n\nNeuron5,3,7 Connex: Connections between 3 neurons, nerve fibers, IGNEx (complex type of intraganglionic nerve endings) and fibers in the circular muscles.\n\nNeuron8,9,10 Connex: Connections of 3 neurons with each other and with long passing fibers. \n\nIntraganglionic Nerve Ending (IGNE): Digital traces of neurites consist of complex intraganglionic nerve endings. The blue fiber has branched terminals, more likely the afferent nerve endings; the violet and cyan terminals also interweave into the fiber nest; the orange, pink and peach fibers and one process of the neuron cross the IGNE to make 1-2 conjunctions. \n",
|
|
44
|
+
// "doi": "",
|
|
45
|
+
// "heading": "Digital tracing for subject M11",
|
|
46
|
+
// "id": "Sample 1",
|
|
47
|
+
// "path": "files/derivative/sub-M11/sam-pCm11/digital-traces/pC PHPS XFP M11 20XZ 180425_180713_2_NL_20.xml",
|
|
48
|
+
// "view": "View 1"
|
|
49
|
+
// },
|
|
50
|
+
// {
|
|
51
|
+
// "annotation": "",
|
|
52
|
+
// "description": "This digital trace demonstrates some types of wiring. A long process of the green neuron terminates in the intraganglionic nerve endings (IGNE) while in contact with a nerve fiber (cyan), soma of a neuron (peach) and processes of 3 neurons (magenta, yellow and red). Two neurons and one fiber are traced to an IGNE. ",
|
|
53
|
+
// "doi": "",
|
|
54
|
+
// "heading": "Digital tracing for subject M16",
|
|
55
|
+
// "id": "Sample 2",
|
|
56
|
+
// "path": "files/derivative/sub-M16/sam-pCm16/digital-traces/pC PHPS XFP M16 20XZ 180425_180524.xml",
|
|
57
|
+
// "view": "View 2"
|
|
58
|
+
// }
|
|
59
|
+
// ],
|
|
60
|
+
// "version": "0.1.0",
|
|
61
|
+
// "views": [
|
|
62
|
+
// {
|
|
63
|
+
// "annotation": "--",
|
|
64
|
+
// "description": "Digital tracing of neurons for subject M11.",
|
|
65
|
+
// "id": "View 1",
|
|
66
|
+
// "path": "files/derivative/Scaffolds/M11_view.json",
|
|
67
|
+
// "sample": "Sample 1",
|
|
68
|
+
// "thumbnail": "https://api.sparc.science/s3-resource/221/2/files/derivative/Scaffolds/M11_thumbnail.jpeg"
|
|
69
|
+
// },
|
|
70
|
+
// {
|
|
71
|
+
// "annotation": "--",
|
|
72
|
+
// "description": "Digital tracing of neurons for subject M16.",
|
|
73
|
+
// "id": "View 2",
|
|
74
|
+
// "path": "files/derivative/Scaffolds/M16_view.json",
|
|
75
|
+
// "sample": "Sample 2",
|
|
76
|
+
// "thumbnail": "https://api.sparc.science/s3-resource/221/2/files/derivative/Scaffolds/M16_thumbnail.jpeg"
|
|
77
|
+
// }
|
|
78
|
+
// ]
|
|
79
|
+
// }
|
|
80
|
+
// }
|