@abi-software/map-utilities 1.2.2-beta.1 → 1.2.2-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-utilities",
3
- "version": "1.2.2-beta.1",
3
+ "version": "1.2.2-beta.2",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
@@ -337,7 +337,7 @@ class CytoscapeGraph extends EventTarget
337
337
  },
338
338
  directed: true,
339
339
  style: GRAPH_STYLE,
340
- minZoom: 0.5,
340
+ minZoom: 0.1,
341
341
  maxZoom: 10,
342
342
  wheelSensitivity: 0.4,
343
343
  }).on('mouseover', 'node', this.overNode.bind(this))
@@ -4,12 +4,18 @@
4
4
  <el-col>
5
5
  <el-row v-if="inDrawing">
6
6
  <span class="dialog-title">Finalise drawing</span>
7
- <el-button type="primary" plain @click="$emit('confirmDrawn', true)">
8
- Confirm
9
- </el-button>
10
- <el-button type="primary" plain @click="$emit('cancelDrawn', true)">
11
- Cancel
12
- </el-button>
7
+ <el-button-group>
8
+ <el-button
9
+ type="primary"
10
+ plain
11
+ @click="$emit('confirmDrawn', true)"
12
+ >
13
+ Confirm
14
+ </el-button>
15
+ <el-button type="primary" plain @click="$emit('cancelDrawn', true)">
16
+ Cancel
17
+ </el-button>
18
+ </el-button-group>
13
19
  </el-row>
14
20
  <el-row v-else>
15
21
  <span class="dialog-title">Visualise connection</span>
@@ -28,18 +34,7 @@
28
34
  <b><span>Related Features</span></b>
29
35
  <el-row v-for="(value, key) in connectionEntry" :key="key">
30
36
  <el-card :shadow="shadowDisplay(key)" @click="handleTooltip(key)">
31
- <el-popover
32
- trigger="hover"
33
- :disabled="value.label.length < 20"
34
- :width="200"
35
- :content="capitalise(value.label)"
36
- >
37
- <template #reference>
38
- <span class="connection-label">{{
39
- capitalise(value.label)
40
- }}</span>
41
- </template>
42
- </el-popover>
37
+ <span>{{ capitalise(value.label) }}</span>
43
38
  </el-card>
44
39
  </el-row>
45
40
  </el-col>
@@ -105,13 +100,13 @@ export default {
105
100
  }
106
101
 
107
102
  .dialog-title {
108
- font-size: 16px;
103
+ font-size: 18px;
109
104
  font-weight: bold;
110
105
  color: rgb(131, 0, 191);
111
106
  }
112
107
 
113
108
  .el-button {
114
- margin: 5px 5px 5px 0;
109
+ margin: 5px 0px;
115
110
  }
116
111
 
117
112
  :deep(.el-card) {
@@ -120,13 +115,4 @@ export default {
120
115
  border: 0;
121
116
  cursor: pointer;
122
117
  }
123
-
124
- .connection-label {
125
- white-space: nowrap;
126
- display: block;
127
- width: 200px;
128
- overflow: hidden;
129
- text-overflow: ellipsis;
130
- font-size: 14px;
131
- }
132
118
  </style>
@@ -3,9 +3,6 @@
3
3
  <div class="block">
4
4
  <el-row class="info-field">
5
5
  <div class="title">Feature Annotations</div>
6
- <div class="title-buttons">
7
- <copy-to-clipboard :content="updatedCopyContent" />
8
- </div>
9
6
  </el-row>
10
7
  <template v-if="annotationEntry">
11
8
  <el-row
@@ -14,9 +11,7 @@
14
11
  class="dialog-text"
15
12
  :key="key"
16
13
  >
17
- <strong>{{ label }}: </strong>&nbsp;
18
- <span v-if="label !== 'Ontology'">{{ annotationEntry[key] }}</span>
19
- <a v-else :href="ontologyLink" target="_blank">{{ annotationEntry[key] }}</a>
14
+ <strong>{{ label }}: </strong>&nbsp;{{ annotationEntry[key] }}
20
15
  </el-row>
21
16
  <template v-if="prevSubs.length > 0">
22
17
  <div
@@ -48,15 +43,11 @@
48
43
  <el-row class="dialog-text">
49
44
  <strong>Evidence: </strong>
50
45
  <el-row
51
- v-for="(evidence, index) in sub.body.evidence"
46
+ v-for="evidence in sub.body.evidence"
52
47
  :key="evidence"
53
48
  class="dialog-text"
54
- >
55
- <a v-if="typeof evidence === 'object' ":href="Object.values(evidence)[0]" target="_blank">
56
- {{ Object.keys(evidence)[0] }}
57
- </a>
58
- <span v-else> {{ evidence }}</span>
59
- <span v-if="index !== sub.body.evidence.length - 1">, </span>
49
+ >
50
+ <a :href="evidence" target="_blank"> {{ evidence }}</a>
60
51
  </el-row>
61
52
  </el-row>
62
53
  <el-row class="dialog-text">
@@ -108,17 +99,18 @@
108
99
  <el-select
109
100
  :teleported="false"
110
101
  v-model="evidencePrefix"
111
- placeholder="Other:"
102
+ placeholder="No Prefix"
112
103
  class="select-box"
113
104
  popper-class="flatmap_dropdown"
114
105
  >
115
106
  <el-option
116
107
  v-for="item in evidencePrefixes"
117
- :key="item.label"
118
- :value="item.value"
108
+ :key="item"
109
+ :label="item"
110
+ :value="item"
119
111
  >
120
112
  <el-row>
121
- <el-col :span="12">{{ item.label }}</el-col>
113
+ <el-col :span="12">{{ item }}</el-col>
122
114
  </el-row>
123
115
  </el-option>
124
116
  </el-select>
@@ -166,18 +158,14 @@ export default {
166
158
  return {
167
159
  displayPair: {
168
160
  "Feature ID": "featureId",
169
- Label: "label",
170
- Ontology: "models",
161
+ Tooltip: "label",
162
+ Models: "models",
171
163
  Name: "name",
172
164
  Resource: "resourceId",
173
165
  },
174
166
  editing: false,
175
- evidencePrefixes: [
176
- { value: "DOI:", label: "DOI:" },
177
- { value: "PMID:", label: "PMID:" },
178
- { value: "", label: "Other:" },
179
- ],
180
- evidencePrefix: "DOI:",
167
+ evidencePrefixes: ["", "DOI:", "PMID:"],
168
+ evidencePrefix: "",
181
169
  evidence: [],
182
170
  authenticated: false,
183
171
  newEvidence: "",
@@ -186,7 +174,6 @@ export default {
186
174
  showSubmissions: true,
187
175
  errorMessage: "",
188
176
  creator: undefined,
189
- copyContent: '',
190
177
  };
191
178
  },
192
179
  computed: {
@@ -208,15 +195,6 @@ export default {
208
195
  this.annotationEntry["type"] === "deleted"
209
196
  );
210
197
  },
211
- ontologyLink: function () {
212
- const models = this.annotationEntry['models'];
213
- if (models && models.startsWith("UBERON")) {
214
- return `http://purl.obolibrary.org/obo/${this.annotationEntry.models.replace(":", "_")}`;
215
- }
216
- },
217
- updatedCopyContent: function () {
218
- return this.getUpdateCopyContent();
219
- },
220
198
  },
221
199
  methods: {
222
200
  evidenceEntered: function (value) {
@@ -279,20 +257,18 @@ export default {
279
257
  this.annotationEntry["featureId"]
280
258
  ) {
281
259
  const evidenceURLs = [];
282
- this.evidence.forEach((evi) => {
283
- let eviObject = {}
284
- if (evi.includes("DOI:")) {
285
- eviObject[evi] = evi.replace("DOI:", "https://doi.org/");
286
- } else if (evi.includes("PMID:")) {
287
- eviObject[evi] = evi.replace(
260
+ this.evidence.forEach((evidence) => {
261
+ if (evidence.includes("DOI:")) {
262
+ const link = evidence.replace("DOI:", "https://doi.org/");
263
+ evidenceURLs.push(new URL(link));
264
+ } else if (evidence.includes("PMID:")) {
265
+ const link = evidence.replace(
288
266
  "PMID:",
289
267
  "https://pubmed.ncbi.nlm.nih.gov/"
290
268
  );
291
- }
292
- if (evi in eviObject) {
293
- evidenceURLs.push(eviObject);
269
+ evidenceURLs.push(new URL(link));
294
270
  } else {
295
- evidenceURLs.push(evi);
271
+ evidenceURLs.push(evidence);
296
272
  }
297
273
  });
298
274
  const userAnnotation = {
@@ -340,57 +316,6 @@ export default {
340
316
  this.newFeature = "";
341
317
  this.comment = "";
342
318
  },
343
- getUpdateCopyContent: function () {
344
- if (!this.annotationEntry) {
345
- return '';
346
- }
347
-
348
- const contentArray = [];
349
-
350
- // featureId
351
- if (this.annotationEntry.featureId) {
352
- contentArray.push(`<div><strong>Feature ID:</strong>${this.annotationEntry.featureId}</div>`);
353
- }
354
-
355
- // label
356
- if (this.annotationEntry.label) {
357
- contentArray.push(`<div><strong>Label:</strong>${this.annotationEntry.label}</div>`);
358
- }
359
-
360
- // models
361
- if (this.annotationEntry.models) {
362
- contentArray.push(`<div><strong>Ontology:</strong>${this.annotationEntry.models}</div>`);
363
- if (this.ontologyLink) {
364
- contentArray.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`);
365
- }
366
- }
367
-
368
- // resourceId
369
- if (this.annotationEntry.resourceId) {
370
- contentArray.push(`<div><strong>Resource:</strong>${this.annotationEntry.resourceId}</div>`);
371
- }
372
-
373
- if (this.prevSubs.length) {
374
- let annotationContent = '<div><strong>Annotations:</strong></div>\n<br>';
375
- this.prevSubs.map((sub, index) => {
376
- annotationContent += `<div><strong>Created:</strong>${this.formatTime(sub.created)}</div>\n<br>`;
377
- annotationContent += `<div><strong>Creator:</strong>${sub.creator.name}</div>\n<br>`;
378
- annotationContent += `<div><strong>Email:</strong>${sub.creator.email}</div>\n<br>`;
379
- if (sub.body.evidence.length) {
380
- let evidenceContent = '';
381
- sub.body.evidence.forEach((evi, index) => {
382
- evidenceContent += `${typeof evi === 'object' ? Object.values(evi)[0] : evi}`;
383
- if (index !== sub.body.evidence.length - 1) evidenceContent += ', ';
384
- })
385
- annotationContent += `<div><strong>Evidence:</strong>${evidenceContent}</div>\n<br>`;
386
- }
387
- annotationContent += `<div><strong>Comment:</strong>${sub.body.comment}</div>\n<br>`;
388
- })
389
- contentArray.push(`<div>${annotationContent}</div>`);
390
- }
391
-
392
- return contentArray.join('\n\n<br>');
393
- },
394
319
  },
395
320
  watch: {
396
321
  annotationEntry: {
@@ -421,11 +346,7 @@ export default {
421
346
 
422
347
  <style lang="scss" scoped>
423
348
  .info-field {
424
- padding: 0;
425
349
  display: flex;
426
- flex-direction: row;
427
- justify-content: space-between;
428
- gap: 1rem;
429
350
  }
430
351
 
431
352
  .block {
@@ -484,22 +405,7 @@ export default {
484
405
  font-weight: 500;
485
406
  font-weight: bold;
486
407
  padding-bottom: 8px;
487
- color: $app-primary-color;
488
- }
489
-
490
- .title-buttons {
491
- display: flex;
492
- flex-direction: row;
493
- gap: 0.5rem;
494
-
495
- :deep(.copy-clipboard-button) {
496
- &,
497
- &:hover,
498
- &:focus {
499
- border-color: $app-primary-color !important;
500
- border-radius: 50%;
501
- }
502
- }
408
+ color: rgb(131, 0, 191);
503
409
  }
504
410
 
505
411
  .sub-title {
@@ -14,6 +14,7 @@ declare module 'vue' {
14
14
  CreateTooltipContent: typeof import('./components/Tooltip/CreateTooltipContent.vue')['default']
15
15
  DrawToolbar: typeof import('./components/DrawToolbar/DrawToolbar.vue')['default']
16
16
  ElButton: typeof import('element-plus/es')['ElButton']
17
+ ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
17
18
  ElCard: typeof import('element-plus/es')['ElCard']
18
19
  ElCol: typeof import('element-plus/es')['ElCol']
19
20
  ElColorPicker: typeof import('element-plus/es')['ElColorPicker']