@abi-software/map-side-bar 2.7.2-beta.6 → 2.7.2-beta.7
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 +5357 -5491
- package/dist/map-side-bar.umd.cjs +27 -27
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/ConnectivityInfo.vue +234 -337
- package/src/components/SearchFilters.vue +0 -13
- package/src/components/SearchHistory.vue +1 -0
- package/src/components/SideBar.vue +40 -5
- package/src/components.d.ts +2 -1
- package/src/exampleConnectivityInput.js +2 -2
|
@@ -1,27 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="entry" class="main" v-loading="loading">
|
|
3
|
-
<div v-if="connectivityEntry.length > 1" class="button-container">
|
|
4
|
-
<el-popover
|
|
5
|
-
width="auto"
|
|
6
|
-
trigger="hover"
|
|
7
|
-
:teleported="false"
|
|
8
|
-
>
|
|
9
|
-
<template #reference>
|
|
10
|
-
<el-button class="button" @click="previous">Previous</el-button>
|
|
11
|
-
</template>
|
|
12
|
-
<span>{{ previousLabel }}</span>
|
|
13
|
-
</el-popover>
|
|
14
|
-
<el-popover
|
|
15
|
-
width="auto"
|
|
16
|
-
trigger="hover"
|
|
17
|
-
:teleported="false"
|
|
18
|
-
>
|
|
19
|
-
<template #reference>
|
|
20
|
-
<el-button class="button" @click="next">Next</el-button>
|
|
21
|
-
</template>
|
|
22
|
-
<span>{{ nextLabel }}</span>
|
|
23
|
-
</el-popover>
|
|
24
|
-
</div>
|
|
25
3
|
<!-- Connectivity Info Title -->
|
|
26
4
|
<div class="connectivity-info-title">
|
|
27
5
|
<div class="title-content">
|
|
@@ -66,7 +44,7 @@
|
|
|
66
44
|
popper-class="popover-map-pin"
|
|
67
45
|
>
|
|
68
46
|
<template #reference>
|
|
69
|
-
<el-button class="button-circle" circle @click="showConnectivity">
|
|
47
|
+
<el-button class="button-circle" circle @click="showConnectivity(entry)">
|
|
70
48
|
<el-icon color="white">
|
|
71
49
|
<el-icon-location />
|
|
72
50
|
</el-icon>
|
|
@@ -80,161 +58,65 @@
|
|
|
80
58
|
</div>
|
|
81
59
|
</div>
|
|
82
60
|
|
|
83
|
-
<div
|
|
61
|
+
<div
|
|
62
|
+
class="content-container population-display"
|
|
63
|
+
:class="dualConnectionSource ? 'population-display-toolbar' : ''"
|
|
64
|
+
>
|
|
84
65
|
<div class="block attribute-title-container">
|
|
85
66
|
<span class="attribute-title">Population Display</span>
|
|
86
67
|
</div>
|
|
87
68
|
<div class="block buttons-row">
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
@
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<el-button
|
|
95
|
-
:class="activeView === 'graphView' ? 'button' : 'el-button-secondary'"
|
|
96
|
-
@click="switchConnectivityView('graphView')"
|
|
97
|
-
>
|
|
98
|
-
Graph view
|
|
99
|
-
</el-button>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
<div class="content-container content-container-connectivity" v-show="activeView === 'listView'">
|
|
104
|
-
{{ entry.paths }}
|
|
105
|
-
<div v-if="entry.origins && entry.origins.length > 0" class="block">
|
|
106
|
-
<div class="attribute-title-container">
|
|
107
|
-
<span class="attribute-title">Origin</span>
|
|
108
|
-
<el-popover
|
|
109
|
-
width="250"
|
|
110
|
-
trigger="hover"
|
|
111
|
-
:teleported="false"
|
|
112
|
-
popper-class="popover-origin-help"
|
|
113
|
-
>
|
|
114
|
-
<template #reference>
|
|
115
|
-
<el-icon class="info"><el-icon-warning /></el-icon>
|
|
116
|
-
</template>
|
|
117
|
-
<span style="word-break: keep-all">
|
|
118
|
-
<i>Origin</i> {{ originDescription }}
|
|
119
|
-
</span>
|
|
120
|
-
|
|
121
|
-
</el-popover>
|
|
122
|
-
</div>
|
|
123
|
-
<div
|
|
124
|
-
v-for="(origin, i) in entry.origins"
|
|
125
|
-
class="attribute-content"
|
|
126
|
-
:origin-item-label="origin"
|
|
127
|
-
:key="origin"
|
|
128
|
-
@mouseenter="toggleConnectivityTooltip(origin, {show: true})"
|
|
129
|
-
@mouseleave="toggleConnectivityTooltip(origin, {show: false})"
|
|
130
|
-
>
|
|
131
|
-
{{ capitalise(origin) }}
|
|
69
|
+
<div v-if="dualConnectionSource">
|
|
70
|
+
<span>Connectivity from:</span>
|
|
71
|
+
<el-radio-group v-model="connectivitySource" @change="onConnectivitySourceChange">
|
|
72
|
+
<el-radio value="map">Map</el-radio>
|
|
73
|
+
<el-radio value="sckan">SCKAN</el-radio>
|
|
74
|
+
</el-radio-group>
|
|
132
75
|
</div>
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"
|
|
138
|
-
class="button"
|
|
139
|
-
id="open-dendrites-button"
|
|
140
|
-
@click="openDendrites"
|
|
141
|
-
>
|
|
142
|
-
Explore origin data
|
|
143
|
-
</el-button>
|
|
144
|
-
</div>
|
|
145
|
-
<div
|
|
146
|
-
v-if="entry.components && entry.components.length > 0"
|
|
147
|
-
class="block"
|
|
148
|
-
>
|
|
149
|
-
<div class="attribute-title-container">
|
|
150
|
-
<div class="attribute-title">Components</div>
|
|
151
|
-
</div>
|
|
152
|
-
<div
|
|
153
|
-
v-for="(component, i) in entry.components"
|
|
154
|
-
class="attribute-content"
|
|
155
|
-
:component-item-label="component"
|
|
156
|
-
:key="component"
|
|
157
|
-
@mouseenter="toggleConnectivityTooltip(component, {show: true})"
|
|
158
|
-
@mouseleave="toggleConnectivityTooltip(component, {show: false})"
|
|
159
|
-
>
|
|
160
|
-
{{ capitalise(component) }}
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
<div
|
|
164
|
-
v-if="entry.destinations && entry.destinations.length > 0"
|
|
165
|
-
class="block"
|
|
166
|
-
>
|
|
167
|
-
<div class="attribute-title-container">
|
|
168
|
-
<span class="attribute-title">Destination</span>
|
|
169
|
-
<el-popover
|
|
170
|
-
width="250"
|
|
171
|
-
trigger="hover"
|
|
172
|
-
:teleported="false"
|
|
173
|
-
popper-class="popover-origin-help"
|
|
76
|
+
<div>
|
|
77
|
+
<el-button
|
|
78
|
+
:class="activeView === 'listView' ? 'button' : 'el-button-secondary'"
|
|
79
|
+
@click="switchConnectivityView('listView')"
|
|
174
80
|
>
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
<div
|
|
184
|
-
v-for="(destination, i) in entry.destinations"
|
|
185
|
-
class="attribute-content"
|
|
186
|
-
:destination-item-label="destination"
|
|
187
|
-
:key="destination"
|
|
188
|
-
@mouseenter="toggleConnectivityTooltip(destination, {show: true})"
|
|
189
|
-
@mouseleave="toggleConnectivityTooltip(destination, {show: false})"
|
|
190
|
-
>
|
|
191
|
-
{{ capitalise(destination) }}
|
|
81
|
+
List view
|
|
82
|
+
</el-button>
|
|
83
|
+
<el-button
|
|
84
|
+
:class="activeView === 'graphView' ? 'button' : 'el-button-secondary'"
|
|
85
|
+
@click="switchConnectivityView('graphView')"
|
|
86
|
+
>
|
|
87
|
+
Graph view
|
|
88
|
+
</el-button>
|
|
192
89
|
</div>
|
|
193
|
-
<el-button
|
|
194
|
-
v-show="
|
|
195
|
-
entry.destinationsWithDatasets &&
|
|
196
|
-
entry.destinationsWithDatasets.length > 0 &&
|
|
197
|
-
shouldShowExploreButton(entry.destinationsWithDatasets)
|
|
198
|
-
"
|
|
199
|
-
class="button"
|
|
200
|
-
@click="openAxons"
|
|
201
|
-
>
|
|
202
|
-
Explore destination data
|
|
203
|
-
</el-button>
|
|
204
|
-
</div>
|
|
205
|
-
<div
|
|
206
|
-
v-show="
|
|
207
|
-
entry.componentsWithDatasets &&
|
|
208
|
-
entry.componentsWithDatasets.length > 0 &&
|
|
209
|
-
shouldShowExploreButton(entry.componentsWithDatasets)
|
|
210
|
-
"
|
|
211
|
-
class="block"
|
|
212
|
-
>
|
|
213
|
-
<el-button
|
|
214
|
-
class="button"
|
|
215
|
-
@click="openAll"
|
|
216
|
-
>
|
|
217
|
-
Search for data on components
|
|
218
|
-
</el-button>
|
|
219
90
|
</div>
|
|
91
|
+
</div>
|
|
220
92
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
93
|
+
<div class="content-container content-container-connectivity" v-show="activeView === 'listView'">
|
|
94
|
+
<connectivity-list
|
|
95
|
+
v-loading="connectivityLoading"
|
|
96
|
+
:key="connectivityListKey"
|
|
97
|
+
:entry="entry"
|
|
98
|
+
:origins="origins"
|
|
99
|
+
:components="components"
|
|
100
|
+
:destinations="destinations"
|
|
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>
|
|
229
109
|
</div>
|
|
230
110
|
|
|
231
111
|
<div class="content-container" v-show="activeView === 'graphView'">
|
|
232
112
|
<template v-if="graphViewLoaded">
|
|
233
113
|
<connectivity-graph
|
|
234
|
-
|
|
114
|
+
v-loading="connectivityLoading"
|
|
115
|
+
:key="connectivityGraphKey"
|
|
235
116
|
:entry="entry.featureId[0]"
|
|
236
|
-
:mapServer="
|
|
117
|
+
:mapServer="flatmapApi"
|
|
237
118
|
:sckanVersion="sckanVersion"
|
|
119
|
+
:connectivityFromMap="connectivityFromMap"
|
|
238
120
|
@tap-node="onTapNode"
|
|
239
121
|
ref="connectivityGraphRef"
|
|
240
122
|
/>
|
|
@@ -252,11 +134,6 @@
|
|
|
252
134
|
</template>
|
|
253
135
|
|
|
254
136
|
<script>
|
|
255
|
-
import {
|
|
256
|
-
ArrowUp as ElIconArrowUp,
|
|
257
|
-
ArrowDown as ElIconArrowDown,
|
|
258
|
-
Warning as ElIconWarning,
|
|
259
|
-
} from '@element-plus/icons-vue'
|
|
260
137
|
/* eslint-disable no-alert, no-console */
|
|
261
138
|
import {
|
|
262
139
|
ElButton as Button,
|
|
@@ -268,6 +145,7 @@ import EventBus from './EventBus.js'
|
|
|
268
145
|
import {
|
|
269
146
|
CopyToClipboard,
|
|
270
147
|
ConnectivityGraph,
|
|
148
|
+
ConnectivityList,
|
|
271
149
|
ExternalResourceCard,
|
|
272
150
|
} from '@abi-software/map-utilities';
|
|
273
151
|
import '@abi-software/map-utilities/dist/style.css';
|
|
@@ -291,17 +169,24 @@ export default {
|
|
|
291
169
|
Button,
|
|
292
170
|
Container,
|
|
293
171
|
Icon,
|
|
294
|
-
ElIconArrowUp,
|
|
295
|
-
ElIconArrowDown,
|
|
296
|
-
ElIconWarning,
|
|
297
172
|
ExternalResourceCard,
|
|
298
173
|
CopyToClipboard,
|
|
299
174
|
ConnectivityGraph,
|
|
175
|
+
ConnectivityList,
|
|
300
176
|
},
|
|
301
177
|
props: {
|
|
302
|
-
|
|
303
|
-
type:
|
|
304
|
-
default:
|
|
178
|
+
entry: {
|
|
179
|
+
type: Object,
|
|
180
|
+
default: () => ({
|
|
181
|
+
origins: [],
|
|
182
|
+
components: [],
|
|
183
|
+
destinations: [],
|
|
184
|
+
originsWithDatasets: [],
|
|
185
|
+
componentsWithDatasets: [],
|
|
186
|
+
destinationsWithDatasets: [],
|
|
187
|
+
resource: undefined,
|
|
188
|
+
featuresAlert: undefined,
|
|
189
|
+
}),
|
|
305
190
|
},
|
|
306
191
|
envVars: {
|
|
307
192
|
type: Object,
|
|
@@ -311,43 +196,58 @@ export default {
|
|
|
311
196
|
type: Array,
|
|
312
197
|
default: () => [],
|
|
313
198
|
},
|
|
199
|
+
useDOIFormatter: {
|
|
200
|
+
type: Boolean,
|
|
201
|
+
default: true,
|
|
202
|
+
},
|
|
314
203
|
},
|
|
315
204
|
data: function () {
|
|
316
205
|
return {
|
|
317
206
|
controller: undefined,
|
|
318
207
|
activeSpecies: undefined,
|
|
319
|
-
pubmedSearchUrl: '',
|
|
320
208
|
loading: false,
|
|
321
209
|
activeView: 'listView',
|
|
322
|
-
facetList: [],
|
|
323
210
|
showToolip: false,
|
|
324
211
|
showDetails: false,
|
|
325
212
|
originDescriptions: {
|
|
326
213
|
motor: 'is the location of the initial cell body of the circuit',
|
|
327
214
|
sensory: 'is the location of the initial cell body in the PNS circuit',
|
|
328
215
|
},
|
|
216
|
+
origins: [],
|
|
217
|
+
originsWithDatasets: [],
|
|
218
|
+
components: [],
|
|
329
219
|
componentsWithDatasets: [],
|
|
220
|
+
destinations: [],
|
|
221
|
+
destinationsWithDatasets: [],
|
|
222
|
+
connectivityFromMap: null,
|
|
330
223
|
uberons: [{ id: undefined, name: undefined }],
|
|
331
224
|
connectivityError: null,
|
|
332
225
|
timeoutID: undefined,
|
|
333
226
|
graphViewLoaded: false,
|
|
334
227
|
updatedCopyContent: '',
|
|
335
|
-
|
|
228
|
+
sckanVersion: '',
|
|
229
|
+
connectivitySource: 'sckan',
|
|
230
|
+
mapuuid: '',
|
|
231
|
+
mapId: '',
|
|
232
|
+
dualConnectionSource: false,
|
|
233
|
+
flatmapApi: '',
|
|
234
|
+
connectivityListKey: '',
|
|
235
|
+
connectivityGraphKey: '',
|
|
236
|
+
connectivityLoading: false,
|
|
336
237
|
}
|
|
337
238
|
},
|
|
338
239
|
watch: {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
this.
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
240
|
+
entry: function (newVal, oldVal) {
|
|
241
|
+
if (newVal !== oldVal) {
|
|
242
|
+
this.connectivityLoading = true;
|
|
243
|
+
this.updateKeys();
|
|
244
|
+
this.updateGraphConnectivity();
|
|
245
|
+
this.updateConnectionsData(newVal);
|
|
246
|
+
this.connectivityLoading = false;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
346
249
|
},
|
|
347
250
|
computed: {
|
|
348
|
-
entry: function () {
|
|
349
|
-
return this.connectivityEntry[this.entryIndex];
|
|
350
|
-
},
|
|
351
251
|
resources: function () {
|
|
352
252
|
let resources = [];
|
|
353
253
|
if (this.entry && this.entry.hyperlinks) {
|
|
@@ -375,90 +275,23 @@ export default {
|
|
|
375
275
|
text += ' species'
|
|
376
276
|
return text
|
|
377
277
|
},
|
|
378
|
-
sckanVersion: function () {
|
|
379
|
-
return this.entry.knowledgeSource
|
|
380
|
-
},
|
|
381
|
-
previousLabel: function () {
|
|
382
|
-
if (this.entryIndex === 0) {
|
|
383
|
-
return "This is the first item"
|
|
384
|
-
}
|
|
385
|
-
return this.connectivityEntry[this.entryIndex - 1].title
|
|
386
|
-
},
|
|
387
|
-
nextLabel: function () {
|
|
388
|
-
if (this.entryIndex === this.connectivityEntry.length - 1) {
|
|
389
|
-
return "This is the last item"
|
|
390
|
-
}
|
|
391
|
-
return this.connectivityEntry[this.entryIndex + 1].title
|
|
392
|
-
}
|
|
393
278
|
},
|
|
394
279
|
methods: {
|
|
395
|
-
previous: function () {
|
|
396
|
-
if (this.entryIndex !== 0) {
|
|
397
|
-
this.entryIndex = this.entryIndex - 1;
|
|
398
|
-
}
|
|
399
|
-
},
|
|
400
|
-
next: function () {
|
|
401
|
-
if (this.entryIndex !== this.connectivityEntry.length - 1) {
|
|
402
|
-
this.entryIndex = this.entryIndex + 1;
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
280
|
titleCase: function (title) {
|
|
406
281
|
return titleCase(title)
|
|
407
282
|
},
|
|
408
283
|
capitalise: function (text) {
|
|
409
284
|
return capitalise(text)
|
|
410
285
|
},
|
|
411
|
-
|
|
412
|
-
window.open(url, '_blank')
|
|
413
|
-
},
|
|
414
|
-
openAll: function () {
|
|
415
|
-
EventBus.emit('onConnectivityActionClick', {
|
|
416
|
-
type: 'Facets',
|
|
417
|
-
labels: this.entry.componentsWithDatasets.map((a) => a.name.toLowerCase()),
|
|
418
|
-
})
|
|
419
|
-
},
|
|
420
|
-
openAxons: function () {
|
|
421
|
-
EventBus.emit('onConnectivityActionClick', {
|
|
422
|
-
type: 'Facets',
|
|
423
|
-
labels: this.entry.destinationsWithDatasets.map((a) => a.name.toLowerCase()),
|
|
424
|
-
})
|
|
425
|
-
},
|
|
426
|
-
// shouldShowExploreButton: Checks if the feature is in the list of available anatomy facets
|
|
427
|
-
shouldShowExploreButton: function (features) {
|
|
428
|
-
for (let i = 0; i < features.length; i++) {
|
|
429
|
-
if (this.facetList.includes(features[i].name.toLowerCase())) {
|
|
430
|
-
return true
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
return false
|
|
434
|
-
},
|
|
435
|
-
// convertFacetsToList: Converts the available anatomy facets to a list for easy searching
|
|
436
|
-
convertFacetsToList: function (facets) {
|
|
437
|
-
facets.forEach((facet) => {
|
|
438
|
-
if(facet.children) {
|
|
439
|
-
this.convertFacetsToList(facet.children)
|
|
440
|
-
} else {
|
|
441
|
-
this.facetList.push(facet.label.toLowerCase())
|
|
442
|
-
}
|
|
443
|
-
})
|
|
444
|
-
},
|
|
445
|
-
openDendrites: function () {
|
|
446
|
-
EventBus.emit('onConnectivityActionClick', {
|
|
447
|
-
type: 'Facets',
|
|
448
|
-
labels: this.entry.originsWithDatasets.map((a) => a.name.toLowerCase()),
|
|
449
|
-
})
|
|
450
|
-
},
|
|
451
|
-
pubmedSearchUrlUpdate: function (val) {
|
|
452
|
-
this.pubmedSearchUrl = val
|
|
453
|
-
},
|
|
454
|
-
showConnectivity: function () {
|
|
286
|
+
showConnectivity: function (entry) {
|
|
455
287
|
// move the map center to highlighted area
|
|
456
|
-
const featureIds =
|
|
288
|
+
const featureIds = entry.featureId || [];
|
|
457
289
|
// connected to flatmapvuer > moveMap(featureIds) function
|
|
458
290
|
this.$emit('show-connectivity', featureIds);
|
|
459
291
|
},
|
|
460
292
|
switchConnectivityView: function (val) {
|
|
461
293
|
this.activeView = val;
|
|
294
|
+
this.setState();
|
|
462
295
|
|
|
463
296
|
if (val === 'graphView' && !this.graphViewLoaded) {
|
|
464
297
|
// to load the connectivity graph only after the container is in view
|
|
@@ -541,28 +374,28 @@ export default {
|
|
|
541
374
|
}
|
|
542
375
|
|
|
543
376
|
// Origins
|
|
544
|
-
if (this.
|
|
377
|
+
if (this.origins?.length) {
|
|
545
378
|
const title = 'Origin';
|
|
546
|
-
const origins = this.
|
|
547
|
-
const originsWithDatasets = this.
|
|
379
|
+
const origins = this.origins;
|
|
380
|
+
const originsWithDatasets = this.originsWithDatasets;
|
|
548
381
|
const transformedOrigins = transformData(title, origins, originsWithDatasets);
|
|
549
382
|
contentArray.push(transformedOrigins);
|
|
550
383
|
}
|
|
551
384
|
|
|
552
385
|
// Components
|
|
553
|
-
if (this.
|
|
386
|
+
if (this.components?.length) {
|
|
554
387
|
const title = 'Components';
|
|
555
|
-
const components = this.
|
|
556
|
-
const componentsWithDatasets = this.
|
|
388
|
+
const components = this.components;
|
|
389
|
+
const componentsWithDatasets = this.componentsWithDatasets;
|
|
557
390
|
const transformedComponents = transformData(title, components, componentsWithDatasets);
|
|
558
391
|
contentArray.push(transformedComponents);
|
|
559
392
|
}
|
|
560
393
|
|
|
561
394
|
// Destination
|
|
562
|
-
if (this.
|
|
395
|
+
if (this.destinations?.length) {
|
|
563
396
|
const title = 'Destination';
|
|
564
|
-
const destinations = this.
|
|
565
|
-
const destinationsWithDatasets = this.
|
|
397
|
+
const destinations = this.destinations;
|
|
398
|
+
const destinationsWithDatasets = this.destinationsWithDatasets;
|
|
566
399
|
const transformedDestinations = transformData(title, destinations, destinationsWithDatasets);
|
|
567
400
|
contentArray.push(transformedDestinations);
|
|
568
401
|
}
|
|
@@ -582,9 +415,9 @@ export default {
|
|
|
582
415
|
},
|
|
583
416
|
toggleConnectivityTooltip: function (name, option) {
|
|
584
417
|
const allWithDatasets = [
|
|
585
|
-
...this.
|
|
586
|
-
...this.
|
|
587
|
-
...this.
|
|
418
|
+
...this.componentsWithDatasets,
|
|
419
|
+
...this.destinationsWithDatasets,
|
|
420
|
+
...this.originsWithDatasets,
|
|
588
421
|
];
|
|
589
422
|
const names = name.split(','); // some features have more than one value
|
|
590
423
|
const data = [];
|
|
@@ -660,9 +493,118 @@ export default {
|
|
|
660
493
|
this.connectivityError = null;
|
|
661
494
|
}, ERROR_TIMEOUT);
|
|
662
495
|
},
|
|
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
|
+
},
|
|
663
591
|
},
|
|
664
592
|
mounted: function () {
|
|
665
|
-
this.
|
|
593
|
+
this.sckanVersion = this.entry['knowledge-source'];
|
|
594
|
+
this.mapuuid = this.entry['mapuuid'];
|
|
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
|
+
|
|
666
608
|
EventBus.on('connectivity-graph-error', (errorInfo) => {
|
|
667
609
|
this.pushConnectivityError(errorInfo);
|
|
668
610
|
});
|
|
@@ -690,11 +632,6 @@ export default {
|
|
|
690
632
|
}
|
|
691
633
|
}
|
|
692
634
|
|
|
693
|
-
.button-container {
|
|
694
|
-
display: flex;
|
|
695
|
-
justify-content: space-between;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
635
|
.title {
|
|
699
636
|
text-align: left;
|
|
700
637
|
// width: 16em;
|
|
@@ -748,17 +685,8 @@ export default {
|
|
|
748
685
|
}
|
|
749
686
|
}
|
|
750
687
|
|
|
751
|
-
.info,
|
|
752
688
|
.alert {
|
|
753
689
|
color: #8300bf;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
.info {
|
|
757
|
-
transform: rotate(180deg);
|
|
758
|
-
margin-left: 8px;
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
.alert {
|
|
762
690
|
margin-left: 5px;
|
|
763
691
|
vertical-align: text-bottom;
|
|
764
692
|
|
|
@@ -818,39 +746,6 @@ export default {
|
|
|
818
746
|
text-transform: uppercase;
|
|
819
747
|
}
|
|
820
748
|
|
|
821
|
-
.attribute-content {
|
|
822
|
-
font-size: 14px;
|
|
823
|
-
font-weight: 500;
|
|
824
|
-
transition: color 0.25s ease;
|
|
825
|
-
position: relative;
|
|
826
|
-
cursor: default;
|
|
827
|
-
|
|
828
|
-
&:hover {
|
|
829
|
-
color: $app-primary-color;
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
+ .attribute-content {
|
|
833
|
-
&::before {
|
|
834
|
-
content: "";
|
|
835
|
-
width: 90%;
|
|
836
|
-
height: 1px;
|
|
837
|
-
background-color: var(--el-border-color);
|
|
838
|
-
position: absolute;
|
|
839
|
-
top: 0;
|
|
840
|
-
left: 0;
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
&:last-of-type {
|
|
845
|
-
margin-bottom: 0.5em;
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
.popover-container {
|
|
850
|
-
height: 100%;
|
|
851
|
-
width: 100%;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
749
|
.main {
|
|
855
750
|
.el-button.is-round {
|
|
856
751
|
border-radius: 4px;
|
|
@@ -907,6 +802,12 @@ export default {
|
|
|
907
802
|
margin-top: 0 !important;
|
|
908
803
|
margin-left: 10px !important;
|
|
909
804
|
}
|
|
805
|
+
|
|
806
|
+
> div:first-child {
|
|
807
|
+
display: flex;
|
|
808
|
+
align-items: center;
|
|
809
|
+
gap: 0.5rem;
|
|
810
|
+
}
|
|
910
811
|
}
|
|
911
812
|
|
|
912
813
|
.population-display {
|
|
@@ -917,6 +818,23 @@ export default {
|
|
|
917
818
|
justify-content: space-between;
|
|
918
819
|
border-bottom: 1px solid $app-primary-color;
|
|
919
820
|
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
|
+
}
|
|
920
838
|
}
|
|
921
839
|
|
|
922
840
|
.tooltip-container {
|
|
@@ -1038,25 +956,4 @@ export default {
|
|
|
1038
956
|
margin-top: -1.25rem;
|
|
1039
957
|
}
|
|
1040
958
|
}
|
|
1041
|
-
|
|
1042
|
-
.connectivity-error-container {
|
|
1043
|
-
position: sticky;
|
|
1044
|
-
bottom: 0.5rem;
|
|
1045
|
-
width: 100%;
|
|
1046
|
-
min-height: 31px; // placeholder
|
|
1047
|
-
margin-top: -10px !important;
|
|
1048
|
-
display: flex;
|
|
1049
|
-
flex-direction: row;
|
|
1050
|
-
align-items: center;
|
|
1051
|
-
justify-content: center;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
.connectivity-error {
|
|
1055
|
-
width: fit-content;
|
|
1056
|
-
font-size: 12px;
|
|
1057
|
-
padding: 0.25rem 0.5rem;
|
|
1058
|
-
background-color: var(--el-color-error-light-9);
|
|
1059
|
-
border-radius: var(--el-border-radius-small);
|
|
1060
|
-
border: 1px solid var(--el-color-error);
|
|
1061
|
-
}
|
|
1062
959
|
</style>
|