@abi-software/mapintegratedvuer 1.21.2 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/eslint.config.js CHANGED
@@ -12,7 +12,7 @@ const gitignorePath = fileURLToPath(new URL('.gitignore', import.meta.url));
12
12
  export default [
13
13
  includeIgnoreFile(gitignorePath, { gitignoreResolution: true }),
14
14
  {
15
- ignores: ['dist/**', 'docs/.vitepress/**', 'docs/components/**', 'test/**'],
15
+ ignores: ['dist/**', 'docs/.vitepress/**', 'docs/components/**', 'test/**', 'CHANGELOG.md'],
16
16
  },
17
17
  js.configs.recommended,
18
18
  ...vue.configs['flat/essential'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/mapintegratedvuer",
3
- "version": "1.21.2",
3
+ "version": "1.22.0",
4
4
  "license": "Apache-2.0",
5
5
  "engines": {
6
6
  "node": "^24.20.0"
@@ -58,11 +58,11 @@
58
58
  "*.js"
59
59
  ],
60
60
  "dependencies": {
61
- "@abi-software/flatmapvuer": "1.17.0",
61
+ "@abi-software/flatmapvuer": "1.19.0",
62
62
  "@abi-software/map-side-bar": "2.19.0",
63
63
  "@abi-software/map-utilities": "1.12.0",
64
64
  "@abi-software/plotvuer": "1.3.0",
65
- "@abi-software/scaffoldvuer": "1.21.0",
65
+ "@abi-software/scaffoldvuer": "2.0.0",
66
66
  "@abi-software/simulationvuer": "4.3.0",
67
67
  "@abi-software/sparc-annotation": "0.3.2",
68
68
  "@abi-software/svg-sprite": "1.4.0",
package/src/App.vue CHANGED
@@ -30,29 +30,12 @@
30
30
  <el-button @click="setFlatmap()" size="small">Set Flatmap</el-button>
31
31
  <el-button @click="setSearch()" size="small">Set Search</el-button>
32
32
  </div>
33
- <div class="row">
34
- <div style="font-weight: 600">Connectivity tooltip labels:</div>
35
- </div>
36
- <div class="row">
37
- <el-checkbox @change="onShowLongLabelChange" v-model="showLongLabel" size="small">
38
- Show long label
39
- </el-checkbox>
40
- <el-checkbox
41
- @change="onTruncateLongLabelChange"
42
- :disabled="!showLongLabel"
43
- v-model="truncateLongLabel"
44
- size="small"
45
- >
46
- Truncate long label
47
- </el-checkbox>
48
- <el-checkbox
49
- @change="onShowIdInTooltipChange"
50
- :disabled="!showLongLabel"
51
- v-model="showIdInTooltip"
52
- size="small"
53
- >
54
- Show ID in tooltip
55
- </el-checkbox>
33
+ <div class="row radio-row">
34
+ <span class="radio-label">Open new species in:</span>
35
+ <el-radio-group v-model="openNewSpeciesInSplitView" size="small">
36
+ <el-radio :value="false">Current view</el-radio>
37
+ <el-radio :value="true">Split view</el-radio>
38
+ </el-radio-group>
56
39
  </div>
57
40
  </div>
58
41
  <template #reference>
@@ -76,6 +59,7 @@
76
59
  :allClosable="false"
77
60
  :showGlobalSettings="true"
78
61
  :showOpenMapButton="true"
62
+ :openNewSpeciesInSplitView="openNewSpeciesInSplitView"
79
63
  @updateShareLinkRequested="updateUUID"
80
64
  @isReady="viewerIsReady"
81
65
  @mapLoaded="mapIsLoaded"
@@ -183,6 +167,7 @@ export default {
183
167
  showLongLabel: true,
184
168
  truncateLongLabel: true,
185
169
  showIdInTooltip: true,
170
+ openNewSpeciesInSplitView: true,
186
171
  };
187
172
  },
188
173
  computed: {
@@ -334,15 +319,6 @@ export default {
334
319
  this.$refs.map.openSearch([], '10.26275/1uno-tynt');
335
320
  this.closePopover();
336
321
  },
337
- onShowLongLabelChange: function () {
338
- this.closePopover();
339
- },
340
- onTruncateLongLabelChange: function () {
341
- this.closePopover();
342
- },
343
- onShowIdInTooltipChange: function () {
344
- this.closePopover();
345
- },
346
322
  mapIsLoaded: function (map) {
347
323
  console.log('map is loaded', map);
348
324
  // map.changeViewingMode('Annotation')
@@ -573,6 +549,14 @@ body {
573
549
  text-align: center;
574
550
  }
575
551
 
552
+ .radio-row {
553
+ align-items: center;
554
+ }
555
+
556
+ .radio-label {
557
+ font-size: 12px;
558
+ }
559
+
576
560
  .map-icon {
577
561
  color: $app-primary-color !important;
578
562
  }
@@ -434,6 +434,7 @@ export default {
434
434
  border-color: $app-primary-color;
435
435
  color: #fff;
436
436
  font-size: 11px !important;
437
+
437
438
  &:hover {
438
439
  color: #fff !important;
439
440
  background-color: #ac76c5 !important;
@@ -132,6 +132,16 @@ export default {
132
132
  type: Boolean,
133
133
  default: true,
134
134
  },
135
+ /**
136
+ * The option to open a species from the species dropdown's "open new view"
137
+ * in a split view. From a single view, it opens as a vertical split on the right.
138
+ * From a split view, it replaces the other pane's view.
139
+ * Default is `true`.
140
+ */
141
+ openNewSpeciesInSplitView: {
142
+ type: Boolean,
143
+ default: true,
144
+ },
135
145
  },
136
146
  provide: function () {
137
147
  return {
@@ -308,7 +318,11 @@ export default {
308
318
  discoverId: state.dataset_id,
309
319
  version: state.dataset_version,
310
320
  };
311
- this.$refs.flow.createNewEntry(newView);
321
+ // sourceId is only provided by "open new view" from the species dropdown
322
+ this.$refs.flow.createNewEntry(newView, {
323
+ openInSplitView: this.openNewSpeciesInSplitView && state.sourceId !== undefined,
324
+ sourceId: state.sourceId,
325
+ });
312
326
  } else {
313
327
  //State for multiflatmap containing the following items:
314
328
  // taxo - taxo of species to set
@@ -466,6 +480,12 @@ export default {
466
480
  */
467
481
  this.$emit('mapLoaded', map);
468
482
  });
483
+ // Allow other components to request opening a map via setCurrentEntry
484
+ EventBus.on('SetCurrentEntry', (entry) => {
485
+ if (entry) {
486
+ this.setCurrentEntry(entry);
487
+ }
488
+ });
469
489
  this.isReady = true;
470
490
  this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog);
471
491
  this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar);
@@ -835,8 +835,10 @@ export default {
835
835
  /**
836
836
  * Add new entry which will sequentially create a
837
837
  * new dialog.
838
+ * Set `options.openInSplitView` with `options.sourceId` to open the
839
+ * new entry next to the source entry instead of the primary pane.
838
840
  */
839
- createNewEntry: function (data) {
841
+ createNewEntry: function (data, options = {}) {
840
842
  let newEntry = {};
841
843
  newEntry.viewUrl = undefined;
842
844
  newEntry.state = undefined;
@@ -845,7 +847,15 @@ export default {
845
847
  newEntry.id = this.getNewEntryId();
846
848
  newEntry.discoverId = data.discoverId;
847
849
  this.entriesStore.addNewEntry(newEntry);
848
- this.splitFlowStore.setIdToPrimaryPane(newEntry.id);
850
+ if (options.openInSplitView) {
851
+ this.splitFlowStore.placeEntryInSplitView({
852
+ id: newEntry.id,
853
+ sourceId: options.sourceId,
854
+ entries: this.entries,
855
+ });
856
+ } else {
857
+ this.splitFlowStore.setIdToPrimaryPane(newEntry.id);
858
+ }
849
859
  //close sidebar on entry creation to see the context card
850
860
  if (this.$refs.sideBar) {
851
861
  this.$refs.sideBar.setDrawerOpen(false);
@@ -37,6 +37,7 @@
37
37
  :showOpenMapButton="showOpenMapButton"
38
38
  @pan-zoom-callback="flatmapPanZoomCallback"
39
39
  @open-map="openMap"
40
+ @open-map-species="openMapSpecies"
40
41
  @finish-help-mode="endHelp"
41
42
  @pathway-selection-changed="onPathwaySelectionChanged"
42
43
  @open-pubmed-url="onOpenPubmedUrl"
@@ -135,6 +136,19 @@ export default {
135
136
  //First search and show the result
136
137
  return flatmap.searchAndShowResult(term, true, true);
137
138
  },
139
+ // Open the given species as a new view.
140
+ openMapSpecies: function (species) {
141
+ EventBus.emit('SetCurrentEntry', {
142
+ resource: species,
143
+ type: 'MultiFlatmap',
144
+ mode: 'main',
145
+ state: undefined,
146
+ label: '',
147
+ discoverId: undefined,
148
+ sourceId: this.entry.id,
149
+ });
150
+ this.trackOpenMap(`open_new_AC_map_${species}`);
151
+ },
138
152
  /**
139
153
  * Append the list of suggested terms to suggestions
140
154
  */
@@ -349,6 +349,37 @@ export const useSplitFlowStore = defineStore('splitFlow', {
349
349
  this.customLayout[currentKey].id = firstPaneId;
350
350
  }
351
351
  },
352
+ /**
353
+ * Place a newly created entry alongside the source entry.
354
+ * Single view: switch to vertical split with the new entry on the right.
355
+ * Multiple views: replace the other pane (pane-2 if the source is in
356
+ * pane-1, otherwise pane-1). The replaced entry remains in the entries list.
357
+ * Falls back to the primary pane if the source is not currently visible.
358
+ */
359
+ placeEntryInSplitView(payload) {
360
+ const { id, sourceId, entries } = payload;
361
+ if (this.activeView === 'singlepanel') {
362
+ const sourceKey = findKeyWithId(this.customLayout, sourceId);
363
+ if (sourceKey !== 'pane-1') {
364
+ this.setIdToPrimaryPane(id);
365
+ return;
366
+ }
367
+ this.updateActiveView({ view: '2vertpanel', entries }, false);
368
+ this.assignOrSwapPaneWithIds({ source: id, target: this.customLayout['pane-2'].id }, false);
369
+ } else {
370
+ const sourceKey = findKeyWithId(this.customLayout, sourceId);
371
+ if (!sourceKey || !this.isPaneActive(sourceKey)) {
372
+ this.setIdToPrimaryPane(id);
373
+ return;
374
+ }
375
+ const targetKey = sourceKey === 'pane-1' ? 'pane-2' : 'pane-1';
376
+ this.assignOrSwapPaneWithIds(
377
+ { source: id, target: this.customLayout[targetKey].id },
378
+ false,
379
+ );
380
+ }
381
+ this.updateSplitPanels();
382
+ },
352
383
  reset() {
353
384
  const original = getOriginalState();
354
385
  this.activeView = original.activeView;