@abi-software/map-side-bar 2.4.2-beta.7 → 2.4.2-beta.9
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/dist/map-side-bar.js +41 -17
- package/dist/map-side-bar.umd.cjs +6 -5
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/map-side-bar.js
CHANGED
|
@@ -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 };
|
|
@@ -45492,15 +45512,19 @@ const ode = 1.3, ade = 24 * 60 * 60 * 1e3, ide = "Reset position", hk = "Lock zo
|
|
|
45492
45512
|
getCachedTermLabels: async function() {
|
|
45493
45513
|
if (this.labelledTerms.size) {
|
|
45494
45514
|
const e = await this.query(
|
|
45495
|
-
`
|
|
45496
|
-
|
|
45497
|
-
|
|
45515
|
+
`select entity, knowledge from knowledge
|
|
45516
|
+
where entity in (?${", ?".repeat(this.labelledTerms.size - 1)})
|
|
45517
|
+
order by source desc`,
|
|
45498
45518
|
[...this.labelledTerms.values()]
|
|
45499
45519
|
);
|
|
45500
|
-
|
|
45501
|
-
|
|
45502
|
-
|
|
45503
|
-
|
|
45520
|
+
let t = null;
|
|
45521
|
+
for (const [r, o] of e.values)
|
|
45522
|
+
if (r !== t) {
|
|
45523
|
+
const a = JSON.parse(o);
|
|
45524
|
+
this.labelCache.set(r, a.label || r), t = r;
|
|
45525
|
+
}
|
|
45526
|
+
const n = Object.fromEntries(this.labelCache);
|
|
45527
|
+
sessionStorage.setItem("connectivity-graph-labels", JSON.stringify(n)), this.updateCacheExpiry();
|
|
45504
45528
|
}
|
|
45505
45529
|
},
|
|
45506
45530
|
cacheNodeLabels: function(e) {
|
|
@@ -45530,7 +45554,7 @@ const ode = 1.3, ade = 24 * 60 * 60 * 1e3, ide = "Reset position", hk = "Lock zo
|
|
|
45530
45554
|
}, cde = { class: "connectivity-graph" }, dde = {
|
|
45531
45555
|
ref: "graphCanvas",
|
|
45532
45556
|
class: "graph-canvas"
|
|
45533
|
-
}, pde = { class: "control-panel" }, fde = /* @__PURE__ */ a8('<div class="node-key" data-v-
|
|
45557
|
+
}, pde = { class: "control-panel" }, fde = /* @__PURE__ */ a8('<div class="node-key" data-v-528570f4><div class="key-head" data-v-528570f4>Node type:</div><div data-v-528570f4><div data-v-528570f4><span data-v-528570f4>Node:</span><span class="key-box" style="background:#80F0F0;" data-v-528570f4></span></div><div data-v-528570f4><span data-v-528570f4>Axon:</span><span class="key-box" style="background:green;" data-v-528570f4></span></div><div data-v-528570f4><span data-v-528570f4>Dendrite:</span><span class="key-box" style="background:red;" data-v-528570f4></span></div><div data-v-528570f4><span data-v-528570f4>Both:</span><span class="key-box" style="background:gray;" data-v-528570f4></span></div></div></div>', 1), hde = { class: "tools" }, vde = { class: "visually-hidden" }, gde = { class: "visually-hidden" };
|
|
45534
45558
|
function mde(e, t, n, r, o, a) {
|
|
45535
45559
|
const i = XY, s = yr, u = Xp, l = qc, c = uZ, d = dZ, f = dre;
|
|
45536
45560
|
return ot((F(), j("div", cde, [
|
|
@@ -45594,7 +45618,7 @@ function mde(e, t, n, r, o, a) {
|
|
|
45594
45618
|
[f, e.loading]
|
|
45595
45619
|
]);
|
|
45596
45620
|
}
|
|
45597
|
-
const yde = /* @__PURE__ */ FE(ude, [["render", mde], ["__scopeId", "data-v-
|
|
45621
|
+
const yde = /* @__PURE__ */ FE(ude, [["render", mde], ["__scopeId", "data-v-528570f4"]]), bde = {
|
|
45598
45622
|
data() {
|
|
45599
45623
|
return {
|
|
45600
45624
|
ElIconView: iC
|