@abi-software/flatmapvuer 1.20.1-demo.0 → 1.20.1-demo.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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>
@@ -567,6 +618,8 @@ import {
567
618
  Tooltip,
568
619
  TreeControls,
569
620
  getFlatmapFilterOptions,
621
+ collectHelpModeSteps,
622
+ helpModeDirective,
570
623
  } from '@abi-software/map-utilities';
571
624
  import '@abi-software/map-utilities/dist/style.css';
572
625
  import EventBus from './EventBus.js';
@@ -640,6 +693,9 @@ export default {
640
693
  DrawToolbar,
641
694
  FlatmapError,
642
695
  },
696
+ directives: {
697
+ helpMode: helpModeDirective,
698
+ },
643
699
  beforeCreate: function () {
644
700
  //The state watcher may triggered before
645
701
  //created causing issue, This flag will
@@ -2327,133 +2383,27 @@ export default {
2327
2383
  },
2328
2384
  /**
2329
2385
  * @public
2330
- * Function to set help mode
2331
- * by providing flag ``helpMode`` (true/false).
2332
- * @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.
2333
2389
  */
2334
- setHelpMode: function (helpMode) {
2335
- const toolTipsLength = this.hoverVisibilities.length;
2336
- const lastIndex = toolTipsLength - 1;
2337
- const activePopoverObj = this.hoverVisibilities[this.helpModeActiveIndex];
2338
-
2339
- if (activePopoverObj) {
2340
- const popoverRefsId = activePopoverObj?.refs;
2341
- const popoverRefId = activePopoverObj?.ref;
2342
- const popoverRef = this.$refs[popoverRefsId ? popoverRefsId : popoverRefId];
2343
-
2344
- if (popoverRef) {
2345
- // Open pathway drawer if the tooltip is inside or beside
2346
- const { parentElement, nextElementSibling } = popoverRef.$el;
2347
- const isPathwayContainer = (element) => {
2348
- return (
2349
- element &&
2350
- (element.classList.contains('pathway-container') ||
2351
- element.classList.contains('pathway-location'))
2352
- );
2353
- };
2354
-
2355
- if (isPathwayContainer(parentElement) || isPathwayContainer(nextElementSibling)) {
2356
- if (this.requiresDrawer) {
2357
- this.drawerOpen = true;
2358
- } else {
2359
- this.helpModeActiveIndex += 1;
2360
- }
2361
- }
2362
- } else {
2363
- // skip the unavailable tooltips
2364
- this.helpModeActiveIndex += 1;
2365
- this.setHelpMode(helpMode);
2366
- }
2367
- }
2368
-
2369
- // Skip checkbox tooltip if pathway filter is not shown
2370
- const activePopoverObjAfter = this.hoverVisibilities[this.helpModeActiveIndex];
2371
- if (activePopoverObjAfter?.ref === 'checkBoxPopover' && !this.showPathwayFilter) {
2372
- this.helpModeActiveIndex += 1;
2373
- this.setHelpMode(helpMode);
2374
- }
2375
-
2376
- if (!helpMode) {
2377
- // reset to iniital state
2378
- this.helpModeActiveIndex = this.helpModeInitialIndex;
2379
- }
2380
-
2381
- if (this.viewingMode !== 'Annotation' && this.helpModeActiveIndex > 9) {
2382
- this.helpModeActiveIndex = lastIndex;
2383
- }
2384
-
2385
- if (helpMode && this.helpModeActiveIndex >= lastIndex) {
2386
- /**
2387
- * This event is emitted when the tooltips in help mode reach the last item.
2388
- */
2389
- this.$emit('help-mode-last-item', true);
2390
- }
2391
-
2392
- if (helpMode && !this.helpModeDialog) {
2393
- this.inHelp = true;
2394
- this.hoverVisibilities.forEach((item) => {
2395
- item.value = true;
2396
- });
2397
- } else if (helpMode && this.helpModeDialog && toolTipsLength > this.helpModeActiveIndex) {
2398
- // Show the map tooltip as first item
2399
- if (this.helpModeActiveIndex > -1) {
2400
- this.closeFlatmapHelpPopup();
2401
-
2402
- // wait for CSS transition
2403
- setTimeout(() => {
2404
- this.inHelp = false;
2405
- this.hoverVisibilities.forEach((item) => {
2406
- item.value = false;
2407
- });
2408
-
2409
- this.showTooltip(this.helpModeActiveIndex, 200);
2410
- }, 300);
2411
- } else if (this.helpModeActiveIndex === -1) {
2412
- this.openFlatmapHelpPopup();
2413
- }
2414
- } else {
2415
- this.inHelp = false;
2416
- this.hoverVisibilities.forEach((item) => {
2417
- item.value = false;
2418
- });
2419
- this.closeFlatmapHelpPopup();
2420
- }
2390
+ getHelpModeSteps: function () {
2391
+ return collectHelpModeSteps(this.$el);
2421
2392
  },
2422
2393
  /**
2423
- * @public
2424
- * Function to show tooltip
2425
- * by providing ``tooltipNumber``.
2426
- * @arg {Number} `tooltipNumber`
2427
- * @arg {Number} `timeout` _(default: `500`)_
2394
+ * Open the pathway drawer to show the help of the items inside it.
2428
2395
  */
2429
- showTooltip: function (tooltipNumber, timeout = 500) {
2430
- if (!this.inHelp) {
2431
- clearTimeout(this.tooltipWait[tooltipNumber]);
2432
- this.tooltipWait[tooltipNumber] = setTimeout(() => {
2433
- this.hoverVisibilities[tooltipNumber].value = true;
2434
- /**
2435
- * This event is emitted after a tooltip in Flatmap is shown.
2436
- */
2437
- this.$emit('shown-tooltip');
2438
- }, timeout);
2439
- }
2396
+ openHelpModeDrawer: function () {
2397
+ if (this.requiresDrawer) this.drawerOpen = true;
2440
2398
  },
2441
-
2442
2399
  /**
2443
- * @public
2444
- * Function to hide tooltip
2445
- * by providing ``tooltipNumber``.
2446
- * @arg {Number} `tooltipNumber`
2447
- * @arg {Number} `timeout` _(default: `500`)_
2400
+ * Show the dataset marker in the drawer, which is otherwise only shown on hover.
2448
2401
  */
2449
- hideTooltip: function (tooltipNumber, timeout = 500) {
2450
- if (!this.inHelp) {
2451
- clearTimeout(this.tooltipWait[tooltipNumber]);
2452
- this.tooltipWait[tooltipNumber] = setTimeout(() => {
2453
- this.hoverVisibilities[tooltipNumber].value = false;
2454
- }, timeout);
2455
- }
2402
+ setHelpModeMarker: function (visible) {
2403
+ if (visible) this.openHelpModeDrawer();
2404
+ this.helpModeMarkerVisible = visible;
2456
2405
  },
2406
+
2457
2407
  /**
2458
2408
  * @public
2459
2409
  * Function to display tooltip
@@ -2561,10 +2511,6 @@ export default {
2561
2511
  anchor: 'top',
2562
2512
  className: 'flatmap-popup-popper',
2563
2513
  });
2564
- /**
2565
- * This event is emitted after a tooltip on Flatmap's map is shown.
2566
- */
2567
- this.$emit('shown-map-tooltip');
2568
2514
  }
2569
2515
  }
2570
2516
  },
@@ -3217,44 +3163,6 @@ export default {
3217
3163
  type: Boolean,
3218
3164
  default: true,
3219
3165
  },
3220
- /**
3221
- * The option to show tooltips for help mode.
3222
- */
3223
- helpMode: {
3224
- type: Boolean,
3225
- default: false,
3226
- },
3227
- /**
3228
- * The active item index of help mode.
3229
- */
3230
- helpModeActiveItem: {
3231
- type: Number,
3232
- default: 0,
3233
- },
3234
- /**
3235
- * The option to use helpModeDialog.
3236
- * On default, `false`, clicking help will show all tooltips.
3237
- * If `true`, clicking help will show the help-mode-dialog.
3238
- */
3239
- helpModeDialog: {
3240
- type: Boolean,
3241
- default: false,
3242
- },
3243
- /**
3244
- * The last item of help mode.
3245
- */
3246
- helpModeLastItem: {
3247
- type: Boolean,
3248
- default: false,
3249
- },
3250
- /**
3251
- * The initial index number for help mode tooltips.
3252
- * Set negative (e.g. -2) if there are other tooltips outside of `hoverVisibilities`.
3253
- */
3254
- helpModeInitialIndex: {
3255
- type: Number,
3256
- default: 0,
3257
- },
3258
3166
  /**
3259
3167
  * This flag dictate whether a context will be allocatged
3260
3168
  * for this instance
@@ -3436,6 +3344,8 @@ export default {
3436
3344
  flatmapAPI: this.flatmapAPI,
3437
3345
  sparcAPI: this.sparcAPI,
3438
3346
  userApiKey: this.userToken,
3347
+ // For the help of the items in the pathway drawer, e.g. in the legends
3348
+ openHelpModeDrawer: this.openHelpModeDrawer,
3439
3349
  };
3440
3350
  },
3441
3351
  data: function () {
@@ -3463,29 +3373,11 @@ export default {
3463
3373
  systems: [],
3464
3374
  taxonConnectivity: [],
3465
3375
  pathwaysMaxHeight: 1000,
3466
- tooltipWait: markRaw([]),
3467
- hoverVisibilities: [
3468
- { value: false, ref: 'markerPopover' }, // 0
3469
- { value: false, ref: 'zoomInPopover' }, // 1
3470
- { value: false, ref: 'zoomOutPopover' }, // 2
3471
- { value: false, ref: 'zoomFitPopover' }, // 3
3472
- { value: false, ref: 'openMapPopover' }, // 4
3473
- { value: false, ref: 'settingsPopover' }, // 5
3474
- { value: false, ref: 'checkBoxPopover' }, // 6
3475
- { value: false, ref: 'warningPopover' }, // 7
3476
- { value: false, ref: 'whatsNewPopover' }, // 8
3477
- { value: false, ref: 'featuredMarkerPopover' }, // 9
3478
- { value: false, refs: 'toolbarPopover', ref: 'editPopover' }, // 10
3479
- { value: false, refs: 'toolbarPopover', ref: 'deletePopover' }, // 11
3480
- { value: false, refs: 'toolbarPopover', ref: 'pointPopover' }, // 12
3481
- { value: false, refs: 'toolbarPopover', ref: 'lineStringPopover' }, // 13
3482
- { value: false, refs: 'toolbarPopover', ref: 'polygonPopover' }, // 14
3483
- { value: false, refs: 'toolbarPopover', ref: 'connectionPopover' }, // 15
3484
- ],
3485
- helpModeActiveIndex: this.helpModeInitialIndex,
3376
+ // Delay before showing and hiding the control tooltips
3377
+ tooltipDelay: 500,
3378
+ helpModeMarkerVisible: false,
3486
3379
  yellowstar: yellowstar,
3487
3380
  isFC: false,
3488
- inHelp: false,
3489
3381
  currentBackground: 'white',
3490
3382
  availableBackground: ['white', 'lightskyblue', 'black'],
3491
3383
  loading: false,
@@ -3558,6 +3450,15 @@ export default {
3558
3450
  };
3559
3451
  },
3560
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
+ },
3561
3462
  ...mapState(useMainStore, ['userToken']),
3562
3463
  isValidDrawnCreated: function () {
3563
3464
  return Object.keys(this.drawnCreatedEvent).length > 0;
@@ -3587,9 +3488,6 @@ export default {
3587
3488
  legendEntry: function () {
3588
3489
  return [...this.flatmapLegends, ...this.externalLegends];
3589
3490
  },
3590
- showDatasetMarkerTooltip: function () {
3591
- return this.hoverVisibilities[9].value;
3592
- },
3593
3491
  },
3594
3492
  watch: {
3595
3493
  entry: function () {
@@ -3601,19 +3499,6 @@ export default {
3601
3499
  },
3602
3500
  immediate: true,
3603
3501
  },
3604
- helpMode: function (newVal, oldVal) {
3605
- if (newVal !== oldVal) {
3606
- this.setHelpMode(newVal);
3607
- }
3608
- },
3609
- helpModeActiveItem: function () {
3610
- // just take the action from helpModeActiveItem
3611
- // work with local value since the indexing is different
3612
- if (this.helpMode) {
3613
- this.helpModeActiveIndex += 1;
3614
- this.setHelpMode(this.helpMode);
3615
- }
3616
- },
3617
3502
  render: function (val) {
3618
3503
  if (val) {
3619
3504
  if (this.mapImp && this.mapImp.contextLost && !this.loading) {
@@ -3717,7 +3602,6 @@ export default {
3717
3602
  mounted: function () {
3718
3603
  this.openMapRef = shallowRef(this.$refs.openMapRef);
3719
3604
  this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef);
3720
- this.tooltipWait.length = this.hoverVisibilities.length;
3721
3605
  this.flatmapQueries = markRaw(new FlatmapQueries());
3722
3606
  this.flatmapQueries.initialise(this.flatmapAPI);
3723
3607
  if (this.state) {
@@ -3874,10 +3758,12 @@ export default {
3874
3758
  width: auto;
3875
3759
  }
3876
3760
 
3761
+ // Lined up with the legend items, the icon is wider than the 20px legend icons
3877
3762
  .flatmap-marker-help {
3878
- display: block;
3763
+ display: flex;
3764
+ align-items: center;
3879
3765
  width: max-content;
3880
- margin: 0.5rem;
3766
+ margin: 8px 8.5px;
3881
3767
 
3882
3768
  :deep(.flatmap-marker svg) {
3883
3769
  display: block;
@@ -3886,6 +3772,12 @@ export default {
3886
3772
  }
3887
3773
  }
3888
3774
 
3775
+ .flatmap-marker-help-label {
3776
+ margin-left: 10px;
3777
+ font-size: 12px;
3778
+ color: rgb(48, 49, 51);
3779
+ }
3780
+
3889
3781
  .el-dropdown-link {
3890
3782
  cursor: pointer;
3891
3783
  color: #409eff;
@@ -4307,12 +4199,6 @@ export default {
4307
4199
  }
4308
4200
  }
4309
4201
 
4310
- :deep(.flatmap-popper.flatmap-marker-popper) {
4311
- white-space: break-spaces;
4312
- word-wrap: break-word;
4313
- word-break: break-word;
4314
- }
4315
-
4316
4202
  :deep(.el-loading-spinner) {
4317
4203
  .path {
4318
4204
  stroke: $app-primary-color;