@abi-software/flatmapvuer 0.5.10 → 0.6.0-vue3-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 (41) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +105 -105
  3. package/babel.config.js +0 -14
  4. package/dist/favicon.ico +0 -0
  5. package/dist/flatmapvuer.js +69542 -0
  6. package/dist/flatmapvuer.umd.cjs +1021 -0
  7. package/dist/index.html +17 -0
  8. package/dist/style.css +1 -0
  9. package/package.json +87 -79
  10. package/public/index.html +17 -17
  11. package/src/App.vue +303 -228
  12. package/src/assets/_variables.scss +43 -43
  13. package/src/assets/styles.scss +6 -7
  14. package/src/components/AnnotationTool.vue +443 -403
  15. package/src/components/EventBus.js +3 -3
  16. package/src/components/ExternalResourceCard.vue +108 -99
  17. package/src/components/FlatmapVuer.vue +2117 -2070
  18. package/src/components/MultiFlatmapVuer.vue +603 -535
  19. package/src/components/ProvenancePopup.vue +496 -422
  20. package/src/components/SelectionsGroup.vue +258 -249
  21. package/src/components/Tooltip.vue +50 -52
  22. package/src/components/TreeControls.vue +234 -231
  23. package/src/components/index.js +6 -9
  24. package/src/components/legends/DynamicLegends.vue +106 -112
  25. package/src/components/legends/SvgLegends.vue +112 -67
  26. package/src/components.d.ts +46 -0
  27. package/src/icons/flatmap-marker.js +1 -1
  28. package/src/icons/fonts/mapicon-species.eot +0 -0
  29. package/src/icons/fonts/mapicon-species.svg +14 -14
  30. package/src/icons/fonts/mapicon-species.ttf +0 -0
  31. package/src/icons/fonts/mapicon-species.woff +0 -0
  32. package/src/icons/mapicon-species-style.css +42 -42
  33. package/src/icons/yellowstar.js +5 -5
  34. package/src/legends/legend.svg +25 -25
  35. package/src/main.js +4 -8
  36. package/src/services/flatmapQueries.js +451 -415
  37. package/vite.config.js +76 -0
  38. package/vue.config.js +45 -31
  39. package/CHANGELOG.md +0 -402
  40. package/package-lock.json +0 -18473
  41. package/src/nerve-map.js +0 -99
@@ -1,249 +1,258 @@
1
- <template>
2
- <div class="selections-container">
3
- <el-row>
4
- <el-col :span="12">
5
- <div class="checkall-display-text">{{title}}</div>
6
- </el-col>
7
- <el-col :span="12">
8
- <el-checkbox
9
- v-if="selections && selections.length > 1"
10
- class="all-checkbox"
11
- :indeterminate="isIndeterminate"
12
- v-model="checkAll"
13
- @change="handleCheckAllChange"
14
- >Display all</el-checkbox>
15
- </el-col>
16
- </el-row>
17
- <el-checkbox-group
18
- v-model="checkedItems"
19
- size="small"
20
- class="checkbox-group"
21
- @change="handleCheckedItemsChange"
22
- >
23
- <div class="checkbox-group-inner">
24
- <el-row v-for="item in selections" :key="item[identifierKey]" :label="item[identifierKey]">
25
- <div class="checkbox-container">
26
- <el-checkbox
27
- class="my-checkbox"
28
- :label="item[identifierKey]"
29
- @change="visibilityToggle(item[identifierKey], $event)"
30
- :checked="!('enabled' in item) || (item.enabled === true)">
31
- <el-row class="checkbox-row">
32
- <el-col :span="4">
33
- <div class="path-visual" :style="getLineStyles(item)"></div>
34
- </el-col>
35
- <el-col :span="20">
36
- <div :style="getBackgroundStyles(item)">
37
- {{item[labelKey]}}
38
- </div>
39
- </el-col>
40
- </el-row>
41
- </el-checkbox>
42
- </div>
43
- </el-row>
44
- </div>
45
- </el-checkbox-group>
46
- </div>
47
- </template>
48
-
49
- <script>
50
- /* eslint-disable no-alert, no-console */
51
- import Vue from "vue";
52
- import {
53
- Checkbox,
54
- CheckboxGroup,
55
- Col,
56
- Row
57
- } from "element-ui";
58
- import lang from "element-ui/lib/locale/lang/en";
59
- import locale from "element-ui/lib/locale";
60
-
61
- locale.use(lang);
62
- Vue.use(Checkbox);
63
- Vue.use(CheckboxGroup);
64
- Vue.use(Col);
65
- Vue.use(Row);
66
-
67
-
68
- export default {
69
- name: "SelectionsGroup",
70
- methods: {
71
- /**
72
- * Function to toggle paths to default.
73
- * Also called when the associated button is pressed.
74
- */
75
- reset: function() {
76
- this.checkAll = true;
77
- this.checkedItems = [];
78
- this.selections.forEach(item => {
79
- if (!('enabled' in item) || item.enabled === true) {
80
- this.checkedItems.push(item[this.identifierKey]);
81
- } else {
82
- this.checkAll = false;
83
- }
84
- });
85
- },
86
- visibilityToggle: function(key, value) {
87
- this.$emit("changed", {key, value});
88
- },
89
- handleCheckedItemsChange: function(value) {
90
- let checkedCount = value.length;
91
- this.checkAll = checkedCount === this.selections.length;
92
- },
93
- handleCheckAllChange: function(val) {
94
- this.checkedItems = val ? this.selections.map(a => a[this.identifierKey]) : [];
95
- this.$emit("checkAll",
96
- {
97
- keys: this.selections.map(a => a[this.identifierKey]),
98
- value: val
99
- });
100
- },
101
- getBackgroundStyles: function(item) {
102
- if ('colour' in item && this.colourStyle === "background") {
103
- return { background: item.colour };
104
- }
105
- return {};
106
- },
107
- getLineStyles: function(item) {
108
- if ('colour' in item && this.colourStyle === "line") {
109
- if (('dashed' in item) && (item.dashed === true)) {
110
- const background = `repeating-linear-gradient(90deg,${item.colour},${item.colour} 6px,transparent 0,transparent 9px)`;
111
- return { background };
112
- }
113
- else {
114
- return { background: item.colour };
115
- }
116
- }
117
- return { display: "None"};
118
- }
119
- },
120
- props: {
121
- colourStyle: {
122
- type: String,
123
- default: "line"
124
- },
125
- identifierKey: {
126
- type: String,
127
- default: "id"
128
- },
129
- labelKey: {
130
- type: String,
131
- default: "label"
132
- },
133
- title: {
134
- type: String,
135
- default: ""
136
- },
137
- selections: {
138
- type: Array,
139
- default: function() {
140
- return [];
141
- },
142
- },
143
- },
144
- computed: {
145
- isIndeterminate: function() {
146
- const count = this.checkedItems.length;
147
- if ((count === 0) || this.checkAll){
148
- return false;
149
- }
150
- return true;
151
- }
152
- },
153
- data: function() {
154
- return {
155
- checkedItems: [],
156
- checkAll: true,
157
- };
158
- },
159
- mounted: function() {
160
- this.reset();
161
- }
162
- };
163
- </script>
164
-
165
- <!-- Add "scoped" attribute to limit CSS to this component only -->
166
- <style scoped lang="scss">
167
- @import "~element-ui/packages/theme-chalk/src/checkbox";
168
- @import "~element-ui/packages/theme-chalk/src/checkbox-group";
169
- @import "~element-ui/packages/theme-chalk/src/row";
170
-
171
- .path-visual {
172
- margin: 3px 0;
173
- height: 3px;
174
- width: 25px;
175
- margin-right: 5px;
176
- display: inline-block;
177
- }
178
-
179
- .selections-container {
180
- padding-top: 5px;
181
- }
182
-
183
- .checkall-display-text {
184
- width: 59px;
185
- height: 20px;
186
- color: rgb(48, 49, 51);
187
- font-size: 14px;
188
- font-weight: normal;
189
- line-height: 20px;
190
- margin-left: 8px;
191
- white-space: nowrap;
192
- }
193
-
194
- .all-checkbox {
195
- float: right;
196
- }
197
-
198
- .checkbox-container {
199
- display: flex;
200
- cursor: pointer;
201
- }
202
-
203
- .checkbox-group {
204
- width: 260px;
205
- border: 1px solid rgb(144, 147, 153);
206
- border-radius: 4px;
207
- background: #ffffff;
208
- }
209
-
210
- .my-checkbox {
211
- background-color: #fff;
212
- width: 100%;
213
- }
214
-
215
- .checkbox-group-inner {
216
- padding: 18px;
217
- }
218
-
219
- ::v-deep .el-checkbox__label {
220
- padding-left: 5px;
221
- color: $app-primary-color;
222
- font-size: 12px;
223
- font-weight: 500;
224
- letter-spacing: 0px;
225
- line-height: 14px;
226
- width: 100%;
227
- }
228
-
229
- ::v-deep .el-checkbox__input {
230
- &.is-indeterminate,
231
- &.is-checked {
232
- .el-checkbox__inner {
233
- background-color: $app-primary-color;
234
- border-color: $app-primary-color;
235
- }
236
- }
237
- }
238
-
239
- ::v-deep .el-checkbox__label {
240
- color: $app-primary-color !important;
241
- }
242
-
243
- .checkbox-row {
244
- width: 100%;
245
- top: 2px;
246
- }
247
-
248
- </style>
249
-
1
+ <template>
2
+ <div class="selections-container">
3
+ <el-row>
4
+ <el-col :span="12">
5
+ <div class="checkall-display-text">{{ title }}</div>
6
+ </el-col>
7
+ <el-col :span="12">
8
+ <el-checkbox
9
+ v-if="selections && selections.length > 1"
10
+ class="all-checkbox"
11
+ :indeterminate="isIndeterminate"
12
+ v-model="checkAll"
13
+ @change="handleCheckAllChange"
14
+ >Display all</el-checkbox
15
+ >
16
+ </el-col>
17
+ </el-row>
18
+ <el-checkbox-group
19
+ v-model="checkedItems"
20
+ size="small"
21
+ class="checkbox-group"
22
+ @change="handleCheckedItemsChange"
23
+ >
24
+ <div class="checkbox-group-inner">
25
+ <el-row
26
+ v-for="item in selections"
27
+ :key="item[identifierKey]"
28
+ :label="item[identifierKey]"
29
+ >
30
+ <div class="checkbox-container">
31
+ <el-checkbox
32
+ class="my-checkbox"
33
+ :label="item[identifierKey]"
34
+ @change="visibilityToggle(item[identifierKey], $event)"
35
+ :checked="!('enabled' in item) || item.enabled === true"
36
+ >
37
+ <el-row class="checkbox-row">
38
+ <el-col :span="4" v-if="hasLineStyles(item)">
39
+ <div class="path-visual" :style="getLineStyles(item)"></div>
40
+ </el-col>
41
+ <el-col :span="20">
42
+ <div :style="getBackgroundStyles(item)">
43
+ {{ item[labelKey] }}
44
+ </div>
45
+ </el-col>
46
+ </el-row>
47
+ </el-checkbox>
48
+ </div>
49
+ </el-row>
50
+ </div>
51
+ </el-checkbox-group>
52
+ </div>
53
+ </template>
54
+
55
+ <script>
56
+ /* eslint-disable no-alert, no-console */
57
+ import {
58
+ ElCheckbox as Checkbox,
59
+ ElCheckboxGroup as CheckboxGroup,
60
+ ElCol as Col,
61
+ ElRow as Row,
62
+ } from 'element-plus'
63
+
64
+ export default {
65
+ name: 'SelectionsGroup',
66
+ components: {
67
+ Checkbox,
68
+ CheckboxGroup,
69
+ Col,
70
+ Row,
71
+ },
72
+ methods: {
73
+ /**
74
+ * Function to toggle paths to default.
75
+ * Also called when the associated button is pressed.
76
+ */
77
+ reset: function () {
78
+ this.checkAll = true
79
+ this.checkedItems = []
80
+ this.selections.forEach((item) => {
81
+ if (!('enabled' in item) || item.enabled === true) {
82
+ this.checkedItems.push(item[this.identifierKey])
83
+ } else {
84
+ this.checkAll = false
85
+ }
86
+ })
87
+ },
88
+ visibilityToggle: function (key, value) {
89
+ this.$emit('changed', { key, value })
90
+ },
91
+ handleCheckedItemsChange: function (value) {
92
+ let checkedCount = value.length
93
+ this.checkAll = checkedCount === this.selections.length
94
+ },
95
+ handleCheckAllChange: function (val) {
96
+ this.checkedItems = val
97
+ ? this.selections.map((a) => a[this.identifierKey])
98
+ : []
99
+ this.$emit('checkAll', {
100
+ keys: this.selections.map((a) => a[this.identifierKey]),
101
+ value: val,
102
+ })
103
+ },
104
+ getBackgroundStyles: function (item) {
105
+ if ('colour' in item && this.colourStyle === 'background') {
106
+ return { background: item.colour }
107
+ }
108
+ return {}
109
+ },
110
+ hasLineStyles: function(item) {
111
+ return 'colour' in item && this.colourStyle === 'line'
112
+ },
113
+ getLineStyles: function (item) {
114
+ if ('colour' in item && this.colourStyle === 'line') {
115
+ if ('dashed' in item && item.dashed === true) {
116
+ const background = `repeating-linear-gradient(90deg,${item.colour},${item.colour} 6px,transparent 0,transparent 9px)`
117
+ return { background }
118
+ } else {
119
+ return { background: item.colour }
120
+ }
121
+ }
122
+ return { display: 'None' }
123
+ },
124
+ },
125
+ props: {
126
+ colourStyle: {
127
+ type: String,
128
+ default: 'line',
129
+ },
130
+ identifierKey: {
131
+ type: String,
132
+ default: 'id',
133
+ },
134
+ labelKey: {
135
+ type: String,
136
+ default: 'label',
137
+ },
138
+ title: {
139
+ type: String,
140
+ default: '',
141
+ },
142
+ selections: {
143
+ type: Array,
144
+ default: function () {
145
+ return []
146
+ },
147
+ },
148
+ },
149
+ computed: {
150
+ isIndeterminate: function () {
151
+ const count = this.checkedItems.length
152
+ if (count === 0 || this.checkAll) {
153
+ return false
154
+ }
155
+ return true
156
+ },
157
+ },
158
+ data: function () {
159
+ return {
160
+ checkedItems: [],
161
+ checkAll: true,
162
+ }
163
+ },
164
+ mounted: function () {
165
+ this.reset()
166
+ },
167
+ }
168
+ </script>
169
+
170
+ <style lang="scss" scoped>
171
+ @use 'element-plus/theme-chalk/src/checkbox';
172
+ @use 'element-plus/theme-chalk/src/checkbox-group';
173
+ @use 'element-plus/theme-chalk/src/row';
174
+
175
+ .path-visual {
176
+ margin: 3px 0;
177
+ height: 3px;
178
+ width: 25px;
179
+ margin-right: 5px;
180
+ display: inline-block;
181
+ }
182
+
183
+ .selections-container {
184
+ padding-top: 5px;
185
+ }
186
+
187
+ .checkall-display-text {
188
+ width: 59px;
189
+ height: 20px;
190
+ color: rgb(48, 49, 51);
191
+ font-size: 14px;
192
+ font-weight: normal;
193
+ line-height: 20px;
194
+ margin-left: 8px;
195
+ white-space: nowrap;
196
+ }
197
+
198
+ .all-checkbox {
199
+ height:20px;
200
+ float: right;
201
+ }
202
+
203
+ .checkbox-container {
204
+ display: flex;
205
+ cursor: pointer;
206
+ width: 100%;
207
+ }
208
+
209
+ .checkbox-group {
210
+ width: 260px;
211
+ border: 1px solid rgb(144, 147, 153);
212
+ border-radius: 4px;
213
+ background: #ffffff;
214
+ }
215
+
216
+ .my-checkbox {
217
+ background-color: #fff;
218
+ width: 100%;
219
+ }
220
+
221
+ .checkbox-group-inner {
222
+ padding: 18px;
223
+ }
224
+
225
+ :deep(.el-checkbox__label) {
226
+ padding-left: 5px;
227
+ color: $app-primary-color;
228
+ font-size: 12px;
229
+ font-weight: 500;
230
+ letter-spacing: 0px;
231
+ line-height: 14px;
232
+ width: 100%;
233
+ }
234
+
235
+ :deep(.el-checkbox__input) {
236
+ &.is-indeterminate,
237
+ &.is-checked {
238
+ .el-checkbox__inner {
239
+ background-color: $app-primary-color;
240
+ border-color: $app-primary-color;
241
+ }
242
+ }
243
+ }
244
+
245
+ :deep(.el-row) {
246
+ height:20px;
247
+ margin-bottom: 0;
248
+ }
249
+
250
+ :deep(.el-checkbox__label) {
251
+ color: $app-primary-color !important;
252
+ }
253
+
254
+ .checkbox-row {
255
+ width: 100%;
256
+ top: 2px;
257
+ }
258
+ </style>
@@ -1,52 +1,50 @@
1
- <template>
2
- <div class="tooltip-container">
3
- <template v-if="annotationDisplay">
4
- <annotation-tool :annotationEntry="annotationEntry"/>
5
- </template>
6
- <template v-else>
7
- <provenance-popup :entry="entry"/>
8
- </template>
9
- </div>
10
- </template>
11
-
12
-
13
- <script>
14
- /* eslint-disable no-alert, no-console */
15
- import AnnotationTool from "./AnnotationTool";
16
- import ProvenancePopup from "./ProvenancePopup";
17
-
18
- export default {
19
- name: "Tooltip",
20
- components: {
21
- AnnotationTool,
22
- ProvenancePopup,
23
- },
24
- props: {
25
- entry: {
26
- type: Object,
27
- },
28
- annotationDisplay: {
29
- type: Boolean,
30
- default: false
31
- },
32
- annotationEntry: {
33
- type: Object,
34
- },
35
- },
36
- };
37
- </script>
38
-
39
- <style scoped lang="scss">
40
-
41
- .tooltip-container {
42
- text-align:justify;
43
- border-radius: 4px;
44
- box-shadow: 0 1px 2px rgba(0,0,0,.1);
45
- pointer-events: auto;
46
- background: #fff;
47
- border: 1px solid $app-primary-color;
48
- display: flex;
49
- justify-content: center;
50
- align-items: center;
51
- }
52
- </style>
1
+ <template>
2
+ <div class="tooltip-container">
3
+ <template v-if="annotationDisplay">
4
+ <annotation-tool :annotationEntry="annotationEntry" />
5
+ </template>
6
+ <template v-else>
7
+ <provenance-popup :entry="entry" />
8
+ </template>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ /* eslint-disable no-alert, no-console */
14
+ import AnnotationTool from './AnnotationTool.vue'
15
+ import ProvenancePopup from './ProvenancePopup.vue'
16
+
17
+ export default {
18
+ name: 'Tooltip',
19
+ components: {
20
+ AnnotationTool,
21
+ ProvenancePopup,
22
+ },
23
+ props: {
24
+ entry: {
25
+ type: Object,
26
+ },
27
+ annotationDisplay: {
28
+ type: Boolean,
29
+ default: false,
30
+ },
31
+ annotationEntry: {
32
+ type: Object,
33
+ },
34
+ },
35
+ }
36
+ </script>
37
+
38
+ <style lang="scss" scoped>
39
+ .tooltip-container {
40
+ text-align: justify;
41
+ border-radius: 4px;
42
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
43
+ pointer-events: auto;
44
+ background: #fff;
45
+ border: 1px solid $app-primary-color;
46
+ display: flex;
47
+ justify-content: center;
48
+ align-items: center;
49
+ }
50
+ </style>