@abi-software/flatmapvuer 1.20.0 → 1.20.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
+ 'Hover over a feature on the map to see its name, click on it to see more information such as its connectivity.',
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 map.',
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,24 @@ 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"
170
+ trigger="hover"
146
171
  width="70"
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: 'Zoom in to see more detail. You can also scroll or pinch on the map.',
185
+ placement: 'left',
186
+ }"
154
187
  @click="zoomIn()"
155
- @mouseover="showTooltip(1)"
156
- @mouseout="hideTooltip(1)"
157
188
  >
158
189
  <map-svg-icon class="icon-button zoomIn" icon="zoomIn" />
159
190
  </div>
@@ -163,18 +194,24 @@ Please use `const` to assign meaningful names to them...
163
194
  content="Zoom out"
164
195
  placement="top-end"
165
196
  :teleported="false"
166
- trigger="manual"
197
+ trigger="hover"
167
198
  width="70"
168
199
  popper-class="flatmap-popper"
169
- :visible="hoverVisibilities[2].value"
200
+ :show-after="tooltipDelay"
201
+ :hide-after="tooltipDelay"
170
202
  ref="zoomOutPopover"
171
203
  >
172
204
  <template #reference>
173
205
  <div
174
206
  class="icon-button-container"
207
+ v-help-mode="{
208
+ id: 'flatmap-zoom-out',
209
+ area: 'zoom',
210
+ title: 'Zoom out',
211
+ description: 'Zoom out to see more of the map.',
212
+ placement: 'top',
213
+ }"
175
214
  @click="zoomOut()"
176
- @mouseover="showTooltip(2)"
177
- @mouseout="hideTooltip(2)"
178
215
  >
179
216
  <map-svg-icon class="icon-button zoomOut" icon="zoomOut" />
180
217
  </div>
@@ -184,10 +221,11 @@ Please use `const` to assign meaningful names to them...
184
221
  content="Reset"
185
222
  placement="top"
186
223
  :teleported="false"
187
- trigger="manual"
224
+ trigger="hover"
188
225
  width="70"
189
226
  popper-class="flatmap-popper"
190
- :visible="hoverVisibilities[3].value"
227
+ :show-after="tooltipDelay"
228
+ :hide-after="tooltipDelay"
191
229
  ref="zoomFitPopover"
192
230
  >
193
231
  <div>
@@ -198,95 +236,95 @@ Please use `const` to assign meaningful names to them...
198
236
  <template #reference>
199
237
  <div
200
238
  class="icon-button-container"
239
+ v-help-mode="{
240
+ id: 'flatmap-zoom-fit',
241
+ area: 'zoom',
242
+ title: 'Fit to window',
243
+ description: 'Reset the view so the whole map fits in the window.',
244
+ placement: 'top',
245
+ }"
201
246
  @click="resetView()"
202
- @mouseover="showTooltip(3)"
203
- @mouseout="hideTooltip(3)"
204
247
  >
205
248
  <map-svg-icon class="icon-button fitWindow" icon="fitWindow" />
206
249
  </div>
207
250
  </template>
208
251
  </el-popover>
209
252
  </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"
253
+ <div
254
+ class="pathway-location"
255
+ :class="{ open: drawerOpen, close: !drawerOpen }"
256
+ v-show="!disableUI && requiresDrawer"
219
257
  >
220
- <template #reference>
258
+ <div
259
+ class="pathway-container"
260
+ v-help-mode="{
261
+ id: 'flatmap-pathways',
262
+ area: 'legends',
263
+ title: showPathwayFilter ? 'Pathways and legends' : 'Legends',
264
+ description: showPathwayFilter
265
+ ? 'Show or hide pathways, systems and other map layers using the checkboxes in this panel.'
266
+ : 'The legends explain the symbols and colours used on this map.',
267
+ placement: 'right',
268
+ onEnter: openHelpModeDrawer,
269
+ }"
270
+ :class="{ open: drawerOpen, close: !drawerOpen }"
271
+ :style="{ 'max-height': pathwaysMaxHeight + 'px' }"
272
+ >
273
+ <dynamic-legends
274
+ v-if="legendEntry.length"
275
+ identifierKey="prompt"
276
+ colourKey="colour"
277
+ styleKey="style"
278
+ :legends="legendEntry"
279
+ :showStarInLegend="true"
280
+ ref="featuredMarkerPopover"
281
+ class="svg-legends-container"
282
+ />
283
+ <!-- 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
284
  <div
222
- class="pathway-location"
223
- :class="{ open: drawerOpen, close: !drawerOpen }"
224
- v-show="!disableUI && requiresDrawer"
285
+ v-show="helpModeMarkerVisible"
286
+ class="flatmap-marker-help"
287
+ v-help-mode="{
288
+ id: 'flatmap-marker',
289
+ area: 'legends',
290
+ title: 'Dataset markers',
291
+ description:
292
+ 'Find these markers on the map for data. The number inside a marker is the number of datasets available at that location.',
293
+ placement: 'right',
294
+ onEnter: () => setHelpModeMarker(true),
295
+ onLeave: () => setHelpModeMarker(false),
296
+ }"
225
297
  >
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
- <!--
298
+ <div class="flatmap-marker-help-icon" v-html="flatmapMarker"></div>
299
+ <span class="flatmap-marker-help-label">Dataset markers</span>
300
+ </div>
301
+ <tree-controls
302
+ v-if="isFC && systems && systems.length > 0"
303
+ class="treeControls"
304
+ mapType="flatmap"
305
+ title="Systems"
306
+ :treeData="systems"
307
+ :active="currentActive"
308
+ :hover="currentHover"
309
+ @checkChanged="systemSelected"
310
+ @checkAll="checkAllSystems"
311
+ @changeActive="ftuSelected"
312
+ ref="treeControls"
313
+ />
314
+ <selections-group
315
+ v-if="containsAlert && alertOptions && showPathwayFilter"
316
+ title="Notes"
317
+ labelKey="label"
318
+ identifierKey="key"
319
+ :selections="alertOptions"
320
+ @changed="alertSelected"
321
+ @checkboxMouseEnter="alertMouseEnterEmitted"
322
+ @selections-data-changed="onSelectionsDataChanged"
323
+ @checkAll="checkAllAlerts"
324
+ ref="alertSelection"
325
+ key="alertSelection"
326
+ />
327
+ <!--
290
328
  <selections-group
291
329
  v-if="isFC && sckanDisplay && sckanDisplay.length > 0"
292
330
  title="SCKAN"
@@ -312,45 +350,43 @@ Please use `const` to assign meaningful names to them...
312
350
  key="layersSelection"
313
351
  />
314
352
  -->
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>
353
+ <selections-group
354
+ v-if="pathways && pathways.length > 0"
355
+ title="Pathways"
356
+ labelKey="label"
357
+ identifierKey="type"
358
+ colourStyle="line"
359
+ :selections="pathways"
360
+ :showAsLegend="!showPathwayFilter"
361
+ @changed="pathwaysSelected"
362
+ @selections-data-changed="onSelectionsDataChanged"
363
+ @checkAll="checkAllPathways"
364
+ ref="pathwaysSelection"
365
+ key="pathwaysSelection"
366
+ />
367
+ <selections-group
368
+ v-if="taxonConnectivity && taxonConnectivity.length > 0 && showPathwayFilter"
369
+ title="Studied in"
370
+ labelKey="label"
371
+ identifierKey="taxon"
372
+ helpMessage="Evidence exists that this set of neuron populations have been studied in the given species."
373
+ :selections="taxonConnectivity"
374
+ @changed="taxonsSelected"
375
+ @checkboxMouseEnter="taxonMouseEnterEmitted"
376
+ @selections-data-changed="onSelectionsDataChanged"
377
+ @checkAll="checkAllTaxons"
378
+ ref="taxonSelection"
379
+ key="taxonSelection"
380
+ />
381
+ </div>
382
+ <div
383
+ @click="toggleDrawer"
384
+ class="drawer-button"
385
+ :class="{ open: drawerOpen, close: !drawerOpen }"
386
+ >
387
+ <el-icon><el-icon-arrow-left /></el-icon>
388
+ </div>
389
+ </div>
354
390
  <el-popover
355
391
  v-if="openMapRef"
356
392
  ref="open-map-popover"
@@ -477,7 +513,9 @@ Please use `const` to assign meaningful names to them...
477
513
  >
478
514
  <el-row v-if="showOpenMapButton">
479
515
  <el-popover
480
- :visible="hoverVisibilities[4].value"
516
+ trigger="hover"
517
+ :show-after="tooltipDelay"
518
+ :hide-after="tooltipDelay"
481
519
  content="Open new map"
482
520
  placement="right"
483
521
  :teleported="false"
@@ -488,9 +526,15 @@ Please use `const` to assign meaningful names to them...
488
526
  <div
489
527
  v-if="enableOpenMapUI && openMapOptions.length > 0"
490
528
  ref="openMapRef"
529
+ v-help-mode="{
530
+ id: 'flatmap-open-map',
531
+ area: 'map-settings',
532
+ title: 'Open new map',
533
+ description:
534
+ 'Open another map, such as a different species or a connectivity map.',
535
+ placement: 'right',
536
+ }"
491
537
  class="icon-button-container"
492
- @mouseover="showTooltip(4)"
493
- @mouseout="hideTooltip(4)"
494
538
  >
495
539
  <map-svg-icon icon="openMap" class="icon-button open-map-button" />
496
540
  </div>
@@ -501,18 +545,25 @@ Please use `const` to assign meaningful names to them...
501
545
  <el-popover
502
546
  content="Change settings"
503
547
  placement="right"
504
- :visible="hoverVisibilities[5].value"
548
+ :show-after="tooltipDelay"
549
+ :hide-after="tooltipDelay"
505
550
  :teleported="false"
506
- trigger="manual"
551
+ trigger="hover"
507
552
  popper-class="flatmap-popper"
508
553
  ref="settingsPopover"
509
554
  >
510
555
  <template #reference>
511
556
  <div
512
557
  ref="backgroundIconRef"
558
+ v-help-mode="{
559
+ id: 'flatmap-settings',
560
+ area: 'map-settings',
561
+ title: 'Settings',
562
+ description:
563
+ 'Change the map settings, such as the background colour and the viewing mode.',
564
+ placement: 'right',
565
+ }"
513
566
  class="icon-button-container"
514
- @mouseover="showTooltip(5)"
515
- @mouseout="hideTooltip(5)"
516
567
  >
517
568
  <map-svg-icon icon="changeBckgd" class="icon-button" />
518
569
  </div>
@@ -557,6 +608,7 @@ import { capitalise, normaliseAlertToStringArray } from './utilities.js';
557
608
  import yellowstar from '../icons/yellowstar';
558
609
  import ResizeSensor from 'css-element-queries/src/ResizeSensor';
559
610
  import flatmap from '../services/flatmapLoader.js';
611
+ import { attachSomaLocationMarkerMethods } from '../services/somaLocationMarkers.js';
560
612
  import { AnnotationService } from '@abi-software/sparc-annotation';
561
613
  import { mapState } from 'pinia';
562
614
  import { useMainStore } from '@/store/index';
@@ -566,6 +618,8 @@ import {
566
618
  Tooltip,
567
619
  TreeControls,
568
620
  getFlatmapFilterOptions,
621
+ collectHelpModeSteps,
622
+ helpModeDirective,
569
623
  } from '@abi-software/map-utilities';
570
624
  import '@abi-software/map-utilities/dist/style.css';
571
625
  import EventBus from './EventBus.js';
@@ -639,6 +693,9 @@ export default {
639
693
  DrawToolbar,
640
694
  FlatmapError,
641
695
  },
696
+ directives: {
697
+ helpMode: helpModeDirective,
698
+ },
642
699
  beforeCreate: function () {
643
700
  //The state watcher may triggered before
644
701
  //created causing issue, This flag will
@@ -2326,133 +2383,27 @@ export default {
2326
2383
  },
2327
2384
  /**
2328
2385
  * @public
2329
- * Function to set help mode
2330
- * by providing flag ``helpMode`` (true/false).
2331
- * @arg {Boolean} `helpMode`
2386
+ * Function to get the help mode steps of this flatmap, from the elements with ``v-help-mode``,
2387
+ * to be used with ``HelpModeTour`` and ``HelpModeHover`` from ``@abi-software/map-utilities``.
2388
+ * @returns {Array} The list of help steps.
2332
2389
  */
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
- }
2390
+ getHelpModeSteps: function () {
2391
+ return collectHelpModeSteps(this.$el);
2420
2392
  },
2421
2393
  /**
2422
- * @public
2423
- * Function to show tooltip
2424
- * by providing ``tooltipNumber``.
2425
- * @arg {Number} `tooltipNumber`
2426
- * @arg {Number} `timeout` _(default: `500`)_
2394
+ * Open the pathway drawer to show the help of the items inside it.
2427
2395
  */
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
- }
2396
+ openHelpModeDrawer: function () {
2397
+ if (this.requiresDrawer) this.drawerOpen = true;
2439
2398
  },
2440
-
2441
2399
  /**
2442
- * @public
2443
- * Function to hide tooltip
2444
- * by providing ``tooltipNumber``.
2445
- * @arg {Number} `tooltipNumber`
2446
- * @arg {Number} `timeout` _(default: `500`)_
2400
+ * Show the dataset marker in the drawer, which is otherwise only shown on hover.
2447
2401
  */
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);
2454
- }
2402
+ setHelpModeMarker: function (visible) {
2403
+ if (visible) this.openHelpModeDrawer();
2404
+ this.helpModeMarkerVisible = visible;
2455
2405
  },
2406
+
2456
2407
  /**
2457
2408
  * @public
2458
2409
  * Function to display tooltip
@@ -2560,10 +2511,6 @@ export default {
2560
2511
  anchor: 'top',
2561
2512
  className: 'flatmap-popup-popper',
2562
2513
  });
2563
- /**
2564
- * This event is emitted after a tooltip on Flatmap's map is shown.
2565
- */
2566
- this.$emit('shown-map-tooltip');
2567
2514
  }
2568
2515
  }
2569
2516
  },
@@ -2786,7 +2733,7 @@ export default {
2786
2733
  });
2787
2734
  promise1
2788
2735
  .then((returnedObject) => {
2789
- this.mapImp = returnedObject;
2736
+ this.mapImp = attachSomaLocationMarkerMethods(returnedObject);
2790
2737
  this.serverURL = this.mapImp.makeServerUrl('').slice(0, -1);
2791
2738
  let mapVersion = this.mapImp.details.version;
2792
2739
  this.setFlightPathInfo(mapVersion);
@@ -3216,44 +3163,6 @@ export default {
3216
3163
  type: Boolean,
3217
3164
  default: true,
3218
3165
  },
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
3166
  /**
3258
3167
  * This flag dictate whether a context will be allocatged
3259
3168
  * for this instance
@@ -3435,6 +3344,8 @@ export default {
3435
3344
  flatmapAPI: this.flatmapAPI,
3436
3345
  sparcAPI: this.sparcAPI,
3437
3346
  userApiKey: this.userToken,
3347
+ // For the help of the items in the pathway drawer, e.g. in the legends
3348
+ openHelpModeDrawer: this.openHelpModeDrawer,
3438
3349
  };
3439
3350
  },
3440
3351
  data: function () {
@@ -3462,29 +3373,11 @@ export default {
3462
3373
  systems: [],
3463
3374
  taxonConnectivity: [],
3464
3375
  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,
3376
+ // Delay before showing and hiding the control tooltips
3377
+ tooltipDelay: 500,
3378
+ helpModeMarkerVisible: false,
3485
3379
  yellowstar: yellowstar,
3486
3380
  isFC: false,
3487
- inHelp: false,
3488
3381
  currentBackground: 'white',
3489
3382
  availableBackground: ['white', 'lightskyblue', 'black'],
3490
3383
  loading: false,
@@ -3557,6 +3450,15 @@ export default {
3557
3450
  };
3558
3451
  },
3559
3452
  computed: {
3453
+ warningHelpDescription: function () {
3454
+ if (this.isLegacy) {
3455
+ return 'This is a legacy map. Click the link below the icon to view the latest map instead.';
3456
+ }
3457
+ if (this.isFC) {
3458
+ return 'This map displays the connectivity of individual neurons which align with the neuron populations from the ApiNATOMY models available in SCKAN.';
3459
+ }
3460
+ 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.';
3461
+ },
3560
3462
  ...mapState(useMainStore, ['userToken']),
3561
3463
  isValidDrawnCreated: function () {
3562
3464
  return Object.keys(this.drawnCreatedEvent).length > 0;
@@ -3586,9 +3488,6 @@ export default {
3586
3488
  legendEntry: function () {
3587
3489
  return [...this.flatmapLegends, ...this.externalLegends];
3588
3490
  },
3589
- showDatasetMarkerTooltip: function () {
3590
- return this.hoverVisibilities[9].value;
3591
- },
3592
3491
  },
3593
3492
  watch: {
3594
3493
  entry: function () {
@@ -3600,19 +3499,6 @@ export default {
3600
3499
  },
3601
3500
  immediate: true,
3602
3501
  },
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
3502
  render: function (val) {
3617
3503
  if (val) {
3618
3504
  if (this.mapImp && this.mapImp.contextLost && !this.loading) {
@@ -3716,7 +3602,6 @@ export default {
3716
3602
  mounted: function () {
3717
3603
  this.openMapRef = shallowRef(this.$refs.openMapRef);
3718
3604
  this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef);
3719
- this.tooltipWait.length = this.hoverVisibilities.length;
3720
3605
  this.flatmapQueries = markRaw(new FlatmapQueries());
3721
3606
  this.flatmapQueries.initialise(this.flatmapAPI);
3722
3607
  if (this.state) {
@@ -3873,10 +3758,12 @@ export default {
3873
3758
  width: auto;
3874
3759
  }
3875
3760
 
3761
+ // Lined up with the legend items, the icon is wider than the 20px legend icons
3876
3762
  .flatmap-marker-help {
3877
- display: block;
3763
+ display: flex;
3764
+ align-items: center;
3878
3765
  width: max-content;
3879
- margin: 0.5rem;
3766
+ margin: 8px 8.5px;
3880
3767
 
3881
3768
  :deep(.flatmap-marker svg) {
3882
3769
  display: block;
@@ -3885,6 +3772,12 @@ export default {
3885
3772
  }
3886
3773
  }
3887
3774
 
3775
+ .flatmap-marker-help-label {
3776
+ margin-left: 10px;
3777
+ font-size: 12px;
3778
+ color: rgb(48, 49, 51);
3779
+ }
3780
+
3888
3781
  .el-dropdown-link {
3889
3782
  cursor: pointer;
3890
3783
  color: #409eff;
@@ -4306,12 +4199,6 @@ export default {
4306
4199
  }
4307
4200
  }
4308
4201
 
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
4202
  :deep(.el-loading-spinner) {
4316
4203
  .path {
4317
4204
  stroke: $app-primary-color;