@abi-software/map-side-bar 2.4.2-beta.6 → 2.4.2-beta.8

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.
@@ -45212,9 +45212,9 @@ ws.warnings = function(e) {
45212
45212
  };
45213
45213
  ws.version = ede;
45214
45214
  ws.stylesheet = ws.Stylesheet = Q_;
45215
- let tde = class {
45215
+ let tde = class extends EventTarget {
45216
45216
  constructor(e, t) {
45217
- ha(this, "cyg", null), ha(this, "nodes", []), ha(this, "edges", []), ha(this, "axons", []), ha(this, "dendrites", []), ha(this, "labelCache", /* @__PURE__ */ new Map()), ha(this, "graphCanvas", null), this.labelCache = e, this.graphCanvas = t;
45217
+ super(), ha(this, "cyg", null), ha(this, "nodes", []), ha(this, "edges", []), ha(this, "axons", []), ha(this, "dendrites", []), ha(this, "labelCache", /* @__PURE__ */ new Map()), ha(this, "graphCanvas", null), this.labelCache = e, this.graphCanvas = t;
45218
45218
  }
45219
45219
  async addConnectivity(e) {
45220
45220
  if (this.axons = e.axons.map((t) => JSON.stringify(t)), this.dendrites = e.dendrites.map((t) => JSON.stringify(t)), e.connectivity.length)
@@ -45233,7 +45233,12 @@ let tde = class {
45233
45233
  });
45234
45234
  }
45235
45235
  showConnectivity(e) {
45236
- this.cyg = new rde(this, e);
45236
+ this.cyg = new rde(this, e), this.cyg.on("tap-node", (t) => {
45237
+ const n = new CustomEvent("tap-node", {
45238
+ detail: t.detail
45239
+ });
45240
+ this.dispatchEvent(n);
45241
+ });
45237
45242
  }
45238
45243
  clearConnectivity() {
45239
45244
  var e;
@@ -45270,6 +45275,9 @@ let tde = class {
45270
45275
  };
45271
45276
  return this.axons.includes(t) ? this.dendrites.includes(t) ? o["both-a-d"] = !0 : o.axon = !0 : this.dendrites.includes(t) && (o.dendrite = !0), o;
45272
45277
  }
45278
+ on(e, t) {
45279
+ this.addEventListener(e, t);
45280
+ }
45273
45281
  };
45274
45282
  const nde = [
45275
45283
  {
@@ -45312,11 +45320,10 @@ const nde = [
45312
45320
  }
45313
45321
  }
45314
45322
  ];
45315
- class rde {
45323
+ class rde extends EventTarget {
45316
45324
  constructor(t, n) {
45317
- ha(this, "cy"), ha(this, "tooltip");
45318
45325
  var r;
45319
- this.cy = ws({
45326
+ super(), ha(this, "cy"), ha(this, "tooltip"), this.cy = ws({
45320
45327
  container: n,
45321
45328
  elements: t.elements,
45322
45329
  layout: {
@@ -45329,7 +45336,7 @@ class rde {
45329
45336
  minZoom: 0.5,
45330
45337
  maxZoom: 10,
45331
45338
  wheelSensitivity: 0.4
45332
- }).on("mouseover", "node", this.overNode.bind(this)).on("mouseout", "node", this.exitNode.bind(this)).on("position", "node", this.moveNode.bind(this)), this.tooltip = document.createElement("div"), this.tooltip.className = "cy-graph-tooltip", this.tooltip.hidden = !0, (r = n == null ? void 0 : n.lastChild) == null || r.appendChild(this.tooltip);
45339
+ }).on("mouseover", "node", this.overNode.bind(this)).on("mouseout", "node", this.exitNode.bind(this)).on("position", "node", this.moveNode.bind(this)).on("tap", "node", this.tapNode.bind(this)), this.tooltip = document.createElement("div"), this.tooltip.className = "cy-graph-tooltip", this.tooltip.hidden = !0, (r = n == null ? void 0 : n.lastChild) == null || r.appendChild(this.tooltip);
45333
45340
  }
45334
45341
  remove() {
45335
45342
  this.cy && this.cy.destroy();
@@ -45349,6 +45356,15 @@ class rde {
45349
45356
  exitNode(t) {
45350
45357
  this.tooltip.hidden = !0;
45351
45358
  }
45359
+ tapNode(t) {
45360
+ const n = t.target.data(), r = new CustomEvent("tap-node", {
45361
+ detail: n
45362
+ });
45363
+ this.dispatchEvent(r);
45364
+ }
45365
+ on(t, n) {
45366
+ this.addEventListener(t, n);
45367
+ }
45352
45368
  }
45353
45369
  const ode = 1.3, ade = 24 * 60 * 60 * 1e3, ide = "Reset position", hk = "Lock zoom (to scroll)", sde = "Unlock zoom", lde = "#8300bf", ude = {
45354
45370
  name: "ConnectivityGraph",
@@ -45423,7 +45439,11 @@ const ode = 1.3, ade = 24 * 60 * 60 * 1e3, ide = "Reset position", hk = "Lock zo
45423
45439
  },
45424
45440
  showGraph: async function(e) {
45425
45441
  const t = this.$refs.graphCanvas;
45426
- this.showSpinner(), this.connectivityGraph = new tde(this.labelCache, t), await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(e)), this.hideSpinner(), this.connectivityGraph.showConnectivity(t);
45442
+ this.showSpinner(), this.connectivityGraph = new tde(this.labelCache, t), await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(e)), this.hideSpinner(), this.connectivityGraph.showConnectivity(t), this.connectivityGraph.on("tap-node", (n) => {
45443
+ const { label: r } = n.detail, o = r.split(`
45444
+ `);
45445
+ this.$emit("tap-node", o);
45446
+ });
45427
45447
  },
45428
45448
  query: async function(e, t) {
45429
45449
  const n = `${this.mapServer}knowledge/query/`, r = { sql: e, params: t };
@@ -45530,7 +45550,7 @@ const ode = 1.3, ade = 24 * 60 * 60 * 1e3, ide = "Reset position", hk = "Lock zo
45530
45550
  }, cde = { class: "connectivity-graph" }, dde = {
45531
45551
  ref: "graphCanvas",
45532
45552
  class: "graph-canvas"
45533
- }, pde = { class: "control-panel" }, fde = /* @__PURE__ */ a8('<div class="node-key" data-v-ec98b14b><div class="key-head" data-v-ec98b14b>Node type:</div><div data-v-ec98b14b><div data-v-ec98b14b><span data-v-ec98b14b>Node:</span><span class="key-box" style="background:#80F0F0;" data-v-ec98b14b></span></div><div data-v-ec98b14b><span data-v-ec98b14b>Axon:</span><span class="key-box" style="background:green;" data-v-ec98b14b></span></div><div data-v-ec98b14b><span data-v-ec98b14b>Dendrite:</span><span class="key-box" style="background:red;" data-v-ec98b14b></span></div><div data-v-ec98b14b><span data-v-ec98b14b>Both:</span><span class="key-box" style="background:gray;" data-v-ec98b14b></span></div></div></div>', 1), hde = { class: "tools" }, vde = { class: "visually-hidden" }, gde = { class: "visually-hidden" };
45553
+ }, pde = { class: "control-panel" }, fde = /* @__PURE__ */ a8('<div class="node-key" data-v-d620c023><div class="key-head" data-v-d620c023>Node type:</div><div data-v-d620c023><div data-v-d620c023><span data-v-d620c023>Node:</span><span class="key-box" style="background:#80F0F0;" data-v-d620c023></span></div><div data-v-d620c023><span data-v-d620c023>Axon:</span><span class="key-box" style="background:green;" data-v-d620c023></span></div><div data-v-d620c023><span data-v-d620c023>Dendrite:</span><span class="key-box" style="background:red;" data-v-d620c023></span></div><div data-v-d620c023><span data-v-d620c023>Both:</span><span class="key-box" style="background:gray;" data-v-d620c023></span></div></div></div>', 1), hde = { class: "tools" }, vde = { class: "visually-hidden" }, gde = { class: "visually-hidden" };
45534
45554
  function mde(e, t, n, r, o, a) {
45535
45555
  const i = XY, s = yr, u = Xp, l = qc, c = uZ, d = dZ, f = dre;
45536
45556
  return ot((F(), j("div", cde, [
@@ -45594,7 +45614,7 @@ function mde(e, t, n, r, o, a) {
45594
45614
  [f, e.loading]
45595
45615
  ]);
45596
45616
  }
45597
- const yde = /* @__PURE__ */ FE(ude, [["render", mde], ["__scopeId", "data-v-ec98b14b"]]), bde = {
45617
+ const yde = /* @__PURE__ */ FE(ude, [["render", mde], ["__scopeId", "data-v-d620c023"]]), bde = {
45598
45618
  data() {
45599
45619
  return {
45600
45620
  ElIconView: iC
@@ -48799,6 +48819,9 @@ const jO = /* @__PURE__ */ oa(gpe, [["render", ype], ["__scopeId", "data-v-e726c
48799
48819
  behavior: "smooth"
48800
48820
  });
48801
48821
  },
48822
+ onTapNode: function(e) {
48823
+ this.$emit("connectivity-component-click", e);
48824
+ },
48802
48825
  getUpdateCopyContent: function() {
48803
48826
  var n, r, o, a, i;
48804
48827
  if (!this.entry)
@@ -48847,7 +48870,7 @@ const jO = /* @__PURE__ */ oa(gpe, [["render", ype], ["__scopeId", "data-v-e726c
48847
48870
  <br>`);
48848
48871
  }
48849
48872
  }
48850
- }, As = (e) => (Pl("data-v-7d824d63"), e = e(), Fl(), e), xpe = {
48873
+ }, As = (e) => (Pl("data-v-b0aeabe2"), e = e(), Fl(), e), xpe = {
48851
48874
  key: 0,
48852
48875
  class: "main"
48853
48876
  }, kpe = { class: "connectivity-info-title" }, Cpe = {
@@ -49099,14 +49122,15 @@ function efe(e, t, n, r, o, a) {
49099
49122
  Ce(p, {
49100
49123
  entry: n.entry.featureId[0],
49101
49124
  mapServer: n.envVars.FLATMAPAPI_LOCATION,
49125
+ onTapNode: a.onTapNode,
49102
49126
  ref: "connectivityGraphRef"
49103
- }, null, 8, ["entry", "mapServer"])
49127
+ }, null, 8, ["entry", "mapServer", "onTapNode"])
49104
49128
  ])
49105
49129
  ])), [
49106
49130
  [v, e.loading]
49107
49131
  ]) : oe("", !0);
49108
49132
  }
49109
- const HO = /* @__PURE__ */ oa(wpe, [["render", efe], ["__scopeId", "data-v-7d824d63"]]), tfe = {
49133
+ const HO = /* @__PURE__ */ oa(wpe, [["render", efe], ["__scopeId", "data-v-b0aeabe2"]]), tfe = {
49110
49134
  name: "Tabs",
49111
49135
  props: {
49112
49136
  tabTitles: {
@@ -49238,6 +49262,13 @@ const UO = /* @__PURE__ */ oa(tfe, [["render", sfe], ["__scopeId", "data-v-ed1ce
49238
49262
  showConnectivity: function(e) {
49239
49263
  this.$emit("show-connectivity", e);
49240
49264
  },
49265
+ /**
49266
+ * This function is triggered after a connectivity component is clicked.
49267
+ * @arg data
49268
+ */
49269
+ onConnectivityComponentClick: function(e) {
49270
+ this.$emit("connectivity-component-click", e);
49271
+ },
49241
49272
  /**
49242
49273
  * This event is emitted when the search filters are changed.
49243
49274
  * @arg `obj` {data, id}
@@ -49406,8 +49437,9 @@ function pfe(e, t, n, r, o, a) {
49406
49437
  envVars: n.envVars,
49407
49438
  ref_for: !0,
49408
49439
  ref: "connectivityTab_" + h.id,
49409
- onShowConnectivity: a.showConnectivity
49410
- }, null, 8, ["entry", "availableAnatomyFacets", "envVars", "onShowConnectivity"])) : oe("", !0)
49440
+ onShowConnectivity: a.showConnectivity,
49441
+ onConnectivityComponentClick: a.onConnectivityComponentClick
49442
+ }, null, 8, ["entry", "availableAnatomyFacets", "envVars", "onShowConnectivity", "onConnectivityComponentClick"])) : oe("", !0)
49411
49443
  ], 64)) : ot((F(), fe(d, {
49412
49444
  key: 1,
49413
49445
  class: "sidebar-content-container",
@@ -49428,7 +49460,7 @@ function pfe(e, t, n, r, o, a) {
49428
49460
  }, 8, ["modelValue"])
49429
49461
  ], 512);
49430
49462
  }
49431
- const vfe = /* @__PURE__ */ oa(lfe, [["render", pfe], ["__scopeId", "data-v-914d3512"]]);
49463
+ const vfe = /* @__PURE__ */ oa(lfe, [["render", pfe], ["__scopeId", "data-v-ee15e5f2"]]);
49432
49464
  export {
49433
49465
  vfe as SideBar
49434
49466
  };