@abi-software/flatmapvuer 1.20.0 → 1.20.1-demo.0

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.
@@ -9002,7 +9002,63 @@ var q_ = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), J_ = (e) => {
9002
9002
  }
9003
9003
  return o;
9004
9004
  });
9005
- })))()), Z_ = Ie, Q_ = Re("main", {
9005
+ })))()), Z_ = Ie, Q_ = "#1b7f6b", $_ = "#f4f1de", ev = "#12312b", tv = "99+", nv = function(e) {
9006
+ return (Array.isArray(e) ? e : []).map((e) => ({
9007
+ label: String(e?.label || "").trim(),
9008
+ curie: String(e?.curie || "").trim(),
9009
+ count: Number(e?.count || 0)
9010
+ })).filter((e) => e.curie && e.count > 0);
9011
+ }, rv = function(e) {
9012
+ return e > 99 ? tv : String(e);
9013
+ }, iv = function(e) {
9014
+ let t = document.createElement("div");
9015
+ return t.className = "flatmapvuer-soma-location-marker", t.title = e.label || e.curie, t.style.width = "34px", t.style.height = "48px", t.style.display = "flex", t.style.alignItems = "center", t.style.justifyContent = "center", t.style.transform = "translate(-50%, -100%)", t.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 27 42" width="34" height="48" aria-hidden="true">
9016
+ <ellipse style="fill: rgb(0, 0, 0); fill-opacity: 0.18;" cx="12" cy="36" rx="8" ry="4"/>
9017
+ <path d="M12.25.25a12.254 12.254 0 0 0-12 12.494
9018
+ c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0
9019
+ C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z"
9020
+ style="fill:${Q_};stroke:${$_};stroke-width:1.1"/>
9021
+ <circle cx="12.5" cy="12.5" r="8" fill="${$_}"/>
9022
+ <text x="12.5" y="16.1" text-anchor="middle" style="font-size:7.5px;font-weight:700;fill:${ev};font-family:Arial, sans-serif">${rv(e.count)}</text>
9023
+ </svg>`, t;
9024
+ }, av = function(e, t) {
9025
+ let n = Array.isArray(e?.modelFeatureIds?.(t)) ? e.modelFeatureIds(t) : [], r = [], i = /* @__PURE__ */ new Set();
9026
+ for (let t of n) {
9027
+ let n = e.annotation(t), a = String(n?.uri || "").trim();
9028
+ a && !i.has(a) && (i.add(a), r.push({
9029
+ type: "feature-uri",
9030
+ value: a
9031
+ }));
9032
+ }
9033
+ return !r.length && n.length && r.push({
9034
+ type: "model",
9035
+ value: t
9036
+ }), r;
9037
+ }, ov = function(e) {
9038
+ if (!e || e.addSomaLocationMarkers) return e;
9039
+ let t = [];
9040
+ return e.clearSomaLocationMarkers = function() {
9041
+ t.forEach((t) => {
9042
+ e.removeMarker(t);
9043
+ }), t = [];
9044
+ }, e.addSomaLocationMarkers = function(n) {
9045
+ let r = nv(n), i = [];
9046
+ return e.clearSomaLocationMarkers(), r.forEach((n) => {
9047
+ let r = av(e, n.curie);
9048
+ if (!r.length) return;
9049
+ let a = !1;
9050
+ r.forEach((r) => {
9051
+ let i = iv(n), o = [];
9052
+ if (r.type === "feature-uri") o = e.addMarkerByFeatureUri(r.value, { element: i });
9053
+ else if (r.type === "model") {
9054
+ let t = e.addMarker(r.value, { element: i });
9055
+ o = t > -1 ? [t] : [];
9056
+ }
9057
+ o.length && (t.push(...o), a = !0);
9058
+ }), a && i.push(n);
9059
+ }), i;
9060
+ }, e;
9061
+ }, sv = Re("main", {
9006
9062
  state: () => ({ userProfile: { token: "" } }),
9007
9063
  getters: { userToken(e) {
9008
9064
  return e.userProfile.token;
@@ -9013,7 +9069,7 @@ var q_ = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), J_ = (e) => {
9013
9069
  });
9014
9070
  //#endregion
9015
9071
  //#region node_modules/mitt/dist/mitt.mjs
9016
- function $_(e) {
9072
+ function cv(e) {
9017
9073
  return {
9018
9074
  all: e ||= /* @__PURE__ */ new Map(),
9019
9075
  on: function(t, n) {
@@ -9036,7 +9092,7 @@ function $_(e) {
9036
9092
  }
9037
9093
  //#endregion
9038
9094
  //#region src/components/EventBus.js
9039
- var ev = new $_(), tv = "cannot be found on the map.", nv = (e) => {
9095
+ var lv = new cv(), uv = "cannot be found on the map.", dv = (e) => {
9040
9096
  let t = {
9041
9097
  lng: 0,
9042
9098
  lat: 0
@@ -9044,17 +9100,17 @@ var ev = new $_(), tv = "cannot be found on the map.", nv = (e) => {
9044
9100
  return e.type === "Polygon" ? e.coordinates.length && (n = e.coordinates[0]) : n = e.coordinates, n && (e.type === "Point" ? (t.lng += parseFloat(n[0]), t.lat += parseFloat(n[1])) : (n.map((e) => {
9045
9101
  t.lng += parseFloat(e[0]), t.lat += parseFloat(e[1]);
9046
9102
  }), t.lng /= n.length, t.lat /= n.length)), t;
9047
- }, rv = (e, t) => {
9103
+ }, fv = (e, t) => {
9048
9104
  let n = [], r = e.organs ? e.organs : e.ftus, i = r ? r.filter((e, t) => r.findIndex((t) => t.label === e.label) === t) : void 0;
9049
9105
  return i && i.forEach((e) => {
9050
9106
  let r = {
9051
9107
  label: e.label,
9052
9108
  models: e.models,
9053
9109
  key: `${t}.${e.label}`
9054
- }, i = rv(e, r.key);
9110
+ }, i = fv(e, r.key);
9055
9111
  i.length > 0 && (r.children = i), n.push(r);
9056
9112
  }), n;
9057
- }, iv = {
9113
+ }, pv = {
9058
9114
  name: "FlatmapVuer",
9059
9115
  components: {
9060
9116
  MapSvgIcon: Oe,
@@ -9230,7 +9286,7 @@ var ev = new $_(), tv = "cannot be found on the map.", nv = (e) => {
9230
9286
  enabled: e.enabled,
9231
9287
  label: e.id,
9232
9288
  key: e.id
9233
- }, r = rv(e, n.key);
9289
+ }, r = fv(e, n.key);
9234
9290
  r.length > 0 && (n.children = r), t.children.push(n);
9235
9291
  }), this.systems.push(t);
9236
9292
  }
@@ -9536,7 +9592,7 @@ var ev = new $_(), tv = "cannot be found on the map.", nv = (e) => {
9536
9592
  emitConnectivityError: function(e) {
9537
9593
  this.$emit("connectivity-error", { data: {
9538
9594
  errorData: e,
9539
- errorMessage: tv
9595
+ errorMessage: uv
9540
9596
  } });
9541
9597
  },
9542
9598
  checkConnectivityTooltipEntry: function(e) {
@@ -9560,7 +9616,7 @@ var ev = new $_(), tv = "cannot be found on the map.", nv = (e) => {
9560
9616
  featureId: e.featureId ? e.featureId : e.feature?.id,
9561
9617
  offline: this.offlineAnnotationEnabled
9562
9618
  });
9563
- }), t[0].feature) this.activeDrawTool || this.activeDrawMode || this.isValidDrawnCreated ? (this.featureAnnotationSubmitted = !1, this.activeDrawTool && this.createConnectivityBody(), this.displayTooltip(t[0].feature.id, nv(t[0].feature.geometry))) : this.rollbackAnnotationEvent();
9619
+ }), t[0].feature) this.activeDrawTool || this.activeDrawMode || this.isValidDrawnCreated ? (this.featureAnnotationSubmitted = !1, this.activeDrawTool && this.createConnectivityBody(), this.displayTooltip(t[0].feature.id, dv(t[0].feature.geometry))) : this.rollbackAnnotationEvent();
9564
9620
  else {
9565
9621
  let e = this.annotationEntry.filter((e) => e.featureId && e.models).map((e) => e.models);
9566
9622
  e.length > 0 && this.displayTooltip(e);
@@ -9795,7 +9851,7 @@ var ev = new $_(), tv = "cannot be found on the map.", nv = (e) => {
9795
9851
  container: this.$refs.display,
9796
9852
  tooltipDelay: 15
9797
9853
  }).then((t) => {
9798
- this.mapImp = t, this.serverURL = this.mapImp.makeServerUrl("").slice(0, -1);
9854
+ this.mapImp = ov(t), this.serverURL = this.mapImp.makeServerUrl("").slice(0, -1);
9799
9855
  let n = this.mapImp.details.version;
9800
9856
  this.setFlightPathInfo(n);
9801
9857
  let r = this._stateToBeSet ? this._stateToBeSet : e;
@@ -9930,7 +9986,7 @@ var ev = new $_(), tv = "cannot be found on the map.", nv = (e) => {
9930
9986
  return this.mapImp ? this.mapImp.search(e) : [];
9931
9987
  },
9932
9988
  onActionClick: function(e) {
9933
- ev.emit("onActionClick", e);
9989
+ lv.emit("onActionClick", e);
9934
9990
  },
9935
9991
  setConnectionType: function(e) {
9936
9992
  this.connectionType = e;
@@ -10288,7 +10344,7 @@ var ev = new $_(), tv = "cannot be found on the map.", nv = (e) => {
10288
10344
  };
10289
10345
  },
10290
10346
  computed: {
10291
- ...ze(Q_, ["userToken"]),
10347
+ ...ze(sv, ["userToken"]),
10292
10348
  isValidDrawnCreated: function() {
10293
10349
  return Object.keys(this.drawnCreatedEvent).length > 0;
10294
10350
  },
@@ -10381,39 +10437,39 @@ var ev = new $_(), tv = "cannot be found on the map.", nv = (e) => {
10381
10437
  beforeUnmount: function() {
10382
10438
  this.tooltipObserver &&= (this.tooltipObserver.disconnect(), null);
10383
10439
  }
10384
- }, av = {
10440
+ }, mv = {
10385
10441
  class: "flatmap-container",
10386
10442
  ref: "flatmapContainer",
10387
10443
  "element-loading-text": "Loading...",
10388
10444
  "element-loading-background": "rgba(0, 0, 0, 0.3)"
10389
- }, ov = { style: {
10445
+ }, hv = { style: {
10390
10446
  height: "100%",
10391
10447
  width: "100%",
10392
10448
  position: "relative",
10393
10449
  "overflow-y": "none"
10394
- } }, sv = {
10450
+ } }, gv = {
10395
10451
  style: {
10396
10452
  height: "100%",
10397
10453
  width: "100%"
10398
10454
  },
10399
10455
  ref: "display",
10400
10456
  class: "flatmap-display"
10401
- }, cv = { class: "beta-popovers" }, lv = {
10457
+ }, _v = { class: "beta-popovers" }, vv = {
10402
10458
  key: 2,
10403
10459
  class: "warning-text"
10404
- }, uv = { class: "bottom-right-control" }, dv = ["innerHTML"], fv = { style: { "margin-bottom": "2px" } }, pv = {
10460
+ }, yv = { class: "bottom-right-control" }, bv = ["innerHTML"], xv = { style: { "margin-bottom": "2px" } }, Sv = {
10405
10461
  key: 0,
10406
10462
  class: "viewing-mode-title"
10407
- }, mv = ["onClick"], hv = ["onClick"];
10408
- function gv(e, n, r, i, a, o) {
10463
+ }, Cv = ["onClick"], wv = ["onClick"];
10464
+ function Tv(e, n, r, i, a, o) {
10409
10465
  let s = L("map-svg-sprite-color"), f = A_, h = De, g = Mf, _ = Wg, v = ye, y = L("DrawToolbar"), b = L("map-svg-icon"), x = x_, S = L("tree-controls"), C = u_, w = be, D = fh, O = Pg, k = Fg, ee = Yh, A = Jh, j = kg, te = Ag, ne = L("Tooltip"), N = Ug, re = t_;
10410
- return U((M(), u("div", av, [m(s), d("div", ov, [
10411
- d("div", sv, null, 512),
10466
+ return U((M(), u("div", mv, [m(s), d("div", hv, [
10467
+ d("div", gv, null, 512),
10412
10468
  e.flatmapError ? (M(), c(f, {
10413
10469
  key: 0,
10414
10470
  flatmapError: e.flatmapError
10415
10471
  }, null, 8, ["flatmapError"])) : l("", !0),
10416
- U(d("div", cv, [d("div", null, [r.displayWarning || r.isLegacy ? (M(), c(_, {
10472
+ U(d("div", _v, [d("div", null, [r.displayWarning || r.isLegacy ? (M(), c(_, {
10417
10473
  key: 0,
10418
10474
  placement: "right",
10419
10475
  "popper-class": "warning-popper flatmap-popper",
@@ -10431,7 +10487,7 @@ function gv(e, n, r, i, a, o) {
10431
10487
  })) : l("", !0), r.isLegacy ? (M(), u(t, { key: 1 }, [n[31] ||= d("span", { class: "warning-text" }, "Legacy Map", -1), d("div", {
10432
10488
  class: "latest-map-text",
10433
10489
  onClick: n[6] ||= (...e) => o.viewLatestMap && o.viewLatestMap(...e)
10434
- }, " Click here for the latest map ")], 64)) : r.displayWarning ? (M(), u("span", lv, "Beta")) : l("", !0)], 32)]),
10490
+ }, " Click here for the latest map ")], 64)) : r.displayWarning ? (M(), u("span", vv, "Beta")) : l("", !0)], 32)]),
10435
10491
  default: H(() => [r.isLegacy ? (M(), u("p", {
10436
10492
  key: 0,
10437
10493
  onMouseover: n[0] ||= (e) => o.showTooltip(7),
@@ -10541,7 +10597,7 @@ function gv(e, n, r, i, a, o) {
10541
10597
  "onShowTooltip",
10542
10598
  "onHideTooltip"
10543
10599
  ])) : l("", !0),
10544
- U(d("div", uv, [
10600
+ U(d("div", yv, [
10545
10601
  m(_, {
10546
10602
  content: "Zoom in",
10547
10603
  placement: "left",
@@ -10655,7 +10711,7 @@ function gv(e, n, r, i, a, o) {
10655
10711
  reference: H(() => [U(d("div", {
10656
10712
  class: "flatmap-marker-help",
10657
10713
  innerHTML: e.flatmapMarker
10658
- }, null, 8, dv), [[ge, e.hoverVisibilities[0].value], [
10714
+ }, null, 8, bv), [[ge, e.hoverVisibilities[0].value], [
10659
10715
  N,
10660
10716
  void 0,
10661
10717
  "markerPopover"
@@ -10795,11 +10851,11 @@ function gv(e, n, r, i, a, o) {
10795
10851
  }),
10796
10852
  m(O, { class: "backgroundControl" }, {
10797
10853
  default: H(() => [
10798
- d("div", fv, [(M(!0), u(t, null, F(e.viewingModes, (n, r) => (M(), u(t, { key: r }, [r === e.viewingMode ? (M(), u("span", pv, [d("b", null, R(r), 1)])) : (M(), u("span", {
10854
+ d("div", xv, [(M(!0), u(t, null, F(e.viewingModes, (n, r) => (M(), u(t, { key: r }, [r === e.viewingMode ? (M(), u("span", Sv, [d("b", null, R(r), 1)])) : (M(), u("span", {
10799
10855
  key: 1,
10800
10856
  class: "viewing-mode-unselected",
10801
10857
  onClick: (e) => o.changeViewingMode(r)
10802
- }, R(r), 9, mv))], 64))), 128))]),
10858
+ }, R(r), 9, Cv))], 64))), 128))]),
10803
10859
  m(O, { class: "viewing-mode-description" }, {
10804
10860
  default: H(() => [p(R(o.modeDescription), 1)]),
10805
10861
  _: 1
@@ -10937,7 +10993,7 @@ function gv(e, n, r, i, a, o) {
10937
10993
  t == e.currentBackground ? "active" : ""
10938
10994
  ]),
10939
10995
  onClick: (e) => o.backgroundChangeCallback(t)
10940
- }, null, 10, hv))), 128))]),
10996
+ }, null, 10, wv))), 128))]),
10941
10997
  _: 1
10942
10998
  })
10943
10999
  ])]),
@@ -11009,22 +11065,22 @@ function gv(e, n, r, i, a, o) {
11009
11065
  ])) : l("", !0)
11010
11066
  ])])), [[re, e.loading]]);
11011
11067
  }
11012
- var _v = /*#__PURE__*/ n_(iv, [["render", gv], ["__scopeId", "data-v-5d2365bc"]]), vv = {
11068
+ var Ev = /*#__PURE__*/ n_(pv, [["render", Tv], ["__scopeId", "data-v-d2e5e646"]]), Dv = {
11013
11069
  "NCBITaxon:10114": "01fedbf9-d783-509c-a10c-827941ab13da",
11014
11070
  "NCBITaxon:9823": "a336ac04-24db-561f-a25f-1c994fe17410",
11015
11071
  "NCBITaxon:9606": "42ed6323-f645-5fbe-bada-9581819cf689",
11016
11072
  "NCBITaxon:10090": "25285fab-48a0-5620-a6a0-f9a0374837d5",
11017
11073
  "NCBITaxon:9685": "73060497-46a6-52bf-b975-cac511c127cb"
11018
- }, yv = {
11074
+ }, Ov = {
11019
11075
  name: "MultiFlatmapVuer",
11020
- components: { FlatmapVuer: _v },
11076
+ components: { FlatmapVuer: Ev },
11021
11077
  created: function() {
11022
11078
  this.loadMapManager();
11023
11079
  },
11024
11080
  mounted: function() {
11025
- this.initialise(), ev.on("onActionClick", (e) => {
11081
+ this.initialise(), lv.on("onActionClick", (e) => {
11026
11082
  this.resourceSelected(e);
11027
- }), ev.on("open-pubmed-url", (e) => {
11083
+ }), lv.on("open-pubmed-url", (e) => {
11028
11084
  this.$emit("open-pubmed-url", e);
11029
11085
  });
11030
11086
  },
@@ -11172,7 +11228,7 @@ var _v = /*#__PURE__*/ n_(iv, [["render", gv], ["__scopeId", "data-v-5d2365bc"]]
11172
11228
  let n = e.state;
11173
11229
  if (!n.uuid) {
11174
11230
  if (n.entry) {
11175
- let r = n.entry in vv ? vv[n.entry] : void 0;
11231
+ let r = n.entry in Dv ? Dv[n.entry] : void 0;
11176
11232
  t(this.createLegacyEntry(e, n.entry, r) || e);
11177
11233
  }
11178
11234
  } else if (n.entry) return new Promise(() => {
@@ -11382,23 +11438,23 @@ var _v = /*#__PURE__*/ n_(iv, [["render", gv], ["__scopeId", "data-v-5d2365bc"]]
11382
11438
  t && this.$refs[t][0].forceContextLoss();
11383
11439
  } }
11384
11440
  }
11385
- }, bv = {
11441
+ }, kv = {
11386
11442
  class: "multi-container",
11387
11443
  ref: "multiContainer"
11388
- }, xv = {
11444
+ }, Av = {
11389
11445
  key: 0,
11390
11446
  style: {
11391
11447
  position: "absolute",
11392
11448
  "z-index": "100"
11393
11449
  }
11394
- }, Sv = { class: "option-label" }, Cv = { class: "option-title" }, wv = { class: "select-box-icon" }, Tv = {
11450
+ }, jv = { class: "option-label" }, Mv = { class: "option-title" }, Nv = { class: "select-box-icon" }, Pv = {
11395
11451
  key: 1,
11396
11452
  class: "option-title active-species"
11397
- }, Ev = { class: "select-box-icon" }, Dv = ["aria-label", "onClick"];
11398
- function Ov(e, n, r, i, a, o) {
11399
- let s = am, f = Yh, h = Jh, g = Wg, _ = _v, v = A_;
11400
- return M(), u("div", bv, [
11401
- r.disableUI ? l("", !0) : (M(), u("div", xv, [n[3] ||= d("div", { class: "species-display-text" }, "Species", -1), m(g, {
11453
+ }, Fv = { class: "select-box-icon" }, Iv = ["aria-label", "onClick"];
11454
+ function Lv(e, n, r, i, a, o) {
11455
+ let s = am, f = Yh, h = Jh, g = Wg, _ = Ev, v = A_;
11456
+ return M(), u("div", kv, [
11457
+ r.disableUI ? l("", !0) : (M(), u("div", Av, [n[3] ||= d("div", { class: "species-display-text" }, "Species", -1), m(g, {
11402
11458
  content: "Select a species",
11403
11459
  placement: "right",
11404
11460
  trigger: "manual",
@@ -11424,7 +11480,7 @@ function Ov(e, n, r, i, a, o) {
11424
11480
  label: i,
11425
11481
  value: i
11426
11482
  }, {
11427
- default: H(() => [d("span", Sv, [e.activeSpecies === i ? (M(), u("span", Tv, [d("span", Ev, [d("i", { class: T(t.iconClass) }, null, 2)]), p(" " + R(i), 1)])) : (M(), c(s, {
11483
+ default: H(() => [d("span", jv, [e.activeSpecies === i ? (M(), u("span", Pv, [d("span", Fv, [d("i", { class: T(t.iconClass) }, null, 2)]), p(" " + R(i), 1)])) : (M(), c(s, {
11428
11484
  key: 0,
11429
11485
  content: `Change species to ${i}`,
11430
11486
  placement: "top",
@@ -11432,7 +11488,7 @@ function Ov(e, n, r, i, a, o) {
11432
11488
  "show-after": 200,
11433
11489
  "popper-class": "flatmap-species-option-tooltip"
11434
11490
  }, {
11435
- default: H(() => [d("span", Cv, [d("span", wv, [d("i", { class: T(t.iconClass) }, null, 2)]), p(" " + R(i), 1)])]),
11491
+ default: H(() => [d("span", Mv, [d("span", Nv, [d("i", { class: T(t.iconClass) }, null, 2)]), p(" " + R(i), 1)])]),
11436
11492
  _: 2
11437
11493
  }, 1032, ["content"])), r.enableOpenMapUI ? (M(), c(s, {
11438
11494
  key: 2,
@@ -11467,7 +11523,7 @@ function Ov(e, n, r, i, a, o) {
11467
11523
  }),
11468
11524
  d("path", { d: "M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3" }),
11469
11525
  d("path", { d: "M14.5 11.5v6M11.5 14.5h6" })
11470
- ], -1)]], 8, Dv)]),
11526
+ ], -1)]], 8, Iv)]),
11471
11527
  _: 2
11472
11528
  }, 1032, ["content"])) : l("", !0)])]),
11473
11529
  _: 2
@@ -11533,6 +11589,6 @@ function Ov(e, n, r, i, a, o) {
11533
11589
  }, null, 8, ["flatmapError"])) : l("", !0)
11534
11590
  ], 512);
11535
11591
  }
11536
- var kv = /*#__PURE__*/ n_(yv, [["render", Ov], ["__scopeId", "data-v-c3226113"]]);
11592
+ var Rv = /*#__PURE__*/ n_(Ov, [["render", Lv], ["__scopeId", "data-v-c3226113"]]);
11537
11593
  //#endregion
11538
- export { _v as FlatmapVuer, kv as MultiFlatmapVuer };
11594
+ export { Ev as FlatmapVuer, Rv as MultiFlatmapVuer };