@abi-software/flatmapvuer 1.8.1-beta.1 → 1.8.1-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.
@@ -99269,33 +99269,30 @@ const QGt = TGt("main", {
99269
99269
  * @public
99270
99270
  * Function to highlight the connected paths
99271
99271
  * by providing path model identifier, ``pathId`` or ``anatomicalId``.
99272
- * @arg {string | string[]} `pathId` (string) or `anatomicalId` (array)
99272
+ * @arg {string} `pathId` or `anatomicalId`
99273
99273
  */
99274
99274
  retrieveConnectedPaths: async function(t, e = {}) {
99275
99275
  var r, n, i, o, s;
99276
99276
  if (this.mapImp) {
99277
99277
  let a = [], u = (r = e.target) != null && r.length ? e.target : [];
99278
- if (typeof t == "string") {
99279
- const d = [...this.mapImp.pathModelNodes(t)];
99278
+ const d = [...this.mapImp.pathModelNodes(t)], T = await this.mapImp.queryPathsForFeatures(t);
99279
+ if (d.length) {
99280
99280
  if (!u.length) {
99281
- const T = (n = e.type) != null && n.length ? e.type : ["all"], f = await this.flatmapQueries.queryForConnectivityNew(this.mapImp, [t]), Q = (i = f == null ? void 0 : f.ids) == null ? void 0 : i.dendrites.flat(1 / 0), y = (o = f == null ? void 0 : f.ids) == null ? void 0 : o.components.flat(1 / 0), _ = (s = f == null ? void 0 : f.ids) == null ? void 0 : s.axons.flat(1 / 0);
99282
- let L = [];
99283
- T.includes("origins") && L.push(...Q), T.includes("components") && L.push(...y), T.includes("destinations") && L.push(..._), T.includes("all") && L.push(...Q, ...y, ..._), u = [...new Set(L)];
99284
- }
99285
- d.forEach((T) => {
99286
- this.mapImp.nodePathModels(T).forEach((Q) => {
99287
- const _ = this.mapImp.pathModelNodes(Q).map((E) => this.mapImp.featureProperties(E).models);
99288
- u.filter((E) => _.includes(E)).length && !a.includes(Q) && a.push(Q);
99281
+ const f = (n = e.type) != null && n.length ? e.type : ["all"], Q = await this.flatmapQueries.queryForConnectivityNew(this.mapImp, t), y = (i = Q == null ? void 0 : Q.ids) == null ? void 0 : i.dendrites.flat(1 / 0), _ = (o = Q == null ? void 0 : Q.ids) == null ? void 0 : o.components.flat(1 / 0), L = (s = Q == null ? void 0 : Q.ids) == null ? void 0 : s.axons.flat(1 / 0);
99282
+ let E = [];
99283
+ f.includes("origins") && E.push(...y), f.includes("components") && E.push(..._), f.includes("destinations") && E.push(...L), f.includes("all") && E.push(...y, ..._, ...L), u = [...new Set(E)];
99284
+ }
99285
+ d.forEach((f) => {
99286
+ this.mapImp.nodePathModels(f).forEach((y) => {
99287
+ const L = this.mapImp.pathModelNodes(y).map((x) => this.mapImp.featureProperties(x).models);
99288
+ u.filter((x) => L.includes(x)).length && !a.includes(y) && a.push(y);
99289
99289
  });
99290
- }), a = [...a, t];
99291
- } else if (Array.isArray(t)) {
99292
- const d = await this.mapImp.queryPathsForFeatures(t);
99293
- u.length ? d.forEach((T) => {
99294
- const Q = this.mapImp.pathModelNodes(T).map((_) => this.mapImp.featureProperties(_).models);
99295
- u.filter((_) => Q.includes(_)).length && !a.includes(T) && a.push(T);
99296
- }) : a = d, a = [...a, ...t];
99297
- }
99298
- return a = [...new Set(a)], a;
99290
+ });
99291
+ } else T.length && (u.length ? T.forEach((f) => {
99292
+ const y = this.mapImp.pathModelNodes(f).map((L) => this.mapImp.featureProperties(L).models);
99293
+ u.filter((L) => y.includes(L)).length && !a.includes(f) && a.push(f);
99294
+ }) : a = T);
99295
+ return a = [.../* @__PURE__ */ new Set([...a, ...t])], a;
99299
99296
  }
99300
99297
  },
99301
99298
  resetMapFilter: function() {
@@ -99665,7 +99662,7 @@ const QGt = TGt("main", {
99665
99662
  )) : this.rollbackAnnotationEvent())) : this.annotation = {};
99666
99663
  else {
99667
99664
  let e = await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp, t);
99668
- i4t(this.mapImp, this.flatmapQueries), (e && e[0] || t.feature.hyperlinks && t.feature.hyperlinks.length > 0) && (this.resourceForTooltip = t.resource[0], t.resourceForTooltip = this.resourceForTooltip, this.createTooltipFromNeuronCuration(t));
99665
+ i4t(this.mapImp, this.flatmapQueries), e && e[0] || t.feature.hyperlinks && t.feature.hyperlinks.length > 0 ? (this.resourceForTooltip = t.resource[0], t.resourceForTooltip = this.resourceForTooltip, this.createTooltipFromNeuronCuration(t)) : this.createTooltipFromEntityCuration(t);
99669
99666
  }
99670
99667
  },
99671
99668
  /**
@@ -99694,6 +99691,30 @@ const QGt = TGt("main", {
99694
99691
  createTooltipFromNeuronCuration: async function(t) {
99695
99692
  this.tooltipEntry = await this.flatmapQueries.createTooltipData(this.mapImp, t), this.displayTooltip(t.resource[0]);
99696
99693
  },
99694
+ /**
99695
+ * @public
99696
+ * Function to create tooltip from Entity Curation ``data``.
99697
+ * @arg {Object} `data`
99698
+ */
99699
+ createTooltipFromEntityCuration: async function(t) {
99700
+ this.tooltipEntry = await this.flatmapQueries.createTooltipData(this.mapImp, t);
99701
+ let e = [], r = [], n = [];
99702
+ const i = await this.mapImp.queryPathsForFeatures(t.resource);
99703
+ i.length && (i.forEach((o) => {
99704
+ e.push(...this.mapImp.pathModelNodes(o));
99705
+ }), e = [...new Set(e)].filter((o) => o !== t.feature.featureId), e.forEach((o) => {
99706
+ const s = this.mapImp.featureProperties(o);
99707
+ r.includes(s.label) || (r.push(s.label), n.push({ id: s.models, name: s.label }));
99708
+ }), this.tooltipEntry = {
99709
+ ...this.tooltipEntry,
99710
+ origins: [t.label],
99711
+ originsWithDatasets: [{ id: t.resource[0], name: t.label }],
99712
+ components: [],
99713
+ componentsWithDatasets: [],
99714
+ destinations: r,
99715
+ destinationsWithDatasets: n
99716
+ }, this.displayTooltip(t.resource[0]));
99717
+ },
99697
99718
  /**
99698
99719
  * @public
99699
99720
  * Function to show popup on map.
@@ -101207,7 +101228,7 @@ function IGt(t, e, r, n, i, o) {
101207
101228
  [ct, t.loading]
101208
101229
  ]);
101209
101230
  }
101210
- const RY = /* @__PURE__ */ og(vGt, [["render", IGt], ["__scopeId", "data-v-87ff3315"]]);
101231
+ const RY = /* @__PURE__ */ og(vGt, [["render", IGt], ["__scopeId", "data-v-524f9008"]]);
101211
101232
  function kGt(t) {
101212
101233
  return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) {
101213
101234
  var n = t.get(e);