@abi-software/map-utilities 1.1.0-beta.1 → 1.1.0-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-utilities",
3
- "version": "1.1.0-beta.1",
3
+ "version": "1.1.0-beta.2",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
@@ -29,7 +29,7 @@
29
29
  "./src/*": "./src/*"
30
30
  },
31
31
  "dependencies": {
32
- "@abi-software/gallery": "^1.1.0",
32
+ "@abi-software/gallery": "^1.1.1",
33
33
  "@abi-software/svg-sprite": "^1.0.0",
34
34
  "@element-plus/icons-vue": "^2.3.1",
35
35
  "element-plus": "^2.7.3",
@@ -6,15 +6,15 @@
6
6
  :key="index"
7
7
  type="info"
8
8
  class="tag"
9
- :class="{ 'active-tag': species.taxon === activeSpecies.taxon }"
10
- :closable="species.taxon === activeSpecies.taxon"
9
+ :class="{ 'active-tag': species.name === activeSpecies.name }"
10
+ :closable="species.name === activeSpecies.name"
11
11
  @close="removeSpeciesFilterTag"
12
12
  @click="filterBySpecies(species)"
13
13
  >
14
14
  {{ species.name }} ({{ species.count }})
15
15
  </el-tag>
16
16
  <div class="gallery-container">
17
- <Gallery :items="filteredImages" :imageStyle="imageStyle" />
17
+ <Gallery :items="imageItems" :imageStyle="imageStyle" />
18
18
  </div>
19
19
  </div>
20
20
  </div>
@@ -28,7 +28,7 @@ import Gallery from "@abi-software/gallery";
28
28
  import "@abi-software/gallery/dist/style.css";
29
29
 
30
30
  export default {
31
- name: "ImagePopup",
31
+ name: "ImageGalleryPopup",
32
32
  components: {
33
33
  Tag,
34
34
  Gallery,
@@ -41,9 +41,9 @@ export default {
41
41
  },
42
42
  data: function () {
43
43
  return {
44
- activeSpecies: { taxon: "", name: "" },
44
+ activeSpecies: { name: "" },
45
45
  speciesFilterTags: [],
46
- filteredImages: [],
46
+ imageItems: [],
47
47
  showImageGallery: false,
48
48
  };
49
49
  },
@@ -60,7 +60,7 @@ export default {
60
60
  handler: function (value) {
61
61
  if (value) {
62
62
  this.populateFilterTags();
63
- this.filteredImages = this.imageEntry;
63
+ this.imageItems = this.imageEntry;
64
64
  }
65
65
  },
66
66
  deep: true,
@@ -68,39 +68,35 @@ export default {
68
68
  },
69
69
  methods: {
70
70
  removeSpeciesFilterTag: function () {
71
- this.activeSpecies = { taxon: "", name: "" };
72
- this.filteredImages = this.imageEntry;
71
+ this.activeSpecies = { name: "" };
72
+ this.imageItems = this.imageEntry;
73
73
  },
74
74
  filterBySpecies: function (tagInfo) {
75
75
  this.activeSpecies = tagInfo;
76
- let imageList = [];
76
+ let filteredImageItems = [];
77
77
  this.imageEntry.forEach((image) => {
78
- if (image.species && image.species.length > 0) {
78
+ if (image.species && image.species.length) {
79
79
  image.species.forEach((species) => {
80
- if (species.species && species.species.curie === tagInfo.taxon) {
81
- imageList.push(image);
80
+ if (species === tagInfo.name) {
81
+ filteredImageItems.push(image);
82
82
  }
83
83
  });
84
84
  }
85
85
  });
86
- this.filteredImages = imageList;
86
+ this.imageItems = filteredImageItems;
87
87
  },
88
88
  populateFilterTags: function () {
89
89
  let imageObjects = {};
90
90
  this.imageEntry.forEach((image) => {
91
- if (image.species && image.species.length > 0) {
91
+ if (image.species && image.species.length) {
92
92
  image.species.forEach((species) => {
93
- if (species.species) {
94
- const speciesInfo = species.species;
95
- if (!(speciesInfo.curie in imageObjects)) {
96
- imageObjects[speciesInfo.curie] = {
97
- taxon: speciesInfo.curie,
98
- name: speciesInfo.name,
99
- count: 0,
100
- };
101
- }
102
- imageObjects[speciesInfo.curie].count++;
93
+ if (!(species in imageObjects)) {
94
+ imageObjects[species] = {
95
+ name: species,
96
+ count: 0,
97
+ };
103
98
  }
99
+ imageObjects[species].count++;
104
100
  });
105
101
  }
106
102
  });
@@ -109,7 +105,7 @@ export default {
109
105
  },
110
106
  mounted: function () {
111
107
  this.populateFilterTags();
112
- this.filteredImages = this.imageEntry;
108
+ this.imageItems = this.imageEntry;
113
109
  },
114
110
  };
115
111
  </script>