@abi-software/flatmapvuer 0.4.6 → 0.5.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.
- package/CHANGELOG.md +317 -0
- package/dist/flatmapvuer.common.js +713 -1085
- package/dist/flatmapvuer.common.js.map +1 -1
- package/dist/flatmapvuer.css +1 -1
- package/dist/flatmapvuer.umd.js +713 -1085
- package/dist/flatmapvuer.umd.js.map +1 -1
- package/dist/flatmapvuer.umd.min.js +2 -2
- package/dist/flatmapvuer.umd.min.js.map +1 -1
- package/package-lock.json +230 -102
- package/package.json +15 -9
- package/src/App.vue +2 -2
- package/src/components/FlatmapVuer.vue +35 -37
- package/src/components/Tooltip.vue +2 -2
- package/src/services/flatmapQueries.js +21 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/flatmapvuer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/flatmapvuer.common.js",
|
|
6
6
|
"files": [
|
|
@@ -19,23 +19,29 @@
|
|
|
19
19
|
"serve": "vue-cli-service serve --port 8082",
|
|
20
20
|
"build": "vue-cli-service build --dest test_html --mode staging",
|
|
21
21
|
"build-bundle": "vue-cli-service build --target lib --name flatmapvuer ./src/components/index.js",
|
|
22
|
-
"lint": "vue-cli-service lint"
|
|
22
|
+
"lint": "vue-cli-service lint",
|
|
23
|
+
"release:beta": "npm version prerelease --preid=beta; npm publish --tag beta",
|
|
24
|
+
"release:minor": "npm version minor; npm publish",
|
|
25
|
+
"release:patch": "npm version patch; npm publish",
|
|
26
|
+
"changelog": "auto-changelog -p --output CHANGELOG.md --template keepachangelog",
|
|
27
|
+
"version": "npm run build-bundle;npm run changelog; git add CHANGELOG.md"
|
|
23
28
|
},
|
|
24
29
|
"dependencies": {
|
|
25
|
-
"@abi-software/flatmap-viewer": "^2.3.
|
|
30
|
+
"@abi-software/flatmap-viewer": "^2.3.3-b.4",
|
|
26
31
|
"@abi-software/svg-sprite": "^0.1.14",
|
|
27
|
-
"core-js": "^3.
|
|
32
|
+
"core-js": "^3.30.1",
|
|
28
33
|
"css-element-queries": "^1.2.2",
|
|
29
34
|
"current-script-polyfill": "^1.0.0",
|
|
30
35
|
"element-ui": "^2.13.0",
|
|
31
36
|
"file-loader": "^5.0.2",
|
|
32
37
|
"lodash": "^4.17.21",
|
|
33
|
-
"vue": "
|
|
38
|
+
"vue": "2.6.14"
|
|
34
39
|
},
|
|
35
40
|
"devDependencies": {
|
|
36
|
-
"@vue/cli-plugin-babel": "^4.
|
|
37
|
-
"@vue/cli-plugin-eslint": "^4.
|
|
38
|
-
"@vue/cli-service": "^4.5.
|
|
41
|
+
"@vue/cli-plugin-babel": "^4.5.19",
|
|
42
|
+
"@vue/cli-plugin-eslint": "^4.5.19",
|
|
43
|
+
"@vue/cli-service": "^4.5.19",
|
|
44
|
+
"auto-changelog": "^2.4.0",
|
|
39
45
|
"babel-eslint": "^10.0.3",
|
|
40
46
|
"babel-plugin-component": "^1.1.1",
|
|
41
47
|
"base64-inline-loader": "^2.0.1",
|
|
@@ -43,7 +49,7 @@
|
|
|
43
49
|
"eslint-plugin-vue": "^5.0.0",
|
|
44
50
|
"node-sass": "^4.14.1",
|
|
45
51
|
"sass-loader": "^8.0.2",
|
|
46
|
-
"vue-template-compiler": "
|
|
52
|
+
"vue-template-compiler": "2.6.14",
|
|
47
53
|
"webpack-node-externals": "^2.5.2"
|
|
48
54
|
},
|
|
49
55
|
"eslintConfig": {
|
package/src/App.vue
CHANGED
|
@@ -163,7 +163,7 @@ export default {
|
|
|
163
163
|
position:absolute;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
.
|
|
166
|
+
.maplibregl-ctrl-top-left .maplibregl-ctrl {
|
|
167
167
|
margin-top:120px;
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -191,7 +191,7 @@ body {
|
|
|
191
191
|
margin: 0px;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
.
|
|
194
|
+
.maplibregl-ctrl-top-left .maplibregl-ctrl {
|
|
195
195
|
margin-top:120px;
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -525,24 +525,21 @@ export default {
|
|
|
525
525
|
checkAndCreatePopups: async function(data) {
|
|
526
526
|
// Call flatmap database to get the connection data
|
|
527
527
|
let results = await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(data)
|
|
528
|
-
if
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
this.createTooltipFromNeuronCuration(data);
|
|
532
|
-
}
|
|
533
|
-
} else {
|
|
528
|
+
// The line below only creates the tooltip if some data was found on the path
|
|
529
|
+
// result 0 is the connection, result 1 is the pubmed results from flatmap
|
|
530
|
+
if(results[0] || results[1] ||( data.feature.hyperlinks && data.feature.hyperlinks.length > 0)){
|
|
534
531
|
this.resourceForTooltip = data.resource[0];
|
|
535
532
|
this.createTooltipFromNeuronCuration(data);
|
|
536
|
-
}
|
|
533
|
+
}
|
|
537
534
|
},
|
|
538
535
|
popUpCssHacks: function() {
|
|
539
536
|
// Below is a hack to remove flatmap tooltips while popup is open
|
|
540
537
|
let ftooltip = document.querySelector(".flatmap-tooltip-popup");
|
|
541
538
|
if (ftooltip) ftooltip.style.display = "none";
|
|
542
|
-
document.querySelector(".
|
|
539
|
+
document.querySelector(".maplibregl-popup-close-button").style.display =
|
|
543
540
|
"block";
|
|
544
541
|
this.$refs.tooltip.$el.style.display = "flex";
|
|
545
|
-
document.querySelector(".
|
|
542
|
+
document.querySelector(".maplibregl-popup-close-button").onclick = () => {
|
|
546
543
|
document.querySelector(".flatmap-tooltip-popup").style.display =
|
|
547
544
|
"block";
|
|
548
545
|
};
|
|
@@ -641,7 +638,7 @@ export default {
|
|
|
641
638
|
},
|
|
642
639
|
closeFlatmapHelpPopup: function() {
|
|
643
640
|
this.$el
|
|
644
|
-
.querySelectorAll(".
|
|
641
|
+
.querySelectorAll(".maplibregl-popup-close-button")
|
|
645
642
|
.forEach(item => {
|
|
646
643
|
item.click();
|
|
647
644
|
});
|
|
@@ -844,9 +841,10 @@ export default {
|
|
|
844
841
|
if (displayLabel &&
|
|
845
842
|
searchResults.results[0].featureId &&
|
|
846
843
|
searchResults.results[0].text) {
|
|
844
|
+
const annotation = this.mapImp.annotation(searchResults.results[0].featureId);
|
|
847
845
|
this.mapImp.showPopup(
|
|
848
846
|
searchResults.results[0].featureId,
|
|
849
|
-
|
|
847
|
+
annotation.label,
|
|
850
848
|
{ className: "custom-popup", positionAtLastClick: false, preserveSelection: true }
|
|
851
849
|
)
|
|
852
850
|
}
|
|
@@ -1157,13 +1155,13 @@ export default {
|
|
|
1157
1155
|
display: none;
|
|
1158
1156
|
}
|
|
1159
1157
|
|
|
1160
|
-
::v-deep .
|
|
1158
|
+
::v-deep .maplibregl-popup {
|
|
1161
1159
|
max-width: 300px !important;
|
|
1162
1160
|
}
|
|
1163
1161
|
|
|
1164
1162
|
::v-deep .flatmap-tooltip-popup {
|
|
1165
|
-
&.
|
|
1166
|
-
.
|
|
1163
|
+
&.maplibregl-popup-anchor-bottom {
|
|
1164
|
+
.maplibregl-popup-content {
|
|
1167
1165
|
margin-bottom: 12px;
|
|
1168
1166
|
&::after,
|
|
1169
1167
|
&::before {
|
|
@@ -1182,8 +1180,8 @@ export default {
|
|
|
1182
1180
|
}
|
|
1183
1181
|
}
|
|
1184
1182
|
}
|
|
1185
|
-
&.
|
|
1186
|
-
.
|
|
1183
|
+
&.maplibregl-popup-anchor-top {
|
|
1184
|
+
.maplibregl-popup-content {
|
|
1187
1185
|
margin-top: 18px;
|
|
1188
1186
|
&::after,
|
|
1189
1187
|
&::before {
|
|
@@ -1201,7 +1199,7 @@ export default {
|
|
|
1201
1199
|
}
|
|
1202
1200
|
}
|
|
1203
1201
|
}
|
|
1204
|
-
.
|
|
1202
|
+
.maplibregl-popup-content {
|
|
1205
1203
|
border-radius: 4px;
|
|
1206
1204
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
1207
1205
|
pointer-events: none;
|
|
@@ -1224,12 +1222,12 @@ export default {
|
|
|
1224
1222
|
flex-shrink: 0;
|
|
1225
1223
|
}
|
|
1226
1224
|
}
|
|
1227
|
-
.
|
|
1225
|
+
.maplibregl-popup-tip {
|
|
1228
1226
|
display: none;
|
|
1229
1227
|
}
|
|
1230
1228
|
}
|
|
1231
1229
|
|
|
1232
|
-
::v-deep .
|
|
1230
|
+
::v-deep .maplibregl-popup {
|
|
1233
1231
|
&.flatmap-marker-popup {
|
|
1234
1232
|
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
|
|
1235
1233
|
pointer-events: auto;
|
|
@@ -1240,25 +1238,25 @@ export default {
|
|
|
1240
1238
|
/* Fix for chrome bug where under triangle pops up above one on top of it */
|
|
1241
1239
|
.selector:not(*:root),
|
|
1242
1240
|
::v-deep.flatmap-tooltip-popup {
|
|
1243
|
-
.
|
|
1241
|
+
.maplibregl-popup-content::after {
|
|
1244
1242
|
top: 99.9%;
|
|
1245
1243
|
}
|
|
1246
1244
|
}
|
|
1247
1245
|
|
|
1248
1246
|
::v-deep .flatmap-tooltip-dialog {
|
|
1249
|
-
.
|
|
1247
|
+
.maplibregl-popup-tip {
|
|
1250
1248
|
display: none;
|
|
1251
1249
|
}
|
|
1252
1250
|
}
|
|
1253
1251
|
|
|
1254
1252
|
::v-deep .flatmap-marker-popup {
|
|
1255
|
-
.
|
|
1253
|
+
.maplibregl-popup-content {
|
|
1256
1254
|
padding: 0px;
|
|
1257
1255
|
}
|
|
1258
1256
|
}
|
|
1259
1257
|
|
|
1260
1258
|
::v-deep .flatmapvuer-popover {
|
|
1261
|
-
.
|
|
1259
|
+
.maplibregl-popup-close-button {
|
|
1262
1260
|
position: absolute;
|
|
1263
1261
|
right: 0.5em;
|
|
1264
1262
|
top: 0;
|
|
@@ -1359,7 +1357,7 @@ export default {
|
|
|
1359
1357
|
@media (max-width: 1250px) {
|
|
1360
1358
|
height: 125px !important;// important is needed here as we are over-riding the style set by the flatmap
|
|
1361
1359
|
width: 180px !important;
|
|
1362
|
-
>>> .maplibregl-canvas .
|
|
1360
|
+
>>> .maplibregl-canvas .maplibregl-canvas {
|
|
1363
1361
|
height: 125px !important;
|
|
1364
1362
|
width: 180px !important;
|
|
1365
1363
|
}
|
|
@@ -1367,7 +1365,7 @@ export default {
|
|
|
1367
1365
|
@media (min-width: 1251px) {
|
|
1368
1366
|
height: 190px !important;
|
|
1369
1367
|
width: 300px !important;
|
|
1370
|
-
>>> .maplibregl-canvas .
|
|
1368
|
+
>>> .maplibregl-canvas .maplibregl-canvas {
|
|
1371
1369
|
height: 190px !important;
|
|
1372
1370
|
width: 300px !important;
|
|
1373
1371
|
}
|
|
@@ -1448,10 +1446,10 @@ export default {
|
|
|
1448
1446
|
}
|
|
1449
1447
|
|
|
1450
1448
|
::v-deep .flatmap-popup-popper {
|
|
1451
|
-
.
|
|
1449
|
+
.maplibregl-popup-tip {
|
|
1452
1450
|
border-bottom-color: $app-primary-color;
|
|
1453
1451
|
}
|
|
1454
|
-
.
|
|
1452
|
+
.maplibregl-popup-content {
|
|
1455
1453
|
padding: 6px 4px;
|
|
1456
1454
|
font-size: 12px;
|
|
1457
1455
|
color: rgb(48, 49, 51);
|
|
@@ -1459,7 +1457,7 @@ export default {
|
|
|
1459
1457
|
border: 1px solid $app-primary-color;
|
|
1460
1458
|
white-space: nowrap;
|
|
1461
1459
|
min-width: unset;
|
|
1462
|
-
.
|
|
1460
|
+
.maplibregl-popup-close-button {
|
|
1463
1461
|
display: none;
|
|
1464
1462
|
}
|
|
1465
1463
|
}
|
|
@@ -1476,7 +1474,7 @@ export default {
|
|
|
1476
1474
|
}
|
|
1477
1475
|
}
|
|
1478
1476
|
|
|
1479
|
-
::v-deep .
|
|
1477
|
+
::v-deep .maplibregl-popup-content {
|
|
1480
1478
|
padding: 0px;
|
|
1481
1479
|
}
|
|
1482
1480
|
|
|
@@ -1539,7 +1537,7 @@ export default {
|
|
|
1539
1537
|
}
|
|
1540
1538
|
}
|
|
1541
1539
|
|
|
1542
|
-
::v-deep .
|
|
1540
|
+
::v-deep .maplibregl-canvas-container {
|
|
1543
1541
|
canvas {
|
|
1544
1542
|
outline: none;
|
|
1545
1543
|
}
|
|
@@ -1571,10 +1569,10 @@ export default {
|
|
|
1571
1569
|
}
|
|
1572
1570
|
|
|
1573
1571
|
::v-deep .custom-popup {
|
|
1574
|
-
.
|
|
1572
|
+
.maplibregl-popup-tip {
|
|
1575
1573
|
display: none;
|
|
1576
1574
|
}
|
|
1577
|
-
.
|
|
1575
|
+
.maplibregl-popup-content {
|
|
1578
1576
|
border-radius: 4px;
|
|
1579
1577
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
1580
1578
|
pointer-events: none;
|
|
@@ -1601,12 +1599,12 @@ export default {
|
|
|
1601
1599
|
border-style: solid;
|
|
1602
1600
|
flex-shrink: 0;
|
|
1603
1601
|
}
|
|
1604
|
-
.
|
|
1602
|
+
.maplibregl-popup-close-button {
|
|
1605
1603
|
display: none;
|
|
1606
1604
|
}
|
|
1607
1605
|
}
|
|
1608
|
-
&.
|
|
1609
|
-
.
|
|
1606
|
+
&.maplibregl-popup-anchor-bottom {
|
|
1607
|
+
.maplibregl-popup-content {
|
|
1610
1608
|
margin-bottom: 12px;
|
|
1611
1609
|
&::after,
|
|
1612
1610
|
&::before {
|
|
@@ -1625,8 +1623,8 @@ export default {
|
|
|
1625
1623
|
}
|
|
1626
1624
|
}
|
|
1627
1625
|
}
|
|
1628
|
-
&.
|
|
1629
|
-
.
|
|
1626
|
+
&.maplibregl-popup-anchor-top {
|
|
1627
|
+
.maplibregl-popup-content {
|
|
1630
1628
|
margin-top: 18px;
|
|
1631
1629
|
&::after,
|
|
1632
1630
|
&::before {
|
|
@@ -340,7 +340,7 @@ export default {
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
.
|
|
343
|
+
.maplibregl-popup-anchor-bottom {
|
|
344
344
|
.tooltip-container {
|
|
345
345
|
&::after, &::before {
|
|
346
346
|
top: 100%;
|
|
@@ -357,7 +357,7 @@ export default {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
-
.
|
|
360
|
+
.maplibregl-popup-anchor-top {
|
|
361
361
|
.tooltip-container {
|
|
362
362
|
&::after, &::before {
|
|
363
363
|
top: -24px;
|
|
@@ -210,9 +210,9 @@ let FlatmapQueries = function(){
|
|
|
210
210
|
resolve(false)
|
|
211
211
|
})
|
|
212
212
|
})
|
|
213
|
-
let prom2 = this.pubmedQueryOnIds(eventData)
|
|
213
|
+
let prom2 = await this.pubmedQueryOnIds(eventData)
|
|
214
214
|
let results = await Promise.all([prom1, prom2])
|
|
215
|
-
return results
|
|
215
|
+
return results
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
this.connectivityExists = function(data){
|
|
@@ -344,21 +344,24 @@ let FlatmapQueries = function(){
|
|
|
344
344
|
console.error('Error:', error)
|
|
345
345
|
})
|
|
346
346
|
}
|
|
347
|
-
|
|
347
|
+
// Note that this functin WILL run to the end, as it doesn not catch the second level of promises
|
|
348
348
|
this.pubmedQueryOnIds = function(eventData){
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
349
|
+
return new Promise(resolve=>{
|
|
350
|
+
const keastIds = eventData.resource
|
|
351
|
+
const source = eventData.feature.source
|
|
352
|
+
if(!keastIds || keastIds.length === 0) return
|
|
353
|
+
const sql = this.buildPubmedSqlStatement(keastIds)
|
|
354
|
+
this.flatmapQuery(sql).then(data=>{
|
|
355
|
+
// Create pubmed url on paths if we have them
|
|
356
|
+
if (data.values.length > 0){
|
|
357
|
+
this.urls = [this.pubmedSearchUrl(data.values.map(id=>this.stripPMIDPrefix(id[0])))]
|
|
358
|
+
resolve(true)
|
|
359
|
+
} else { // Create pubmed url on models
|
|
360
|
+
this.pubmedQueryOnModels(source).then(result=>{
|
|
361
|
+
resolve(result)
|
|
362
|
+
})
|
|
363
|
+
}
|
|
364
|
+
})
|
|
362
365
|
})
|
|
363
366
|
}
|
|
364
367
|
|
|
@@ -366,10 +369,11 @@ let FlatmapQueries = function(){
|
|
|
366
369
|
return this.flatmapQuery(this.buildPubmedSqlStatementForModels(source)).then(data=>{
|
|
367
370
|
if (Array.isArray(data.values) && data.values.length > 0){
|
|
368
371
|
this.urls = [this.pubmedSearchUrl(data.values.map(id=>this.stripPMIDPrefix(id[0])))]
|
|
372
|
+
return true
|
|
369
373
|
} else {
|
|
370
374
|
this.urls = [] // Clears the pubmed search button
|
|
371
375
|
}
|
|
372
|
-
return
|
|
376
|
+
return false
|
|
373
377
|
})
|
|
374
378
|
}
|
|
375
379
|
|