@abi-software/flatmapvuer 1.7.5-beta.3 → 1.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmapvuer",
3
- "version": "1.7.5-beta.3",
3
+ "version": "1.8.0",
4
4
  "license": "Apache-2.0",
5
5
  "files": [
6
6
  "dist/*",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@abi-software/flatmap-viewer": "3.2.13",
47
- "@abi-software/map-utilities": "^1.3.3-beta.5",
47
+ "@abi-software/map-utilities": "^1.4.0",
48
48
  "@abi-software/sparc-annotation": "0.3.2",
49
49
  "@abi-software/svg-sprite": "^1.0.1",
50
50
  "@element-plus/icons-vue": "^2.3.1",
@@ -1926,8 +1926,7 @@ export default {
1926
1926
  }
1927
1927
  } else {
1928
1928
  //require data.resource && data.feature.source
1929
- let results =
1930
- await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp, data)
1929
+ let results = await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp, data)
1931
1930
  // load and store knowledge
1932
1931
  loadAndStoreKnowledge(this.mapImp, this.flatmapQueries);
1933
1932
  // The line below only creates the tooltip if some data was found on the path
@@ -2433,22 +2432,10 @@ export default {
2433
2432
  if (state.background) this.backgroundChangeCallback(state.background)
2434
2433
  if (state.searchTerm) {
2435
2434
  const searchTerm = state.searchTerm
2436
- this.searchAndShowResult(searchTerm, true)
2437
2435
  if (state.viewingMode === "Neuron Connection") {
2438
2436
  this.highlightConnectedPaths([searchTerm])
2439
2437
  } else {
2440
- const geoID = this.mapImp.modelFeatureIds(searchTerm)
2441
- if (geoID.length > 0) {
2442
- const feature = this.mapImp.featureProperties(geoID[0])
2443
- this.searchAndShowResult(searchTerm, true)
2444
- const data = {
2445
- resource: [feature.source],
2446
- feature,
2447
- label: feature.label,
2448
- provenanceTaxonomy: feature.taxons
2449
- }
2450
- this.checkAndCreatePopups(data)
2451
- }
2438
+ this.searchAndShowResult(searchTerm, true)
2452
2439
  }
2453
2440
  }
2454
2441
  this.setVisibilityState(state)
@@ -2599,6 +2586,7 @@ export default {
2599
2586
  if (this.mapImp.options?.style === 'functional') {
2600
2587
  this.isFC = true
2601
2588
  }
2589
+ console.log(this.mapImp)
2602
2590
  this.mapImp.setBackgroundOpacity(1)
2603
2591
  this.backgroundChangeCallback(this.currentBackground)
2604
2592
  this.pathways = this.mapImp.pathTypes()
@@ -2664,45 +2652,53 @@ export default {
2664
2652
  /**
2665
2653
  * @public
2666
2654
  * Function to display features with annotation matching the provided term,
2667
- * with the option to display the label using displayLabel flag.
2655
+ * with the option to display the label/connectivity information using displayInfo flag.
2668
2656
  * @arg {String} `term`,
2669
- * @arg {String} `displayLabel`
2657
+ * @arg {String} `displayInfo`
2670
2658
  */
2671
- searchAndShowResult: function (term, displayLabel) {
2659
+ searchAndShowResult: function (term, displayInfo) {
2672
2660
  if (this.mapImp) {
2673
2661
  if (term === undefined || term === '') {
2674
2662
  this.mapImp.clearSearchResults()
2663
+ if (this.viewingMode === "Exploration") {
2664
+ this.$emit('connectivity-info-close');
2665
+ } else if (this.viewingMode === "Annotation") {
2666
+ this.manualAbortedOnClose()
2667
+ }
2675
2668
  this.statesTracking.activeTerm = ""
2676
2669
  return true
2677
2670
  } else {
2678
2671
  const searchResults = this.mapImp.search(term)
2679
- if (
2680
- searchResults &&
2681
- searchResults.results &&
2682
- searchResults.results.length > 0
2683
- ) {
2672
+ if (searchResults?.results?.length) {
2684
2673
  this.statesTracking.activeTerm = term
2685
2674
  this.mapImp.showSearchResults(searchResults)
2686
- if (
2687
- displayLabel &&
2688
- searchResults.results
2689
- ) {
2690
- let annotation = undefined;
2675
+ if (displayInfo) {
2691
2676
  let featureId = undefined;
2692
- for (let i = 0; i < searchResults.results.length && !(annotation?.label); i++) {
2677
+ for (let i = 0; i < searchResults.results.length; i++) {
2693
2678
  featureId = searchResults.results[i].featureId
2694
- annotation = this.mapImp.annotation(featureId)
2679
+ const annotation = this.mapImp.annotation(featureId)
2680
+ if (featureId && annotation?.label) break;
2695
2681
  }
2696
- if (annotation?.label) {
2697
- this.mapImp.showPopup(
2698
- featureId,
2699
- capitalise(annotation.label),
2700
- {
2701
- className: 'custom-popup',
2702
- positionAtLastClick: false,
2703
- preserveSelection: true,
2704
- }
2705
- )
2682
+ if (featureId) {
2683
+ const feature = this.mapImp.featureProperties(featureId)
2684
+ const data = {
2685
+ resource: [feature.source],
2686
+ feature: {...feature, models: feature.models || feature.source},
2687
+ label: feature.label,
2688
+ provenanceTaxonomy: feature.taxons,
2689
+ }
2690
+ if (this.viewingMode === "Exploration" || this.viewingMode === "Annotation") {
2691
+ this.checkAndCreatePopups(data)
2692
+ } else if (this.viewingMode === 'Neuron Connection') {
2693
+ setTimeout(() => {
2694
+ this.highlightConnectedPaths(data.resource)
2695
+ }, 1000)
2696
+ }
2697
+ this.mapImp.showPopup(featureId, capitalise(feature.label), {
2698
+ className: 'custom-popup',
2699
+ positionAtLastClick: false,
2700
+ preserveSelection: true,
2701
+ })
2706
2702
  }
2707
2703
  }
2708
2704
  return true