@abi-software/flatmapvuer 0.6.3-vue.3.9 → 1.0.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.
Files changed (38) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +120 -120
  3. package/cypress.config.js +23 -23
  4. package/dist/flatmapvuer.js +15894 -16259
  5. package/dist/flatmapvuer.umd.cjs +132 -145
  6. package/dist/index.html +17 -17
  7. package/dist/style.css +1 -1
  8. package/package.json +95 -95
  9. package/public/index.html +17 -17
  10. package/reporter-config.json +9 -9
  11. package/src/App.vue +310 -310
  12. package/src/assets/_variables.scss +43 -43
  13. package/src/assets/styles.scss +5 -5
  14. package/src/components/AnnotationTool.vue +450 -446
  15. package/src/components/EventBus.js +3 -3
  16. package/src/components/ExternalResourceCard.vue +107 -107
  17. package/src/components/FlatmapVuer.vue +2600 -2531
  18. package/src/components/MultiFlatmapVuer.vue +731 -731
  19. package/src/components/ProvenancePopup.vue +503 -495
  20. package/src/components/SelectionsGroup.vue +255 -255
  21. package/src/components/Tooltip.vue +50 -50
  22. package/src/components/TreeControls.vue +231 -231
  23. package/src/components/index.js +7 -7
  24. package/src/components/legends/DynamicLegends.vue +106 -106
  25. package/src/components/legends/SvgLegends.vue +112 -112
  26. package/src/icons/flatmap-marker.js +1 -1
  27. package/src/icons/fonts/mapicon-species.svg +14 -14
  28. package/src/icons/fonts/mapicon-species.ttf +0 -0
  29. package/src/icons/fonts/mapicon-species.woff +0 -0
  30. package/src/icons/mapicon-species-style.css +42 -42
  31. package/src/icons/yellowstar.js +5 -5
  32. package/src/legends/legend.svg +25 -25
  33. package/src/main.js +19 -19
  34. package/src/services/flatmapQueries.js +453 -453
  35. package/src/store/index.js +23 -23
  36. package/vite.config.js +73 -73
  37. package/vite.static-build.js +12 -12
  38. package/vuese-generator.js +64 -64
package/src/App.vue CHANGED
@@ -1,310 +1,310 @@
1
- <template>
2
- <div id="app">
3
- <el-popover
4
- placement="bottom"
5
- trigger="click"
6
- width="500"
7
- class="popover"
8
- :teleported="false"
9
- >
10
- <div class="options-container">
11
- <el-row :gutter="20">
12
- <el-col :span="8">
13
- <el-button @click="helpMode = !helpMode" size="small"
14
- >Help Mode</el-button
15
- >
16
- </el-col>
17
- <el-col :span="8">
18
- <el-button @click="saveSettings()" size="small"
19
- >Save Settings</el-button
20
- >
21
- </el-col>
22
- <el-col :span="8">
23
- <el-button
24
- :disabled="mapSettings.length === 0"
25
- @click="restoreSettings()"
26
- size="small"
27
- >Restore Settings</el-button
28
- >
29
- </el-col>
30
- </el-row>
31
- <el-row>
32
- <el-col>
33
- <el-switch
34
- v-model="disableUI"
35
- active-text="Disable UI"
36
- >
37
- </el-switch>
38
- </el-col>
39
- </el-row>
40
- <el-row>
41
- <el-col>
42
- <el-autocomplete
43
- class="search-box"
44
- placeholder="Search"
45
- v-model="searchText"
46
- :fetch-suggestions="fetchSuggestions"
47
- @keyup.enter="search"
48
- @select="search"
49
- popper-class="autocomplete-popper"
50
- :teleported="false"
51
- >
52
- </el-autocomplete>
53
- </el-col>
54
- </el-row>
55
- </div>
56
- <template #reference>
57
- <el-button class="options-button" :icon="ElIconSetting"
58
- >Options</el-button>
59
- </template>
60
- </el-popover>
61
-
62
- <MultiFlatmapVuer
63
- ref="multi"
64
- :availableSpecies="availableSpecies"
65
- @resource-selected="FlatmapSelected"
66
- :minZoom="minZoom"
67
- @pan-zoom-callback="panZoomcallback"
68
- @open-map="openMap"
69
- @ready="FlatmapReady"
70
- :initial="initial"
71
- :helpMode="helpMode"
72
- :displayMinimap="true"
73
- :enableOpenMapUI="true"
74
- :flatmapAPI="flatmapAPI"
75
- :disableUI="disableUI"
76
- />
77
- </div>
78
- </template>
79
-
80
- <script>
81
- import { shallowRef } from 'vue';
82
- import { Setting as ElIconSetting } from '@element-plus/icons-vue'
83
- /* eslint-disable no-alert, no-console */
84
- import MultiFlatmapVuer from './components/MultiFlatmapVuer.vue'
85
- import {
86
- ElAutocomplete as Autocomplete,
87
- ElButton as Button,
88
- ElCol as Col,
89
- ElPopover as Popover,
90
- ElRow as Row,
91
- } from 'element-plus'
92
- import './icons/mapicon-species-style.css'
93
-
94
- export default {
95
- name: 'app',
96
- components: {
97
- Autocomplete,
98
- Button,
99
- Col,
100
- ElIconSetting,
101
- Popover,
102
- Row,
103
- },
104
- methods: {
105
- saveSettings: function () {
106
- this.mapSettings.push(this.$refs.multi.getState())
107
- },
108
- restoreSettings: function () {
109
- if (this.mapSettings.length > 0)
110
- this.$refs.multi.setState(this.mapSettings.pop())
111
- },
112
- FlatmapSelected: function (resource) {
113
- if (resource.eventType === 'click') {
114
- console.log('resource', resource)
115
- }
116
- },
117
- FlatmapReady: function (component) {
118
- console.log(component)
119
- let taxon = component.mapImp.describes
120
- let id = component.mapImp.addMarker('UBERON:0000948')
121
- window.flatmapImp = component.mapImp
122
- component.enablePanZoomEvents(true)
123
- //component.showPathwaysDrawer(false);
124
- console.log(taxon, id)
125
- //component.searchAndShowResult("heart");
126
- },
127
- panZoomcallback: function (payload) {
128
- this.payload = payload
129
- },
130
- openMap: function (map) {
131
- console.log(map)
132
- },
133
- fetchSuggestions: function (term, cb) {
134
- if (term === '') {
135
- cb([])
136
- } else {
137
- const suggestions = []
138
- const results = this.$refs.multi
139
- .getCurrentFlatmap()
140
- .searchSuggestions(term)
141
- results.__featureIds.forEach((id) => {
142
- const annotation = this.$refs.multi
143
- .getCurrentFlatmap()
144
- .mapImp.annotation(id)
145
- if (annotation && annotation.label) suggestions.push(annotation.label)
146
- })
147
- const unique = new Set(suggestions)
148
- suggestions.length = 0
149
- for (const item of unique) {
150
- suggestions.push({ value: '"' + item + '"' })
151
- }
152
- cb(suggestions)
153
- }
154
- },
155
- search: function () {
156
- console.log(this.searchText)
157
- this.$refs.multi
158
- .getCurrentFlatmap()
159
- .searchAndShowResult(this.searchText, true)
160
- },
161
- },
162
- data: function () {
163
- return {
164
- searchText: '',
165
- disableUI: false,
166
- minZoom: 4,
167
- availableSpecies: {
168
- 'Human Female': {
169
- taxo: 'NCBITaxon:9606',
170
- biologicalSex: 'PATO:0000383',
171
- iconClass: 'mapicon-icon_human',
172
- displayWarning: true,
173
- },
174
- 'Human Male': {
175
- taxo: 'NCBITaxon:9606',
176
- biologicalSex: 'PATO:0000384',
177
- iconClass: 'mapicon-icon_human',
178
- displayWarning: true,
179
- },
180
- Rat: {
181
- taxo: 'NCBITaxon:10114',
182
- iconClass: 'mapicon-icon_rat',
183
- displayWarning: true,
184
- displayLatestChanges: true,
185
- },
186
- 'Rat (NPO)': {
187
- taxo: 'NCBITaxon:10116',
188
- iconClass: 'mapicon-icon_rat',
189
- displayWarning: true,
190
- displayLatestChanges: true,
191
- },
192
- Mouse: {
193
- taxo: 'NCBITaxon:10090',
194
- iconClass: 'mapicon-icon_mouse',
195
- displayWarning: true,
196
- },
197
- Kember: { taxo: 'ABI:1000001', displayWarning: true },
198
- Pig: {
199
- taxo: 'NCBITaxon:9823',
200
- iconClass: 'mapicon-icon_pig',
201
- displayWarning: true,
202
- },
203
- Cat: {
204
- taxo: 'NCBITaxon:9685',
205
- iconClass: 'mapicon-icon_cat',
206
- displayWarning: true,
207
- },
208
- Sample: { taxo: 'NCBITaxon:1', displayWarning: true },
209
- 'Functional Connectivity': {
210
- taxo: 'FunctionalConnectivity',
211
- displayWarning: true,
212
- },
213
- },
214
- tooltipContent: undefined,
215
- tStyle: {
216
- top: '200px',
217
- left: '200px',
218
- position: 'absolute',
219
- },
220
- displayCloseButton: false,
221
- initial: 'Rat (NPO)',
222
- helpMode: false,
223
- mapSettings: [],
224
- //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/"
225
- //flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/"
226
- //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v3/"
227
- flatmapAPI: 'https://mapcore-demo.org/devel/flatmap/v4/',
228
- //flatmapAPI: "https://mapcore-demo.org/fccb/flatmap/"
229
- //flatmapAPI: "https://mapcore-demo.org/staging/flatmap/v1/"
230
- // flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v1/",
231
- ElIconSetting: shallowRef(ElIconSetting)
232
- }
233
- },
234
- components: {
235
- MultiFlatmapVuer,
236
- },
237
- }
238
- </script>
239
-
240
- <style lang="scss">
241
- #app {
242
- font-family: 'Asap', 'Avenir', Helvetica, Arial, sans-serif;
243
- -webkit-font-smoothing: antialiased;
244
- -moz-osx-font-smoothing: grayscale;
245
- text-align: center;
246
- color: #2c3e50;
247
- height: 100%;
248
- width: 100%;
249
- position: absolute;
250
- }
251
-
252
- .maplibregl-ctrl-top-left .maplibregl-ctrl {
253
- margin-top: 120px;
254
- }
255
-
256
- .search-box {
257
- margin-top: 2px;
258
- height: 28px;
259
- :deep(.el-input__inner) {
260
- background-color: $background;
261
- height: 28px;
262
- line-height: 28px;
263
- border: 1px solid rgb(144, 147, 153);
264
- border-radius: 4px;
265
- &:focus {
266
- border-color: $app-primary-color;
267
- }
268
- }
269
- }
270
-
271
- :deep(.autocomplete-popper) {
272
- min-width: 137px !important;
273
- width: auto !important;
274
- }
275
-
276
- body {
277
- margin: 0px;
278
- }
279
-
280
- .maplibregl-ctrl-top-left .maplibregl-ctrl {
281
- margin-top: 120px;
282
- }
283
-
284
- .popover {
285
- top: 5px;
286
- right: calc(50% - 20px);
287
- position: absolute;
288
- z-index: 1000;
289
- }
290
-
291
- .el-row {
292
- margin-bottom: 5px;
293
- &:last-child {
294
- margin-bottom: 0;
295
- }
296
- }
297
-
298
- .options-button {
299
- z-index:100;
300
- position: absolute;
301
- }
302
-
303
- .options-container {
304
- text-align: center;
305
- }
306
-
307
- .el-tabs__content {
308
- height: 100%;
309
- }
310
- </style>
1
+ <template>
2
+ <div id="app">
3
+ <el-popover
4
+ placement="bottom"
5
+ trigger="click"
6
+ width="500"
7
+ class="popover"
8
+ :teleported="false"
9
+ >
10
+ <div class="options-container">
11
+ <el-row :gutter="20">
12
+ <el-col :span="8">
13
+ <el-button @click="helpMode = !helpMode" size="small"
14
+ >Help Mode</el-button
15
+ >
16
+ </el-col>
17
+ <el-col :span="8">
18
+ <el-button @click="saveSettings()" size="small"
19
+ >Save Settings</el-button
20
+ >
21
+ </el-col>
22
+ <el-col :span="8">
23
+ <el-button
24
+ :disabled="mapSettings.length === 0"
25
+ @click="restoreSettings()"
26
+ size="small"
27
+ >Restore Settings</el-button
28
+ >
29
+ </el-col>
30
+ </el-row>
31
+ <el-row>
32
+ <el-col>
33
+ <el-switch
34
+ v-model="disableUI"
35
+ active-text="Disable UI"
36
+ >
37
+ </el-switch>
38
+ </el-col>
39
+ </el-row>
40
+ <el-row>
41
+ <el-col>
42
+ <el-autocomplete
43
+ class="search-box"
44
+ placeholder="Search"
45
+ v-model="searchText"
46
+ :fetch-suggestions="fetchSuggestions"
47
+ @keyup.enter="search"
48
+ @select="search"
49
+ popper-class="autocomplete-popper"
50
+ :teleported="false"
51
+ >
52
+ </el-autocomplete>
53
+ </el-col>
54
+ </el-row>
55
+ </div>
56
+ <template #reference>
57
+ <el-button class="options-button" :icon="ElIconSetting"
58
+ >Options</el-button>
59
+ </template>
60
+ </el-popover>
61
+
62
+ <MultiFlatmapVuer
63
+ ref="multi"
64
+ :availableSpecies="availableSpecies"
65
+ @resource-selected="FlatmapSelected"
66
+ :minZoom="minZoom"
67
+ @pan-zoom-callback="panZoomcallback"
68
+ @open-map="openMap"
69
+ @ready="FlatmapReady"
70
+ :initial="initial"
71
+ :helpMode="helpMode"
72
+ :displayMinimap="true"
73
+ :enableOpenMapUI="true"
74
+ :flatmapAPI="flatmapAPI"
75
+ :disableUI="disableUI"
76
+ />
77
+ </div>
78
+ </template>
79
+
80
+ <script>
81
+ import { shallowRef } from 'vue';
82
+ import { Setting as ElIconSetting } from '@element-plus/icons-vue'
83
+ /* eslint-disable no-alert, no-console */
84
+ import MultiFlatmapVuer from './components/MultiFlatmapVuer.vue'
85
+ import {
86
+ ElAutocomplete as Autocomplete,
87
+ ElButton as Button,
88
+ ElCol as Col,
89
+ ElPopover as Popover,
90
+ ElRow as Row,
91
+ } from 'element-plus'
92
+ import './icons/mapicon-species-style.css'
93
+
94
+ export default {
95
+ name: 'app',
96
+ components: {
97
+ Autocomplete,
98
+ Button,
99
+ Col,
100
+ ElIconSetting,
101
+ Popover,
102
+ Row,
103
+ },
104
+ methods: {
105
+ saveSettings: function () {
106
+ this.mapSettings.push(this.$refs.multi.getState())
107
+ },
108
+ restoreSettings: function () {
109
+ if (this.mapSettings.length > 0)
110
+ this.$refs.multi.setState(this.mapSettings.pop())
111
+ },
112
+ FlatmapSelected: function (resource) {
113
+ if (resource.eventType === 'click') {
114
+ console.log('resource', resource)
115
+ }
116
+ },
117
+ FlatmapReady: function (component) {
118
+ console.log(component)
119
+ let taxon = component.mapImp.describes
120
+ let id = component.mapImp.addMarker('UBERON:0000948')
121
+ window.flatmapImp = component.mapImp
122
+ component.enablePanZoomEvents(true)
123
+ //component.showPathwaysDrawer(false);
124
+ console.log(taxon, id)
125
+ //component.searchAndShowResult("heart");
126
+ },
127
+ panZoomcallback: function (payload) {
128
+ this.payload = payload
129
+ },
130
+ openMap: function (map) {
131
+ console.log(map)
132
+ },
133
+ fetchSuggestions: function (term, cb) {
134
+ if (term === '') {
135
+ cb([])
136
+ } else {
137
+ const suggestions = []
138
+ const results = this.$refs.multi
139
+ .getCurrentFlatmap()
140
+ .searchSuggestions(term)
141
+ results.__featureIds.forEach((id) => {
142
+ const annotation = this.$refs.multi
143
+ .getCurrentFlatmap()
144
+ .mapImp.annotation(id)
145
+ if (annotation && annotation.label) suggestions.push(annotation.label)
146
+ })
147
+ const unique = new Set(suggestions)
148
+ suggestions.length = 0
149
+ for (const item of unique) {
150
+ suggestions.push({ value: '"' + item + '"' })
151
+ }
152
+ cb(suggestions)
153
+ }
154
+ },
155
+ search: function () {
156
+ console.log(this.searchText)
157
+ this.$refs.multi
158
+ .getCurrentFlatmap()
159
+ .searchAndShowResult(this.searchText, true)
160
+ },
161
+ },
162
+ data: function () {
163
+ return {
164
+ searchText: '',
165
+ disableUI: false,
166
+ minZoom: 4,
167
+ availableSpecies: {
168
+ 'Human Female': {
169
+ taxo: 'NCBITaxon:9606',
170
+ biologicalSex: 'PATO:0000383',
171
+ iconClass: 'mapicon-icon_human',
172
+ displayWarning: true,
173
+ },
174
+ 'Human Male': {
175
+ taxo: 'NCBITaxon:9606',
176
+ biologicalSex: 'PATO:0000384',
177
+ iconClass: 'mapicon-icon_human',
178
+ displayWarning: true,
179
+ },
180
+ Rat: {
181
+ taxo: 'NCBITaxon:10114',
182
+ iconClass: 'mapicon-icon_rat',
183
+ displayWarning: true,
184
+ displayLatestChanges: true,
185
+ },
186
+ 'Rat (NPO)': {
187
+ taxo: 'NCBITaxon:10116',
188
+ iconClass: 'mapicon-icon_rat',
189
+ displayWarning: true,
190
+ displayLatestChanges: true,
191
+ },
192
+ Mouse: {
193
+ taxo: 'NCBITaxon:10090',
194
+ iconClass: 'mapicon-icon_mouse',
195
+ displayWarning: true,
196
+ },
197
+ Kember: { taxo: 'ABI:1000001', displayWarning: true },
198
+ Pig: {
199
+ taxo: 'NCBITaxon:9823',
200
+ iconClass: 'mapicon-icon_pig',
201
+ displayWarning: true,
202
+ },
203
+ Cat: {
204
+ taxo: 'NCBITaxon:9685',
205
+ iconClass: 'mapicon-icon_cat',
206
+ displayWarning: true,
207
+ },
208
+ Sample: { taxo: 'NCBITaxon:1', displayWarning: true },
209
+ 'Functional Connectivity': {
210
+ taxo: 'FunctionalConnectivity',
211
+ displayWarning: true,
212
+ },
213
+ },
214
+ tooltipContent: undefined,
215
+ tStyle: {
216
+ top: '200px',
217
+ left: '200px',
218
+ position: 'absolute',
219
+ },
220
+ displayCloseButton: false,
221
+ initial: 'Rat (NPO)',
222
+ helpMode: false,
223
+ mapSettings: [],
224
+ //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/"
225
+ //flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/"
226
+ //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v3/"
227
+ flatmapAPI: 'https://mapcore-demo.org/devel/flatmap/v4/',
228
+ //flatmapAPI: "https://mapcore-demo.org/fccb/flatmap/"
229
+ //flatmapAPI: "https://mapcore-demo.org/staging/flatmap/v1/"
230
+ // flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v1/",
231
+ ElIconSetting: shallowRef(ElIconSetting)
232
+ }
233
+ },
234
+ components: {
235
+ MultiFlatmapVuer,
236
+ },
237
+ }
238
+ </script>
239
+
240
+ <style lang="scss">
241
+ #app {
242
+ font-family: 'Asap', 'Avenir', Helvetica, Arial, sans-serif;
243
+ -webkit-font-smoothing: antialiased;
244
+ -moz-osx-font-smoothing: grayscale;
245
+ text-align: center;
246
+ color: #2c3e50;
247
+ height: 100%;
248
+ width: 100%;
249
+ position: absolute;
250
+ }
251
+
252
+ .maplibregl-ctrl-top-left .maplibregl-ctrl {
253
+ margin-top: 120px;
254
+ }
255
+
256
+ .search-box {
257
+ margin-top: 2px;
258
+ height: 28px;
259
+ :deep(.el-input__inner) {
260
+ background-color: $background;
261
+ height: 28px;
262
+ line-height: 28px;
263
+ border: 1px solid rgb(144, 147, 153);
264
+ border-radius: 4px;
265
+ &:focus {
266
+ border-color: $app-primary-color;
267
+ }
268
+ }
269
+ }
270
+
271
+ :deep(.autocomplete-popper) {
272
+ min-width: 137px !important;
273
+ width: auto !important;
274
+ }
275
+
276
+ body {
277
+ margin: 0px;
278
+ }
279
+
280
+ .maplibregl-ctrl-top-left .maplibregl-ctrl {
281
+ margin-top: 120px;
282
+ }
283
+
284
+ .popover {
285
+ top: 5px;
286
+ right: calc(50% - 20px);
287
+ position: absolute;
288
+ z-index: 1000;
289
+ }
290
+
291
+ .el-row {
292
+ margin-bottom: 5px;
293
+ &:last-child {
294
+ margin-bottom: 0;
295
+ }
296
+ }
297
+
298
+ .options-button {
299
+ z-index:100;
300
+ position: absolute;
301
+ }
302
+
303
+ .options-container {
304
+ text-align: center;
305
+ }
306
+
307
+ .el-tabs__content {
308
+ height: 100%;
309
+ }
310
+ </style>