@abi-software/flatmapvuer 0.4.2 → 0.4.4

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,72 +1,72 @@
1
- {
2
- "name": "@abi-software/flatmapvuer",
3
- "version": "0.4.2",
4
- "license": "Apache-2.0",
5
- "main": "./dist/flatmapvuer.common.js",
6
- "files": [
7
- "dist/*",
8
- "src/*",
9
- "public/*",
10
- "*.json",
11
- "*.js"
12
- ],
13
- "repository": {
14
- "type": "git",
15
- "url": "https://github.com/ABI-Software/flatmapvuer.git"
16
- },
17
- "scripts": {
18
- "start": "vue-cli-service serve",
19
- "serve": "vue-cli-service serve --port 8082",
20
- "build": "vue-cli-service build --dest test_html --mode staging",
21
- "build-bundle": "vue-cli-service build --target lib --name flatmapvuer ./src/components/index.js",
22
- "lint": "vue-cli-service lint"
23
- },
24
- "dependencies": {
25
- "@abi-software/flatmap-viewer": "^2.3.3-b.4",
26
- "@abi-software/svg-sprite": "^0.1.14",
27
- "core-js": "^3.3.2",
28
- "css-element-queries": "^1.2.2",
29
- "current-script-polyfill": "^1.0.0",
30
- "element-ui": "^2.13.0",
31
- "file-loader": "^5.0.2",
32
- "lodash": "^4.17.21",
33
- "vue": "^2.6.10"
34
- },
35
- "devDependencies": {
36
- "@vue/cli-plugin-babel": "^4.0.0",
37
- "@vue/cli-plugin-eslint": "^4.0.0",
38
- "@vue/cli-service": "^4.5.13",
39
- "babel-eslint": "^10.0.3",
40
- "babel-plugin-component": "^1.1.1",
41
- "base64-inline-loader": "^2.0.1",
42
- "eslint": "^5.16.0",
43
- "eslint-plugin-vue": "^5.0.0",
44
- "node-sass": "^4.14.1",
45
- "sass-loader": "^8.0.2",
46
- "vue-template-compiler": "^2.6.10",
47
- "webpack-node-externals": "^2.5.2"
48
- },
49
- "eslintConfig": {
50
- "root": true,
51
- "env": {
52
- "node": true
53
- },
54
- "extends": [
55
- "plugin:vue/essential",
56
- "eslint:recommended"
57
- ],
58
- "rules": {},
59
- "parserOptions": {
60
- "parser": "babel-eslint"
61
- }
62
- },
63
- "postcss": {
64
- "plugins": {
65
- "autoprefixer": {}
66
- }
67
- },
68
- "browserslist": [
69
- "> 1%",
70
- "last 2 versions"
71
- ]
72
- }
1
+ {
2
+ "name": "@abi-software/flatmapvuer",
3
+ "version": "0.4.4",
4
+ "license": "Apache-2.0",
5
+ "main": "./dist/flatmapvuer.common.js",
6
+ "files": [
7
+ "dist/*",
8
+ "src/*",
9
+ "public/*",
10
+ "*.json",
11
+ "*.js"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/ABI-Software/flatmapvuer.git"
16
+ },
17
+ "scripts": {
18
+ "start": "vue-cli-service serve",
19
+ "serve": "vue-cli-service serve --port 8082",
20
+ "build": "vue-cli-service build --dest test_html --mode staging",
21
+ "build-bundle": "vue-cli-service build --target lib --name flatmapvuer ./src/components/index.js",
22
+ "lint": "vue-cli-service lint"
23
+ },
24
+ "dependencies": {
25
+ "@abi-software/flatmap-viewer": "^2.3.3-b.4",
26
+ "@abi-software/svg-sprite": "^0.1.14",
27
+ "core-js": "^3.3.2",
28
+ "css-element-queries": "^1.2.2",
29
+ "current-script-polyfill": "^1.0.0",
30
+ "element-ui": "^2.13.0",
31
+ "file-loader": "^5.0.2",
32
+ "lodash": "^4.17.21",
33
+ "vue": "^2.6.10"
34
+ },
35
+ "devDependencies": {
36
+ "@vue/cli-plugin-babel": "^4.0.0",
37
+ "@vue/cli-plugin-eslint": "^4.0.0",
38
+ "@vue/cli-service": "^4.5.13",
39
+ "babel-eslint": "^10.0.3",
40
+ "babel-plugin-component": "^1.1.1",
41
+ "base64-inline-loader": "^2.0.1",
42
+ "eslint": "^5.16.0",
43
+ "eslint-plugin-vue": "^5.0.0",
44
+ "node-sass": "^4.14.1",
45
+ "sass-loader": "^8.0.2",
46
+ "vue-template-compiler": "^2.6.10",
47
+ "webpack-node-externals": "^2.5.2"
48
+ },
49
+ "eslintConfig": {
50
+ "root": true,
51
+ "env": {
52
+ "node": true
53
+ },
54
+ "extends": [
55
+ "plugin:vue/essential",
56
+ "eslint:recommended"
57
+ ],
58
+ "rules": {},
59
+ "parserOptions": {
60
+ "parser": "babel-eslint"
61
+ }
62
+ },
63
+ "postcss": {
64
+ "plugins": {
65
+ "autoprefixer": {}
66
+ }
67
+ },
68
+ "browserslist": [
69
+ "> 1%",
70
+ "last 2 versions"
71
+ ]
72
+ }
package/public/index.html CHANGED
@@ -1,17 +1,17 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
- <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
- <title>flatmapvuer</title>
9
- </head>
10
- <body>
11
- <noscript>
12
- <strong>We're sorry but scaffoldvuer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13
- </noscript>
14
- <div id="app"></div>
15
- <!-- built files will be auto injected -->
16
- </body>
17
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
+ <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
+ <title>flatmapvuer</title>
9
+ </head>
10
+ <body>
11
+ <noscript>
12
+ <strong>We're sorry but scaffoldvuer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13
+ </noscript>
14
+ <div id="app"></div>
15
+ <!-- built files will be auto injected -->
16
+ </body>
17
+ </html>
package/src/App.vue CHANGED
@@ -1,221 +1,221 @@
1
- <template>
2
- <div id="app">
3
- <el-popover
4
- placement="bottom"
5
- trigger="click"
6
- width=500
7
- class="popover"
8
- :appendToBody=false
9
- >
10
- <div class="options-container">
11
- <el-row :gutter="20">
12
- <el-button @click="helpMode = !helpMode" size="mini">Help Mode</el-button>
13
- <el-button @click="saveSettings()" size="mini">Save Settings</el-button>
14
- <el-button :disabled="mapSettings.length === 0" @click="restoreSettings()" size="mini">Restore Settings</el-button>
15
- <el-autocomplete class="search-box" placeholder="Search"
16
- v-model="searchText"
17
- :fetch-suggestions="fetchSuggestions"
18
- @keyup.enter.native="search"
19
- @select="search"
20
- popper-class="autocomplete-popper">
21
- </el-autocomplete>
22
- </el-row>
23
- </div>
24
- <el-button class="options-button" icon="el-icon-setting" slot="reference">Options</el-button>
25
- </el-popover>
26
-
27
- <MultiFlatmapVuer ref="multi" :availableSpecies="availableSpecies"
28
- @resource-selected="FlatmapSelected" :minZoom="minZoom"
29
- @pan-zoom-callback="panZoomcallback"
30
- @ready="FlatmapReady" :featureInfo="featureInfo" :searchable="searchable"
31
- :layerControl="layerControl"
32
- :initial="initial" :pathControls="pathControls" :helpMode="helpMode"
33
- :displayMinimap="true" :flatmapAPI="flatmapAPI"/>
34
- </div>
35
- </template>
36
-
37
- <script>
38
- /* eslint-disable no-alert, no-console */
39
- import Vue from "vue";
40
- import MultiFlatmapVuer from './components/MultiFlatmapVuer.vue'
41
- import {
42
- Autocomplete,
43
- Button,
44
- Col,
45
- Popover,
46
- Row,
47
- } from 'element-ui';
48
- import "./icons/mapicon-species-style.css";
49
- Vue.use(Autocomplete);
50
- Vue.use(Button);
51
- Vue.use(Col);
52
- Vue.use(Popover);
53
- Vue.use(Row);
54
-
55
- export default {
56
- name: 'app',
57
- methods: {
58
- saveSettings: function() {
59
- this.mapSettings.push(this.$refs.multi.getState());
60
- },
61
- restoreSettings: function() {
62
- if (this.mapSettings.length > 0)
63
- this.$refs.multi.setState(this.mapSettings.pop());
64
- },
65
- FlatmapSelected: function(resource) {
66
- if (resource.eventType === "click") {
67
- console.log('resource', resource);
68
- }
69
- },
70
- FlatmapReady: function(component) {
71
- console.log(component);
72
- let taxon = component.mapImp.describes;
73
- let id = component.mapImp.addMarker("UBERON:0000948");
74
- component.enablePanZoomEvents(true);
75
- //component.showPathwaysDrawer(false);
76
- console.log(taxon, id);
77
- //component.searchAndShowResult("heart");
78
- },
79
- panZoomcallback: function(payload) {
80
- this.payload = payload
81
- },
82
- fetchSuggestions: function(term, cb) {
83
- if (term === "") {
84
- cb([]);
85
- } else {
86
- const suggestions = [];
87
- const results = this.$refs.multi.getCurrentFlatmap().searchSuggestions(term);
88
- results.__featureIds.forEach(id => {
89
- const annotation = this.$refs.multi.getCurrentFlatmap().mapImp.annotation(id);
90
- if (annotation && annotation.label)
91
- suggestions.push(annotation.label);
92
- });
93
- const unique = new Set(suggestions);
94
- suggestions.length = 0;
95
- for (const item of unique) {
96
- suggestions.push({"value": "\"" + item +"\""});
97
- }
98
- cb(suggestions);
99
- }
100
- },
101
- search: function() {
102
- console.log(this.searchText)
103
- this.$refs.multi.getCurrentFlatmap().searchAndShowResult(this.searchText, true);
104
- }
105
- },
106
- data: function(){
107
- return {
108
- searchText: "",
109
- featureInfo: true,
110
- searchable: true,
111
- pathControls: true,
112
- layerControl: true,
113
- minZoom: 4,
114
- availableSpecies : {
115
- "Human Female":{taxo: "NCBITaxon:9606", biologicalSex: "PATO:0000383", iconClass:"mapicon-icon_human", displayWarning:true},
116
- "Human Male":{taxo: "NCBITaxon:9606", biologicalSex: "PATO:0000384", iconClass:"mapicon-icon_human", displayWarning:true},
117
- "Rat":{taxo: "NCBITaxon:10114", iconClass:"mapicon-icon_rat", displayWarning:false, displayLatestChanges:true},
118
- "Mouse":{taxo: "NCBITaxon:10090", iconClass:"mapicon-icon_mouse", displayWarning:true},
119
- "Kember":{taxo: "ABI:1000001", displayWarning:true},
120
- "Pig":{taxo: "NCBITaxon:9823", iconClass:"mapicon-icon_pig", displayWarning:true},
121
- "Cat":{taxo: "NCBITaxon:9685", iconClass:"mapicon-icon_cat", displayWarning:true},
122
- "Functional Connectivity": {taxo: "FunctionalConnectivity", displayWarning:true},
123
- },
124
- tooltipContent: undefined,
125
- tStyle: {
126
- top: "200px",
127
- left: "200px",
128
- position: "absolute"
129
- },
130
- displayCloseButton: false,
131
- initial: "Rat",
132
- helpMode: false,
133
- mapSettings: [],
134
- //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/"
135
- //flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/"
136
- //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v3/"
137
- flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v4/"
138
- //flatmapAPI: "https://mapcore-demo.org/staging/flatmap/v1/"
139
- // flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v1/"
140
- }
141
- },
142
- components: {
143
- MultiFlatmapVuer,
144
- }
145
- }
146
- </script>
147
-
148
- <style lang="scss">
149
- @import "~element-ui/packages/theme-chalk/src/autocomplete";
150
- @import "~element-ui/packages/theme-chalk/src/button";
151
- @import "~element-ui/packages/theme-chalk/src/col";
152
- @import "~element-ui/packages/theme-chalk/src/popover";
153
- @import "~element-ui/packages/theme-chalk/src/row";
154
-
155
- #app {
156
- font-family: 'Asap', 'Avenir', Helvetica, Arial, sans-serif;
157
- -webkit-font-smoothing: antialiased;
158
- -moz-osx-font-smoothing: grayscale;
159
- text-align: center;
160
- color: #2c3e50;
161
- height:100%;
162
- width: 100%;
163
- position:absolute;
164
- }
165
-
166
- .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
167
- margin-top:120px;
168
- }
169
-
170
- .search-box {
171
- margin-top: 2px;
172
- height:28px;
173
- ::v-deep .el-input__inner {
174
- background-color: $background;
175
- height:28px;
176
- line-height:28px;
177
- border: 1px solid rgb(144, 147, 153);
178
- border-radius: 4px;
179
- &:focus {
180
- border-color: $app-primary-color;
181
- }
182
- }
183
- }
184
-
185
- ::v-deep .autocomplete-popper {
186
- min-width:137px!important;
187
- width: auto!important;
188
- }
189
-
190
- body {
191
- margin: 0px;
192
- }
193
-
194
- .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
195
- margin-top:120px;
196
- }
197
-
198
- .popover{
199
- top:5px;
200
- right:calc( 50% - 20px);
201
- position:absolute;
202
- z-index:1000;
203
- }
204
-
205
- .el-row {
206
- margin-bottom: 5px;
207
- &:last-child {
208
- margin-bottom: 0;
209
- }
210
- }
211
-
212
- .options-container{
213
-
214
- text-align: center;
215
- }
216
-
217
- .el-tabs__content {
218
- height:100%;
219
- }
220
-
221
- </style>
1
+ <template>
2
+ <div id="app">
3
+ <el-popover
4
+ placement="bottom"
5
+ trigger="click"
6
+ width=500
7
+ class="popover"
8
+ :appendToBody=false
9
+ >
10
+ <div class="options-container">
11
+ <el-row :gutter="20">
12
+ <el-button @click="helpMode = !helpMode" size="mini">Help Mode</el-button>
13
+ <el-button @click="saveSettings()" size="mini">Save Settings</el-button>
14
+ <el-button :disabled="mapSettings.length === 0" @click="restoreSettings()" size="mini">Restore Settings</el-button>
15
+ <el-autocomplete class="search-box" placeholder="Search"
16
+ v-model="searchText"
17
+ :fetch-suggestions="fetchSuggestions"
18
+ @keyup.enter.native="search"
19
+ @select="search"
20
+ popper-class="autocomplete-popper">
21
+ </el-autocomplete>
22
+ </el-row>
23
+ </div>
24
+ <el-button class="options-button" icon="el-icon-setting" slot="reference">Options</el-button>
25
+ </el-popover>
26
+
27
+ <MultiFlatmapVuer ref="multi" :availableSpecies="availableSpecies"
28
+ @resource-selected="FlatmapSelected" :minZoom="minZoom"
29
+ @pan-zoom-callback="panZoomcallback"
30
+ @ready="FlatmapReady" :featureInfo="featureInfo" :searchable="searchable"
31
+ :layerControl="layerControl"
32
+ :initial="initial" :pathControls="pathControls" :helpMode="helpMode"
33
+ :displayMinimap="true" :flatmapAPI="flatmapAPI"/>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ /* eslint-disable no-alert, no-console */
39
+ import Vue from "vue";
40
+ import MultiFlatmapVuer from './components/MultiFlatmapVuer.vue'
41
+ import {
42
+ Autocomplete,
43
+ Button,
44
+ Col,
45
+ Popover,
46
+ Row,
47
+ } from 'element-ui';
48
+ import "./icons/mapicon-species-style.css";
49
+ Vue.use(Autocomplete);
50
+ Vue.use(Button);
51
+ Vue.use(Col);
52
+ Vue.use(Popover);
53
+ Vue.use(Row);
54
+
55
+ export default {
56
+ name: 'app',
57
+ methods: {
58
+ saveSettings: function() {
59
+ this.mapSettings.push(this.$refs.multi.getState());
60
+ },
61
+ restoreSettings: function() {
62
+ if (this.mapSettings.length > 0)
63
+ this.$refs.multi.setState(this.mapSettings.pop());
64
+ },
65
+ FlatmapSelected: function(resource) {
66
+ if (resource.eventType === "click") {
67
+ console.log('resource', resource);
68
+ }
69
+ },
70
+ FlatmapReady: function(component) {
71
+ console.log(component);
72
+ let taxon = component.mapImp.describes;
73
+ let id = component.mapImp.addMarker("UBERON:0000948");
74
+ component.enablePanZoomEvents(true);
75
+ //component.showPathwaysDrawer(false);
76
+ console.log(taxon, id);
77
+ //component.searchAndShowResult("heart");
78
+ },
79
+ panZoomcallback: function(payload) {
80
+ this.payload = payload
81
+ },
82
+ fetchSuggestions: function(term, cb) {
83
+ if (term === "") {
84
+ cb([]);
85
+ } else {
86
+ const suggestions = [];
87
+ const results = this.$refs.multi.getCurrentFlatmap().searchSuggestions(term);
88
+ results.__featureIds.forEach(id => {
89
+ const annotation = this.$refs.multi.getCurrentFlatmap().mapImp.annotation(id);
90
+ if (annotation && annotation.label)
91
+ suggestions.push(annotation.label);
92
+ });
93
+ const unique = new Set(suggestions);
94
+ suggestions.length = 0;
95
+ for (const item of unique) {
96
+ suggestions.push({"value": "\"" + item +"\""});
97
+ }
98
+ cb(suggestions);
99
+ }
100
+ },
101
+ search: function() {
102
+ console.log(this.searchText)
103
+ this.$refs.multi.getCurrentFlatmap().searchAndShowResult(this.searchText, true);
104
+ }
105
+ },
106
+ data: function(){
107
+ return {
108
+ searchText: "",
109
+ featureInfo: true,
110
+ searchable: true,
111
+ pathControls: true,
112
+ layerControl: true,
113
+ minZoom: 4,
114
+ availableSpecies : {
115
+ "Human Female":{taxo: "NCBITaxon:9606", biologicalSex: "PATO:0000383", iconClass:"mapicon-icon_human", displayWarning:true},
116
+ "Human Male":{taxo: "NCBITaxon:9606", biologicalSex: "PATO:0000384", iconClass:"mapicon-icon_human", displayWarning:true},
117
+ "Rat":{taxo: "NCBITaxon:10114", iconClass:"mapicon-icon_rat", displayWarning:false, displayLatestChanges:true},
118
+ "Mouse":{taxo: "NCBITaxon:10090", iconClass:"mapicon-icon_mouse", displayWarning:true},
119
+ "Kember":{taxo: "ABI:1000001", displayWarning:true},
120
+ "Pig":{taxo: "NCBITaxon:9823", iconClass:"mapicon-icon_pig", displayWarning:true},
121
+ "Cat":{taxo: "NCBITaxon:9685", iconClass:"mapicon-icon_cat", displayWarning:true},
122
+ "Functional Connectivity": {taxo: "FunctionalConnectivity", displayWarning:true},
123
+ },
124
+ tooltipContent: undefined,
125
+ tStyle: {
126
+ top: "200px",
127
+ left: "200px",
128
+ position: "absolute"
129
+ },
130
+ displayCloseButton: false,
131
+ initial: "Rat",
132
+ helpMode: false,
133
+ mapSettings: [],
134
+ //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/"
135
+ //flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/"
136
+ //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v3/"
137
+ flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v4/"
138
+ //flatmapAPI: "https://mapcore-demo.org/staging/flatmap/v1/"
139
+ // flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v1/"
140
+ }
141
+ },
142
+ components: {
143
+ MultiFlatmapVuer,
144
+ }
145
+ }
146
+ </script>
147
+
148
+ <style lang="scss">
149
+ @import "~element-ui/packages/theme-chalk/src/autocomplete";
150
+ @import "~element-ui/packages/theme-chalk/src/button";
151
+ @import "~element-ui/packages/theme-chalk/src/col";
152
+ @import "~element-ui/packages/theme-chalk/src/popover";
153
+ @import "~element-ui/packages/theme-chalk/src/row";
154
+
155
+ #app {
156
+ font-family: 'Asap', 'Avenir', Helvetica, Arial, sans-serif;
157
+ -webkit-font-smoothing: antialiased;
158
+ -moz-osx-font-smoothing: grayscale;
159
+ text-align: center;
160
+ color: #2c3e50;
161
+ height:100%;
162
+ width: 100%;
163
+ position:absolute;
164
+ }
165
+
166
+ .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
167
+ margin-top:120px;
168
+ }
169
+
170
+ .search-box {
171
+ margin-top: 2px;
172
+ height:28px;
173
+ ::v-deep .el-input__inner {
174
+ background-color: $background;
175
+ height:28px;
176
+ line-height:28px;
177
+ border: 1px solid rgb(144, 147, 153);
178
+ border-radius: 4px;
179
+ &:focus {
180
+ border-color: $app-primary-color;
181
+ }
182
+ }
183
+ }
184
+
185
+ ::v-deep .autocomplete-popper {
186
+ min-width:137px!important;
187
+ width: auto!important;
188
+ }
189
+
190
+ body {
191
+ margin: 0px;
192
+ }
193
+
194
+ .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
195
+ margin-top:120px;
196
+ }
197
+
198
+ .popover{
199
+ top:5px;
200
+ right:calc( 50% - 20px);
201
+ position:absolute;
202
+ z-index:1000;
203
+ }
204
+
205
+ .el-row {
206
+ margin-bottom: 5px;
207
+ &:last-child {
208
+ margin-bottom: 0;
209
+ }
210
+ }
211
+
212
+ .options-container{
213
+
214
+ text-align: center;
215
+ }
216
+
217
+ .el-tabs__content {
218
+ height:100%;
219
+ }
220
+
221
+ </style>