@abi-software/flatmapvuer 0.3.8 → 0.3.10-beta
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/LICENSE +201 -201
- package/README.md +105 -105
- package/babel.config.js +14 -14
- package/dist/flatmapvuer.common.js +1545 -3141
- package/dist/flatmapvuer.common.js.map +1 -1
- package/dist/flatmapvuer.css +1 -1
- package/dist/flatmapvuer.umd.js +1545 -3141
- package/dist/flatmapvuer.umd.js.map +1 -1
- package/dist/flatmapvuer.umd.min.js +1 -1
- package/dist/flatmapvuer.umd.min.js.map +1 -1
- package/package-lock.json +14121 -13933
- package/package.json +71 -71
- package/public/index.html +17 -17
- package/src/App.vue +162 -163
- package/src/assets/_variables.scss +43 -43
- package/src/assets/styles.scss +7 -7
- package/src/components/EventBus.js +2 -2
- package/src/components/FlatmapVuer.vue +1442 -1388
- package/src/components/MultiFlatmapVuer.vue +361 -359
- package/src/components/PubmedViewer.vue +149 -198
- package/src/components/Tooltip.vue +594 -591
- package/src/components/index.js +9 -9
- package/src/components/legends/Legends.vue +66 -66
- package/src/icons/fonts/mapicon-species.eot +0 -0
- package/src/icons/fonts/mapicon-species.svg +14 -14
- package/src/icons/fonts/mapicon-species.ttf +0 -0
- package/src/icons/fonts/mapicon-species.woff +0 -0
- package/src/icons/mapicon-species-style.css +42 -42
- package/src/legends/legend.svg +25 -25
- package/src/main.js +8 -8
- package/src/nerve-map.js +99 -0
- package/vue.config.js +31 -31
|
@@ -1,199 +1,150 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="pubmed-container">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
<style scoped lang="scss">
|
|
151
|
-
@import "~element-ui/packages/theme-chalk/src/link";
|
|
152
|
-
@import "~element-ui/packages/theme-chalk/src/carousel";
|
|
153
|
-
@import "~element-ui/packages/theme-chalk/src/carousel-item";
|
|
154
|
-
|
|
155
|
-
.attribute-title{
|
|
156
|
-
font-size: 16px;
|
|
157
|
-
font-weight: 600;
|
|
158
|
-
/* font-weight: bold; */
|
|
159
|
-
text-transform: uppercase;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.attribute-content{
|
|
163
|
-
font-size: 14px;
|
|
164
|
-
font-weight: 400;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.el-link {
|
|
168
|
-
color: $app-primary-color;
|
|
169
|
-
text-decoration: none;
|
|
170
|
-
word-wrap: break-word;
|
|
171
|
-
&:hover, &:focus{
|
|
172
|
-
color: $app-primary-color;
|
|
173
|
-
text-decoration: underline;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
::v-deep .el-carousel__button {
|
|
178
|
-
background-color: $app-primary-color;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.button {
|
|
182
|
-
margin-left: 0px !important;
|
|
183
|
-
margin-top: 0px !important;
|
|
184
|
-
font-size: 14px !important;
|
|
185
|
-
background-color: $app-primary-color;
|
|
186
|
-
color: #fff;
|
|
187
|
-
&:hover{
|
|
188
|
-
color: #fff !important;
|
|
189
|
-
background: #ac76c5 !important;
|
|
190
|
-
border: 1px solid #ac76c5 !important;
|
|
191
|
-
}
|
|
192
|
-
&+.button {
|
|
193
|
-
margin-top: 10px !important;
|
|
194
|
-
background-color: $app-primary-color;
|
|
195
|
-
color: #fff;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pubmed-container">
|
|
3
|
+
<!-- To view old pubmed display go to: https://github.com/Tehsurfer/flatmapvuer/commit/eca131f8d32cdcac4d136d1722d7fe4df25f6c3a -->
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
/* eslint-disable no-alert, no-console */
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: "Tooltip",
|
|
13
|
+
props: {
|
|
14
|
+
entry: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: () => {}
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
watch: {
|
|
20
|
+
'entry.featureIds': {
|
|
21
|
+
handler: function(ids) {
|
|
22
|
+
this.pubmedQueryOnIds(ids)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
inject: ['flatmapAPI'],
|
|
27
|
+
data: function() {
|
|
28
|
+
return {
|
|
29
|
+
pubmeds: [],
|
|
30
|
+
pubmedIds: [],
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
mounted: function() {
|
|
34
|
+
if (this.entry.featureIds)
|
|
35
|
+
this.pubmedQueryOnIds(this.entry.featureIds)
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
stripPMIDPrefix: function (pubmedId){
|
|
39
|
+
return pubmedId.split(':')[1]
|
|
40
|
+
},
|
|
41
|
+
buildPubmedSqlStatement: function(keastIds) {
|
|
42
|
+
let sql = 'select distinct publication from publications where entity in ('
|
|
43
|
+
if (keastIds.length === 1) {
|
|
44
|
+
sql += `'${keastIds[0]}')`
|
|
45
|
+
} else if (keastIds.length > 1) {
|
|
46
|
+
for (let i in keastIds) {
|
|
47
|
+
sql += `'${keastIds[i]}'${i >= keastIds.length - 1 ? ')' : ','} `
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return sql
|
|
51
|
+
},
|
|
52
|
+
buildPubmedSqlStatementForModels: function(model) {
|
|
53
|
+
return `select distinct publication from publications where entity = '${model}'`
|
|
54
|
+
},
|
|
55
|
+
flatmapQuery: function(sql){
|
|
56
|
+
const data = { sql: sql}
|
|
57
|
+
return fetch(`${this.flatmapAPI}knowledge/query/`, {
|
|
58
|
+
method: 'POST',
|
|
59
|
+
headers: {
|
|
60
|
+
'Content-Type': 'application/json',
|
|
61
|
+
},
|
|
62
|
+
body: JSON.stringify(data),
|
|
63
|
+
})
|
|
64
|
+
.then(response => response.json())
|
|
65
|
+
.catch((error) => {
|
|
66
|
+
console.error('Error:', error)
|
|
67
|
+
})
|
|
68
|
+
},
|
|
69
|
+
pubmedQueryOnIds: function(keastIds){
|
|
70
|
+
if(!keastIds || keastIds.length === 0) return
|
|
71
|
+
const sql = this.buildPubmedSqlStatement(keastIds)
|
|
72
|
+
this.flatmapQuery(sql).then(data=>{
|
|
73
|
+
this.responseData = data
|
|
74
|
+
// Create pubmed url on paths if we have them
|
|
75
|
+
if (data.values.length > 0){
|
|
76
|
+
this.$emit('pubmedSearchUrl', this.pubmedSearchUrl(data.values.map(id=>this.stripPMIDPrefix(id[0]))))
|
|
77
|
+
} else { // Create pubmed url on models
|
|
78
|
+
this.pubmedQueryOnModels(this.entry.source)
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
},
|
|
82
|
+
pubmedQueryOnModels(source){
|
|
83
|
+
this.flatmapQuery(this.buildPubmedSqlStatementForModels(source)).then(data=>{
|
|
84
|
+
if (Array.isArray(data.values) && data.values.length > 0){
|
|
85
|
+
this.$emit('pubmedSearchUrl', this.pubmedSearchUrl(data.values.map(id=>this.stripPMIDPrefix(id[0]))))
|
|
86
|
+
} else {
|
|
87
|
+
this.$emit('pubmedSearchUrl', '') // Clears the pubmed search button
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
},
|
|
91
|
+
pubmedSearchUrl: function(ids) {
|
|
92
|
+
let url = 'https://pubmed.ncbi.nlm.nih.gov/?'
|
|
93
|
+
let params = new URLSearchParams()
|
|
94
|
+
params.append('term', ids)
|
|
95
|
+
return url + params.toString()
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<style scoped lang="scss">
|
|
102
|
+
@import "~element-ui/packages/theme-chalk/src/link";
|
|
103
|
+
@import "~element-ui/packages/theme-chalk/src/carousel";
|
|
104
|
+
@import "~element-ui/packages/theme-chalk/src/carousel-item";
|
|
105
|
+
|
|
106
|
+
.attribute-title{
|
|
107
|
+
font-size: 16px;
|
|
108
|
+
font-weight: 600;
|
|
109
|
+
/* font-weight: bold; */
|
|
110
|
+
text-transform: uppercase;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.attribute-content{
|
|
114
|
+
font-size: 14px;
|
|
115
|
+
font-weight: 400;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.el-link {
|
|
119
|
+
color: $app-primary-color;
|
|
120
|
+
text-decoration: none;
|
|
121
|
+
word-wrap: break-word;
|
|
122
|
+
&:hover, &:focus{
|
|
123
|
+
color: $app-primary-color;
|
|
124
|
+
text-decoration: underline;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
::v-deep .el-carousel__button {
|
|
129
|
+
background-color: $app-primary-color;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.button {
|
|
133
|
+
margin-left: 0px !important;
|
|
134
|
+
margin-top: 0px !important;
|
|
135
|
+
font-size: 14px !important;
|
|
136
|
+
background-color: $app-primary-color;
|
|
137
|
+
color: #fff;
|
|
138
|
+
&:hover{
|
|
139
|
+
color: #fff !important;
|
|
140
|
+
background: #ac76c5 !important;
|
|
141
|
+
border: 1px solid #ac76c5 !important;
|
|
142
|
+
}
|
|
143
|
+
&+.button {
|
|
144
|
+
margin-top: 10px !important;
|
|
145
|
+
background-color: $app-primary-color;
|
|
146
|
+
color: #fff;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
199
150
|
</style>
|