@abi-software/map-side-bar 2.7.2-beta.7 → 2.7.2
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/map-side-bar.js +6074 -5980
- package/dist/map-side-bar.umd.cjs +61 -61
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/ConnectivityInfo.vue +290 -218
- package/src/components/SearchHistory.vue +0 -1
- package/src/components/SideBar.vue +1 -36
- package/src/components.d.ts +1 -2
- package/src/services/flatmapKnowledge.js +94 -0
- package/src/services/flatmapQueries.js +498 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/map-side-bar",
|
|
3
|
-
"version": "2.7.2
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/*",
|
|
6
6
|
"src/*",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@abi-software/gallery": "^1.1.2",
|
|
42
|
-
"@abi-software/map-utilities": "^1.4.
|
|
42
|
+
"@abi-software/map-utilities": "^1.4.2",
|
|
43
43
|
"@abi-software/svg-sprite": "^1.0.1",
|
|
44
44
|
"@element-plus/icons-vue": "^2.3.1",
|
|
45
45
|
"algoliasearch": "^4.10.5",
|
|
@@ -58,65 +58,175 @@
|
|
|
58
58
|
</div>
|
|
59
59
|
</div>
|
|
60
60
|
|
|
61
|
-
<div
|
|
62
|
-
class="content-container population-display"
|
|
63
|
-
:class="dualConnectionSource ? 'population-display-toolbar' : ''"
|
|
64
|
-
>
|
|
61
|
+
<div class="content-container population-display">
|
|
65
62
|
<div class="block attribute-title-container">
|
|
66
63
|
<span class="attribute-title">Population Display</span>
|
|
67
64
|
</div>
|
|
68
65
|
<div class="block buttons-row">
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
<el-button
|
|
67
|
+
:class="activeView === 'listView' ? 'button' : 'el-button-secondary'"
|
|
68
|
+
@click="switchConnectivityView('listView')"
|
|
69
|
+
>
|
|
70
|
+
List view
|
|
71
|
+
</el-button>
|
|
72
|
+
<el-button
|
|
73
|
+
:class="activeView === 'graphView' ? 'button' : 'el-button-secondary'"
|
|
74
|
+
@click="switchConnectivityView('graphView')"
|
|
75
|
+
>
|
|
76
|
+
Graph view
|
|
77
|
+
</el-button>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div class="content-container content-container-connectivity" v-show="activeView === 'listView'">
|
|
82
|
+
{{ entry.paths }}
|
|
83
|
+
<div v-if="entry.origins && entry.origins.length > 0" class="block">
|
|
84
|
+
<div class="attribute-title-container">
|
|
85
|
+
<span class="attribute-title">Origin</span>
|
|
86
|
+
<el-popover
|
|
87
|
+
width="250"
|
|
88
|
+
trigger="hover"
|
|
89
|
+
:teleported="false"
|
|
90
|
+
popper-class="popover-origin-help"
|
|
91
|
+
>
|
|
92
|
+
<template #reference>
|
|
93
|
+
<el-icon class="info"><el-icon-warning /></el-icon>
|
|
94
|
+
</template>
|
|
95
|
+
<span style="word-break: keep-all">
|
|
96
|
+
<i>Origin</i> {{ originDescription }}
|
|
97
|
+
</span>
|
|
98
|
+
|
|
99
|
+
</el-popover>
|
|
100
|
+
</div>
|
|
101
|
+
<div
|
|
102
|
+
v-for="(origin, i) in entry.origins"
|
|
103
|
+
class="attribute-content"
|
|
104
|
+
:origin-item-label="origin"
|
|
105
|
+
:key="origin"
|
|
106
|
+
@mouseenter="toggleConnectivityTooltip(origin, {show: true})"
|
|
107
|
+
@mouseleave="toggleConnectivityTooltip(origin, {show: false})"
|
|
108
|
+
>
|
|
109
|
+
{{ capitalise(origin) }}
|
|
75
110
|
</div>
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
111
|
+
<el-button
|
|
112
|
+
v-show="
|
|
113
|
+
entry.originsWithDatasets && entry.originsWithDatasets.length > 0 &&
|
|
114
|
+
shouldShowExploreButton(entry.originsWithDatasets)
|
|
115
|
+
"
|
|
116
|
+
class="button"
|
|
117
|
+
id="open-dendrites-button"
|
|
118
|
+
@click="openDendrites"
|
|
119
|
+
>
|
|
120
|
+
Explore origin data
|
|
121
|
+
</el-button>
|
|
122
|
+
</div>
|
|
123
|
+
<div
|
|
124
|
+
v-if="entry.components && entry.components.length > 0"
|
|
125
|
+
class="block"
|
|
126
|
+
>
|
|
127
|
+
<div class="attribute-title-container">
|
|
128
|
+
<span class="attribute-title">Components</span>
|
|
129
|
+
<el-popover
|
|
130
|
+
width="250"
|
|
131
|
+
trigger="hover"
|
|
132
|
+
:teleported="false"
|
|
133
|
+
popper-class="popover-origin-help"
|
|
80
134
|
>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
135
|
+
<template #reference>
|
|
136
|
+
<el-icon class="info"><el-icon-warning /></el-icon>
|
|
137
|
+
</template>
|
|
138
|
+
<span style="word-break: keep-all">
|
|
139
|
+
The list is not in any specific order.<br>
|
|
140
|
+
Specific paths can be viewed using Graph View.
|
|
141
|
+
</span>
|
|
142
|
+
</el-popover>
|
|
143
|
+
</div>
|
|
144
|
+
<div
|
|
145
|
+
v-for="(component, i) in entry.components"
|
|
146
|
+
class="attribute-content"
|
|
147
|
+
:component-item-label="component"
|
|
148
|
+
:key="component"
|
|
149
|
+
@mouseenter="toggleConnectivityTooltip(component, {show: true})"
|
|
150
|
+
@mouseleave="toggleConnectivityTooltip(component, {show: false})"
|
|
151
|
+
>
|
|
152
|
+
{{ capitalise(component) }}
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
<div
|
|
156
|
+
v-if="entry.destinations && entry.destinations.length > 0"
|
|
157
|
+
class="block"
|
|
158
|
+
>
|
|
159
|
+
<div class="attribute-title-container">
|
|
160
|
+
<span class="attribute-title">Destination</span>
|
|
161
|
+
<el-popover
|
|
162
|
+
width="250"
|
|
163
|
+
trigger="hover"
|
|
164
|
+
:teleported="false"
|
|
165
|
+
popper-class="popover-origin-help"
|
|
86
166
|
>
|
|
87
|
-
|
|
88
|
-
|
|
167
|
+
<template #reference>
|
|
168
|
+
<el-icon class="info"><el-icon-warning /></el-icon>
|
|
169
|
+
</template>
|
|
170
|
+
<span style="word-break: keep-all">
|
|
171
|
+
<i>Destination</i> is where the axons terminate
|
|
172
|
+
</span>
|
|
173
|
+
</el-popover>
|
|
174
|
+
</div>
|
|
175
|
+
<div
|
|
176
|
+
v-for="(destination, i) in entry.destinations"
|
|
177
|
+
class="attribute-content"
|
|
178
|
+
:destination-item-label="destination"
|
|
179
|
+
:key="destination"
|
|
180
|
+
@mouseenter="toggleConnectivityTooltip(destination, {show: true})"
|
|
181
|
+
@mouseleave="toggleConnectivityTooltip(destination, {show: false})"
|
|
182
|
+
>
|
|
183
|
+
{{ capitalise(destination) }}
|
|
89
184
|
</div>
|
|
185
|
+
<el-button
|
|
186
|
+
v-show="
|
|
187
|
+
entry.destinationsWithDatasets &&
|
|
188
|
+
entry.destinationsWithDatasets.length > 0 &&
|
|
189
|
+
shouldShowExploreButton(entry.destinationsWithDatasets)
|
|
190
|
+
"
|
|
191
|
+
class="button"
|
|
192
|
+
@click="openAxons"
|
|
193
|
+
>
|
|
194
|
+
Explore destination data
|
|
195
|
+
</el-button>
|
|
196
|
+
</div>
|
|
197
|
+
<div
|
|
198
|
+
v-show="
|
|
199
|
+
entry.componentsWithDatasets &&
|
|
200
|
+
entry.componentsWithDatasets.length > 0 &&
|
|
201
|
+
shouldShowExploreButton(entry.componentsWithDatasets)
|
|
202
|
+
"
|
|
203
|
+
class="block"
|
|
204
|
+
>
|
|
205
|
+
<el-button
|
|
206
|
+
class="button"
|
|
207
|
+
@click="openAll"
|
|
208
|
+
>
|
|
209
|
+
Search for data on components
|
|
210
|
+
</el-button>
|
|
90
211
|
</div>
|
|
91
|
-
</div>
|
|
92
212
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
:originsWithDatasets="originsWithDatasets"
|
|
102
|
-
:componentsWithDatasets="componentsWithDatasets"
|
|
103
|
-
:destinationsWithDatasets="destinationsWithDatasets"
|
|
104
|
-
:availableAnatomyFacets="availableAnatomyFacets"
|
|
105
|
-
:connectivityError="connectivityError"
|
|
106
|
-
@toggle-connectivity-tooltip="onToggleConnectivityTooltip"
|
|
107
|
-
@connectivity-action-click="onConnectivityActionClick"
|
|
108
|
-
></connectivity-list>
|
|
213
|
+
<div class="connectivity-error-container">
|
|
214
|
+
<div class="connectivity-error" v-if="connectivityError">
|
|
215
|
+
<strong v-if="connectivityError.errorConnectivities">
|
|
216
|
+
{{ connectivityError.errorConnectivities }}
|
|
217
|
+
</strong>
|
|
218
|
+
{{ connectivityError.errorMessage }}
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
109
221
|
</div>
|
|
110
222
|
|
|
111
223
|
<div class="content-container" v-show="activeView === 'graphView'">
|
|
112
224
|
<template v-if="graphViewLoaded">
|
|
113
225
|
<connectivity-graph
|
|
114
|
-
|
|
115
|
-
:key="connectivityGraphKey"
|
|
226
|
+
:key="entry.featureId[0]"
|
|
116
227
|
:entry="entry.featureId[0]"
|
|
117
|
-
:mapServer="
|
|
228
|
+
:mapServer="envVars.FLATMAPAPI_LOCATION"
|
|
118
229
|
:sckanVersion="sckanVersion"
|
|
119
|
-
:connectivityFromMap="connectivityFromMap"
|
|
120
230
|
@tap-node="onTapNode"
|
|
121
231
|
ref="connectivityGraphRef"
|
|
122
232
|
/>
|
|
@@ -134,6 +244,11 @@
|
|
|
134
244
|
</template>
|
|
135
245
|
|
|
136
246
|
<script>
|
|
247
|
+
import {
|
|
248
|
+
ArrowUp as ElIconArrowUp,
|
|
249
|
+
ArrowDown as ElIconArrowDown,
|
|
250
|
+
Warning as ElIconWarning,
|
|
251
|
+
} from '@element-plus/icons-vue'
|
|
137
252
|
/* eslint-disable no-alert, no-console */
|
|
138
253
|
import {
|
|
139
254
|
ElButton as Button,
|
|
@@ -145,7 +260,6 @@ import EventBus from './EventBus.js'
|
|
|
145
260
|
import {
|
|
146
261
|
CopyToClipboard,
|
|
147
262
|
ConnectivityGraph,
|
|
148
|
-
ConnectivityList,
|
|
149
263
|
ExternalResourceCard,
|
|
150
264
|
} from '@abi-software/map-utilities';
|
|
151
265
|
import '@abi-software/map-utilities/dist/style.css';
|
|
@@ -169,21 +283,23 @@ export default {
|
|
|
169
283
|
Button,
|
|
170
284
|
Container,
|
|
171
285
|
Icon,
|
|
286
|
+
ElIconArrowUp,
|
|
287
|
+
ElIconArrowDown,
|
|
288
|
+
ElIconWarning,
|
|
172
289
|
ExternalResourceCard,
|
|
173
290
|
CopyToClipboard,
|
|
174
291
|
ConnectivityGraph,
|
|
175
|
-
ConnectivityList,
|
|
176
292
|
},
|
|
177
293
|
props: {
|
|
178
294
|
entry: {
|
|
179
295
|
type: Object,
|
|
180
296
|
default: () => ({
|
|
297
|
+
destinations: [],
|
|
181
298
|
origins: [],
|
|
182
299
|
components: [],
|
|
183
|
-
|
|
300
|
+
destinationsWithDatasets: [],
|
|
184
301
|
originsWithDatasets: [],
|
|
185
302
|
componentsWithDatasets: [],
|
|
186
|
-
destinationsWithDatasets: [],
|
|
187
303
|
resource: undefined,
|
|
188
304
|
featuresAlert: undefined,
|
|
189
305
|
}),
|
|
@@ -196,56 +312,38 @@ export default {
|
|
|
196
312
|
type: Array,
|
|
197
313
|
default: () => [],
|
|
198
314
|
},
|
|
199
|
-
useDOIFormatter: {
|
|
200
|
-
type: Boolean,
|
|
201
|
-
default: true,
|
|
202
|
-
},
|
|
203
315
|
},
|
|
204
316
|
data: function () {
|
|
205
317
|
return {
|
|
206
318
|
controller: undefined,
|
|
207
319
|
activeSpecies: undefined,
|
|
320
|
+
pubmedSearchUrl: '',
|
|
208
321
|
loading: false,
|
|
209
322
|
activeView: 'listView',
|
|
323
|
+
facetList: [],
|
|
210
324
|
showToolip: false,
|
|
211
325
|
showDetails: false,
|
|
212
326
|
originDescriptions: {
|
|
213
327
|
motor: 'is the location of the initial cell body of the circuit',
|
|
214
328
|
sensory: 'is the location of the initial cell body in the PNS circuit',
|
|
215
329
|
},
|
|
216
|
-
origins: [],
|
|
217
|
-
originsWithDatasets: [],
|
|
218
|
-
components: [],
|
|
219
330
|
componentsWithDatasets: [],
|
|
220
|
-
destinations: [],
|
|
221
|
-
destinationsWithDatasets: [],
|
|
222
|
-
connectivityFromMap: null,
|
|
223
331
|
uberons: [{ id: undefined, name: undefined }],
|
|
224
332
|
connectivityError: null,
|
|
225
333
|
timeoutID: undefined,
|
|
226
334
|
graphViewLoaded: false,
|
|
227
335
|
updatedCopyContent: '',
|
|
228
336
|
sckanVersion: '',
|
|
229
|
-
connectivitySource: 'sckan',
|
|
230
|
-
mapuuid: '',
|
|
231
|
-
mapId: '',
|
|
232
|
-
dualConnectionSource: false,
|
|
233
|
-
flatmapApi: '',
|
|
234
|
-
connectivityListKey: '',
|
|
235
|
-
connectivityGraphKey: '',
|
|
236
|
-
connectivityLoading: false,
|
|
237
337
|
}
|
|
238
338
|
},
|
|
239
339
|
watch: {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
this.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
}
|
|
340
|
+
availableAnatomyFacets: {
|
|
341
|
+
handler: function (val) {
|
|
342
|
+
this.convertFacetsToList(val)
|
|
343
|
+
},
|
|
344
|
+
immediate: true,
|
|
345
|
+
deep: true,
|
|
346
|
+
},
|
|
249
347
|
},
|
|
250
348
|
computed: {
|
|
251
349
|
resources: function () {
|
|
@@ -283,6 +381,49 @@ export default {
|
|
|
283
381
|
capitalise: function (text) {
|
|
284
382
|
return capitalise(text)
|
|
285
383
|
},
|
|
384
|
+
openUrl: function (url) {
|
|
385
|
+
window.open(url, '_blank')
|
|
386
|
+
},
|
|
387
|
+
openAll: function () {
|
|
388
|
+
EventBus.emit('onConnectivityActionClick', {
|
|
389
|
+
type: 'Facets',
|
|
390
|
+
labels: this.entry.componentsWithDatasets.map((a) => a.name.toLowerCase()),
|
|
391
|
+
})
|
|
392
|
+
},
|
|
393
|
+
openAxons: function () {
|
|
394
|
+
EventBus.emit('onConnectivityActionClick', {
|
|
395
|
+
type: 'Facets',
|
|
396
|
+
labels: this.entry.destinationsWithDatasets.map((a) => a.name.toLowerCase()),
|
|
397
|
+
})
|
|
398
|
+
},
|
|
399
|
+
// shouldShowExploreButton: Checks if the feature is in the list of available anatomy facets
|
|
400
|
+
shouldShowExploreButton: function (features) {
|
|
401
|
+
for (let i = 0; i < features.length; i++) {
|
|
402
|
+
if (this.facetList.includes(features[i].name.toLowerCase())) {
|
|
403
|
+
return true
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return false
|
|
407
|
+
},
|
|
408
|
+
// convertFacetsToList: Converts the available anatomy facets to a list for easy searching
|
|
409
|
+
convertFacetsToList: function (facets) {
|
|
410
|
+
facets.forEach((facet) => {
|
|
411
|
+
if(facet.children) {
|
|
412
|
+
this.convertFacetsToList(facet.children)
|
|
413
|
+
} else {
|
|
414
|
+
this.facetList.push(facet.label.toLowerCase())
|
|
415
|
+
}
|
|
416
|
+
})
|
|
417
|
+
},
|
|
418
|
+
openDendrites: function () {
|
|
419
|
+
EventBus.emit('onConnectivityActionClick', {
|
|
420
|
+
type: 'Facets',
|
|
421
|
+
labels: this.entry.originsWithDatasets.map((a) => a.name.toLowerCase()),
|
|
422
|
+
})
|
|
423
|
+
},
|
|
424
|
+
pubmedSearchUrlUpdate: function (val) {
|
|
425
|
+
this.pubmedSearchUrl = val
|
|
426
|
+
},
|
|
286
427
|
showConnectivity: function (entry) {
|
|
287
428
|
// move the map center to highlighted area
|
|
288
429
|
const featureIds = entry.featureId || [];
|
|
@@ -291,7 +432,6 @@ export default {
|
|
|
291
432
|
},
|
|
292
433
|
switchConnectivityView: function (val) {
|
|
293
434
|
this.activeView = val;
|
|
294
|
-
this.setState();
|
|
295
435
|
|
|
296
436
|
if (val === 'graphView' && !this.graphViewLoaded) {
|
|
297
437
|
// to load the connectivity graph only after the container is in view
|
|
@@ -374,28 +514,28 @@ export default {
|
|
|
374
514
|
}
|
|
375
515
|
|
|
376
516
|
// Origins
|
|
377
|
-
if (this.origins?.length) {
|
|
517
|
+
if (this.entry.origins?.length) {
|
|
378
518
|
const title = 'Origin';
|
|
379
|
-
const origins = this.origins;
|
|
380
|
-
const originsWithDatasets = this.originsWithDatasets;
|
|
519
|
+
const origins = this.entry.origins;
|
|
520
|
+
const originsWithDatasets = this.entry.originsWithDatasets;
|
|
381
521
|
const transformedOrigins = transformData(title, origins, originsWithDatasets);
|
|
382
522
|
contentArray.push(transformedOrigins);
|
|
383
523
|
}
|
|
384
524
|
|
|
385
525
|
// Components
|
|
386
|
-
if (this.components?.length) {
|
|
526
|
+
if (this.entry.components?.length) {
|
|
387
527
|
const title = 'Components';
|
|
388
|
-
const components = this.components;
|
|
389
|
-
const componentsWithDatasets = this.componentsWithDatasets;
|
|
528
|
+
const components = this.entry.components;
|
|
529
|
+
const componentsWithDatasets = this.entry.componentsWithDatasets;
|
|
390
530
|
const transformedComponents = transformData(title, components, componentsWithDatasets);
|
|
391
531
|
contentArray.push(transformedComponents);
|
|
392
532
|
}
|
|
393
533
|
|
|
394
534
|
// Destination
|
|
395
|
-
if (this.destinations?.length) {
|
|
535
|
+
if (this.entry.destinations?.length) {
|
|
396
536
|
const title = 'Destination';
|
|
397
|
-
const destinations = this.destinations;
|
|
398
|
-
const destinationsWithDatasets = this.destinationsWithDatasets;
|
|
537
|
+
const destinations = this.entry.destinations;
|
|
538
|
+
const destinationsWithDatasets = this.entry.destinationsWithDatasets;
|
|
399
539
|
const transformedDestinations = transformData(title, destinations, destinationsWithDatasets);
|
|
400
540
|
contentArray.push(transformedDestinations);
|
|
401
541
|
}
|
|
@@ -415,9 +555,9 @@ export default {
|
|
|
415
555
|
},
|
|
416
556
|
toggleConnectivityTooltip: function (name, option) {
|
|
417
557
|
const allWithDatasets = [
|
|
418
|
-
...this.componentsWithDatasets,
|
|
419
|
-
...this.destinationsWithDatasets,
|
|
420
|
-
...this.originsWithDatasets,
|
|
558
|
+
...this.entry.componentsWithDatasets,
|
|
559
|
+
...this.entry.destinationsWithDatasets,
|
|
560
|
+
...this.entry.originsWithDatasets,
|
|
421
561
|
];
|
|
422
562
|
const names = name.split(','); // some features have more than one value
|
|
423
563
|
const data = [];
|
|
@@ -493,118 +633,10 @@ export default {
|
|
|
493
633
|
this.connectivityError = null;
|
|
494
634
|
}, ERROR_TIMEOUT);
|
|
495
635
|
},
|
|
496
|
-
updateConnectionsData: function (source) {
|
|
497
|
-
this.origins = source.origins;
|
|
498
|
-
this.components = source.components;
|
|
499
|
-
this.destinations = source.destinations;
|
|
500
|
-
this.originsWithDatasets = source.originsWithDatasets;
|
|
501
|
-
this.componentsWithDatasets = source.componentsWithDatasets;
|
|
502
|
-
this.destinationsWithDatasets = source.destinationsWithDatasets;
|
|
503
|
-
|
|
504
|
-
this.updatedCopyContent = this.getUpdateCopyContent();
|
|
505
|
-
},
|
|
506
|
-
onConnectivitySourceChange: function (connectivitySource) {
|
|
507
|
-
const { featureId } = this.entry;
|
|
508
|
-
|
|
509
|
-
this.connectivityLoading = true;
|
|
510
|
-
this.setState();
|
|
511
|
-
|
|
512
|
-
if (this.activeView !== 'graphView') {
|
|
513
|
-
this.graphViewLoaded = false;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
this.updateGraphConnectivity();
|
|
517
|
-
this.updateKeys();
|
|
518
|
-
|
|
519
|
-
EventBus.emit('connectivity-source-change', {
|
|
520
|
-
featureId: featureId,
|
|
521
|
-
connectivitySource: connectivitySource,
|
|
522
|
-
});
|
|
523
|
-
},
|
|
524
|
-
updateGraphConnectivity: function () {
|
|
525
|
-
if (this.connectivitySource === 'map') {
|
|
526
|
-
this.getConnectionsFromMap(this.mapuuid, this.entry.featureId[0])
|
|
527
|
-
.then((response) => {
|
|
528
|
-
this.connectivityFromMap = response;
|
|
529
|
-
this.connectivityLoading = false;
|
|
530
|
-
});
|
|
531
|
-
} else {
|
|
532
|
-
this.connectivityFromMap = null;
|
|
533
|
-
this.connectivityLoading = false
|
|
534
|
-
}
|
|
535
|
-
},
|
|
536
|
-
getConnectionsFromMap: async function (mapuuid, pathId) {
|
|
537
|
-
const url = this.flatmapApi + `flatmap/${mapuuid}/connectivity/${pathId}`;
|
|
538
|
-
|
|
539
|
-
try {
|
|
540
|
-
const response = await fetch(url);
|
|
541
|
-
if (!response.ok) {
|
|
542
|
-
throw new Error(`Response status: ${response.status}`);
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
return await response.json();
|
|
546
|
-
} catch (error) {
|
|
547
|
-
throw new Error(error);
|
|
548
|
-
}
|
|
549
|
-
},
|
|
550
|
-
onToggleConnectivityTooltip: function (data) {
|
|
551
|
-
const {name, option} = data;
|
|
552
|
-
this.toggleConnectivityTooltip(name, option);
|
|
553
|
-
},
|
|
554
|
-
onConnectivityActionClick: function (data) {
|
|
555
|
-
EventBus.emit('onConnectivityActionClick', data);
|
|
556
|
-
},
|
|
557
|
-
/**
|
|
558
|
-
* Using two different keys for List and Graph
|
|
559
|
-
* because the graph needs to be in view to update
|
|
560
|
-
*/
|
|
561
|
-
updateKeys: function () {
|
|
562
|
-
if (this.activeView === 'graphView') {
|
|
563
|
-
this.connectivityGraphKey = this.entry.featureId[0] + this.connectivitySource;
|
|
564
|
-
}
|
|
565
|
-
this.connectivityListKey = this.entry.featureId[0] + this.connectivitySource;
|
|
566
|
-
},
|
|
567
|
-
/**
|
|
568
|
-
* store active view and connectivity source
|
|
569
|
-
* to keep view between switching tabs
|
|
570
|
-
*/
|
|
571
|
-
setState: function () {
|
|
572
|
-
localStorage.setItem('connectivity-active-view', this.activeView);
|
|
573
|
-
localStorage.setItem('connectivity-source', this.connectivitySource);
|
|
574
|
-
},
|
|
575
|
-
updateSettingsFromState: function () {
|
|
576
|
-
const activeView = localStorage.getItem('connectivity-active-view');
|
|
577
|
-
const connectivitySource = localStorage.getItem('connectivity-source');
|
|
578
|
-
|
|
579
|
-
if (activeView) {
|
|
580
|
-
this.activeView = activeView;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
if (this.activeView === 'graphView') {
|
|
584
|
-
this.graphViewLoaded = true;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
if (connectivitySource) {
|
|
588
|
-
this.connectivitySource = connectivitySource;
|
|
589
|
-
}
|
|
590
|
-
},
|
|
591
636
|
},
|
|
592
637
|
mounted: function () {
|
|
593
638
|
this.sckanVersion = this.entry['knowledge-source'];
|
|
594
|
-
this.
|
|
595
|
-
this.mapId = this.entry['mapId'];
|
|
596
|
-
this.flatmapApi = this.envVars.FLATMAPAPI_LOCATION;
|
|
597
|
-
|
|
598
|
-
this.updateSettingsFromState();
|
|
599
|
-
this.updateKeys();
|
|
600
|
-
this.updateGraphConnectivity();
|
|
601
|
-
this.updateConnectionsData(this.entry);
|
|
602
|
-
|
|
603
|
-
// TODO: only rat flatmap has dual connections now
|
|
604
|
-
if (this.mapId === 'rat-flatmap') {
|
|
605
|
-
this.dualConnectionSource = true;
|
|
606
|
-
}
|
|
607
|
-
|
|
639
|
+
this.updatedCopyContent = this.getUpdateCopyContent();
|
|
608
640
|
EventBus.on('connectivity-graph-error', (errorInfo) => {
|
|
609
641
|
this.pushConnectivityError(errorInfo);
|
|
610
642
|
});
|
|
@@ -685,8 +717,17 @@ export default {
|
|
|
685
717
|
}
|
|
686
718
|
}
|
|
687
719
|
|
|
720
|
+
.info,
|
|
688
721
|
.alert {
|
|
689
722
|
color: #8300bf;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.info {
|
|
726
|
+
transform: rotate(180deg);
|
|
727
|
+
margin-left: 8px;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.alert {
|
|
690
731
|
margin-left: 5px;
|
|
691
732
|
vertical-align: text-bottom;
|
|
692
733
|
|
|
@@ -746,6 +787,39 @@ export default {
|
|
|
746
787
|
text-transform: uppercase;
|
|
747
788
|
}
|
|
748
789
|
|
|
790
|
+
.attribute-content {
|
|
791
|
+
font-size: 14px;
|
|
792
|
+
font-weight: 500;
|
|
793
|
+
transition: color 0.25s ease;
|
|
794
|
+
position: relative;
|
|
795
|
+
cursor: default;
|
|
796
|
+
|
|
797
|
+
&:hover {
|
|
798
|
+
color: $app-primary-color;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
+ .attribute-content {
|
|
802
|
+
&::before {
|
|
803
|
+
content: "";
|
|
804
|
+
width: 90%;
|
|
805
|
+
height: 1px;
|
|
806
|
+
background-color: var(--el-border-color);
|
|
807
|
+
position: absolute;
|
|
808
|
+
top: 0;
|
|
809
|
+
left: 0;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
&:last-of-type {
|
|
814
|
+
margin-bottom: 0.5em;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
.popover-container {
|
|
819
|
+
height: 100%;
|
|
820
|
+
width: 100%;
|
|
821
|
+
}
|
|
822
|
+
|
|
749
823
|
.main {
|
|
750
824
|
.el-button.is-round {
|
|
751
825
|
border-radius: 4px;
|
|
@@ -802,12 +876,6 @@ export default {
|
|
|
802
876
|
margin-top: 0 !important;
|
|
803
877
|
margin-left: 10px !important;
|
|
804
878
|
}
|
|
805
|
-
|
|
806
|
-
> div:first-child {
|
|
807
|
-
display: flex;
|
|
808
|
-
align-items: center;
|
|
809
|
-
gap: 0.5rem;
|
|
810
|
-
}
|
|
811
879
|
}
|
|
812
880
|
|
|
813
881
|
.population-display {
|
|
@@ -818,23 +886,6 @@ export default {
|
|
|
818
886
|
justify-content: space-between;
|
|
819
887
|
border-bottom: 1px solid $app-primary-color;
|
|
820
888
|
padding-bottom: 0.5rem !important;
|
|
821
|
-
|
|
822
|
-
&.population-display-toolbar {
|
|
823
|
-
flex-direction: column !important;
|
|
824
|
-
align-items: start;
|
|
825
|
-
|
|
826
|
-
.buttons-row {
|
|
827
|
-
display: flex;
|
|
828
|
-
flex-direction: row;
|
|
829
|
-
align-items: center;
|
|
830
|
-
justify-content: space-between;
|
|
831
|
-
width: 100%;
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
.el-radio {
|
|
836
|
-
margin-right: 1rem;
|
|
837
|
-
}
|
|
838
889
|
}
|
|
839
890
|
|
|
840
891
|
.tooltip-container {
|
|
@@ -956,4 +1007,25 @@ export default {
|
|
|
956
1007
|
margin-top: -1.25rem;
|
|
957
1008
|
}
|
|
958
1009
|
}
|
|
1010
|
+
|
|
1011
|
+
.connectivity-error-container {
|
|
1012
|
+
position: sticky;
|
|
1013
|
+
bottom: 0.5rem;
|
|
1014
|
+
width: 100%;
|
|
1015
|
+
min-height: 31px; // placeholder
|
|
1016
|
+
margin-top: -10px !important;
|
|
1017
|
+
display: flex;
|
|
1018
|
+
flex-direction: row;
|
|
1019
|
+
align-items: center;
|
|
1020
|
+
justify-content: center;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
.connectivity-error {
|
|
1024
|
+
width: fit-content;
|
|
1025
|
+
font-size: 12px;
|
|
1026
|
+
padding: 0.25rem 0.5rem;
|
|
1027
|
+
background-color: var(--el-color-error-light-9);
|
|
1028
|
+
border-radius: var(--el-border-radius-small);
|
|
1029
|
+
border: 1px solid var(--el-color-error);
|
|
1030
|
+
}
|
|
959
1031
|
</style>
|