@abi-software/flatmapvuer 0.5.9-beta.1 → 0.5.9-beta.featuredMarker.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 (40) hide show
  1. package/CHANGELOG.md +399 -389
  2. package/LICENSE +201 -201
  3. package/README.md +105 -105
  4. package/babel.config.js +14 -14
  5. package/dist/flatmapvuer.common.js +6106 -6498
  6. package/dist/flatmapvuer.common.js.map +1 -1
  7. package/dist/flatmapvuer.css +1 -1
  8. package/dist/flatmapvuer.umd.js +6106 -6498
  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 +14399 -18425
  13. package/package.json +78 -79
  14. package/public/index.html +17 -17
  15. package/src/App.vue +226 -228
  16. package/src/assets/_variables.scss +43 -43
  17. package/src/assets/styles.scss +7 -7
  18. package/src/components/EventBus.js +2 -2
  19. package/src/components/ExternalResourceCard.vue +98 -98
  20. package/src/components/FlatmapVuer.vue +1875 -2039
  21. package/src/components/MultiFlatmapVuer.vue +534 -531
  22. package/src/components/SelectionsGroup.vue +249 -249
  23. package/src/components/Tooltip.vue +447 -55
  24. package/src/components/TreeControls.vue +231 -231
  25. package/src/components/index.js +9 -9
  26. package/src/components/legends/DynamicLegends.vue +112 -112
  27. package/src/components/legends/SvgLegends.vue +67 -66
  28. package/src/icons/fonts/mapicon-species.eot +0 -0
  29. package/src/icons/fonts/mapicon-species.svg +14 -14
  30. package/src/icons/fonts/mapicon-species.ttf +0 -0
  31. package/src/icons/fonts/mapicon-species.woff +0 -0
  32. package/src/icons/mapicon-species-style.css +42 -42
  33. package/src/icons/yellowstar.js +5 -0
  34. package/src/legends/legend.svg +25 -25
  35. package/src/main.js +8 -8
  36. package/src/nerve-map.js +99 -0
  37. package/src/services/flatmapQueries.js +415 -415
  38. package/vue.config.js +31 -31
  39. package/src/components/AnnotationTool.vue +0 -402
  40. package/src/components/ProvenancePopup.vue +0 -432
package/vue.config.js CHANGED
@@ -1,31 +1,31 @@
1
- const nodeExternals = require('webpack-node-externals');
2
-
3
- module.exports = {
4
- configureWebpack: config => {
5
- if(process.env.NODE_ENV === 'production') {
6
- config.externals = [nodeExternals({allowlist: [/^element-ui/]}) ];
7
- }
8
- },
9
- chainWebpack: config => {
10
- const fontsRule = config.module.rule('fonts')
11
- fontsRule.uses.clear()
12
- config.module
13
- .rule('fonts')
14
- .test(/\.(ttf|otf|eot|woff|woff2)$/)
15
- .use('base64-inline-loader')
16
- .loader('base64-inline-loader')
17
- .tap(options => {
18
- // modify the options...
19
- return options
20
- })
21
- .end()
22
- },
23
- css: {
24
- //Import variables into all stylesheets.
25
- loaderOptions: {
26
- sass: {
27
- prependData: `@import '@/assets/styles';`
28
- }
29
- }
30
- }
31
- }
1
+ const nodeExternals = require('webpack-node-externals');
2
+
3
+ module.exports = {
4
+ configureWebpack: config => {
5
+ if(process.env.NODE_ENV === 'production') {
6
+ config.externals = [nodeExternals({allowlist: [/^element-ui/]}) ];
7
+ }
8
+ },
9
+ chainWebpack: config => {
10
+ const fontsRule = config.module.rule('fonts')
11
+ fontsRule.uses.clear()
12
+ config.module
13
+ .rule('fonts')
14
+ .test(/\.(ttf|otf|eot|woff|woff2)$/)
15
+ .use('base64-inline-loader')
16
+ .loader('base64-inline-loader')
17
+ .tap(options => {
18
+ // modify the options...
19
+ return options
20
+ })
21
+ .end()
22
+ },
23
+ css: {
24
+ //Import variables into all stylesheets.
25
+ loaderOptions: {
26
+ sass: {
27
+ prependData: `@import '@/assets/styles';`
28
+ }
29
+ }
30
+ }
31
+ }
@@ -1,402 +0,0 @@
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>