@abi-software/mapintegratedvuer 1.20.1 → 1.21.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.
Files changed (41) hide show
  1. package/cypress.config.js +8 -7
  2. package/dist/ConnectivityGraph-CZMROk9r.js +121 -0
  3. package/dist/ContentMixin-Vn34n5t2.js +1672 -0
  4. package/dist/DynamicMarkerMixin-B087dVL_.js +50 -0
  5. package/dist/Flatmap-Bm7m_5m_.js +193 -0
  6. package/dist/Iframe-BWbhTjCR.js +18 -0
  7. package/dist/MultiFlatmap-JziqSEwL.js +303 -0
  8. package/dist/Plot-ChbPsDZX.js +28 -0
  9. package/dist/Scaffold-C6f7c7Ha.js +308 -0
  10. package/dist/Simulation-DcJScRYo.js +25 -0
  11. package/dist/connectivities-UXTqf7_0.js +35743 -0
  12. package/dist/mapintegratedvuer.js +43234 -3
  13. package/dist/mapintegratedvuer.umd.cjs +556 -297
  14. package/dist/style.css +2 -1
  15. package/eslint.config.js +33 -0
  16. package/package.json +61 -76
  17. package/src/assets/fonts.scss +2 -0
  18. package/src/assets/header-icon.scss +2 -1
  19. package/src/assets/styles.scss +2 -3
  20. package/src/components/CustomSplitter.vue +3 -3
  21. package/src/components/SearchControls.vue +1 -1
  22. package/src/components/index.js +1 -0
  23. package/src/components/scripts/simulation_data.js +461 -0
  24. package/src/components/viewers/Flatmap.vue +11 -7
  25. package/src/components/viewers/MultiFlatmap.vue +12 -8
  26. package/src/components.d.ts +6 -2
  27. package/src/main.js +2 -1
  28. package/vite.bundle-build.js +19 -4
  29. package/vite.config.js +16 -1
  30. package/babel.config.js +0 -0
  31. package/dist/ConnectivityGraph-C2SH21O2.js +0 -123
  32. package/dist/ContentMixin-DyNQa5V5.js +0 -1725
  33. package/dist/Flatmap-2O4GdIZV.js +0 -203
  34. package/dist/Iframe-ComVJ_Ev.js +0 -20
  35. package/dist/MultiFlatmap-oVdJqKEz.js +0 -317
  36. package/dist/Plot-CYyVTjHQ.js +0 -25
  37. package/dist/Scaffold-DXGZqxdu.js +0 -305
  38. package/dist/Simulation-DNOubbSn.js +0 -28
  39. package/dist/index-BkejiyeA.js +0 -79223
  40. package/dist/style-3VbUVJif.js +0 -57
  41. package/static.json +0 -7
@@ -0,0 +1,308 @@
1
+ import { C as e, _ as t, a as n, b as r, o as i } from "./connectivities-UXTqf7_0.js";
2
+ import "./mapintegratedvuer.js";
3
+ import { t as a } from "./ContentMixin-Vn34n5t2.js";
4
+ import { createBlock as o, createCommentVNode as s, createElementBlock as c, markRaw as l, openBlock as u, resolveComponent as d } from "vue";
5
+ import { ScaffoldVuer as f } from "@abi-software/scaffoldvuer";
6
+ import "@abi-software/scaffoldvuer/dist/style.css";
7
+ //#region src/components/viewers/Scaffold.vue
8
+ var p = {
9
+ name: "Scaffold",
10
+ mixins: [a],
11
+ components: {
12
+ ScaffoldVuer: f,
13
+ HelpModeDialog: e
14
+ },
15
+ methods: {
16
+ showConnectivitiesByReference: async function(e) {
17
+ if (this.$refs.scaffold) {
18
+ let t = sessionStorage.getItem("flatmap-knowledge"), r = [];
19
+ r = t ? await i(e) : await n(this.flatmapService.mapImp, e, this.flatmapService.flatmapQueries);
20
+ let a = [];
21
+ for (let e of r) {
22
+ let t = this.nervesKnowledge.find((t) => t.id === e);
23
+ if (!t) continue;
24
+ let n = t["nerve-label"];
25
+ if (n) {
26
+ let e = n.flatMap((e) => e.subNerves);
27
+ a.push(...e);
28
+ }
29
+ }
30
+ this.$refs.scaffold.changeHighlightedByName(a, "", !1);
31
+ }
32
+ },
33
+ setNerveGreyScale: function() {
34
+ if (this.$refs.scaffold && this.nervesKnowledge.length) {
35
+ let e = this.nervesKnowledge.reduce((e, t) => e.concat(t["nerve-label"] || []), []).reduce((e, t) => e.concat(t.subNerves || []), []);
36
+ this.$refs.scaffold.setGreyScale(!0, e);
37
+ }
38
+ },
39
+ setVisibilityFilter: function(e) {
40
+ if (this.$refs.scaffold) {
41
+ let t = [], n = !!e;
42
+ if (e) {
43
+ let n = [];
44
+ e.OR.forEach((e) => {
45
+ "AND" in e && e.AND.length >= 2 && "models" in e.AND[1] && n.push(...e.AND[1].models);
46
+ });
47
+ for (let e of n) {
48
+ let n = this.nervesKnowledge.find((t) => t.id === e);
49
+ if (n) {
50
+ let e = n["nerve-label"].map((e) => e.subNerves).flat(Infinity);
51
+ t.push(...e);
52
+ }
53
+ }
54
+ }
55
+ this.$refs.scaffold.zoomToNerves(t, n);
56
+ }
57
+ },
58
+ syncFilter: function(e) {
59
+ this.$refs.scaffold?.viewingMode === "Neuron Connection" && (this.filter = e.filter((e) => e.facet?.toLowerCase() !== "show all"));
60
+ },
61
+ scaffoldResourceSelected: async function(e, t) {
62
+ if (this.resourceSelected(e, t, !0), t.length === 1) {
63
+ if (this.clickedObject = t[0].data, this.clickedObject.isNerves || this.clickedObject.anatomicalId) {
64
+ let e = this.clickedObject.id.toLowerCase();
65
+ if (this.$refs.scaffold.viewingMode === "Neuron Connection") {
66
+ let t = this.settingsStore.globalSettings.connectionType;
67
+ if (this.clickedObject.isNerves) this.filter.push({
68
+ facet: e,
69
+ term: "Nerves",
70
+ facetPropPath: "scaffold.connectivity.nerve"
71
+ });
72
+ else {
73
+ let n = t.toLowerCase(), r = this.clickedObject.anatomicalId || "";
74
+ if (r) this.filter.push({
75
+ facet: `["${r}",[]]`,
76
+ facetPropPath: `flatmap.connectivity.source.${n}`,
77
+ tagLabel: e.charAt(0).toUpperCase() + e.slice(1),
78
+ term: t
79
+ });
80
+ else {
81
+ let i = this.connectivitiesStore.filterOptions[this.entry.resource].find((e) => e.key === `flatmap.connectivity.source.${n}`), a;
82
+ i?.children.forEach((t) => {
83
+ t.label.toLowerCase() === e && (a = t), t.children?.forEach((t) => {
84
+ t.label.toLowerCase() === e && (a = t);
85
+ });
86
+ }), a && (r = a.key.replace(`flatmap.connectivity.source.${n}.`, ""), this.filter.push({
87
+ facet: r,
88
+ facetPropPath: `flatmap.connectivity.source.${n}`,
89
+ tagLabel: a.tagLabel,
90
+ term: t
91
+ }));
92
+ }
93
+ }
94
+ r.emit("neuron-connection-feature-click", {
95
+ filters: this.filter,
96
+ search: this.filter.length ? "" : e
97
+ });
98
+ } else if (this.$refs.scaffold.viewingMode === "Exploration") {
99
+ let t = this.nervesKnowledge.filter((t) => JSON.stringify(t["nerve-label"]).includes(e));
100
+ t.length && this.getKnowledgeTooltip({
101
+ data: t,
102
+ type: this.entry
103
+ });
104
+ }
105
+ }
106
+ } else t.length > 1 ? this.$refs.scaffold.viewingMode === "Exploration" && this.clickedObject && this.$refs.scaffold.$module.setIgnorePicking(!1) : (this.clickedObject = void 0, r.emit("connectivity-info-close"));
107
+ },
108
+ onResize: function() {
109
+ this.scaffoldCamera ||= l(this.$refs.scaffold?.$module?.scene?.getZincCameraControls()), this.scaffoldCamera && this.scaffoldCamera.onResize();
110
+ },
111
+ getState: function() {
112
+ return this.$refs.scaffold ? this.$refs.scaffold.getState() : this.entry.state;
113
+ },
114
+ search: function(e) {
115
+ if (this.$refs.scaffold) return this.$refs.scaffold.search(e, !0);
116
+ },
117
+ searchSuggestions: function(e, t) {
118
+ if (e === "" || !this.$refs.scaffold) return t;
119
+ this.$refs.scaffold.fetchSuggestions(e).forEach((e) => {
120
+ e.suggestion && t.push(e.suggestion);
121
+ });
122
+ },
123
+ showConnectivityTooltips: function(e) {
124
+ if (this.$refs.scaffold) {
125
+ if (e.label) this.$refs.scaffold.changeHighlightedByName([e.label], "", !1), this.$refs.scaffold.showRegionTooltip(e.label, !1, !1);
126
+ else {
127
+ let t = e.connectivityInfo["nerve-label"];
128
+ if (t) {
129
+ let e = t.flatMap((e) => e.subNerves);
130
+ this.$refs.scaffold.changeHighlightedByName(e, "", !1);
131
+ }
132
+ this.$refs.scaffold.hideRegionTooltip();
133
+ }
134
+ }
135
+ },
136
+ zoomToFeatures: function(e, t) {
137
+ if (this.$refs.scaffold) {
138
+ let n;
139
+ n = Array.isArray(e) ? e : [e.name], t && this.$refs.scaffold.changeActiveByName(n, "", !1), this.$refs.scaffold.viewRegion(n);
140
+ }
141
+ },
142
+ scaffoldIsReady: function() {
143
+ this.scaffoldLoaded = !0, this.$refs.scaffold.$module.graphicsHighlight.highlightColour = [
144
+ 1,
145
+ 0,
146
+ 1
147
+ ], this.scaffoldRef || (this.scaffoldRef = l(this.$refs.scaffold), this.scaffoldRef && (this.loadExplorerConfig(), this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities, this.connectivityFilterOptions = this.connectivitiesStore.filterOptions, this.connectivityFilterSources = this.connectivitiesStore.filterSources)), this.updateViewerSettings(), r.emit("mapLoaded", this.$refs.scaffold), setTimeout(() => {
148
+ this.setNerveGreyScale();
149
+ }, 500);
150
+ },
151
+ scaffoldHighlighted: function(e, t) {
152
+ let n = {
153
+ paneIndex: this.entry.id,
154
+ type: e,
155
+ resource: t,
156
+ internalName: void 0
157
+ };
158
+ t && t[0] && ((t[0].data?.id === void 0 || t[0].data?.id === "") && (t[0].data.id = t[0].data?.group), n.internalName = t[0].data.id, n.eventType = "highlighted"), this.$emit("resource-selected", n);
159
+ },
160
+ scaffoldNavigated: function(e, t) {
161
+ if (this.mouseHovered) {
162
+ let n = {
163
+ paneIndex: this.entry.id,
164
+ eventType: "panZoom",
165
+ payload: t,
166
+ type: e
167
+ };
168
+ this.$emit("resource-selected", n);
169
+ }
170
+ },
171
+ updateWithViewUrl: function(e) {
172
+ this.$refs.scaffold && this.$refs.scaffold.updateViewURL(e);
173
+ },
174
+ changeViewingMode: function(e) {
175
+ this.$refs.scaffold && this.$refs.scaffold.changeViewingMode(e);
176
+ },
177
+ updateViewerSettings: function() {
178
+ if (this.$refs.scaffold) {
179
+ let { backgroundDisplay: e, organsDisplay: t, outlinesDisplay: n, viewingMode: r } = this.settingsStore.globalSettings;
180
+ this.$refs.scaffold.backgroundChangeCallback(e), this.$refs.scaffold.changeViewingMode(r), this.$refs.scaffold.setColour(t), this.$refs.scaffold.setOutlines(n);
181
+ }
182
+ }
183
+ },
184
+ computed: {
185
+ warningMessage: function() {
186
+ 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";
187
+ },
188
+ markerLabels: function() {
189
+ return this.settingsStore.globalSettings.displayMarkers ? this.settingsStore.numberOfDatasetsForFacets : {};
190
+ }
191
+ },
192
+ watch: {
193
+ visible: {
194
+ handler(e) {
195
+ e && !this.activated && (this.activated = !0, this.$nextTick(() => {
196
+ this.$refs.scaffold && (this.scaffoldRef = l(this.$refs.scaffold), this.scaffoldRef && (this.loadExplorerConfig(), this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities, this.connectivityFilterOptions = this.connectivitiesStore.filterOptions, this.connectivityFilterSources = this.connectivitiesStore.filterSources));
197
+ }));
198
+ },
199
+ deep: !0,
200
+ immediate: !0
201
+ },
202
+ connectivityKnowledge: {
203
+ handler(e, t) {
204
+ if (this.entry.resource in e) {
205
+ let t = e[this.entry.resource];
206
+ t.length !== this.nervesKnowledge.length && (this.nervesKnowledge = t, this.scaffoldLoaded && this.setNerveGreyScale());
207
+ }
208
+ },
209
+ deep: !0,
210
+ immediate: !0
211
+ }
212
+ },
213
+ data: function() {
214
+ return {
215
+ activated: !1,
216
+ apiLocation: process.env.VUE_APP_API_LOCATION,
217
+ scaffoldCamera: void 0,
218
+ scaffoldLoaded: !1,
219
+ nervesKnowledge: [],
220
+ clickedObject: void 0,
221
+ filter: [],
222
+ query: ""
223
+ };
224
+ }
225
+ }, m = { class: "viewer-container" };
226
+ function h(e, t, n, r, i, a) {
227
+ let l = d("ScaffoldVuer"), f = d("HelpModeDialog");
228
+ return u(), c("div", m, [e.activated ? (u(), o(l, {
229
+ key: 0,
230
+ state: e.entry.state,
231
+ url: e.entry.resource,
232
+ region: e.entry.region,
233
+ onScaffoldSelected: t[0] ||= (t) => a.scaffoldResourceSelected(e.entry.type, t),
234
+ onScaffoldHighlighted: t[1] ||= (t) => a.scaffoldHighlighted(e.entry.type, t),
235
+ onScaffoldNavigated: t[2] ||= (t) => a.scaffoldNavigated(e.entry.type, t),
236
+ onOnReady: a.scaffoldIsReady,
237
+ onOpenMap: e.openMap,
238
+ ref: "scaffold",
239
+ "background-toggle": !0,
240
+ traditional: !0,
241
+ helpMode: e.helpMode,
242
+ helpModeActiveItem: e.helpModeActiveItem,
243
+ helpModeDialog: e.useHelpModeDialog,
244
+ onAnnotationOpen: e.onAnnotationOpen,
245
+ onAnnotationClose: e.onAnnotationClose,
246
+ onUpdateOfflineAnnotationEnabled: e.updateOfflineAnnotationEnabled,
247
+ annotationSidebar: e.annotationSidebar,
248
+ onHelpModeLastItem: e.onHelpModeLastItem,
249
+ onShownTooltip: e.onTooltipShown,
250
+ onShownMapTooltip: e.onMapTooltipShown,
251
+ render: e.visible,
252
+ "display-latest-message": !0,
253
+ "warning-message": a.warningMessage,
254
+ "display-minimap": !1,
255
+ "display-markers": !1,
256
+ "display-warning": !1,
257
+ enableOpenMapUI: !0,
258
+ "view-u-r-l": e.entry.viewUrl,
259
+ markerCluster: !0,
260
+ markerLabels: a.markerLabels,
261
+ flatmapAPI: e.flatmapAPI,
262
+ showLocalSettings: e.showLocalSettings,
263
+ showOpenMapButton: e.showOpenMapButton,
264
+ usageConfig: {
265
+ showTubeLinesControls: !1,
266
+ tubeLines: e.entry.discoverId === "307" || e.entry.discoverId === 307
267
+ }
268
+ }, null, 8, [
269
+ "state",
270
+ "url",
271
+ "region",
272
+ "onOnReady",
273
+ "onOpenMap",
274
+ "helpMode",
275
+ "helpModeActiveItem",
276
+ "helpModeDialog",
277
+ "onAnnotationOpen",
278
+ "onAnnotationClose",
279
+ "onUpdateOfflineAnnotationEnabled",
280
+ "annotationSidebar",
281
+ "onHelpModeLastItem",
282
+ "onShownTooltip",
283
+ "onShownMapTooltip",
284
+ "render",
285
+ "warning-message",
286
+ "view-u-r-l",
287
+ "markerLabels",
288
+ "flatmapAPI",
289
+ "showLocalSettings",
290
+ "showOpenMapButton",
291
+ "usageConfig"
292
+ ])) : s("", !0), e.helpMode && e.useHelpModeDialog ? (u(), o(f, {
293
+ key: 1,
294
+ ref: "scaffoldHelp",
295
+ scaffoldRef: e.scaffoldRef,
296
+ lastItem: e.helpModeLastItem,
297
+ onShowNext: e.onHelpModeShowNext,
298
+ onFinishHelpMode: e.onFinishHelpMode
299
+ }, null, 8, [
300
+ "scaffoldRef",
301
+ "lastItem",
302
+ "onShowNext",
303
+ "onFinishHelpMode"
304
+ ])) : s("", !0)]);
305
+ }
306
+ var g = /*#__PURE__*/ t(p, [["render", h], ["__scopeId", "data-v-f3cad357"]]);
307
+ //#endregion
308
+ export { g as default };
@@ -0,0 +1,25 @@
1
+ import { _ as e } from "./connectivities-UXTqf7_0.js";
2
+ import { t } from "./ContentMixin-Vn34n5t2.js";
3
+ import { createBlock as n, openBlock as r, resolveComponent as i } from "vue";
4
+ import { SimulationVuer as a } from "@abi-software/simulationvuer";
5
+ import "@abi-software/simulationvuer/dist/style.css";
6
+ //#region src/components/viewers/Simulation.vue
7
+ var o = {
8
+ name: "Simulation",
9
+ mixins: [t],
10
+ components: { SimulationVuer: a },
11
+ computed: { id: function() {
12
+ return this.entry.resource ? this.entry.resource : this.entry.discoverId;
13
+ } }
14
+ };
15
+ function s(e, t, a, o, s, c) {
16
+ let l = i("SimulationVuer");
17
+ return r(), n(l, {
18
+ apiLocation: e.apiLocation,
19
+ id: c.id,
20
+ ref: "simulation"
21
+ }, null, 8, ["apiLocation", "id"]);
22
+ }
23
+ var c = /*#__PURE__*/ e(o, [["render", s]]);
24
+ //#endregion
25
+ export { c as default };