@abi-software/flatmapvuer 1.9.0-beta.2 → 1.9.0-beta.4

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.9.0-beta.2",
3
+ "version": "1.9.0-beta.4",
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": "4.2.0",
47
- "@abi-software/map-utilities": "^1.5.0-beta.2",
47
+ "@abi-software/map-utilities": "^1.5.0-beta.3",
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",
@@ -1823,54 +1823,35 @@ export default {
1823
1823
  const featuresToHighlight = [];
1824
1824
  const geojsonHighlights = [];
1825
1825
  const connectivityData = [];
1826
- const filteredConnectivityData = [];
1827
1826
  const errorData = [];
1828
1827
 
1829
- if (!data.length) {
1830
- // Close all tooltips on the current flatmap element
1831
- this.removeActiveTooltips();
1832
- } else {
1833
- data.forEach((item) => {
1834
- connectivityData.push({
1835
- id: item.id,
1836
- label: item.label,
1837
- });
1838
- });
1839
- }
1840
-
1841
1828
  // to keep the highlighted path on map
1842
1829
  if (connectivityInfo && connectivityInfo.featureId) {
1843
1830
  featuresToHighlight.push(...connectivityInfo.featureId);
1844
1831
  }
1845
1832
 
1846
- // search the features on the map first
1847
1833
  if (this.mapImp) {
1848
- connectivityData.forEach((connectivity, i) => {
1849
- const {id, label} = connectivity;
1850
- const response = this.mapImp.search(id);
1834
+ // search the features on the map first
1835
+ data.forEach((connectivity) => {
1836
+ const response = this.mapImp.search(connectivity.id);
1851
1837
 
1852
1838
  if (response?.results.length) {
1853
1839
  const featureId = response?.results[0].featureId;
1854
-
1855
- filteredConnectivityData.push({
1856
- featureId,
1857
- id,
1858
- label,
1859
- });
1840
+ connectivityData.push({ featureId, ...connectivity });
1860
1841
  } else {
1861
1842
  errorData.push(connectivity);
1862
1843
  }
1863
1844
  });
1864
1845
 
1865
- if (filteredConnectivityData.length) {
1866
- let geojsonId = filteredConnectivityData[0].featureId;
1846
+ if (connectivityData.length) {
1847
+ let geojsonId = connectivityData[0].featureId;
1867
1848
 
1868
1849
  this.mapImp.annotations.forEach((annotation) => {
1869
1850
  const anatomicalNodes = annotation['anatomical-nodes'];
1870
1851
 
1871
1852
  if (anatomicalNodes) {
1872
1853
  const anatomicalNodesString = anatomicalNodes.join('');
1873
- const foundItem = filteredConnectivityData.every((item) =>
1854
+ const foundItem = connectivityData.every((item) =>
1874
1855
  anatomicalNodesString.indexOf(item.id) !== -1
1875
1856
  );
1876
1857
 
@@ -1881,17 +1862,14 @@ export default {
1881
1862
  }
1882
1863
  });
1883
1864
 
1884
- this.createTooltipForConnectivity(filteredConnectivityData, geojsonId);
1865
+ this.createTooltipForConnectivity(connectivityData, geojsonId);
1885
1866
  } else {
1886
- errorData.push(...connectivityData);
1887
1867
  // Close all tooltips on the current flatmap element
1888
1868
  this.removeActiveTooltips();
1889
1869
  }
1890
1870
 
1891
- // Emit error message for connectivity graph
1892
- if (errorData.length) {
1893
- this.emitConnectivityGraphError(errorData);
1894
- }
1871
+ // Emit error message for connectivity
1872
+ this.emitConnectivityError(errorData);
1895
1873
 
1896
1874
  // highlight all available features
1897
1875
  const featureIdsToHighlight = this.mapImp.modelFeatureIdList(featuresToHighlight);
@@ -1919,8 +1897,8 @@ export default {
1919
1897
  }
1920
1898
  return featureIds;
1921
1899
  },
1922
- emitConnectivityGraphError: function (errorData) {
1923
- this.$emit('connectivity-graph-error', {
1900
+ emitConnectivityError: function (errorData) {
1901
+ this.$emit('connectivity-error', {
1924
1902
  data: {
1925
1903
  errorData: errorData,
1926
1904
  errorMessage: ERROR_MESSAGE,
@@ -2058,7 +2036,7 @@ export default {
2058
2036
  }
2059
2037
  if (featureId) {
2060
2038
  const feature = this.mapImp.featureProperties(featureId)
2061
- if (!tooltip.components.includes(feature.label)) {
2039
+ if (feature.label && !tooltip.components.includes(feature.label)) {
2062
2040
  tooltip.components.push(feature.label)
2063
2041
  tooltip.componentsWithDatasets.push({ id: feature.models, name: feature.label })
2064
2042
  }
@@ -2067,7 +2045,7 @@ export default {
2067
2045
  featureIds = [...new Set(featureIds)].filter(id => id !== data.feature.featureId)
2068
2046
  featureIds.forEach((id) => {
2069
2047
  const feature = this.mapImp.featureProperties(id)
2070
- if (!tooltip.destinations.includes(feature.label)) {
2048
+ if (feature.label && !tooltip.destinations.includes(feature.label)) {
2071
2049
  tooltip.destinations.push(feature.label)
2072
2050
  tooltip.destinationsWithDatasets.push({ id: feature.models, name: feature.label })
2073
2051
  }
@@ -68,7 +68,7 @@
68
68
  :connectivityInfoSidebar="connectivityInfoSidebar"
69
69
  @connectivity-info-open="onConnectivityInfoOpen"
70
70
  @connectivity-info-close="onConnectivityInfoClose"
71
- @connectivity-graph-error="onConnectivityGraphError"
71
+ @connectivity-error="onConnectivityError"
72
72
  @open-map="$emit('open-map', $event)"
73
73
  @pathway-selection-changed="onSelectionsDataChanged"
74
74
  :minZoom="minZoom"
@@ -295,8 +295,8 @@ export default {
295
295
  onConnectivityInfoOpen: function (entryData) {
296
296
  this.$emit('connectivity-info-open', entryData);
297
297
  },
298
- onConnectivityGraphError: function (errorInfo) {
299
- this.$emit('connectivity-graph-error', errorInfo);
298
+ onConnectivityError: function (errorInfo) {
299
+ this.$emit('connectivity-error', errorInfo);
300
300
  },
301
301
  onSelectionsDataChanged: function (data) {
302
302
  this.$emit('pathway-selection-changed', data);
@@ -27,9 +27,13 @@ async function getReferenceConnectivitiesByAPI(mapImp, resource, flatmapQueries)
27
27
  }
28
28
 
29
29
  function getKnowledgeSource(mapImp) {
30
+ return getKnowledgeSourceFromProvenance(mapImp.provenance);
31
+ }
32
+
33
+ function getKnowledgeSourceFromProvenance(provenance) {
30
34
  let mapKnowledgeSource = '';
31
- if (mapImp.provenance?.connectivity) {
32
- const sckanProvenance = mapImp.provenance.connectivity;
35
+ if (provenance?.connectivity) {
36
+ const sckanProvenance = provenance.connectivity;
33
37
  if ('knowledge-source' in sckanProvenance) {
34
38
  mapKnowledgeSource = sckanProvenance['knowledge-source'];
35
39
  } else if ('npo' in sckanProvenance) {
@@ -97,5 +101,6 @@ export {
97
101
  getReferenceConnectivitiesByAPI,
98
102
  loadAndStoreKnowledge,
99
103
  getKnowledgeSource,
104
+ getKnowledgeSourceFromProvenance,
100
105
  refreshFlatmapKnowledgeCache,
101
106
  }
package/vite.config.js CHANGED
@@ -50,12 +50,16 @@ export default defineConfig(({ command, mode }) => {
50
50
  fileName: 'flatmapvuer',
51
51
  },
52
52
  rollupOptions: {
53
- external: ["vue", "@abi-software/svg-sprite", "@abi-software/map-utilities"],
53
+ external: ["vue", "@abi-software/sparc-annotation", "@abi-software/svg-sprite", "@abi-software/map-utilities",
54
+ "@element-plus/icons-vue", "pinia"],
54
55
  output: {
55
56
  globals: {
56
57
  vue: "Vue",
58
+ "@abi-software/sparc-annotation": "@abi-software/sparc-annotation",
57
59
  "@abi-software/svg-sprite": "@abi-software/svg-sprite",
58
- "@abi-software/map-utilities": "@abi-software/map-utilities"
60
+ "@abi-software/map-utilities": "@abi-software/map-utilities",
61
+ "@element-plus/icons-vue": "@element-plus/icons-vue",
62
+ "pinia": "pinia"
59
63
  },
60
64
  },
61
65
  },