@abi-software/mapintegratedvuer 1.17.2 → 1.17.3-simulation.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.
Files changed (43) hide show
  1. package/dist/{ConnectivityGraph-BL4B9GZX.js → ConnectivityGraph-9pXPgFJR.js} +2 -2
  2. package/dist/{ContentMixin-Djmb_gqk.js → ContentMixin-DIqgKIz6.js} +279 -536
  3. package/dist/Flatmap-D7GVPV7o.js +103422 -0
  4. package/dist/{Iframe-ByYxT4Yq.js → Iframe-CCEA3d9c.js} +2 -2
  5. package/dist/{MultiFlatmap-DSkdlRiS.js → MultiFlatmap-Cuke1uNp.js} +3 -3
  6. package/dist/{Plot-ymkHVq_A.js → Plot-B4oTBVAT.js} +2 -2
  7. package/dist/{Scaffold-bw7posKm.js → Scaffold-Czz8X5kL.js} +79 -53
  8. package/dist/Simulation-BKmz8zwm.js +107 -0
  9. package/dist/{index-CwfUgFL1.js → index-_b4VBGHk.js} +30002 -25408
  10. package/dist/mapintegratedvuer.js +1 -1
  11. package/dist/mapintegratedvuer.umd.cjs +4291 -229
  12. package/dist/style-CM86xE3J.js +119 -0
  13. package/dist/style.css +1 -1
  14. package/package.json +10 -5
  15. package/src/App.vue +285 -258
  16. package/src/assets/styles.scss +1 -1
  17. package/src/components/ContextCard.vue +0 -1
  18. package/src/components/DummyRouteComponent.vue +1 -0
  19. package/src/components/EventBus.ts +13 -0
  20. package/src/components/FloatingWindow.vue +142 -0
  21. package/src/components/MapContent.vue +9 -4
  22. package/src/components/PlotComponent.vue +56 -0
  23. package/src/components/SplitDialog.vue +1 -6
  24. package/src/components/SplitFlow.vue +504 -444
  25. package/src/components/scripts/utilities.js +1 -1
  26. package/src/components/viewers/Flatmap.vue +166 -83
  27. package/src/components/viewers/Simulation.vue +118 -11
  28. package/src/components.d.ts +3 -0
  29. package/src/main.js +9 -3
  30. package/src/mixins/ContentMixin.js +467 -406
  31. package/src/mixins/DynamicMarkerMixin.js +50 -17
  32. package/src/services/mapping.js +69 -0
  33. package/src/services/testData.js +71 -0
  34. package/src/stores/entries.js +1 -1
  35. package/src/stores/mapping.js +29 -0
  36. package/src/stores/settings.js +4 -0
  37. package/src/stores/simulationPlotStore.js +124 -0
  38. package/src/stores/splitFlow.js +425 -352
  39. package/src/types/simulation.js +18 -0
  40. package/dist/Flatmap-uPEQNDkK.js +0 -202
  41. package/dist/Simulation-C_gdqDes.js +0 -28
  42. package/dist/style-Czqe2bTf.js +0 -57
  43. package/src/components/EventBus.js +0 -3
@@ -0,0 +1,119 @@
1
+ import { mapStores as l } from "pinia";
2
+ import { c as p } from "./index-_b4VBGHk.js";
3
+ import { markRaw as u } from "vue";
4
+ const f = (e, t) => new URL(e, t).href, m = async (e, t) => {
5
+ var r;
6
+ if (e && ((r = e.resource) != null && r.url)) {
7
+ const a = f(e.resource.url, t), o = await (await fetch(a)).json(), i = ["csv_file", "protocol", "thumbnail"];
8
+ return o.forEach((s) => {
9
+ i.forEach((c) => {
10
+ c in s && (s[c] = f(s[c], a));
11
+ });
12
+ }), o;
13
+ }
14
+ }, d = async (e, t) => {
15
+ if (e["simulation-protocols"]) {
16
+ const r = [];
17
+ for (const a of e["simulation-protocols"]) {
18
+ const n = await m(a, t);
19
+ n && r.push(...n);
20
+ }
21
+ return r;
22
+ }
23
+ }, h = async (e, t, r) => {
24
+ var n;
25
+ const a = [];
26
+ for (const o of t) {
27
+ let i = !1;
28
+ if (o.flatmaps)
29
+ for (const s of o.flatmaps)
30
+ ((n = s.associated_flatmap) == null ? void 0 : n.identifier) === e && (i = !0);
31
+ if (i) {
32
+ const s = await d(o, r);
33
+ s && a.push(...s);
34
+ }
35
+ }
36
+ return a;
37
+ }, g = async (e, t) => {
38
+ if (e) {
39
+ const a = await (await fetch(e)).json();
40
+ return await h(t, a, e);
41
+ }
42
+ }, k = function(e) {
43
+ return e ? [...new Set(e.map((t) => JSON.stringify(t)))].map(
44
+ (t) => JSON.parse(t)
45
+ ) : [];
46
+ }, M = {
47
+ computed: {
48
+ ...l(p)
49
+ },
50
+ data: function() {
51
+ return {
52
+ protocolData: void 0,
53
+ markerToUberonID: {}
54
+ };
55
+ },
56
+ methods: {
57
+ flatmapPanZoomCallback: function(e) {
58
+ if (this.mouseHovered) {
59
+ const t = {
60
+ paneIndex: this.entry.id,
61
+ eventType: "panZoom",
62
+ payload: e,
63
+ type: this.entry.type
64
+ };
65
+ this.$emit("resource-selected", t);
66
+ }
67
+ },
68
+ /**
69
+ * Function used for updating the flatmap markers.
70
+ * We set the markers based on what was searched and the flatmap clusters them.
71
+ */
72
+ flatmapMarkerUpdate(e) {
73
+ if (this.flatmapReady && !this.protocolData) {
74
+ let t = e;
75
+ if (t || (t = this.getFlatmapImp()), t) {
76
+ let r = this.settingsStore.globalSettings.displayMarkers ? this.settingsStore.markers : [];
77
+ r = k(r), t.clearMarkers(), t.clearDatasetMarkers(), t.addDatasetMarkers(r), this.entry.type === "MultiFlatmap" && this.restoreFeaturedMarkers(t);
78
+ }
79
+ }
80
+ },
81
+ // removeMarkersNotOnFlatmap: rewrites the dataset marker list to only include markers that are on the flatmap
82
+ removeMarkersNotOnFlatmap(e, t) {
83
+ let r = e.anatomicalIdentifiers, a = [];
84
+ for (let n = 0; n < t.length; n++) {
85
+ let o = t[n], i = { id: o.id, terms: [] };
86
+ for (let s = 0; s < o.terms.length; s++)
87
+ r.includes(o.terms[s]) && i.terms.push(o.terms[s]);
88
+ a.push(i);
89
+ }
90
+ return a;
91
+ },
92
+ updateProtocolMarkers: function(e, t) {
93
+ e.clearMarkers(), t.length > 0 && t.forEach((r) => {
94
+ const o = e.sparqlQuery(`
95
+ prefix bgf: <https://bg-rdf.org/ontologies/bondgraph-framework#>
96
+ prefix UBERON: <http://purl.obolibrary.org/obo/UBERON_>
97
+ select ?featureUri where {
98
+ ?featureUri bgf:hasLocation ?region
99
+ filter (?region in (${r}))
100
+ }`)[0].get("featureUri").value, i = e.addMarkerByFeatureUri(o);
101
+ this.markerToUberonID[i] = r;
102
+ });
103
+ },
104
+ flatmapReadyForMarkerUpdates: async function(e) {
105
+ if (e) {
106
+ e.enablePanZoomEvents(!0), this.flatmapReady = !0;
107
+ const t = e.mapImp;
108
+ if (t) {
109
+ const r = t.mapMetadata.uuid;
110
+ this.protocolData = u(await g(this.settingsStore.testDataLocation, r)), this.protocolData || this.flatmapMarkerUpdate(t);
111
+ }
112
+ }
113
+ }
114
+ }
115
+ };
116
+ export {
117
+ M as D,
118
+ g as r
119
+ };