@abi-software/mapintegratedvuer 1.17.3-simulation.2 → 1.17.4

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 (47) hide show
  1. package/dist/{ConnectivityGraph-9pXPgFJR.js → ConnectivityGraph-CNtSLKGZ.js} +19 -21
  2. package/dist/{ContentMixin-DIqgKIz6.js → ContentMixin-BImmmP1E.js} +521 -295
  3. package/dist/Flatmap-CakK_75H.js +202 -0
  4. package/dist/{Iframe-CCEA3d9c.js → Iframe-C7E9XJu7.js} +2 -2
  5. package/dist/{MultiFlatmap-Cuke1uNp.js → MultiFlatmap-DnDXuvTw.js} +3 -3
  6. package/dist/{Plot-B4oTBVAT.js → Plot-CxCj3uTj.js} +2 -2
  7. package/dist/Scaffold-D1NyLNzW.js +304 -0
  8. package/dist/Simulation-Br3Grrd6.js +28 -0
  9. package/dist/{index-_b4VBGHk.js → index-qyfmiqHe.js} +22862 -27602
  10. package/dist/mapintegratedvuer.js +1 -1
  11. package/dist/mapintegratedvuer.umd.cjs +232 -4291
  12. package/dist/style-DezYtA61.js +57 -0
  13. package/dist/style.css +1 -1
  14. package/package.json +5 -10
  15. package/src/App.vue +258 -285
  16. package/src/assets/styles.scss +1 -1
  17. package/src/components/ContextCard.vue +1 -0
  18. package/src/components/EventBus.js +3 -0
  19. package/src/components/MapContent.vue +4 -9
  20. package/src/components/SplitDialog.vue +6 -2
  21. package/src/components/SplitFlow.vue +445 -504
  22. package/src/components/scripts/utilities.js +1 -1
  23. package/src/components/viewers/ConnectivityGraph.vue +1 -9
  24. package/src/components/viewers/Flatmap.vue +83 -166
  25. package/src/components/viewers/Scaffold.vue +130 -78
  26. package/src/components/viewers/Simulation.vue +11 -118
  27. package/src/components.d.ts +0 -3
  28. package/src/main.js +3 -9
  29. package/src/mixins/ContentMixin.js +384 -496
  30. package/src/mixins/DynamicMarkerMixin.js +17 -50
  31. package/src/stores/connectivities.js +10 -1
  32. package/src/stores/entries.js +1 -1
  33. package/src/stores/settings.js +0 -4
  34. package/src/stores/splitFlow.js +352 -425
  35. package/dist/Flatmap-D7GVPV7o.js +0 -103422
  36. package/dist/Scaffold-Czz8X5kL.js +0 -310
  37. package/dist/Simulation-BKmz8zwm.js +0 -107
  38. package/dist/style-CM86xE3J.js +0 -119
  39. package/src/components/DummyRouteComponent.vue +0 -1
  40. package/src/components/EventBus.ts +0 -13
  41. package/src/components/FloatingWindow.vue +0 -142
  42. package/src/components/PlotComponent.vue +0 -56
  43. package/src/services/mapping.js +0 -69
  44. package/src/services/testData.js +0 -71
  45. package/src/stores/mapping.js +0 -29
  46. package/src/stores/simulationPlotStore.js +0 -124
  47. package/src/types/simulation.js +0 -18
@@ -1,310 +0,0 @@
1
- import { _ as p, z as m, E as c } from "./index-_b4VBGHk.js";
2
- import { C as v } from "./ContentMixin-DIqgKIz6.js";
3
- import { ScaffoldVuer as w } from "@abi-software/scaffoldvuer";
4
- import { resolveComponent as u, openBlock as g, createElementBlock as y, createVNode as b, createBlock as S, createCommentVNode as M } from "vue";
5
- async function k(e) {
6
- const t = sessionStorage.getItem("flatmap-knowledge");
7
- if (t) {
8
- const i = JSON.parse(t).filter((s) => s.references && s.references.length).filter((s) => s.references.includes(e));
9
- if (i.length)
10
- return i.map((l) => l.id);
11
- }
12
- return [];
13
- }
14
- async function I(e, t, n) {
15
- const i = `select knowledge from knowledge
16
- where source="${N(e)}" and
17
- knowledge like "%${t}%" order by source desc`;
18
- return (await n.queryKnowledge(i)).map((a) => JSON.parse(a)).map((a) => a.id);
19
- }
20
- function N(e) {
21
- return $(e.mapMetadata);
22
- }
23
- function $(e) {
24
- let t = "";
25
- if (e != null && e.connectivity) {
26
- const n = e.connectivity;
27
- "knowledge-source" in n ? t = n["knowledge-source"] : "npo" in n && (t = `${n.npo.release}-npo`);
28
- }
29
- return t;
30
- }
31
- const C = {
32
- name: "Scaffold",
33
- mixins: [v],
34
- components: {
35
- ScaffoldVuer: w,
36
- HelpModeDialog: m
37
- },
38
- methods: {
39
- showConnectivitiesByReference: async function(e) {
40
- const t = sessionStorage.getItem("flatmap-knowledge");
41
- let n = [];
42
- t ? n = await k(e) : n = await I(this.flatmapService.mapImp, e, this.flatmapService.flatmapQueries);
43
- const o = [];
44
- for (const i of n) {
45
- const s = this.nervesKnowledge.find((r) => r.id === i);
46
- if (!s) continue;
47
- const l = s["nerve-label"];
48
- if (l) {
49
- const r = l.flatMap((a) => a.subNerves);
50
- o.push(...r);
51
- }
52
- }
53
- this.$refs.scaffold.changeHighlightedByName(o, "", !1);
54
- },
55
- setNerveGreyScale: function() {
56
- if (this.nervesKnowledge.length) {
57
- const t = this.nervesKnowledge.reduce((n, o) => n.concat(o["nerve-label"] || []), []).reduce((n, o) => n.concat(o.subNerves || []), []);
58
- this.$refs.scaffold.setGreyScale(!0, t);
59
- }
60
- },
61
- setVisibilityFilter: function(e) {
62
- let t = [];
63
- const n = !!e;
64
- if (e) {
65
- const o = [];
66
- e.OR.forEach((i) => {
67
- "AND" in i && i.AND.length >= 2 && "models" in i.AND[1] && o.push(...i.AND[1].models);
68
- });
69
- for (const i of o) {
70
- const s = this.nervesKnowledge.find((l) => l.id === i);
71
- if (s) {
72
- const l = s["nerve-label"].map((r) => r.subNerves).flat(1 / 0);
73
- t.push(...l);
74
- }
75
- }
76
- }
77
- this.$refs.scaffold.zoomToNerves(t, n);
78
- },
79
- syncFilter: function(e) {
80
- this.$refs.scaffold.viewingMode === "Neuron Connection" && (this.filter = e.filter((t) => {
81
- var n;
82
- return ((n = t.facet) == null ? void 0 : n.toLowerCase()) !== "show all";
83
- }));
84
- },
85
- scaffoldResourceSelected: async function(e, t) {
86
- if (this.resourceSelected(e, t, !0), t.length === 1) {
87
- if (this.clickedObject = t[0].data, this.clickedObject.isNerves || this.clickedObject.anatomicalId) {
88
- const n = this.clickedObject.id.toLowerCase();
89
- if (this.$refs.scaffold.viewingMode === "Neuron Connection") {
90
- const o = this.settingsStore.globalSettings.connectionType;
91
- if (this.clickedObject.isNerves)
92
- this.filter.push({
93
- facet: n,
94
- term: "Nerves",
95
- facetPropPath: "scaffold.connectivity.nerve"
96
- });
97
- else {
98
- const i = o.toLowerCase();
99
- let s = this.clickedObject.anatomicalId || "";
100
- if (s)
101
- this.filter.push({
102
- facet: `["${s}",[]]`,
103
- facetPropPath: `flatmap.connectivity.source.${i}`,
104
- tagLabel: n.charAt(0).toUpperCase() + n.slice(1),
105
- term: o
106
- });
107
- else {
108
- const r = this.connectivitiesStore.filterOptions[this.entry.resource].find((f) => f.key === `flatmap.connectivity.source.${i}`);
109
- let a;
110
- r == null || r.children.forEach((f) => {
111
- var d;
112
- f.label.toLowerCase() === n && (a = f), (d = f.children) == null || d.forEach((h) => {
113
- h.label.toLowerCase() === n && (a = h);
114
- });
115
- }), a && (s = a.key.replace(`flatmap.connectivity.source.${i}.`, ""), this.filter.push({
116
- facet: s,
117
- facetPropPath: `flatmap.connectivity.source.${i}`,
118
- tagLabel: a.tagLabel,
119
- term: o
120
- }));
121
- }
122
- }
123
- c.emit("neuron-connection-feature-click", {
124
- filters: this.filter,
125
- search: this.filter.length ? "" : n
126
- });
127
- } else if (this.$refs.scaffold.viewingMode === "Exploration") {
128
- const o = this.nervesKnowledge.filter((i) => JSON.stringify(i["nerve-label"]).includes(n));
129
- o.length && this.getKnowledgeTooltip({ data: o, type: this.entry });
130
- }
131
- }
132
- } else t.length > 1 ? this.$refs.scaffold.viewingMode === "Exploration" && this.clickedObject && this.$refs.scaffold.$module.setIgnorePicking(!1) : (this.clickedObject = void 0, c.emit("connectivity-info-close"));
133
- },
134
- onResize: function() {
135
- this.scaffoldCamera.onResize();
136
- },
137
- getState: function() {
138
- return this.$refs.scaffold.getState();
139
- },
140
- /**
141
- * Perform a local search on this contentvuer
142
- */
143
- search: function(e) {
144
- return this.$refs.scaffold.search(e, !0);
145
- },
146
- searchSuggestions: function(e, t) {
147
- if (e === "" || !this.$refs.scaffold)
148
- return t;
149
- this.$refs.scaffold.fetchSuggestions(e).forEach((o) => {
150
- o.suggestion && t.push(o.suggestion);
151
- });
152
- },
153
- showConnectivityTooltips: function(e) {
154
- if (e.label)
155
- this.$refs.scaffold.changeHighlightedByName([e.label], "", !1), this.$refs.scaffold.showRegionTooltip(e.label, !1, !1);
156
- else {
157
- const t = e.connectivityInfo["nerve-label"];
158
- if (t) {
159
- const n = t.flatMap((o) => o.subNerves);
160
- this.$refs.scaffold.changeHighlightedByName(n, "", !1);
161
- }
162
- this.$refs.scaffold.hideRegionTooltip();
163
- }
164
- },
165
- zoomToFeatures: function(e, t) {
166
- let n;
167
- Array.isArray(e) ? n = e : n = [e.name], t && this.$refs.scaffold.changeActiveByName(n, "", !1), this.$refs.scaffold.viewRegion(n);
168
- },
169
- scaffoldIsReady: function() {
170
- this.scaffoldLoaded = !0, this.$refs.scaffold.$module.graphicsHighlight.highlightColour = [1, 0, 1], this.visible && this.entry.rotation && this.entry.rotation, this.updateViewerSettings(), c.emit("mapLoaded", this.$refs.scaffold), setTimeout(() => {
171
- this.setNerveGreyScale();
172
- }, 500);
173
- },
174
- /**
175
- * Callback when the vuers emit a selected event.
176
- */
177
- scaffoldHighlighted: function(e, t) {
178
- var o, i, s;
179
- const n = {
180
- paneIndex: this.entry.id,
181
- type: e,
182
- resource: t,
183
- internalName: void 0
184
- };
185
- t && t[0] && ((((o = t[0].data) == null ? void 0 : o.id) === void 0 || ((i = t[0].data) == null ? void 0 : i.id) === "") && (t[0].data.id = (s = t[0].data) == null ? void 0 : s.group), n.internalName = t[0].data.id, n.eventType = "highlighted"), this.$emit("resource-selected", n);
186
- },
187
- /**
188
- * Callback when the vuers emit a selected event.
189
- */
190
- scaffoldNavigated: function(e, t) {
191
- if (this.mouseHovered) {
192
- const n = {
193
- paneIndex: this.entry.id,
194
- eventType: "panZoom",
195
- payload: t,
196
- type: e
197
- };
198
- this.$emit("resource-selected", n);
199
- }
200
- },
201
- updateWithViewUrl: function(e) {
202
- this.$refs.scaffold.updateViewURL(e);
203
- },
204
- /**
205
- * Change the view mode of the current scaffold
206
- */
207
- changeViewingMode: function(e) {
208
- this.$refs.scaffold.changeViewingMode(e);
209
- },
210
- updateViewerSettings: function() {
211
- const {
212
- backgroundDisplay: e,
213
- organsDisplay: t,
214
- outlinesDisplay: n,
215
- viewingMode: o
216
- } = this.settingsStore.globalSettings;
217
- this.$refs.scaffold.backgroundChangeCallback(e), this.$refs.scaffold.changeViewingMode(o), this.$refs.scaffold.setColour(t), this.$refs.scaffold.setOutlines(n);
218
- }
219
- },
220
- computed: {
221
- warningMessage: function() {
222
- return this.entry.discoverId === "307" || this.entry.discoverId === 307 ? "This map displays the anatomical location and connectivity of nerves, through which the neuron populations from the ApiNATOMY models available in SCKAN can be routed." : "Under active development";
223
- },
224
- markerLabels: function() {
225
- return this.settingsStore.globalSettings.displayMarkers ? this.settingsStore.numberOfDatasetsForFacets : {};
226
- }
227
- },
228
- watch: {
229
- connectivityKnowledge: {
230
- handler(e, t) {
231
- if (this.entry.resource in e) {
232
- const n = e[this.entry.resource];
233
- n.length !== this.nervesKnowledge.length && (this.nervesKnowledge = n, this.scaffoldLoaded && this.setNerveGreyScale());
234
- }
235
- },
236
- deep: !0,
237
- immediate: !0
238
- }
239
- },
240
- data: function() {
241
- return {
242
- apiLocation: process.env.VUE_APP_API_LOCATION,
243
- scaffoldCamera: void 0,
244
- scaffoldLoaded: !1,
245
- nervesKnowledge: [],
246
- clickedObject: void 0,
247
- filter: [],
248
- query: ""
249
- };
250
- },
251
- mounted: function() {
252
- this.scaffoldCamera = this.$refs.scaffold.$module.scene.getZincCameraControls();
253
- }
254
- }, O = { class: "viewer-container" };
255
- function L(e, t, n, o, i, s) {
256
- const l = u("ScaffoldVuer"), r = u("HelpModeDialog");
257
- return g(), y("div", O, [
258
- b(l, {
259
- state: e.entry.state,
260
- url: e.entry.resource,
261
- region: e.entry.region,
262
- onScaffoldSelected: t[0] || (t[0] = (a) => s.scaffoldResourceSelected(e.entry.type, a)),
263
- onScaffoldHighlighted: t[1] || (t[1] = (a) => s.scaffoldHighlighted(e.entry.type, a)),
264
- onScaffoldNavigated: t[2] || (t[2] = (a) => s.scaffoldNavigated(e.entry.type, a)),
265
- onOnReady: s.scaffoldIsReady,
266
- onOpenMap: e.openMap,
267
- ref: "scaffold",
268
- "background-toggle": !0,
269
- traditional: !0,
270
- helpMode: e.helpMode,
271
- helpModeActiveItem: e.helpModeActiveItem,
272
- helpModeDialog: e.useHelpModeDialog,
273
- onAnnotationOpen: e.onAnnotationOpen,
274
- onAnnotationClose: e.onAnnotationClose,
275
- onUpdateOfflineAnnotationEnabled: e.updateOfflineAnnotationEnabled,
276
- annotationSidebar: e.annotationSidebar,
277
- onHelpModeLastItem: e.onHelpModeLastItem,
278
- onShownTooltip: e.onTooltipShown,
279
- onShownMapTooltip: e.onMapTooltipShown,
280
- render: e.visible,
281
- "display-latest-message": !0,
282
- "warning-message": s.warningMessage,
283
- "display-minimap": !1,
284
- "display-markers": !1,
285
- enableOpenMapUI: !0,
286
- "view-u-r-l": e.entry.viewUrl,
287
- markerCluster: !0,
288
- markerLabels: s.markerLabels,
289
- flatmapAPI: e.flatmapAPI,
290
- showLocalSettings: e.showLocalSettings,
291
- showOpenMapButton: e.showOpenMapButton,
292
- usageConfig: {
293
- showTubeLinesControls: !1,
294
- tubeLines: e.entry.discoverId === "307" || e.entry.discoverId === 307
295
- }
296
- }, null, 8, ["state", "url", "region", "onOnReady", "onOpenMap", "helpMode", "helpModeActiveItem", "helpModeDialog", "onAnnotationOpen", "onAnnotationClose", "onUpdateOfflineAnnotationEnabled", "annotationSidebar", "onHelpModeLastItem", "onShownTooltip", "onShownMapTooltip", "render", "warning-message", "view-u-r-l", "markerLabels", "flatmapAPI", "showLocalSettings", "showOpenMapButton", "usageConfig"]),
297
- e.helpMode && e.useHelpModeDialog ? (g(), S(r, {
298
- key: 0,
299
- ref: "scaffoldHelp",
300
- scaffoldRef: e.scaffoldRef,
301
- lastItem: e.helpModeLastItem,
302
- onShowNext: e.onHelpModeShowNext,
303
- onFinishHelpMode: e.onFinishHelpMode
304
- }, null, 8, ["scaffoldRef", "lastItem", "onShowNext", "onFinishHelpMode"])) : M("", !0)
305
- ]);
306
- }
307
- const H = /* @__PURE__ */ p(C, [["render", L], ["__scopeId", "data-v-5de11cee"]]);
308
- export {
309
- H as default
310
- };
@@ -1,107 +0,0 @@
1
- import { _ as r, E as i } from "./index-_b4VBGHk.js";
2
- import { C as l } from "./ContentMixin-DIqgKIz6.js";
3
- import { SimulationVuer as d } from "@abi-software/simulationvuer";
4
- import { resolveComponent as u, openBlock as c, createBlock as f } from "vue";
5
- const h = {
6
- name: "Simulation",
7
- mixins: [l],
8
- components: {
9
- SimulationVuer: d
10
- },
11
- computed: {
12
- id: function() {
13
- return this.entry.resource ? this.entry.resource : this.entry.discoverId;
14
- }
15
- },
16
- data: function() {
17
- return {
18
- columns: void 0,
19
- csv: void 0,
20
- fileOpened: !1
21
- };
22
- },
23
- methods: {
24
- handleDataNotification: function(t) {
25
- i.emit("simulation-response", t);
26
- },
27
- handleDataRequest(t) {
28
- this.processRequest(t);
29
- },
30
- handleExternalEvent(t) {
31
- console.log("handleExternalEvent", t);
32
- },
33
- handleFileEvent(t) {
34
- (t == null ? void 0 : t.type) === "opened" && this.$nextTick(() => {
35
- this.fileOpened = !0, (this.entry.csv_file || this.csv_file) && this.addExternalData(
36
- {
37
- targetEntryId: this.entry.id,
38
- action: this.entry
39
- }
40
- );
41
- });
42
- },
43
- handleWindowClosed(t) {
44
- var e;
45
- (e = this.$refs.simulation) == null || e.removeDataSubscription(t.id);
46
- },
47
- processRequest: function(t) {
48
- var a, n;
49
- if (t.id !== "nz.ac.auckland.simulation-data-request") return;
50
- if (parseInt(t.version.split(".")[0]) !== 0) {
51
- console.warn("Unsupported simulation request version:", t.version);
52
- return;
53
- }
54
- ((a = t.payload.protocol) == null ? void 0 : a.resource) === this.id && ((n = this.$refs.simulation) == null || n.addDataSubscription({
55
- id: t.id,
56
- version: t.version,
57
- payload: {
58
- windowId: t.payload.windowId,
59
- ownerId: t.payload.ownerId,
60
- component: t.payload.component,
61
- variable: t.payload.variable,
62
- withVOI: !0
63
- }
64
- }));
65
- },
66
- addExternalData: function(t) {
67
- if (this.entry.id === t.targetEntryId) {
68
- const e = t.action;
69
- if (e.csv_file && (this.csv_file = e.csv_file, this.columns = e.columns), this.csv_file && this.fileOpened) {
70
- const a = [];
71
- this.columns && this.columns.forEach((n) => {
72
- n.cellml_variable && n.cellml_variable !== "main/t" && a.push(n.cellml_variable);
73
- }), this.$refs.simulation.addExternalData(this.csv_file, void 0, a);
74
- }
75
- }
76
- }
77
- },
78
- mounted: function() {
79
- i.on("simulation-external-data", this.addExternalData), i.on("simulation-data-request", this.handleDataRequest), i.on("plot-window-closed", this.handleWindowClosed), i.emit("simulation-ready", {
80
- resourceId: this.id,
81
- entryId: this.entry.id,
82
- ready: !0
83
- }), console.log(this.entry);
84
- },
85
- beforeUnmount: function() {
86
- i.emit("simulation-ready", {
87
- resourceId: this.id,
88
- entryId: this.entry.id,
89
- ready: !1
90
- }), i.off("simulation-data-request", this.handleDataRequest), i.off("plot-window-closed", this.handleWindowClosed);
91
- }
92
- };
93
- function m(t, e, a, n, p, o) {
94
- const s = u("SimulationVuer");
95
- return c(), f(s, {
96
- apiLocation: t.apiLocation,
97
- id: o.id,
98
- ref: "simulation",
99
- onDataNotification: o.handleDataNotification,
100
- onExternalData: o.handleExternalEvent,
101
- onFile: o.handleFileEvent
102
- }, null, 8, ["apiLocation", "id", "onDataNotification", "onExternalData", "onFile"]);
103
- }
104
- const w = /* @__PURE__ */ r(h, [["render", m]]);
105
- export {
106
- w as default
107
- };
@@ -1,119 +0,0 @@
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
- };
@@ -1 +0,0 @@
1
- <template></template>
@@ -1,13 +0,0 @@
1
- import mitt from 'mitt';
2
- import type { SimulationRequest, SimulationResponse } from '../types/simulation';
3
-
4
- // Define the mapping of Event Name -> Event Payload
5
- type Events = {
6
- 'simulation-data-request': SimulationRequest;
7
- 'simulation-data-ready': SimulationResponse;
8
- [key: string]: any; // Allow for other events with any payload.
9
- };
10
-
11
- // Pass the type to mitt
12
- const EventBus = mitt<Events>();
13
- export default EventBus;
@@ -1,142 +0,0 @@
1
- <script setup>
2
- import { ref, toRefs, watch } from 'vue'
3
- import { useDraggable } from '@vueuse/core'
4
-
5
- const props = defineProps(['windowData', 'offsetX', 'offsetY'])
6
- const emit = defineEmits(['closeWindow', 'mouseDown'])
7
- const { windowData } = toRefs(props)
8
-
9
- // 1. Create a template ref for the DOM element
10
- const el = ref(null)
11
-
12
- // 2. Create a "handle" ref so the user can only drag by the header
13
- const handle = ref(null)
14
-
15
- const transform = ref('translate(0px, 0px)')
16
- const isMinimized = ref(false)
17
- const toggleMinimize = () => {
18
- isMinimized.value = !isMinimized.value
19
- }
20
-
21
- const getTitle = () => {
22
- if (windowData.value.label) {
23
- let title = windowData.value.label;
24
- if (windowData.value.data?.title) {
25
- title += ` (${windowData.value.data?.title})`;
26
- }
27
- return title;
28
- } else {
29
- return windowData.value.data?.title;
30
- }
31
- }
32
-
33
- watch(
34
- [() => props.offsetX, () => props.offsetY],
35
- ([newX, newY]) => {
36
- transform.value = `translate(-${newX}px, -${newY}px)`
37
- },
38
- { immediate: true }
39
- )
40
-
41
- // 3. Activate draggable logic
42
- // We set initialValue to the props so it opens where we want
43
- const { x, y, style } = useDraggable(el, {
44
- initialValue: { x: windowData.value.x, y: windowData.value.y },
45
- handle: handle, // Only drag when clicking the header
46
- preventDefault: true,
47
- })
48
- </script>
49
-
50
- <template>
51
- <div
52
- ref="el"
53
- class="floating-window"
54
- :class="{ 'is-minimized': isMinimized }"
55
- :style="[style, { zIndex: windowData.zIndex, transform: transform }]"
56
- @mousedown="emit('mouseDown', windowData.id)"
57
- >
58
- <div ref="handle" class="window-header">
59
- <span class="title">{{ getTitle() }}</span>
60
- <div class="window-controls">
61
- <button @click.stop="toggleMinimize" class="control-btn">
62
- {{ isMinimized ? '□' : '_' }}
63
- </button>
64
- <button @click.stop="emit('closeWindow', windowData.id)">×</button>
65
- </div>
66
- </div>
67
-
68
- <div class="window-body" v-show="!isMinimized">
69
- <slot></slot>
70
- </div>
71
- </div>
72
- </template>
73
-
74
- <style scoped>
75
- .floating-window {
76
- position: absolute; /* Fixed relative to viewport */
77
- width: 400px;
78
- min-width: 200px;
79
- height: 300px;
80
- min-height: 150px;
81
- background: white;
82
- border: 1px solid #ccc;
83
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
84
- display: flex;
85
- flex-direction: column;
86
- resize: both; /* Allow resizing */
87
- overflow: hidden; /* Prevent content overflow */
88
- transition: height 0.2s ease, width 0.2s ease;
89
-
90
- .title {
91
- align-content: center;
92
- font-size: 12px;
93
- }
94
- }
95
-
96
- .window-header {
97
- background: #f0f0f0;
98
- padding: 8px;
99
- cursor: grab; /* Shows user it is draggable */
100
- display: flex;
101
- justify-content: space-between;
102
- border-bottom: 1px solid #ddd;
103
- user-select: none;
104
- }
105
-
106
- .window-header:active {
107
- cursor: grabbing;
108
- }
109
-
110
- .window-body {
111
- flex-grow: 1;
112
- width: 100%;
113
- height: 100%;
114
- position: relative;
115
- padding: 10px;
116
- /* overflow: hidden; Important for Plotly resizing */
117
- }
118
-
119
- .floating-window.is-minimized {
120
- height: auto !important;
121
- min-height: 0 !important;
122
- resize: none; /* Disable resizing when minimized */
123
- width: 250px; /* Optional: shrink the width to make a neat little bar */
124
- }
125
-
126
- .window-controls {
127
- display: flex;
128
- gap: 5px;
129
- }
130
-
131
- .control-btn {
132
- background: transparent;
133
- border: 1px solid #ccc;
134
- cursor: pointer;
135
- padding: 0 5px;
136
- border-radius: 3px;
137
- }
138
-
139
- .control-btn:hover {
140
- background: #e0e0e0;
141
- }
142
- </style>