@abi-software/map-side-bar 2.18.0 → 2.19.1-demo.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.
Files changed (41) hide show
  1. package/.postcssrc.json +5 -5
  2. package/README.md +8 -9
  3. package/cypress.config.js +6 -7
  4. package/dist/map-side-bar.js +6890 -6026
  5. package/dist/map-side-bar.umd.cjs +65 -62
  6. package/dist/style.css +1 -1
  7. package/eslint.config.js +44 -9
  8. package/package.json +10 -3
  9. package/reporter-config.json +1 -1
  10. package/src/App.vue +89 -80
  11. package/src/algolia/algolia.js +173 -167
  12. package/src/algolia/utils.js +34 -38
  13. package/src/assets/_variables.scss +12 -10
  14. package/src/assets/connectivity-explorer.scss +1 -1
  15. package/src/assets/fonts.scss +0 -1
  16. package/src/assets/searchPopover.scss +1 -2
  17. package/src/components/AnnotationTool.vue +9 -32
  18. package/src/components/BadgesGroup.vue +29 -32
  19. package/src/components/CellCard.vue +992 -0
  20. package/src/components/CellCardExplorer.vue +879 -0
  21. package/src/components/ConnectivityCard.vue +22 -19
  22. package/src/components/ConnectivityExplorer.vue +109 -130
  23. package/src/components/ConnectivityInfo.vue +142 -171
  24. package/src/components/ContributorItem.vue +15 -11
  25. package/src/components/DatasetCard.vue +166 -201
  26. package/src/components/DatasetExplorer.vue +160 -201
  27. package/src/components/ImageGallery.vue +35 -36
  28. package/src/components/SearchFilters.vue +384 -407
  29. package/src/components/SearchHistory.vue +69 -103
  30. package/src/components/SideBar.vue +186 -94
  31. package/src/components/Tabs.vue +25 -21
  32. package/src/components/icons/IconOpenExternal.vue +23 -0
  33. package/src/components/index.js +3 -5
  34. package/src/components/species-map.js +7 -7
  35. package/src/components.d.ts +3 -0
  36. package/src/exampleConnectivityInput.js +310 -318
  37. package/src/main.js +6 -6
  38. package/src/mixins/S3Bucket.vue +10 -13
  39. package/src/utils/common.js +59 -0
  40. package/vite.config.js +62 -61
  41. package/vuese-generator.js +47 -55
@@ -1,5 +1,3 @@
1
- /* eslint-disable no-alert, no-console */
2
-
3
1
  // Mapping between display categories and their Algolia index property path
4
2
  // Used for populating the Dataset Search Results facet menu dynamically
5
3
  export const facetPropPathMapping = [
@@ -7,7 +5,7 @@ export const facetPropPathMapping = [
7
5
  label: 'Data Type',
8
6
  id: 'item.types',
9
7
  facetPropPath: 'item.types.name',
10
- facetSubpropPath: 'item.types.subcategory.name'
8
+ facetSubpropPath: 'item.types.subcategory.name',
11
9
  },
12
10
  {
13
11
  label: 'Anatomical Structure',
@@ -15,39 +13,39 @@ export const facetPropPathMapping = [
15
13
  facetPropPath: 'anatomy.organ.category.name',
16
14
  facetSubpropPath: 'anatomy.organ.subcategory.name',
17
15
  facetSubsubpropPath: 'anatomy.organ.subsubcategory.name',
18
- facetFilterPath: 'anatomy.organ.name'
16
+ facetFilterPath: 'anatomy.organ.name',
19
17
  },
20
18
  {
21
19
  label: 'Species',
22
20
  id: 'organisms.primary.species',
23
21
  facetPropPath: 'organisms.primary.species.name',
24
- facetSubpropPath: 'organisms.primary.species.subcategory.name'
22
+ facetSubpropPath: 'organisms.primary.species.subcategory.name',
25
23
  },
26
24
  {
27
25
  label: 'Experimental Approach',
28
26
  id: 'item.modalities',
29
27
  facetPropPath: 'item.modalities.keyword',
30
- facetSubpropPath: 'item.modalities.subcategory.name'
28
+ facetSubpropPath: 'item.modalities.subcategory.name',
31
29
  },
32
30
  {
33
31
  label: 'Sex',
34
32
  id: 'attributes.subject.sex',
35
33
  facetPropPath: 'attributes.subject.sex.value',
36
- facetSubpropPath: 'attributes.subject.sex.subcategory.name'
34
+ facetSubpropPath: 'attributes.subject.sex.subcategory.name',
37
35
  },
38
36
  {
39
37
  label: 'Age Categories',
40
38
  id: 'attributes.subject.ageCategory',
41
39
  facetPropPath: 'attributes.subject.ageCategory.value',
42
- facetSubpropPath: 'attributes.subject.ageCategory.subcategory.name'
40
+ facetSubpropPath: 'attributes.subject.ageCategory.subcategory.name',
43
41
  },
44
42
  {
45
43
  label: 'Consortia',
46
44
  id: 'supportingAwards.consortium',
47
45
  facetPropPath: 'supportingAwards.consortium.name',
48
- facetSubpropPath: 'supportingAwards.consortium.subcategory.name'
46
+ facetSubpropPath: 'supportingAwards.consortium.subcategory.name',
49
47
  },
50
- ]
48
+ ];
51
49
 
52
50
  // Same as above, but these show on the sidebar filters
53
51
  export const shownFilters = {
@@ -57,70 +55,68 @@ export const shownFilters = {
57
55
  'attributes.subject.ageCategory.value': 'Age Categories',
58
56
  'supportingAwards.consortium.name': 'Consortia',
59
57
  'item.types.name': 'Data type',
60
- }
58
+ };
61
59
 
62
60
  /* Returns filter for searching algolia. All facets of the same category are joined with OR,
63
- * and each of those results is then joined with an AND.
64
- * i.e. (color:blue OR color:red) AND (shape:circle OR shape:red) */
61
+ * and each of those results is then joined with an AND.
62
+ * i.e. (color:blue OR color:red) AND (shape:circle OR shape:red) */
65
63
  export function getFilters(selectedFacetArray = undefined) {
66
64
  // return all datasets if no filter
67
65
  if (selectedFacetArray === undefined) {
68
- return 'NOT item.published.status:embargo'
66
+ return 'NOT item.published.status:embargo';
69
67
  }
70
68
 
71
69
  // Switch the 'term' attribute to 'label' if 'label' does not exist
72
- selectedFacetArray.forEach(f => {
73
- f.label = f.facet3 ? f.facet3 : f.facet2 ? f.facet2 : f.facet
74
- })
70
+ selectedFacetArray.forEach((f) => {
71
+ f.label = f.facet3 ? f.facet3 : f.facet2 ? f.facet2 : f.facet;
72
+ });
75
73
 
76
- let facets = removeShowAllFacets(selectedFacetArray)
74
+ let facets = removeShowAllFacets(selectedFacetArray);
77
75
  //Facet 3 Non specific is the same as facet.facet2 the subsubcategory
78
76
  facets.forEach((facet) => {
79
77
  if (facet.facet3) {
80
- if (facet.facet3 === "Non specific") {
81
- facet.label = facet.facet2
78
+ if (facet.facet3 === 'Non specific') {
79
+ facet.label = facet.facet2;
82
80
  }
83
81
  }
84
- })
82
+ });
85
83
 
86
- let filters = "NOT item.published.status:embargo";
84
+ let filters = 'NOT item.published.status:embargo';
87
85
  filters = `(${filters}) AND `;
88
- const facetPropPaths = facetPropPathMapping.map(
89
- (f) => [f.facetPropPath, f.facetFilterPath]
90
- );
86
+ const facetPropPaths = facetPropPathMapping.map((f) => [f.facetPropPath, f.facetFilterPath]);
91
87
  facetPropPaths.map(([facetPropPath, facetFilterPath]) => {
92
- let facetsToBool = facets.filter(
93
- (facet) => facet.facetPropPath == facetPropPath
94
- );
95
- let orFilters = "";
96
- let andFilters = "";
88
+ let facetsToBool = facets.filter((facet) => facet.facetPropPath == facetPropPath);
89
+ let orFilters = '';
90
+ let andFilters = '';
97
91
  facetsToBool.map((facet) => {
98
92
  // for customization
99
93
  // facetSubPropPath have the priority
100
- let facetPropPathToUse = facet.facetSubPropPath ?
101
- facet.facetSubPropPath : facetFilterPath ?
102
- facetFilterPath : facetPropPath
94
+ let facetPropPathToUse = facet.facetSubPropPath
95
+ ? facet.facetSubPropPath
96
+ : facetFilterPath
97
+ ? facetFilterPath
98
+ : facetPropPath;
103
99
  if (facet.AND) {
104
100
  andFilters += `AND "${facetPropPathToUse}":"${facet.label}"`;
105
101
  } else {
106
102
  orFilters += `"${facetPropPathToUse}":"${facet.label}" OR `;
107
103
  }
108
104
  });
109
- if (orFilters == "" && andFilters == "") {
105
+ if (orFilters == '' && andFilters == '') {
110
106
  return;
111
107
  }
112
- orFilters = `(${orFilters.substring(0, orFilters.lastIndexOf(" OR "))})` // remove last OR
108
+ orFilters = `(${orFilters.substring(0, orFilters.lastIndexOf(' OR '))})`; // remove last OR
113
109
 
114
110
  filters += `${orFilters + andFilters} AND `; // Put them together
115
111
  // (Note that we add an extra AND in case there are facets at a higher level)
116
112
 
117
113
  filters = filters.split('()AND ').join(''); // Handle case where there where no OR facets
118
114
  });
119
- return filters.substring(0, filters.lastIndexOf(" AND "));
115
+ return filters.substring(0, filters.lastIndexOf(' AND '));
120
116
  }
121
117
 
122
118
  function removeShowAllFacets(facetArray) {
123
- return facetArray.filter(f => f.label !== 'Show all')
119
+ return facetArray.filter((f) => f.label !== 'Show all');
124
120
  }
125
121
 
126
- export { removeShowAllFacets }
122
+ export { removeShowAllFacets };
@@ -1,15 +1,15 @@
1
1
  // Primary colors
2
- $purple: #8300BF;
3
- $darkBlue: #24245B;
2
+ $purple: #8300bf;
3
+ $darkBlue: #24245b;
4
4
  $grey: #303133;
5
5
 
6
6
  // Secondary colors
7
- $lightPurple: #BC00FC;
8
- $blue: #0026FF;
7
+ $lightPurple: #bc00fc;
8
+ $blue: #0026ff;
9
9
 
10
10
  // Status colors
11
11
  $success: #5e9f69;
12
- $warning: #FF8400;
12
+ $warning: #ff8400;
13
13
  $danger: #b51d09;
14
14
 
15
15
  // Text colors
@@ -18,12 +18,12 @@ $mediumGrey: #606266;
18
18
  $lightGrey: #909399;
19
19
 
20
20
  // Line colors
21
- $lineColor1: #DCDFE6;
22
- $lineColor2: #E4E7ED;
21
+ $lineColor1: #dcdfe6;
22
+ $lineColor2: #e4e7ed;
23
23
 
24
24
  // Background colors
25
- $background: #F5F7FA;
26
- $cochlear: #FFFFFF;
25
+ $background: #f5f7fa;
26
+ $cochlear: #ffffff;
27
27
 
28
28
  //Search box colors
29
29
  $darkGrey: #606266;
@@ -33,7 +33,9 @@ $app-secondary-color: $darkBlue;
33
33
  $text-color: $grey;
34
34
  $input-text: $grey;
35
35
 
36
- $system-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
36
+ $system-font:
37
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell,
38
+ 'Helvetica Neue', sans-serif !important;
37
39
  $font-family: 'Asap', sans-serif;
38
40
 
39
41
  // Viewport Sizes
@@ -7,5 +7,5 @@
7
7
  background: #e0e0e0;
8
8
  padding: 2px 4px;
9
9
  border-radius: 4px;
10
- font-size: .75rem !important;
10
+ font-size: 0.75rem !important;
11
11
  }
@@ -1,3 +1,2 @@
1
1
  @use 'variables' as *;
2
2
  @import url('https://fonts.googleapis.com/css?family=Asap:400,400i,500,600,700&display=swap');
3
-
@@ -1,4 +1,3 @@
1
-
2
1
  @use '_variables' as *;
3
2
  @forward '_variables';
4
3
 
@@ -29,7 +28,7 @@
29
28
  border-color: $app-primary-color !important;
30
29
  }
31
30
 
32
- &[data-popper-placement^=bottom] .el-popper__arrow:before {
31
+ &[data-popper-placement^='bottom'] .el-popper__arrow:before {
33
32
  border-bottom-color: transparent !important;
34
33
  border-right-color: transparent !important;
35
34
  }
@@ -19,21 +19,12 @@
19
19
  <el-row>
20
20
  <el-col :offset="1" :span="6">Delete this feature?</el-col>
21
21
  <el-col :offset="1" :span="3">
22
- <el-button
23
- class="delete-button"
24
- :icon="ElIconDelete"
25
- @click="$emit('confirm-delete')"
26
- >
27
- Delete
22
+ <el-button class="delete-button" :icon="ElIconDelete" @click="$emit('confirm-delete')">
23
+ Delete
28
24
  </el-button>
29
25
  </el-col>
30
26
  <el-col :offset="1" :span="2">
31
- <el-button
32
- class="delete-button"
33
- @click="$emit('cancel-create')"
34
- >
35
- Dismiss
36
- </el-button>
27
+ <el-button class="delete-button" @click="$emit('cancel-create')">Dismiss</el-button>
37
28
  </el-col>
38
29
  </el-row>
39
30
  </div>
@@ -43,27 +34,14 @@
43
34
  <script>
44
35
  import { shallowRef } from 'vue';
45
36
  import { AnnotationPopup, CreateTooltipContent } from '@abi-software/map-utilities';
37
+ import { Delete as ElIconDelete } from '@element-plus/icons-vue';
46
38
  import '@abi-software/map-utilities/dist/style.css';
47
- import {
48
- ElButton as Button,
49
- ElCol as Col,
50
- ElRow as Row,
51
- ElIcon as Icon,
52
- } from 'element-plus'
53
- import {
54
- Delete as ElIconDelete,
55
- } from '@element-plus/icons-vue'
56
39
 
57
40
  export default {
58
41
  name: 'AnnotationTool',
59
42
  components: {
60
43
  AnnotationPopup,
61
- Button,
62
44
  CreateTooltipContent,
63
- Col,
64
- ElIconDelete,
65
- Icon,
66
- Row,
67
45
  },
68
46
  props: {
69
47
  annotationEntry: {
@@ -71,8 +49,8 @@ export default {
71
49
  },
72
50
  createData: {
73
51
  type: Object,
74
- default: {},
75
- }
52
+ default: () => {},
53
+ },
76
54
  },
77
55
  data: function () {
78
56
  return {
@@ -80,7 +58,7 @@ export default {
80
58
  annotationPopupData: null,
81
59
  };
82
60
  },
83
- }
61
+ };
84
62
  </script>
85
63
 
86
64
  <style scoped lang="scss">
@@ -130,7 +108,7 @@ export default {
130
108
  .delete-button {
131
109
  pointer-events: auto;
132
110
  cursor: pointer;
133
- margin-left:8px;
111
+ margin-left: 8px;
134
112
  padding-left: 8px;
135
113
  padding-right: 8px;
136
114
  height: 24px !important;
@@ -144,5 +122,4 @@ export default {
144
122
  .create-container.create-tooltip-content {
145
123
  background-color: #f7faff;
146
124
  }
147
-
148
- </style>
125
+ </style>
@@ -8,19 +8,16 @@
8
8
  @click="categoryClicked(key)"
9
9
  size="small"
10
10
  :key="key"
11
- >{{ key + ' (' + item.size + ')' }}
11
+ >
12
+ {{ key + ' (' + item.size + ')' }}
12
13
  </el-button>
13
14
  </template>
14
15
  </div>
15
16
  </template>
16
17
 
17
18
  <script>
18
- /* eslint-disable no-alert, no-console */
19
- import { ElButton as Button } from 'element-plus'
20
-
21
19
  export default {
22
20
  name: 'BadgesGroup',
23
- components: { Button },
24
21
  props: {
25
22
  /**
26
23
  * Object containing information for
@@ -29,7 +26,7 @@ export default {
29
26
  additionalLinks: {
30
27
  type: Array,
31
28
  default: () => {
32
- return []
29
+ return [];
33
30
  },
34
31
  },
35
32
  displayDataset: {
@@ -43,7 +40,7 @@ export default {
43
40
  items: {
44
41
  type: Object,
45
42
  default: () => {
46
- return {}
43
+ return {};
47
44
  },
48
45
  },
49
46
  },
@@ -52,19 +49,19 @@ export default {
52
49
  //Always start with 1 image - the dataset thumbnail itself
53
50
  categories: { All: { size: 1 }, Dataset: { size: 1 } },
54
51
  active: 'All',
55
- }
52
+ };
56
53
  },
57
54
  methods: {
58
55
  addToCategories: function (name) {
59
- const array = this.items[name]
56
+ const array = this.items[name];
60
57
  if (array && array.length > 0) {
61
- this.categories[name] = { size: array.length }
62
- this.categories['All'].size += array.length
58
+ this.categories[name] = { size: array.length };
59
+ this.categories['All'].size += array.length;
63
60
  }
64
61
  },
65
62
  categoryClicked: function (name) {
66
- this.active = name
67
- this.$emit('categoryChanged', name)
63
+ this.active = name;
64
+ this.$emit('categoryChanged', name);
68
65
  },
69
66
  },
70
67
  watch: {
@@ -72,16 +69,16 @@ export default {
72
69
  deep: true,
73
70
  immediate: true,
74
71
  handler: function () {
75
- this.categories = {}
76
- this.active = "All"
72
+ this.categories = {};
73
+ this.active = 'All';
77
74
  if (this.displayDataset) {
78
- this.categories.All = { size: 1 }
79
- this.categories.Dataset = { size: 1 }
75
+ this.categories.All = { size: 1 };
76
+ this.categories.Dataset = { size: 1 };
80
77
  } else {
81
- this.categories.All = { size: 0 }
78
+ this.categories.All = { size: 0 };
82
79
  }
83
- let keys = ['Flatmaps', 'Plots', 'Scaffolds', 'Simulations']
84
- keys.forEach(key => this.addToCategories(key))
80
+ let keys = ['Flatmaps', 'Plots', 'Scaffolds', 'Simulations'];
81
+ keys.forEach((key) => this.addToCategories(key));
85
82
  /** disable the following
86
83
  this.addToCategories(this.entry.images, 'Images');
87
84
  this.addToCategories(this.entry.videos, 'Videos');
@@ -89,29 +86,29 @@ export default {
89
86
  },
90
87
  },
91
88
  },
92
- }
89
+ };
93
90
  </script>
94
91
 
95
92
  <style lang="scss" scoped>
96
93
  .container {
97
94
  .tag-button.el-button {
98
- border-radius: 4px!important;
99
- font-size: 0.75rem!important;
100
- padding: 0.2rem 0.2rem!important;
101
- margin: 0.5rem 0 0 0!important;
95
+ border-radius: 4px !important;
96
+ font-size: 0.75rem !important;
97
+ padding: 0.2rem 0.2rem !important;
98
+ margin: 0.5rem 0 0 0 !important;
102
99
  margin-right: 0.75rem !important;
103
- background: #f9f2fc!important;
104
- border: 1px solid $app-primary-color!important;
105
- color: $app-primary-color!important;
100
+ background: #f9f2fc !important;
101
+ border: 1px solid $app-primary-color !important;
102
+ color: $app-primary-color !important;
106
103
  &.active {
107
- background: $app-primary-color!important;
108
- border: 1px solid $app-primary-color!important;
109
- color: #fff!important;
104
+ background: $app-primary-color !important;
105
+ border: 1px solid $app-primary-color !important;
106
+ color: #fff !important;
110
107
  }
111
108
  }
112
109
 
113
110
  .tag-button + .tag-button {
114
- margin-left: 0!important;
111
+ margin-left: 0 !important;
115
112
  }
116
113
  }
117
114
  </style>