@abi-software/flatmapvuer 0.5.9-alpha-connected-paths.2 → 0.5.9-beta.1

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 (39) hide show
  1. package/CHANGELOG.md +389 -399
  2. package/LICENSE +201 -201
  3. package/README.md +105 -105
  4. package/babel.config.js +14 -14
  5. package/dist/flatmapvuer.common.js +1940 -1543
  6. package/dist/flatmapvuer.common.js.map +1 -1
  7. package/dist/flatmapvuer.css +1 -1
  8. package/dist/flatmapvuer.umd.js +1940 -1543
  9. package/dist/flatmapvuer.umd.js.map +1 -1
  10. package/dist/flatmapvuer.umd.min.js +2 -2
  11. package/dist/flatmapvuer.umd.min.js.map +1 -1
  12. package/package-lock.json +18425 -14418
  13. package/package.json +79 -78
  14. package/public/index.html +17 -17
  15. package/src/App.vue +228 -227
  16. package/src/assets/_variables.scss +43 -43
  17. package/src/assets/styles.scss +7 -7
  18. package/src/components/AnnotationTool.vue +402 -0
  19. package/src/components/EventBus.js +2 -2
  20. package/src/components/ExternalResourceCard.vue +98 -98
  21. package/src/components/FlatmapVuer.vue +2039 -1884
  22. package/src/components/MultiFlatmapVuer.vue +531 -529
  23. package/src/components/ProvenancePopup.vue +432 -0
  24. package/src/components/SelectionsGroup.vue +249 -249
  25. package/src/components/Tooltip.vue +55 -454
  26. package/src/components/TreeControls.vue +231 -231
  27. package/src/components/index.js +9 -9
  28. package/src/components/legends/DynamicLegends.vue +112 -112
  29. package/src/components/legends/SvgLegends.vue +66 -66
  30. package/src/icons/fonts/mapicon-species.eot +0 -0
  31. package/src/icons/fonts/mapicon-species.svg +14 -14
  32. package/src/icons/fonts/mapicon-species.ttf +0 -0
  33. package/src/icons/fonts/mapicon-species.woff +0 -0
  34. package/src/icons/mapicon-species-style.css +42 -42
  35. package/src/legends/legend.svg +25 -25
  36. package/src/main.js +8 -8
  37. package/src/services/flatmapQueries.js +415 -415
  38. package/vue.config.js +31 -31
  39. package/src/nerve-map.js +0 -99
@@ -1,43 +1,43 @@
1
- // Primary colors
2
- $purple: #8300BF;
3
- $darkBlue: #24245B;
4
- $grey: #303133;
5
-
6
- // Secondary colors
7
- $lightPurple: #BC00FC;
8
- $blue: #0026FF;
9
-
10
- // Status colors
11
- $success: #5e9f69;
12
- $warning: #FF8400;
13
- $danger: #b51d09;
14
-
15
- // Text colors
16
- $neutralGrey: #616161;
17
- $mediumGrey: #606266;
18
- $lightGrey: #909399;
19
-
20
- // Line colors
21
- $lineColor1: #DCDFE6;
22
- $lineColor2: #E4E7ED;
23
-
24
- // Background colors
25
- $background: #F5F7FA;
26
- $cochlear: #FFFFFF;
27
-
28
- //Search box colors
29
- $darkGrey: #606266;
30
-
31
- $app-primary-color: $purple !default;
32
- $app-secondary-color: $darkBlue !default;
33
- $text-color: $grey !default;
34
- $input-text: $grey !default;
35
-
36
- $system-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
37
- $font-family: 'Asap', sans-serif;
38
-
39
- // Viewport Sizes
40
- $viewport-sm: 20rem;
41
- $viewport-md: 47rem;
42
- $viewport-lg: 64rem;
43
- $viewport-xlg: 120rem;
1
+ // Primary colors
2
+ $purple: #8300BF;
3
+ $darkBlue: #24245B;
4
+ $grey: #303133;
5
+
6
+ // Secondary colors
7
+ $lightPurple: #BC00FC;
8
+ $blue: #0026FF;
9
+
10
+ // Status colors
11
+ $success: #5e9f69;
12
+ $warning: #FF8400;
13
+ $danger: #b51d09;
14
+
15
+ // Text colors
16
+ $neutralGrey: #616161;
17
+ $mediumGrey: #606266;
18
+ $lightGrey: #909399;
19
+
20
+ // Line colors
21
+ $lineColor1: #DCDFE6;
22
+ $lineColor2: #E4E7ED;
23
+
24
+ // Background colors
25
+ $background: #F5F7FA;
26
+ $cochlear: #FFFFFF;
27
+
28
+ //Search box colors
29
+ $darkGrey: #606266;
30
+
31
+ $app-primary-color: $purple !default;
32
+ $app-secondary-color: $darkBlue !default;
33
+ $text-color: $grey !default;
34
+ $input-text: $grey !default;
35
+
36
+ $system-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
37
+ $font-family: 'Asap', sans-serif;
38
+
39
+ // Viewport Sizes
40
+ $viewport-sm: 20rem;
41
+ $viewport-md: 47rem;
42
+ $viewport-lg: 64rem;
43
+ $viewport-xlg: 120rem;
@@ -1,7 +1,7 @@
1
- @import url('https://fonts.googleapis.com/css?family=Asap:400,400i,500,600,700&display=swap');
2
-
3
- @import '_variables';
4
-
5
- /* icon font path, required */
6
- $--color-primary: $app-primary-color !default;
7
- $--font-path: '~element-ui/lib/theme-chalk/fonts';
1
+ @import url('https://fonts.googleapis.com/css?family=Asap:400,400i,500,600,700&display=swap');
2
+
3
+ @import '_variables';
4
+
5
+ /* icon font path, required */
6
+ $--color-primary: $app-primary-color !default;
7
+ $--font-path: '~element-ui/lib/theme-chalk/fonts';
@@ -0,0 +1,402 @@
1
+ <template>
2
+ <el-main class="main">
3
+ <div class="block">
4
+ <el-row class="info-field">
5
+ <span class="title">Feature Annotations</span>
6
+ </el-row>
7
+ <template v-if="annotationEntry">
8
+ <el-row
9
+ v-for="(key, label) in displayPair"
10
+ v-show="annotationEntry[key]"
11
+ class="dialog-text"
12
+ :key="key"
13
+ >
14
+ <strong>{{ label }}: </strong> {{ annotationEntry[key] }}
15
+ </el-row>
16
+ <template v-if="prevSubs.length > 0">
17
+ <div v-show="showSubmissions" class="hide" @click="showSubmissions = false">
18
+ Hide previous submissions
19
+ <i class="el-icon-arrow-up"></i>
20
+ </div>
21
+ <div v-show="!showSubmissions" class="hide" @click="showSubmissions = true">
22
+ Show previous {{ prevSubs.length }} submission(s)
23
+ <i class="el-icon-arrow-down"></i>
24
+ </div>
25
+ <template v-if="showSubmissions">
26
+ <el-row class="dialog-spacer"></el-row>
27
+ <el-row class="dialog-text">
28
+ <strong class="sub-title">Previous submissions:</strong>
29
+ </el-row>
30
+ <div class="entry" v-for="(sub, index) in prevSubs" :key="index">
31
+ <el-row class="dialog-text">
32
+ <strong>{{ formatTime(sub.created) }}</strong> {{ sub.creator.name }}
33
+ </el-row>
34
+ <el-row class="dialog-text">
35
+ <strong>Evidence: </strong>
36
+ <el-row v-for="(evidence) in sub.evidence" :key="evidence" class="dialog-text">
37
+ <a :href="evidence" target="_blank"> {{ evidence }}</a>
38
+ </el-row>
39
+ </el-row>
40
+ <el-row class="dialog-text">
41
+ <strong>Comment: </strong> {{ sub.comment }}
42
+ </el-row>
43
+ </div>
44
+ </template>
45
+ </template>
46
+ <el-row class="dialog-spacer"></el-row>
47
+ <template v-if="authenticated">
48
+ <template v-if="isEditable">
49
+ <el-row v-if="!editing">
50
+ <i
51
+ class="el-icon-edit standard-icon"
52
+ @click="editing = true"
53
+ />
54
+ </el-row>
55
+ <template v-else>
56
+ <el-row class="dialog-text">
57
+ <strong class="sub-title">Suggest changes:</strong>
58
+ </el-row>
59
+ <el-row class="dialog-text">
60
+ <strong>Evidvence:</strong>
61
+ </el-row>
62
+ <el-row v-for="(value, index) in evidence" :key="value">
63
+ <el-col :span="20">
64
+ {{ evidence[index] }}
65
+ </el-col>
66
+ <el-col :span="4">
67
+ <i
68
+ class="el-icon-close standard-icon"
69
+ @click="removeEvidence(index)"
70
+ />
71
+ </el-col>
72
+ </el-row>
73
+ <el-row>
74
+ <el-input
75
+ size="mini"
76
+ placeholder="Enter"
77
+ v-model="newEvidence"
78
+ @change="evidenceEntered($event)"
79
+ >
80
+ <el-select
81
+ :popper-append-to-body="false"
82
+ v-model="evidencePrefix"
83
+ placeholder="Select"
84
+ class="select-box"
85
+ popper-class="flatmap_dropdown"
86
+ slot="prepend"
87
+ >
88
+ <el-option v-for="item in evidencePrefixes" :key="item" :label="item" :value="item">
89
+ <el-row>
90
+ <el-col :span="12">{{ item }}</el-col>
91
+ </el-row>
92
+ </el-option>
93
+ </el-select>
94
+ </el-input>
95
+ </el-row>
96
+ <el-row>
97
+ <strong>Comment:</strong>
98
+ </el-row>
99
+ <el-row class="dialog-text">
100
+ <el-input
101
+ type="textarea"
102
+ :autosize="{ minRows: 2, maxRows: 4}"
103
+ placeholder="Enter"
104
+ v-model="comment"
105
+ />
106
+ </el-row>
107
+ <el-row class="dialog-text">
108
+ <el-button
109
+ class="button"
110
+ type="primary"
111
+ plain
112
+ @click="submit"
113
+ >
114
+ Submit
115
+ </el-button>
116
+ </el-row>
117
+ </template>
118
+ </template>
119
+ </template>
120
+ <el-row class="dialog-text" v-if="errorMessage">
121
+ <strong class="sub-title"> {{ errorMessage }}
122
+ </strong>
123
+ </el-row>
124
+ </template>
125
+ </div>
126
+ </el-main>
127
+ </template>
128
+
129
+
130
+ <script>
131
+ /* eslint-disable no-alert, no-console */
132
+ /* eslint-disable no-alert, no-console */
133
+ import Vue from "vue";
134
+ import { AnnotationService } from "@abi-software/sparc-annotation";
135
+ import { Button, Col, Input, Main, Row, Select } from "element-ui";
136
+ import lang from "element-ui/lib/locale/lang/en";
137
+ import locale from "element-ui/lib/locale";
138
+
139
+ locale.use(lang);
140
+ Vue.use(Button);
141
+ Vue.use(Col);
142
+ Vue.use(Input);
143
+ Vue.use(Main);
144
+ Vue.use(Row);
145
+ Vue.use(Select);
146
+
147
+ export default {
148
+ name: "AnnotationTool",
149
+ props: {
150
+ annotationEntry: {
151
+ type: Object,
152
+ },
153
+ },
154
+ inject: ['flatmapAPI'],
155
+ data: function() {
156
+ return {
157
+ displayPair: {
158
+ "Feature ID": "featureId",
159
+ "Tooltip": "label",
160
+ "Models": "models",
161
+ "Name": "name",
162
+ "Resource": "resourceId"
163
+ },
164
+ editing: false,
165
+ evidencePrefixes: [
166
+ "DOI:",
167
+ "PMID:",
168
+ ],
169
+ evidencePrefix: "DOI:",
170
+ evidence: [ ],
171
+ authenticated: false,
172
+ newEvidence: '',
173
+ comment: '',
174
+ prevSubs: [ ],
175
+ showSubmissions: true,
176
+ errorMessage: "",
177
+ }
178
+ },
179
+ computed: {
180
+ isEditable: function() {
181
+ return this.annotationEntry['resourceId'] && this.annotationEntry['featureId'];
182
+ },
183
+ },
184
+ methods: {
185
+ evidenceEntered: function(value) {
186
+ if (value) {
187
+ this.evidence.push(this.evidencePrefix + value);
188
+ this.newEvidence = "";
189
+ }
190
+ },
191
+ formatTime: function(dateString) {
192
+ const options = { year: "numeric", month: "long", day: "numeric",
193
+ hour: "numeric", minute: "numeric", second: "numeric" };
194
+ return new Date(dateString).toLocaleDateString(undefined, options);
195
+ },
196
+ updatePrevSubmissions: function() {
197
+ if (this.$annotator) {
198
+ if (this.annotationEntry['resourceId'] &&
199
+ this.annotationEntry['featureId']) {
200
+ this.$annotator.itemAnnotations(this.annotationEntry['resourceId'],
201
+ this.annotationEntry['featureId']).then((value) => {
202
+ this.prevSubs = value;
203
+ })
204
+ .catch((reason) => {
205
+ console.log(reason); // Error!
206
+ });
207
+ }
208
+ }
209
+ },
210
+ submit: function() {
211
+ if ((this.evidence.length > 0) || this.comment) {
212
+ if (this.annotationEntry['resourceId'] &&
213
+ this.annotationEntry['featureId']) {
214
+ const evidenceURLs = [];
215
+ this.evidence.forEach((evidence) => {
216
+ if (evidence.includes("DOI:")) {
217
+ const link = evidence.replace("DOI:", "https://doi.org/");
218
+ evidenceURLs.push(new URL(link));
219
+ } else if (evidence.includes("PMID:")) {
220
+ const link = evidence.replace("PMID:", "https://pubmed.ncbi.nlm.nih.gov/");
221
+ evidenceURLs.push(new URL(link));
222
+ }
223
+ });
224
+ const userAnnotation = {
225
+ resource: this.annotationEntry['resourceId'],
226
+ item: this.annotationEntry['featureId'],
227
+ evidence: evidenceURLs,
228
+ comment: this.comment,
229
+ }
230
+ this.$annotator.addAnnotation(userAnnotation).then(() => {
231
+ this.errorMessage = "";
232
+ this.resetSubmission();
233
+ this.updatePrevSubmissions();
234
+ })
235
+ .catch(() => {
236
+ this.errorMessage = "There is a problem with the submission, please try again later";
237
+ });
238
+ }
239
+ }
240
+ },
241
+ removeEvidence: function(index) {
242
+ this.evidence.splice(index, 1);
243
+ },
244
+ resetSubmission: function() {
245
+ this.editing = false;
246
+ this.evidence = [];
247
+ this.newFeature = '';
248
+ this.comment = '';
249
+ },
250
+ },
251
+ watch: {
252
+ annotationEntry: {
253
+ handler: function() {
254
+ this.resetSubmission();
255
+ this.updatePrevSubmissions();
256
+ },
257
+ immediate: false,
258
+ deep: false,
259
+ }
260
+ },
261
+ mounted: function() {
262
+ if (!this.$annotator) {
263
+ Vue.prototype.$annotator = new AnnotationService(
264
+ `${this.flatmapAPI}annotator`);
265
+ }
266
+ this.$annotator.authenticate().then((userData) => {
267
+ if (userData.name && userData.email) {
268
+ this.authenticated = true;
269
+ } else {
270
+ this.errorMessage = "You cannot view some of the information as you are not logged in or without the correct permission."
271
+ }
272
+ })
273
+ }
274
+ };
275
+ </script>
276
+
277
+ <style scoped lang="scss">
278
+ @import "~element-ui/packages/theme-chalk/src/button";
279
+ @import "~element-ui/packages/theme-chalk/src/col";
280
+ @import "~element-ui/packages/theme-chalk/src/input";
281
+ @import "~element-ui/packages/theme-chalk/src/main";
282
+ @import "~element-ui/packages/theme-chalk/src/row";
283
+ @import "~element-ui/packages/theme-chalk/src/select";
284
+
285
+ .info-field {
286
+ display:flex;
287
+ }
288
+
289
+ .block {
290
+ margin-bottom: 0.5em;
291
+ }
292
+
293
+ .button {
294
+ padding-top:5px;
295
+ padding-bottom:5px;
296
+ }
297
+
298
+ .standard-icon {
299
+ color: $app-primary-color;
300
+ &:hover {
301
+ cursor: pointer;
302
+ }
303
+ }
304
+
305
+ .dialog-text {
306
+ color: rgb(48, 49, 51);
307
+ font-size: 14px;
308
+ font-weight: normal;
309
+ line-height: 20px;
310
+ }
311
+
312
+ .main {
313
+ font-size: 14px;
314
+ text-align: left;
315
+ line-height: 1.5em;
316
+ font-family: Asap, sans-serif,Helvetica;
317
+ font-weight: 400;
318
+ /* outline: thin red solid; */
319
+ padding: 1em !important;
320
+ overflow-x: hidden;
321
+ overflow-y: auto;
322
+ min-width: 20rem;
323
+ max-height: 400px;
324
+ scrollbar-width: thin;
325
+
326
+ &::-webkit-scrollbar {
327
+ width: 4px;
328
+ }
329
+
330
+ &::-webkit-scrollbar-thumb {
331
+ border-radius: 10px;
332
+ box-shadow: inset 0 0 6px #c0c4cc;
333
+ }
334
+ }
335
+
336
+ .title {
337
+ font-size: 18px;
338
+ font-weight: 500;
339
+ font-weight: bold;
340
+ padding-bottom: 8px;
341
+ color: rgb(131, 0, 191);
342
+ }
343
+
344
+ .sub-title {
345
+ font-size: 16px;
346
+ }
347
+
348
+
349
+ .dialog-spacer {
350
+ border-bottom: 1px solid #e4e7ed;
351
+ margin-bottom: 10px;
352
+ }
353
+
354
+ .submit {
355
+ color: $app-primary-color;
356
+ &:hover {
357
+ cursor: pointer;
358
+ }
359
+ }
360
+
361
+ .entry ~ .entry {
362
+ border-top: 1px solid #e4e7ed;
363
+ margin-top: 10px;
364
+ }
365
+
366
+ .hide{
367
+ color: $app-primary-color;
368
+ cursor: pointer;
369
+ margin-right: 6px;
370
+ margin-top: 3px;
371
+ }
372
+
373
+ ::v-deep .el-input__inner, ::v-deep .el-textarea__inner{
374
+ font-family: Asap, sans-serif;
375
+ }
376
+
377
+ .select-box {
378
+ width:80px;
379
+ background-color: var(--white);
380
+ font-weight: 500;
381
+ color:rgb(48, 49, 51);;
382
+ ::v-deep .el-input__inner {
383
+ height:30px;
384
+ color: rgb(48, 49, 51);
385
+ }
386
+ ::v-deep .el-input__icon {
387
+ line-height:30px
388
+ }
389
+ }
390
+
391
+ ::v-deep .flatmap_dropdown {
392
+ min-width: 80px!important;
393
+ .el-select-dropdown__item {
394
+ white-space: nowrap;
395
+ text-align: left;
396
+ &.selected {
397
+ color: $app-primary-color;
398
+ font-weight: normal;
399
+ }
400
+ }
401
+ }
402
+ </style>
@@ -1,3 +1,3 @@
1
- import Vue from 'vue';
2
- const EventBus = new Vue();
1
+ import Vue from 'vue';
2
+ const EventBus = new Vue();
3
3
  export default EventBus;