@abi-software/flatmapvuer 0.3.6-upstream-downstream → 0.3.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmapvuer",
3
- "version": "0.3.6-upstream-downstream",
3
+ "version": "0.3.7",
4
4
  "main": "./dist/flatmapvuer.common.js",
5
5
  "files": [
6
6
  "dist/*",
@@ -17,7 +17,7 @@
17
17
  "lint": "vue-cli-service lint"
18
18
  },
19
19
  "dependencies": {
20
- "@abi-software/flatmap-viewer": "^2.2.1-beta.8",
20
+ "@abi-software/flatmap-viewer": "^2.2.2-beta.4",
21
21
  "@abi-software/svg-sprite": "^0.1.14",
22
22
  "core-js": "^3.3.2",
23
23
  "css-element-queries": "^1.2.2",
package/src/App.vue CHANGED
@@ -91,8 +91,8 @@ export default {
91
91
  displayCloseButton: false,
92
92
  initial: "Rat",
93
93
  helpMode: false,
94
- //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/"
95
- flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/"
94
+ flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/"
95
+ // flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/"
96
96
  // flatmapAPI: "https://mapcore-demo.org/fccb/flatmap/"
97
97
  // flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v1/"
98
98
  }
@@ -124,6 +124,7 @@
124
124
  v-if="pathways.length > 0 && pathControls"
125
125
  v-popover:checkBoxPopover
126
126
  >
127
+ <svg-legends class= "svg-legends-container"/>
127
128
  <el-popover
128
129
  content="Find these markers for data"
129
130
  placement="right"
@@ -250,6 +251,7 @@
250
251
  import Vue from "vue";
251
252
  import Tooltip from "./Tooltip";
252
253
  import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
254
+ import SvgLegends from "./legends/Legends";
253
255
  import {
254
256
  Checkbox,
255
257
  CheckboxGroup,
@@ -284,7 +286,8 @@ export default {
284
286
  components: {
285
287
  MapSvgIcon,
286
288
  MapSvgSpriteColor,
287
- Tooltip
289
+ Tooltip,
290
+ SvgLegends
288
291
  },
289
292
  beforeCreate: function() {
290
293
  this.mapManager = undefined;
@@ -650,7 +653,15 @@ export default {
650
653
  }
651
654
  }
652
655
  return false;
653
- }
656
+ },
657
+ /**
658
+ * Get the list of suggested terms
659
+ */
660
+ searchSuggestions: function(term) {
661
+ if (this.mapImp)
662
+ return this.mapImp.search(term);
663
+ return [];
664
+ },
654
665
  },
655
666
  props: {
656
667
  entry: String,
@@ -785,7 +796,7 @@ export default {
785
796
  @import "~element-ui/packages/theme-chalk/src/loading";
786
797
  @import "~element-ui/packages/theme-chalk/src/row";
787
798
 
788
- .beta-popovers{
799
+ .beta-popovers {
789
800
  position: absolute;
790
801
  top: 90px;
791
802
  left: 16px;
@@ -882,6 +893,11 @@ export default {
882
893
  }
883
894
  }
884
895
 
896
+ .svg-legends-container {
897
+ width:70%;
898
+ height:auto;
899
+ }
900
+
885
901
  .pathway-container {
886
902
  float: left;
887
903
  padding-left: 16px;
@@ -890,7 +906,6 @@ export default {
890
906
  text-align: left;
891
907
  overflow: auto;
892
908
  border: 1px solid rgb(220, 223, 230);
893
- padding-top: 7px;
894
909
  padding-bottom: 16px;
895
910
  background: #ffffff;
896
911
  }
@@ -1163,7 +1178,7 @@ export default {
1163
1178
  background-color: black;
1164
1179
  }
1165
1180
  &.lightskyblue {
1166
- background-color: white;
1181
+ background-color: lightskyblue;
1167
1182
  }
1168
1183
  }
1169
1184
 
@@ -1288,7 +1303,7 @@ export default {
1288
1303
  z-index: 8;
1289
1304
  width: 20px;
1290
1305
  height: 40px;
1291
- border: solid 1px #e4e7ed;
1306
+ border: solid 1px $app-primary-color;
1292
1307
  text-align: center;
1293
1308
  vertical-align: middle;
1294
1309
  cursor: pointer;
@@ -1305,21 +1320,22 @@ export default {
1305
1320
  .drawer-button {
1306
1321
  float: left;
1307
1322
  margin-top: calc(50% - 36px);
1308
- border-left: 0;
1309
- background-color: #ffffff;
1323
+ background-color: #F9F2FC;
1324
+
1310
1325
  i {
1326
+ font-weight: 600;
1311
1327
  margin-top: 12px;
1312
1328
  color: $app-primary-color;
1313
1329
  transition-delay: 0.9s;
1314
1330
  }
1315
1331
  &.open {
1316
1332
  i {
1317
- transform: rotate(0deg) scaleY(2.5);
1333
+ transform: rotate(0deg) scaleY(2);
1318
1334
  }
1319
1335
  }
1320
1336
  &.close {
1321
1337
  i {
1322
- transform: rotate(180deg) scaleY(2.5);
1338
+ transform: rotate(180deg) scaleY(2);
1323
1339
  }
1324
1340
  }
1325
1341
  }
@@ -120,14 +120,18 @@ export default {
120
120
  this.loading.response = false
121
121
 
122
122
  // create links for each pubmedId
123
- data.values.forEach(identifier => {
124
- let ids = this.stripPMIDPrefix(identifier[0])
125
- this.titleFromPubmed(ids).then( bib=>{
126
- let [html, link] = this.splitLink(bib)
127
- this.pubmeds.push({identifier: identifier[0] , html: html, url: link})
128
- })
129
- });
130
- this.$emit('pubmedSearchUrl', this.pubmedSearchUrl(data.values.map(id=>this.stripPMIDPrefix(id[0]))))
123
+ if (data.values.length > 0){
124
+ data.values.forEach(identifier => {
125
+ let ids = this.stripPMIDPrefix(identifier[0])
126
+ this.titleFromPubmed(ids).then( bib=>{
127
+ let [html, link] = this.splitLink(bib)
128
+ this.pubmeds.push({identifier: identifier[0] , html: html, url: link})
129
+ })
130
+ });
131
+ this.$emit('pubmedSearchUrl', this.pubmedSearchUrl(data.values.map(id=>this.stripPMIDPrefix(id[0]))))
132
+ } else {
133
+ this.$emit('pubmedSearchUrl', '') // Clears the pubmed search button
134
+ }
131
135
  })
132
136
  .catch((error) => {
133
137
  console.error('Error:', error)
@@ -26,9 +26,9 @@
26
26
  </span>
27
27
  </el-popover>
28
28
  </div>
29
- <div v-for="origin in origins" class="attribute-content" :key="origin">
29
+ <div v-for="(origin, i) in origins" class="attribute-content" :key="origin">
30
30
  {{ capitalise(origin) }}
31
- <div class="seperator"></div>
31
+ <div v-if="i != origins.length - 1" class="seperator"></div>
32
32
  </div>
33
33
  <el-button v-show="originsWithDatasets.length > 0" class="button" @click="openDendrites">
34
34
  Explore origin data
@@ -36,9 +36,9 @@
36
36
  </div>
37
37
  <div v-if="this.components" class="block">
38
38
  <div class="attribute-title">Components</div>
39
- <div v-for="component in components" class="attribute-content" :key="component">
39
+ <div v-for="(component, i) in components" class="attribute-content" :key="component">
40
40
  {{ capitalise(component) }}
41
- <div class="seperator"></div>
41
+ <div v-if="i != components.length - 1" class="seperator"></div>
42
42
  </div>
43
43
  </div>
44
44
  <div v-if="this.destinations" class="block">
@@ -56,9 +56,9 @@
56
56
  </span>
57
57
  </el-popover>
58
58
  </div>
59
- <div v-for="destination in destinations" class="attribute-content" :key="destination">
59
+ <div v-for="(destination, i) in destinations" class="attribute-content" :key="destination">
60
60
  {{ capitalise(destination) }}
61
- <div class="seperator"></div>
61
+ <div v-if="i != destinations.length - 1" class="seperator"></div>
62
62
  </div>
63
63
  <el-button v-show="destinationsWithDatasets.length > 0" class="button" @click="openAxons">
64
64
  Explore destination data
@@ -76,7 +76,7 @@
76
76
  <i v-if="action.title === 'Search for datasets' || action.title === 'View Dataset' " class="el-icon-coin"></i>
77
77
  {{action.title}}
78
78
  </el-button> -->
79
- <el-button v-if="pubmedSearchUrl" class="button" icon="el-icon-notebook-2" @click="openUrl(pubmedSearchUrl)">
79
+ <el-button v-if="pubmedSearchUrl != ''" class="button" icon="el-icon-notebook-2" @click="openUrl(pubmedSearchUrl)">
80
80
  Open publications in pubmed
81
81
  </el-button>
82
82
  </div>
@@ -118,6 +118,11 @@ const inArray = function(ar1, ar2){
118
118
  return as1.indexOf(as2) !== -1
119
119
  }
120
120
 
121
+ // remove duplicates by stringifying the objects
122
+ const removeDuplicates = function(arrayOfAnything){
123
+ return [...new Set(arrayOfAnything.map(e => JSON.stringify(e)))].map(e => JSON.parse(e))
124
+ }
125
+
121
126
  const capitalise = function(str){
122
127
  if (str)
123
128
  return str.charAt(0).toUpperCase() + str.slice(1)
@@ -232,7 +237,7 @@ export default {
232
237
  },
233
238
  findComponents: function(connectivity){
234
239
  let dnodes = connectivity.connectivity.flat() // get nodes from edgelist
235
- let nodes = [...new Set(dnodes)] // remove duplicates
240
+ let nodes = removeDuplicates(dnodes)
236
241
 
237
242
  let found = []
238
243
  let terminal = false
@@ -345,14 +350,13 @@ export default {
345
350
  .then(response => response.json())
346
351
  .then(data => {
347
352
  let connectivity = JSON.parse(data.values[0][0])
348
-
349
353
  // Filter the origin and destinations from components
350
354
  let components = this.findComponents(connectivity)
351
355
 
352
356
  // process the nodes for finding datasets
353
357
  let componentsFlat = this.flattenConntectivity(components)
354
- let axons = connectivity.axons
355
- let dendrites = connectivity.dendrites
358
+ let axons = removeDuplicates(connectivity.axons)
359
+ let dendrites = removeDuplicates(connectivity.dendrites)
356
360
  let axonsFlat = this.flattenConntectivity(axons)
357
361
  let dendritesFlat = this.flattenConntectivity(dendrites)
358
362
 
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <div class="legends-container">
3
+ <svg version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 500 500" style="enable-background:new 0 0 500 500;" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com">
4
+ <defs>
5
+ <bx:grid height="30.447" width="32.516" x="0" y="0"/>
6
+ </defs>
7
+ <path class="st0 st0-translate" d="M61.3,103.8c-15.9,0-28.8-12.3-28.8-27.3c0-15,13-27.3,28.8-27.3s28.8,12.3,28.8,27.3 C90.1,91.5,77.2,103.8,61.3,103.8z"/>
8
+ <path class="st1" d="M40.3,356.1C29.5,345,29.8,328,41.5,317.5c11.7-10.5,29.6-9.9,40.7,1.1c11.1,11,10.5,28.1-1.2,38.5 C69.3,367.4,51.1,366.9,40.3,356.1z"/>
9
+ <path class="st2" d="M61.2,396.9c-5.3,9.3-15.3,15.1-26.1,15.1l-0.4,0.6c5.1,9,5.1,20,0,29l0.4,0.6c10.7,0,20.8,5.8,26.1,15.1 c5.3-9.3,15.3-15.1,26.1-15.1c-5.3-9.3-5.3-20.9,0-30.4C76.6,412.1,66.7,406.3,61.2,396.9z"/>
10
+ <text transform="matrix(0.9908 0 0 1 118.0161 171.7975)" class="st3 st4 st5" style="white-space: pre;">Tissue region</text>
11
+ <path class="st6" d="M40.9,231.1c11.3-10.6,29.5-10.6,40.8,0c11.3,10.6,11.3,27.9,0,38.5c-11.3,10.6-29.5,10.6-40.8,0 C29.7,259,29.7,241.7,40.9,231.1z"/>
12
+ <text transform="matrix(0.9908 0 0 1 118.0161 257.675)" class="st3 st4 st5" style="white-space: pre;">Brain nuclei</text>
13
+ <!-- Hide this unti we can clarify the label
14
+ <path class="st7" d="M34.3,174c-6.2-13.9,0.6-29.9,15.3-35.7c14.7-5.9,31.6,0.6,37.8,14.4c1.5,3.5,2.3,7,2.3,10.6 c0,10.6-6.6,20.8-17.6,25.2C57.5,194.3,40.5,187.9,34.3,174z"/>
15
+ <text transform="matrix(0.9908 0 0 1 117.5474 171.7975)" class="st3 st4 st5" style="white-space: pre;">Specific anatomical structure</text>
16
+ -->
17
+ <text transform="matrix(0.9908 0 0 1 118.0903 345.5266)" class="st3 st4 st5" style="white-space: pre;">Ganglia</text>
18
+ <text transform="matrix(0.9908 0 0 1 118.0903 433.1613)" class="st3 st4 st5" style="white-space: pre;">Nerve plexus</text>
19
+ </svg>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ export default {
25
+ name: 'SvgLegends',
26
+ }
27
+ </script>
28
+
29
+ <style scoped lang="scss">
30
+ .legends-container {
31
+ pointer-events: none;
32
+ transform: translate(0px, -20px);
33
+ }
34
+
35
+ .st0-translate {
36
+ transform: translate(0px, 88px);
37
+ }
38
+ .st0 {
39
+ fill:#FF33CC;
40
+ }
41
+ .st1 {
42
+ fill:#B2F074;
43
+ }
44
+ .st2 {
45
+ opacity:0.64;
46
+ fill:#E4E417;
47
+ enable-background:new;
48
+ }
49
+ .st3 {
50
+ fill:#333333;
51
+ }
52
+ .st4 {
53
+ font-family:Asap, sans-serif;
54
+ }
55
+ .st5 {
56
+ font-size:32px;
57
+ }
58
+ .st6 {
59
+ fill:#F15A24;
60
+ }
61
+ .st7 {
62
+ fill:#66FFFF;
63
+ stroke:#000000;
64
+ stroke-width:3;
65
+ }
66
+ </style>