@abi-software/flatmapvuer 0.5.9 → 0.6.0-vue3-0

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 (41) hide show
  1. package/babel.config.js +0 -14
  2. package/dist/favicon.ico +0 -0
  3. package/dist/flatmapvuer.js +69542 -0
  4. package/dist/flatmapvuer.umd.cjs +1021 -0
  5. package/dist/index.html +17 -0
  6. package/dist/style.css +1 -0
  7. package/package.json +29 -21
  8. package/src/App.vue +180 -105
  9. package/src/assets/styles.scss +2 -3
  10. package/src/components/AnnotationTool.vue +193 -153
  11. package/src/components/EventBus.js +3 -3
  12. package/src/components/ExternalResourceCard.vue +39 -30
  13. package/src/components/FlatmapVuer.vue +734 -676
  14. package/src/components/MultiFlatmapVuer.vue +313 -246
  15. package/src/components/ProvenancePopup.vue +195 -121
  16. package/src/components/SelectionsGroup.vue +93 -84
  17. package/src/components/Tooltip.vue +11 -13
  18. package/src/components/TreeControls.vue +67 -64
  19. package/src/components/index.js +4 -7
  20. package/src/components/legends/DynamicLegends.vue +13 -19
  21. package/src/components/legends/SvgLegends.vue +72 -27
  22. package/src/components.d.ts +46 -0
  23. package/src/icons/flatmap-marker.js +1 -1
  24. package/src/icons/fonts/mapicon-species.eot +0 -0
  25. package/src/icons/fonts/mapicon-species.svg +0 -0
  26. package/src/icons/yellowstar.js +2 -2
  27. package/src/legends/legend.svg +0 -0
  28. package/src/main.js +2 -6
  29. package/src/services/flatmapQueries.js +175 -139
  30. package/vite.config.js +76 -0
  31. package/vue.config.js +14 -0
  32. package/CHANGELOG.md +0 -402
  33. package/dist/demo.html +0 -10
  34. package/dist/flatmapvuer.common.js +0 -22741
  35. package/dist/flatmapvuer.common.js.map +0 -1
  36. package/dist/flatmapvuer.css +0 -1
  37. package/dist/flatmapvuer.umd.js +0 -22751
  38. package/dist/flatmapvuer.umd.js.map +0 -1
  39. package/dist/flatmapvuer.umd.min.js +0 -4
  40. package/dist/flatmapvuer.umd.min.js.map +0 -1
  41. package/package-lock.json +0 -18473
@@ -1,211 +1,282 @@
1
1
  <template>
2
2
  <el-main v-if="entry" class="main" v-loading="loading">
3
3
  <div class="block" v-if="entry.title">
4
- <span class="title">{{capitalise(entry.title)}}</span>
5
- <div v-if="entry.provenanceTaxonomyLabel && entry.provenanceTaxonomyLabel.length > 0" class="subtitle">
6
- {{provSpeciesDescription}}
4
+ <span class="title">{{ capitalise(entry.title) }}</span>
5
+ <div
6
+ v-if="
7
+ entry.provenanceTaxonomyLabel &&
8
+ entry.provenanceTaxonomyLabel.length > 0
9
+ "
10
+ class="subtitle"
11
+ >
12
+ {{ provSpeciesDescription }}
7
13
  </div>
8
14
  </div>
9
15
  <div class="block" v-else>
10
- <span class="title">{{entry.featureId}}</span>
16
+ <span class="title">{{ entry.featureId }}</span>
11
17
  </div>
12
18
  <div v-show="showDetails" class="hide" @click="showDetails = false">
13
- Hide path information
14
- <i class="el-icon-arrow-up"></i>
15
- </div>
16
- <div v-show="!showDetails" class="hide" @click="showDetails = true">
17
- Show path information
18
- <i class="el-icon-arrow-down"></i>
19
- </div>
19
+ Hide path information
20
+ <el-icon><el-icon-arrow-up /></el-icon>
21
+ </div>
22
+ <div v-show="!showDetails" class="hide" @click="showDetails = true">
23
+ Show path information
24
+ <el-icon><el-icon-arrow-down /></el-icon>
25
+ </div>
20
26
  <transition name="slide-fade">
21
27
  <div v-show="showDetails" class="content-container scrollbar">
22
- {{entry.paths}}
28
+ {{ entry.paths }}
23
29
  <div v-if="entry.origins && entry.origins.length > 0" class="block">
24
30
  <div>
25
31
  <span class="attribute-title">Origin</span>
26
32
  <el-popover
27
- width="250"
28
- trigger="hover"
29
- :append-to-body=false
30
- popper-class="popover-origin-help"
33
+ width="250"
34
+ trigger="hover"
35
+ :teleported="false"
36
+ popper-class="popover-origin-help"
31
37
  >
32
- <i slot="reference" class="el-icon-warning-outline info"/>
33
- <span style="word-break: keep-all;">
34
- <i>Origin</i> {{originDescription}}
35
- </span>
38
+ <template #reference>
39
+ <el-icon class="info"><el-icon-warning /></el-icon>
40
+ <span style="word-break: keep-all">
41
+ <i>Origin</i> {{ originDescription }}
42
+ </span>
43
+ </template>
36
44
  </el-popover>
37
45
  </div>
38
- <div v-for="(origin, i) in entry.origins" class="attribute-content" :key="origin">
46
+ <div
47
+ v-for="(origin, i) in entry.origins"
48
+ class="attribute-content"
49
+ :key="origin"
50
+ >
39
51
  {{ capitalise(origin) }}
40
52
  <div v-if="i != entry.origins.length - 1" class="seperator"></div>
41
53
  </div>
42
- <el-button v-show="entry.originsWithDatasets && entry.originsWithDatasets.length > 0" class="button" @click="openDendrites">
54
+ <el-button
55
+ v-show="
56
+ entry.originsWithDatasets && entry.originsWithDatasets.length > 0
57
+ "
58
+ class="button"
59
+ @click="openDendrites"
60
+ >
43
61
  Explore origin data
44
62
  </el-button>
45
63
  </div>
46
- <div v-if="entry.components && entry.components.length > 0" class="block">
64
+ <div
65
+ v-if="entry.components && entry.components.length > 0"
66
+ class="block"
67
+ >
47
68
  <div class="attribute-title">Components</div>
48
- <div v-for="(component, i) in entry.components" class="attribute-content" :key="component">
69
+ <div
70
+ v-for="(component, i) in entry.components"
71
+ class="attribute-content"
72
+ :key="component"
73
+ >
49
74
  {{ capitalise(component) }}
50
- <div v-if="i != entry.components.length - 1" class="seperator"></div>
75
+ <div
76
+ v-if="i != entry.components.length - 1"
77
+ class="seperator"
78
+ ></div>
51
79
  </div>
52
80
  </div>
53
- <div v-if="entry.destinations && entry.destinations.length > 0" class="block">
81
+ <div
82
+ v-if="entry.destinations && entry.destinations.length > 0"
83
+ class="block"
84
+ >
54
85
  <div>
55
86
  <span class="attribute-title">Destination</span>
56
87
  <el-popover
57
- width="250"
58
- trigger="hover"
59
- :append-to-body=false
60
- popper-class="popover-origin-help"
88
+ width="250"
89
+ trigger="hover"
90
+ :teleported="false"
91
+ popper-class="popover-origin-help"
61
92
  >
62
- <i slot="reference" class="el-icon-warning-outline info"/>
63
- <span style="word-break: keep-all;">
64
- <i>Destination</i> is where the axons terminate
65
- </span>
93
+ <template #reference>
94
+ <el-icon class="info"><el-icon-warning /></el-icon>
95
+ <span style="word-break: keep-all">
96
+ <i>Destination</i> is where the axons terminate
97
+ </span>
98
+ </template>
66
99
  </el-popover>
67
100
  </div>
68
- <div v-for="(destination, i) in entry.destinations" class="attribute-content" :key="destination">
101
+ <div
102
+ v-for="(destination, i) in entry.destinations"
103
+ class="attribute-content"
104
+ :key="destination"
105
+ >
69
106
  {{ capitalise(destination) }}
70
- <div v-if="i != entry.destinations.length - 1" class="seperator"></div>
107
+ <div
108
+ v-if="i != entry.destinations.length - 1"
109
+ class="seperator"
110
+ ></div>
71
111
  </div>
72
- <el-button v-show="entry.destinationsWithDatasets && entry.destinationsWithDatasets.length > 0" class="button" @click="openAxons">
112
+ <el-button
113
+ v-show="
114
+ entry.destinationsWithDatasets &&
115
+ entry.destinationsWithDatasets.length > 0
116
+ "
117
+ class="button"
118
+ @click="openAxons"
119
+ >
73
120
  Explore destination data
74
121
  </el-button>
75
122
  </div>
76
123
 
77
- <el-button v-show="entry.componentsWithDatasets && entry.componentsWithDatasets.length > 0" class="button" @click="openAll">
124
+ <el-button
125
+ v-show="
126
+ entry.componentsWithDatasets &&
127
+ entry.componentsWithDatasets.length > 0
128
+ "
129
+ class="button"
130
+ @click="openAll"
131
+ >
78
132
  Search for data on components
79
133
  </el-button>
80
134
 
81
135
  <external-resource-card :resources="resources"></external-resource-card>
82
-
83
136
  </div>
84
137
  </transition>
85
138
  </el-main>
86
139
  </template>
87
140
 
88
-
89
141
  <script>
142
+ import {
143
+ ArrowUp as ElIconArrowUp,
144
+ ArrowDown as ElIconArrowDown,
145
+ Warning as ElIconWarning,
146
+ } from '@element-plus/icons-vue'
90
147
  /* eslint-disable no-alert, no-console */
91
- import Vue from "vue";
92
148
  import {
93
- Button,
94
- Container,
95
- Icon,
96
- Main
97
- } from "element-ui";
98
- import lang from "element-ui/lib/locale/lang/en";
99
- import locale from "element-ui/lib/locale";
100
- locale.use(lang);
101
- Vue.use(Button);
102
- Vue.use(Container);
103
- Vue.use(Icon);
104
- Vue.use(Main);
149
+ ElButton as Button,
150
+ ElContainer as Container,
151
+ ElIcon as Icon,
152
+ ElMain as Main,
153
+ } from 'element-plus'
105
154
 
106
155
  import EventBus from './EventBus'
107
- import ExternalResourceCard from './ExternalResourceCard.vue';
156
+ import ExternalResourceCard from './ExternalResourceCard.vue'
108
157
 
109
158
  const titleCase = (str) => {
110
- return str.replace(/\w\S*/g, (t) => { return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase() });
159
+ return str.replace(/\w\S*/g, (t) => {
160
+ return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase()
161
+ })
111
162
  }
112
163
 
113
- const capitalise = function(str){
114
- if (str)
115
- return str.charAt(0).toUpperCase() + str.slice(1)
116
- return ""
164
+ const capitalise = function (str) {
165
+ if (str) return str.charAt(0).toUpperCase() + str.slice(1)
166
+ return ''
117
167
  }
118
168
 
119
169
  export default {
120
- components: { ExternalResourceCard },
121
- name: "ProvenancePopup",
122
- props: {
170
+ name: 'ProvenancePopup',
171
+ components: {
172
+ Button,
173
+ Container,
174
+ Icon,
175
+ Main,
176
+ ExternalResourceCard,
177
+ ElIconArrowUp,
178
+ ElIconArrowDown,
179
+ ElIconWarning,
180
+ },
181
+ props: {
123
182
  entry: {
124
183
  type: Object,
125
184
  default: () => ({
126
- destinations: [],
185
+ destinations: [],
127
186
  origins: [],
128
187
  components: [],
129
188
  destinationsWithDatasets: [],
130
189
  originsWithDatasets: [],
131
190
  componentsWithDatasets: [],
132
- resource: undefined
133
- })
191
+ resource: undefined,
192
+ }),
134
193
  },
135
194
  },
136
- data: function() {
195
+ data: function () {
137
196
  return {
138
197
  controller: undefined,
139
198
  activeSpecies: undefined,
140
- appendToBody: false,
141
199
  pubmedSearchUrl: '',
142
200
  loading: false,
143
201
  showToolip: false,
144
202
  showDetails: false,
145
203
  originDescriptions: {
146
- 'motor': 'is the location of the initial cell body of the circuit',
147
- 'sensory': 'is the location of the initial cell body in the PNS circuit'
204
+ motor: 'is the location of the initial cell body of the circuit',
205
+ sensory: 'is the location of the initial cell body in the PNS circuit',
148
206
  },
149
207
  componentsWithDatasets: [],
150
- uberons: [{id: undefined, name: undefined}]
151
- };
208
+ uberons: [{ id: undefined, name: undefined }],
209
+ }
152
210
  },
153
211
  computed: {
154
- resources: function(){
212
+ resources: function () {
155
213
  let resources = []
156
- if(this.entry && this.entry.hyperlinks){
214
+ if (this.entry && this.entry.hyperlinks) {
157
215
  resources = this.entry.hyperlinks
158
216
  }
159
217
  return resources
160
218
  },
161
- originDescription: function(){
162
- if(this.entry && this.entry.title && this.entry.title.toLowerCase().includes('motor')){
219
+ originDescription: function () {
220
+ if (
221
+ this.entry &&
222
+ this.entry.title &&
223
+ this.entry.title.toLowerCase().includes('motor')
224
+ ) {
163
225
  return this.originDescriptions.motor
164
226
  } else {
165
227
  return this.originDescriptions.sensory
166
228
  }
167
229
  },
168
- provSpeciesDescription: function(){
169
- let text = "Observed in"
170
- this.entry.provenanceTaxonomyLabel.forEach(label => {
230
+ provSpeciesDescription: function () {
231
+ let text = 'Observed in'
232
+ this.entry.provenanceTaxonomyLabel.forEach((label) => {
171
233
  text += ` ${label},`
172
- });
173
- text = text.slice(0,-1) // remove last comma
174
- text += " species"
234
+ })
235
+ text = text.slice(0, -1) // remove last comma
236
+ text += ' species'
175
237
  return text
176
- }
238
+ },
177
239
  },
178
240
  methods: {
179
- titleCase: function(title){
241
+ titleCase: function (title) {
180
242
  return titleCase(title)
181
243
  },
182
- capitalise: function(text){
244
+ capitalise: function (text) {
183
245
  return capitalise(text)
184
246
  },
185
- openUrl: function(url){
247
+ openUrl: function (url) {
186
248
  window.open(url, '_blank')
187
249
  },
188
- openAll: function(){
189
- EventBus.$emit('onActionClick', {type:'Facets', labels: this.entry.componentsWithDatasets.map(a=>a.name)})
250
+ openAll: function () {
251
+ EventBus.emit('onActionClick', {
252
+ type: 'Facets',
253
+ labels: this.entry.componentsWithDatasets.map((a) => a.name),
254
+ })
190
255
  },
191
- openAxons: function(){
192
- EventBus.$emit('onActionClick', {type:'Facets', labels: this.entry.destinationsWithDatasets.map(a=>a.name)})
256
+ openAxons: function () {
257
+ EventBus.emit('onActionClick', {
258
+ type: 'Facets',
259
+ labels: this.entry.destinationsWithDatasets.map((a) => a.name),
260
+ })
193
261
  },
194
- openDendrites: function(){
195
- EventBus.$emit('onActionClick', {type:'Facets', labels: this.entry.originsWithDatasets.map(a=>a.name)})
262
+ openDendrites: function () {
263
+ EventBus.emit('onActionClick', {
264
+ type: 'Facets',
265
+ labels: this.entry.originsWithDatasets.map((a) => a.name),
266
+ })
196
267
  },
197
- pubmedSearchUrlUpdate: function (val){
268
+ pubmedSearchUrlUpdate: function (val) {
198
269
  this.pubmedSearchUrl = val
199
270
  },
200
- }
201
- };
271
+ },
272
+ }
202
273
  </script>
203
274
 
204
- <style scoped lang="scss">
205
- @import "~element-ui/packages/theme-chalk/src/button";
206
- @import "~element-ui/packages/theme-chalk/src/container";
207
- @import "~element-ui/packages/theme-chalk/src/header";
208
- @import "~element-ui/packages/theme-chalk/src/main";
275
+ <style lang="scss" scoped>
276
+ @use 'element-plus/theme-chalk/src/button';
277
+ @use 'element-plus/theme-chalk/src/container';
278
+ @use 'element-plus/theme-chalk/src/header';
279
+ @use 'element-plus/theme-chalk/src/main';
209
280
 
210
281
  .display {
211
282
  width: 44px;
@@ -245,19 +316,19 @@ export default {
245
316
  text-transform: none !important; // need to overide the tooltip text transform
246
317
  }
247
318
 
248
- .info{
319
+ .info {
249
320
  transform: rotate(180deg);
250
321
  color: #8300bf;
251
322
  margin-left: 8px;
252
323
  }
253
324
 
254
325
  .seperator {
255
- width:90%;
256
- height:1px;
257
- background-color:#bfbec2;
326
+ width: 90%;
327
+ height: 1px;
328
+ background-color: #bfbec2;
258
329
  }
259
330
 
260
- .hide{
331
+ .hide {
261
332
  color: $app-primary-color;
262
333
  cursor: pointer;
263
334
  margin-right: 6px;
@@ -279,7 +350,7 @@ export default {
279
350
  font-size: 14px;
280
351
  text-align: left;
281
352
  line-height: 1.5em;
282
- font-family: Asap, sans-serif,Helvetica;
353
+ font-family: Asap, sans-serif, Helvetica;
283
354
  font-weight: 400;
284
355
  /* outline: thin red solid; */
285
356
  padding: 1em !important;
@@ -287,7 +358,7 @@ export default {
287
358
  min-width: 16rem;
288
359
  }
289
360
 
290
- .title{
361
+ .title {
291
362
  font-size: 18px;
292
363
  font-weight: 500;
293
364
  font-weight: bold;
@@ -295,14 +366,14 @@ export default {
295
366
  color: rgb(131, 0, 191);
296
367
  }
297
368
 
298
- .attribute-title{
369
+ .attribute-title {
299
370
  font-size: 16px;
300
371
  font-weight: 600;
301
372
  /* font-weight: bold; */
302
373
  text-transform: uppercase;
303
374
  }
304
375
 
305
- .attribute-content{
376
+ .attribute-content {
306
377
  font-size: 14px;
307
378
  font-weight: 500;
308
379
  }
@@ -313,7 +384,7 @@ export default {
313
384
  }
314
385
 
315
386
  .main {
316
- .el-button.is-round{
387
+ .el-button.is-round {
317
388
  border-radius: 4px;
318
389
  padding: 9px 20px 10px 20px;
319
390
  display: flex;
@@ -327,7 +398,7 @@ export default {
327
398
  font-size: 14px !important;
328
399
  background-color: $app-primary-color;
329
400
  color: #fff;
330
- &+.button {
401
+ & + .button {
331
402
  margin-top: 10px !important;
332
403
  }
333
404
  &:hover {
@@ -337,8 +408,9 @@ export default {
337
408
  }
338
409
  }
339
410
 
340
- .tooltip-container{
341
- &::after, &::before {
411
+ .tooltip-container {
412
+ &::after,
413
+ &::before {
342
414
  content: '';
343
415
  display: block;
344
416
  position: absolute;
@@ -359,34 +431,36 @@ export default {
359
431
 
360
432
  .maplibregl-popup-anchor-bottom {
361
433
  .tooltip-container {
362
- &::after, &::before {
434
+ &::after,
435
+ &::before {
363
436
  top: 100%;
364
437
  border-width: 12px;
365
438
  }
366
439
  &::after {
367
- margin-top:-1px;
368
- border-color: rgb(255, 255, 255) transparent transparent transparent ;
440
+ margin-top: -1px;
441
+ border-color: rgb(255, 255, 255) transparent transparent transparent;
369
442
  }
370
443
  &::before {
371
444
  margin: 0 auto;
372
- border-color: $app-primary-color transparent transparent transparent ;
445
+ border-color: $app-primary-color transparent transparent transparent;
373
446
  }
374
447
  }
375
448
  }
376
449
 
377
450
  .maplibregl-popup-anchor-top {
378
451
  .tooltip-container {
379
- &::after, &::before {
452
+ &::after,
453
+ &::before {
380
454
  top: -24px;
381
455
  border-width: 12px;
382
456
  }
383
457
  &::after {
384
458
  margin-top: 1px;
385
- border-color: transparent transparent rgb(255, 255, 255) transparent ;
459
+ border-color: transparent transparent rgb(255, 255, 255) transparent;
386
460
  }
387
461
  &::before {
388
462
  margin: 0 auto;
389
- border-color: transparent transparent $app-primary-color transparent ;
463
+ border-color: transparent transparent $app-primary-color transparent;
390
464
  }
391
465
  }
392
466
  }
@@ -414,9 +488,9 @@ export default {
414
488
  background-color: #979797;
415
489
  }
416
490
 
417
-
418
491
  /* Fix for chrome bug where under triangle pops up above one on top of it */
419
- .selector:not(*:root), .tooltip-container::after{
492
+ .selector:not(*:root),
493
+ .tooltip-container::after {
420
494
  top: 99.4%;
421
495
  }
422
496
  </style>