@abi-software/flatmapvuer 0.5.9-alpha-connected-paths.2 → 0.5.9-beta.1

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 (39) hide show
  1. package/CHANGELOG.md +389 -399
  2. package/LICENSE +201 -201
  3. package/README.md +105 -105
  4. package/babel.config.js +14 -14
  5. package/dist/flatmapvuer.common.js +1940 -1543
  6. package/dist/flatmapvuer.common.js.map +1 -1
  7. package/dist/flatmapvuer.css +1 -1
  8. package/dist/flatmapvuer.umd.js +1940 -1543
  9. package/dist/flatmapvuer.umd.js.map +1 -1
  10. package/dist/flatmapvuer.umd.min.js +2 -2
  11. package/dist/flatmapvuer.umd.min.js.map +1 -1
  12. package/package-lock.json +18425 -14418
  13. package/package.json +79 -78
  14. package/public/index.html +17 -17
  15. package/src/App.vue +228 -227
  16. package/src/assets/_variables.scss +43 -43
  17. package/src/assets/styles.scss +7 -7
  18. package/src/components/AnnotationTool.vue +402 -0
  19. package/src/components/EventBus.js +2 -2
  20. package/src/components/ExternalResourceCard.vue +98 -98
  21. package/src/components/FlatmapVuer.vue +2039 -1884
  22. package/src/components/MultiFlatmapVuer.vue +531 -529
  23. package/src/components/ProvenancePopup.vue +432 -0
  24. package/src/components/SelectionsGroup.vue +249 -249
  25. package/src/components/Tooltip.vue +55 -454
  26. package/src/components/TreeControls.vue +231 -231
  27. package/src/components/index.js +9 -9
  28. package/src/components/legends/DynamicLegends.vue +112 -112
  29. package/src/components/legends/SvgLegends.vue +66 -66
  30. package/src/icons/fonts/mapicon-species.eot +0 -0
  31. package/src/icons/fonts/mapicon-species.svg +14 -14
  32. package/src/icons/fonts/mapicon-species.ttf +0 -0
  33. package/src/icons/fonts/mapicon-species.woff +0 -0
  34. package/src/icons/mapicon-species-style.css +42 -42
  35. package/src/legends/legend.svg +25 -25
  36. package/src/main.js +8 -8
  37. package/src/services/flatmapQueries.js +415 -415
  38. package/vue.config.js +31 -31
  39. package/src/nerve-map.js +0 -99
@@ -1,1884 +1,2039 @@
1
- <template>
2
- <div
3
- class="flatmap-container"
4
- ref="flatmapContainer"
5
- v-loading="loading"
6
- element-loading-text="Loading..."
7
- element-loading-spinner="el-icon-loading"
8
- element-loading-background="rgba(0, 0, 0, 0.3)"
9
- >
10
- <map-svg-sprite-color />
11
- <div style="height:100%;width:100%;position:relative;overflow-y:none">
12
- <div style="height:100%;width:100%;" ref="display"></div>
13
- <div class="beta-popovers">
14
- <div>
15
- <el-popover
16
- placement="right"
17
- :appendToBody="false"
18
- trigger="manual"
19
- popper-class="warning-popper flatmap-popper right-popper"
20
- v-model="hoverVisibilities[6].value"
21
- ref="warningPopover"
22
- >
23
- <p v-if="isLegacy" @mouseover="showToolitip(6)" @mouseout="hideToolitip(6)">
24
- This is a legacy map, you may view the latest map instead.
25
- </p>
26
- <p v-else-if="isFC" @mouseover="showToolitip(6)" @mouseout="hideToolitip(6)">
27
- This map displays the connectivity of individual neurons.
28
- Specifically, those which align with (parts of) the neuron
29
- populations from the
30
- <a href="https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew" target="_blank" >
31
- ApiNATOMY
32
- </a>
33
- models available in
34
- <a href="https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD" target="_blank" >
35
- SCKAN
36
- </a>.
37
- </p>
38
- <p v-else @mouseover="showToolitip(6)" @mouseout="hideToolitip(6)">
39
- This map displays the connectivity of neuron populations.
40
- Specifically, those from the primarily rat-based
41
- <a href="https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew" target="_blank" >
42
- ApiNATOMY
43
- </a>
44
- models available in
45
- <a href="https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD" target="_blank" >
46
- SCKAN
47
- </a>. New connectivity and species
48
- specificity will be added as the SPARC program progresses.
49
- </p>
50
- </el-popover>
51
- <i
52
- class="el-icon-warning warning-icon"
53
- v-if="displayWarning"
54
- @mouseover="showToolitip(6)"
55
- @mouseout="hideToolitip(6)"
56
- v-popover:warningPopover
57
- >
58
- <template v-if="isLegacy">
59
- <span class="warning-text">Legacy Map</span>
60
- <div class="latest-map-text" @click="viewLatestMap">Click here for the latest map</div>
61
- </template>
62
- <template v-else>
63
- <span class="warning-text">Beta</span>
64
- </template>
65
- </i>
66
- </div>
67
- <el-popover
68
- :content="latestChangesMessage"
69
- placement="right"
70
- v-if="displayLatestChanges"
71
- :appendToBody="false"
72
- trigger="manual"
73
- popper-class="warning-popper flatmap-popper right-popper"
74
- v-model="hoverVisibilities[7].value"
75
- ref="latestChangesPopover"
76
- ></el-popover>
77
- <i
78
- class="el-icon-warning latest-changesicon"
79
- v-if="displayLatestChanges && latestChangesMessage"
80
- @mouseover="showToolitip(7)"
81
- @mouseout="hideToolitip(7)"
82
- v-popover:latestChangesPopover
83
- >
84
- <span class="warning-text">What's new?</span>
85
- </i>
86
- </div>
87
-
88
- <!-- The element below is placed onto the flatmap when it is ready -->
89
- <i class="el-icon-arrow-down minimap-resize" :class="{ enlarge: minimapSmall, shrink: !minimapSmall}" ref="minimapResize" v-show="minimapResizeShow" @click="closeMinimap"></i>
90
-
91
- <div class="bottom-right-control">
92
- <el-popover
93
- content="Zoom in"
94
- placement="left"
95
- :appendToBody="false"
96
- trigger="manual"
97
- popper-class="flatmap-popper left-popper"
98
- v-model="hoverVisibilities[0].value"
99
- >
100
- <map-svg-icon
101
- icon="zoomIn"
102
- class="icon-button zoomIn"
103
- slot="reference"
104
- @click.native="zoomIn()"
105
- @mouseover.native="showToolitip(0)"
106
- @mouseout.native="hideToolitip(0)"
107
- />
108
- </el-popover>
109
- <el-popover
110
- content="Zoom out"
111
- placement="top-end"
112
- :appendToBody="false"
113
- trigger="manual"
114
- popper-class="flatmap-popper popper-zoomout"
115
- v-model="hoverVisibilities[1].value"
116
- >
117
- <map-svg-icon
118
- icon="zoomOut"
119
- class="icon-button zoomOut"
120
- slot="reference"
121
- @click.native="zoomOut()"
122
- @mouseover.native="showToolitip(1)"
123
- @mouseout.native="hideToolitip(1)"
124
- />
125
- </el-popover>
126
- <el-popover
127
- content="Reset"
128
- placement="top"
129
- :appendToBody="false"
130
- trigger="manual"
131
- popper-class="flatmap-popper"
132
- v-model="hoverVisibilities[2].value"
133
- >
134
- <div>
135
- Fit to
136
- <br>
137
- window
138
- </div>
139
- <map-svg-icon
140
- slot="reference"
141
- icon="fitWindow"
142
- class="icon-button fitWindow"
143
- @click.native="resetView()"
144
- @mouseover.native="showToolitip(2)"
145
- @mouseout.native="hideToolitip(2)"
146
- />
147
- </el-popover>
148
- </div>
149
- <el-popover
150
- content="Change pathway visibility"
151
- placement="right"
152
- :appendToBody="false"
153
- trigger="manual"
154
- popper-class="flatmap-popper right-popper"
155
- v-model="hoverVisibilities[4].value"
156
- ref="checkBoxPopover"
157
- />
158
- <div class="pathway-location" :class="{ open: drawerOpen, close: !drawerOpen }">
159
- <div
160
- class="pathway-container"
161
- :style="{'max-height': pathwaysMaxHeight + 'px'}"
162
- v-if="pathControls"
163
- v-popover:checkBoxPopover
164
- >
165
- <svg-legends v-if="!isFC" class="svg-legends-container"/>
166
- <el-popover
167
- content="Find these markers for data"
168
- placement="right"
169
- :appendToBody="false"
170
- trigger="manual"
171
- popper-class="flatmap-popper popper-bump-right right-popper"
172
- v-model="hoverVisibilities[5].value"
173
- ref="markerPopover"
174
- ></el-popover>
175
- <div
176
- v-show="hoverVisibilities[5].value"
177
- class="flatmap-marker-help"
178
- v-html="flatmapMarker"
179
- v-popover:markerPopover
180
- ></div>
181
- <tree-controls
182
- v-if="isFC && systems && systems.length > 0"
183
- :active="currentActive"
184
- :hover="currentHover"
185
- :tree-data="systems"
186
- ref="treeControls"
187
- @changed="systemSelected"
188
- @checkAll="checkAllSystems"
189
- @change-active="ftuSelected"
190
- />
191
- <selections-group
192
- v-if="!isFC && centreLines && centreLines.length > 0"
193
- title="Nerves"
194
- labelKey="label"
195
- identifierKey="key"
196
- :selections="centreLines"
197
- @changed="centreLinesSelected"
198
- ref="centrelinesSelection"
199
- key="centrelinesSelection"
200
- />
201
- <!--
202
- <selections-group
203
- v-if="isFC && sckanDisplay && sckanDisplay.length > 0"
204
- title="SCKAN"
205
- labelKey="label"
206
- identifierKey="key"
207
- :selections="sckanDisplay"
208
- @changed="sckanSelected"
209
- @checkAll="checkAllSCKAN"
210
- ref="skcanSelection"
211
- key="skcanSelection"
212
- />
213
- <selections-group
214
- v-if="layers && layers.length > 0"
215
- title="Layers"
216
- labelKey="description"
217
- identifierKey="id"
218
- :selections="layers"
219
- @changed="layersSelected"
220
- @checkAll="checkAllLayers"
221
- ref="layersSelection"
222
- key="layersSelection"
223
- />
224
- -->
225
- <selections-group
226
- v-if="!isFC && taxonConnectivity && taxonConnectivity.length > 0"
227
- title="Observed in"
228
- labelKey="label"
229
- identifierKey="taxon"
230
- :selections="taxonConnectivity"
231
- @changed="taxonsSelected"
232
- @checkAll="checkAllTaxons"
233
- ref="taxonSelection"
234
- key="taxonSelection"
235
- />
236
- <selections-group
237
- v-if="pathways && pathways.length > 0"
238
- title="Pathways"
239
- labelKey="label"
240
- identifierKey="type"
241
- colourStyle="line"
242
- :selections="pathways"
243
- @changed="pathwaysSelected"
244
- @checkAll="checkAllPathways"
245
- ref="pathwaysSelection"
246
- key="pathwaysSelection"
247
- />
248
- </div>
249
- <div
250
- @click="toggleDrawer"
251
- class="drawer-button"
252
- :class="{ open: drawerOpen, close: !drawerOpen }"
253
- >
254
- <i class="el-icon-arrow-left"></i>
255
- </div>
256
- </div>
257
- <el-popover
258
- ref="open-map-popover"
259
- placement="top-start"
260
- width="128"
261
- :append-to-body="false"
262
- trigger="click"
263
- popper-class="open-map-popper non-selectable"
264
- >
265
- <el-row v-for="item in openMapOptions" :key="item.key">
266
- <el-button
267
- type="primary"
268
- plain
269
- @click="$emit('open-map', item.key)"
270
- >
271
- {{item.display}}
272
- </el-button>
273
- </el-row>
274
- </el-popover>
275
- <el-popover
276
- ref="backgroundPopover"
277
- placement="top-start"
278
- width="175"
279
- :appendToBody="false"
280
- trigger="click"
281
- popper-class="background-popper"
282
- >
283
- <el-row class="backgroundText">HighlightTool</el-row>
284
- <el-row class="backgroundControl">
285
- <el-radio-group v-model="highlightToolOn" class="flatmap-radio" @change="setHighlightTool">
286
- <el-radio :label="true">On</el-radio>
287
- <el-radio :label="false">Off</el-radio>
288
- </el-radio-group>
289
- </el-row>
290
- <el-row class="backgroundText">Organs display</el-row>
291
- <el-row class="backgroundControl">
292
- <el-radio-group v-model="colourRadio" class="flatmap-radio" @change="setColour">
293
- <el-radio :label="true">Colour</el-radio>
294
- <el-radio :label="false">Greyscale</el-radio>
295
- </el-radio-group>
296
- </el-row>
297
- <el-row class="backgroundSpacer"></el-row>
298
- <el-row class="backgroundText">Outlines display</el-row>
299
- <el-row class="backgroundControl">
300
- <el-radio-group v-model="outlinesRadio" class="flatmap-radio" @change="setOutlines">
301
- <el-radio :label="true">Show</el-radio>
302
- <el-radio :label="false">Hide</el-radio>
303
- </el-radio-group>
304
- </el-row>
305
- <el-row class="backgroundSpacer"></el-row>
306
- <el-row class="backgroundText">Change background</el-row>
307
- <el-row class="backgroundControl">
308
- <div
309
- v-for="item in availableBackground"
310
- :key="item"
311
- :class="['backgroundChoice', item, item == currentBackground ? 'active' :'']"
312
- @click="backgroundChangeCallback(item)"
313
- />
314
- </el-row>
315
- </el-popover>
316
- <div
317
- class="settings-group"
318
- :class="{ open: drawerOpen, close: !drawerOpen }"
319
- >
320
- <el-row>
321
- <el-popover
322
- v-model="hoverVisibilities[8].value"
323
- content="Open new map"
324
- placement="right"
325
- :append-to-body="false"
326
- trigger="manual"
327
- popper-class="flatmap-popper right-popper"
328
- >
329
- <map-svg-icon
330
- v-if="enableOpenMapUI && openMapOptions.length > 0"
331
- slot="reference"
332
- v-popover:open-map-popover
333
- icon="openMap"
334
- class="icon-button"
335
- @mouseover.native="showToolitip(8)"
336
- @mouseout.native="hideToolitip(8)"
337
- />
338
- </el-popover>
339
- </el-row>
340
- <el-row>
341
- <el-popover
342
- content="Change settings"
343
- placement="right"
344
- v-model="hoverVisibilities[3].value"
345
- :appendToBody="false"
346
- trigger="manual"
347
- popper-class="flatmap-popper right-popper"
348
- >
349
- <map-svg-icon
350
- v-popover:backgroundPopover
351
- icon="changeBckgd"
352
- class="icon-button"
353
- slot="reference"
354
- @mouseover.native="showToolitip(3)"
355
- @mouseout.native="hideToolitip(3)"
356
- />
357
- </el-popover>
358
- </el-row>
359
- </div>
360
- <Tooltip
361
- ref="tooltip"
362
- class="tooltip"
363
- @highlightConnectedPaths="highlightConnectedPaths"
364
- @onClose="closeTooltip"
365
- :entry="tooltipEntry"
366
- />
367
- </div>
368
- </div>
369
- </template>
370
-
371
- <script>
372
- /* eslint-disable no-alert, no-console */
373
- import Vue from "vue";
374
- import Tooltip from "./Tooltip";
375
- import SelectionsGroup from "./SelectionsGroup";
376
- import TreeControls from "./TreeControls";
377
- import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
378
- import SvgLegends from "./legends/SvgLegends";
379
- import {
380
- Button,
381
- Col,
382
- Loading,
383
- Radio,
384
- RadioGroup,
385
- Row
386
- } from "element-ui";
387
- import lang from "element-ui/lib/locale/lang/en";
388
- import locale from "element-ui/lib/locale";
389
- import flatmapMarker from "../icons/flatmap-marker";
390
- import {FlatmapQueries, findTaxonomyLabel} from "../services/flatmapQueries.js";
391
-
392
- locale.use(lang);
393
- Vue.use(Button);
394
- Vue.use(Col);
395
- Vue.use(Loading.directive);
396
- Vue.use(Radio);
397
- Vue.use(RadioGroup);
398
- Vue.use(Row);
399
- const ResizeSensor = require("css-element-queries/src/ResizeSensor");
400
-
401
- const processTaxon = (flatmapAPI, taxonIdentifiers) => {
402
- let processed = [];
403
- taxonIdentifiers.forEach(taxon => {
404
- findTaxonomyLabel(flatmapAPI, taxon).then(value => {
405
- const item = { taxon, label: value};
406
- processed.push(item);
407
- });
408
- });
409
-
410
- return processed;
411
- }
412
-
413
- const processFTUs = (parent, key) => {
414
- const ftus = [];
415
- let items = parent.organs ? parent.organs : parent.ftus;
416
- const children = items ? items.filter(
417
- (obj, index) =>
418
- items.findIndex((item) => item.label === obj.label) === index
419
- ) : undefined
420
- if (children) {
421
- children.forEach(child => {
422
- const data = {
423
- label: child.label,
424
- models: child.models,
425
- key: `${key}.${child.label}`,
426
- };
427
- const grandChildren = processFTUs(child, data.key);
428
- if (grandChildren.length > 0) {
429
- data.children = grandChildren;
430
- }
431
- ftus.push(data);
432
- })
433
- }
434
- return ftus;
435
- }
436
-
437
- const processSystems = systems => {
438
- const allSystems = [];
439
- if (systems && systems.length > 0) {
440
- const data = { label: "All", key: "All", children: [] };
441
- systems.forEach(system => {
442
- const child = {
443
- colour: system.colour,
444
- enabled: system.enabled,
445
- label: system.id,
446
- key: system.id,
447
- };
448
- const children = processFTUs(system, child.key);
449
- if (children.length > 0)
450
- child.children = children;
451
- data.children.push(child);
452
- });
453
-
454
- allSystems.push(data);
455
- }
456
-
457
- return allSystems;
458
- }
459
-
460
- const createUnfilledTooltipData = function (){
461
- return {
462
- destinations: [],
463
- origins: [],
464
- components: [],
465
- destinationsWithDatasets: [],
466
- originsWithDatasets: [],
467
- componentsWithDatasets: [],
468
- resource: undefined
469
- }
470
- }
471
-
472
- export default {
473
- name: "FlatmapVuer",
474
- components: {
475
- MapSvgIcon,
476
- MapSvgSpriteColor,
477
- Tooltip,
478
- TreeControls,
479
- SelectionsGroup,
480
- SvgLegends
481
- },
482
- beforeCreate: function() {
483
- this.mapManager = undefined;
484
- this.mapImp = undefined;
485
- //The state watcher may triggered before
486
- //created causing issue, This flag will
487
- //resolve this issue.
488
- this.setStateRequired = false;
489
- },
490
- methods: {
491
- viewLatestMap: function() {
492
- let biologicalSex = this.biologicalSex ? this.biologicalSex : undefined;
493
- //Human requires special handling
494
- if (this.entry === "NCBITaxon:9606") {
495
- biologicalSex = "PATO:0000384";
496
- }
497
- const state = {
498
- entry: this.entry,
499
- biologicalSex,
500
- viewport: this.mapImp.getState()
501
- };
502
- this.$emit("view-latest-map", state);
503
- },
504
- backgroundChangeCallback: function(colour) {
505
- this.currentBackground = colour;
506
- if (this.mapImp) {
507
- this.mapImp.setBackgroundColour(this.currentBackground, 1);
508
- }
509
- },
510
- toggleDrawer: function() {
511
- this.drawerOpen = !this.drawerOpen;
512
- },
513
- /**
514
- * Function to toggle colour/greyscale of organs.
515
- */
516
- setColour: function(flag) {
517
- this.colourRadio = flag;
518
- if (this.mapImp) {
519
- this.mapImp.setColour({ colour: flag, outline: this.outlinesRadio });
520
- }
521
- },
522
- setHighlightTool: function(flag) {
523
- this.highlightToolOn = flag;
524
- },
525
- /**
526
- * Function to toggle outlines f organs.
527
- */
528
- setOutlines: function(flag) {
529
- this.outlineRadio = flag;
530
- if (this.mapImp) {
531
- this.mapImp.setColour({ colour: this.colourRadio, outline: flag });
532
- }
533
- },
534
- /**
535
- * Function to toggle paths to default.
536
- * Also called when the associated button is pressed.
537
- */
538
- resetView: function() {
539
- if (this.mapImp) {
540
- this.mapImp.resetMap();
541
- if (this.$refs.centrelinesSelection) {
542
- this.$refs.centrelinesSelection.reset();
543
- }
544
- if (this.$refs.skcanSelection) {
545
- this.$refs.skcanSelection.reset();
546
- }
547
- if (this.$refs.layersSelection) {
548
- this.$refs.layersSelection.reset();
549
- }
550
- if (this.$refs.systemsSelection) {
551
- this.$refs.pathwaysSelection.reset();
552
- }
553
- if (this.$refs.pathwaysSelection) {
554
- this.$refs.pathwaysSelection.reset();
555
- }
556
- }
557
- },
558
- /**
559
- * Function to zoom in.
560
- * Also called when the associated button is pressed.
561
- */
562
- zoomIn: function() {
563
- if (this.mapImp) {
564
- this.mapImp.zoomIn();
565
- }
566
- },
567
- /**
568
- * Function to zoom out.
569
- * Also called when the associated button is pressed.
570
- */
571
- zoomOut: function() {
572
- if (this.mapImp) {
573
- this.mapImp.zoomOut();
574
- }
575
- },
576
- centreLinesSelected: function(payload) {
577
- if (this.mapImp) {
578
- this.mapImp.enableCentrelines(payload.value);
579
- }
580
- },
581
- sckanSelected: function(payload) {
582
- if (this.mapImp) {
583
- this.mapImp.enableSckanPath(payload.key, payload.value);
584
- }
585
- },
586
- checkAllSCKAN: function(payload) {
587
- if (this.mapImp) {
588
- payload.keys.forEach(key => this.mapImp.enableSckanPath(key, payload.value));
589
- }
590
- },
591
- highlightConnectedPaths: function(payload) {
592
- if (this.mapImp) {
593
- let paths = [...this.mapImp.pathModelNodes(payload)]
594
- // The line below matches the paths to the annIdToFeatureId map to get the feature ids
595
-
596
- let pathFeatures = paths.map(p=>this.mapImp.featureProperties(p))
597
- let toHighlight = []
598
- pathFeatures.forEach(p=>{
599
- this.mapImp.nodePathModels(p.featureId).forEach(f=>{
600
- toHighlight.push(f)
601
- })
602
- })
603
- // display connected paths
604
- this.mapImp.zoomToFeatures(toHighlight, {noZoomIn: true});
605
- }
606
- },
607
- systemSelected: function(payload) {
608
- if (this.mapImp) {
609
- this.mapImp.enableSystem(payload.key, payload.value);
610
- }
611
- },
612
- checkAllSystems: function(flag) {
613
- if (this.mapImp) {
614
- this.systems[0].children.forEach(key => this.mapImp.enableSystem(key.label, flag));
615
- }
616
- },
617
- ftuSelected: function(models) {
618
- this.searchAndShowResult(models, true);
619
- },
620
- layersSelected: function(payload) {
621
- if (this.mapImp) {
622
- this.mapImp.enableLayer(payload.key, payload.value);
623
- }
624
- },
625
- checkAllLayers: function(payload) {
626
- if (this.mapImp) {
627
- payload.keys.forEach(key => this.mapImp.enableLayer(key, payload.value));
628
- }
629
- },
630
- taxonsSelected: function(payload) {
631
- if (this.mapImp) {
632
- this.mapImp.enableConnectivityByTaxonIds(payload.key, payload.value);
633
- }
634
- },
635
- checkAllTaxons: function(payload) {
636
- if (this.mapImp) {
637
- payload.keys.forEach(key => this.mapImp.enableConnectivityByTaxonIds(key, payload.value));
638
- }
639
- },
640
- pathwaysSelected: function(payload) {
641
- if (this.mapImp) {
642
- this.mapImp.enablePath(payload.key, payload.value);
643
- }
644
- },
645
- checkAllPathways: function(payload) {
646
- if (this.mapImp) {
647
- payload.keys.forEach(key => this.mapImp.enablePath(key, payload.value));
648
- }
649
- },
650
- enablePanZoomEvents: function(flag) {
651
- this.mapImp.enablePanZoomEvents(flag);
652
- },
653
- eventCallback: function() {
654
- return (eventType, data, ...args) => {
655
- if (eventType !== "pan-zoom") {
656
- const label = data.label;
657
- const resource = [data.models];
658
- const taxonomy = this.entry;
659
- const biologicalSex = this.biologicalSex;
660
- const payload = {
661
- dataset: data.dataset,
662
- biologicalSex: biologicalSex,
663
- taxonomy: taxonomy,
664
- resource: resource,
665
- label: label,
666
- feature: data,
667
- userData: args,
668
- eventType: eventType,
669
- provenanceTaxonomy: data.taxons ? JSON.parse(data.taxons) : undefined
670
- };
671
- if (eventType === "click") {
672
-
673
- if (this.highlightToolOn) {
674
- this.highlightConnectedPaths([data.models])
675
- } else {
676
- console.log('active changed')
677
- this.currentActive = data.models ? data.models : "";
678
- }
679
- } else if (eventType === "mouseenter" && !this.highlightToolOn) {
680
- console.log('active changed')
681
- this.currentHover = data.models ? data.models : "";
682
- }
683
- if (data && data.type !== "marker" && eventType === "click" && !this.highlightToolOn){
684
- this.checkAndCreatePopups(payload);
685
- }
686
- this.$emit("resource-selected", payload);
687
- } else {
688
- this.$emit("pan-zoom-callback", data);
689
- }
690
- };
691
- },
692
- // checkNeuronClicked shows a neuron path pop up if a path was recently clicked
693
- checkAndCreatePopups: async function(data) {
694
- // Call flatmap database to get the connection data
695
- let results = await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(data)
696
- // The line below only creates the tooltip if some data was found on the path
697
- // result 0 is the connection, result 1 is the pubmed results from flatmap
698
- if(results[0] || results[1] ||( data.feature.hyperlinks && data.feature.hyperlinks.length > 0)){
699
- this.resourceForTooltip = data.resource[0];
700
- data.resourceForTooltip = this.resourceForTooltip;
701
- this.createTooltipFromNeuronCuration(data);
702
- }
703
- },
704
- popUpCssHacks: function() {
705
- // Below is a hack to remove flatmap tooltips while popup is open
706
- let ftooltip = document.querySelector(".flatmap-tooltip-popup");
707
- if (ftooltip) ftooltip.style.display = "none";
708
- document.querySelector(".maplibregl-popup-close-button").style.display =
709
- "block";
710
- this.$refs.tooltip.$el.style.display = "flex";
711
- document.querySelector(".maplibregl-popup-close-button").onclick = () => {
712
- document.querySelector(".flatmap-tooltip-popup").style.display =
713
- "block";
714
- };
715
- },
716
- closeTooltip: function() {
717
- this.$refs.tooltip.$el.style.display = "none";
718
- document.querySelectorAll('.maplibregl-popup').forEach(item => {
719
- item.style.display = "none";
720
- });
721
- },
722
- createTooltipFromNeuronCuration: async function(data) {
723
- this.tooltipEntry = await this.flatmapQueries.createTooltipData(data);
724
- this.displayTooltip();
725
- },
726
- // Keeping this as an API
727
- showPopup: function(featureId, node, options) {
728
- let myOptions = options;
729
- if (this.mapImp) {
730
- if (myOptions) {
731
- if (!myOptions.className) myOptions.className = "custom-popup";
732
- } else {
733
- myOptions = { className: "custom-popup", positionAtLastClick: true };
734
- }
735
- this.mapImp.showPopup(featureId, node, myOptions);
736
- }
737
- },
738
- showMarkerPopup: function(featureId, node, options) {
739
- if (this.mapImp) {
740
- this.mapImp.showMarkerPopup(featureId, node, options);
741
- }
742
- },
743
- closeMinimap: function(){
744
- let minimapEl = this.$refs.flatmapContainer.querySelector('.maplibregl-ctrl-minimap'); // find minimap
745
- if (this.minimapSmall) { //switch the classes on the minimap
746
- minimapEl.classList.add('enlarge');
747
- minimapEl.classList.remove('shrink');
748
- } else {
749
- minimapEl.classList.add('shrink');
750
- minimapEl.classList.remove('enlarge');
751
- }
752
- this.minimapSmall = !this.minimapSmall;
753
- },
754
- addResizeButtonToMinimap: function(){
755
- let minimapEl = this.$refs.flatmapContainer.querySelector('.maplibregl-ctrl-minimap');
756
- if (minimapEl){
757
- this.$refs.minimapResize.parentNode.removeChild(this.$refs.minimapResize);
758
- minimapEl.appendChild(this.$refs.minimapResize);
759
- this.minimapResizeShow = true;
760
- }
761
- },
762
- setHelpMode: function(helpMode) {
763
- if (helpMode) {
764
- this.inHelp = true;
765
- this.hoverVisibilities.forEach(item => {
766
- item.value = true;
767
- });
768
- this.openFlatmapHelpPopup();
769
- } else {
770
- this.inHelp = false;
771
- this.hoverVisibilities.forEach(item => {
772
- item.value = false;
773
- });
774
- this.closeFlatmapHelpPopup();
775
- }
776
- },
777
- showToolitip: function(tooltipNumber) {
778
- if (!this.inHelp) {
779
- clearTimeout(this.tooltipWait[tooltipNumber]);
780
- this.tooltipWait[tooltipNumber] = setTimeout(() => {
781
- this.hoverVisibilities[tooltipNumber].value = true;
782
- }, 500);
783
- }
784
- },
785
- hideToolitip: function(tooltipNumber) {
786
- if (!this.inHelp) {
787
- clearTimeout(this.tooltipWait[tooltipNumber]);
788
- this.tooltipWait[tooltipNumber] = setTimeout(() => {
789
- this.hoverVisibilities[tooltipNumber].value = false;
790
- }, 500);
791
- }
792
- },
793
- displayTooltip: function() {
794
- this.mapImp.showPopup(
795
- this.mapImp.modelFeatureIds(this.resourceForTooltip)[0],
796
- this.$refs.tooltip.$el,
797
- { className: "flatmapvuer-popover", positionAtLastClick: true }
798
- );
799
- this.popUpCssHacks();
800
- },
801
- openFlatmapHelpPopup: function() {
802
- if (this.mapImp) {
803
- let heartId = this.mapImp.featureIdsForModel("UBERON:0000948")[0];
804
- const elm = "Click for more information";
805
- this.mapImp.showPopup(heartId, elm, {
806
- anchor: "top",
807
- className: "flatmap-popup-popper"
808
- });
809
- }
810
- },
811
- closeFlatmapHelpPopup: function() {
812
- this.$el
813
- .querySelectorAll(".maplibregl-popup-close-button")
814
- .forEach(item => {
815
- item.click();
816
- });
817
- },
818
- getLabels: function() {
819
- let labels = [];
820
- if (this.mapImp) {
821
- let annotations = this.mapImp.annotations;
822
- for (let value of annotations.values()) {
823
- if (value.label) labels.push(value.label);
824
- }
825
- return Array.from(new Set(labels));
826
- }
827
- },
828
- getState: function() {
829
- if (this.mapImp) {
830
- let state = {
831
- entry: this.entry,
832
- viewport: this.mapImp.getState()
833
- };
834
- const identifier = this.mapImp.getIdentifier();
835
- if (this.biologicalSex)
836
- state['biologicalSex'] = this.biologicalSex;
837
- else if (identifier && identifier.biologicalSex)
838
- state['biologicalSex'] = identifier.biologicalSex;
839
- if (identifier && identifier.uuid)
840
- state['uuid'] = identifier.uuid;
841
- return state;
842
- }
843
- return undefined;
844
- },
845
- setState: function(state) {
846
- if (state) {
847
- if (this.mapImp &&
848
- (state.entry && (this.entry == state.entry)) &&
849
- (!state.biologicalSex || (state.biologicalSex === this.biologicalSex)))
850
- {
851
- if (state.viewport) {
852
- this.mapImp.setState(state.viewport);
853
- }
854
- } else {
855
- this.createFlatmap(state);
856
- }
857
- this.setStateRequired = false;
858
- }
859
- },
860
- restoreMapState: function(state) {
861
- if (state) {
862
- if (state.viewport)
863
- this.mapImp.setState(state.viewport);
864
- if (state.searchTerm)
865
- this.searchAndShowResult(state.searchTerm, true);
866
- }
867
- },
868
- createFlatmap: function(state) {
869
- if (!this.mapImp && !this.loading) {
870
- this.loading = true;
871
- let minimap = false;
872
- if (this.displayMinimap) {
873
- minimap = { position: "top-right" };
874
- }
875
-
876
- //As for flatmap-viewer@2.2.7, see below for the documentation
877
- //for the identifier:
878
-
879
- //@arg identifier {string|Object}
880
- // A string or object identifying the map to load. If a string its
881
- // value can be either the map's ``uuid``, assigned at generation time,
882
- // or taxon and biological sex identifiers of the species that the map
883
- // represents. The latest version of a map is loaded unless it has been
884
- // identified using a ``uuid`` (see below).
885
- // @arg identifier.taxon {string} The taxon identifier of the species
886
- // represented by the map. This is specified as metadata in the map's source file.
887
- // @arg identifier.biologicalSex {string} The biological sex of the species
888
- // represented by the map. This is specified as metadatain the map's source file.
889
- // @arg identifier.uuid {string} The unique uuid the flatmap. If given then this exact map will
890
- // be loaded, overriding ``taxon`` and ``biologicalSex``.
891
-
892
- let identifier = { taxon: this.entry };
893
- if (this.uuid) {
894
- identifier.uuid = this.uuid;
895
- }
896
- //This now handle the uses of uuid when resuming states
897
- if (state) {
898
- if (state.uuid) {
899
- identifier = { uuid: state.uuid };
900
- } else if (state.entry) {
901
- identifier.taxon = state.entry;
902
- if (state.biologicalSex) {
903
- identifier["biologicalSex"] = state.biologicalSex;
904
- } else if (identifier.taxon === "NCBITaxon:9606") {
905
- //For backward compatibility
906
- identifier["biologicalSex"] ="PATO:0000384";
907
- }
908
- }
909
- } else {
910
- // Set the bioloicalSex now if map is not resumed from
911
- // a saved state
912
- if (this.biologicalSex) {
913
- identifier["biologicalSex"] = this.biologicalSex;
914
- }
915
- }
916
-
917
- let promise1 = this.mapManager.loadMap(
918
- identifier,
919
- this.$refs.display,
920
- this.eventCallback(),
921
- {
922
- //fullscreenControl: false,
923
- //annotatable: false,
924
- //debug: true,
925
- featureInfo: this.featureInfo,
926
- "min-zoom": this.minZoom,
927
- layerControl: true,
928
- pathControls: true,
929
- searchable: this.searchable,
930
- tooltips: this.tooltips,
931
- minimap: minimap
932
- }
933
- );
934
- promise1.then(returnedObject => {
935
- this.mapImp = returnedObject;
936
- this.onFlatmapReady();
937
- if (this._stateToBeSet)
938
- this.restoreMapState(this._stateToBeSet);
939
- else {
940
- this.restoreMapState(state);
941
- }
942
- });
943
- } else if (state) {
944
- this._stateToBeSet = { viewport: state.viewport, searchTerm: state.searchTerm };
945
- if (this.mapImp && !this.loading)
946
- this.restoreMapState(this._stateToBeSet);
947
- }
948
- },
949
- computePathControlsMaximumHeight() {
950
- const elem = this.$refs.display;
951
- if (elem) {
952
- const computed = getComputedStyle(elem);
953
- const padding = parseInt(computed.paddingTop) + parseInt(computed.paddingBottom);
954
- const height = elem.clientHeight - padding;
955
- this.pathwaysMaxHeight = height - 170;
956
- }
957
- },
958
- mapResize: function() {
959
- try {
960
- this.computePathControlsMaximumHeight();
961
- if (this.mapImp) {
962
- this.mapImp.resize();
963
- this.showMinimap(this.displayMinimap);
964
- if (this.mapImp._minimap) {
965
- this.mapImp._minimap.resize();
966
- }
967
- }
968
- } catch {
969
- console.error("Map resize error");
970
- }
971
- },
972
- onFlatmapReady: function(){
973
- // onFlatmapReady is used for functions that need to run immediately after the flatmap is loaded
974
- this.sensor = new ResizeSensor(
975
- this.$refs.display,
976
- this.mapResize
977
- );
978
- if (this.mapImp.options && this.mapImp.options.style === "functional") {
979
- this.isFC = true;
980
- }
981
- this.mapImp.setBackgroundOpacity(1);
982
- this.backgroundChangeCallback(this.currentBackground);
983
- this.pathways = this.mapImp.pathTypes();
984
- this.mapImp.enableCentrelines(false);
985
- //Disable layers for now
986
- //this.layers = this.mapImp.getLayers();
987
- this.systems = processSystems(this.mapImp.getSystems());
988
- this.taxonConnectivity = processTaxon(this.flatmapAPI, this.mapImp.taxonIdentifiers);
989
- this.addResizeButtonToMinimap();
990
- this.loading = false;
991
- this.computePathControlsMaximumHeight();
992
- this.drawerOpen = true;
993
- this.mapResize();
994
- this.$emit("ready", this);
995
- },
996
- showMinimap: function(flag) {
997
- if (this.mapImp)
998
- this.mapImp.showMinimap(flag);
999
- },
1000
- showPathwaysDrawer: function(flag) {
1001
- this.drawerOpen = flag;
1002
- },
1003
- /**
1004
- * Function to display features with annotation matching the provided term,
1005
- * with the option to display the label using displayLabel flag.
1006
- */
1007
- searchAndShowResult: function(term, displayLabel) {
1008
- if (this.mapImp) {
1009
- if (term === undefined || term === "") {
1010
- this.mapImp.clearSearchResults();
1011
- return true;
1012
- } else {
1013
- const searchResults = this.mapImp.search(term);
1014
- if (searchResults && searchResults.results &&
1015
- searchResults.results.length > 0) {
1016
- this.mapImp.showSearchResults(searchResults);
1017
- if (displayLabel &&
1018
- searchResults.results[0].featureId &&
1019
- searchResults.results[0].text) {
1020
- const annotation = this.mapImp.annotation(searchResults.results[0].featureId);
1021
- this.mapImp.showPopup(
1022
- searchResults.results[0].featureId,
1023
- annotation.label,
1024
- { className: "custom-popup", positionAtLastClick: false, preserveSelection: true }
1025
- )
1026
- }
1027
- return true;
1028
- }
1029
- else
1030
- this.mapImp.clearSearchResults();
1031
- }
1032
- }
1033
- return false;
1034
- },
1035
- /**
1036
- * Get the list of suggested terms
1037
- */
1038
- searchSuggestions: function(term) {
1039
- if (this.mapImp)
1040
- return this.mapImp.search(term);
1041
- return [];
1042
- },
1043
- },
1044
- props: {
1045
- entry: String,
1046
- uuid: String,
1047
- biologicalSex: {
1048
- type: String,
1049
- default: ""
1050
- },
1051
- featureInfo: {
1052
- type: Boolean,
1053
- default: false
1054
- },
1055
- minZoom: {
1056
- type: Number,
1057
- default: 4
1058
- },
1059
- pathControls: {
1060
- type: Boolean,
1061
- default: false
1062
- },
1063
- searchable: {
1064
- type: Boolean,
1065
- default: false
1066
- },
1067
- layerControl: {
1068
- type: Boolean,
1069
- default: false
1070
- },
1071
- tooltips: {
1072
- type: Boolean,
1073
- default: true
1074
- },
1075
- helpMode: {
1076
- type: Boolean,
1077
- default: false
1078
- },
1079
- renderAtMounted: {
1080
- type: Boolean,
1081
- default: true
1082
- },
1083
- displayMinimap: {
1084
- type: Boolean,
1085
- default: false
1086
- },
1087
- displayWarning: {
1088
- type: Boolean,
1089
- default: false
1090
- },
1091
- /**
1092
- * Flag to determine rather open map UI should be
1093
- * presented or not.
1094
- */
1095
- enableOpenMapUI: {
1096
- type: Boolean,
1097
- default: false,
1098
- },
1099
- openMapOptions: {
1100
- type: Array,
1101
- default: function () {
1102
- return [
1103
- {
1104
- display: "Open AC Map",
1105
- key: "AC"
1106
- },
1107
- {
1108
- display: "Open FC Map",
1109
- key: "FC"
1110
- },
1111
- {
1112
- display: "Open 3D Human Map",
1113
- key: "3D"
1114
- },
1115
- ]
1116
- },
1117
- },
1118
- isLegacy: {
1119
- type: Boolean,
1120
- default: false
1121
- },
1122
- displayLatestChanges: {
1123
- type: Boolean,
1124
- default: false,
1125
- },
1126
- latestChangesMessage: {
1127
- type: String,
1128
- default: "'Observed In' controls and information are now included in AC maps. System control with FTU information has been added to the FC map.",
1129
- },
1130
- /**
1131
- * State containing state of the flatmap.
1132
- */
1133
- state: {
1134
- type: Object,
1135
- default: undefined
1136
- },
1137
- /**
1138
- * Specify the endpoint of the flatmap server.
1139
- */
1140
- flatmapAPI: {
1141
- type: String,
1142
- default: "https://mapcore-demo.org/current/flatmap/v3/"
1143
- },
1144
- sparcAPI: {
1145
- type: String,
1146
- default: "https://api.sparc.science/"
1147
- },
1148
- },
1149
- provide() {
1150
- return {
1151
- sparcAPI: this.sparcAPI,
1152
- flatmapAPI: this.flatmapAPI
1153
- }
1154
- },
1155
- data: function() {
1156
- return {
1157
- layers: [],
1158
- pathways: [],
1159
- sckanDisplay: [
1160
- {
1161
- label: "Display Path with SCKAN",
1162
- key: "VALID",
1163
- },
1164
- ],
1165
- centreLines: [
1166
- {
1167
- label: "Display Nerves",
1168
- key: "centrelines",
1169
- enabled: false
1170
- }
1171
- ],
1172
- systems: [],
1173
- taxonConnectivity: [],
1174
- pathwaysMaxHeight: 1000,
1175
- hoverVisibilities: [
1176
- { value: false },
1177
- { value: false },
1178
- { value: false },
1179
- { value: false },
1180
- { value: false },
1181
- { value: false },
1182
- { value: false },
1183
- { value: false },
1184
- { value: false },
1185
- ],
1186
- isFC: false,
1187
- inHelp: false,
1188
- currentBackground: "white",
1189
- availableBackground: ["white", "lightskyblue", "black"],
1190
- loading: false,
1191
- highlightToolOn: false,
1192
- flatmapMarker: flatmapMarker,
1193
- tooltipEntry: createUnfilledTooltipData(),
1194
- connectivityTooltipVisible: false,
1195
- resourceForTooltip: undefined,
1196
- drawerOpen: false,
1197
- colourRadio: true,
1198
- outlinesRadio: true,
1199
- minimapResizeShow: false,
1200
- minimapSmall: false,
1201
- currentActive: "",
1202
- currentHover: "",
1203
- };
1204
- },
1205
- watch: {
1206
- entry: function() {
1207
- if (!this.state) this.createFlatmap();
1208
- },
1209
- helpMode: function(val) {
1210
- this.setHelpMode(val);
1211
- },
1212
- state: {
1213
- handler: function(state) {
1214
- if (this.mapManager) {
1215
- this.setState(state);
1216
- } else {
1217
- //this component has not been mounted yet
1218
- this.setStateRequired = true;
1219
- }
1220
- },
1221
- immediate: true,
1222
- deep: true
1223
- }
1224
- },
1225
- mounted: function() {
1226
- const flatmap = require("@abi-software/flatmap-viewer");
1227
- this.tooltipWait = [];
1228
- this.tooltipWait.length = this.hoverVisibilities.length;
1229
- this.mapManager = new flatmap.MapManager(this.flatmapAPI);
1230
- this.flatmapQueries = new FlatmapQueries();
1231
- this.flatmapQueries.initialise(this.flatmapAPI);
1232
- if (this.state) {
1233
- //State is set and require to set the state
1234
- if (this.setStateRequired) {
1235
- this.setState(this.state);
1236
- }
1237
- } else if(this.renderAtMounted) {
1238
- this.createFlatmap();
1239
- }
1240
- }
1241
- };
1242
- </script>
1243
-
1244
- <!-- Add "scoped" attribute to limit CSS to this component only -->
1245
- <style scoped lang="scss">
1246
- @import "~element-ui/packages/theme-chalk/src/button";
1247
- @import "~element-ui/packages/theme-chalk/src/loading";
1248
- @import "~element-ui/packages/theme-chalk/src/row";
1249
-
1250
- .beta-popovers {
1251
- position: absolute;
1252
- top: 90px;
1253
- left: 16px;
1254
- text-align: left;
1255
- font-size: 25px;
1256
- }
1257
-
1258
- .warning-icon {
1259
- color: $warning;
1260
-
1261
- &:hover {
1262
- cursor: pointer;
1263
- }
1264
- }
1265
-
1266
- .warning-text {
1267
- font-family: Asap, sans-serif;
1268
- font-size: 15px;
1269
- vertical-align: 5px;
1270
- }
1271
-
1272
- .latest-map-text {
1273
- color: $app-primary-color;;
1274
- font-family: Asap, sans-serif;
1275
- font-size: 12px;
1276
- margin-top: 5px;
1277
- vertical-align: 10px;
1278
- cursor: pointer;
1279
- }
1280
-
1281
- .latest-changesicon {
1282
- color: $success;
1283
-
1284
- &:hover {
1285
- cursor: pointer;
1286
- }
1287
- }
1288
-
1289
- .latest-changestext {
1290
- font-family: Asap, sans-serif;
1291
- font-size: 15px;
1292
- vertical-align: 5px;
1293
- }
1294
-
1295
- .flatmap-container {
1296
- height: 100%;
1297
- width: 100%;
1298
- }
1299
-
1300
- .pathway-location {
1301
- position: absolute;
1302
- bottom: 0px;
1303
- transition: all 1s ease;
1304
- &.open {
1305
- left: 0px;
1306
- }
1307
- &.close {
1308
- left: -298px;
1309
- }
1310
- }
1311
-
1312
- .svg-legends-container {
1313
- width:70%;
1314
- height:auto;
1315
- position:relative;
1316
- max-height:140px;
1317
- }
1318
-
1319
- .pathway-container {
1320
- float: left;
1321
- padding-left: 16px;
1322
- padding-right: 18px;
1323
- text-align: left;
1324
- overflow: auto;
1325
- border: 1px solid rgb(220, 223, 230);
1326
- padding-bottom: 16px;
1327
- background: #ffffff;
1328
- overflow-x: hidden;
1329
- scrollbar-width: thin;
1330
-
1331
- &::-webkit-scrollbar {
1332
- width: 4px;
1333
- }
1334
-
1335
- &::-webkit-scrollbar-thumb {
1336
- border-radius: 10px;
1337
- box-shadow: inset 0 0 6px #c0c4cc;
1338
- }
1339
- }
1340
-
1341
- .flatmap-marker-help {
1342
- display: inline-block;
1343
- }
1344
-
1345
- ::v-deep .popper-bump-right {
1346
- left: 30px;
1347
- }
1348
-
1349
- .el-dropdown-link {
1350
- cursor: pointer;
1351
- color: #409eff;
1352
- }
1353
- .el-icon-arrow-down {
1354
- font-size: 12px;
1355
- }
1356
- .demonstration {
1357
- display: block;
1358
- color: #8492a6;
1359
- font-size: 14px;
1360
- margin-bottom: 20px;
1361
- }
1362
-
1363
- .tooltip {
1364
- display: none;
1365
- }
1366
-
1367
- ::v-deep .maplibregl-popup {
1368
- max-width: 300px !important;
1369
- }
1370
-
1371
- ::v-deep .flatmap-tooltip-popup {
1372
- &.maplibregl-popup-anchor-bottom {
1373
- .maplibregl-popup-content {
1374
- margin-bottom: 12px;
1375
- &::after,
1376
- &::before {
1377
- top: 100%;
1378
- border-width: 12px;
1379
- }
1380
- /* this border color controlls the color of the triangle (what looks like the fill of the triangle) */
1381
- &::after {
1382
- margin-top: -1px;
1383
- border-color: rgb(255, 255, 255) transparent transparent transparent;
1384
- }
1385
- /* this border color controlls the outside, thin border */
1386
- &::before {
1387
- margin: 0 auto;
1388
- border-color: $app-primary-color transparent transparent transparent;
1389
- }
1390
- }
1391
- }
1392
- &.maplibregl-popup-anchor-top {
1393
- .maplibregl-popup-content {
1394
- margin-top: 18px;
1395
- &::after,
1396
- &::before {
1397
- top: calc(-100% + 6px);
1398
- border-width: 12px;
1399
- }
1400
- /* this border color controlls the color of the triangle (what looks like the fill of the triangle) */
1401
- &::after {
1402
- margin-top: 1px;
1403
- border-color: transparent transparent rgb(255, 255, 255) transparent;
1404
- }
1405
- &::before {
1406
- margin: 0 auto;
1407
- border-color: transparent transparent $app-primary-color transparent;
1408
- }
1409
- }
1410
- }
1411
- .maplibregl-popup-content {
1412
- border-radius: 4px;
1413
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
1414
- pointer-events: none;
1415
- display: none;
1416
- background: #fff;
1417
- border: 1px solid $app-primary-color;
1418
- padding-left: 6px;
1419
- padding-right: 6px;
1420
- display: flex;
1421
- justify-content: center;
1422
- align-items: center;
1423
- &::after,
1424
- &::before {
1425
- content: "";
1426
- display: block;
1427
- position: absolute;
1428
- width: 0;
1429
- height: 0;
1430
- border-style: solid;
1431
- flex-shrink: 0;
1432
- }
1433
- }
1434
- .maplibregl-popup-tip {
1435
- display: none;
1436
- }
1437
- }
1438
-
1439
- ::v-deep .maplibregl-popup {
1440
- &.flatmap-marker-popup {
1441
- box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
1442
- pointer-events: auto;
1443
- background: #fff;
1444
- }
1445
- }
1446
-
1447
- /* Fix for chrome bug where under triangle pops up above one on top of it */
1448
- .selector:not(*:root),
1449
- ::v-deep.flatmap-tooltip-popup {
1450
- .maplibregl-popup-content::after {
1451
- top: 99.9%;
1452
- }
1453
- }
1454
-
1455
- ::v-deep .flatmap-tooltip-dialog {
1456
- .maplibregl-popup-tip {
1457
- display: none;
1458
- }
1459
- }
1460
-
1461
- ::v-deep .flatmap-marker-popup {
1462
- .maplibregl-popup-content {
1463
- padding: 0px;
1464
- }
1465
- }
1466
-
1467
- ::v-deep .flatmapvuer-popover {
1468
- .maplibregl-popup-close-button {
1469
- position: absolute;
1470
- right: 0.5em;
1471
- top: 0;
1472
- border: 0;
1473
- border-radius: 0 3px 0 0;
1474
- cursor: pointer;
1475
- background-color: transparent;
1476
- font-size: 2.5em;
1477
- color: grey;
1478
- top: 0.95em;
1479
- }
1480
- }
1481
-
1482
- .zoomOut {
1483
- padding-left: 8px;
1484
- }
1485
-
1486
- .fitWindow {
1487
- padding-left: 8px;
1488
- }
1489
-
1490
- .settings-group {
1491
- bottom: 16px;
1492
- position: absolute;
1493
- transition: all 1s ease;
1494
- &.open {
1495
- left: 322px;
1496
- }
1497
- &.close {
1498
- left: 24px;
1499
- }
1500
- }
1501
-
1502
- ::v-deep .background-popper {
1503
- padding: 5px 12px;
1504
- background-color: #ffffff;
1505
- border: 1px solid $app-primary-color;
1506
- box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
1507
- height: 200px;
1508
- width: 175px;
1509
- min-width: 175px;
1510
- &.el-popper[x-placement^="top"] {
1511
- .popper__arrow {
1512
- border-top-color: $app-primary-color !important;
1513
- &::after {
1514
- border-top-color: #fff !important;
1515
- }
1516
- }
1517
- }
1518
- }
1519
-
1520
- ::v-deep .open-map-popper {
1521
- padding-top: 5px;
1522
- padding-bottom: 5px;
1523
- background-color: #ffffff;
1524
- border: 1px solid $app-primary-color;
1525
- box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
1526
- width: 178px;
1527
- min-width: 178px;
1528
-
1529
- .el-row ~ .el-row {
1530
- margin-top: 8px;
1531
- }
1532
-
1533
- .el-button {
1534
- padding-top:5px;
1535
- padding-bottom:5px;
1536
- }
1537
-
1538
- &.el-popper[x-placement^="top"] {
1539
- .popper__arrow {
1540
- border-top-color: $app-primary-color !important;
1541
- &:after {
1542
- border-top-color: #fff !important;
1543
- }
1544
- }
1545
- }
1546
- }
1547
-
1548
- .backgroundText {
1549
- color: rgb(48, 49, 51);
1550
- font-size: 14px;
1551
- font-weight: normal;
1552
- line-height: 20px;
1553
- }
1554
-
1555
- .backgroundControl {
1556
- display: flex;
1557
- margin-top: 16px;
1558
- }
1559
-
1560
- .backgroundChoice {
1561
- width: 20px;
1562
- height: 20px;
1563
- border: 1px solid rgb(144, 147, 153);
1564
- margin-left: 20px;
1565
- &.active {
1566
- border: 2px solid $app-primary-color;
1567
- }
1568
- &:hover {
1569
- cursor: pointer;
1570
- }
1571
- &.white {
1572
- background-color: white;
1573
- margin-left: 10px;
1574
- }
1575
- &.black {
1576
- background-color: black;
1577
- }
1578
- &.lightskyblue {
1579
- background-color: lightskyblue;
1580
- }
1581
- }
1582
-
1583
- .icon-button {
1584
- height: 24px !important;
1585
- width: 24px !important;
1586
- color: $app-primary-color;
1587
- &:hover {
1588
- cursor: pointer;
1589
- }
1590
- }
1591
-
1592
- ::v-deep .maplibregl-ctrl-minimap {
1593
- transform-origin: top right;
1594
- @media (max-width: 1250px) {
1595
- height: 125px !important;// important is needed here as we are over-riding the style set by the flatmap
1596
- width: 180px !important;
1597
- >>> .maplibregl-canvas .maplibregl-canvas {
1598
- height: 125px !important;
1599
- width: 180px !important;
1600
- }
1601
- }
1602
- @media (min-width: 1251px) {
1603
- height: 190px !important;
1604
- width: 300px !important;
1605
- >>> .maplibregl-canvas .maplibregl-canvas {
1606
- height: 190px !important;
1607
- width: 300px !important;
1608
- }
1609
- }
1610
- transition: all 1s ease;
1611
- &.shrink {
1612
- transform: scale(0.5);
1613
- transform: scale(0.5);
1614
- }
1615
- }
1616
-
1617
- .minimap-resize {
1618
- position: absolute;
1619
- pointer-events: all;
1620
- cursor: pointer;
1621
- top: 0;
1622
- right: 0;
1623
- padding-top: 3px; // needed as icon is offset
1624
- width: 20px;
1625
- height: 14px;
1626
- z-index: 9;
1627
- transition: all 1s ease;
1628
- &.shrink {
1629
- transform: rotate(0deg);
1630
- }
1631
- &.enlarge {
1632
- transform: rotate(180deg) scale(2);
1633
- padding-bottom: 5px; // note padding is added to the opposite side since it is rotated
1634
- padding-left: 5px;
1635
- }
1636
- }
1637
-
1638
- ::v-deep .flatmap-popper {
1639
- padding: 6px 4px;
1640
- font-size: 12px;
1641
- color: rgb(48, 49, 51);
1642
- background-color: #f3ecf6;
1643
- border: 1px solid $app-primary-color;
1644
- white-space: nowrap;
1645
- min-width: unset;
1646
- &.warning-popper {
1647
- min-width: 150px;
1648
- max-width: 400px;
1649
- word-break: keep-all;
1650
- white-space: unset;
1651
- }
1652
- &.left-popper {
1653
- .popper__arrow {
1654
- border-left-color: $app-primary-color !important;
1655
- &::after {
1656
- border-left-color: #f3ecf6 !important;
1657
- }
1658
- }
1659
- }
1660
- &.right-popper {
1661
- .popper__arrow {
1662
- border-right-color: $app-primary-color !important;
1663
- &:after {
1664
- border-right-color: #f3ecf6 !important;
1665
- }
1666
- }
1667
- }
1668
- &.el-popper[x-placement^="top"] {
1669
- .popper__arrow {
1670
- border-top-color: $app-primary-color !important;
1671
- &:after {
1672
- border-top-color: #f3ecf6 !important;
1673
- }
1674
- }
1675
- }
1676
- }
1677
-
1678
- ::v-deep .el-loading-spinner {
1679
- i,
1680
- .el-loading-text {
1681
- color: $app-primary-color;
1682
- }
1683
- }
1684
-
1685
- ::v-deep .flatmap-popup-popper {
1686
- .maplibregl-popup-tip {
1687
- border-bottom-color: $app-primary-color;
1688
- }
1689
- .maplibregl-popup-content {
1690
- padding: 6px 4px;
1691
- font-size: 12px;
1692
- color: rgb(48, 49, 51);
1693
- background-color: #f3ecf6;
1694
- border: 1px solid $app-primary-color;
1695
- white-space: nowrap;
1696
- min-width: unset;
1697
- .maplibregl-popup-close-button {
1698
- display: none;
1699
- }
1700
- }
1701
- }
1702
-
1703
- ::v-deep .popper-zoomout {
1704
- padding-right: 13px !important;
1705
- left: -21px !important;
1706
- }
1707
-
1708
- ::v-deep .popper-zoomout {
1709
- .popper__arrow {
1710
- left: 53px !important;
1711
- }
1712
- }
1713
-
1714
- ::v-deep .maplibregl-popup-content {
1715
- padding: 0px;
1716
- }
1717
-
1718
- .bottom-right-control {
1719
- position: absolute;
1720
- right: 16px;
1721
- bottom: 16px;
1722
- }
1723
-
1724
- ::v-deep .my-drawer {
1725
- background: rgba(0, 0, 0, 0);
1726
- box-shadow: none;
1727
- }
1728
-
1729
- .drawer {
1730
- ::v-deep .el-drawer:focus {
1731
- outline: none;
1732
- }
1733
- }
1734
-
1735
- .open-drawer,
1736
- .drawer-button {
1737
- z-index: 8;
1738
- width: 20px;
1739
- height: 40px;
1740
- border: solid 1px $app-primary-color;
1741
- text-align: center;
1742
- vertical-align: middle;
1743
- cursor: pointer;
1744
- pointer-events: auto;
1745
- }
1746
-
1747
- .open-drawer {
1748
- position: absolute;
1749
- left: 0px;
1750
- background-color: #f7faff;
1751
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
1752
- }
1753
-
1754
- .drawer-button {
1755
- float: left;
1756
- margin-top: calc(50% - 36px);
1757
- background-color: #F9F2FC;
1758
-
1759
- i {
1760
- font-weight: 600;
1761
- margin-top: 12px;
1762
- color: $app-primary-color;
1763
- transition-delay: 0.9s;
1764
- }
1765
- &.open {
1766
- i {
1767
- transform: rotate(0deg) scaleY(2);
1768
- }
1769
- }
1770
- &.close {
1771
- i {
1772
- transform: rotate(180deg) scaleY(2);
1773
- }
1774
- }
1775
- }
1776
-
1777
- ::v-deep .maplibregl-canvas-container {
1778
- canvas {
1779
- outline: none;
1780
- }
1781
- }
1782
-
1783
- .backgroundSpacer {
1784
- border-bottom: 1px solid #e4e7ed;
1785
- margin-bottom: 10px;
1786
- }
1787
-
1788
- .flatmap-radio {
1789
- ::v-deep label {
1790
- margin-right: 20px;
1791
- &:last-child {
1792
- margin-right: 0px;
1793
- }
1794
- }
1795
- .el-radio__input {
1796
- &.is-checked {
1797
- & + .el-radio__label {
1798
- color: $app-primary-color;
1799
- }
1800
- .el-radio__inner {
1801
- border-color: $app-primary-color;
1802
- background: $app-primary-color;
1803
- }
1804
- }
1805
- }
1806
- }
1807
-
1808
- ::v-deep .custom-popup {
1809
- .maplibregl-popup-tip {
1810
- display: none;
1811
- }
1812
- .maplibregl-popup-content {
1813
- border-radius: 4px;
1814
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
1815
- pointer-events: none;
1816
- display: none;
1817
- background: #fff;
1818
- font-family: "Asap",sans-serif;
1819
- font-size: 12pt;
1820
- color: $app-primary-color;
1821
- border: 1px solid $app-primary-color;
1822
- padding-left: 6px;
1823
- padding-right: 6px;
1824
- padding-top: 6px;
1825
- padding-bottom: 6px;
1826
- display: flex;
1827
- justify-content: center;
1828
- align-items: center;
1829
- &::after,
1830
- &::before {
1831
- content: "";
1832
- display: block;
1833
- position: absolute;
1834
- width: 0;
1835
- height: 0;
1836
- border-style: solid;
1837
- flex-shrink: 0;
1838
- }
1839
- .maplibregl-popup-close-button {
1840
- display: none;
1841
- }
1842
- }
1843
- &.maplibregl-popup-anchor-bottom {
1844
- .maplibregl-popup-content {
1845
- margin-bottom: 12px;
1846
- &::after,
1847
- &::before {
1848
- top: 100%;
1849
- border-width: 12px;
1850
- }
1851
- /* this border color controlls the color of the triangle (what looks like the fill of the triangle) */
1852
- &::after {
1853
- margin-top: -1px;
1854
- border-color: rgb(255, 255, 255) transparent transparent transparent;
1855
- }
1856
- /* this border color controlls the outside, thin border */
1857
- &::before {
1858
- margin: 0 auto;
1859
- border-color: $app-primary-color transparent transparent transparent;
1860
- }
1861
- }
1862
- }
1863
- &.maplibregl-popup-anchor-top {
1864
- .maplibregl-popup-content {
1865
- margin-top: 18px;
1866
- &::after,
1867
- &::before {
1868
- top: calc(-100% + 6px);
1869
- border-width: 12px;
1870
- }
1871
- /* this border color controlls the color of the triangle (what looks like the fill of the triangle) */
1872
- &::after {
1873
- margin-top: 1px;
1874
- border-color: transparent transparent rgb(255, 255, 255) transparent;
1875
- }
1876
- &::before {
1877
- margin: 0 auto;
1878
- border-color: transparent transparent $app-primary-color transparent;
1879
- }
1880
- }
1881
- }
1882
- }
1883
- </style>
1884
-
1
+ <template>
2
+ <div
3
+ class="flatmap-container"
4
+ ref="flatmapContainer"
5
+ v-loading="loading"
6
+ element-loading-text="Loading..."
7
+ element-loading-spinner="el-icon-loading"
8
+ element-loading-background="rgba(0, 0, 0, 0.3)"
9
+ >
10
+ <map-svg-sprite-color />
11
+ <div
12
+ style="height: 100%; width: 100%; position: relative; overflow-y: none"
13
+ >
14
+ <div style="height: 100%; width: 100%" ref="display"></div>
15
+ <div class="beta-popovers">
16
+ <div>
17
+ <el-popover
18
+ placement="right"
19
+ :appendToBody="false"
20
+ trigger="manual"
21
+ popper-class="warning-popper flatmap-popper right-popper"
22
+ v-model="hoverVisibilities[6].value"
23
+ ref="warningPopover"
24
+ >
25
+ <p
26
+ v-if="isLegacy"
27
+ @mouseover="showToolitip(6)"
28
+ @mouseout="hideToolitip(6)"
29
+ >
30
+ This is a legacy map, you may view the latest map instead.
31
+ </p>
32
+ <p
33
+ v-else-if="isFC"
34
+ @mouseover="showToolitip(6)"
35
+ @mouseout="hideToolitip(6)"
36
+ >
37
+ This map displays the connectivity of individual neurons.
38
+ Specifically, those which align with (parts of) the neuron
39
+ populations from the
40
+ <a
41
+ href="https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew"
42
+ target="_blank"
43
+ >
44
+ ApiNATOMY
45
+ </a>
46
+ models available in
47
+ <a
48
+ href="https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD"
49
+ target="_blank"
50
+ >
51
+ SCKAN </a
52
+ >.
53
+ </p>
54
+ <p v-else @mouseover="showToolitip(6)" @mouseout="hideToolitip(6)">
55
+ This map displays the connectivity of neuron populations.
56
+ Specifically, those from the primarily rat-based
57
+ <a
58
+ href="https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew"
59
+ target="_blank"
60
+ >
61
+ ApiNATOMY
62
+ </a>
63
+ models available in
64
+ <a
65
+ href="https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD"
66
+ target="_blank"
67
+ >
68
+ SCKAN </a
69
+ >. New connectivity and species specificity will be added as the
70
+ SPARC program progresses.
71
+ </p>
72
+ </el-popover>
73
+ <i
74
+ class="el-icon-warning warning-icon"
75
+ v-if="displayWarning"
76
+ @mouseover="showToolitip(6)"
77
+ @mouseout="hideToolitip(6)"
78
+ v-popover:warningPopover
79
+ >
80
+ <template v-if="isLegacy">
81
+ <span class="warning-text">Legacy Map</span>
82
+ <div class="latest-map-text" @click="viewLatestMap">
83
+ Click here for the latest map
84
+ </div>
85
+ </template>
86
+ <template v-else>
87
+ <span class="warning-text">Beta</span>
88
+ </template>
89
+ </i>
90
+ </div>
91
+ <el-popover
92
+ :content="latestChangesMessage"
93
+ placement="right"
94
+ v-if="displayLatestChanges"
95
+ :appendToBody="false"
96
+ trigger="manual"
97
+ popper-class="warning-popper flatmap-popper right-popper"
98
+ v-model="hoverVisibilities[7].value"
99
+ ref="latestChangesPopover"
100
+ ></el-popover>
101
+ <i
102
+ class="el-icon-warning latest-changesicon"
103
+ v-if="displayLatestChanges && latestChangesMessage"
104
+ @mouseover="showToolitip(7)"
105
+ @mouseout="hideToolitip(7)"
106
+ v-popover:latestChangesPopover
107
+ >
108
+ <span class="warning-text">What's new?</span>
109
+ </i>
110
+ </div>
111
+
112
+ <!-- The element below is placed onto the flatmap when it is ready -->
113
+ <i
114
+ class="el-icon-arrow-down minimap-resize"
115
+ :class="{ enlarge: minimapSmall, shrink: !minimapSmall }"
116
+ ref="minimapResize"
117
+ v-show="minimapResizeShow"
118
+ @click="closeMinimap"
119
+ ></i>
120
+
121
+ <div class="bottom-right-control">
122
+ <el-popover
123
+ content="Zoom in"
124
+ placement="left"
125
+ :appendToBody="false"
126
+ trigger="manual"
127
+ popper-class="flatmap-popper left-popper"
128
+ v-model="hoverVisibilities[0].value"
129
+ >
130
+ <map-svg-icon
131
+ icon="zoomIn"
132
+ class="icon-button zoomIn"
133
+ slot="reference"
134
+ @click.native="zoomIn()"
135
+ @mouseover.native="showToolitip(0)"
136
+ @mouseout.native="hideToolitip(0)"
137
+ />
138
+ </el-popover>
139
+ <el-popover
140
+ content="Zoom out"
141
+ placement="top-end"
142
+ :appendToBody="false"
143
+ trigger="manual"
144
+ popper-class="flatmap-popper popper-zoomout"
145
+ v-model="hoverVisibilities[1].value"
146
+ >
147
+ <map-svg-icon
148
+ icon="zoomOut"
149
+ class="icon-button zoomOut"
150
+ slot="reference"
151
+ @click.native="zoomOut()"
152
+ @mouseover.native="showToolitip(1)"
153
+ @mouseout.native="hideToolitip(1)"
154
+ />
155
+ </el-popover>
156
+ <el-popover
157
+ content="Reset"
158
+ placement="top"
159
+ :appendToBody="false"
160
+ trigger="manual"
161
+ popper-class="flatmap-popper"
162
+ v-model="hoverVisibilities[2].value"
163
+ >
164
+ <div>
165
+ Fit to
166
+ <br />
167
+ window
168
+ </div>
169
+ <map-svg-icon
170
+ slot="reference"
171
+ icon="fitWindow"
172
+ class="icon-button fitWindow"
173
+ @click.native="resetView()"
174
+ @mouseover.native="showToolitip(2)"
175
+ @mouseout.native="hideToolitip(2)"
176
+ />
177
+ </el-popover>
178
+ </div>
179
+ <el-popover
180
+ content="Change pathway visibility"
181
+ placement="right"
182
+ :appendToBody="false"
183
+ trigger="manual"
184
+ popper-class="flatmap-popper right-popper"
185
+ v-model="hoverVisibilities[4].value"
186
+ ref="checkBoxPopover"
187
+ />
188
+ <div
189
+ class="pathway-location"
190
+ :class="{ open: drawerOpen, close: !drawerOpen }"
191
+ >
192
+ <div
193
+ class="pathway-container"
194
+ :class="{ open: drawerOpen, close: !drawerOpen }"
195
+ :style="{ 'max-height' : pathwaysMaxHeight + 'px' }"
196
+ v-if="pathControls"
197
+ v-popover:checkBoxPopover
198
+ >
199
+ <svg-legends v-if="!isFC" class="svg-legends-container" />
200
+ <el-popover
201
+ content="Find these markers for data"
202
+ placement="right"
203
+ :appendToBody="false"
204
+ trigger="manual"
205
+ popper-class="flatmap-popper popper-bump-right right-popper"
206
+ v-model="hoverVisibilities[5].value"
207
+ ref="markerPopover"
208
+ ></el-popover>
209
+ <div
210
+ v-show="hoverVisibilities[5].value"
211
+ class="flatmap-marker-help"
212
+ v-html="flatmapMarker"
213
+ v-popover:markerPopover
214
+ ></div>
215
+ <tree-controls
216
+ v-if="isFC && systems && systems.length > 0"
217
+ :active="currentActive"
218
+ :hover="currentHover"
219
+ :tree-data="systems"
220
+ ref="treeControls"
221
+ @changed="systemSelected"
222
+ @checkAll="checkAllSystems"
223
+ @change-active="ftuSelected"
224
+ />
225
+ <selections-group
226
+ v-if="!isFC && centreLines && centreLines.length > 0"
227
+ title="Nerves"
228
+ labelKey="label"
229
+ identifierKey="key"
230
+ :selections="centreLines"
231
+ @changed="centreLinesSelected"
232
+ ref="centrelinesSelection"
233
+ key="centrelinesSelection"
234
+ />
235
+ <!--
236
+ <selections-group
237
+ v-if="isFC && sckanDisplay && sckanDisplay.length > 0"
238
+ title="SCKAN"
239
+ labelKey="label"
240
+ identifierKey="key"
241
+ :selections="sckanDisplay"
242
+ @changed="sckanSelected"
243
+ @checkAll="checkAllSCKAN"
244
+ ref="skcanSelection"
245
+ key="skcanSelection"
246
+ />
247
+ <selections-group
248
+ v-if="layers && layers.length > 0"
249
+ title="Layers"
250
+ labelKey="description"
251
+ identifierKey="id"
252
+ :selections="layers"
253
+ @changed="layersSelected"
254
+ @checkAll="checkAllLayers"
255
+ ref="layersSelection"
256
+ key="layersSelection"
257
+ />
258
+ -->
259
+ <selections-group
260
+ v-if="!isFC && taxonConnectivity && taxonConnectivity.length > 0"
261
+ title="Observed in"
262
+ labelKey="label"
263
+ identifierKey="taxon"
264
+ :selections="taxonConnectivity"
265
+ @changed="taxonsSelected"
266
+ @checkAll="checkAllTaxons"
267
+ ref="taxonSelection"
268
+ key="taxonSelection"
269
+ />
270
+ <selections-group
271
+ v-if="pathways && pathways.length > 0"
272
+ title="Pathways"
273
+ labelKey="label"
274
+ identifierKey="type"
275
+ colourStyle="line"
276
+ :selections="pathways"
277
+ @changed="pathwaysSelected"
278
+ @checkAll="checkAllPathways"
279
+ ref="pathwaysSelection"
280
+ key="pathwaysSelection"
281
+ />
282
+ </div>
283
+ <div
284
+ @click="toggleDrawer"
285
+ class="drawer-button"
286
+ :class="{ open: drawerOpen, close: !drawerOpen }"
287
+ >
288
+ <i class="el-icon-arrow-left"></i>
289
+ </div>
290
+ </div>
291
+ <el-popover
292
+ ref="open-map-popover"
293
+ placement="top-start"
294
+ width="128"
295
+ :append-to-body="false"
296
+ trigger="click"
297
+ popper-class="open-map-popper non-selectable"
298
+ >
299
+ <el-row v-for="item in openMapOptions" :key="item.key">
300
+ <el-button type="primary" plain @click="$emit('open-map', item.key)">
301
+ {{ item.display }}
302
+ </el-button>
303
+ </el-row>
304
+ </el-popover>
305
+ <el-popover
306
+ ref="backgroundPopover"
307
+ placement="top-start"
308
+ width="175"
309
+ :appendToBody="false"
310
+ trigger="click"
311
+ popper-class="background-popper"
312
+ >
313
+ <el-row class="backgroundText">Viewing Mode</el-row>
314
+ <el-row class="backgroundControl">
315
+ <el-select
316
+ :popper-append-to-body="false"
317
+ v-model="viewingMode"
318
+ placeholder="Select"
319
+ class="select-box"
320
+ popper-class="flatmap_dropdown"
321
+ >
322
+ <el-option
323
+ v-for="item in viewingModes"
324
+ :key="item"
325
+ :label="item"
326
+ :value="item"
327
+ >
328
+ <el-row>
329
+ <el-col :span="12">{{ item }}</el-col>
330
+ </el-row>
331
+ </el-option>
332
+ </el-select>
333
+ </el-row>
334
+ <el-row class="backgroundSpacer"></el-row>
335
+ <el-row class="backgroundText">Organs display</el-row>
336
+ <el-row class="backgroundControl">
337
+ <el-radio-group
338
+ v-model="colourRadio"
339
+ class="flatmap-radio"
340
+ @change="setColour"
341
+ >
342
+ <el-radio :label="true">Colour</el-radio>
343
+ <el-radio :label="false">Greyscale</el-radio>
344
+ </el-radio-group>
345
+ </el-row>
346
+ <el-row class="backgroundSpacer"></el-row>
347
+ <el-row class="backgroundText">Outlines display</el-row>
348
+ <el-row class="backgroundControl">
349
+ <el-radio-group
350
+ v-model="outlinesRadio"
351
+ class="flatmap-radio"
352
+ @change="setOutlines"
353
+ >
354
+ <el-radio :label="true">Show</el-radio>
355
+ <el-radio :label="false">Hide</el-radio>
356
+ </el-radio-group>
357
+ </el-row>
358
+ <el-row class="backgroundSpacer"></el-row>
359
+ <el-row class="backgroundText">Change background</el-row>
360
+ <el-row class="backgroundControl">
361
+ <div
362
+ v-for="item in availableBackground"
363
+ :key="item"
364
+ :class="[
365
+ 'backgroundChoice',
366
+ item,
367
+ item == currentBackground ? 'active' : '',
368
+ ]"
369
+ @click="backgroundChangeCallback(item)"
370
+ />
371
+ </el-row>
372
+ </el-popover>
373
+ <div
374
+ class="settings-group"
375
+ :class="{ open: drawerOpen, close: !drawerOpen }"
376
+ >
377
+ <el-row>
378
+ <el-popover
379
+ v-model="hoverVisibilities[8].value"
380
+ content="Open new map"
381
+ placement="right"
382
+ :append-to-body="false"
383
+ trigger="manual"
384
+ popper-class="flatmap-popper right-popper"
385
+ >
386
+ <map-svg-icon
387
+ v-if="enableOpenMapUI && openMapOptions.length > 0"
388
+ slot="reference"
389
+ v-popover:open-map-popover
390
+ icon="openMap"
391
+ class="icon-button"
392
+ @mouseover.native="showToolitip(8)"
393
+ @mouseout.native="hideToolitip(8)"
394
+ />
395
+ </el-popover>
396
+ </el-row>
397
+ <el-row>
398
+ <el-popover
399
+ content="Change settings"
400
+ placement="right"
401
+ v-model="hoverVisibilities[3].value"
402
+ :appendToBody="false"
403
+ trigger="manual"
404
+ popper-class="flatmap-popper right-popper"
405
+ >
406
+ <map-svg-icon
407
+ v-popover:backgroundPopover
408
+ icon="changeBckgd"
409
+ class="icon-button"
410
+ slot="reference"
411
+ @mouseover.native="showToolitip(3)"
412
+ @mouseout.native="hideToolitip(3)"
413
+ />
414
+ </el-popover>
415
+ </el-row>
416
+ </div>
417
+ <Tooltip
418
+ ref="tooltip"
419
+ class="tooltip"
420
+ :annotationEntry="annotationEntry"
421
+ @highlightConnectedPaths="highlightConnectedPaths"
422
+ @onClose="closeTooltip"
423
+ :entry="tooltipEntry"
424
+ :annotationDisplay="viewingMode === 'Annotation'"
425
+ />
426
+ </div>
427
+ </div>
428
+ </template>
429
+
430
+ <script>
431
+ /* eslint-disable no-alert, no-console */
432
+ import Vue from "vue";
433
+ import Tooltip from "./Tooltip";
434
+ import SelectionsGroup from "./SelectionsGroup";
435
+ import TreeControls from "./TreeControls";
436
+ import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
437
+ import SvgLegends from "./legends/SvgLegends";
438
+ import {
439
+ Button,
440
+ Col,
441
+ Loading,
442
+ Radio,
443
+ RadioGroup,
444
+ Row,
445
+ Select,
446
+ } from "element-ui";
447
+ import lang from "element-ui/lib/locale/lang/en";
448
+ import locale from "element-ui/lib/locale";
449
+ import flatmapMarker from "../icons/flatmap-marker";
450
+ import {
451
+ FlatmapQueries,
452
+ findTaxonomyLabel,
453
+ } from "../services/flatmapQueries.js";
454
+
455
+ locale.use(lang);
456
+ Vue.use(Button);
457
+ Vue.use(Col);
458
+ Vue.use(Loading.directive);
459
+ Vue.use(Radio);
460
+ Vue.use(RadioGroup);
461
+ Vue.use(Row);
462
+ Vue.use(Select);
463
+ const ResizeSensor = require("css-element-queries/src/ResizeSensor");
464
+
465
+ const processTaxon = (flatmapAPI, taxonIdentifiers) => {
466
+ let processed = [];
467
+ taxonIdentifiers.forEach((taxon) => {
468
+ findTaxonomyLabel(flatmapAPI, taxon).then((value) => {
469
+ const item = { taxon, label: value };
470
+ processed.push(item);
471
+ });
472
+ });
473
+
474
+ return processed;
475
+ };
476
+
477
+ const processFTUs = (parent, key) => {
478
+ const ftus = [];
479
+ let items = parent.organs ? parent.organs : parent.ftus;
480
+ const children = items
481
+ ? items.filter(
482
+ (obj, index) =>
483
+ items.findIndex((item) => item.label === obj.label) === index
484
+ )
485
+ : undefined;
486
+ if (children) {
487
+ children.forEach((child) => {
488
+ const data = {
489
+ label: child.label,
490
+ models: child.models,
491
+ key: `${key}.${child.label}`,
492
+ };
493
+ const grandChildren = processFTUs(child, data.key);
494
+ if (grandChildren.length > 0) {
495
+ data.children = grandChildren;
496
+ }
497
+ ftus.push(data);
498
+ });
499
+ }
500
+ return ftus;
501
+ };
502
+
503
+ const processSystems = (systems) => {
504
+ const allSystems = [];
505
+ if (systems && systems.length > 0) {
506
+ const data = { label: "All", key: "All", children: [] };
507
+ systems.forEach((system) => {
508
+ const child = {
509
+ colour: system.colour,
510
+ enabled: system.enabled,
511
+ label: system.id,
512
+ key: system.id,
513
+ };
514
+ const children = processFTUs(system, child.key);
515
+ if (children.length > 0) child.children = children;
516
+ data.children.push(child);
517
+ });
518
+
519
+ allSystems.push(data);
520
+ }
521
+
522
+ return allSystems;
523
+ };
524
+
525
+ const createUnfilledTooltipData = function () {
526
+ return {
527
+ destinations: [],
528
+ origins: [],
529
+ components: [],
530
+ destinationsWithDatasets: [],
531
+ originsWithDatasets: [],
532
+ componentsWithDatasets: [],
533
+ resource: undefined,
534
+ };
535
+ };
536
+
537
+ export default {
538
+ name: "FlatmapVuer",
539
+ components: {
540
+ MapSvgIcon,
541
+ MapSvgSpriteColor,
542
+ Tooltip,
543
+ TreeControls,
544
+ SelectionsGroup,
545
+ SvgLegends,
546
+ },
547
+ beforeCreate: function () {
548
+ this.mapManager = undefined;
549
+ this.mapImp = undefined;
550
+ //The state watcher may triggered before
551
+ //created causing issue, This flag will
552
+ //resolve this issue.
553
+ this.setStateRequired = false;
554
+ },
555
+ methods: {
556
+ viewLatestMap: function () {
557
+ let biologicalSex = this.biologicalSex ? this.biologicalSex : undefined;
558
+ //Human requires special handling
559
+ if (this.entry === "NCBITaxon:9606") {
560
+ biologicalSex = "PATO:0000384";
561
+ }
562
+ const state = {
563
+ entry: this.entry,
564
+ biologicalSex,
565
+ viewport: this.mapImp.getState(),
566
+ };
567
+ this.$emit("view-latest-map", state);
568
+ },
569
+ backgroundChangeCallback: function (colour) {
570
+ this.currentBackground = colour;
571
+ if (this.mapImp) {
572
+ this.mapImp.setBackgroundColour(this.currentBackground, 1);
573
+ }
574
+ },
575
+ toggleDrawer: function () {
576
+ this.drawerOpen = !this.drawerOpen;
577
+ },
578
+ /**
579
+ * Function to toggle colour/greyscale of organs.
580
+ */
581
+ setColour: function (flag) {
582
+ this.colourRadio = flag;
583
+ if (this.mapImp) {
584
+ this.mapImp.setColour({ colour: flag, outline: this.outlinesRadio });
585
+ }
586
+ },
587
+ /**
588
+ * Function to toggle outlines f organs.
589
+ */
590
+ setOutlines: function (flag) {
591
+ this.outlineRadio = flag;
592
+ if (this.mapImp) {
593
+ this.mapImp.setColour({ colour: this.colourRadio, outline: flag });
594
+ }
595
+ },
596
+ /**
597
+ * Function to toggle paths to default.
598
+ * Also called when the associated button is pressed.
599
+ */
600
+ resetView: function () {
601
+ if (this.mapImp) {
602
+ this.mapImp.resetMap();
603
+ if (this.$refs.centrelinesSelection) {
604
+ this.$refs.centrelinesSelection.reset();
605
+ }
606
+ if (this.$refs.skcanSelection) {
607
+ this.$refs.skcanSelection.reset();
608
+ }
609
+ if (this.$refs.layersSelection) {
610
+ this.$refs.layersSelection.reset();
611
+ }
612
+ if (this.$refs.systemsSelection) {
613
+ this.$refs.pathwaysSelection.reset();
614
+ }
615
+ if (this.$refs.pathwaysSelection) {
616
+ this.$refs.pathwaysSelection.reset();
617
+ }
618
+ }
619
+ },
620
+ /**
621
+ * Function to zoom in.
622
+ * Also called when the associated button is pressed.
623
+ */
624
+ zoomIn: function () {
625
+ if (this.mapImp) {
626
+ this.mapImp.zoomIn();
627
+ }
628
+ },
629
+ /**
630
+ * Function to zoom out.
631
+ * Also called when the associated button is pressed.
632
+ */
633
+ zoomOut: function () {
634
+ if (this.mapImp) {
635
+ this.mapImp.zoomOut();
636
+ }
637
+ },
638
+ centreLinesSelected: function (payload) {
639
+ if (this.mapImp) {
640
+ this.mapImp.enableCentrelines(payload.value);
641
+ }
642
+ },
643
+ sckanSelected: function (payload) {
644
+ if (this.mapImp) {
645
+ this.mapImp.enableSckanPath(payload.key, payload.value);
646
+ }
647
+ },
648
+ checkAllSCKAN: function (payload) {
649
+ if (this.mapImp) {
650
+ payload.keys.forEach((key) =>
651
+ this.mapImp.enableSckanPath(key, payload.value));
652
+ }
653
+ },
654
+ highlightConnectedPaths: function (payload) {
655
+ if (this.mapImp) {
656
+ let paths = [...this.mapImp.pathModelNodes(payload)];
657
+ // The line below matches the paths to the annIdToFeatureId map to get the feature ids
658
+
659
+ let pathFeatures = paths.map(p=>this.mapImp.featureProperties(p));
660
+ let toHighlight = [];
661
+ pathFeatures.forEach(p=>{
662
+ this.mapImp.nodePathModels(p.featureId).forEach(f=>{
663
+ toHighlight.push(f);
664
+ })
665
+ })
666
+ // display connected paths
667
+ this.mapImp.zoomToFeatures(toHighlight, {noZoomIn: true});
668
+ }
669
+ },
670
+ systemSelected: function (payload) {
671
+ if (this.mapImp) {
672
+ this.mapImp.enableSystem(payload.key, payload.value);
673
+ }
674
+ },
675
+ checkAllSystems: function (flag) {
676
+ if (this.mapImp) {
677
+ this.systems[0].children.forEach((key) =>
678
+ this.mapImp.enableSystem(key.label, flag)
679
+ );
680
+ }
681
+ },
682
+ ftuSelected: function (models) {
683
+ this.searchAndShowResult(models, true);
684
+ },
685
+ layersSelected: function (payload) {
686
+ if (this.mapImp) {
687
+ this.mapImp.enableLayer(payload.key, payload.value);
688
+ }
689
+ },
690
+ checkAllLayers: function (payload) {
691
+ if (this.mapImp) {
692
+ payload.keys.forEach((key) =>
693
+ this.mapImp.enableLayer(key, payload.value)
694
+ );
695
+ }
696
+ },
697
+ taxonsSelected: function (payload) {
698
+ if (this.mapImp) {
699
+ this.mapImp.enableConnectivityByTaxonIds(payload.key, payload.value);
700
+ }
701
+ },
702
+ checkAllTaxons: function (payload) {
703
+ if (this.mapImp) {
704
+ payload.keys.forEach((key) =>
705
+ this.mapImp.enableConnectivityByTaxonIds(key, payload.value)
706
+ );
707
+ }
708
+ },
709
+ pathwaysSelected: function (payload) {
710
+ if (this.mapImp) {
711
+ this.mapImp.enablePath(payload.key, payload.value);
712
+ }
713
+ },
714
+ checkAllPathways: function (payload) {
715
+ if (this.mapImp) {
716
+ payload.keys.forEach((key) =>
717
+ this.mapImp.enablePath(key, payload.value)
718
+ );
719
+ }
720
+ },
721
+ enablePanZoomEvents: function (flag) {
722
+ this.mapImp.enablePanZoomEvents(flag);
723
+ },
724
+ eventCallback: function () {
725
+ return (eventType, data, ...args) => {
726
+ if (eventType !== "pan-zoom") {
727
+ const label = data.label;
728
+ const resource = [data.models];
729
+ const taxonomy = this.entry;
730
+ const biologicalSex = this.biologicalSex;
731
+ const payload = {
732
+ dataset: data.dataset,
733
+ biologicalSex: biologicalSex,
734
+ taxonomy: taxonomy,
735
+ resource: resource,
736
+ label: label,
737
+ feature: data,
738
+ userData: args,
739
+ eventType: eventType,
740
+ provenanceTaxonomy: data.taxons
741
+ ? JSON.parse(data.taxons)
742
+ : undefined,
743
+ };
744
+ if (eventType === "click") {
745
+ if (this.viewingMode === "Network Discovery") {
746
+ this.highlightConnectedPaths([data.models]);
747
+ } else {
748
+ this.currentActive = data.models ? data.models : "";
749
+ }
750
+ } else if (eventType === "mouseenter" &&
751
+ !(this.viewingMode === "Network Discovery")) {
752
+ this.currentHover = data.models ? data.models : "";
753
+ }
754
+ if (
755
+ data &&
756
+ data.type !== "marker" &&
757
+ eventType === "click" &&
758
+ !(this.viewingMode === "Network Discovery")
759
+ ) {
760
+ this.checkAndCreatePopups(payload);
761
+ }
762
+ this.$emit("resource-selected", payload);
763
+ } else {
764
+ this.$emit("pan-zoom-callback", data);
765
+ }
766
+ };
767
+ },
768
+ // checkNeuronClicked shows a neuron path pop up if a path was recently clicked
769
+ checkAndCreatePopups: async function (data) {
770
+ // Call flatmap database to get the connection data
771
+ if (this.viewingMode === "Annotation") {
772
+ if (data.feature && data.feature.featureId && data.feature.models) {
773
+ this.annotationEntry = { ...data.feature, resourceId: this.serverUUID };
774
+ this.displayTooltip(data.feature.models);
775
+ } else {
776
+ this.annotation = {};
777
+ }
778
+ } else {
779
+ let results =
780
+ await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(data);
781
+ // The line below only creates the tooltip if some data was found on the path
782
+ // result 0 is the connection, result 1 is the pubmed results from flatmap
783
+ if (
784
+ results[0] ||
785
+ results[1] ||
786
+ (data.feature.hyperlinks && data.feature.hyperlinks.length > 0)
787
+ ) {
788
+ this.resourceForTooltip = data.resource[0];
789
+ data.resourceForTooltip = this.resourceForTooltip;
790
+ this.createTooltipFromNeuronCuration(data);
791
+ }
792
+ }
793
+ },
794
+ popUpCssHacks: function () {
795
+ // Below is a hack to remove flatmap tooltips while popup is open
796
+ let ftooltip = document.querySelector(".flatmap-tooltip-popup");
797
+ if (ftooltip) ftooltip.style.display = "none";
798
+ document.querySelector(".maplibregl-popup-close-button").style.display =
799
+ "block";
800
+ this.$refs.tooltip.$el.style.display = "flex";
801
+ document.querySelector(".maplibregl-popup-close-button").onclick = () => {
802
+ document.querySelector(".flatmap-tooltip-popup").style.display =
803
+ "block";
804
+ };
805
+ },
806
+ closeTooltip: function () {
807
+ this.$refs.tooltip.$el.style.display = "none";
808
+ document.querySelectorAll(".maplibregl-popup").forEach((item) => {
809
+ item.style.display = "none";
810
+ });
811
+ },
812
+ createTooltipFromNeuronCuration: async function (data) {
813
+ this.tooltipEntry = await this.flatmapQueries.createTooltipData(data);
814
+ this.displayTooltip(data.resource[0]);
815
+ },
816
+ // Keeping this as an API
817
+ showPopup: function (featureId, node, options) {
818
+ let myOptions = options;
819
+ if (this.mapImp) {
820
+ if (myOptions) {
821
+ if (!myOptions.className) myOptions.className = "custom-popup";
822
+ } else {
823
+ myOptions = { className: "custom-popup", positionAtLastClick: true };
824
+ }
825
+ this.mapImp.showPopup(featureId, node, myOptions);
826
+ }
827
+ },
828
+ showMarkerPopup: function (featureId, node, options) {
829
+ if (this.mapImp) {
830
+ this.mapImp.showMarkerPopup(featureId, node, options);
831
+ }
832
+ },
833
+ closeMinimap: function () {
834
+ let minimapEl = this.$refs.flatmapContainer.querySelector(
835
+ ".maplibregl-ctrl-minimap"
836
+ ); // find minimap
837
+ if (this.minimapSmall) {
838
+ //switch the classes on the minimap
839
+ minimapEl.classList.add("enlarge");
840
+ minimapEl.classList.remove("shrink");
841
+ } else {
842
+ minimapEl.classList.add("shrink");
843
+ minimapEl.classList.remove("enlarge");
844
+ }
845
+ this.minimapSmall = !this.minimapSmall;
846
+ },
847
+ addResizeButtonToMinimap: function () {
848
+ let minimapEl = this.$refs.flatmapContainer.querySelector(
849
+ ".maplibregl-ctrl-minimap"
850
+ );
851
+ if (minimapEl) {
852
+ this.$refs.minimapResize.parentNode.removeChild(
853
+ this.$refs.minimapResize
854
+ );
855
+ minimapEl.appendChild(this.$refs.minimapResize);
856
+ this.minimapResizeShow = true;
857
+ }
858
+ },
859
+ setHelpMode: function (helpMode) {
860
+ if (helpMode) {
861
+ this.inHelp = true;
862
+ this.hoverVisibilities.forEach((item) => {
863
+ item.value = true;
864
+ });
865
+ this.openFlatmapHelpPopup();
866
+ } else {
867
+ this.inHelp = false;
868
+ this.hoverVisibilities.forEach((item) => {
869
+ item.value = false;
870
+ });
871
+ this.closeFlatmapHelpPopup();
872
+ }
873
+ },
874
+ showToolitip: function (tooltipNumber) {
875
+ if (!this.inHelp) {
876
+ clearTimeout(this.tooltipWait[tooltipNumber]);
877
+ this.tooltipWait[tooltipNumber] = setTimeout(() => {
878
+ this.hoverVisibilities[tooltipNumber].value = true;
879
+ }, 500);
880
+ }
881
+ },
882
+ hideToolitip: function (tooltipNumber) {
883
+ if (!this.inHelp) {
884
+ clearTimeout(this.tooltipWait[tooltipNumber]);
885
+ this.tooltipWait[tooltipNumber] = setTimeout(() => {
886
+ this.hoverVisibilities[tooltipNumber].value = false;
887
+ }, 500);
888
+ }
889
+ },
890
+ displayTooltip: function (feature) {
891
+ this.mapImp.showPopup(
892
+ this.mapImp.modelFeatureIds(feature)[0],
893
+ this.$refs.tooltip.$el,
894
+ { className: "flatmapvuer-popover", positionAtLastClick: true }
895
+ );
896
+ this.popUpCssHacks();
897
+ },
898
+ openFlatmapHelpPopup: function () {
899
+ if (this.mapImp) {
900
+ let heartId = this.mapImp.featureIdsForModel("UBERON:0000948")[0];
901
+ const elm = "Click for more information";
902
+ this.mapImp.showPopup(heartId, elm, {
903
+ anchor: "top",
904
+ className: "flatmap-popup-popper",
905
+ });
906
+ }
907
+ },
908
+ closeFlatmapHelpPopup: function () {
909
+ this.$el
910
+ .querySelectorAll(".maplibregl-popup-close-button")
911
+ .forEach((item) => {
912
+ item.click();
913
+ });
914
+ },
915
+ getLabels: function () {
916
+ let labels = [];
917
+ if (this.mapImp) {
918
+ let annotations = this.mapImp.annotations;
919
+ for (let value of annotations.values()) {
920
+ if (value.label) labels.push(value.label);
921
+ }
922
+ return Array.from(new Set(labels));
923
+ }
924
+ },
925
+ getState: function () {
926
+ if (this.mapImp) {
927
+ let state = {
928
+ entry: this.entry,
929
+ viewport: this.mapImp.getState(),
930
+ };
931
+ const identifier = this.mapImp.getIdentifier();
932
+ if (this.biologicalSex) state["biologicalSex"] = this.biologicalSex;
933
+ else if (identifier && identifier.biologicalSex)
934
+ state["biologicalSex"] = identifier.biologicalSex;
935
+ if (identifier && identifier.uuid) state["uuid"] = identifier.uuid;
936
+ return state;
937
+ }
938
+ return undefined;
939
+ },
940
+ setState: function (state) {
941
+ if (state) {
942
+ if (
943
+ this.mapImp &&
944
+ state.entry &&
945
+ this.entry == state.entry &&
946
+ (!state.biologicalSex || state.biologicalSex === this.biologicalSex)
947
+ ) {
948
+ if (state.viewport) {
949
+ this.mapImp.setState(state.viewport);
950
+ }
951
+ } else {
952
+ this.createFlatmap(state);
953
+ }
954
+ this.setStateRequired = false;
955
+ }
956
+ },
957
+ restoreMapState: function (state) {
958
+ if (state) {
959
+ if (state.viewport) this.mapImp.setState(state.viewport);
960
+ if (state.searchTerm) this.searchAndShowResult(state.searchTerm, true);
961
+ }
962
+ },
963
+ createFlatmap: function (state) {
964
+ if (!this.mapImp && !this.loading) {
965
+ this.loading = true;
966
+ let minimap = false;
967
+ if (this.displayMinimap) {
968
+ minimap = { position: "top-right" };
969
+ }
970
+
971
+ //As for flatmap-viewer@2.2.7, see below for the documentation
972
+ //for the identifier:
973
+
974
+ //@arg identifier {string|Object}
975
+ // A string or object identifying the map to load. If a string its
976
+ // value can be either the map's ``uuid``, assigned at generation time,
977
+ // or taxon and biological sex identifiers of the species that the map
978
+ // represents. The latest version of a map is loaded unless it has been
979
+ // identified using a ``uuid`` (see below).
980
+ // @arg identifier.taxon {string} The taxon identifier of the species
981
+ // represented by the map. This is specified as metadata in the map's source file.
982
+ // @arg identifier.biologicalSex {string} The biological sex of the species
983
+ // represented by the map. This is specified as metadatain the map's source file.
984
+ // @arg identifier.uuid {string} The unique uuid the flatmap. If given then this exact map will
985
+ // be loaded, overriding ``taxon`` and ``biologicalSex``.
986
+
987
+ let identifier = { taxon: this.entry };
988
+ if (this.uuid) {
989
+ identifier.uuid = this.uuid;
990
+ }
991
+ //This now handle the uses of uuid when resuming states
992
+ if (state) {
993
+ if (state.uuid) {
994
+ identifier = { uuid: state.uuid };
995
+ } else if (state.entry) {
996
+ identifier.taxon = state.entry;
997
+ if (state.biologicalSex) {
998
+ identifier["biologicalSex"] = state.biologicalSex;
999
+ } else if (identifier.taxon === "NCBITaxon:9606") {
1000
+ //For backward compatibility
1001
+ identifier["biologicalSex"] = "PATO:0000384";
1002
+ }
1003
+ }
1004
+ } else {
1005
+ // Set the bioloicalSex now if map is not resumed from
1006
+ // a saved state
1007
+ if (this.biologicalSex) {
1008
+ identifier["biologicalSex"] = this.biologicalSex;
1009
+ }
1010
+ }
1011
+
1012
+ let promise1 = this.mapManager.loadMap(
1013
+ identifier,
1014
+ this.$refs.display,
1015
+ this.eventCallback(),
1016
+ {
1017
+ //fullscreenControl: false,
1018
+ //annotatable: false,
1019
+ //debug: true,
1020
+ featureInfo: this.featureInfo,
1021
+ "min-zoom": this.minZoom,
1022
+ layerControl: true,
1023
+ pathControls: true,
1024
+ searchable: this.searchable,
1025
+ tooltips: this.tooltips,
1026
+ minimap: minimap,
1027
+ }
1028
+ );
1029
+ promise1.then((returnedObject) => {
1030
+ this.mapImp = returnedObject;
1031
+ this.serverUUID = this.mapImp.getIdentifier().uuid;
1032
+ this.onFlatmapReady();
1033
+ if (this._stateToBeSet) this.restoreMapState(this._stateToBeSet);
1034
+ else {
1035
+ this.restoreMapState(state);
1036
+ }
1037
+ });
1038
+ } else if (state) {
1039
+ this._stateToBeSet = {
1040
+ viewport: state.viewport,
1041
+ searchTerm: state.searchTerm,
1042
+ };
1043
+ if (this.mapImp && !this.loading)
1044
+ this.restoreMapState(this._stateToBeSet);
1045
+ }
1046
+ },
1047
+ computePathControlsMaximumHeight() {
1048
+ const elem = this.$refs.display;
1049
+ if (elem) {
1050
+ const computed = getComputedStyle(elem);
1051
+ const padding =
1052
+ parseInt(computed.paddingTop) + parseInt(computed.paddingBottom);
1053
+ const height = elem.clientHeight - padding;
1054
+ this.pathwaysMaxHeight = height - 170;
1055
+ }
1056
+ },
1057
+ mapResize: function () {
1058
+ try {
1059
+ this.computePathControlsMaximumHeight();
1060
+ if (this.mapImp) {
1061
+ this.mapImp.resize();
1062
+ this.showMinimap(this.displayMinimap);
1063
+ if (this.mapImp._minimap) {
1064
+ this.mapImp._minimap.resize();
1065
+ }
1066
+ }
1067
+ } catch {
1068
+ console.error("Map resize error");
1069
+ }
1070
+ },
1071
+ onFlatmapReady: function () {
1072
+ // onFlatmapReady is used for functions that need to run immediately after the flatmap is loaded
1073
+ this.sensor = new ResizeSensor(this.$refs.display, this.mapResize);
1074
+ if (this.mapImp.options && this.mapImp.options.style === "functional") {
1075
+ this.isFC = true;
1076
+ }
1077
+ this.mapImp.setBackgroundOpacity(1);
1078
+ this.backgroundChangeCallback(this.currentBackground);
1079
+ this.pathways = this.mapImp.pathTypes();
1080
+ this.mapImp.enableCentrelines(false);
1081
+ //Disable layers for now
1082
+ //this.layers = this.mapImp.getLayers();
1083
+ this.systems = processSystems(this.mapImp.getSystems());
1084
+ this.taxonConnectivity = processTaxon(
1085
+ this.flatmapAPI,
1086
+ this.mapImp.taxonIdentifiers
1087
+ );
1088
+ this.addResizeButtonToMinimap();
1089
+ this.loading = false;
1090
+ this.computePathControlsMaximumHeight();
1091
+ this.drawerOpen = true;
1092
+ this.mapResize();
1093
+ this.$emit("ready", this);
1094
+ },
1095
+ showMinimap: function (flag) {
1096
+ if (this.mapImp) this.mapImp.showMinimap(flag);
1097
+ },
1098
+ showPathwaysDrawer: function (flag) {
1099
+ this.drawerOpen = flag;
1100
+ },
1101
+ /**
1102
+ * Function to display features with annotation matching the provided term,
1103
+ * with the option to display the label using displayLabel flag.
1104
+ */
1105
+ searchAndShowResult: function (term, displayLabel) {
1106
+ if (this.mapImp) {
1107
+ if (term === undefined || term === "") {
1108
+ this.mapImp.clearSearchResults();
1109
+ return true;
1110
+ } else {
1111
+ const searchResults = this.mapImp.search(term);
1112
+ if (
1113
+ searchResults &&
1114
+ searchResults.results &&
1115
+ searchResults.results.length > 0
1116
+ ) {
1117
+ this.mapImp.showSearchResults(searchResults);
1118
+ if (
1119
+ displayLabel &&
1120
+ searchResults.results[0].featureId &&
1121
+ searchResults.results[0].text
1122
+ ) {
1123
+ const annotation = this.mapImp.annotation(
1124
+ searchResults.results[0].featureId
1125
+ );
1126
+ this.mapImp.showPopup(
1127
+ searchResults.results[0].featureId,
1128
+ annotation.label,
1129
+ {
1130
+ className: "custom-popup",
1131
+ positionAtLastClick: false,
1132
+ preserveSelection: true,
1133
+ }
1134
+ );
1135
+ }
1136
+ return true;
1137
+ } else this.mapImp.clearSearchResults();
1138
+ }
1139
+ }
1140
+ return false;
1141
+ },
1142
+ /**
1143
+ * Get the list of suggested terms
1144
+ */
1145
+ searchSuggestions: function (term) {
1146
+ if (this.mapImp) return this.mapImp.search(term);
1147
+ return [];
1148
+ },
1149
+ },
1150
+ props: {
1151
+ entry: String,
1152
+ uuid: String,
1153
+ biologicalSex: {
1154
+ type: String,
1155
+ default: "",
1156
+ },
1157
+ featureInfo: {
1158
+ type: Boolean,
1159
+ default: false,
1160
+ },
1161
+ minZoom: {
1162
+ type: Number,
1163
+ default: 4,
1164
+ },
1165
+ pathControls: {
1166
+ type: Boolean,
1167
+ default: false,
1168
+ },
1169
+ searchable: {
1170
+ type: Boolean,
1171
+ default: false,
1172
+ },
1173
+ layerControl: {
1174
+ type: Boolean,
1175
+ default: false,
1176
+ },
1177
+ tooltips: {
1178
+ type: Boolean,
1179
+ default: true,
1180
+ },
1181
+ helpMode: {
1182
+ type: Boolean,
1183
+ default: false,
1184
+ },
1185
+ renderAtMounted: {
1186
+ type: Boolean,
1187
+ default: true,
1188
+ },
1189
+ displayMinimap: {
1190
+ type: Boolean,
1191
+ default: false,
1192
+ },
1193
+ displayWarning: {
1194
+ type: Boolean,
1195
+ default: false,
1196
+ },
1197
+ /**
1198
+ * Flag to determine rather open map UI should be
1199
+ * presented or not.
1200
+ */
1201
+ enableOpenMapUI: {
1202
+ type: Boolean,
1203
+ default: false,
1204
+ },
1205
+ openMapOptions: {
1206
+ type: Array,
1207
+ default: function () {
1208
+ return [
1209
+ {
1210
+ display: "Open AC Map",
1211
+ key: "AC",
1212
+ },
1213
+ {
1214
+ display: "Open FC Map",
1215
+ key: "FC",
1216
+ },
1217
+ {
1218
+ display: "Open 3D Human Map",
1219
+ key: "3D",
1220
+ },
1221
+ ];
1222
+ },
1223
+ },
1224
+ isLegacy: {
1225
+ type: Boolean,
1226
+ default: false,
1227
+ },
1228
+ displayLatestChanges: {
1229
+ type: Boolean,
1230
+ default: false,
1231
+ },
1232
+ latestChangesMessage: {
1233
+ type: String,
1234
+ default:
1235
+ "'Observed In' controls and information are now included in AC maps. System control with FTU information has been added to the FC map.",
1236
+ },
1237
+ /**
1238
+ * State containing state of the flatmap.
1239
+ */
1240
+ state: {
1241
+ type: Object,
1242
+ default: undefined,
1243
+ },
1244
+ /**
1245
+ * Specify the endpoint of the flatmap server.
1246
+ */
1247
+ flatmapAPI: {
1248
+ type: String,
1249
+ default: "https://mapcore-demo.org/current/flatmap/v3/",
1250
+ },
1251
+ sparcAPI: {
1252
+ type: String,
1253
+ default: "https://api.sparc.science/",
1254
+ },
1255
+ },
1256
+ provide() {
1257
+ return {
1258
+ flatmapAPI: this.flatmapAPI,
1259
+ sparcAPI: this.sparcAPI,
1260
+ };
1261
+ },
1262
+ data: function () {
1263
+ return {
1264
+ annotationEntry: {},
1265
+ serverUUID: undefined,
1266
+ layers: [],
1267
+ pathways: [],
1268
+ sckanDisplay: [
1269
+ {
1270
+ label: "Display Path with SCKAN",
1271
+ key: "VALID",
1272
+ },
1273
+ ],
1274
+ centreLines: [
1275
+ {
1276
+ label: "Display Nerves",
1277
+ key: "centrelines",
1278
+ enabled: false,
1279
+ },
1280
+ ],
1281
+ systems: [],
1282
+ taxonConnectivity: [],
1283
+ pathwaysMaxHeight: 1000,
1284
+ hoverVisibilities: [
1285
+ { value: false },
1286
+ { value: false },
1287
+ { value: false },
1288
+ { value: false },
1289
+ { value: false },
1290
+ { value: false },
1291
+ { value: false },
1292
+ { value: false },
1293
+ { value: false },
1294
+ ],
1295
+ isFC: false,
1296
+ inHelp: false,
1297
+ currentBackground: "white",
1298
+ availableBackground: ["white", "lightskyblue", "black"],
1299
+ loading: false,
1300
+ flatmapMarker: flatmapMarker,
1301
+ tooltipEntry: createUnfilledTooltipData(),
1302
+ connectivityTooltipVisible: false,
1303
+ drawerOpen: false,
1304
+ annotationRadio: false,
1305
+ colourRadio: true,
1306
+ outlinesRadio: true,
1307
+ minimapResizeShow: false,
1308
+ minimapSmall: false,
1309
+ currentActive: "",
1310
+ currentHover: "",
1311
+ viewingMode: "Exploration",
1312
+ viewingModes: ["Annotation", "Exploration", "Network Discovery"],
1313
+ };
1314
+ },
1315
+ watch: {
1316
+ entry: function () {
1317
+ if (!this.state) this.createFlatmap();
1318
+ },
1319
+ helpMode: function (val) {
1320
+ this.setHelpMode(val);
1321
+ },
1322
+ state: {
1323
+ handler: function (state) {
1324
+ if (this.mapManager) {
1325
+ this.setState(state);
1326
+ } else {
1327
+ //this component has not been mounted yet
1328
+ this.setStateRequired = true;
1329
+ }
1330
+ },
1331
+ immediate: true,
1332
+ deep: true,
1333
+ },
1334
+ },
1335
+ mounted: function () {
1336
+ const flatmap = require("@abi-software/flatmap-viewer");
1337
+ this.tooltipWait = [];
1338
+ this.tooltipWait.length = this.hoverVisibilities.length;
1339
+ this.mapManager = new flatmap.MapManager(this.flatmapAPI);
1340
+ this.flatmapQueries = new FlatmapQueries();
1341
+ this.flatmapQueries.initialise(this.flatmapAPI);
1342
+ if (this.state) {
1343
+ //State is set and require to set the state
1344
+ if (this.setStateRequired) {
1345
+ this.setState(this.state);
1346
+ }
1347
+ } else if (this.renderAtMounted) {
1348
+ this.createFlatmap();
1349
+ }
1350
+ },
1351
+ };
1352
+ </script>
1353
+
1354
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
1355
+ <style scoped lang="scss">
1356
+ @import "~element-ui/packages/theme-chalk/src/button";
1357
+ @import "~element-ui/packages/theme-chalk/src/loading";
1358
+ @import "~element-ui/packages/theme-chalk/src/row";
1359
+ @import "~element-ui/packages/theme-chalk/src/select";
1360
+
1361
+ .beta-popovers {
1362
+ position: absolute;
1363
+ top: 90px;
1364
+ left: 16px;
1365
+ text-align: left;
1366
+ font-size: 25px;
1367
+ }
1368
+
1369
+ .warning-icon {
1370
+ color: $warning;
1371
+
1372
+ &:hover {
1373
+ cursor: pointer;
1374
+ }
1375
+ }
1376
+
1377
+ .warning-text {
1378
+ font-family: Asap, sans-serif;
1379
+ font-size: 15px;
1380
+ vertical-align: 5px;
1381
+ }
1382
+
1383
+ .latest-map-text {
1384
+ color: $app-primary-color;
1385
+ font-family: Asap, sans-serif;
1386
+ font-size: 12px;
1387
+ margin-top: 5px;
1388
+ vertical-align: 10px;
1389
+ cursor: pointer;
1390
+ }
1391
+
1392
+ .latest-changesicon {
1393
+ color: $success;
1394
+
1395
+ &:hover {
1396
+ cursor: pointer;
1397
+ }
1398
+ }
1399
+
1400
+ .latest-changestext {
1401
+ font-family: Asap, sans-serif;
1402
+ font-size: 15px;
1403
+ vertical-align: 5px;
1404
+ }
1405
+
1406
+ .flatmap-container {
1407
+ height: 100%;
1408
+ width: 100%;
1409
+ }
1410
+
1411
+ .pathway-location {
1412
+ position: absolute;
1413
+ bottom: 0px;
1414
+ transition: all 1s ease;
1415
+ &.open {
1416
+ left: 0px;
1417
+ }
1418
+ &.close {
1419
+ left: -298px;
1420
+ }
1421
+ }
1422
+
1423
+ .svg-legends-container {
1424
+ width: 70%;
1425
+ height: auto;
1426
+ position: relative;
1427
+ max-height: 140px;
1428
+ }
1429
+
1430
+ .pathway-container {
1431
+ float: left;
1432
+ padding-left: 16px;
1433
+ padding-right: 18px;
1434
+ text-align: left;
1435
+ overflow: auto;
1436
+ border: 1px solid rgb(220, 223, 230);
1437
+ padding-bottom: 16px;
1438
+ background: #ffffff;
1439
+ overflow-x: hidden;
1440
+ scrollbar-width: thin;
1441
+
1442
+ transition: all 1s ease;
1443
+ &.open {
1444
+ opacity: 1;
1445
+ }
1446
+ &.close {
1447
+ opacity: 0;
1448
+ }
1449
+
1450
+ &::-webkit-scrollbar {
1451
+ width: 4px;
1452
+ }
1453
+
1454
+ &::-webkit-scrollbar-thumb {
1455
+ border-radius: 10px;
1456
+ box-shadow: inset 0 0 6px #c0c4cc;
1457
+ }
1458
+ }
1459
+
1460
+ .flatmap-marker-help {
1461
+ display: inline-block;
1462
+ }
1463
+
1464
+ ::v-deep .popper-bump-right {
1465
+ left: 30px;
1466
+ }
1467
+
1468
+ .el-dropdown-link {
1469
+ cursor: pointer;
1470
+ color: #409eff;
1471
+ }
1472
+ .el-icon-arrow-down {
1473
+ font-size: 12px;
1474
+ }
1475
+ .demonstration {
1476
+ display: block;
1477
+ color: #8492a6;
1478
+ font-size: 14px;
1479
+ margin-bottom: 20px;
1480
+ }
1481
+
1482
+ .tooltip {
1483
+ display: none;
1484
+ }
1485
+
1486
+ ::v-deep .maplibregl-popup {
1487
+ max-width: 300px !important;
1488
+ }
1489
+
1490
+ ::v-deep .flatmap-tooltip-popup {
1491
+ &.maplibregl-popup-anchor-bottom {
1492
+ .maplibregl-popup-content {
1493
+ margin-bottom: 12px;
1494
+ &::after,
1495
+ &::before {
1496
+ top: 100%;
1497
+ border-width: 12px;
1498
+ }
1499
+ /* this border color controlls the color of the triangle (what looks like the fill of the triangle) */
1500
+ &::after {
1501
+ margin-top: -1px;
1502
+ border-color: rgb(255, 255, 255) transparent transparent transparent;
1503
+ }
1504
+ /* this border color controlls the outside, thin border */
1505
+ &::before {
1506
+ margin: 0 auto;
1507
+ border-color: $app-primary-color transparent transparent transparent;
1508
+ }
1509
+ }
1510
+ }
1511
+ &.maplibregl-popup-anchor-top {
1512
+ .maplibregl-popup-content {
1513
+ margin-top: 18px;
1514
+ &::after,
1515
+ &::before {
1516
+ top: calc(-100% + 6px);
1517
+ border-width: 12px;
1518
+ }
1519
+ /* this border color controlls the color of the triangle (what looks like the fill of the triangle) */
1520
+ &::after {
1521
+ margin-top: 1px;
1522
+ border-color: transparent transparent rgb(255, 255, 255) transparent;
1523
+ }
1524
+ &::before {
1525
+ margin: 0 auto;
1526
+ border-color: transparent transparent $app-primary-color transparent;
1527
+ }
1528
+ }
1529
+ }
1530
+ .maplibregl-popup-content {
1531
+ border-radius: 4px;
1532
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
1533
+ pointer-events: none;
1534
+ display: none;
1535
+ background: #fff;
1536
+ border: 1px solid $app-primary-color;
1537
+ padding-left: 6px;
1538
+ padding-right: 6px;
1539
+ display: flex;
1540
+ justify-content: center;
1541
+ align-items: center;
1542
+ &::after,
1543
+ &::before {
1544
+ content: "";
1545
+ display: block;
1546
+ position: absolute;
1547
+ width: 0;
1548
+ height: 0;
1549
+ border-style: solid;
1550
+ flex-shrink: 0;
1551
+ }
1552
+ }
1553
+ .maplibregl-popup-tip {
1554
+ display: none;
1555
+ }
1556
+ }
1557
+
1558
+ ::v-deep .maplibregl-popup {
1559
+ &.flatmap-marker-popup {
1560
+ box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
1561
+ pointer-events: auto;
1562
+ background: #fff;
1563
+ }
1564
+ }
1565
+
1566
+ /* Fix for chrome bug where under triangle pops up above one on top of it */
1567
+ .selector:not(*:root),
1568
+ ::v-deep.flatmap-tooltip-popup {
1569
+ .maplibregl-popup-content::after {
1570
+ top: 99.9%;
1571
+ }
1572
+ }
1573
+
1574
+ ::v-deep .flatmap-tooltip-dialog {
1575
+ .maplibregl-popup-tip {
1576
+ display: none;
1577
+ }
1578
+ }
1579
+
1580
+ ::v-deep .flatmap-marker-popup {
1581
+ .maplibregl-popup-content {
1582
+ padding: 0px;
1583
+ }
1584
+ }
1585
+
1586
+ ::v-deep .flatmapvuer-popover {
1587
+ .maplibregl-popup-close-button {
1588
+ position: absolute;
1589
+ right: 0.5em;
1590
+ top: 0;
1591
+ border: 0;
1592
+ border-radius: 0 3px 0 0;
1593
+ cursor: pointer;
1594
+ background-color: transparent;
1595
+ font-size: 2.5em;
1596
+ color: grey;
1597
+ top: 0.95em;
1598
+ }
1599
+ }
1600
+
1601
+ .zoomOut {
1602
+ padding-left: 8px;
1603
+ }
1604
+
1605
+ .fitWindow {
1606
+ padding-left: 8px;
1607
+ }
1608
+
1609
+ .settings-group {
1610
+ bottom: 16px;
1611
+ position: absolute;
1612
+ transition: all 1s ease;
1613
+ &.open {
1614
+ left: 322px;
1615
+ }
1616
+ &.close {
1617
+ left: 24px;
1618
+ }
1619
+ }
1620
+
1621
+ ::v-deep .background-popper {
1622
+ padding: 5px 12px;
1623
+ background-color: #ffffff;
1624
+ border: 1px solid $app-primary-color;
1625
+ box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
1626
+ height: 270px;
1627
+ width: 175px;
1628
+ min-width: 175px;
1629
+ &.el-popper[x-placement^="top"] {
1630
+ .popper__arrow {
1631
+ border-top-color: $app-primary-color !important;
1632
+ &::after {
1633
+ border-top-color: #fff !important;
1634
+ }
1635
+ }
1636
+ }
1637
+ }
1638
+
1639
+ ::v-deep .open-map-popper {
1640
+ padding-top: 5px;
1641
+ padding-bottom: 5px;
1642
+ background-color: #ffffff;
1643
+ border: 1px solid $app-primary-color;
1644
+ box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
1645
+ width: 178px;
1646
+ min-width: 178px;
1647
+
1648
+ .el-row ~ .el-row {
1649
+ margin-top: 8px;
1650
+ }
1651
+
1652
+ .el-button {
1653
+ padding-top: 5px;
1654
+ padding-bottom: 5px;
1655
+ }
1656
+
1657
+ &.el-popper[x-placement^="top"] {
1658
+ .popper__arrow {
1659
+ border-top-color: $app-primary-color !important;
1660
+ &:after {
1661
+ border-top-color: #fff !important;
1662
+ }
1663
+ }
1664
+ }
1665
+ }
1666
+
1667
+ .backgroundText {
1668
+ color: rgb(48, 49, 51);
1669
+ font-size: 14px;
1670
+ font-weight: normal;
1671
+ line-height: 20px;
1672
+ }
1673
+
1674
+ .backgroundControl {
1675
+ display: flex;
1676
+ margin-top: 12px;
1677
+ }
1678
+
1679
+ .backgroundChoice {
1680
+ width: 20px;
1681
+ height: 20px;
1682
+ border: 1px solid rgb(144, 147, 153);
1683
+ margin-left: 20px;
1684
+ &.active {
1685
+ border: 2px solid $app-primary-color;
1686
+ }
1687
+ &:hover {
1688
+ cursor: pointer;
1689
+ }
1690
+ &.white {
1691
+ background-color: white;
1692
+ margin-left: 10px;
1693
+ }
1694
+ &.black {
1695
+ background-color: black;
1696
+ }
1697
+ &.lightskyblue {
1698
+ background-color: lightskyblue;
1699
+ }
1700
+ }
1701
+
1702
+ .icon-button {
1703
+ height: 24px !important;
1704
+ width: 24px !important;
1705
+ color: $app-primary-color;
1706
+ &:hover {
1707
+ cursor: pointer;
1708
+ }
1709
+ }
1710
+
1711
+ ::v-deep .maplibregl-ctrl-minimap {
1712
+ transform-origin: top right;
1713
+ @media (max-width: 1250px) {
1714
+ height: 125px !important; // important is needed here as we are over-riding the style set by the flatmap
1715
+ width: 180px !important;
1716
+ >>> .maplibregl-canvas .maplibregl-canvas {
1717
+ height: 125px !important;
1718
+ width: 180px !important;
1719
+ }
1720
+ }
1721
+ @media (min-width: 1251px) {
1722
+ height: 190px !important;
1723
+ width: 300px !important;
1724
+ >>> .maplibregl-canvas .maplibregl-canvas {
1725
+ height: 190px !important;
1726
+ width: 300px !important;
1727
+ }
1728
+ }
1729
+ transition: all 1s ease;
1730
+ &.shrink {
1731
+ transform: scale(0.5);
1732
+ transform: scale(0.5);
1733
+ }
1734
+ }
1735
+
1736
+ .minimap-resize {
1737
+ position: absolute;
1738
+ pointer-events: all;
1739
+ cursor: pointer;
1740
+ top: 0;
1741
+ right: 0;
1742
+ padding-top: 3px; // needed as icon is offset
1743
+ width: 20px;
1744
+ height: 14px;
1745
+ z-index: 9;
1746
+ transition: all 1s ease;
1747
+ &.shrink {
1748
+ transform: rotate(0deg);
1749
+ }
1750
+ &.enlarge {
1751
+ transform: rotate(180deg) scale(2);
1752
+ padding-bottom: 5px; // note padding is added to the opposite side since it is rotated
1753
+ padding-left: 5px;
1754
+ }
1755
+ }
1756
+
1757
+ ::v-deep .flatmap-popper {
1758
+ padding: 6px 4px;
1759
+ font-size: 12px;
1760
+ color: rgb(48, 49, 51);
1761
+ background-color: #f3ecf6;
1762
+ border: 1px solid $app-primary-color;
1763
+ white-space: nowrap;
1764
+ min-width: unset;
1765
+ &.warning-popper {
1766
+ min-width: 150px;
1767
+ max-width: 400px;
1768
+ word-break: keep-all;
1769
+ white-space: unset;
1770
+ }
1771
+ &.left-popper {
1772
+ .popper__arrow {
1773
+ border-left-color: $app-primary-color !important;
1774
+ &::after {
1775
+ border-left-color: #f3ecf6 !important;
1776
+ }
1777
+ }
1778
+ }
1779
+ &.right-popper {
1780
+ .popper__arrow {
1781
+ border-right-color: $app-primary-color !important;
1782
+ &:after {
1783
+ border-right-color: #f3ecf6 !important;
1784
+ }
1785
+ }
1786
+ }
1787
+ &.el-popper[x-placement^="top"] {
1788
+ .popper__arrow {
1789
+ border-top-color: $app-primary-color !important;
1790
+ &:after {
1791
+ border-top-color: #f3ecf6 !important;
1792
+ }
1793
+ }
1794
+ }
1795
+ }
1796
+
1797
+ ::v-deep .el-loading-spinner {
1798
+ i,
1799
+ .el-loading-text {
1800
+ color: $app-primary-color;
1801
+ }
1802
+ }
1803
+
1804
+ ::v-deep .flatmap-popup-popper {
1805
+ .maplibregl-popup-tip {
1806
+ border-bottom-color: $app-primary-color;
1807
+ }
1808
+ .maplibregl-popup-content {
1809
+ padding: 6px 4px;
1810
+ font-size: 12px;
1811
+ color: rgb(48, 49, 51);
1812
+ background-color: #f3ecf6;
1813
+ border: 1px solid $app-primary-color;
1814
+ white-space: nowrap;
1815
+ min-width: unset;
1816
+ .maplibregl-popup-close-button {
1817
+ display: none;
1818
+ }
1819
+ }
1820
+ }
1821
+
1822
+ ::v-deep .popper-zoomout {
1823
+ padding-right: 13px !important;
1824
+ left: -21px !important;
1825
+ }
1826
+
1827
+ ::v-deep .popper-zoomout {
1828
+ .popper__arrow {
1829
+ left: 53px !important;
1830
+ }
1831
+ }
1832
+
1833
+ ::v-deep .maplibregl-popup-content {
1834
+ padding: 0px;
1835
+ }
1836
+
1837
+ .bottom-right-control {
1838
+ position: absolute;
1839
+ right: 16px;
1840
+ bottom: 16px;
1841
+ }
1842
+
1843
+ ::v-deep .my-drawer {
1844
+ background: rgba(0, 0, 0, 0);
1845
+ box-shadow: none;
1846
+ }
1847
+
1848
+ .drawer {
1849
+ ::v-deep .el-drawer:focus {
1850
+ outline: none;
1851
+ }
1852
+ }
1853
+
1854
+ .open-drawer,
1855
+ .drawer-button {
1856
+ z-index: 8;
1857
+ width: 20px;
1858
+ height: 40px;
1859
+ border: solid 1px $app-primary-color;
1860
+ text-align: center;
1861
+ vertical-align: middle;
1862
+ cursor: pointer;
1863
+ pointer-events: auto;
1864
+ }
1865
+
1866
+ .open-drawer {
1867
+ position: absolute;
1868
+ left: 0px;
1869
+ background-color: #f7faff;
1870
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
1871
+ }
1872
+
1873
+ .drawer-button {
1874
+ float: left;
1875
+ margin-top: calc(50% - 36px);
1876
+ background-color: #f9f2fc;
1877
+
1878
+ i {
1879
+ font-weight: 600;
1880
+ margin-top: 12px;
1881
+ color: $app-primary-color;
1882
+ transition-delay: 0.9s;
1883
+ }
1884
+ &.open {
1885
+ i {
1886
+ transform: rotate(0deg) scaleY(2);
1887
+ }
1888
+ }
1889
+ &.close {
1890
+ i {
1891
+ transform: rotate(180deg) scaleY(2);
1892
+ }
1893
+ }
1894
+ }
1895
+
1896
+ ::v-deep .maplibregl-canvas-container {
1897
+ canvas {
1898
+ outline: none;
1899
+ }
1900
+ }
1901
+
1902
+ .backgroundSpacer {
1903
+ border-bottom: 1px solid #e4e7ed;
1904
+ margin-bottom: 10px;
1905
+ }
1906
+
1907
+ .flatmap-radio {
1908
+ ::v-deep label {
1909
+ margin-right: 20px;
1910
+ &:last-child {
1911
+ margin-right: 0px;
1912
+ }
1913
+ }
1914
+ ::v-deep .el-radio__input {
1915
+ &.is-checked {
1916
+ & + .el-radio__label {
1917
+ color: $app-primary-color;
1918
+ }
1919
+ .el-radio__inner {
1920
+ border-color: $app-primary-color;
1921
+ background: $app-primary-color;
1922
+ }
1923
+ }
1924
+ .el-radio__inner:hover {
1925
+ border-color: $app-primary-color;
1926
+ }
1927
+ }
1928
+ }
1929
+
1930
+ ::v-deep .custom-popup {
1931
+ .maplibregl-popup-tip {
1932
+ display: none;
1933
+ }
1934
+ .maplibregl-popup-content {
1935
+ border-radius: 4px;
1936
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
1937
+ pointer-events: none;
1938
+ display: none;
1939
+ background: #fff;
1940
+ font-family: "Asap", sans-serif;
1941
+ font-size: 12pt;
1942
+ color: $app-primary-color;
1943
+ border: 1px solid $app-primary-color;
1944
+ padding-left: 6px;
1945
+ padding-right: 6px;
1946
+ padding-top: 6px;
1947
+ padding-bottom: 6px;
1948
+ display: flex;
1949
+ justify-content: center;
1950
+ align-items: center;
1951
+ &::after,
1952
+ &::before {
1953
+ content: "";
1954
+ display: block;
1955
+ position: absolute;
1956
+ width: 0;
1957
+ height: 0;
1958
+ border-style: solid;
1959
+ flex-shrink: 0;
1960
+ }
1961
+ .maplibregl-popup-close-button {
1962
+ display: none;
1963
+ }
1964
+ }
1965
+ &.maplibregl-popup-anchor-bottom {
1966
+ .maplibregl-popup-content {
1967
+ margin-bottom: 12px;
1968
+ &::after,
1969
+ &::before {
1970
+ top: 100%;
1971
+ border-width: 12px;
1972
+ }
1973
+ /* this border color controlls the color of the triangle (what looks like the fill of the triangle) */
1974
+ &::after {
1975
+ margin-top: -1px;
1976
+ border-color: rgb(255, 255, 255) transparent transparent transparent;
1977
+ }
1978
+ /* this border color controlls the outside, thin border */
1979
+ &::before {
1980
+ margin: 0 auto;
1981
+ border-color: $app-primary-color transparent transparent transparent;
1982
+ }
1983
+ }
1984
+ }
1985
+ &.maplibregl-popup-anchor-top {
1986
+ .maplibregl-popup-content {
1987
+ margin-top: 18px;
1988
+ &::after,
1989
+ &::before {
1990
+ top: calc(-100% + 6px);
1991
+ border-width: 12px;
1992
+ }
1993
+ /* this border color controlls the color of the triangle (what looks like the fill of the triangle) */
1994
+ &::after {
1995
+ margin-top: 1px;
1996
+ border-color: transparent transparent rgb(255, 255, 255) transparent;
1997
+ }
1998
+ &::before {
1999
+ margin: 0 auto;
2000
+ border-color: transparent transparent $app-primary-color transparent;
2001
+ }
2002
+ }
2003
+ }
2004
+ }
2005
+
2006
+ .select-box {
2007
+ border-radius: 4px;
2008
+ border: 1px solid rgb(144, 147, 153);
2009
+ background-color: var(--white);
2010
+ font-weight: 500;
2011
+ color: rgb(48, 49, 51);
2012
+ ::v-deep .el-input__inner {
2013
+ height: 30px;
2014
+ color: rgb(48, 49, 51);
2015
+ }
2016
+ ::v-deep .el-input__inner {
2017
+ &is-focus,
2018
+ &:focus {
2019
+ border: 1px solid $app-primary-color;
2020
+ }
2021
+ }
2022
+ ::v-deep .el-input__icon {
2023
+ line-height: 30px;
2024
+ }
2025
+ }
2026
+
2027
+ ::v-deep .flatmap_dropdown {
2028
+ min-width: 160px !important;
2029
+ .el-select-dropdown__item {
2030
+ white-space: nowrap;
2031
+ text-align: left;
2032
+ &.selected {
2033
+ color: $app-primary-color;
2034
+ font-weight: normal;
2035
+ }
2036
+ }
2037
+ }
2038
+ </style>
2039
+