@abi-software/map-side-bar 1.1.5-beta-1 → 1.1.5

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.
@@ -1,434 +1,372 @@
1
- <template>
2
- <div class="dataset-card-container" ref="container">
3
- <div v-bind:class=" expanded ? 'dataset-card-expanded' : 'dataset-card'" ref="card">
4
- <!-- The seperator-path css is set on SidebarContent.vue -->
5
- <div class="seperator-path"></div>
6
- <div class="card" >
7
- <span class="card-left">
8
- <img svg-inline class="banner-img" :src="thumbnail" @click="openDataset"/>
9
- </span>
10
- <div class="card-right" >
11
- <div class="title" @click="cardClicked">{{entry.name}}</div>
12
- <div class="details">{{contributors}} {{entry.publishDate ? `(${publishYear})` : ''}}</div>
13
- <div class="details">{{samples}}</div>
14
- <div class="details">id: {{discoverId}}</div>
15
- <div>
16
- <el-button v-if="!entry.simulation" @click="openDataset" size="mini" class="button" icon="el-icon-coin">View dataset</el-button>
17
- </div>
18
- <div>
19
- <el-button v-if="entry.scaffolds" @click="openScaffold" size="mini" class="button" icon="el-icon-view">View scaffold</el-button>
20
- </div>
21
- <div>
22
- <el-button v-if="hasCSVFile" @click="openPlot" size="mini" class="button" icon="el-icon-view">View plot</el-button>
23
- </div>
24
- <div>
25
- <el-button v-if="entry.simulation" @click="openRepository" size="mini" class="button" icon="el-icon-view">View repository</el-button>
26
- </div>
27
- <div>
28
- <el-button v-if="entry.simulation" @click="openSimulation" size="mini" class="button" icon="el-icon-view">View simulation</el-button>
29
- </div>
30
- <div>
31
- <el-button v-if="entry.segmentation" @click="openSegmentation" size="mini" class="button" icon="el-icon-view">View segmentation</el-button>
32
- </div>
33
- <div>
34
- <el-button v-if="biolucidaData" @click="openImage" size="mini" class="button" icon="el-icon-view">View image</el-button>
35
- </div>
36
- </div>
37
-
38
- </div>
39
- <p v-if="(cardOverflow && !expanded)" class="read-more"><el-button @click="expand" class="read-more-button">Read more...</el-button></p>
40
- </div>
41
- </div>
42
- </template>
43
-
44
-
45
- <script>
46
- /* eslint-disable no-alert, no-console */
47
- import Vue from "vue";
48
- import { Button, Icon } from "element-ui";
49
- import lang from "element-ui/lib/locale/lang/en";
50
- import locale from "element-ui/lib/locale";
51
- import EventBus from "./EventBus"
52
- import scaffoldMetaMap from './scaffold-meta-map';
53
- import speciesMap from "./species-map";
54
-
55
- locale.use(lang);
56
- Vue.use(Button);
57
- Vue.use(Icon);
58
-
59
- const capitalise = function(string){
60
- return string.replace(/\b\w/g, v => v.toUpperCase());
61
- }
62
-
63
- export default {
64
- name: "DatasetCard",
65
- props: {
66
- /**
67
- * Object containing information for
68
- * the required viewing.
69
- */
70
- entry: Object,
71
- envVars: {
72
- type: Object,
73
- default: () => {}
74
- },
75
- },
76
- data: function () {
77
- return {
78
- thumbnail: require('@/../assets/missing-image.svg'),
79
- dataLocation: this.entry.doi,
80
- discoverId: undefined,
81
- cardOverflow: false,
82
- expanded: false,
83
- biolucidaData: undefined
84
- };
85
- },
86
- computed: {
87
- hasCSVFile: function(){
88
- return ( this.entry.csvFiles && this.entry.csvFiles.length !== 0 )
89
- },
90
- contributors: function() {
91
- let text = "";
92
- if (this.entry.contributors) {
93
- if (this.entry.contributors.length === 1) {
94
- text = this.lastName(this.entry.contributors[0].name);
95
- } else if (this.entry.contributors.length === 2) {
96
- text = this.lastName(this.entry.contributors[0].name) + " & " + this.lastName(this.entry.contributors[1].name);
97
- } else if (this.entry.contributors.length > 2) {
98
- text = this.lastName(this.entry.contributors[0].name) + " et al.";
99
- }
100
- }
101
- return text;
102
- },
103
- samples: function() {
104
- let text = "";
105
- if (this.entry.species) {
106
- if (speciesMap[this.entry.species[0].toLowerCase()]){
107
- text = `${speciesMap[this.entry.species[0].toLowerCase()]}`;
108
- } else {
109
- text = `${this.entry.species}`;
110
- }
111
- }
112
- if (this.entry.numberSamples > 0) {
113
- text += " (";
114
- if (this.entry.numberSamples === 1) {
115
- text += `${this.entry.numberSamples} sample`;
116
- } else if (this.entry.numberSamples > 1) {
117
- text += `${this.entry.numberSamples} samples`;
118
- }
119
- if (this.entry.numberSubjects === 1) {
120
- text += ` from ${this.entry.numberSubjects} subject`;
121
- } else if (this.entry.numberSamples > 1) {
122
- text += ` from ${this.entry.numberSubjects} subjects`;
123
- }
124
- text += ")";
125
- }
126
-
127
- return text;
128
- },
129
- label: function(){
130
- return this.entry.organs ? this.entry.organs[0] : this.entry.name
131
- },
132
- publishYear: function() {
133
- return this.entry.publishDate.split('-')[0]
134
- }
135
- },
136
- methods: {
137
- cardClicked: function(){
138
- if(this.entry.scaffolds){
139
- this.openScaffold()
140
- }else{
141
- this.openDataset()
142
- }
143
- },
144
- openScaffold: function(){
145
- let action = {
146
- label: capitalise(this.label),
147
- resource: this.getScaffoldPath(this.discoverId, this.version, this.entry.scaffolds[0].dataset.path),
148
- title: "View 3D scaffold",
149
- type: "Scaffold",
150
- discoverId: this.discoverId,
151
- contextCard: scaffoldMetaMap[this.discoverId] ? scaffoldMetaMap[this.discoverId].contextCard : undefined
152
- }
153
- EventBus.$emit("PopoverActionClick", action)
154
- },
155
- openPlot: function(){
156
- let action = {
157
- label: capitalise(this.label),
158
- resource: this.getFileFromPath(this.discoverId, this.version, this.entry.csvFiles[0].dataset.path),
159
- title: "View plot",
160
- type: "Plot",
161
- discoverId: this.discoverId,
162
- }
163
- EventBus.$emit("PopoverActionClick", action)
164
- },
165
- openDataset: function(){
166
- window.open(this.dataLocation,'_blank');
167
- },
168
- openRepository: function() {
169
- let apiLocation = this.envVars.API_LOCATION;
170
- this.entry.additionalLinks.forEach(function(el) {
171
- if (el.description == "Repository") {
172
- let xmlhttp = new XMLHttpRequest();
173
- xmlhttp.open("POST", apiLocation + "/pmr_latest_exposure", true);
174
- xmlhttp.setRequestHeader("Content-type", "application/json");
175
- xmlhttp.onreadystatechange = () => {
176
- if (xmlhttp.readyState === 4) {
177
- let url = "";
178
- if (xmlhttp.status === 200) {
179
- url = JSON.parse(xmlhttp.responseText)["url"];
180
- }
181
- if (url === "") {
182
- url = el.uri;
183
- }
184
- window.open(url,'_blank');
185
- }
186
- };
187
- xmlhttp.send(JSON.stringify({workspace_url: el.uri}));
188
- }
189
- });
190
- },
191
- openSimulation: function() {
192
- let isSedmlResource = false;
193
- let resource = undefined;
194
- this.entry.additionalLinks.forEach(function(el) {
195
- if (el.description == "SED-ML file") {
196
- isSedmlResource = true;
197
- resource = el.uri;
198
- } else if (!isSedmlResource && (el.description == "CellML file")) {
199
- resource = el.uri;
200
- }
201
- });
202
- let action = {
203
- label: undefined,
204
- resource: resource,
205
- dataset: this.dataLocation,
206
- datasetId: this.discoverId,
207
- title: "View simulation",
208
- name: this.entry.name,
209
- description: this.entry.description,
210
- type: "Simulation"
211
- }
212
- EventBus.$emit("PopoverActionClick", action)
213
- },
214
- openSegmentation: function() {
215
- if (this.entry.segmentation && this.entry.segmentation[0]) {
216
- const segmentation = this.entry.segmentation[0];
217
- const filePath = segmentation.dataset.path;
218
- const datasetId = this.discoverId;
219
- const datasetVersion = this.version;
220
- const prefix = 'https://sparc.biolucida.net:8081';
221
- const resource = {
222
- share_link: `${prefix}/dataviewer?datasetId=${datasetId}&version=${datasetVersion}&path=${filePath}`
223
- };
224
- let action = {
225
- label: capitalise(this.label),
226
- resource: resource,
227
- dataset: this.dataLocation,
228
- datasetId: this.discoverId,
229
- title: "View segmentation",
230
- name: this.entry.name,
231
- description: this.entry.description,
232
- type: "Segmentation"
233
- };
234
- EventBus.$emit("PopoverActionClick", action);
235
- }
236
- },
237
- openImage: function() {
238
- if (this.biolucidaData) {
239
- const biolucidaData = this.biolucidaData;
240
- if ('dataset_images' in biolucidaData) {
241
- const image = biolucidaData['dataset_images'][0];
242
- const resource = {
243
- share_link: image.share_link,
244
- id: image.image_id,
245
- itemId: image.sourcepkg_id
246
- }
247
- let action = {
248
- label: capitalise(this.label),
249
- resource: resource,
250
- dataset: this.dataLocation,
251
- datasetId: this.discoverId,
252
- title: "View image",
253
- name: this.entry.name,
254
- description: this.entry.description,
255
- type: "Biolucida"
256
- };
257
- EventBus.$emit("PopoverActionClick", action);
258
- }
259
- }
260
- },
261
- getScaffoldPath: function(discoverId, version, scaffoldPath){
262
- let id = discoverId
263
- let path = `${this.envVars.API_LOCATION}s3-resource/${id}/${version}/files/${scaffoldPath}`
264
- return path
265
- },
266
- getFileFromPath: function(discoverId, version, path){
267
- return `${this.envVars.API_LOCATION}s3-resource/${discoverId}/${version}/files/${path}`
268
- },
269
- isOverflown: function(el){
270
- return el.clientHeight < el.scrollHeight
271
- },
272
- expand: function() {
273
- this.expanded = true
274
- },
275
- splitDOI: function(doi){
276
- return [doi.split('/')[doi.split('/').length-2], doi.split('/')[doi.split('/').length-1]]
277
- },
278
- getBanner: function () {
279
- let doi = this.splitDOI(this.entry.doi)
280
- fetch(`https://api.pennsieve.io/discover/datasets/doi/${doi[0]}/${doi[1]}`)
281
- .then((response) =>{
282
- if (!response.ok){
283
- throw Error(response.statusText)
284
- } else {
285
- return response.json()
286
- }
287
- })
288
- .then((data) => {
289
- this.thumbnail = data.banner
290
- this.discoverId = data.id
291
- this.version = data.version
292
- this.dataLocation = `https://sparc.science/datasets/${data.id}?type=dataset`
293
- this.getBiolucidaInfo(this.discoverId)
294
- })
295
- .catch(() => {
296
- //set defaults if we hit an error
297
- this.thumbnail = require('@/../assets/missing-image.svg')
298
- this.discoverId = undefined
299
- });
300
- },
301
- lastName: function(fullName){
302
- return fullName.split(',')[0]
303
- },
304
- getBiolucidaInfo: function(id) {
305
- let apiLocation = this.envVars.API_LOCATION;
306
- let endpoint = apiLocation + "image_search/" + id;
307
- // Add parameters if we are sent them
308
- fetch(endpoint)
309
- .then(response => response.json())
310
- .then(data => {
311
- if (data.status == "success")
312
- this.biolucidaData = data;
313
- });
314
- }
315
- },
316
- mounted: function(){
317
- this.getBanner()
318
- this.cardOverflow = this.isOverflown(this.$refs.card)
319
- },
320
- updated: function () {
321
- },
322
- watch: {
323
- 'entry.description': function() { // watch it
324
- this.cardOverflow = false
325
- this.expanded = false
326
- this.cardOverflow = this.isOverflown(this.$refs.card)
327
- this.getBanner()
328
- }
329
- },
330
- };
331
- </script>
332
-
333
- <!-- Add "scoped" attribute to limit CSS to this component only -->
334
- <style scoped>
335
- .dataset-card {
336
- padding-left: 16px;
337
- position: relative;
338
- }
339
-
340
- .title {
341
- padding-bottom: 5px;
342
- font-family: Asap;
343
- font-size: 14px;
344
- font-weight: bold;
345
- font-stretch: normal;
346
- font-style: normal;
347
- line-height: 1.5;
348
- letter-spacing: 1.05px;
349
- color: #484848;
350
- cursor: pointer;
351
- }
352
- .card {
353
- padding-top: 18px;
354
- position: relative;
355
- display: flex;
356
- }
357
-
358
- .card-left{
359
- flex: 1
360
- }
361
-
362
- .card-right {
363
- flex: 1.3;
364
- padding-left: 6px;
365
- }
366
-
367
- .dataset-card .read-more {
368
- position: absolute;
369
- z-index: 9;
370
- bottom: 0;
371
- left: 0;
372
- width: 100%;
373
- height: 20px;
374
- margin: 0; padding: 20px 66px;
375
- /* "transparent" only works here because == rgba(0,0,0,0) */
376
- background-image: linear-gradient(to bottom, transparent, white);
377
- pointer-events: none;
378
- }
379
-
380
- .read-more-button{
381
- width: 85px;
382
- height: 20px;
383
- font-family: Asap;
384
- font-size: 14px;
385
- font-weight: normal;
386
- font-stretch: normal;
387
- font-style: normal;
388
- line-height: normal;
389
- letter-spacing: normal;
390
- color: #8300bf;
391
- padding: 0px;
392
- pointer-events: all;
393
- cursor: pointer;
394
- }
395
-
396
- .button{
397
- z-index: 10;
398
- font-family: Asap;
399
- font-size: 14px;
400
- font-weight: normal;
401
- font-stretch: normal;
402
- font-style: normal;
403
- line-height: normal;
404
- letter-spacing: normal;
405
- background-color: #8300bf;
406
- border: #8300bf;
407
- color: white;
408
- cursor: pointer;
409
- margin-top: 8px;
410
- }
411
-
412
- .button:hover {
413
- background-color: #8300bf;
414
- color: white;
415
- }
416
-
417
- .banner-img {
418
- width: 128px;
419
- height: 128px;
420
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
421
- background-color: #ffffff;
422
- cursor: pointer;
423
- }
424
- .details{
425
- font-family: Asap;
426
- font-size: 14px;
427
- font-weight: normal;
428
- font-stretch: normal;
429
- font-style: normal;
430
- line-height: 1.5;
431
- letter-spacing: 1.05px;
432
- color: #484848;
433
- }
434
- </style>
1
+ <template>
2
+ <div class="dataset-card-container" ref="container">
3
+ <div v-bind:class=" expanded ? 'dataset-card-expanded' : 'dataset-card'" ref="card">
4
+ <div v-if="entry.id !== 0" class="seperator-path"></div>
5
+ <div class="card" >
6
+ <span class="card-left">
7
+ <img svg-inline class="banner-img" :src="thumbnail" @click="openDataset"/>
8
+ </span>
9
+ <div class="card-right" >
10
+ <div class="title" @click="cardClicked">{{entry.name}}</div>
11
+ <div class="details">{{contributors}} {{entry.publishDate ? `(${publishYear})` : ''}}</div>
12
+ <div class="details">{{samples}}</div>
13
+ <div class="details">id: {{discoverId}}</div>
14
+ <div>
15
+ <el-button v-if="!entry.simulation" @click="openDataset" size="mini" class="button" icon="el-icon-coin">View dataset</el-button>
16
+ </div>
17
+ <div>
18
+ <el-button v-if="entry.scaffolds" @click="openScaffold" size="mini" class="button" icon="el-icon-view">View scaffold</el-button>
19
+ </div>
20
+ <div>
21
+ <el-button v-if="hasCSVFile" @click="openPlot" size="mini" class="button" icon="el-icon-view">View plot</el-button>
22
+ </div>
23
+ <div>
24
+ <el-button v-if="entry.simulation" @click="openRepository" size="mini" class="button" icon="el-icon-view">View repository</el-button>
25
+ </div>
26
+ <div>
27
+ <el-button v-if="entry.simulation" @click="openSimulation" size="mini" class="button" icon="el-icon-view">View simulation</el-button>
28
+ </div>
29
+ </div>
30
+
31
+ </div>
32
+ <p v-if="(cardOverflow && !expanded)" class="read-more"><el-button @click="expand" class="read-more-button">Read more...</el-button></p>
33
+ </div>
34
+ </div>
35
+ </template>
36
+
37
+
38
+ <script>
39
+ /* eslint-disable no-alert, no-console */
40
+ import Vue from "vue";
41
+ import { Button, Icon } from "element-ui";
42
+ import lang from "element-ui/lib/locale/lang/en";
43
+ import locale from "element-ui/lib/locale";
44
+ import EventBus from "./EventBus"
45
+ import scaffoldMetaMap from './scaffold-meta-map';
46
+ import speciesMap from "./species-map";
47
+
48
+ locale.use(lang);
49
+ Vue.use(Button);
50
+ Vue.use(Icon);
51
+
52
+ const capitalise = function(string){
53
+ return string.replace(/\b\w/g, v => v.toUpperCase());
54
+ }
55
+
56
+ export default {
57
+ name: "DatasetCard",
58
+ props: {
59
+ /**
60
+ * Object containing information for
61
+ * the required viewing.
62
+ */
63
+ entry: Object,
64
+ envVars: {
65
+ type: Object,
66
+ default: () => {}
67
+ },
68
+ },
69
+ data: function () {
70
+ return {
71
+ thumbnail: require('@/../assets/missing-image.svg'),
72
+ dataLocation: this.entry.doi,
73
+ discoverId: undefined,
74
+ cardOverflow: false,
75
+ expanded: false
76
+ };
77
+ },
78
+ computed: {
79
+ hasCSVFile: function(){
80
+ return ( this.entry.csvFiles && this.entry.csvFiles.length !== 0 )
81
+ },
82
+ contributors: function() {
83
+ let text = "";
84
+ if (this.entry.contributors) {
85
+ if (this.entry.contributors.length === 1) {
86
+ text = this.lastName(this.entry.contributors[0].name);
87
+ } else if (this.entry.contributors.length === 2) {
88
+ text = this.lastName(this.entry.contributors[0].name) + " & " + this.lastName(this.entry.contributors[1].name);
89
+ } else if (this.entry.contributors.length > 2) {
90
+ text = this.lastName(this.entry.contributors[0].name) + " et al.";
91
+ }
92
+ }
93
+ return text;
94
+ },
95
+ samples: function() {
96
+ let text = "";
97
+ if (this.entry.species) {
98
+ if (speciesMap[this.entry.species[0].toLowerCase()]){
99
+ text = `${speciesMap[this.entry.species[0].toLowerCase()]}`;
100
+ } else {
101
+ text = `${this.entry.species}`;
102
+ }
103
+ }
104
+ if (this.entry.numberSamples > 0) {
105
+ text += " (";
106
+ if (this.entry.numberSamples === 1) {
107
+ text += `${this.entry.numberSamples} sample`;
108
+ } else if (this.entry.numberSamples > 1) {
109
+ text += `${this.entry.numberSamples} samples`;
110
+ }
111
+ if (this.entry.numberSubjects === 1) {
112
+ text += ` from ${this.entry.numberSubjects} subject`;
113
+ } else if (this.entry.numberSamples > 1) {
114
+ text += ` from ${this.entry.numberSubjects} subjects`;
115
+ }
116
+ text += ")";
117
+ }
118
+
119
+ return text;
120
+ },
121
+ label: function(){
122
+ return this.entry.organs ? this.entry.organs[0] : this.entry.name
123
+ },
124
+ publishYear: function() {
125
+ return this.entry.publishDate.split('-')[0]
126
+ }
127
+ },
128
+ methods: {
129
+ cardClicked: function(){
130
+ if(this.entry.scaffolds){
131
+ this.openScaffold()
132
+ }else{
133
+ this.openDataset()
134
+ }
135
+ },
136
+ openScaffold: function(){
137
+ let action = {
138
+ label: capitalise(this.label),
139
+ resource: this.getScaffoldPath(this.discoverId, this.version, this.entry.scaffolds[0].dataset.path),
140
+ title: "View 3D scaffold",
141
+ type: "Scaffold",
142
+ discoverId: this.discoverId,
143
+ contextCard: scaffoldMetaMap[this.discoverId] ? scaffoldMetaMap[this.discoverId].contextCard : undefined
144
+ }
145
+ EventBus.$emit("PopoverActionClick", action)
146
+ },
147
+ openPlot: function(){
148
+ let action = {
149
+ label: capitalise(this.label),
150
+ resource: this.getFileFromPath(this.discoverId, this.version, this.entry.csvFiles[0].dataset.path),
151
+ title: "View plot",
152
+ type: "Plot",
153
+ discoverId: this.discoverId,
154
+ }
155
+ EventBus.$emit("PopoverActionClick", action)
156
+ },
157
+ openDataset: function(){
158
+ window.open(this.dataLocation,'_blank');
159
+ },
160
+ openRepository: function() {
161
+ let apiLocation = this.envVars.API_LOCATION;
162
+ this.entry.additionalLinks.forEach(function(el) {
163
+ if (el.description == "Repository") {
164
+ let xmlhttp = new XMLHttpRequest();
165
+ xmlhttp.open("POST", apiLocation + "/pmr_latest_exposure", true);
166
+ xmlhttp.setRequestHeader("Content-type", "application/json");
167
+ xmlhttp.onreadystatechange = () => {
168
+ if (xmlhttp.readyState === 4) {
169
+ let url = "";
170
+ if (xmlhttp.status === 200) {
171
+ url = JSON.parse(xmlhttp.responseText)["url"];
172
+ }
173
+ if (url === "") {
174
+ url = el.uri;
175
+ }
176
+ window.open(url,'_blank');
177
+ }
178
+ };
179
+ xmlhttp.send(JSON.stringify({workspace_url: el.uri}));
180
+ }
181
+ });
182
+ },
183
+ openSimulation: function() {
184
+ let isSedmlResource = false;
185
+ let resource = undefined;
186
+ this.entry.additionalLinks.forEach(function(el) {
187
+ if (el.description == "SED-ML file") {
188
+ isSedmlResource = true;
189
+ resource = el.uri;
190
+ } else if (!isSedmlResource && (el.description == "CellML file")) {
191
+ resource = el.uri;
192
+ }
193
+ });
194
+ let action = {
195
+ label: undefined,
196
+ resource: resource,
197
+ dataset: this.dataLocation,
198
+ datasetId: this.discoverId,
199
+ title: "View simulation",
200
+ name: this.entry.name,
201
+ description: this.entry.description,
202
+ type: "Simulation"
203
+ }
204
+ EventBus.$emit("PopoverActionClick", action)
205
+ },
206
+ getScaffoldPath: function(discoverId, version, scaffoldPath){
207
+ let id = discoverId
208
+ let path = `${this.envVars.API_LOCATION}s3-resource/${id}/${version}/files/${scaffoldPath}`
209
+ return path
210
+ },
211
+ getFileFromPath: function(discoverId, version, path){
212
+ return `${this.envVars.API_LOCATION}s3-resource/${discoverId}/${version}/files/${path}`
213
+ },
214
+ isOverflown: function(el){
215
+ return el.clientHeight < el.scrollHeight
216
+ },
217
+ expand: function() {
218
+ this.expanded = true
219
+ },
220
+ splitDOI: function(doi){
221
+ return [doi.split('/')[doi.split('/').length-2], doi.split('/')[doi.split('/').length-1]]
222
+ },
223
+ getBanner: function () {
224
+ let doi = this.splitDOI(this.entry.doi)
225
+ fetch(`https://api.pennsieve.io/discover/datasets/doi/${doi[0]}/${doi[1]}`)
226
+ .then((response) =>{
227
+ if (!response.ok){
228
+ throw Error(response.statusText)
229
+ } else {
230
+ return response.json()
231
+ }
232
+ })
233
+ .then((data) => {
234
+ this.thumbnail = data.banner
235
+ this.discoverId = data.id
236
+ this.version = data.version
237
+ this.dataLocation = `https://sparc.science/datasets/${data.id}?type=dataset`
238
+ })
239
+ .catch(() => {
240
+ //set defaults if we hit an error
241
+ this.thumbnail = require('@/../assets/missing-image.svg')
242
+ this.discoverId = undefined
243
+ });
244
+ },
245
+ lastName: function(fullName){
246
+ return fullName.split(',')[0]
247
+ },
248
+ },
249
+ mounted: function(){
250
+ this.getBanner()
251
+ this.cardOverflow = this.isOverflown(this.$refs.card)
252
+ },
253
+ updated: function () {
254
+ },
255
+ watch: {
256
+ 'entry.description': function() { // watch it
257
+ this.cardOverflow = false
258
+ this.expanded = false
259
+ this.cardOverflow = this.isOverflown(this.$refs.card)
260
+ this.getBanner()
261
+ }
262
+ },
263
+ };
264
+ </script>
265
+
266
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
267
+ <style scoped>
268
+ .dataset-card {
269
+ padding-left: 16px;
270
+ position: relative;
271
+ }
272
+ .seperator-path {
273
+ width: 486px;
274
+ height: 0px;
275
+ border: solid 1px #e4e7ed;
276
+ background-color: #e4e7ed;
277
+ }
278
+ .title {
279
+ padding-bottom: 5px;
280
+ font-family: Asap;
281
+ font-size: 14px;
282
+ font-weight: bold;
283
+ font-stretch: normal;
284
+ font-style: normal;
285
+ line-height: 1.5;
286
+ letter-spacing: 1.05px;
287
+ color: #484848;
288
+ cursor: pointer;
289
+ }
290
+ .card {
291
+ padding-top: 18px;
292
+ position: relative;
293
+ display: flex;
294
+ }
295
+
296
+ .card-left{
297
+ flex: 1
298
+ }
299
+
300
+ .card-right {
301
+ flex: 1.3;
302
+ padding-left: 6px;
303
+ }
304
+
305
+ .dataset-card .read-more {
306
+ position: absolute;
307
+ z-index: 9;
308
+ bottom: 0;
309
+ left: 0;
310
+ width: 100%;
311
+ height: 20px;
312
+ margin: 0; padding: 20px 66px;
313
+ /* "transparent" only works here because == rgba(0,0,0,0) */
314
+ background-image: linear-gradient(to bottom, transparent, white);
315
+ pointer-events: none;
316
+ }
317
+
318
+ .read-more-button{
319
+ width: 85px;
320
+ height: 20px;
321
+ font-family: Asap;
322
+ font-size: 14px;
323
+ font-weight: normal;
324
+ font-stretch: normal;
325
+ font-style: normal;
326
+ line-height: normal;
327
+ letter-spacing: normal;
328
+ color: #8300bf;
329
+ padding: 0px;
330
+ pointer-events: all;
331
+ cursor: pointer;
332
+ }
333
+
334
+ .button{
335
+ z-index: 10;
336
+ font-family: Asap;
337
+ font-size: 14px;
338
+ font-weight: normal;
339
+ font-stretch: normal;
340
+ font-style: normal;
341
+ line-height: normal;
342
+ letter-spacing: normal;
343
+ background-color: #8300bf;
344
+ border: #8300bf;
345
+ color: white;
346
+ cursor: pointer;
347
+ margin-top: 8px;
348
+ }
349
+
350
+ .button:hover {
351
+ background-color: #8300bf;
352
+ color: white;
353
+ }
354
+
355
+ .banner-img {
356
+ width: 128px;
357
+ height: 128px;
358
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
359
+ background-color: #ffffff;
360
+ cursor: pointer;
361
+ }
362
+ .details{
363
+ font-family: Asap;
364
+ font-size: 14px;
365
+ font-weight: normal;
366
+ font-stretch: normal;
367
+ font-style: normal;
368
+ line-height: 1.5;
369
+ letter-spacing: 1.05px;
370
+ color: #484848;
371
+ }
372
+ </style>