@abi-software/flatmapvuer 1.8.3-beta.0 → 1.8.3-beta.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/flatmapvuer",
3
- "version": "1.8.3-beta.0",
3
+ "version": "1.8.3-beta.1",
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": "3.2.13",
47
- "@abi-software/map-utilities": "^1.4.3-beta.0",
47
+ "@abi-software/map-utilities": "^1.4.3-beta.2",
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",
@@ -75,6 +75,24 @@ const inArray = function (ar1, ar2) {
75
75
  return as1.indexOf(as2) !== -1
76
76
  }
77
77
 
78
+ const compareNames = (a, b) => {
79
+ // to make it work for both string name and obj.name
80
+ const _nameA = a.name ?? a;
81
+ const _nameB = b.name ?? b;
82
+ const nameA = _nameA.toUpperCase();
83
+ const nameB = _nameB.toUpperCase();
84
+
85
+ if (nameA < nameB) {
86
+ return -1;
87
+ }
88
+
89
+ if (nameA > nameB) {
90
+ return 1;
91
+ }
92
+
93
+ return 0;
94
+ }
95
+
78
96
  let FlatmapQueries = function () {
79
97
  this.initialise = function (flatmapApi) {
80
98
  this.flatmapApi = flatmapApi
@@ -427,13 +445,13 @@ let FlatmapQueries = function () {
427
445
  // Filter for the anatomy which is annotated on datasets
428
446
  this.originsWithDatasets = this.uberons.filter(
429
447
  (ub) => dendritesFlat.indexOf(ub.id) !== -1
430
- )
448
+ ).sort(compareNames);
431
449
  this.componentsWithDatasets = this.uberons.filter(
432
450
  (ub) => componentsFlat.indexOf(ub.id) !== -1
433
- )
451
+ ).sort(compareNames);
434
452
  this.destinationsWithDatasets = this.uberons.filter(
435
453
  (ub) => axonsFlat.indexOf(ub.id) !== -1
436
- )
454
+ ).sort(compareNames);
437
455
  }
438
456
 
439
457
  this.processConnectivity = function (mapImp, connectivity) {
@@ -472,13 +490,13 @@ let FlatmapQueries = function () {
472
490
  this.createLabelLookup(mapImp, conIds).then((lookUp) => {
473
491
  this.origins = dendrites.map((d) =>
474
492
  this.createLabelFromNeuralNode(d, lookUp)
475
- )
493
+ ).sort(compareNames);
476
494
  this.components = components.map((c) =>
477
495
  this.createLabelFromNeuralNode(c, lookUp)
478
- )
496
+ ).sort(compareNames);
479
497
  this.destinations = axons.map((a) =>
480
498
  this.createLabelFromNeuralNode(a, lookUp)
481
- )
499
+ ).sort(compareNames);
482
500
  this.flattenAndFindDatasets(dendrites, components, axons)
483
501
  resolve({
484
502
  ids: {