@abi-software/mapintegratedvuer 1.8.0-beta.1 → 1.8.0-isan.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 (31) hide show
  1. package/dist/ContentMixin-CthZZNjI.js +706 -0
  2. package/dist/{Flatmap-BMowLXfS.js → Flatmap-Bi9esI2v.js} +62 -60
  3. package/dist/{Iframe-fNcVYbXe.js → Iframe-bsYxppii.js} +2 -2
  4. package/dist/{MultiFlatmap-DuKi1y2A.js → MultiFlatmap-BWFsdMgS.js} +46 -37
  5. package/dist/{Plot-3jlnqIiS.js → Plot-gX8radCI.js} +2 -2
  6. package/dist/{Scaffold-Brboi1Ah.js → Scaffold-Dn3GeNi0.js} +7197 -7151
  7. package/dist/Simulation-Zgs0MXh1.js +30 -0
  8. package/dist/{index-B_H6BPK_.js → index-DFkMrKek.js} +23282 -21203
  9. package/dist/mapintegratedvuer.js +1 -1
  10. package/dist/mapintegratedvuer.umd.cjs +1663 -1009
  11. package/dist/{style-Bt2YbWCx.js → style-DlUxkFU-.js} +70145 -67320
  12. package/dist/style.css +1 -1
  13. package/package.json +8 -7
  14. package/src/App.vue +3 -14
  15. package/src/assets/header-icon.scss +7 -0
  16. package/src/components/ContentBar.vue +5 -1
  17. package/src/components/DialogToolbarContent.vue +87 -15
  18. package/src/components/FlatmapContextCard.vue +11 -8
  19. package/src/components/MapContent.vue +11 -21
  20. package/src/components/SplitFlow.vue +183 -108
  21. package/src/components/scripts/utilities.js +1 -1
  22. package/src/components/viewers/Flatmap.vue +6 -7
  23. package/src/components/viewers/MultiFlatmap.vue +25 -7
  24. package/src/components/viewers/Scaffold.vue +2 -2
  25. package/src/components/viewers/Simulation.vue +19 -1
  26. package/src/components.d.ts +4 -0
  27. package/src/mixins/ContentMixin.js +138 -80
  28. package/src/mixins/DynamicMarkerMixin.js +3 -1
  29. package/src/stores/settings.js +13 -10
  30. package/dist/ContentMixin-B9DtqhYT.js +0 -357
  31. package/dist/Simulation-BPEbHrzv.js +0 -22
@@ -1,357 +0,0 @@
1
- import "vue";
2
- import { u as p, d as u, E as r, T as d, e as h, f as m } from "./index-B_H6BPK_.js";
3
- import { mapStores as g } from "pinia";
4
- function y(e) {
5
- return e[0].toUpperCase() + e.substring(1);
6
- }
7
- const I = {
8
- emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
9
- props: {
10
- /**
11
- * Object containing information for
12
- * the required viewing.
13
- */
14
- entry: Object,
15
- visible: {
16
- type: Boolean,
17
- default: !0
18
- },
19
- mouseHovered: {
20
- type: Boolean,
21
- default: !1
22
- }
23
- },
24
- computed: {
25
- ...g(p, u),
26
- idNamePair() {
27
- return this.splitFlowStore.idNamePair;
28
- },
29
- syncMode() {
30
- return this.splitFlowStore.syncMode;
31
- },
32
- useHelpModeDialog() {
33
- return this.settingsStore.useHelpModeDialog;
34
- },
35
- connectivityInfoSidebar() {
36
- return this.settingsStore.connectivityInfoSidebar;
37
- },
38
- annotationSidebar() {
39
- return this.settingsStore.annotationSidebar;
40
- }
41
- },
42
- mounted: function() {
43
- r.on("startHelp", () => {
44
- this.startHelp();
45
- }), this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold;
46
- },
47
- methods: {
48
- toggleSyncMode: function() {
49
- },
50
- getState: function() {
51
- },
52
- openMap: function(e) {
53
- e === "SYNC" ? (this.toggleSyncMode(), this.trackOpenMap("toggle_map_sync_mode")) : (r.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`)), this.onConnectivityInfoClose();
54
- },
55
- onMapmanagerLoaded: function(e) {
56
- this.settingsStore.updateMapManager(e);
57
- },
58
- trackOpenMap: function(e) {
59
- d.sendEvent({
60
- event: "interaction_event",
61
- event_name: "portal_maps_open_map",
62
- category: e,
63
- location: "open_new_map"
64
- });
65
- },
66
- updateWithViewUrl: function() {
67
- },
68
- /**
69
- * Perform a local search on this contentvuer
70
- */
71
- search: function() {
72
- return !1;
73
- },
74
- /**
75
- * Get a list of search suggestions on this contentvuer
76
- */
77
- searchSuggestions: function() {
78
- },
79
- /**
80
- * Callback when the vuers emit a selected event.
81
- */
82
- resourceSelected: function(e, t) {
83
- var s, o, l, f;
84
- if (this.resourceHasAction(t)) {
85
- r.emit("PopoverActionClick", t);
86
- return;
87
- }
88
- let i, n = !1;
89
- const a = {
90
- paneIndex: this.entry.id,
91
- type: e,
92
- resource: t,
93
- internalName: void 0,
94
- eventType: void 0
95
- };
96
- if (e == "MultiFlatmap" || e == "Flatmap")
97
- if (a.internalName = (s = t == null ? void 0 : t.feature) != null && s.label ? t.feature.label : this.idNamePair[t.feature.models], t.eventType == "click")
98
- if (a.eventType = "selected", t.feature.type == "marker") {
99
- let c = a.internalName;
100
- this.settingsStore.isFeaturedMarkerIdentifier(
101
- t.feature.id
102
- ) ? i = {
103
- type: "Search",
104
- term: this.settingsStore.featuredMarkerDoi(
105
- t.feature.id
106
- ),
107
- featuredDataset: !0
108
- } : i = {
109
- type: "Facet",
110
- facet: c,
111
- facetPropPath: "anatomy.organ.category.name",
112
- term: "Anatomical structure"
113
- }, n = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
114
- } else t.feature.type == "feature" && this.syncMode && (n = !0);
115
- else t.eventType == "mouseenter" && (a.eventType = "highlighted", n = !0);
116
- else e == "Scaffold" && (t && t[0] && ((((o = t[0].data) == null ? void 0 : o.id) === void 0 || ((l = t[0].data) == null ? void 0 : l.id) === "") && (t[0].data.id = (f = t[0].data) == null ? void 0 : f.group), a.internalName = t[0].data.id, t[0].data.lastActionOnMarker === !0 && (i = {
117
- type: "Facet",
118
- facet: y(t[0].data.id),
119
- facetPropPath: "anatomy.organ.category.name",
120
- term: "Anatomical structure"
121
- })), a.eventType = "selected", n = !0);
122
- i && r.emit("PopoverActionClick", i), n && this.$emit("resource-selected", a);
123
- },
124
- resourceHasAction: function(e) {
125
- return e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets";
126
- },
127
- /**
128
- * Check if this viewer is currently visible
129
- */
130
- isVisible: function() {
131
- return this.splitFlowStore.getPaneNameById(this.entry.id) !== void 0;
132
- },
133
- displayTooltip: function() {
134
- },
135
- /**
136
- * Get the term to zoom/highlight in a synchronisation event,
137
- * if it cannot be found in the map, it will perform several
138
- * calls to try to ge a valid name/id.
139
- */
140
- getNameAndIdFromSyncData: async function(e) {
141
- let t = e.internalName;
142
- t === void 0 && e.resource && (t = e.resource.label);
143
- let i;
144
- if (e.resource && e.resource.resource && (i = e.resource.resource[0]), this.entry.type === "Scaffold") {
145
- if (this.$refs.scaffold.findObjectsWithGroupName(t).length === 0) {
146
- if (e.resource && e.resource.feature) {
147
- const s = h(e.resource.feature.models);
148
- if (s.length > 0) return s;
149
- }
150
- let a = m(t);
151
- if (a)
152
- return a;
153
- if (i && e.eventType === "selected")
154
- return fetch(`${this.apiLocation}get-related-terms/${i}`).then((s) => s.json()).then((s) => {
155
- if (s.uberon.array.length > 0)
156
- return t = s.uberon.array[0].name.charAt(0).toUpperCase() + s.uberon.array[0].name.slice(1), i = s.uberon.array[0].id.toUpperCase(), { id: i, name: t };
157
- });
158
- }
159
- } else if (this.entry.type === "MultiFlatmap")
160
- if (t === "Bladder")
161
- t = "Urinary Bladder";
162
- else {
163
- const n = h(t);
164
- n.length > 0 && (t = n[0]);
165
- }
166
- return { id: i, name: t };
167
- },
168
- // Get the species and andaotmy info for the featured datasets
169
- getDatasetAnatomyInfo: function(e) {
170
- fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((t) => t.json()).then((t) => {
171
- const i = t.result[0];
172
- let n;
173
- try {
174
- n = i.anatomy.organ[0].curie;
175
- } catch {
176
- n = void 0;
177
- }
178
- let a;
179
- try {
180
- a = i.item.curie;
181
- } catch {
182
- a = void 0;
183
- }
184
- let s;
185
- try {
186
- let o = 0, l = !1;
187
- for (; !l && o < i.organisms.subject.length; ) {
188
- const f = i.organisms.subject[o];
189
- f.species && (s = f.species.name, l = !0), o += 1;
190
- }
191
- } catch {
192
- s = void 0;
193
- }
194
- this.settingsStore.updateFeaturedMarker({
195
- identifier: e,
196
- marker: n,
197
- doi: a,
198
- species: s
199
- });
200
- });
201
- },
202
- // Check if the old featured dataset api has any info
203
- oldFeaturedDatasetApiHasInfo: async function() {
204
- let t = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
205
- return !t.identifiers || t.identifiers.length == 0 ? !1 : t.identifiers;
206
- },
207
- // Check if the new featured dataset api has any info
208
- newFeaturedDatasetApiHasInfo: async function() {
209
- let t = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
210
- return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((i) => i.id);
211
- },
212
- /**
213
- * Get a list of featured datasets to display.
214
- */
215
- getFeaturedDatasets: async function() {
216
- let e = [], t = await this.oldFeaturedDatasetApiHasInfo();
217
- if (t) e = t;
218
- else {
219
- let i = await this.newFeaturedDatasetApiHasInfo();
220
- i && (e = i);
221
- }
222
- this.settingsStore.updateFeatured(e), e.forEach((i) => {
223
- this.getDatasetAnatomyInfo(i);
224
- });
225
- },
226
- zoomToFeatures: function() {
227
- },
228
- handleSyncMouseEvent: async function(e) {
229
- let t = await this.getNameAndIdFromSyncData(e);
230
- e.eventType === "highlighted" ? this.highlightFeatures(t) : e.eventType === "selected" && this.displayTooltip(t);
231
- },
232
- /**
233
- * Handle sync pan zoom event
234
- */
235
- handleSyncPanZoomEvent: function() {
236
- },
237
- highlightFeatures: function() {
238
- },
239
- receiveSynchronisedEvent: async function(e) {
240
- if (e.paneIndex !== this.entry.id)
241
- e.eventType == "panZoom" || this.handleSyncMouseEvent(e);
242
- else if (e.eventType == "selected") {
243
- let t = await this.getNameAndIdFromSyncData(e);
244
- this.zoomToFeatures(t, !1);
245
- }
246
- },
247
- requestSynchronisedEvent: function() {
248
- },
249
- flatmapMarkerUpdate() {
250
- },
251
- onResize: function() {
252
- },
253
- startHelp: function() {
254
- this.isInHelp === !1 && (this.helpMode = !0, window.addEventListener("mousedown", this.checkEndHelpMouseDown), this.isInHelp = !0);
255
- },
256
- endHelp: function() {
257
- window.removeEventListener("mousedown", this.checkEndHelpMouseDown), this.helpMode = !1, setTimeout(() => {
258
- this.isInHelp = !1;
259
- }, 200);
260
- },
261
- onHelpModeShowNext: function() {
262
- this.helpModeActiveItem += 1;
263
- },
264
- onHelpModeLastItem: function(e) {
265
- e && (this.helpModeLastItem = !0);
266
- },
267
- onFinishHelpMode: function() {
268
- this.helpMode = !1, this.helpModeActiveItem = 0, this.helpModeLastItem = !1;
269
- },
270
- onTooltipShown: function() {
271
- this.$refs.multiflatmap && this.$refs.multiflatmapHelp && this.$refs.multiflatmapHelp.toggleTooltipHighlight(), this.$refs.flatmap && this.$refs.flatmapHelp && this.$refs.flatmapHelp.toggleTooltipHighlight(), this.$refs.scaffold && this.$refs.scaffoldHelp && this.$refs.scaffoldHelp.toggleTooltipHighlight();
272
- },
273
- onMapTooltipShown: function() {
274
- this.$refs.multiflatmap && this.$refs.multiflatmapHelp && this.$refs.multiflatmapHelp.toggleTooltipPinHighlight(), this.$refs.flatmap && this.$refs.flatmapHelp && this.$refs.flatmapHelp.toggleTooltipPinHighlight(), this.$refs.scaffold && this.$refs.scaffoldHelp && this.$refs.scaffoldHelp.toggleTooltipPinHighlight();
275
- },
276
- /**
277
- * End help-mode only if user clicks outside of help mode dialog.
278
- */
279
- checkEndHelpMouseDown: function(e) {
280
- e.target.closest(".help-mode-dialog") || this.endHelp();
281
- },
282
- getConnectivitiesByDOI: async function(e) {
283
- return await this.$refs.multiflatmap.getCurrentFlatmap().searchConnectivitiesByReference(e);
284
- },
285
- highlightAnatomies: async function(e, t, i) {
286
- const n = [...t], a = this.settingsStore.hoverHighlightOptions;
287
- if (a.highlightConnectedPaths) {
288
- const s = await e.queryPathsForFeatures(t);
289
- s && n.push(...s);
290
- }
291
- if (a.highlightDOIPaths) {
292
- const s = await this.getConnectivitiesByDOI(i);
293
- s && n.push(...s);
294
- }
295
- return n;
296
- },
297
- mapHoverHighlight: function() {
298
- if (this.visible) {
299
- const e = this.settingsStore.hoverAnatomies, t = this.settingsStore.hoverOrgans, i = this.settingsStore.hoverDOI;
300
- let n = null, a = null;
301
- this.flatmapRef && (n = this.$refs.flatmap.mapImp), this.multiflatmapRef && (n = this.$refs.multiflatmap.getCurrentFlatmap().mapImp), this.scaffoldRef && (a = this.$refs.scaffold), n && n.clearSearchResults(), e.length || t.length ? (clearTimeout(this.hoverDelay), this.multiflatmapRef || this.flatmapRef ? this.highlightAnatomies(n, e, i).then((s) => {
302
- n.selectFeatures(s);
303
- }) : this.scaffoldRef && (a == null || a.changeHighlightedByName(t, "", !1))) : this.hoverDelay = setTimeout(() => {
304
- this.multiflatmapRef || this.flatmapRef ? n == null || n.clearSearchResults() : this.scaffoldRef && (a == null || a.changeHighlightedByName(t, "", !1));
305
- }, 500);
306
- }
307
- },
308
- onAnnotationOpen: function(e) {
309
- r.emit("annotation-open", e);
310
- },
311
- onAnnotationClose: function() {
312
- r.emit("annotation-close");
313
- },
314
- onConnectivityInfoOpen: function(e) {
315
- r.emit("connectivity-info-open", e);
316
- },
317
- onConnectivityInfoClose: function() {
318
- r.emit("connectivity-info-close");
319
- },
320
- onConnectivityGraphError: function(e) {
321
- r.emit("connectivity-graph-error", e);
322
- }
323
- },
324
- data: function() {
325
- return {
326
- apiLocation: void 0,
327
- activeSpecies: "Human Male",
328
- scaffoldCamera: void 0,
329
- mainStyle: {
330
- height: this.entry.datasetTitle ? "calc(100% - 30px)" : "100%",
331
- width: "100%",
332
- bottom: "0px"
333
- },
334
- helpMode: !1,
335
- helpModeActiveItem: 0,
336
- helpModeLastItem: !1,
337
- multiflatmapRef: null,
338
- flatmapRef: null,
339
- scaffoldRef: null,
340
- scaffoldLoaded: !1,
341
- isInHelp: !1,
342
- hoverDelay: void 0,
343
- mapManager: void 0
344
- };
345
- },
346
- created: function() {
347
- this.flatmapAPI = void 0, this.apiLocation = void 0, this.settingsStore.flatmapAPI && (this.flatmapAPI = this.settingsStore.flatmapAPI), this.settingsStore.sparcApi && (this.apiLocation = this.settingsStore.sparcApi), this.settingsStore.mapManager && (this.mapManager = this.settingsStore.mapManager);
348
- },
349
- watch: {
350
- helpMode: function(e) {
351
- e || (this.helpModeActiveItem = 0);
352
- }
353
- }
354
- };
355
- export {
356
- I as C
357
- };
@@ -1,22 +0,0 @@
1
- import { C as i } from "./ContentMixin-B9DtqhYT.js";
2
- import { SimulationVuer as t } from "@abi-software/simulationvuer";
3
- import { resolveComponent as e, openBlock as r, createBlock as a } from "vue";
4
- import { _ as m } from "./index-B_H6BPK_.js";
5
- const c = {
6
- name: "Simulation",
7
- mixins: [i],
8
- components: {
9
- SimulationVuer: t
10
- }
11
- };
12
- function p(o, s, u, l, f, _) {
13
- const n = e("SimulationVuer");
14
- return r(), a(n, {
15
- apiLocation: o.apiLocation,
16
- id: o.entry.discoverId
17
- }, null, 8, ["apiLocation", "id"]);
18
- }
19
- const C = /* @__PURE__ */ m(c, [["render", p]]);
20
- export {
21
- C as default
22
- };