@abi-software/mapintegratedvuer 1.14.1 → 1.15.1

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/mapintegratedvuer",
3
- "version": "1.14.1",
3
+ "version": "1.15.1",
4
4
  "license": "Apache-2.0",
5
5
  "scripts": {
6
6
  "serve": "vite --host --force",
@@ -52,9 +52,9 @@
52
52
  "*.js"
53
53
  ],
54
54
  "dependencies": {
55
- "@abi-software/flatmapvuer": "1.12.0",
56
- "@abi-software/map-side-bar": "2.11.3",
57
- "@abi-software/map-utilities": "1.7.6",
55
+ "@abi-software/flatmapvuer": "1.12.1",
56
+ "@abi-software/map-side-bar": "2.11.4",
57
+ "@abi-software/map-utilities": "1.7.7",
58
58
  "@abi-software/plotvuer": "1.0.7",
59
59
  "@abi-software/scaffoldvuer": "1.13.0",
60
60
  "@abi-software/simulationvuer": "2.0.20",
@@ -82,7 +82,7 @@
82
82
  "chai": "^4.1.2",
83
83
  "chokidar": "^3.6.0",
84
84
  "concurrently": "^8.2.2",
85
- "cypress": "^13.13.0",
85
+ "cypress": "^13.17.0",
86
86
  "cypress-multi-reporters": "^1.6.4",
87
87
  "cypress-visual-regression": "^5.2.2",
88
88
  "cypress-wait-until": "^1.7.1",
@@ -148,7 +148,10 @@ export default {
148
148
  hidePane: function(refName) {
149
149
  if (this.$refs && ('tabContainer' in this.$refs)) {
150
150
  const style = {};
151
- style["display"] = "none";
151
+ // style["display"] = "none";
152
+ style["visibility"] = "hidden";
153
+ style["pointer-events"] = "none";
154
+ style["opacity"] = "0";
152
155
  this.styles[refName] = style;
153
156
  }
154
157
  },
@@ -241,6 +244,65 @@ export default {
241
244
  });
242
245
  return ids;
243
246
  },
247
+ /**
248
+ * Search pathways by term with keyword matching.
249
+ *
250
+ * @param {Object} flatmap - The flatmap object
251
+ * @param {String} term - The search term to match against pathway IDs
252
+ * @returns {Array<String>} Array of pathway IDs that match the search criteria
253
+ *
254
+ * Search behavior:
255
+ * 1. Multi-segment search (contains delimiters like '-', ':', '_', '/', etc.):
256
+ * - Matches the entire pattern within pathway IDs
257
+ * - Example: "bolew-unbranched", "ilxtr:neuron", "unbranched-4"
258
+ *
259
+ * 2. Short single term (< 3 characters):
260
+ * - Only matches exact segments between delimiters
261
+ * - Example: "on" will NOT match "neuron" but would match "ilxtr:on:something"
262
+ *
263
+ * 3. Long single term (≥ 3 characters):
264
+ * - Matches exact segments OR partial matches within meaningful segments
265
+ * - Example: "bolew", "unbranched", "neuron" match their respective segments
266
+ */
267
+ searchPathwaysByTerm: function (flatmap, term) {
268
+ const pathwayModels = flatmap.mapImp.pathways?.models;
269
+ if (!pathwayModels || !term) return [];
270
+
271
+ const searchTerm = term.toLowerCase();
272
+ const minTermLength = 3;
273
+ const hasDelimiters = /[-_:\s\/]+/.test(searchTerm);
274
+
275
+ if (hasDelimiters) {
276
+ return pathwayModels
277
+ .filter((pathway) => {
278
+ const pathwayId = pathway.id?.toLowerCase() || '';
279
+ return pathwayId.includes(searchTerm);
280
+ })
281
+ .map(pathway => pathway.id);
282
+ }
283
+
284
+ if (searchTerm.length < minTermLength) {
285
+ return pathwayModels
286
+ .filter((pathway) => {
287
+ const pathwayId = pathway.id?.toLowerCase() || '';
288
+ const segments = pathwayId.split(/[-_:\s\/]+/);
289
+ return segments.includes(searchTerm);
290
+ })
291
+ .map(pathway => pathway.id);
292
+ }
293
+
294
+ return pathwayModels
295
+ .filter((pathway) => {
296
+ const pathwayId = pathway.id?.toLowerCase() || '';
297
+ const segments = pathwayId.split(/[-_:\s\/]+/);
298
+
299
+ return segments.some(segment =>
300
+ segment === searchTerm ||
301
+ (segment.length >= minTermLength && segment.includes(searchTerm))
302
+ );
303
+ })
304
+ .map(pathway => pathway.id);
305
+ },
244
306
  getFlatmapSearchedId: function (flatmap, term) {
245
307
  const ids = [];
246
308
  const searchResult = flatmap.mapImp.search(term);
@@ -272,6 +334,12 @@ export default {
272
334
  const flatmapUUID = latestFlatmap.uuid;
273
335
  return flatmapUUID;
274
336
  },
337
+ parseSearchTerms: function (query) {
338
+ return query
339
+ .split(",")
340
+ .map(term => term.trim().replace(/["']/g, ""))
341
+ .filter(term => term);
342
+ },
275
343
  connectivityQueryFilter: async function (data) {
276
344
  this.query = "";
277
345
  this.filter = [];
@@ -316,16 +384,19 @@ export default {
316
384
  this.query = data.query;
317
385
  // get query search result ids and order
318
386
  if (data.query) {
319
- const searchTerms = this.query
320
- .replace(/["']/g, "")
321
- .split(",")
322
- .map(term => term.trim())
323
- .filter(term => term);
387
+ const searchTerms = this.parseSearchTerms(this.query);
324
388
  const nestedIds = [];
325
389
  for (let index = 0; index < searchTerms.length; index++) {
326
- isFlatmap ?
327
- nestedIds.push(this.getFlatmapSearchedId(currentMap, searchTerms[index])) :
328
- nestedIds.push(this.getGeneralSearchedId(results, searchTerms[index], 'query'));
390
+ const term = searchTerms[index];
391
+ const searchResult = isFlatmap ?
392
+ this.getFlatmapSearchedId(currentMap, term) :
393
+ this.getGeneralSearchedId(results, term, 'query');
394
+ nestedIds.push(searchResult);
395
+ // search if the term is a part of a pathway
396
+ if (isFlatmap) {
397
+ const pathwayIdsFromTerm = this.searchPathwaysByTerm(currentMap, term);
398
+ nestedIds.push(...pathwayIdsFromTerm);
399
+ }
329
400
  }
330
401
  // within query search (split terms by comma) -> OR
331
402
  const flatIds = [...new Set(nestedIds.flat())];
@@ -668,15 +739,24 @@ export default {
668
739
 
669
740
  .contentvuer {
670
741
  position: absolute;
671
- transition: all 1s ease;
742
+ transition: opacity 0s, visibility 0s, left 1s ease, top 1s ease, width 1s ease, height 1s ease;
672
743
  background: rgba(255, 255, 255, 1);
744
+ visibility: visible;
745
+ opacity: 1;
673
746
 
674
747
  &.inactive {
675
- display: none;
676
- width: 0%;
677
- height: 0%;
678
- left: 0px;
679
- top: 30px;
748
+ // display: none;
749
+ // width: 0%;
750
+ // height: 0%;
751
+ // left: 0px;
752
+ // top: 30px;
753
+ visibility: hidden;
754
+ pointer-events: none;
755
+ opacity: 0;
756
+
757
+ canvas {
758
+ display: none;
759
+ }
680
760
  }
681
761
  }
682
762
  </style>