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