@abi-software/mapintegratedvuer 1.21.1 → 1.22.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.
- package/README.md +23 -5
- package/assets/location-icon.html +33 -1
- package/assets/styleguide.css +18 -18
- package/cypress.config.js +7 -9
- package/dist/{ConnectivityGraph-CZMROk9r.js → ConnectivityGraph-BBZ3Dgat.js} +3 -3
- package/dist/{ContentMixin-Vn34n5t2.js → ContentMixin-B-O_IwPg.js} +16 -18
- package/dist/{DynamicMarkerMixin-BS6t7w_i.js → DynamicMarkerMixin-B9iqtP_f.js} +1 -1
- package/dist/{Flatmap-BejxA0uz.js → Flatmap-BoEFI50b.js} +4 -4
- package/dist/{Iframe-BWbhTjCR.js → Iframe-Slj-LQTF.js} +4 -4
- package/dist/{MultiFlatmap-nlmsH-Ib.js → MultiFlatmap-l6aBn6x3.js} +17 -5
- package/dist/{Plot-ChbPsDZX.js → Plot-CIhEip5b.js} +2 -2
- package/dist/{Scaffold-C6f7c7Ha.js → Scaffold-D5ZGCDvt.js} +4 -4
- package/dist/{Simulation-DcJScRYo.js → Simulation-C5o5DXRb.js} +2 -2
- package/dist/{connectivities-UXTqf7_0.js → connectivities-Br3MpoAv.js} +154 -95
- package/dist/index.html +9 -6
- package/dist/mapintegratedvuer.js +5506 -5582
- package/dist/mapintegratedvuer.umd.cjs +196 -196
- package/dist/style.css +1 -1
- package/eslint.config.js +39 -15
- package/package.json +12 -6
- package/public/index.html +9 -6
- package/src/App.vue +224 -255
- package/src/assets/_variables.scss +12 -10
- package/src/assets/header-icon.scss +8 -9
- package/src/assets/mapicon-species-style.css +10 -8
- package/src/assets/styles.scss +1 -1
- package/src/components/ContentBar.vue +99 -106
- package/src/components/ContentVuer.vue +36 -39
- package/src/components/ContextCard.vue +238 -199
- package/src/components/ContextHelp.vue +22 -26
- package/src/components/CustomSplitter.vue +32 -43
- package/src/components/DatasetHeader.vue +37 -41
- package/src/components/DialogToolbarContent.vue +292 -256
- package/src/components/FlatmapContextCard.vue +52 -57
- package/src/components/MapContent.vue +111 -87
- package/src/components/ResizeSensor.vue +8 -13
- package/src/components/SearchControls.vue +26 -35
- package/src/components/SimulatedData.js +196 -219
- package/src/components/SplitDialog.vue +139 -129
- package/src/components/SplitFlow.vue +433 -239
- package/src/components/index.js +1 -3
- package/src/components/scripts/simulation_data.js +393 -397
- package/src/components/scripts/utilities.js +108 -78
- package/src/components/viewers/CellDLViewer.vue +9 -9
- package/src/components/viewers/ConnectivityGraph.vue +9 -12
- package/src/components/viewers/Flatmap.vue +23 -25
- package/src/components/viewers/Iframe.vue +8 -10
- package/src/components/viewers/MultiFlatmap.vue +73 -69
- package/src/components/viewers/Plot.vue +6 -7
- package/src/components/viewers/Scaffold.vue +73 -63
- package/src/components/viewers/Simulation.vue +10 -15
- package/src/main.js +16 -21
- package/src/mixins/ContentMixin.js +208 -178
- package/src/mixins/DynamicMarkerMixin.js +14 -18
- package/src/mixins/RetrieveContextCardMixin.js +35 -30
- package/src/mixins/S3Bucket.vue +10 -13
- package/src/services/knowledgeMapping.js +53 -53
- package/src/services/tagging.js +4 -4
- package/src/stores/connectivities.js +46 -8
- package/src/stores/entries.js +7 -9
- package/src/stores/index.js +7 -7
- package/src/stores/settings.js +23 -31
- package/src/stores/splitFlow.js +395 -298
- package/vite.bundle-build.js +24 -26
- package/vite.config.js +22 -21
- package/vite.static-build.js +4 -4
- package/vitest.workspace.js +1 -3
- package/vuese-generator.js +47 -55
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="tab-container" ref="tabContainer">
|
|
3
|
-
<custom-splitter
|
|
4
|
-
index="split-1"
|
|
5
|
-
key="split-1"
|
|
6
|
-
/>
|
|
3
|
+
<custom-splitter index="split-1" key="split-1" />
|
|
7
4
|
<div
|
|
8
5
|
v-for="entry in entries"
|
|
9
6
|
:key="entry.id"
|
|
@@ -22,23 +19,18 @@
|
|
|
22
19
|
</div>
|
|
23
20
|
</template>
|
|
24
21
|
|
|
25
|
-
|
|
26
22
|
<script>
|
|
27
|
-
|
|
28
|
-
import
|
|
29
|
-
import CustomSplitter from "./CustomSplitter.vue";
|
|
23
|
+
import ContentVuer from './ContentVuer.vue';
|
|
24
|
+
import CustomSplitter from './CustomSplitter.vue';
|
|
30
25
|
import EventBus from './EventBus';
|
|
31
26
|
import { mapStores } from 'pinia';
|
|
32
27
|
import { useSplitFlowStore } from '../stores/splitFlow';
|
|
33
28
|
import { useSettingsStore } from '../stores/settings';
|
|
34
29
|
import { useConnectivitiesStore } from '../stores/connectivities';
|
|
35
|
-
import {
|
|
36
|
-
queryPathsByRoute,
|
|
37
|
-
queryAllConnectedPaths,
|
|
38
|
-
} from "@abi-software/map-utilities";
|
|
30
|
+
import { queryPathsByRoute, queryAllConnectedPaths } from '@abi-software/map-utilities';
|
|
39
31
|
|
|
40
32
|
export default {
|
|
41
|
-
name:
|
|
33
|
+
name: 'SplitDialog',
|
|
42
34
|
components: {
|
|
43
35
|
ContentVuer,
|
|
44
36
|
CustomSplitter,
|
|
@@ -46,36 +38,36 @@ export default {
|
|
|
46
38
|
props: {
|
|
47
39
|
entries: {
|
|
48
40
|
type: Array,
|
|
49
|
-
default: function() {
|
|
41
|
+
default: function () {
|
|
50
42
|
return [];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
43
|
+
},
|
|
44
|
+
},
|
|
53
45
|
},
|
|
54
|
-
data: function() {
|
|
46
|
+
data: function () {
|
|
55
47
|
return {
|
|
56
|
-
styles: {
|
|
57
|
-
query:
|
|
48
|
+
styles: {},
|
|
49
|
+
query: '',
|
|
58
50
|
filter: [],
|
|
59
|
-
}
|
|
51
|
+
};
|
|
60
52
|
},
|
|
61
53
|
methods: {
|
|
62
54
|
/**
|
|
63
55
|
* Callback when the vuers emit a selected event.
|
|
64
56
|
*/
|
|
65
|
-
resourceSelected: function(result) {
|
|
66
|
-
this.$emit(
|
|
57
|
+
resourceSelected: function (result) {
|
|
58
|
+
this.$emit('resource-selected', result);
|
|
67
59
|
},
|
|
68
60
|
speciesChanged: function (species) {
|
|
69
|
-
this.$emit(
|
|
61
|
+
this.$emit('species-changed', species);
|
|
70
62
|
},
|
|
71
|
-
getClass: function(id) {
|
|
63
|
+
getClass: function (id) {
|
|
72
64
|
if (this.isIdVisible(id)) {
|
|
73
65
|
return this.getRefsName(id);
|
|
74
66
|
} else {
|
|
75
|
-
return
|
|
67
|
+
return 'inactive';
|
|
76
68
|
}
|
|
77
69
|
},
|
|
78
|
-
getRefsName: function(id) {
|
|
70
|
+
getRefsName: function (id) {
|
|
79
71
|
const refName = this.splitFlowStore.getPaneNameById(id);
|
|
80
72
|
if (refName) {
|
|
81
73
|
if (!(refName in this.styles)) {
|
|
@@ -84,7 +76,7 @@ export default {
|
|
|
84
76
|
}
|
|
85
77
|
return refName;
|
|
86
78
|
},
|
|
87
|
-
getStyle: function(id) {
|
|
79
|
+
getStyle: function (id) {
|
|
88
80
|
/*
|
|
89
81
|
Set the style based on the position of the spltters
|
|
90
82
|
Header is 30px in height and the splitter is 1px in
|
|
@@ -97,18 +89,17 @@ export default {
|
|
|
97
89
|
}
|
|
98
90
|
return {};
|
|
99
91
|
},
|
|
100
|
-
getActiveContents: function() {
|
|
92
|
+
getActiveContents: function () {
|
|
101
93
|
const activeContents = [];
|
|
102
94
|
const vuers = this.$refs['content'];
|
|
103
95
|
if (vuers) {
|
|
104
|
-
vuers.forEach(vuer => {
|
|
105
|
-
if (vuer.visible)
|
|
106
|
-
activeContents.push(vuer);
|
|
96
|
+
vuers.forEach((vuer) => {
|
|
97
|
+
if (vuer.visible) activeContents.push(vuer);
|
|
107
98
|
});
|
|
108
99
|
}
|
|
109
100
|
return activeContents;
|
|
110
101
|
},
|
|
111
|
-
isIdVisible: function(id) {
|
|
102
|
+
isIdVisible: function (id) {
|
|
112
103
|
const paneName = this.splitFlowStore.getPaneNameById(id);
|
|
113
104
|
let visible = false;
|
|
114
105
|
if (paneName !== undefined) {
|
|
@@ -116,8 +107,8 @@ export default {
|
|
|
116
107
|
}
|
|
117
108
|
return visible;
|
|
118
109
|
},
|
|
119
|
-
getContentsWithId: function(id) {
|
|
120
|
-
let contents = this.$refs[
|
|
110
|
+
getContentsWithId: function (id) {
|
|
111
|
+
let contents = this.$refs['content'];
|
|
121
112
|
for (let i = 0; i < contents.length; i++) {
|
|
122
113
|
if (contents[i].getId() == id) {
|
|
123
114
|
return contents[i];
|
|
@@ -125,44 +116,44 @@ export default {
|
|
|
125
116
|
}
|
|
126
117
|
return undefined;
|
|
127
118
|
},
|
|
128
|
-
getContentsState: function() {
|
|
119
|
+
getContentsState: function () {
|
|
129
120
|
let states = [];
|
|
130
|
-
let contents = this.$refs[
|
|
121
|
+
let contents = this.$refs['content'];
|
|
131
122
|
for (let i = 0; i < contents.length; i++) {
|
|
132
123
|
states.push(contents[i].getState());
|
|
133
124
|
}
|
|
134
125
|
return states;
|
|
135
126
|
},
|
|
136
|
-
setStyles: function(refName, rect) {
|
|
127
|
+
setStyles: function (refName, rect) {
|
|
137
128
|
if (this.$refs && this.$refs.tabContainer) {
|
|
138
129
|
const bound = this.$refs.tabContainer.getBoundingClientRect();
|
|
139
130
|
const style = {};
|
|
140
|
-
style[
|
|
141
|
-
style[
|
|
142
|
-
style[
|
|
143
|
-
style[
|
|
144
|
-
style[
|
|
131
|
+
style['width'] = `${rect.width}px`;
|
|
132
|
+
style['left'] = `${rect.left - bound.left}px`;
|
|
133
|
+
style['height'] = `${rect.height}px`;
|
|
134
|
+
style['top'] = `${rect.top - bound.top}px`;
|
|
135
|
+
style['display'] = 'block';
|
|
145
136
|
this.styles[refName] = style;
|
|
146
137
|
}
|
|
147
138
|
},
|
|
148
|
-
hidePane: function(refName) {
|
|
149
|
-
if (this.$refs &&
|
|
139
|
+
hidePane: function (refName) {
|
|
140
|
+
if (this.$refs && 'tabContainer' in this.$refs) {
|
|
150
141
|
const style = {};
|
|
151
142
|
// style["display"] = "none";
|
|
152
|
-
style[
|
|
153
|
-
style[
|
|
154
|
-
style[
|
|
143
|
+
style['visibility'] = 'hidden';
|
|
144
|
+
style['pointer-events'] = 'none';
|
|
145
|
+
style['opacity'] = '0';
|
|
155
146
|
this.styles[refName] = style;
|
|
156
147
|
}
|
|
157
148
|
},
|
|
158
|
-
resize: function() {
|
|
149
|
+
resize: function () {
|
|
159
150
|
this.__userResize__ = true;
|
|
160
151
|
},
|
|
161
|
-
resized: function(splitterName, event) {
|
|
152
|
+
resized: function (splitterName, event) {
|
|
162
153
|
if (this.__userResize__) {
|
|
163
154
|
this.splitFlowStore.setSplitter({
|
|
164
155
|
name: splitterName,
|
|
165
|
-
value: event[0].size
|
|
156
|
+
value: event[0].size,
|
|
166
157
|
});
|
|
167
158
|
}
|
|
168
159
|
this.__userResize__ = false;
|
|
@@ -171,34 +162,29 @@ export default {
|
|
|
171
162
|
let activePaneIDs = this.splitFlowStore.getActivePaneIds();
|
|
172
163
|
// body scaffold id may be a string depends on situation
|
|
173
164
|
const wholeBodyScaffoldIDs = [307, '307'];
|
|
174
|
-
const sckanVersion = Object.keys(this.connectivitiesStore.globalConnectivities)
|
|
175
|
-
|
|
165
|
+
const sckanVersion = Object.keys(this.connectivitiesStore.globalConnectivities).find((key) =>
|
|
166
|
+
key.includes('sckan'),
|
|
167
|
+
);
|
|
176
168
|
const uuids = Array.from(
|
|
177
169
|
new Set(
|
|
178
170
|
this.entries
|
|
179
171
|
.filter((entry) => {
|
|
180
172
|
return (
|
|
181
173
|
activePaneIDs.includes(entry.id) &&
|
|
182
|
-
(
|
|
183
|
-
(
|
|
184
|
-
entry.
|
|
185
|
-
(entry.
|
|
186
|
-
|
|
187
|
-
(
|
|
188
|
-
entry.type === 'Scaffold' && entry.resource &&
|
|
189
|
-
(entry.isBodyScaffold || wholeBodyScaffoldIDs.includes(entry.discoverId))
|
|
190
|
-
)
|
|
191
|
-
)
|
|
192
|
-
)
|
|
174
|
+
((entry.uuid && (entry.type === 'Flatmap' || entry.type === 'MultiFlatmap')) ||
|
|
175
|
+
(entry.type === 'Scaffold' &&
|
|
176
|
+
entry.resource &&
|
|
177
|
+
(entry.isBodyScaffold || wholeBodyScaffoldIDs.includes(entry.discoverId))))
|
|
178
|
+
);
|
|
193
179
|
})
|
|
194
180
|
.map((entry) => {
|
|
195
|
-
if (
|
|
181
|
+
if (entry.type === 'Flatmap' || entry.type === 'MultiFlatmap') {
|
|
196
182
|
return entry.uuid;
|
|
197
183
|
} else if (entry.type === 'Scaffold') {
|
|
198
184
|
return entry.resource;
|
|
199
185
|
}
|
|
200
|
-
})
|
|
201
|
-
)
|
|
186
|
+
}),
|
|
187
|
+
),
|
|
202
188
|
);
|
|
203
189
|
|
|
204
190
|
// mix connectivites of available maps
|
|
@@ -206,36 +192,38 @@ export default {
|
|
|
206
192
|
// emit connectivity-knowledge event only if active connectivity keys are updated
|
|
207
193
|
if (this.connectivitiesStore.updateActiveConnectivityKeys(uuids)) {
|
|
208
194
|
const uniqueFilters = this.connectivitiesStore.getUniqueFilterOptionsByKeys;
|
|
209
|
-
EventBus.emit(
|
|
195
|
+
EventBus.emit('connectivity-filter-options', uniqueFilters);
|
|
210
196
|
}
|
|
211
197
|
} else {
|
|
212
198
|
const connectivityData = this.connectivitiesStore.globalConnectivities[sckanVersion] || [];
|
|
213
|
-
EventBus.emit(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
199
|
+
EventBus.emit('connectivity-knowledge', {
|
|
200
|
+
data: connectivityData,
|
|
201
|
+
highlight: [],
|
|
202
|
+
processed: false,
|
|
203
|
+
// Marks this as the default/global fallback
|
|
204
|
+
// (no active map's connectivity keys resolved yet)
|
|
205
|
+
// rather than data scoped to the currently active viewers.
|
|
206
|
+
isDefaultKnowledge: true,
|
|
217
207
|
});
|
|
218
|
-
EventBus.emit(
|
|
208
|
+
EventBus.emit('connectivity-filter-options', []);
|
|
219
209
|
this.connectivitiesStore.updateActiveConnectivityKeys([sckanVersion]);
|
|
220
210
|
}
|
|
221
211
|
},
|
|
222
|
-
getGeneralSearchedId: function (entry, term,
|
|
212
|
+
getGeneralSearchedId: function (entry, term, _type = 'query') {
|
|
223
213
|
const ids = [];
|
|
224
214
|
entry.forEach((data) => {
|
|
225
|
-
let compareRanges = [
|
|
226
|
-
|
|
227
|
-
];
|
|
228
|
-
if (type = 'query') {
|
|
215
|
+
let compareRanges = [JSON.stringify(data['nerve-label'])];
|
|
216
|
+
if (_type === 'query') {
|
|
229
217
|
compareRanges = [
|
|
230
218
|
...compareRanges,
|
|
231
219
|
data.id,
|
|
232
220
|
data.label,
|
|
233
221
|
data['long-label'],
|
|
234
|
-
JSON.stringify(data['nerves'])
|
|
235
|
-
]
|
|
222
|
+
JSON.stringify(data['nerves']),
|
|
223
|
+
];
|
|
236
224
|
}
|
|
237
225
|
const isMatched = compareRanges.some((data) => {
|
|
238
|
-
return data?.toLowerCase().includes(term.toLowerCase())
|
|
226
|
+
return data?.toLowerCase().includes(term.toLowerCase());
|
|
239
227
|
});
|
|
240
228
|
if (isMatched && !ids.includes(data.id)) {
|
|
241
229
|
ids.push(data.id);
|
|
@@ -269,7 +257,7 @@ export default {
|
|
|
269
257
|
|
|
270
258
|
const searchTerm = term.toLowerCase();
|
|
271
259
|
const minTermLength = 3;
|
|
272
|
-
const hasDelimiters = /[-_:\s
|
|
260
|
+
const hasDelimiters = /[-_:\s/]+/.test(searchTerm);
|
|
273
261
|
|
|
274
262
|
if (hasDelimiters) {
|
|
275
263
|
return pathwayModels
|
|
@@ -277,30 +265,31 @@ export default {
|
|
|
277
265
|
const pathwayId = pathway.id?.toLowerCase() || '';
|
|
278
266
|
return pathwayId.includes(searchTerm);
|
|
279
267
|
})
|
|
280
|
-
.map(pathway => pathway.id);
|
|
268
|
+
.map((pathway) => pathway.id);
|
|
281
269
|
}
|
|
282
270
|
|
|
283
271
|
if (searchTerm.length < minTermLength) {
|
|
284
272
|
return pathwayModels
|
|
285
273
|
.filter((pathway) => {
|
|
286
274
|
const pathwayId = pathway.id?.toLowerCase() || '';
|
|
287
|
-
const segments = pathwayId.split(/[-_:\s
|
|
275
|
+
const segments = pathwayId.split(/[-_:\s/]+/);
|
|
288
276
|
return segments.includes(searchTerm);
|
|
289
277
|
})
|
|
290
|
-
.map(pathway => pathway.id);
|
|
278
|
+
.map((pathway) => pathway.id);
|
|
291
279
|
}
|
|
292
280
|
|
|
293
281
|
return pathwayModels
|
|
294
282
|
.filter((pathway) => {
|
|
295
283
|
const pathwayId = pathway.id?.toLowerCase() || '';
|
|
296
|
-
const segments = pathwayId.split(/[-_:\s
|
|
284
|
+
const segments = pathwayId.split(/[-_:\s/]+/);
|
|
297
285
|
|
|
298
|
-
return segments.some(
|
|
299
|
-
segment
|
|
300
|
-
|
|
286
|
+
return segments.some(
|
|
287
|
+
(segment) =>
|
|
288
|
+
segment === searchTerm ||
|
|
289
|
+
(segment.length >= minTermLength && segment.includes(searchTerm)),
|
|
301
290
|
);
|
|
302
291
|
})
|
|
303
|
-
.map(pathway => pathway.id);
|
|
292
|
+
.map((pathway) => pathway.id);
|
|
304
293
|
},
|
|
305
294
|
getFlatmapSearchedId: function (flatmap, term) {
|
|
306
295
|
const ids = [];
|
|
@@ -313,10 +302,10 @@ export default {
|
|
|
313
302
|
annotation.name,
|
|
314
303
|
annotation.label,
|
|
315
304
|
annotation.models,
|
|
316
|
-
annotation.source
|
|
305
|
+
annotation.source,
|
|
317
306
|
];
|
|
318
307
|
const isMatched = compareRanges.some((item) => {
|
|
319
|
-
return item && item.toLowerCase().includes(term.toLowerCase())
|
|
308
|
+
return item && item.toLowerCase().includes(term.toLowerCase());
|
|
320
309
|
});
|
|
321
310
|
if (isMatched && annotation.models && !ids.includes(annotation.models)) {
|
|
322
311
|
ids.push(annotation.models);
|
|
@@ -328,27 +317,29 @@ export default {
|
|
|
328
317
|
const flatmapResponse = await fetch(flatmapAPI);
|
|
329
318
|
const flatmapJson = await flatmapResponse.json();
|
|
330
319
|
const latestFlatmap = flatmapJson
|
|
331
|
-
.filter(f => f.id === id)
|
|
320
|
+
.filter((f) => f.id === id)
|
|
332
321
|
.sort((a, b) => b.created.localeCompare(a.created))[0];
|
|
333
322
|
const flatmapUUID = latestFlatmap.uuid;
|
|
334
323
|
return flatmapUUID;
|
|
335
324
|
},
|
|
336
325
|
parseSearchTerms: function (query) {
|
|
337
326
|
return query
|
|
338
|
-
.split(
|
|
339
|
-
.map(term => term.trim().replace(/["']/g,
|
|
340
|
-
.filter(term => term);
|
|
327
|
+
.split(',')
|
|
328
|
+
.map((term) => term.trim().replace(/["']/g, ''))
|
|
329
|
+
.filter((term) => term);
|
|
341
330
|
},
|
|
342
331
|
connectivityQueryFilter: async function (data) {
|
|
343
|
-
this.query =
|
|
332
|
+
this.query = '';
|
|
344
333
|
this.filter = [];
|
|
345
334
|
const activeContents = this.getActiveContents();
|
|
346
335
|
const flatmapAPI = this.settingsStore.flatmapAPI;
|
|
347
|
-
const searchOrders = [],
|
|
336
|
+
const searchOrders = [],
|
|
337
|
+
searchResults = [];
|
|
348
338
|
let searchHighlights = [];
|
|
349
339
|
let processed = false;
|
|
350
|
-
let queryIds = [],
|
|
351
|
-
|
|
340
|
+
let queryIds = [],
|
|
341
|
+
facetIds = [];
|
|
342
|
+
let sourceId = '';
|
|
352
343
|
|
|
353
344
|
const uniqueFilters = this.connectivitiesStore.getUniqueFilterOptionsByKeys;
|
|
354
345
|
const uniqueFilterSources = this.connectivitiesStore.getUniqueFilterSourcesByKeys;
|
|
@@ -363,7 +354,7 @@ export default {
|
|
|
363
354
|
const plot = viewer.$refs.plot;
|
|
364
355
|
const simulation = viewer.$refs.simulation;
|
|
365
356
|
let currentMap = null;
|
|
366
|
-
if (multiflatmap) {
|
|
357
|
+
if (multiflatmap && viewer.flatmapIsReady()) {
|
|
367
358
|
const _currentMap = multiflatmap.getCurrentFlatmap();
|
|
368
359
|
if (_currentMap && _currentMap.mapImp) {
|
|
369
360
|
currentMap = _currentMap;
|
|
@@ -386,9 +377,9 @@ export default {
|
|
|
386
377
|
const nestedIds = [];
|
|
387
378
|
for (let index = 0; index < searchTerms.length; index++) {
|
|
388
379
|
const term = searchTerms[index];
|
|
389
|
-
const searchResult = isFlatmap
|
|
390
|
-
this.getFlatmapSearchedId(currentMap, term)
|
|
391
|
-
this.getGeneralSearchedId(results, term, 'query');
|
|
380
|
+
const searchResult = isFlatmap
|
|
381
|
+
? this.getFlatmapSearchedId(currentMap, term)
|
|
382
|
+
: this.getGeneralSearchedId(results, term, 'query');
|
|
392
383
|
nestedIds.push(searchResult);
|
|
393
384
|
// search if the term is a part of a pathway
|
|
394
385
|
if (isFlatmap) {
|
|
@@ -400,7 +391,9 @@ export default {
|
|
|
400
391
|
const flatIds = [...new Set(nestedIds.flat())];
|
|
401
392
|
if (flatIds.length) {
|
|
402
393
|
searchOrders.push(...flatIds);
|
|
403
|
-
const ids = isFlatmap
|
|
394
|
+
const ids = isFlatmap
|
|
395
|
+
? await queryAllConnectedPaths(flatmapAPI, sourceId, flatIds)
|
|
396
|
+
: flatIds;
|
|
404
397
|
queryIds.push(...ids);
|
|
405
398
|
}
|
|
406
399
|
}
|
|
@@ -426,7 +419,7 @@ export default {
|
|
|
426
419
|
// generate connectivityQueries to query related ids
|
|
427
420
|
if (isNeuronConnection && item.facet?.toLowerCase() !== 'show all') {
|
|
428
421
|
// string format with a space for CQ
|
|
429
|
-
const feature = item.facet.replace(
|
|
422
|
+
const feature = item.facet.replace(',[', ', [');
|
|
430
423
|
const mode = item.facetPropPath.split('.').pop();
|
|
431
424
|
|
|
432
425
|
if (mode === 'origin') {
|
|
@@ -447,12 +440,16 @@ export default {
|
|
|
447
440
|
filters[facetKey] = [];
|
|
448
441
|
}
|
|
449
442
|
// within facet search category -> OR
|
|
450
|
-
filters[facetKey].push(
|
|
443
|
+
filters[facetKey].push(
|
|
444
|
+
...this.getGeneralSearchedId(results, item.facet, 'facet'),
|
|
445
|
+
);
|
|
451
446
|
}
|
|
452
447
|
} else if (isFlatmap) {
|
|
453
448
|
if (!isNeuronConnection) {
|
|
454
449
|
// all other flatmap filter logic
|
|
455
|
-
const matchedFilter = uniqueFilters.find(filter =>
|
|
450
|
+
const matchedFilter = uniqueFilters.find((filter) =>
|
|
451
|
+
filter.key.includes(facetKey),
|
|
452
|
+
);
|
|
456
453
|
if (matchedFilter) {
|
|
457
454
|
matchedFilter.children.forEach((child) => {
|
|
458
455
|
if (child.label.toLowerCase() === item.facet.toLowerCase() && child.key) {
|
|
@@ -489,31 +486,38 @@ export default {
|
|
|
489
486
|
if (!('ovd' in filters)) {
|
|
490
487
|
filters['ovd'] = [];
|
|
491
488
|
}
|
|
492
|
-
filters['ovd'].push(...await queryPathsByRoute(options));
|
|
489
|
+
filters['ovd'].push(...(await queryPathsByRoute(options)));
|
|
493
490
|
} else if (connectivityQueries.all.length) {
|
|
494
491
|
if (!('all' in filters)) {
|
|
495
492
|
filters['all'] = [];
|
|
496
493
|
}
|
|
497
|
-
filters['all'].push(
|
|
494
|
+
filters['all'].push(
|
|
495
|
+
...(await queryAllConnectedPaths(flatmapAPI, sourceId, connectivityQueries.all)),
|
|
496
|
+
);
|
|
498
497
|
}
|
|
499
498
|
|
|
500
499
|
const nestedIds = Object.values(filters);
|
|
501
500
|
this.filter = [...this.filter, ...nestedIds];
|
|
502
501
|
// between facet search categories -> AND
|
|
503
|
-
const ids = this.filter.length
|
|
502
|
+
const ids = this.filter.length
|
|
503
|
+
? this.filter.reduce((acc, curr) => acc.filter((id) => curr.includes(id)))
|
|
504
|
+
: [];
|
|
504
505
|
facetIds.push(...ids);
|
|
505
506
|
}
|
|
506
507
|
}
|
|
507
508
|
}
|
|
508
509
|
|
|
509
510
|
let target;
|
|
510
|
-
if (this.query && !this.filter.length) {
|
|
511
|
+
if (this.query && !this.filter.length) {
|
|
512
|
+
// pure query search
|
|
511
513
|
target = queryIds;
|
|
512
|
-
} else if (!this.query && this.filter.length) {
|
|
514
|
+
} else if (!this.query && this.filter.length) {
|
|
515
|
+
// pure facet search
|
|
513
516
|
target = facetIds;
|
|
514
|
-
} else if (this.query && this.filter.length) {
|
|
517
|
+
} else if (this.query && this.filter.length) {
|
|
518
|
+
// combined query and facet search
|
|
515
519
|
// between query search and facet search -> AND
|
|
516
|
-
target = queryIds.filter(id => facetIds.includes(id));
|
|
520
|
+
target = queryIds.filter((id) => facetIds.includes(id));
|
|
517
521
|
}
|
|
518
522
|
// This can be empty array due to the AND operation
|
|
519
523
|
if (target) {
|
|
@@ -526,22 +530,22 @@ export default {
|
|
|
526
530
|
const uniqueOrders = [...new Set(searchOrders)];
|
|
527
531
|
const uniqueHighlights = [...new Set(searchHighlights)];
|
|
528
532
|
let uniqueResults = Array.from(
|
|
529
|
-
new Map(searchResults.map((item) => [item.id, item])).values()
|
|
533
|
+
new Map(searchResults.map((item) => [item.id, item])).values(),
|
|
530
534
|
);
|
|
531
535
|
// Ensure that the results always show search items first
|
|
532
536
|
// and the rest ordered by alphabetical order
|
|
533
537
|
uniqueResults = [
|
|
534
538
|
...uniqueResults.filter((r) => uniqueOrders.includes(r.id)),
|
|
535
|
-
...uniqueResults.filter((r) => !uniqueOrders.includes(r.id))
|
|
539
|
+
...uniqueResults.filter((r) => !uniqueOrders.includes(r.id)),
|
|
536
540
|
];
|
|
537
541
|
|
|
538
542
|
const connectivitiesPayload = {
|
|
539
543
|
data: uniqueResults,
|
|
540
544
|
highlight: uniqueHighlights,
|
|
541
|
-
processed: processed
|
|
545
|
+
processed: processed,
|
|
542
546
|
};
|
|
543
547
|
|
|
544
|
-
EventBus.emit(
|
|
548
|
+
EventBus.emit('connectivity-knowledge', connectivitiesPayload);
|
|
545
549
|
},
|
|
546
550
|
updateFlatmapMinimap: function () {
|
|
547
551
|
const activePaneIDs = this.splitFlowStore.getActivePaneIds();
|
|
@@ -573,7 +577,7 @@ export default {
|
|
|
573
577
|
computed: {
|
|
574
578
|
...mapStores(useSplitFlowStore, useConnectivitiesStore, useSettingsStore),
|
|
575
579
|
horizontal() {
|
|
576
|
-
if (this.splitFlowStore.activeView ===
|
|
580
|
+
if (this.splitFlowStore.activeView === '2horpanel') {
|
|
577
581
|
return true;
|
|
578
582
|
}
|
|
579
583
|
return false;
|
|
@@ -583,27 +587,27 @@ export default {
|
|
|
583
587
|
},
|
|
584
588
|
},
|
|
585
589
|
mounted: function () {
|
|
586
|
-
EventBus.on(
|
|
590
|
+
EventBus.on('PaneResize', (payload) => {
|
|
587
591
|
this.setStyles(payload.refName, payload.rect);
|
|
588
592
|
this.updateFlatmapMinimap();
|
|
589
593
|
});
|
|
590
|
-
EventBus.on(
|
|
594
|
+
EventBus.on('PaneUnmounted', (payload) => {
|
|
591
595
|
this.hidePane(payload.refName);
|
|
592
596
|
});
|
|
593
597
|
EventBus.on('species-layout-connectivity-update', () => {
|
|
594
598
|
this.onSpeciesLayoutConnectivityUpdate();
|
|
595
|
-
})
|
|
596
|
-
EventBus.on(
|
|
599
|
+
});
|
|
600
|
+
EventBus.on('connectivity-query-filter', (payload) => {
|
|
597
601
|
this.connectivityQueryFilter(payload);
|
|
598
602
|
});
|
|
599
603
|
//The followings are migrated from ContentVuer and its child components to here
|
|
600
|
-
EventBus.on(
|
|
604
|
+
EventBus.on('hoverUpdate', (payload) => {
|
|
601
605
|
const contents = this.getActiveContents();
|
|
602
606
|
contents.forEach((content) => {
|
|
603
607
|
content.onHoverUpdate(payload);
|
|
604
608
|
});
|
|
605
609
|
});
|
|
606
|
-
EventBus.on(
|
|
610
|
+
EventBus.on('startHelp', () => {
|
|
607
611
|
const contents = this.getActiveContents();
|
|
608
612
|
contents.forEach((content) => {
|
|
609
613
|
content.onStartHelp();
|
|
@@ -627,7 +631,7 @@ export default {
|
|
|
627
631
|
content.onGlobalViewerSettingsUpdate();
|
|
628
632
|
});
|
|
629
633
|
});
|
|
630
|
-
EventBus.on(
|
|
634
|
+
EventBus.on('markerUpdate', () => {
|
|
631
635
|
const contents = this.$refs['content'];
|
|
632
636
|
contents.forEach((content) => {
|
|
633
637
|
content.onFlatmapMarkerUpdate();
|
|
@@ -646,7 +650,7 @@ export default {
|
|
|
646
650
|
//TODO: This can be improved with using just one viewer to give us
|
|
647
651
|
//the new knowlegdge with the species/sources specified which
|
|
648
652
|
//will require some UI changes on the sidebar
|
|
649
|
-
const ongoingSources = []
|
|
653
|
+
const ongoingSources = [];
|
|
650
654
|
contents.forEach((content) => {
|
|
651
655
|
content.onConnectivitySourceChange(payload, ongoingSources);
|
|
652
656
|
});
|
|
@@ -683,7 +687,7 @@ export default {
|
|
|
683
687
|
margin: 0px 0px 0px 0px !important;
|
|
684
688
|
z-index: 6 !important;
|
|
685
689
|
&::before {
|
|
686
|
-
content:
|
|
690
|
+
content: '';
|
|
687
691
|
position: absolute;
|
|
688
692
|
left: 0;
|
|
689
693
|
top: 0;
|
|
@@ -737,7 +741,13 @@ export default {
|
|
|
737
741
|
|
|
738
742
|
.contentvuer {
|
|
739
743
|
position: absolute;
|
|
740
|
-
transition:
|
|
744
|
+
transition:
|
|
745
|
+
opacity 0s,
|
|
746
|
+
visibility 0s,
|
|
747
|
+
left 0s ease,
|
|
748
|
+
top 0s ease,
|
|
749
|
+
width 0s ease,
|
|
750
|
+
height 0s ease;
|
|
741
751
|
background: rgba(255, 255, 255, 1);
|
|
742
752
|
visibility: visible;
|
|
743
753
|
opacity: 1;
|