@abi-software/flatmapvuer 1.1.0-beta.2 → 1.1.0-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.
- package/dist/flatmapvuer.js +13343 -13135
- package/dist/flatmapvuer.umd.cjs +105 -105
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/App.vue +8 -0
- package/src/components/ConnectionDialog.vue +107 -100
- package/src/components/DrawTool.vue +509 -0
- package/src/components/ExternalResourceCard.vue +2 -0
- package/src/components/FlatmapVuer.vue +241 -523
- package/src/components/MultiFlatmapVuer.vue +17 -3
- package/src/components/SelectionsGroup.vue +57 -0
- package/src/components.d.ts +1 -0
- package/src/icons/yellowstar.js +1 -1
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
content="Select a species"
|
|
7
7
|
placement="right"
|
|
8
8
|
trigger="manual"
|
|
9
|
-
popper-class="flatmap-popper right-popper"
|
|
9
|
+
popper-class="flatmap-popper flatmap-teleport-popper right-popper"
|
|
10
|
+
width="max-content"
|
|
10
11
|
:visible="helpMode"
|
|
11
12
|
:teleported="false"
|
|
12
13
|
ref="selectPopover"
|
|
@@ -62,8 +63,9 @@
|
|
|
62
63
|
* @arg $event
|
|
63
64
|
*/
|
|
64
65
|
$emit('open-map', $event)"
|
|
66
|
+
@pathway-selection-changed="onSelectionsDataChanged"
|
|
65
67
|
:minZoom="minZoom"
|
|
66
|
-
:helpMode="helpMode"
|
|
68
|
+
:helpMode="activeSpecies == key && helpMode"
|
|
67
69
|
:renderAtMounted="renderAtMounted"
|
|
68
70
|
:displayMinimap="displayMinimap"
|
|
69
71
|
:showStarInLegend="showStarInLegend"
|
|
@@ -120,6 +122,15 @@ export default {
|
|
|
120
122
|
EventBus.on('onActionClick', (action) => {
|
|
121
123
|
this.resourceSelected(action)
|
|
122
124
|
})
|
|
125
|
+
EventBus.on('open-pubmed-url', (url) => {
|
|
126
|
+
/**
|
|
127
|
+
* This event is emitted when the user clicks
|
|
128
|
+
* on "Open publications in pubmed" button
|
|
129
|
+
* from provenance popup.
|
|
130
|
+
* @arg url
|
|
131
|
+
*/
|
|
132
|
+
this.$emit('open-pubmed-url', url);
|
|
133
|
+
});
|
|
123
134
|
},
|
|
124
135
|
methods: {
|
|
125
136
|
/**
|
|
@@ -244,6 +255,9 @@ export default {
|
|
|
244
255
|
*/
|
|
245
256
|
this.$emit('pan-zoom-callback', payload)
|
|
246
257
|
},
|
|
258
|
+
onSelectionsDataChanged: function (data) {
|
|
259
|
+
this.$emit('pathway-selection-changed', data);
|
|
260
|
+
},
|
|
247
261
|
/**
|
|
248
262
|
* @vuese
|
|
249
263
|
* Function to show popup on map.
|
|
@@ -729,4 +743,4 @@ export default {
|
|
|
729
743
|
--el-color-primary: #8300BF;
|
|
730
744
|
}
|
|
731
745
|
|
|
732
|
-
</style>
|
|
746
|
+
</style>
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
:indeterminate="isIndeterminate"
|
|
12
12
|
v-model="checkAll"
|
|
13
13
|
@change="handleCheckAllChange"
|
|
14
|
+
@click="onAllCheckboxNativeChange"
|
|
14
15
|
>Display all</el-checkbox
|
|
15
16
|
>
|
|
16
17
|
</el-col>
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
class="my-checkbox"
|
|
36
37
|
:label="item[identifierKey]"
|
|
37
38
|
@change="visibilityToggle(item[identifierKey], $event)"
|
|
39
|
+
@click="onCheckboxNativeChange"
|
|
38
40
|
:checked="!('enabled' in item) || item.enabled === true"
|
|
39
41
|
>
|
|
40
42
|
<el-row class="checkbox-row">
|
|
@@ -88,8 +90,52 @@ export default {
|
|
|
88
90
|
}
|
|
89
91
|
})
|
|
90
92
|
},
|
|
93
|
+
setCheckboxActionData: function (containerEl, option) {
|
|
94
|
+
// option = 'individual' or 'all'
|
|
95
|
+
if (containerEl) {
|
|
96
|
+
const checkboxEl = containerEl.querySelector('input[type="checkbox"]');
|
|
97
|
+
const checkboxLabelEl = containerEl.querySelector('.el-checkbox__label');
|
|
98
|
+
const selectionsContainerEl = containerEl.closest('.selections-container');
|
|
99
|
+
const selectionsTitleEl = selectionsContainerEl.querySelector('.checkall-display-text');
|
|
100
|
+
|
|
101
|
+
// change true/false to checked/unchecked for readability
|
|
102
|
+
let checkedLabel = '';
|
|
103
|
+
if (checkboxEl) {
|
|
104
|
+
checkedLabel = checkboxEl.checked ? 'checked' : 'unchecked';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
this.checkboxActionData = {
|
|
108
|
+
selectionsTitle: selectionsTitleEl ? selectionsTitleEl.innerText : '',
|
|
109
|
+
property: (checkboxEl && option !== 'all') ? checkboxEl.value : '',
|
|
110
|
+
label: checkboxLabelEl ? checkboxLabelEl.innerText : '',
|
|
111
|
+
checked: checkedLabel
|
|
112
|
+
};
|
|
113
|
+
} else {
|
|
114
|
+
// reset if no checkbox container found
|
|
115
|
+
this.checkboxActionData = {
|
|
116
|
+
selectionsTitle: '',
|
|
117
|
+
property: '',
|
|
118
|
+
label: '',
|
|
119
|
+
checked: '',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
onCheckboxNativeChange: function (event) {
|
|
124
|
+
const checkboxContainerEl = event.target.closest('.checkbox-container');
|
|
125
|
+
this.setCheckboxActionData(checkboxContainerEl, 'individual');
|
|
126
|
+
},
|
|
127
|
+
onAllCheckboxNativeChange: function (event) {
|
|
128
|
+
const checkboxContainerEl = event.target.closest('.all-checkbox');
|
|
129
|
+
this.setCheckboxActionData(checkboxContainerEl, 'all');
|
|
130
|
+
},
|
|
91
131
|
visibilityToggle: function (key, value) {
|
|
92
132
|
this.$emit('changed', { key, value })
|
|
133
|
+
// emit event with checkbox data for tracking
|
|
134
|
+
if (key === this.checkboxActionData.property) {
|
|
135
|
+
// change true/false to checked/unchecked for readability
|
|
136
|
+
this.checkboxActionData.checked = value ? 'checked' : 'unchecked';
|
|
137
|
+
}
|
|
138
|
+
this.$emit('selections-data-changed', this.checkboxActionData);
|
|
93
139
|
},
|
|
94
140
|
checkboxMouseEnterEmit: function (key, value) {
|
|
95
141
|
// Update the stated to send to the emit
|
|
@@ -109,6 +155,11 @@ export default {
|
|
|
109
155
|
keys: this.selections.map((a) => a[this.identifierKey]),
|
|
110
156
|
value: val,
|
|
111
157
|
})
|
|
158
|
+
// emit event with checkbox data for tracking
|
|
159
|
+
this.checkboxActionData.property = this.identifierKey;
|
|
160
|
+
// change true/false to checked/unchecked for readability
|
|
161
|
+
this.checkboxActionData.checked = val ? 'checked' : 'unchecked';
|
|
162
|
+
this.$emit('selections-data-changed', this.checkboxActionData);
|
|
112
163
|
},
|
|
113
164
|
getBackgroundStyles: function (item) {
|
|
114
165
|
if ('colour' in item && this.colourStyle === 'background') {
|
|
@@ -168,6 +219,12 @@ export default {
|
|
|
168
219
|
return {
|
|
169
220
|
checkedItems: [],
|
|
170
221
|
checkAll: true,
|
|
222
|
+
checkboxActionData: {
|
|
223
|
+
selectionsTitle: '',
|
|
224
|
+
property: '',
|
|
225
|
+
label: '',
|
|
226
|
+
checked: '',
|
|
227
|
+
},
|
|
171
228
|
}
|
|
172
229
|
},
|
|
173
230
|
mounted: function () {
|
package/src/components.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ declare module 'vue' {
|
|
|
9
9
|
export interface GlobalComponents {
|
|
10
10
|
AnnotationTool: typeof import('./components/AnnotationTool.vue')['default']
|
|
11
11
|
ConnectionDialog: typeof import('./components/ConnectionDialog.vue')['default']
|
|
12
|
+
DrawTool: typeof import('./components/DrawTool.vue')['default']
|
|
12
13
|
DynamicLegends: typeof import('./components/legends/DynamicLegends.vue')['default']
|
|
13
14
|
ElButton: typeof import('element-plus/es')['ElButton']
|
|
14
15
|
ElCard: typeof import('element-plus/es')['ElCard']
|
package/src/icons/yellowstar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default '<svg width="195px" height="24px" viewBox="0 0 200 24" fill="yellow">' +
|
|
2
2
|
'<path d="M22.0748 3.25583C22.4141 2.42845 23.5859 2.42845 23.9252 3.25583L25.6493 7.45955C25.793 7.80979 26.1221 8.04889 26.4995 8.07727L31.0303 8.41798C31.922 8.48504 32.2841 9.59942 31.6021 10.1778L28.1369 13.1166C27.8482 13.3614 27.7225 13.7483 27.8122 14.1161L28.8882 18.5304C29.1 19.3992 28.152 20.0879 27.3912 19.618L23.5255 17.2305C23.2034 17.0316 22.7966 17.0316 22.4745 17.2305L18.60881 19.618C17.84796 20.0879 16.9 19.3992 17.1118 18.5304L18.18785 14.1161C18.2775 13.7483 18.1518 13.3614 17.86309 13.1166L14.3979 10.1778C13.71588 9.59942 14.07796 8.48504 14.96971 8.41798L19.50046 8.07727C19.87794 8.04889 20.20704 7.80979 20.35068 7.45955L22.0748 3.25583Z" stroke="#000000" stroke-width="2"/>' +
|
|
3
3
|
// Adjusting the x attribute and adding padding for the text element
|
|
4
|
-
'<text x="
|
|
4
|
+
'<text x="47" y="52%" style="white-space: pre" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#333333">Featured dataset marker</text>' +
|
|
5
5
|
'</svg>'
|