@abi-software/flatmapvuer 1.21.0 → 1.21.1-demo.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.
@@ -2,6 +2,7 @@
2
2
  <div
3
3
  class="flatmap-container"
4
4
  ref="flatmapContainer"
5
+ data-help-scope
5
6
  v-loading="loading"
6
7
  element-loading-text="Loading..."
7
8
  element-loading-background="rgba(0, 0, 0, 0.3)"
@@ -9,7 +10,24 @@
9
10
  <map-svg-sprite-color />
10
11
  <div style="height: 100%; width: 100%; position: relative; overflow-y: none">
11
12
  <!-- flatmap-display -->
12
- <div style="height: 100%; width: 100%" ref="display" class="flatmap-display"></div>
13
+ <div
14
+ style="height: 100%; width: 100%"
15
+ ref="display"
16
+ class="flatmap-display"
17
+ v-help-mode="{
18
+ id: 'flatmap-map-popup',
19
+ area: 'map-info',
20
+ // After the controls at the top left, e.g. what's new, the map is below them
21
+ order: 1,
22
+ title: 'Explore the map',
23
+ description:
24
+ '<b>Hover</b> over a feature on the map to see its name, <b>click</b> on it to see more information (depending on the viewing mode).',
25
+ placement: 'bottom',
26
+ target: () => $el.querySelector('.flatmap-popup-popper'),
27
+ onEnter: openFlatmapHelpPopup,
28
+ onLeave: closeFlatmapHelpPopup,
29
+ }"
30
+ ></div>
13
31
  <!-- flatmap-error -->
14
32
  <FlatmapError v-if="flatmapError" :flatmapError="flatmapError" />
15
33
 
@@ -20,18 +38,13 @@
20
38
  placement="right"
21
39
  popper-class="warning-popper flatmap-popper"
22
40
  :teleported="false"
23
- :visible="hoverVisibilities[7].value"
41
+ trigger="hover"
42
+ :show-after="tooltipDelay"
43
+ :hide-after="tooltipDelay"
24
44
  ref="warningPopover"
25
45
  >
26
- <!--
27
- What magic meaning do the numbers 6, 7, etc have?
28
-
29
- Please use `const` to assign meaningful names to them...
30
- -->
31
- <p v-if="isLegacy" @mouseover="showTooltip(7)" @mouseout="hideTooltip(7)">
32
- This is a legacy map, you may view the latest map instead.
33
- </p>
34
- <p v-else-if="isFC" @mouseover="showTooltip(7)" @mouseout="hideTooltip(7)">
46
+ <p v-if="isLegacy">This is a legacy map, you may view the latest map instead.</p>
47
+ <p v-else-if="isFC">
35
48
  This map displays the connectivity of individual neurons. Specifically, those which
36
49
  align with (parts of) the neuron populations from the
37
50
  <a href="https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew" target="_blank">
@@ -43,7 +56,7 @@ Please use `const` to assign meaningful names to them...
43
56
  </a>
44
57
  .
45
58
  </p>
46
- <p v-else @mouseover="showTooltip(7)" @mouseout="hideTooltip(7)">
59
+ <p v-else>
47
60
  This map displays the connectivity of neuron populations. Specifically, those from the
48
61
  primarily rat-based
49
62
  <a href="https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew" target="_blank">
@@ -57,7 +70,16 @@ Please use `const` to assign meaningful names to them...
57
70
  progresses.
58
71
  </p>
59
72
  <template #reference>
60
- <div class="warning-icon" @mouseover="showTooltip(7)" @mouseout="hideTooltip(7)">
73
+ <div
74
+ class="warning-icon"
75
+ v-help-mode="{
76
+ id: 'flatmap-warning',
77
+ area: 'map-info',
78
+ title: 'About this map',
79
+ description: warningHelpDescription,
80
+ placement: 'right',
81
+ }"
82
+ >
61
83
  <el-icon v-if="displayWarning || isLegacy"><el-icon-warning-filled /></el-icon>
62
84
  <template v-if="isLegacy">
63
85
  <span class="warning-text">Legacy Map</span>
@@ -76,17 +98,23 @@ Please use `const` to assign meaningful names to them...
76
98
  placement="right"
77
99
  v-if="displayLatestChanges"
78
100
  :teleported="false"
79
- trigger="manual"
101
+ trigger="hover"
80
102
  popper-class="warning-popper flatmap-popper"
81
- :visible="hoverVisibilities[8].value"
103
+ :show-after="tooltipDelay"
104
+ :hide-after="tooltipDelay"
82
105
  ref="whatsNewPopover"
83
106
  >
84
107
  <template #reference>
85
108
  <div
86
109
  class="latest-changesicon"
110
+ v-help-mode="{
111
+ id: 'flatmap-whats-new',
112
+ area: 'map-info',
113
+ title: 'What\'s new?',
114
+ description: 'See the latest changes and improvements made to this viewer.',
115
+ placement: 'right',
116
+ }"
87
117
  v-if="displayLatestChanges"
88
- @mouseover="showTooltip(8)"
89
- @mouseout="hideTooltip(8)"
90
118
  >
91
119
  <el-icon><el-icon-warning-filled /></el-icon>
92
120
  <span class="warning-text">What's new?</span>
@@ -127,13 +155,10 @@ Please use `const` to assign meaningful names to them...
127
155
  :activeDrawMode="activeDrawMode"
128
156
  :newlyDrawnEntry="drawnCreatedEvent"
129
157
  :connectionEntry="connectionEntry"
130
- :hoverVisibilities="hoverVisibilities"
131
158
  @clickToolbar="toolbarEvent"
132
159
  @featureTooltip="connectedFeatureTooltip"
133
160
  @confirmDrawn="confirmDrawnFeature"
134
161
  @cancelDrawn="cancelDrawnFeature"
135
- @showTooltip="showTooltip"
136
- @hideTooltip="hideTooltip"
137
162
  ref="toolbarPopover"
138
163
  />
139
164
 
@@ -142,18 +167,25 @@ Please use `const` to assign meaningful names to them...
142
167
  content="Zoom in"
143
168
  placement="left"
144
169
  :teleported="false"
145
- trigger="manual"
146
- width="70"
170
+ trigger="hover"
171
+ width="max-content"
147
172
  popper-class="flatmap-popper"
148
- :visible="hoverVisibilities[1].value"
173
+ :show-after="tooltipDelay"
174
+ :hide-after="tooltipDelay"
149
175
  ref="zoomInPopover"
150
176
  >
151
177
  <template #reference>
152
178
  <div
153
179
  class="icon-button-container"
180
+ v-help-mode="{
181
+ id: 'flatmap-zoom-in',
182
+ area: 'zoom',
183
+ title: 'Zoom in',
184
+ description:
185
+ 'Zoom in to see more detail. You can also scroll, or pinch open on a touch screen.',
186
+ placement: 'left',
187
+ }"
154
188
  @click="zoomIn()"
155
- @mouseover="showTooltip(1)"
156
- @mouseout="hideTooltip(1)"
157
189
  >
158
190
  <map-svg-icon class="icon-button zoomIn" icon="zoomIn" />
159
191
  </div>
@@ -163,130 +195,134 @@ Please use `const` to assign meaningful names to them...
163
195
  content="Zoom out"
164
196
  placement="top-end"
165
197
  :teleported="false"
166
- trigger="manual"
167
- width="70"
198
+ trigger="hover"
199
+ width="max-content"
168
200
  popper-class="flatmap-popper"
169
- :visible="hoverVisibilities[2].value"
201
+ :show-after="tooltipDelay"
202
+ :hide-after="tooltipDelay"
170
203
  ref="zoomOutPopover"
171
204
  >
172
205
  <template #reference>
173
206
  <div
174
207
  class="icon-button-container"
208
+ v-help-mode="{
209
+ id: 'flatmap-zoom-out',
210
+ area: 'zoom',
211
+ title: 'Zoom out',
212
+ description:
213
+ 'Zoom out to see more. You can also scroll, or pinch closed on a touch screen.',
214
+ placement: 'top',
215
+ }"
175
216
  @click="zoomOut()"
176
- @mouseover="showTooltip(2)"
177
- @mouseout="hideTooltip(2)"
178
217
  >
179
218
  <map-svg-icon class="icon-button zoomOut" icon="zoomOut" />
180
219
  </div>
181
220
  </template>
182
221
  </el-popover>
183
222
  <el-popover
184
- content="Reset"
185
223
  placement="top"
186
224
  :teleported="false"
187
- trigger="manual"
188
- width="70"
225
+ trigger="hover"
226
+ width="max-content"
189
227
  popper-class="flatmap-popper"
190
- :visible="hoverVisibilities[3].value"
228
+ :show-after="tooltipDelay"
229
+ :hide-after="tooltipDelay"
191
230
  ref="zoomFitPopover"
231
+ content="Fit to view"
192
232
  >
193
- <div>
194
- Fit to
195
- <br />
196
- window
197
- </div>
198
233
  <template #reference>
199
234
  <div
200
235
  class="icon-button-container"
236
+ v-help-mode="{
237
+ id: 'flatmap-zoom-fit',
238
+ area: 'zoom',
239
+ title: 'Fit to view',
240
+ description: 'Reset the zoom and position so everything fits in this view.',
241
+ placement: 'top',
242
+ }"
201
243
  @click="resetView()"
202
- @mouseover="showTooltip(3)"
203
- @mouseout="hideTooltip(3)"
204
244
  >
205
245
  <map-svg-icon class="icon-button fitWindow" icon="fitWindow" />
206
246
  </div>
207
247
  </template>
208
248
  </el-popover>
209
249
  </div>
210
- <el-popover
211
- content="Change pathway visibility"
212
- placement="right"
213
- :teleported="false"
214
- trigger="manual"
215
- :offset="-18"
216
- popper-class="flatmap-popper"
217
- :visible="hoverVisibilities[6].value"
218
- ref="checkBoxPopover"
250
+ <div
251
+ class="pathway-location"
252
+ :class="{ open: drawerOpen, close: !drawerOpen }"
253
+ v-show="!disableUI && requiresDrawer"
219
254
  >
220
- <template #reference>
255
+ <div
256
+ class="pathway-container"
257
+ v-help-mode="{
258
+ id: 'flatmap-pathways',
259
+ area: 'legends',
260
+ title: showPathwayFilter ? 'Pathways and legends' : 'Legends',
261
+ description: showPathwayFilter
262
+ ? 'Show or hide pathways, systems and other map layers using the checkboxes in this panel.'
263
+ : 'The legends explain the symbols and colors used on this map.',
264
+ placement: 'right',
265
+ onEnter: openHelpModeDrawer,
266
+ onLeave: restoreHelpModeDrawer,
267
+ }"
268
+ :class="{ open: drawerOpen, close: !drawerOpen }"
269
+ :style="{ 'max-height': pathwaysMaxHeight + 'px' }"
270
+ >
271
+ <dynamic-legends
272
+ v-if="legendEntry.length"
273
+ identifierKey="prompt"
274
+ colourKey="colour"
275
+ styleKey="style"
276
+ :legends="legendEntry"
277
+ :showStarInLegend="true"
278
+ ref="featuredMarkerPopover"
279
+ class="svg-legends-container"
280
+ />
281
+ <!-- The line below places the yellowstar svg on the left, and the text "Featured markers on the right" with css so they are both centered in the div -->
221
282
  <div
222
- class="pathway-location"
223
- :class="{ open: drawerOpen, close: !drawerOpen }"
224
- v-show="!disableUI && requiresDrawer"
283
+ v-show="helpModeMarkerVisible"
284
+ class="flatmap-marker-help"
285
+ v-help-mode="{
286
+ id: 'flatmap-marker',
287
+ area: 'legends',
288
+ title: 'Dataset markers',
289
+ description:
290
+ 'Find these markers on the map for data. The number inside a marker is the number of datasets available at that location.',
291
+ placement: 'right',
292
+ onEnter: () => setHelpModeMarker(true),
293
+ onLeave: () => setHelpModeMarker(false),
294
+ }"
225
295
  >
226
- <div
227
- class="pathway-container"
228
- :class="{ open: drawerOpen, close: !drawerOpen }"
229
- :style="{ 'max-height': pathwaysMaxHeight + 'px' }"
230
- v-popover:checkBoxPopover
231
- >
232
- <dynamic-legends
233
- v-if="legendEntry.length"
234
- identifierKey="prompt"
235
- colourKey="colour"
236
- styleKey="style"
237
- :legends="legendEntry"
238
- :showStarInLegend="true"
239
- :showDatasetMarkerTooltip="showDatasetMarkerTooltip"
240
- ref="featuredMarkerPopover"
241
- class="svg-legends-container"
242
- />
243
- <!-- The line below places the yellowstar svg on the left, and the text "Featured markers on the right" with css so they are both centered in the div -->
244
- <el-popover
245
- content="Find these markers for data. The number inside the markers is the number of datasets available for each marker."
246
- placement="right"
247
- :teleported="false"
248
- width="200"
249
- trigger="manual"
250
- popper-class="flatmap-popper flatmap-marker-popper"
251
- :visible="hoverVisibilities[0].value"
252
- ref="markerPopover"
253
- >
254
- <template #reference>
255
- <div
256
- v-show="hoverVisibilities[0].value"
257
- class="flatmap-marker-help"
258
- v-html="flatmapMarker"
259
- v-popover:markerPopover
260
- ></div>
261
- </template>
262
- </el-popover>
263
- <tree-controls
264
- v-if="isFC && systems && systems.length > 0"
265
- class="treeControls"
266
- mapType="flatmap"
267
- title="Systems"
268
- :treeData="systems"
269
- :active="currentActive"
270
- :hover="currentHover"
271
- @checkChanged="systemSelected"
272
- @checkAll="checkAllSystems"
273
- @changeActive="ftuSelected"
274
- ref="treeControls"
275
- />
276
- <selections-group
277
- v-if="containsAlert && alertOptions && showPathwayFilter"
278
- title="Notes"
279
- labelKey="label"
280
- identifierKey="key"
281
- :selections="alertOptions"
282
- @changed="alertSelected"
283
- @checkboxMouseEnter="alertMouseEnterEmitted"
284
- @selections-data-changed="onSelectionsDataChanged"
285
- @checkAll="checkAllAlerts"
286
- ref="alertSelection"
287
- key="alertSelection"
288
- />
289
- <!--
296
+ <div class="flatmap-marker-help-icon" v-html="flatmapMarker"></div>
297
+ <span class="flatmap-marker-help-label">Dataset markers</span>
298
+ </div>
299
+ <tree-controls
300
+ v-if="isFC && systems && systems.length > 0"
301
+ class="treeControls"
302
+ mapType="flatmap"
303
+ title="Systems"
304
+ :treeData="systems"
305
+ :active="currentActive"
306
+ :hover="currentHover"
307
+ @checkChanged="systemSelected"
308
+ @checkAll="checkAllSystems"
309
+ @changeActive="ftuSelected"
310
+ ref="treeControls"
311
+ />
312
+ <selections-group
313
+ v-if="containsAlert && alertOptions && showPathwayFilter"
314
+ title="Notes"
315
+ labelKey="label"
316
+ identifierKey="key"
317
+ :selections="alertOptions"
318
+ @changed="alertSelected"
319
+ @checkboxMouseEnter="alertMouseEnterEmitted"
320
+ @selections-data-changed="onSelectionsDataChanged"
321
+ @checkAll="checkAllAlerts"
322
+ ref="alertSelection"
323
+ key="alertSelection"
324
+ />
325
+ <!--
290
326
  <selections-group
291
327
  v-if="isFC && sckanDisplay && sckanDisplay.length > 0"
292
328
  title="SCKAN"
@@ -312,45 +348,43 @@ Please use `const` to assign meaningful names to them...
312
348
  key="layersSelection"
313
349
  />
314
350
  -->
315
- <selections-group
316
- v-if="pathways && pathways.length > 0"
317
- title="Pathways"
318
- labelKey="label"
319
- identifierKey="type"
320
- colourStyle="line"
321
- :selections="pathways"
322
- :showAsLegend="!showPathwayFilter"
323
- @changed="pathwaysSelected"
324
- @selections-data-changed="onSelectionsDataChanged"
325
- @checkAll="checkAllPathways"
326
- ref="pathwaysSelection"
327
- key="pathwaysSelection"
328
- />
329
- <selections-group
330
- v-if="taxonConnectivity && taxonConnectivity.length > 0 && showPathwayFilter"
331
- title="Studied in"
332
- labelKey="label"
333
- identifierKey="taxon"
334
- helpMessage="Evidence exists that this set of neuron populations have been studied in the given species."
335
- :selections="taxonConnectivity"
336
- @changed="taxonsSelected"
337
- @checkboxMouseEnter="taxonMouseEnterEmitted"
338
- @selections-data-changed="onSelectionsDataChanged"
339
- @checkAll="checkAllTaxons"
340
- ref="taxonSelection"
341
- key="taxonSelection"
342
- />
343
- </div>
344
- <div
345
- @click="toggleDrawer"
346
- class="drawer-button"
347
- :class="{ open: drawerOpen, close: !drawerOpen }"
348
- >
349
- <el-icon><el-icon-arrow-left /></el-icon>
350
- </div>
351
- </div>
352
- </template>
353
- </el-popover>
351
+ <selections-group
352
+ v-if="pathways && pathways.length > 0"
353
+ title="Pathways"
354
+ labelKey="label"
355
+ identifierKey="type"
356
+ colourStyle="line"
357
+ :selections="pathways"
358
+ :showAsLegend="!showPathwayFilter"
359
+ @changed="pathwaysSelected"
360
+ @selections-data-changed="onSelectionsDataChanged"
361
+ @checkAll="checkAllPathways"
362
+ ref="pathwaysSelection"
363
+ key="pathwaysSelection"
364
+ />
365
+ <selections-group
366
+ v-if="taxonConnectivity && taxonConnectivity.length > 0 && showPathwayFilter"
367
+ title="Studied in"
368
+ labelKey="label"
369
+ identifierKey="taxon"
370
+ helpMessage="Evidence exists that this set of neuron populations have been studied in the given species."
371
+ :selections="taxonConnectivity"
372
+ @changed="taxonsSelected"
373
+ @checkboxMouseEnter="taxonMouseEnterEmitted"
374
+ @selections-data-changed="onSelectionsDataChanged"
375
+ @checkAll="checkAllTaxons"
376
+ ref="taxonSelection"
377
+ key="taxonSelection"
378
+ />
379
+ </div>
380
+ <div
381
+ @click="toggleDrawer"
382
+ class="drawer-button"
383
+ :class="{ open: drawerOpen, close: !drawerOpen }"
384
+ >
385
+ <el-icon><el-icon-arrow-left /></el-icon>
386
+ </div>
387
+ </div>
354
388
  <el-popover
355
389
  v-if="openMapRef"
356
390
  ref="open-map-popover"
@@ -477,7 +511,9 @@ Please use `const` to assign meaningful names to them...
477
511
  >
478
512
  <el-row v-if="showOpenMapButton">
479
513
  <el-popover
480
- :visible="hoverVisibilities[4].value"
514
+ trigger="hover"
515
+ :show-after="tooltipDelay"
516
+ :hide-after="tooltipDelay"
481
517
  content="Open new map"
482
518
  placement="right"
483
519
  :teleported="false"
@@ -488,9 +524,15 @@ Please use `const` to assign meaningful names to them...
488
524
  <div
489
525
  v-if="enableOpenMapUI && openMapOptions.length > 0"
490
526
  ref="openMapRef"
527
+ v-help-mode="{
528
+ id: 'flatmap-open-map',
529
+ area: 'map-settings',
530
+ title: 'Open new map',
531
+ description:
532
+ 'Open another map viewer, such as a different species or a connectivity map.',
533
+ placement: 'right',
534
+ }"
491
535
  class="icon-button-container"
492
- @mouseover="showTooltip(4)"
493
- @mouseout="hideTooltip(4)"
494
536
  >
495
537
  <map-svg-icon icon="openMap" class="icon-button open-map-button" />
496
538
  </div>
@@ -501,18 +543,25 @@ Please use `const` to assign meaningful names to them...
501
543
  <el-popover
502
544
  content="Change settings"
503
545
  placement="right"
504
- :visible="hoverVisibilities[5].value"
546
+ :show-after="tooltipDelay"
547
+ :hide-after="tooltipDelay"
505
548
  :teleported="false"
506
- trigger="manual"
549
+ trigger="hover"
507
550
  popper-class="flatmap-popper"
508
551
  ref="settingsPopover"
509
552
  >
510
553
  <template #reference>
511
554
  <div
512
555
  ref="backgroundIconRef"
556
+ v-help-mode="{
557
+ id: 'flatmap-settings',
558
+ area: 'map-settings',
559
+ title: 'Settings',
560
+ description:
561
+ 'Change the map settings, such as the background colour and the viewing mode.',
562
+ placement: 'right',
563
+ }"
513
564
  class="icon-button-container"
514
- @mouseover="showTooltip(5)"
515
- @mouseout="hideTooltip(5)"
516
565
  >
517
566
  <map-svg-icon icon="changeBckgd" class="icon-button" />
518
567
  </div>
@@ -557,6 +606,7 @@ import { capitalise, normaliseAlertToStringArray } from './utilities.js';
557
606
  import yellowstar from '../icons/yellowstar';
558
607
  import ResizeSensor from 'css-element-queries/src/ResizeSensor';
559
608
  import flatmap from '../services/flatmapLoader.js';
609
+ import { attachSomaLocationMarkerMethods } from '../services/somaLocationMarkers.js';
560
610
  import { AnnotationService } from '@abi-software/sparc-annotation';
561
611
  import { mapState } from 'pinia';
562
612
  import { useMainStore } from '@/store/index';
@@ -566,12 +616,17 @@ import {
566
616
  Tooltip,
567
617
  TreeControls,
568
618
  getFlatmapFilterOptions,
619
+ collectHelpModeSteps,
620
+ helpModeDirective,
569
621
  } from '@abi-software/map-utilities';
570
622
  import '@abi-software/map-utilities/dist/style.css';
571
623
  import EventBus from './EventBus.js';
572
624
  import FlatmapError from './FlatmapError.vue';
573
625
 
574
626
  const ERROR_MESSAGE = 'cannot be found on the map.';
627
+ // The drawer opened for the help is closed after this delay, so it stays open between
628
+ // the help of its items, e.g. the legends then the dataset markers
629
+ const HELP_MODE_DRAWER_RESTORE_DELAY = 500;
575
630
 
576
631
  const centroid = (geometry) => {
577
632
  let featureGeometry = { lng: 0, lat: 0 };
@@ -639,6 +694,9 @@ export default {
639
694
  DrawToolbar,
640
695
  FlatmapError,
641
696
  },
697
+ directives: {
698
+ helpMode: helpModeDirective,
699
+ },
642
700
  beforeCreate: function () {
643
701
  //The state watcher may triggered before
644
702
  //created causing issue, This flag will
@@ -2326,133 +2384,45 @@ export default {
2326
2384
  },
2327
2385
  /**
2328
2386
  * @public
2329
- * Function to set help mode
2330
- * by providing flag ``helpMode`` (true/false).
2331
- * @arg {Boolean} `helpMode`
2387
+ * Function to get the help mode steps of this flatmap, from the elements with ``v-help-mode``,
2388
+ * to be used with ``HelpModeTour`` and ``HelpModeHover`` from ``@abi-software/map-utilities``.
2389
+ * @returns {Array} The list of help steps.
2332
2390
  */
2333
- setHelpMode: function (helpMode) {
2334
- const toolTipsLength = this.hoverVisibilities.length;
2335
- const lastIndex = toolTipsLength - 1;
2336
- const activePopoverObj = this.hoverVisibilities[this.helpModeActiveIndex];
2337
-
2338
- if (activePopoverObj) {
2339
- const popoverRefsId = activePopoverObj?.refs;
2340
- const popoverRefId = activePopoverObj?.ref;
2341
- const popoverRef = this.$refs[popoverRefsId ? popoverRefsId : popoverRefId];
2342
-
2343
- if (popoverRef) {
2344
- // Open pathway drawer if the tooltip is inside or beside
2345
- const { parentElement, nextElementSibling } = popoverRef.$el;
2346
- const isPathwayContainer = (element) => {
2347
- return (
2348
- element &&
2349
- (element.classList.contains('pathway-container') ||
2350
- element.classList.contains('pathway-location'))
2351
- );
2352
- };
2353
-
2354
- if (isPathwayContainer(parentElement) || isPathwayContainer(nextElementSibling)) {
2355
- if (this.requiresDrawer) {
2356
- this.drawerOpen = true;
2357
- } else {
2358
- this.helpModeActiveIndex += 1;
2359
- }
2360
- }
2361
- } else {
2362
- // skip the unavailable tooltips
2363
- this.helpModeActiveIndex += 1;
2364
- this.setHelpMode(helpMode);
2365
- }
2366
- }
2367
-
2368
- // Skip checkbox tooltip if pathway filter is not shown
2369
- const activePopoverObjAfter = this.hoverVisibilities[this.helpModeActiveIndex];
2370
- if (activePopoverObjAfter?.ref === 'checkBoxPopover' && !this.showPathwayFilter) {
2371
- this.helpModeActiveIndex += 1;
2372
- this.setHelpMode(helpMode);
2373
- }
2374
-
2375
- if (!helpMode) {
2376
- // reset to iniital state
2377
- this.helpModeActiveIndex = this.helpModeInitialIndex;
2378
- }
2379
-
2380
- if (this.viewingMode !== 'Annotation' && this.helpModeActiveIndex > 9) {
2381
- this.helpModeActiveIndex = lastIndex;
2382
- }
2383
-
2384
- if (helpMode && this.helpModeActiveIndex >= lastIndex) {
2385
- /**
2386
- * This event is emitted when the tooltips in help mode reach the last item.
2387
- */
2388
- this.$emit('help-mode-last-item', true);
2389
- }
2390
-
2391
- if (helpMode && !this.helpModeDialog) {
2392
- this.inHelp = true;
2393
- this.hoverVisibilities.forEach((item) => {
2394
- item.value = true;
2395
- });
2396
- } else if (helpMode && this.helpModeDialog && toolTipsLength > this.helpModeActiveIndex) {
2397
- // Show the map tooltip as first item
2398
- if (this.helpModeActiveIndex > -1) {
2399
- this.closeFlatmapHelpPopup();
2400
-
2401
- // wait for CSS transition
2402
- setTimeout(() => {
2403
- this.inHelp = false;
2404
- this.hoverVisibilities.forEach((item) => {
2405
- item.value = false;
2406
- });
2407
-
2408
- this.showTooltip(this.helpModeActiveIndex, 200);
2409
- }, 300);
2410
- } else if (this.helpModeActiveIndex === -1) {
2411
- this.openFlatmapHelpPopup();
2412
- }
2413
- } else {
2414
- this.inHelp = false;
2415
- this.hoverVisibilities.forEach((item) => {
2416
- item.value = false;
2417
- });
2418
- this.closeFlatmapHelpPopup();
2419
- }
2391
+ getHelpModeSteps: function () {
2392
+ return collectHelpModeSteps(this.$el);
2420
2393
  },
2421
2394
  /**
2422
- * @public
2423
- * Function to show tooltip
2424
- * by providing ``tooltipNumber``.
2425
- * @arg {Number} `tooltipNumber`
2426
- * @arg {Number} `timeout` _(default: `500`)_
2395
+ * Open the pathway drawer to show the help of the items inside it.
2427
2396
  */
2428
- showTooltip: function (tooltipNumber, timeout = 500) {
2429
- if (!this.inHelp) {
2430
- clearTimeout(this.tooltipWait[tooltipNumber]);
2431
- this.tooltipWait[tooltipNumber] = setTimeout(() => {
2432
- this.hoverVisibilities[tooltipNumber].value = true;
2433
- /**
2434
- * This event is emitted after a tooltip in Flatmap is shown.
2435
- */
2436
- this.$emit('shown-tooltip');
2437
- }, timeout);
2438
- }
2397
+ openHelpModeDrawer: function () {
2398
+ clearTimeout(this.helpModeDrawerTimeout);
2399
+ if (!this.requiresDrawer) return;
2400
+ // Remember to close it again if the user had closed it
2401
+ if (!this.drawerOpen) this.helpModeDrawerOpened = true;
2402
+ this.drawerOpen = true;
2439
2403
  },
2440
-
2441
2404
  /**
2442
- * @public
2443
- * Function to hide tooltip
2444
- * by providing ``tooltipNumber``.
2445
- * @arg {Number} `tooltipNumber`
2446
- * @arg {Number} `timeout` _(default: `500`)_
2405
+ * Close the drawer again if it was opened for the help, see `openHelpModeDrawer`.
2447
2406
  */
2448
- hideTooltip: function (tooltipNumber, timeout = 500) {
2449
- if (!this.inHelp) {
2450
- clearTimeout(this.tooltipWait[tooltipNumber]);
2451
- this.tooltipWait[tooltipNumber] = setTimeout(() => {
2452
- this.hoverVisibilities[tooltipNumber].value = false;
2453
- }, timeout);
2407
+ restoreHelpModeDrawer: function () {
2408
+ clearTimeout(this.helpModeDrawerTimeout);
2409
+ this.helpModeDrawerTimeout = setTimeout(() => {
2410
+ if (this.helpModeDrawerOpened) this.drawerOpen = false;
2411
+ this.helpModeDrawerOpened = false;
2412
+ }, HELP_MODE_DRAWER_RESTORE_DELAY);
2413
+ },
2414
+ /**
2415
+ * Show the dataset marker in the drawer, which is otherwise only shown on hover.
2416
+ */
2417
+ setHelpModeMarker: function (visible) {
2418
+ if (visible) {
2419
+ this.openHelpModeDrawer();
2420
+ } else {
2421
+ this.restoreHelpModeDrawer();
2454
2422
  }
2423
+ this.helpModeMarkerVisible = visible;
2455
2424
  },
2425
+
2456
2426
  /**
2457
2427
  * @public
2458
2428
  * Function to display tooltip
@@ -2560,10 +2530,6 @@ export default {
2560
2530
  anchor: 'top',
2561
2531
  className: 'flatmap-popup-popper',
2562
2532
  });
2563
- /**
2564
- * This event is emitted after a tooltip on Flatmap's map is shown.
2565
- */
2566
- this.$emit('shown-map-tooltip');
2567
2533
  }
2568
2534
  }
2569
2535
  },
@@ -2572,9 +2538,12 @@ export default {
2572
2538
  * Function to close Flatmap Help Popup.
2573
2539
  */
2574
2540
  closeFlatmapHelpPopup: function () {
2575
- this.$el.querySelectorAll('.maplibregl-popup-close-button').forEach((item) => {
2576
- item.click();
2577
- });
2541
+ // Only the help popup, not a popup the user opened
2542
+ this.$el
2543
+ .querySelectorAll('.flatmap-popup-popper .maplibregl-popup-close-button')
2544
+ .forEach((item) => {
2545
+ item.click();
2546
+ });
2578
2547
  },
2579
2548
  /**
2580
2549
  * @public
@@ -2786,7 +2755,7 @@ export default {
2786
2755
  });
2787
2756
  promise1
2788
2757
  .then((returnedObject) => {
2789
- this.mapImp = returnedObject;
2758
+ this.mapImp = attachSomaLocationMarkerMethods(returnedObject);
2790
2759
  this.serverURL = this.mapImp.makeServerUrl('').slice(0, -1);
2791
2760
  let mapVersion = this.mapImp.details.version;
2792
2761
  this.setFlightPathInfo(mapVersion);
@@ -3216,44 +3185,6 @@ export default {
3216
3185
  type: Boolean,
3217
3186
  default: true,
3218
3187
  },
3219
- /**
3220
- * The option to show tooltips for help mode.
3221
- */
3222
- helpMode: {
3223
- type: Boolean,
3224
- default: false,
3225
- },
3226
- /**
3227
- * The active item index of help mode.
3228
- */
3229
- helpModeActiveItem: {
3230
- type: Number,
3231
- default: 0,
3232
- },
3233
- /**
3234
- * The option to use helpModeDialog.
3235
- * On default, `false`, clicking help will show all tooltips.
3236
- * If `true`, clicking help will show the help-mode-dialog.
3237
- */
3238
- helpModeDialog: {
3239
- type: Boolean,
3240
- default: false,
3241
- },
3242
- /**
3243
- * The last item of help mode.
3244
- */
3245
- helpModeLastItem: {
3246
- type: Boolean,
3247
- default: false,
3248
- },
3249
- /**
3250
- * The initial index number for help mode tooltips.
3251
- * Set negative (e.g. -2) if there are other tooltips outside of `hoverVisibilities`.
3252
- */
3253
- helpModeInitialIndex: {
3254
- type: Number,
3255
- default: 0,
3256
- },
3257
3188
  /**
3258
3189
  * This flag dictate whether a context will be allocatged
3259
3190
  * for this instance
@@ -3435,6 +3366,9 @@ export default {
3435
3366
  flatmapAPI: this.flatmapAPI,
3436
3367
  sparcAPI: this.sparcAPI,
3437
3368
  userApiKey: this.userToken,
3369
+ // For the help of the items in the pathway drawer, e.g. in the legends
3370
+ openHelpModeDrawer: this.openHelpModeDrawer,
3371
+ restoreHelpModeDrawer: this.restoreHelpModeDrawer,
3438
3372
  };
3439
3373
  },
3440
3374
  data: function () {
@@ -3462,29 +3396,11 @@ export default {
3462
3396
  systems: [],
3463
3397
  taxonConnectivity: [],
3464
3398
  pathwaysMaxHeight: 1000,
3465
- tooltipWait: markRaw([]),
3466
- hoverVisibilities: [
3467
- { value: false, ref: 'markerPopover' }, // 0
3468
- { value: false, ref: 'zoomInPopover' }, // 1
3469
- { value: false, ref: 'zoomOutPopover' }, // 2
3470
- { value: false, ref: 'zoomFitPopover' }, // 3
3471
- { value: false, ref: 'openMapPopover' }, // 4
3472
- { value: false, ref: 'settingsPopover' }, // 5
3473
- { value: false, ref: 'checkBoxPopover' }, // 6
3474
- { value: false, ref: 'warningPopover' }, // 7
3475
- { value: false, ref: 'whatsNewPopover' }, // 8
3476
- { value: false, ref: 'featuredMarkerPopover' }, // 9
3477
- { value: false, refs: 'toolbarPopover', ref: 'editPopover' }, // 10
3478
- { value: false, refs: 'toolbarPopover', ref: 'deletePopover' }, // 11
3479
- { value: false, refs: 'toolbarPopover', ref: 'pointPopover' }, // 12
3480
- { value: false, refs: 'toolbarPopover', ref: 'lineStringPopover' }, // 13
3481
- { value: false, refs: 'toolbarPopover', ref: 'polygonPopover' }, // 14
3482
- { value: false, refs: 'toolbarPopover', ref: 'connectionPopover' }, // 15
3483
- ],
3484
- helpModeActiveIndex: this.helpModeInitialIndex,
3399
+ // Delay before showing and hiding the control tooltips
3400
+ tooltipDelay: 500,
3401
+ helpModeMarkerVisible: false,
3485
3402
  yellowstar: yellowstar,
3486
3403
  isFC: false,
3487
- inHelp: false,
3488
3404
  currentBackground: 'white',
3489
3405
  availableBackground: ['white', 'lightskyblue', 'black'],
3490
3406
  loading: false,
@@ -3557,6 +3473,15 @@ export default {
3557
3473
  };
3558
3474
  },
3559
3475
  computed: {
3476
+ warningHelpDescription: function () {
3477
+ if (this.isLegacy) {
3478
+ return 'This is a legacy map. Click the link below the icon to view the latest map instead.';
3479
+ }
3480
+ if (this.isFC) {
3481
+ return 'This map displays the connectivity of individual neurons which align with the neuron populations from the ApiNATOMY models available in SCKAN.';
3482
+ }
3483
+ return 'This map displays the connectivity of neuron populations from the primarily rat-based ApiNATOMY models available in SCKAN. New connectivity and species specificity will be added as the SPARC program progresses.';
3484
+ },
3560
3485
  ...mapState(useMainStore, ['userToken']),
3561
3486
  isValidDrawnCreated: function () {
3562
3487
  return Object.keys(this.drawnCreatedEvent).length > 0;
@@ -3586,9 +3511,6 @@ export default {
3586
3511
  legendEntry: function () {
3587
3512
  return [...this.flatmapLegends, ...this.externalLegends];
3588
3513
  },
3589
- showDatasetMarkerTooltip: function () {
3590
- return this.hoverVisibilities[9].value;
3591
- },
3592
3514
  },
3593
3515
  watch: {
3594
3516
  entry: function () {
@@ -3600,19 +3522,6 @@ export default {
3600
3522
  },
3601
3523
  immediate: true,
3602
3524
  },
3603
- helpMode: function (newVal, oldVal) {
3604
- if (newVal !== oldVal) {
3605
- this.setHelpMode(newVal);
3606
- }
3607
- },
3608
- helpModeActiveItem: function () {
3609
- // just take the action from helpModeActiveItem
3610
- // work with local value since the indexing is different
3611
- if (this.helpMode) {
3612
- this.helpModeActiveIndex += 1;
3613
- this.setHelpMode(this.helpMode);
3614
- }
3615
- },
3616
3525
  render: function (val) {
3617
3526
  if (val) {
3618
3527
  if (this.mapImp && this.mapImp.contextLost && !this.loading) {
@@ -3716,7 +3625,6 @@ export default {
3716
3625
  mounted: function () {
3717
3626
  this.openMapRef = shallowRef(this.$refs.openMapRef);
3718
3627
  this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef);
3719
- this.tooltipWait.length = this.hoverVisibilities.length;
3720
3628
  this.flatmapQueries = markRaw(new FlatmapQueries());
3721
3629
  this.flatmapQueries.initialise(this.flatmapAPI);
3722
3630
  if (this.state) {
@@ -3873,10 +3781,12 @@ export default {
3873
3781
  width: auto;
3874
3782
  }
3875
3783
 
3784
+ // Lined up with the legend items, the icon is wider than the 20px legend icons
3876
3785
  .flatmap-marker-help {
3877
- display: block;
3786
+ display: flex;
3787
+ align-items: center;
3878
3788
  width: max-content;
3879
- margin: 0.5rem;
3789
+ margin: 8px 8.5px;
3880
3790
 
3881
3791
  :deep(.flatmap-marker svg) {
3882
3792
  display: block;
@@ -3885,6 +3795,12 @@ export default {
3885
3795
  }
3886
3796
  }
3887
3797
 
3798
+ .flatmap-marker-help-label {
3799
+ margin-left: 10px;
3800
+ font-size: 12px;
3801
+ color: rgb(48, 49, 51);
3802
+ }
3803
+
3888
3804
  .el-dropdown-link {
3889
3805
  cursor: pointer;
3890
3806
  color: #409eff;
@@ -4306,12 +4222,6 @@ export default {
4306
4222
  }
4307
4223
  }
4308
4224
 
4309
- :deep(.flatmap-popper.flatmap-marker-popper) {
4310
- white-space: break-spaces;
4311
- word-wrap: break-word;
4312
- word-break: break-word;
4313
- }
4314
-
4315
4225
  :deep(.el-loading-spinner) {
4316
4226
  .path {
4317
4227
  stroke: $app-primary-color;