@abi-software/mapintegratedvuer 1.9.0-externalise.1 → 1.9.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.
@@ -2,6 +2,7 @@ import { defineStore } from 'pinia';
2
2
  import {
3
3
  getAvailableTermsForSpecies,
4
4
  } from "../components/SimulatedData.js";
5
+ import EventBus from '../components/EventBus.js';
5
6
 
6
7
  /* eslint-disable no-alert, no-console */
7
8
  const presetLayouts = (view) => {
@@ -12,13 +13,13 @@ const presetLayouts = (view) => {
12
13
  "pane-1": {content: true, id: 1},
13
14
  "pane-2": {content: true, id: 2},
14
15
  };
15
- case "2vertpanel":
16
+ case "2vertpanel":
16
17
  return {
17
18
  "split-1": {content: false, horizontal: false, children: ["pane-1", "pane-2"]},
18
19
  "pane-1": {content: true, id: 1},
19
20
  "pane-2": {content: true, id: 2},
20
21
  }
21
- case "3panel":
22
+ case "3panel":
22
23
  return {
23
24
  "split-1": {content: false, horizontal: false, children: ["pane-1", "split-2"]},
24
25
  "split-2": {content: false, horizontal: true, children: ["pane-2", "pane-3"]},
@@ -26,7 +27,7 @@ const presetLayouts = (view) => {
26
27
  "pane-2": {content: true, id: 2},
27
28
  "pane-3": {content: true, id: 3},
28
29
  }
29
- case "4panel":
30
+ case "4panel":
30
31
  return {
31
32
  "split-1": {content: false, horizontal: false, children: ["split-3", "split-2"]},
32
33
  "split-2": {content: false, horizontal: true, children: ["pane-2", "pane-3"]},
@@ -36,7 +37,7 @@ const presetLayouts = (view) => {
36
37
  "pane-3": {content: true, id: 3},
37
38
  "pane-4": {content: true, id: 4},
38
39
  }
39
- case "5panel":
40
+ case "5panel":
40
41
  return {
41
42
  "split-1": {content: false, horizontal: true, children: ["split-3", "split-2"]},
42
43
  "split-2": {content: false, horizontal: false, children: ["pane-2", "pane-3"]},
@@ -47,7 +48,7 @@ const presetLayouts = (view) => {
47
48
  "pane-4": {content: true, id: 4},
48
49
  "pane-5": {content: true, id: 5},
49
50
  }
50
- case "6panel":
51
+ case "6panel":
51
52
  return {
52
53
  "split-1": {content: false, horizontal: true, children: ["split-3", "split-2"]},
53
54
  "split-2": {content: false, horizontal: false, children: ["pane-2", "pane-3", "pane-5"]},
@@ -199,6 +200,7 @@ export const useSplitFlowStore = defineStore('splitFlow', {
199
200
  if (sourceKey) {
200
201
  this.customLayout[sourceKey].id = payload.target;
201
202
  }
203
+ this.updateSplitPanels();
202
204
  },
203
205
  getAvailableTerms(apiLocation) {
204
206
  let terms = getAvailableTermsForSpecies();
@@ -246,6 +248,7 @@ export const useSplitFlowStore = defineStore('splitFlow', {
246
248
  for (const [key, value] of Object.entries(customLayout)) {
247
249
  this.customLayout[key] = value;
248
250
  }
251
+ this.updateSplitPanels();
249
252
  },
250
253
  setSplitter(payload) {
251
254
  if (this.splitters[payload.name])
@@ -317,7 +320,7 @@ export const useSplitFlowStore = defineStore('splitFlow', {
317
320
  },
318
321
  setSyncMode(payload) {
319
322
  if (payload) {
320
- //Force the second slot to be the new viewer in payload and change the
323
+ //Force the second slot to be the new viewer in payload and change the
321
324
  //view to the payload's layout
322
325
  //this.customLayout["pane-2"].id = id;
323
326
  if (payload.flag === true) {
@@ -553,7 +556,11 @@ export const useSplitFlowStore = defineStore('splitFlow', {
553
556
  this.customLayout[key] = value;
554
557
  }
555
558
  }
559
+ this.updateSplitPanels();
556
560
  }
557
- }
561
+ },
562
+ updateSplitPanels() {
563
+ EventBus.emit('species-layout-connectivity-update');
564
+ },
558
565
  }
559
566
  });
@@ -12,16 +12,13 @@ export default defineConfig((configEnv) => {
12
12
  fileName: "mapintegratedvuer",
13
13
  },
14
14
  rollupOptions: {
15
- external: ["vue", "pinia", "@abi-software/flatmapvuer", "@abi-software/plotvuer",
16
- "@abi-software/scaffoldvuer", "@abi-software/simulationvuer"],
15
+ external: ["vue", "pinia", "@abi-software/plotvuer", "@abi-software/simulationvuer"],
17
16
  output: {
18
17
  globals: {
19
18
  vue: "Vue",
20
19
  pinia: "pinia",
21
- "@abi-software/flatmapvuer": "flatmapvuer",
22
- "@abi-software/plotvuer": "plotvuer",
23
- "@abi-software/scaffoldvuer": "scaffoldvuer",
24
20
  "@abi-software/simulationvuer": "simulationvuer",
21
+ "@abi-software/plotvuer": "plotvuer",
25
22
  },
26
23
  },
27
24
  },
@@ -1,180 +0,0 @@
1
- import { _ as p, G as c, E as l } from "./index-DXbdAVdH.js";
2
- import { C as u } from "./ContentMixin-DuzUGOr7.js";
3
- import { ScaffoldVuer as m } from "@abi-software/scaffoldvuer";
4
- import { resolveComponent as r, openBlock as f, createElementBlock as g, createVNode as y, createBlock as M, createCommentVNode as S } from "vue";
5
- const v = {
6
- name: "Scaffold",
7
- mixins: [u],
8
- components: {
9
- ScaffoldVuer: m,
10
- HelpModeDialog: c
11
- },
12
- methods: {
13
- onResize: function() {
14
- this.scaffoldCamera.onResize();
15
- },
16
- getState: function() {
17
- return this.$refs.scaffold.getState();
18
- },
19
- /**
20
- * Perform a local search on this contentvuer
21
- */
22
- search: function(e) {
23
- return this.$refs.scaffold.search(e, !0);
24
- },
25
- searchSuggestions: function(e, o) {
26
- if (e === "" || !this.$refs.scaffold)
27
- return o;
28
- this.$refs.scaffold.fetchSuggestions(e).forEach((a) => {
29
- a.suggestion && o.push(a.suggestion);
30
- });
31
- },
32
- /**
33
- * Handle sync pan zoom event
34
- */
35
- handleSyncPanZoomEvent: function(e) {
36
- if (!this.mouseHovered && e.type !== this.entry.type) {
37
- const o = e.payload.origin, t = e.payload.size, a = [o[0] + t[0] / 2, o[1] + t[1] / 2], i = [
38
- (a[0] - 0.5) * 2,
39
- (0.5 - a[1]) * 2
40
- ], n = 1 / Math.max(t[0], t[1]);
41
- this.$refs.scaffold.$module.setSyncControlCenterZoom(
42
- i,
43
- n
44
- );
45
- }
46
- },
47
- displayTooltip: function(e) {
48
- let o;
49
- e && (o = e.name), o ? this.$refs.scaffold.search(o, !0) : this.$refs.scaffold.hideRegionTooltip();
50
- },
51
- zoomToFeatures: function(e, o) {
52
- let t;
53
- Array.isArray(e) ? t = e : t = [e.name], o && this.$refs.scaffold.changeActiveByName(t, "", !1), this.$refs.scaffold.viewRegion(t);
54
- },
55
- highlightFeatures: function(e) {
56
- let o;
57
- Array.isArray(e) ? o = e : o = [e.name], this.$refs.scaffold.changeHighlightedByName(o, "", !1);
58
- },
59
- scaffoldIsReady: function() {
60
- if (this.scaffoldLoaded = !0, this.$refs.scaffold.$module.graphicsHighlight.highlightColour = [1, 0, 1], this.isVisible()) {
61
- let e = "free";
62
- this.entry.rotation && (e = this.entry.rotation), this.$refs.scaffold.toggleSyncControl(this.splitFlowStore.globalCallback, e), this.splitFlowStore.syncMode && this.$refs.scaffold.fitWindow();
63
- }
64
- l.emit("mapLoaded", this.$refs.scaffold);
65
- },
66
- requestSynchronisedEvent: function(e) {
67
- if (this.scaffoldLoaded) {
68
- let o = "free";
69
- this.entry.rotation && (o = this.entry.rotation), this.$refs.scaffold.toggleSyncControl(e, o);
70
- }
71
- },
72
- /**
73
- * Callback when the vuers emit a selected event.
74
- */
75
- scaffoldHighlighted: function(e, o) {
76
- var a, i, n;
77
- const t = {
78
- paneIndex: this.entry.id,
79
- type: e,
80
- resource: o,
81
- internalName: void 0
82
- };
83
- o && o[0] && ((((a = o[0].data) == null ? void 0 : a.id) === void 0 || ((i = o[0].data) == null ? void 0 : i.id) === "") && (o[0].data.id = (n = o[0].data) == null ? void 0 : n.group), t.internalName = o[0].data.id, t.eventType = "highlighted"), this.$emit("resource-selected", t);
84
- },
85
- /**
86
- * Callback when the vuers emit a selected event.
87
- */
88
- scaffoldNavigated: function(e, o) {
89
- if (this.mouseHovered) {
90
- const t = {
91
- paneIndex: this.entry.id,
92
- eventType: "panZoom",
93
- payload: o,
94
- type: e
95
- };
96
- this.$emit("resource-selected", t);
97
- }
98
- },
99
- updateWithViewUrl: function(e) {
100
- this.$refs.scaffold.updateViewURL(e);
101
- },
102
- /**
103
- * Change the view mode of the current scaffold
104
- */
105
- changeViewingMode: function(e) {
106
- this.$refs.scaffold.changeViewingMode(e);
107
- }
108
- },
109
- computed: {
110
- warningMessage: function() {
111
- return this.entry.isBodyScaffold ? "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";
112
- },
113
- markerLabels: function() {
114
- return this.settingsStore.globalSettings.displayMarkers ? this.settingsStore.numberOfDatasetsForFacets : {};
115
- }
116
- },
117
- data: function() {
118
- return {
119
- apiLocation: process.env.VUE_APP_API_LOCATION,
120
- scaffoldCamera: void 0,
121
- scaffoldLoaded: !1
122
- };
123
- },
124
- mounted: function() {
125
- this.scaffoldCamera = this.$refs.scaffold.$module.scene.getZincCameraControls(), l.on("startHelp", () => {
126
- this.startHelp();
127
- }), l.on("hoverUpdate", () => {
128
- this.scaffoldLoaded && this.cardHoverHighlight();
129
- });
130
- }
131
- }, w = { class: "viewer-container" };
132
- function H(e, o, t, a, i, n) {
133
- const d = r("ScaffoldVuer"), h = r("HelpModeDialog");
134
- return f(), g("div", w, [
135
- y(d, {
136
- state: e.entry.state,
137
- url: e.entry.resource,
138
- region: e.entry.region,
139
- onScaffoldSelected: o[0] || (o[0] = (s) => e.resourceSelected(e.entry.type, s, !0)),
140
- onScaffoldHighlighted: o[1] || (o[1] = (s) => n.scaffoldHighlighted(e.entry.type, s)),
141
- onScaffoldNavigated: o[2] || (o[2] = (s) => n.scaffoldNavigated(e.entry.type, s)),
142
- onOnReady: n.scaffoldIsReady,
143
- onOpenMap: e.openMap,
144
- ref: "scaffold",
145
- "background-toggle": !0,
146
- traditional: !0,
147
- helpMode: e.helpMode,
148
- helpModeActiveItem: e.helpModeActiveItem,
149
- helpModeDialog: e.useHelpModeDialog,
150
- onAnnotationOpen: e.onAnnotationOpen,
151
- onAnnotationClose: e.onAnnotationClose,
152
- annotationSidebar: e.annotationSidebar,
153
- onHelpModeLastItem: e.onHelpModeLastItem,
154
- onShownTooltip: e.onTooltipShown,
155
- onShownMapTooltip: e.onMapTooltipShown,
156
- render: e.visible,
157
- "display-latest-message": !0,
158
- "warning-message": n.warningMessage,
159
- "display-minimap": !1,
160
- "display-markers": !1,
161
- enableOpenMapUI: !0,
162
- "view-u-r-l": e.entry.viewUrl,
163
- markerCluster: !0,
164
- markerLabels: n.markerLabels,
165
- flatmapAPI: e.flatmapAPI
166
- }, null, 8, ["state", "url", "region", "onOnReady", "onOpenMap", "helpMode", "helpModeActiveItem", "helpModeDialog", "onAnnotationOpen", "onAnnotationClose", "annotationSidebar", "onHelpModeLastItem", "onShownTooltip", "onShownMapTooltip", "render", "warning-message", "view-u-r-l", "markerLabels", "flatmapAPI"]),
167
- e.helpMode && e.useHelpModeDialog ? (f(), M(h, {
168
- key: 0,
169
- ref: "scaffoldHelp",
170
- scaffoldRef: e.scaffoldRef,
171
- lastItem: e.helpModeLastItem,
172
- onShowNext: e.onHelpModeShowNext,
173
- onFinishHelpMode: e.onFinishHelpMode
174
- }, null, 8, ["scaffoldRef", "lastItem", "onShowNext", "onFinishHelpMode"])) : S("", !0)
175
- ]);
176
- }
177
- const b = /* @__PURE__ */ p(v, [["render", H], ["__scopeId", "data-v-fa031bde"]]);
178
- export {
179
- b as default
180
- };
@@ -1,66 +0,0 @@
1
- import { mapStores as l } from "pinia";
2
- import { u as o } from "./index-DXbdAVdH.js";
3
- const p = function(t) {
4
- return t ? [...new Set(t.map((e) => JSON.stringify(e)))].map(
5
- (e) => JSON.parse(e)
6
- ) : [];
7
- }, c = {
8
- computed: {
9
- ...l(o)
10
- },
11
- methods: {
12
- flatmapPanZoomCallback: function(t) {
13
- if (this.mouseHovered) {
14
- const e = {
15
- paneIndex: this.entry.id,
16
- eventType: "panZoom",
17
- payload: t,
18
- type: this.entry.type
19
- };
20
- this.$emit("resource-selected", e);
21
- }
22
- },
23
- /**
24
- * Function used for updating the flatmap markers.
25
- * We set the markers based on what was searched and the flatmap clusters them.
26
- */
27
- flatmapMarkerUpdate(t) {
28
- if (!this.flatmapReady) return;
29
- let e = t;
30
- if (e || (e = this.getFlatmapImp()), e) {
31
- let i = this.settingsStore.globalSettings.displayMarkers ? this.settingsStore.markers : [];
32
- i = p(i);
33
- let s = this.removeMarkersNotOnFlatmap(e, i);
34
- if (e.clearMarkers(), e.clearDatasetMarkers(), this.entry.resource === "FunctionalConnectivity") {
35
- let a = [];
36
- for (let r = 0; r < s.length; r++)
37
- a = a.concat(s[r].terms);
38
- e.addMarkers(Array.from(new Set(a)), { className: "standard-marker", cluster: !1 });
39
- } else
40
- e.addDatasetMarkers(s);
41
- this.entry.type === "MultiFlatmap" && this.restoreFeaturedMarkers(e);
42
- }
43
- },
44
- // removeMarkersNotOnFlatmap: rewrites the dataset marker list to only include markers that are on the flatmap
45
- removeMarkersNotOnFlatmap(t, e) {
46
- let i = t.anatomicalIdentifiers, s = [];
47
- for (let a = 0; a < e.length; a++) {
48
- let r = e[a], n = { id: r.id, terms: [] };
49
- for (let m = 0; m < r.terms.length; m++)
50
- i.includes(r.terms[m]) && n.terms.push(r.terms[m]);
51
- s.push(n);
52
- }
53
- return s;
54
- },
55
- flatmapReadyForMarkerUpdates: function(t) {
56
- if (t) {
57
- t.enablePanZoomEvents(!0), this.flatmapReady = !0;
58
- const e = t.mapImp;
59
- this.flatmapMarkerUpdate(e);
60
- }
61
- }
62
- }
63
- };
64
- export {
65
- c as D
66
- };