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