@abi-software/flatmapvuer 0.6.0-vue3.8 → 0.6.1-vue3.8

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