@abi-software/flatmapvuer 0.2.3 → 0.2.4-beta-3

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.
@@ -6,7 +6,7 @@
6
6
  element-loading-spinner="el-icon-loading"
7
7
  element-loading-background="rgba(0, 0, 0, 0.3)"
8
8
  >
9
- <SvgSpriteColor />
9
+ <map-svg-sprite-color />
10
10
  <div style="height:100%;width:100%;position:relative;overflow-y:none">
11
11
  <div style="height:100%;width:100%;" ref="display"></div>
12
12
  <el-popover
@@ -37,7 +37,7 @@
37
37
  popper-class="flatmap-popper left-popper"
38
38
  v-model="hoverVisibilities[0].value"
39
39
  >
40
- <SvgIcon
40
+ <map-svg-icon
41
41
  icon="zoomIn"
42
42
  class="icon-button zoomIn"
43
43
  slot="reference"
@@ -54,7 +54,7 @@
54
54
  popper-class="flatmap-popper popper-zoomout"
55
55
  v-model="hoverVisibilities[1].value"
56
56
  >
57
- <SvgIcon
57
+ <map-svg-icon
58
58
  icon="zoomOut"
59
59
  class="icon-button zoomOut"
60
60
  slot="reference"
@@ -71,7 +71,7 @@
71
71
  popper-class="flatmap-popper"
72
72
  v-model="hoverVisibilities[2].value"
73
73
  >
74
- <SvgIcon
74
+ <map-svg-icon
75
75
  icon="resetZoom"
76
76
  class="icon-button resetView"
77
77
  slot="reference"
@@ -197,7 +197,7 @@
197
197
  trigger="manual"
198
198
  popper-class="flatmap-popper right-popper"
199
199
  >
200
- <SvgIcon
200
+ <map-svg-icon
201
201
  v-popover:backgroundPopover
202
202
  icon="changeBckgd"
203
203
  class="icon-button background-colour"
@@ -211,6 +211,7 @@
211
211
  ref="tooltip"
212
212
  class="tooltip"
213
213
  :content="tooltipContent"
214
+ :flatmapAPI="flatmapAPI"
214
215
  @resource-selected="resourceSelected"
215
216
  />
216
217
  </div>
@@ -221,7 +222,7 @@
221
222
  /* eslint-disable no-alert, no-console */
222
223
  import Vue from "vue";
223
224
  import Tooltip from "./Tooltip";
224
- import { SvgIcon, SvgSpriteColor } from "@abi-software/svg-sprite";
225
+ import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
225
226
  import {
226
227
  Checkbox,
227
228
  CheckboxGroup,
@@ -253,8 +254,8 @@ const mapResize = map => {
253
254
  export default {
254
255
  name: "FlatmapVuer",
255
256
  components: {
256
- SvgIcon,
257
- SvgSpriteColor,
257
+ MapSvgIcon,
258
+ MapSvgSpriteColor,
258
259
  Tooltip
259
260
  },
260
261
  beforeCreate: function() {
@@ -337,24 +338,31 @@ export default {
337
338
  this.mapImp.showPaths(this.checkedItems);
338
339
  }
339
340
  },
341
+ enablePanZoomEvents: function(flag) {
342
+ this.mapImp.enablePanZoomEvents(flag);
343
+ },
340
344
  eventCallback: function() {
341
- return (eventType, feature, ...args) => {
342
- const label = feature.label;
343
- const resource = [feature.models];
344
- const taxonomy = this.entry;
345
- const data = {
346
- dataset: feature.dataset,
347
- taxonomy: taxonomy,
348
- resource: resource,
349
- label: label,
350
- feature: feature,
351
- userData: args,
352
- eventType: eventType
353
- };
354
- // Disable the nueron pop up for now.
355
- if (feature && feature.type !== "marker")
356
- this.checkAndCreatePopups(data);
357
- this.$emit("resource-selected", data);
345
+ return (eventType, data, ...args) => {
346
+ if (eventType !== "pan-zoom") {
347
+ const label = data.label;
348
+ const resource = [data.models];
349
+ const taxonomy = this.entry;
350
+ const payload = {
351
+ dataset: data.dataset,
352
+ taxonomy: taxonomy,
353
+ resource: resource,
354
+ label: label,
355
+ feature: data,
356
+ userData: args,
357
+ eventType: eventType
358
+ };
359
+ // Disable the nueron pop up for now.
360
+ if (data && data.type !== "marker")
361
+ this.checkAndCreatePopups(data);
362
+ this.$emit("resource-selected", payload);
363
+ } else {
364
+ this.$emit("pan-zoom-callback", data);
365
+ }
358
366
  };
359
367
  },
360
368
  // checkNeuronClicked shows a neuron path pop up if a path was recently clicked
@@ -633,7 +641,7 @@ export default {
633
641
  },
634
642
  warningMessage: {
635
643
  type: String,
636
- default: "Beta feature - under active development"
644
+ default: "Beta feature - This map is based on the connectivity of a rat. New connectivity and species specificity will be added as the SPARC program progress."
637
645
  },
638
646
  /**
639
647
  * State containing state of the flatmap.
@@ -36,6 +36,7 @@
36
36
  :ref="key"
37
37
  @resource-selected="FlatmapSelected"
38
38
  @ready="FlatmapReady"
39
+ @pan-zoom-callback="panZoomCallback"
39
40
  :featureInfo="featureInfo"
40
41
  :minZoom="minZoom"
41
42
  :pathControls="pathControls"
@@ -119,6 +120,9 @@ export default {
119
120
  getCurrentFlatmap: function() {
120
121
  return this.$refs[this.activeSpecies][0];
121
122
  },
123
+ panZoomCallback: function(payload) {
124
+ this.$emit("pan-zoom-callback", payload);
125
+ },
122
126
  showPopup: function(featureId, node, options) {
123
127
  let map = this.getCurrentFlatmap();
124
128
  map.showPopup(featureId, node, options);
@@ -43,6 +43,13 @@ export default {
43
43
  type: String,
44
44
  default: ''
45
45
  },
46
+ /**
47
+ * Specify the endpoint of the flatmap server.
48
+ */
49
+ flatmapAPI: {
50
+ type: String,
51
+ default: "https://mapcore-demo.org/flatmaps/"
52
+ }
46
53
  },
47
54
  watch: {
48
55
  'featureId': function (val){
@@ -85,8 +92,9 @@ export default {
85
92
  flatmapQuery: function(identifier){
86
93
  this.pubmeds = []
87
94
  this.loading.response = true
95
+ let endpoint = this.flatmapAPI + 'knowledge/query/';
88
96
  const data = { sql: 'select publication from publications where entity=?', "params": [identifier]};
89
- fetch('https://mapcore-demo.org/devel/flatmap/v1/knowledge/query/', {
97
+ fetch(endpoint, {
90
98
  method: 'POST',
91
99
  headers: {
92
100
  'Content-Type': 'application/json',
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
 
11
11
 
12
- <pubmed-viewer v-if="content.featureId" class="block" :featureId="content.featureId" @pubmedSearchUrl="pubmedSearchUrlUpdate"/>
12
+ <pubmed-viewer v-if="content.featureId" class="block" :flatmapAPI=flatmapAPI :featureId="content.featureId" @pubmedSearchUrl="pubmedSearchUrlUpdate"/>
13
13
  <div v-if="content.components" class="block">
14
14
  <div class="attribute-title">Components</div>
15
15
  <span class="attribute-content">{{content.components}}</span>
@@ -71,6 +71,13 @@ export default {
71
71
  content: {
72
72
  type: Object,
73
73
  default: undefined
74
+ },
75
+ /**
76
+ * Specify the endpoint of the flatmap server.
77
+ */
78
+ flatmapAPI: {
79
+ type: String,
80
+ default: "https://mapcore-demo.org/flatmaps/"
74
81
  }
75
82
  },
76
83
  data: function() {
@@ -104,7 +111,6 @@ export default {
104
111
  @import "~element-ui/packages/theme-chalk/src/button";
105
112
  @import "~element-ui/packages/theme-chalk/src/container";
106
113
  @import "~element-ui/packages/theme-chalk/src/header";
107
- @import "~element-ui/packages/theme-chalk/src/icon";
108
114
  @import "~element-ui/packages/theme-chalk/src/main";
109
115
 
110
116
  .tooltip-container {
package/vue.config.js CHANGED
@@ -6,6 +6,20 @@ module.exports = {
6
6
  config.externals = [nodeExternals({}) ];
7
7
  }
8
8
  },
9
+ chainWebpack: config => {
10
+ const fontsRule = config.module.rule('fonts')
11
+ fontsRule.uses.clear()
12
+ config.module
13
+ .rule('fonts')
14
+ .test(/\.(ttf|otf|eot|woff|woff2)$/)
15
+ .use('base64-inline-loader')
16
+ .loader('base64-inline-loader')
17
+ .tap(options => {
18
+ // modify the options...
19
+ return options
20
+ })
21
+ .end()
22
+ },
9
23
  css: {
10
24
  //Import variables into all stylesheets.
11
25
  loaderOptions: {