@abi-software/map-utilities 1.5.0-beta.2 → 1.5.0-beta.3

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.5.0-beta.2",
3
+ "version": "1.5.0-beta.3",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
@@ -110,10 +110,8 @@
110
110
  </div>
111
111
  </div>
112
112
 
113
- <div v-if="connectivityError" class="connectivity-graph-error">
114
- <strong v-if="connectivityError.errorConnectivities">
115
- {{ connectivityError.errorConnectivities }}
116
- </strong>
113
+ <div v-show="connectivityError.errorConnectivities" class="connectivity-graph-error">
114
+ <strong>{{ connectivityError.errorConnectivities }}</strong>
117
115
  {{ connectivityError.errorMessage }}
118
116
  </div>
119
117
 
@@ -136,7 +134,6 @@ const ZOOM_IN_LABEL = 'Zoom in';
136
134
  const ZOOM_OUT_LABEL = 'Zoom out';
137
135
  const ZOOM_INCREMENT = 0.25;
138
136
  const APP_PRIMARY_COLOR = '#8300bf';
139
- const ERROR_TIMEOUT = 3000; // 3 seconds
140
137
 
141
138
  export default {
142
139
  name: 'ConnectivityGraph',
@@ -164,6 +161,10 @@ export default {
164
161
  type: Object,
165
162
  default: () => null,
166
163
  },
164
+ connectivityError: {
165
+ type: Object,
166
+ default: () => {},
167
+ }
167
168
  },
168
169
  data: function () {
169
170
  return {
@@ -183,8 +184,6 @@ export default {
183
184
  zoomOutLabel: ZOOM_OUT_LABEL,
184
185
  iconColor: APP_PRIMARY_COLOR,
185
186
  zoomEnabled: false,
186
- connectivityError: null,
187
- timeoutID: undefined,
188
187
  connectivityGraphContainer: null,
189
188
  };
190
189
  },
@@ -505,18 +504,7 @@ export default {
505
504
  this.zoomEnabled = !this.zoomEnabled;
506
505
  this.zoomLockLabel = this.zoomEnabled ? ZOOM_UNLOCK_LABEL : ZOOM_LOCK_LABEL;
507
506
  this.connectivityGraph.enableZoom(!this.zoomEnabled);
508
- },
509
- showErrorMessage: function (connectivityError) {
510
- this.connectivityError = {...connectivityError};
511
-
512
- if (this.timeoutID) {
513
- clearTimeout(this.timeoutID);
514
- }
515
-
516
- this.timeoutID = setTimeout(() => {
517
- this.connectivityError = null;
518
- }, ERROR_TIMEOUT);
519
- },
507
+ }
520
508
  },
521
509
  };
522
510
  </script>
@@ -26,13 +26,14 @@
26
26
  @mouseenter="onConnectivityHovered(origin)"
27
27
  @mouseleave="onConnectivityHovered()"
28
28
  >
29
- <span>{{ capitalise(origin) }}</span>
30
29
  <el-icon
31
- class="connectivity-search-icon"
30
+ class="magnify-glass"
31
+ v-show="shouldShowMagnifyGlass(origin)"
32
32
  @click="onConnectivityClicked(origin)"
33
33
  >
34
34
  <el-icon-search />
35
35
  </el-icon>
36
+ <span>{{ capitalise(origin) }}</span>
36
37
  </div>
37
38
  <el-button
38
39
  v-show="
@@ -61,13 +62,14 @@
61
62
  @mouseenter="onConnectivityHovered(component)"
62
63
  @mouseleave="onConnectivityHovered()"
63
64
  >
64
- <span>{{ capitalise(component) }}</span>
65
65
  <el-icon
66
- class="connectivity-search-icon"
66
+ class="magnify-glass"
67
+ v-show="shouldShowMagnifyGlass(component)"
67
68
  @click="onConnectivityClicked(component)"
68
69
  >
69
70
  <el-icon-search />
70
71
  </el-icon>
72
+ <span>{{ capitalise(component) }}</span>
71
73
  </div>
72
74
  </div>
73
75
  <div
@@ -98,13 +100,14 @@
98
100
  @mouseenter="onConnectivityHovered(destination)"
99
101
  @mouseleave="onConnectivityHovered()"
100
102
  >
101
- <span>{{ capitalise(destination) }}</span>
102
103
  <el-icon
103
- class="connectivity-search-icon"
104
+ class="magnify-glass"
105
+ v-show="shouldShowMagnifyGlass(destination)"
104
106
  @click="onConnectivityClicked(destination)"
105
107
  >
106
108
  <el-icon-search />
107
109
  </el-icon>
110
+ <span>{{ capitalise(destination) }}</span>
108
111
  </div>
109
112
  <el-button
110
113
  v-show="
@@ -135,10 +138,8 @@
135
138
  </div>
136
139
 
137
140
  <div class="connectivity-error-container">
138
- <div class="connectivity-error" v-if="connectivityError">
139
- <strong v-if="connectivityError.errorConnectivities">
140
- {{ connectivityError.errorConnectivities }}
141
- </strong>
141
+ <div class="connectivity-error" v-show="connectivityError.errorConnectivities">
142
+ <strong>{{ connectivityError.errorConnectivities }}</strong>
142
143
  {{ connectivityError.errorMessage }}
143
144
  </div>
144
145
  </div>
@@ -210,7 +211,7 @@ export default {
210
211
  },
211
212
  connectivityError: {
212
213
  type: Object,
213
- default: () => null,
214
+ default: () => {},
214
215
  }
215
216
  },
216
217
  data: function () {
@@ -220,7 +221,6 @@ export default {
220
221
  sensory: 'is the location of the initial cell body in the PNS circuit',
221
222
  },
222
223
  facetList: [],
223
- sckanVersion: '',
224
224
  }
225
225
  },
226
226
  watch: {
@@ -253,7 +253,17 @@ export default {
253
253
  this.$emit('connectivity-hovered', name);
254
254
  },
255
255
  onConnectivityClicked: function (name) {
256
- this.$emit('connectivity-clicked', name);
256
+ const connectivity = this.connectivityError.errorConnectivities;
257
+ // Remove the invalid term while searching
258
+ const label = connectivity
259
+ ? name.replace(new RegExp(`\\s*,?\\s*${connectivity}\\s*,?\\s*`, 'gi'), '').trim()
260
+ : name;
261
+ this.$emit('connectivity-clicked', label);
262
+ },
263
+ // shouldShowMagnifyGlass: Checks whether the hovered terms contain valid term or not
264
+ shouldShowMagnifyGlass: function (features) {
265
+ const connectivity = this.connectivityError.errorConnectivities;
266
+ return connectivity?.toLowerCase() !== features.toLowerCase();
257
267
  },
258
268
  // shouldShowExploreButton: Checks if the feature is in the list of available anatomy facets
259
269
  shouldShowExploreButton: function (features) {
@@ -368,25 +378,27 @@ export default {
368
378
  }
369
379
 
370
380
  .attribute-content {
371
- display: flex;
372
- justify-content: space-between;
373
381
  font-size: 14px;
374
382
  font-weight: 500;
375
383
  transition: color 0.25s ease;
376
384
  position: relative;
377
385
  cursor: default;
386
+ padding-left: 16px;
378
387
 
379
- .connectivity-search-icon {
388
+ .magnify-glass {
380
389
  display: none;
390
+ position: absolute;
391
+ top: 0;
392
+ left: 0;
381
393
  }
382
394
 
383
395
  &:hover {
384
396
  color: $app-primary-color;
385
397
 
386
- .connectivity-search-icon {
398
+ .magnify-glass {
399
+ display: block;
387
400
  padding-top: 4px;
388
401
  cursor: pointer;
389
- display: block;
390
402
  }
391
403
  }
392
404
 
package/vite.config.js CHANGED
@@ -38,10 +38,11 @@ export default defineConfig({
38
38
  fileName: "map-utilities",
39
39
  },
40
40
  rollupOptions: {
41
- external: ["vue"],
41
+ external: ["vue", "@element-plus/icons-vue"],
42
42
  output: {
43
43
  globals: {
44
44
  vue: "Vue",
45
+ "@element-plus/icons-vue": "@element-plus/icons-vue",
45
46
  },
46
47
  },
47
48
  },