@abi-software/mapintegratedvuer 1.7.2 → 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-fO2lvKFX.js → Flatmap-Bi9esI2v.js} +24 -19
  3. package/dist/{Iframe-C8wxLuOy.js → Iframe-bsYxppii.js} +2 -2
  4. package/dist/{MultiFlatmap-Dijv5l_F.js → MultiFlatmap-BWFsdMgS.js} +49 -35
  5. package/dist/{Plot-iXTevaO7.js → Plot-gX8radCI.js} +2 -2
  6. package/dist/{Scaffold-_QafxYws.js → Scaffold-Dn3GeNi0.js} +10241 -10168
  7. package/dist/Simulation-Zgs0MXh1.js +30 -0
  8. package/dist/{index-DcTjoXV1.js → index-DFkMrKek.js} +22249 -19928
  9. package/dist/mapintegratedvuer.js +1 -1
  10. package/dist/mapintegratedvuer.umd.cjs +1667 -1009
  11. package/dist/{style-C2GyLbPa.js → style-DlUxkFU-.js} +75606 -75481
  12. package/dist/style.css +1 -1
  13. package/package.json +8 -7
  14. package/src/App.vue +39 -18
  15. package/src/assets/header-icon.scss +7 -0
  16. package/src/components/ContentBar.vue +5 -1
  17. package/src/components/DialogToolbarContent.vue +91 -6
  18. package/src/components/FlatmapContextCard.vue +11 -8
  19. package/src/components/MapContent.vue +62 -46
  20. package/src/components/SplitFlow.vue +188 -112
  21. package/src/components/scripts/utilities.js +1 -1
  22. package/src/components/viewers/Flatmap.vue +12 -7
  23. package/src/components/viewers/MultiFlatmap.vue +34 -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 +155 -47
  28. package/src/mixins/DynamicMarkerMixin.js +3 -1
  29. package/src/stores/settings.js +31 -5
  30. package/dist/ContentMixin-CdE8AlUJ.js +0 -339
  31. package/dist/Simulation-CJ-9g74P.js +0 -22
@@ -1,339 +0,0 @@
1
- import "vue";
2
- import { u as d, e as u, E as r, T as p, f as h, i as m } from "./index-DcTjoXV1.js";
3
- import { mapStores as g } from "pinia";
4
- function y(e) {
5
- return e[0].toUpperCase() + e.substring(1);
6
- }
7
- const w = {
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(d, 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
- p.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 n, o, l, f;
84
- if (this.resourceHasAction(t)) {
85
- r.emit("PopoverActionClick", t);
86
- return;
87
- }
88
- let i, s = !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 = (n = t == null ? void 0 : t.feature) != null && n.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
- }, s = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
114
- } else t.feature.type == "feature" && this.syncMode && (s = !0);
115
- else t.eventType == "mouseenter" && (a.eventType = "highlighted", s = !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", s = !0);
122
- i && r.emit("PopoverActionClick", i), s && 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 n = h(e.resource.feature.models);
148
- if (n.length > 0) return n;
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((n) => n.json()).then((n) => {
155
- if (n.uberon.array.length > 0)
156
- return t = n.uberon.array[0].name.charAt(0).toUpperCase() + n.uberon.array[0].name.slice(1), i = n.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 s = h(t);
164
- s.length > 0 && (t = s[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 s;
173
- try {
174
- s = i.anatomy.organ[0].curie;
175
- } catch {
176
- s = void 0;
177
- }
178
- let a;
179
- try {
180
- a = i.item.curie;
181
- } catch {
182
- a = void 0;
183
- }
184
- let n;
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 && (n = f.species.name, l = !0), o += 1;
190
- }
191
- } catch {
192
- n = void 0;
193
- }
194
- this.settingsStore.updateFeaturedMarker({
195
- identifier: e,
196
- marker: s,
197
- doi: a,
198
- species: n
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
- mapHoverHighlight: function(e) {
283
- if (this.visible) {
284
- const t = this.settingsStore.hoverAnatomies, i = this.settingsStore.hoverOrgans;
285
- t.length || i.length ? (clearTimeout(this.hoverDelay), this.multiflatmapRef || this.flatmapRef ? e == null || e.zoomToFeatures(t, { noZoomIn: !0 }) : this.scaffoldRef && (e == null || e.changeHighlightedByName(i, "", !1))) : this.hoverDelay = setTimeout(() => {
286
- this.multiflatmapRef || this.flatmapRef ? e == null || e.clearSearchResults() : this.scaffoldRef && (e == null || e.changeHighlightedByName(i, "", !1));
287
- }, 500);
288
- }
289
- },
290
- onAnnotationOpen: function(e) {
291
- r.emit("annotation-open", e);
292
- },
293
- onAnnotationClose: function() {
294
- r.emit("annotation-close");
295
- },
296
- onConnectivityInfoOpen: function(e) {
297
- r.emit("connectivity-info-open", e);
298
- },
299
- onConnectivityInfoClose: function() {
300
- r.emit("connectivity-info-close");
301
- },
302
- onConnectivityGraphError: function(e) {
303
- r.emit("connectivity-graph-error", e);
304
- }
305
- },
306
- data: function() {
307
- return {
308
- apiLocation: void 0,
309
- activeSpecies: "Human Male",
310
- scaffoldCamera: void 0,
311
- mainStyle: {
312
- height: this.entry.datasetTitle ? "calc(100% - 30px)" : "100%",
313
- width: "100%",
314
- bottom: "0px"
315
- },
316
- helpMode: !1,
317
- helpModeActiveItem: 0,
318
- helpModeLastItem: !1,
319
- multiflatmapRef: null,
320
- flatmapRef: null,
321
- scaffoldRef: null,
322
- scaffoldLoaded: !1,
323
- isInHelp: !1,
324
- hoverDelay: void 0,
325
- mapManager: void 0
326
- };
327
- },
328
- created: function() {
329
- 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);
330
- },
331
- watch: {
332
- helpMode: function(e) {
333
- e || (this.helpModeActiveItem = 0);
334
- }
335
- }
336
- };
337
- export {
338
- w as C
339
- };
@@ -1,22 +0,0 @@
1
- import { C as i } from "./ContentMixin-CdE8AlUJ.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-DcTjoXV1.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
- };