@abi-software/flatmapvuer 1.3.2 → 1.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmapvuer",
3
- "version": "1.3.2",
3
+ "version": "1.4.1",
4
4
  "license": "Apache-2.0",
5
5
  "files": [
6
6
  "dist/*",
@@ -43,8 +43,8 @@
43
43
  "./src/*": "./src/*"
44
44
  },
45
45
  "dependencies": {
46
- "@abi-software/flatmap-viewer": "2.9.5",
47
- "@abi-software/map-utilities": "1.0.0",
46
+ "@abi-software/flatmap-viewer": "3.1.4",
47
+ "@abi-software/map-utilities": "1.1.0",
48
48
  "@abi-software/sparc-annotation": "0.3.1",
49
49
  "@abi-software/svg-sprite": "1.0.0",
50
50
  "@element-plus/icons-vue": "^2.3.1",
package/src/App.vue CHANGED
@@ -150,6 +150,7 @@ export default {
150
150
  //component.showPathwaysDrawer(false);
151
151
  if (this.consoleOn) console.log(taxon, id)
152
152
  //component.searchAndShowResult("heart");
153
+ // component.changeViewingMode('Annotation')
153
154
  },
154
155
  panZoomcallback: function (payload) {
155
156
  this.payload = payload
@@ -260,6 +261,10 @@ export default {
260
261
  iconClass: 'mapicon-icon_cat',
261
262
  displayWarning: true,
262
263
  },
264
+ Vagus: {
265
+ taxo: 'UBERON:1759',
266
+ displayWarning: true,
267
+ },
263
268
  Sample: { taxo: 'NCBITaxon:1', displayWarning: true },
264
269
  'Functional Connectivity': {
265
270
  taxo: 'FunctionalConnectivity',
@@ -282,8 +287,9 @@ export default {
282
287
  mapSettings: [],
283
288
  //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/"
284
289
  //flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/"
285
- //flatmapAPI: "https://mapcoe-demo.org/current/flatmap/v3/",
286
- flatmapAPI: 'https://mapcore-demo.org/devel/flatmap/v4/',
290
+ flatmapAPI: "https://mapcore-demo.org/current/flatmap/v3/",
291
+ //flatmapAPI: 'https://mapcore-demo.org/devel/flatmap/v4/',
292
+ //flatmapAPI: 'https://mapcore-demo.org/curation/flatmap/',
287
293
  //flatmapAPI: "https://mapcore-demo.org/fccb/flatmap/"
288
294
  //flatmapAPI: "https://mapcore-demo.org/staging/flatmap/v1/"
289
295
  // flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v1/",
@@ -54,7 +54,7 @@ Please use `const` to assign meaningful names to them...
54
54
  SCKAN </a
55
55
  >.
56
56
  </p>
57
- <p v-else @mouseover="showTooltip(6)" @mouseout="hideTooltip(6)">
57
+ <p v-else @mouseover="showTooltip(7)" @mouseout="hideTooltip(7)">
58
58
  This map displays the connectivity of neuron populations.
59
59
  Specifically, those from the primarily rat-based
60
60
  <a
@@ -76,8 +76,8 @@ Please use `const` to assign meaningful names to them...
76
76
  <div
77
77
  class="warning-icon"
78
78
  v-if="displayWarning"
79
- @mouseover="showTooltip(6)"
80
- @mouseout="hideTooltip(6)"
79
+ @mouseover="showTooltip(7)"
80
+ @mouseout="hideTooltip(7)"
81
81
  >
82
82
  <el-icon><el-icon-warning-filled /></el-icon>
83
83
  <template v-if="isLegacy">
@@ -245,7 +245,7 @@ Please use `const` to assign meaningful names to them...
245
245
  <div
246
246
  class="pathway-location"
247
247
  :class="{ open: drawerOpen, close: !drawerOpen }"
248
- v-show="!disableUI"
248
+ v-show="!(disableUI || isCentreLine)"
249
249
  >
250
250
  <div
251
251
  class="pathway-container"
@@ -363,7 +363,7 @@ Please use `const` to assign meaningful names to them...
363
363
  key="pathwaysSelection"
364
364
  />
365
365
  <selections-group
366
- v-if="!isFC && taxonConnectivity && taxonConnectivity.length > 0"
366
+ v-if="taxonConnectivity && taxonConnectivity.length > 0"
367
367
  title="Studied in"
368
368
  labelKey="label"
369
369
  identifierKey="taxon"
@@ -377,7 +377,7 @@ Please use `const` to assign meaningful names to them...
377
377
  key="taxonSelection"
378
378
  />
379
379
  <selections-group
380
- v-if="!isFC && centreLines && centreLines.length > 0"
380
+ v-if="!(isCentreLine || isFC) && centreLines && centreLines.length > 0"
381
381
  title="Nerves"
382
382
  labelKey="label"
383
383
  identifierKey="key"
@@ -437,19 +437,19 @@ Please use `const` to assign meaningful names to them...
437
437
  <el-row class="backgroundControl">
438
438
  <div style="margin-bottom: 2px;">
439
439
  <template
440
- v-for="(item, i) in viewingModes"
441
- :key="item + i"
440
+ v-for="(value, key, index) in viewingModes"
441
+ :key="key"
442
442
  >
443
- <template v-if="item.name === viewingMode">
444
- <span class="viewing-mode-title"><b >{{ item.name }}</b></span>
443
+ <template v-if="key === viewingMode">
444
+ <span class="viewing-mode-title"><b >{{ key }}</b></span>
445
445
  </template>
446
446
  <template v-else>
447
- <span class="viewing-mode-unselected" @click="changeViewingMode(i)">{{ item.name }}</span>
447
+ <span class="viewing-mode-unselected" @click="changeViewingMode(key)">{{ key }}</span>
448
448
  </template>
449
449
  </template>
450
450
  </div>
451
451
  <el-row class="viewing-mode-description">
452
- {{ viewingModes[viewingModeIndex].description}}
452
+ {{ viewingModes[viewingMode] }}
453
453
  </el-row>
454
454
  </el-row>
455
455
  <template v-if="viewingMode === 'Annotation' && userInformation">
@@ -757,8 +757,6 @@ export default {
757
757
  DrawToolbar
758
758
  },
759
759
  beforeCreate: function () {
760
- this.mapManager = undefined
761
- this.mapImp = undefined
762
760
  //The state watcher may triggered before
763
761
  //created causing issue, This flag will
764
762
  //resolve this issue.
@@ -1691,13 +1689,10 @@ export default {
1691
1689
  * Function triggered by viewing mode change.
1692
1690
  * (e.g., from 'Exploration' to 'Annotation')
1693
1691
  * All tooltips and popups currently showing on map will be closed
1694
- * when this function is triggered. Optional index can be provided, this will
1695
- * switch the provided view mode to the first index.
1696
1692
  */
1697
- changeViewingMode: function (newModeIndex=null) {
1698
- if (newModeIndex !== null) {
1699
- //this.viewingMode = this.viewingModes[newModeIndex].name
1700
- this.viewingModeIndex = newModeIndex
1693
+ changeViewingMode: function (modeName) {
1694
+ if (modeName) {
1695
+ this.viewingMode = modeName
1701
1696
  }
1702
1697
  this.closeTooltip()
1703
1698
  },
@@ -2001,6 +1996,9 @@ export default {
2001
1996
  // this method is moved to sidebar connectivity info
2002
1997
  // const featureIds = [feature];
2003
1998
  // this.moveMap(featureIds);
1999
+ if (this.featuresAlert) {
2000
+ this.tooltipEntry['featuresAlert'] = this.featuresAlert;
2001
+ }
2004
2002
  this.$emit('connectivity-info-open', this.tooltipEntry);
2005
2003
  }
2006
2004
  // If UI is not disabled,
@@ -2315,14 +2313,19 @@ export default {
2315
2313
  */
2316
2314
  onFlatmapReady: function () {
2317
2315
  // onFlatmapReady is used for functions that need to run immediately after the flatmap is loaded
2318
- this.sensor = new ResizeSensor(this.$refs.display, this.mapResize)
2319
- if (this.mapImp.options && this.mapImp.options.style === 'functional') {
2316
+ this.sensor = markRaw(new ResizeSensor(this.$refs.display, this.mapResize))
2317
+ console.log(this.mapImp.options)
2318
+ if (this.mapImp.options?.style === 'functional') {
2320
2319
  this.isFC = true
2320
+ } else if (this.mapImp.options?.style === 'centreline') {
2321
+ this.isCentreLine = true
2321
2322
  }
2322
2323
  this.mapImp.setBackgroundOpacity(1)
2323
2324
  this.backgroundChangeCallback(this.currentBackground)
2324
2325
  this.pathways = this.mapImp.pathTypes()
2325
- this.mapImp.enableCentrelines(false)
2326
+ if (!this.isCentreLine) {
2327
+ this.mapImp.enableCentrelines(false)
2328
+ }
2326
2329
  //Disable layers for now
2327
2330
  //this.layers = this.mapImp.getLayers();
2328
2331
  this.processSystems(this.mapImp.getSystems())
@@ -2331,7 +2334,7 @@ export default {
2331
2334
  this.addResizeButtonToMinimap()
2332
2335
  this.loading = false
2333
2336
  this.computePathControlsMaximumHeight()
2334
- this.drawerOpen = true
2337
+ this.drawerOpen = !this.isCentreLine
2335
2338
  this.mapResize()
2336
2339
  this.handleMapClick();
2337
2340
  /**
@@ -2625,6 +2628,9 @@ export default {
2625
2628
  },
2626
2629
  data: function () {
2627
2630
  return {
2631
+ sensor: null,
2632
+ mapManager: undefined,
2633
+ flatmapQueries: undefined,
2628
2634
  annotationEntry: {},
2629
2635
  //tooltip display has to be set to false until it is rendered
2630
2636
  //for the first time, otherwise it may display an arrow at a
@@ -2649,6 +2655,7 @@ export default {
2649
2655
  systems: [],
2650
2656
  taxonConnectivity: [],
2651
2657
  pathwaysMaxHeight: 1000,
2658
+ tooltipWait: markRaw([]),
2652
2659
  hoverVisibilities: [
2653
2660
  { value: false, ref: 'markerPopover' }, // 0
2654
2661
  { value: false, ref: 'zoomInPopover' }, // 1
@@ -2670,6 +2677,7 @@ export default {
2670
2677
  helpModeActiveIndex: this.helpModeInitialIndex,
2671
2678
  yellowstar: yellowstar,
2672
2679
  isFC: false,
2680
+ isCentreLine: false,
2673
2681
  inHelp: false,
2674
2682
  currentBackground: 'white',
2675
2683
  availableBackground: ['white', 'lightskyblue', 'black'],
@@ -2688,20 +2696,11 @@ export default {
2688
2696
  currentActive: '',
2689
2697
  selectedDrawnFeature: undefined, // Clicked drawn annotation
2690
2698
  currentHover: '',
2691
- viewingModeIndex: 0,
2699
+ viewingMode: 'Exploration',
2692
2700
  viewingModes: {
2693
- 0: {
2694
- name: 'Exploration',
2695
- description:'Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources'
2696
- },
2697
- 1: {
2698
- name: 'Neuron Connection',
2699
- description: 'Discover Neuron connections by selecting a neuron and viewing its associated network connections'
2700
- },
2701
- 2: {
2702
- name: 'Annotation',
2703
- description: 'View internal identifiers of features'
2704
- }
2701
+ 'Exploration': 'Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources',
2702
+ 'Neuron Connection': 'Discover Neuron connections by selecting a neuron and viewing its associated network connections',
2703
+ 'Annotation': 'View internal identifiers of features'
2705
2704
  },
2706
2705
  drawnType: 'All tools',
2707
2706
  drawnTypes: ['All tools', 'Point', 'LineString', 'Polygon', 'None'],
@@ -2752,9 +2751,6 @@ export default {
2752
2751
  isValidDrawnCreated: function () {
2753
2752
  return Object.keys(this.drawnCreatedEvent).length > 0
2754
2753
  },
2755
- viewingMode: function() {
2756
- return this.viewingModes[this.viewingModeIndex].name
2757
- },
2758
2754
  },
2759
2755
  watch: {
2760
2756
  entry: function () {
@@ -2812,10 +2808,9 @@ export default {
2812
2808
  mounted: function () {
2813
2809
  this.openMapRef = shallowRef(this.$refs.openMapRef)
2814
2810
  this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef)
2815
- this.tooltipWait = []
2816
2811
  this.tooltipWait.length = this.hoverVisibilities.length
2817
- this.mapManager = new flatmap.MapManager(this.flatmapAPI)
2818
- this.flatmapQueries = new FlatmapQueries()
2812
+ this.mapManager = markRaw(new flatmap.MapManager(this.flatmapAPI))
2813
+ this.flatmapQueries = markRaw(new FlatmapQueries())
2819
2814
  this.flatmapQueries.initialise(this.flatmapAPI)
2820
2815
  if (this.state) {
2821
2816
  //State is set and require to set the state
@@ -87,7 +87,7 @@
87
87
 
88
88
  <script>
89
89
  /* eslint-disable no-alert, no-console */
90
- import { reactive } from 'vue'
90
+ import { markRaw } from 'vue'
91
91
  import EventBus from './EventBus'
92
92
  import FlatmapVuer from './FlatmapVuer.vue'
93
93
  import * as flatmap from '@abi-software/flatmap-viewer'
@@ -120,12 +120,6 @@ export default {
120
120
  Popover,
121
121
  FlatmapVuer,
122
122
  },
123
- beforeMount() {
124
- //List for resolving the promise in initialise
125
- //if initialise is called multiple times
126
- this._resolveList = []
127
- this._initialised = false
128
- },
129
123
  mounted: function () {
130
124
  this.initialise()
131
125
  EventBus.on('onActionClick', (action) => {
@@ -160,7 +154,7 @@ export default {
160
154
  // FIrst look through the uuid
161
155
  const uuid = this.availableSpecies[key].uuid
162
156
  if (uuid && data.map((e) => e.uuid).indexOf(uuid) > 0) {
163
- this.speciesList[key] = reactive(this.availableSpecies[key])
157
+ this.speciesList[key] = this.availableSpecies[key]
164
158
  } else {
165
159
  for (let i = 0; i < data.length; i++) {
166
160
  if (this.availableSpecies[key].taxo === data[i].taxon) {
@@ -170,11 +164,11 @@ export default {
170
164
  data[i].biologicalSex ===
171
165
  this.availableSpecies[key].biologicalSex
172
166
  ) {
173
- this.speciesList[key] = reactive(this.availableSpecies[key])
167
+ this.speciesList[key] = this.availableSpecies[key]
174
168
  break
175
169
  }
176
170
  } else {
177
- this.speciesList[key] = reactive(this.availableSpecies[key])
171
+ this.speciesList[key] = this.availableSpecies[key]
178
172
  break
179
173
  }
180
174
  }
@@ -205,19 +199,19 @@ export default {
205
199
  5
206
200
  )
207
201
  }
208
- this._initialised = true
202
+ this.initialised = true
209
203
  resolve()
210
204
  //Resolve all other promises resolve in the list
211
- this._resolveList.forEach((other) => {
205
+ this.resolveList.forEach((other) => {
212
206
  other()
213
207
  })
214
208
  })
215
- } else if (this._initialised) {
209
+ } else if (this.initialised) {
216
210
  //resolve as it has been initialised
217
211
  resolve()
218
212
  } else {
219
213
  //resolve when the async initialisation is finished
220
- this._resolveList.push(resolve)
214
+ this.resolveList.push(resolve)
221
215
  }
222
216
  })
223
217
  },
@@ -361,11 +355,11 @@ export default {
361
355
  if (state.species.slice(0, 6) === 'Legacy') name = state.species
362
356
  else name = name + ` ${state.species}`
363
357
  }
364
- this.speciesList[name] = reactive({
358
+ this.speciesList[name] = {
365
359
  taxo: taxo,
366
360
  isLegacy: true,
367
361
  displayWarning: true,
368
- })
362
+ }
369
363
  return {
370
364
  species: name,
371
365
  state: {
@@ -517,6 +511,14 @@ export default {
517
511
  */
518
512
  this.$emit('shown-map-tooltip');
519
513
  },
514
+ /**
515
+ * @vuese
516
+ * Function to change the view mode of the map.
517
+ */
518
+ changeViewingMode: function (modeName) {
519
+ let map = this.getCurrentFlatmap()
520
+ map.changeViewingMode(modeName)
521
+ },
520
522
  },
521
523
  props: {
522
524
  /**
@@ -720,6 +722,8 @@ export default {
720
722
  activeSpecies: undefined,
721
723
  speciesList: {},
722
724
  requireInitialisation: true,
725
+ resolveList: markRaw([]),
726
+ initialised: false,
723
727
  }
724
728
  },
725
729
  watch: {
@@ -8,7 +8,6 @@ export {}
8
8
  declare module 'vue' {
9
9
  export interface GlobalComponents {
10
10
  DynamicLegends: typeof import('./components/legends/DynamicLegends.vue')['default']
11
- ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
12
11
  ElButton: typeof import('element-plus/es')['ElButton']
13
12
  ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
14
13
  ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
@@ -24,7 +23,6 @@ declare module 'vue' {
24
23
  ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
25
24
  ElRow: typeof import('element-plus/es')['ElRow']
26
25
  ElSelect: typeof import('element-plus/es')['ElSelect']
27
- ElSwitch: typeof import('element-plus/es')['ElSwitch']
28
26
  FlatmapVuer: typeof import('./components/FlatmapVuer.vue')['default']
29
27
  MultiFlatmapVuer: typeof import('./components/MultiFlatmapVuer.vue')['default']
30
28
  SelectionsGroup: typeof import('./components/SelectionsGroup.vue')['default']