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