@abi-software/mapintegratedvuer 1.2.0 → 1.2.1-beta.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.
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@abi-software/mapintegratedvuer",
3
- "version": "1.2.0",
3
+ "version": "1.2.1-beta.0",
4
4
  "license": "Apache-2.0",
5
5
  "scripts": {
6
6
  "serve": "vite --host --force",
7
- "build-bundle": "vite build",
7
+ "heroku-postbuild": "vite build",
8
+ "build-bundle": "vite build -c vite.bundle-build.js",
9
+ "build-static": "vite build -c vite.static-build.js",
10
+ "start": "vite build && vite preview",
8
11
  "test-unit": "mochapack --webpack-config test/unit/webpack.config.js --require test/unit/setup.js test/unit/**/*.spec.js",
9
12
  "test": "vitest --dom",
10
- "build-static": "vite build -c vite.static-build.js",
11
13
  "cypress": "cypress",
12
14
  "cypress-component": "cypress run --component",
13
15
  "report:merge": "mochawesome-merge cypress/results/json/*json > cypress/results/mochawesome-bundle.json",
@@ -48,14 +50,16 @@
48
50
  "*.js"
49
51
  ],
50
52
  "dependencies": {
51
- "@abi-software/flatmapvuer": "^1.1.2-alpha-6",
52
- "@abi-software/map-side-bar": "^2.2.1-alpha-3",
53
+ "@abi-software/flatmapvuer": "^1.2.0-beta.1",
54
+ "@abi-software/map-side-bar": "^2.2.1-beta.3",
55
+ "@abi-software/map-utilities": "^0.0.0-beta.4",
53
56
  "@abi-software/plotvuer": "1.0.0",
54
- "@abi-software/scaffoldvuer": "^1.2.0-beta.0",
57
+ "@abi-software/scaffoldvuer": "^1.2.1-beta.0",
55
58
  "@abi-software/simulationvuer": "1.0.0",
56
59
  "@abi-software/svg-sprite": "1.0.0",
57
60
  "@element-plus/icons-vue": "^2.3.1",
58
61
  "@pinia/testing": "^0.1.3",
62
+ "@vitejs/plugin-vue": "^4.6.2",
59
63
  "css-element-queries": "^1.2.3",
60
64
  "element-plus": "^2.4.4",
61
65
  "marked": "^4.3.0",
@@ -69,7 +73,6 @@
69
73
  },
70
74
  "devDependencies": {
71
75
  "@cypress/webpack-dev-server": "^3.6.1",
72
- "@vitejs/plugin-vue": "^4.6.2",
73
76
  "@vue/test-utils": "^2.4.4",
74
77
  "@vuese/markdown-render": "^2.11.3",
75
78
  "@vuese/parser": "^2.10.3",
@@ -130,5 +133,8 @@
130
133
  "browserslist": [
131
134
  "> 1%",
132
135
  "last 2 versions"
133
- ]
136
+ ],
137
+ "engines": {
138
+ "node": "18.17.1"
139
+ }
134
140
  }
package/public/index.html CHANGED
@@ -4,14 +4,15 @@
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
6
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
- <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
- <title>Physiome Portal</title>
7
+ <link rel="icon" href="favicon.ico">
8
+ <title>Map Viewer</title>
9
9
  </head>
10
10
  <body>
11
11
  <noscript>
12
- <strong>We're sorry but Physiome Portal doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
12
+ <strong>We're sorry but Map Viewer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13
13
  </noscript>
14
14
  <div id="app"></div>
15
+ <script type="module" src="/src/main.js"></script>
15
16
  <!-- built files will be auto injected -->
16
17
  </body>
17
18
  </html>
package/src/App.vue CHANGED
@@ -39,6 +39,7 @@
39
39
  :state="state"
40
40
  :shareLink="shareLink"
41
41
  :useHelpModeDialog="true"
42
+ :connectivityInfoSidebar="true"
42
43
  @updateShareLinkRequested="updateUUID"
43
44
  @isReady="mapIsReady"
44
45
  />
@@ -83,6 +83,13 @@ export default {
83
83
  type: Boolean,
84
84
  default: false,
85
85
  },
86
+ /**
87
+ * The option to show connectivity info in sidebar.
88
+ */
89
+ connectivityInfoSidebar: {
90
+ type: Boolean,
91
+ default: false,
92
+ },
86
93
  },
87
94
  data: function () {
88
95
  return {
@@ -319,6 +326,7 @@ export default {
319
326
  }
320
327
  this.isReady = true;
321
328
  this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog);
329
+ this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar);
322
330
  }
323
331
  }
324
332
 
@@ -23,8 +23,10 @@
23
23
  :envVars="envVars"
24
24
  :visible="sideBarVisibility"
25
25
  :class="['side-bar', { 'start-up': startUp }]"
26
- :activeId="activeDockedId"
26
+ :activeTabId="activeDockedId"
27
27
  :open-at-start="startUp"
28
+ :connectivityInfo="connectivityInfo"
29
+ @connectivity-info-close="onConnectivityInfoClose"
28
30
  @actionClick="actionClick"
29
31
  @tabClicked="tabClicked"
30
32
  @search-changed="searchChanged($event)"
@@ -98,6 +100,7 @@ export default {
98
100
  hoveredMarkerDelay: undefined,
99
101
  filterTriggered: false,
100
102
  availableFacets: [],
103
+ connectivityInfo: null,
101
104
  }
102
105
  },
103
106
  watch: {
@@ -139,6 +142,7 @@ export default {
139
142
  window.open(action.resource, "_blank");
140
143
  } else if (action.type == "Facet") {
141
144
  if (this.$refs.sideBar) {
145
+ this.closeConnectivityInfo();
142
146
  this.$refs.sideBar.addFilter(action);
143
147
  const { facet } = action;
144
148
  // GA Tagging
@@ -174,6 +178,7 @@ export default {
174
178
  }))
175
179
  );
176
180
  if (this.$refs.sideBar) {
181
+ this.closeConnectivityInfo();
177
182
  this.$refs.sideBar.openSearch(facets, "");
178
183
 
179
184
  const filterValuesArray = intersectArrays(this.availableFacets, action.labels);
@@ -383,10 +388,18 @@ export default {
383
388
  this.search = query;
384
389
  this._facets = facets;
385
390
  if (this.$refs && this.$refs.sideBar) {
391
+ this.closeConnectivityInfo();
386
392
  this.$refs.sideBar.openSearch(facets, query);
387
393
  }
388
394
  this.startUp = false;
389
395
  },
396
+ closeConnectivityInfo: function() {
397
+ // close all opened popups on DOM
398
+ const containerEl = this.$el;
399
+ containerEl.querySelectorAll('.maplibregl-popup-close-button').forEach((el) => {
400
+ el.click();
401
+ });
402
+ },
390
403
  onFullscreen: function (val) {
391
404
  this.$emit("onFullscreen", val);
392
405
  },
@@ -430,7 +443,7 @@ export default {
430
443
  this.$refs.splitdialog.sendSynchronisedEvent(result);
431
444
  }
432
445
  },
433
- tabClicked: function (id) {
446
+ tabClicked: function ({id, type}) {
434
447
  this.activeDockedId = id;
435
448
  },
436
449
  toggleSyncMode: function (payload) {
@@ -471,6 +484,16 @@ export default {
471
484
  'dataset_id': datasetId || ''
472
485
  });
473
486
  },
487
+ onConnectivityInfoClose: function () {
488
+ EventBus.emit('connectivity-info-close');
489
+ },
490
+ resetActivePathways: function () {
491
+ const containerEl = this.$el;
492
+ const activeCanvas = containerEl.querySelector('.maplibregl-canvas');
493
+ if (activeCanvas) {
494
+ activeCanvas.click();
495
+ }
496
+ },
474
497
  },
475
498
  created: function () {
476
499
  this._facets = [];
@@ -486,6 +509,18 @@ export default {
486
509
  EventBus.on("PopoverActionClick", payload => {
487
510
  this.actionClick(payload);
488
511
  });
512
+ EventBus.on('connectivity-info-open', payload => {
513
+ this.connectivityInfo = payload;
514
+ if (this.$refs.sideBar) {
515
+ this.tabClicked({id: 2, type: 'connectivity'});
516
+ this.$refs.sideBar.setDrawerOpen(true);
517
+ }
518
+ });
519
+ EventBus.on('connectivity-info-close', payload => {
520
+ this.tabClicked({id: 1, type: 'search'});
521
+ this.connectivityInfo = null;
522
+ this.resetActivePathways();
523
+ });
489
524
  EventBus.on("OpenNewMap", type => {
490
525
  this.openNewMap(type);
491
526
  });
@@ -15,6 +15,9 @@
15
15
  @help-mode-last-item="onHelpModeLastItem"
16
16
  @shown-tooltip="onTooltipShown"
17
17
  @shown-map-tooltip="onMapTooltipShown"
18
+ @connectivity-info-open="onConnectivityInfoOpen"
19
+ @connectivity-info-close="onConnectivityInfoClose"
20
+ :connectivityInfoSidebar="connectivityInfoSidebar"
18
21
  :pathControls="true"
19
22
  ref="flatmap"
20
23
  @ready="flatmapReadyCall"
@@ -40,13 +43,16 @@
40
43
 
41
44
  <script>
42
45
  /* eslint-disable no-alert, no-console */
43
- import { FlatmapVuer, HelpModeDialog } from "@abi-software/flatmapvuer";
44
46
  import Tagging from '../../services/tagging.js';
45
47
  import EventBus from "../EventBus";
46
48
  import ContentMixin from "../../mixins/ContentMixin";
47
49
  import DynamicMarkerMixin from "../../mixins/DynamicMarkerMixin";
48
50
  import { transformObjToString } from '../scripts/utilities';
51
+
52
+ import { FlatmapVuer } from "@abi-software/flatmapvuer";
49
53
  import "@abi-software/flatmapvuer/dist/style.css";
54
+ import { HelpModeDialog } from '@abi-software/map-utilities'
55
+ import '@abi-software/map-utilities/dist/style.css'
50
56
 
51
57
  export default {
52
58
  name: "Flatmap",
@@ -176,7 +182,7 @@ export default {
176
182
  }
177
183
 
178
184
  :deep(.maplibregl-popup) {
179
- z-index: 3;
185
+ z-index: 11;
180
186
  }
181
187
 
182
188
  :deep(.flatmapvuer-popover) {
@@ -14,6 +14,9 @@
14
14
  @help-mode-last-item="onHelpModeLastItem"
15
15
  @shown-tooltip="onTooltipShown"
16
16
  @shown-map-tooltip="onMapTooltipShown"
17
+ @connectivity-info-open="onConnectivityInfoOpen"
18
+ @connectivity-info-close="onConnectivityInfoClose"
19
+ :connectivityInfoSidebar="connectivityInfoSidebar"
17
20
  ref="multiflatmap"
18
21
  :displayMinimap="true"
19
22
  :showStarInLegend="showStarInLegend"
@@ -42,7 +45,6 @@
42
45
  <script>
43
46
  /* eslint-disable no-alert, no-console */
44
47
  import Tagging from '../../services/tagging.js';
45
- import { MultiFlatmapVuer, HelpModeDialog } from "@abi-software/flatmapvuer";
46
48
  import ContentMixin from "../../mixins/ContentMixin";
47
49
  import EventBus from "../EventBus";
48
50
  import {
@@ -52,8 +54,12 @@ import {
52
54
  } from "../scripts/utilities";
53
55
  import DyncamicMarkerMixin from "../../mixins/DynamicMarkerMixin";
54
56
 
55
- import "@abi-software/flatmapvuer/dist/style.css";
56
57
  import YellowStar from "../../icons/yellowstar";
58
+
59
+ import { MultiFlatmapVuer } from "@abi-software/flatmapvuer";
60
+ import "@abi-software/flatmapvuer/dist/style.css";
61
+ import { HelpModeDialog } from '@abi-software/map-utilities'
62
+ import '@abi-software/map-utilities/dist/style.css'
57
63
 
58
64
  const getOpenMapOptions = (species) => {
59
65
  const options = [
@@ -306,6 +312,7 @@ export default {
306
312
  await this.toggleSyncMode();
307
313
  }
308
314
  this.updateProvCard();
315
+ this.onConnectivityInfoClose();
309
316
 
310
317
  // GA Tagging
311
318
  // Event tracking for maps' species change
@@ -441,7 +448,7 @@ export default {
441
448
  }
442
449
 
443
450
  :deep(.maplibregl-popup) {
444
- z-index: 3;
451
+ z-index: 11;
445
452
  }
446
453
 
447
454
  :deep(.maplibregl-marker) {
@@ -44,10 +44,12 @@
44
44
  <script>
45
45
  /* eslint-disable no-alert, no-console */
46
46
  import EventBus from "../EventBus";
47
- import { ScaffoldVuer, HelpModeDialog } from "@abi-software/scaffoldvuer";
48
47
  import ContentMixin from "../../mixins/ContentMixin";
49
48
 
49
+ import { ScaffoldVuer } from "@abi-software/scaffoldvuer";
50
50
  import "@abi-software/scaffoldvuer/dist/style.css";
51
+ import { HelpModeDialog } from '@abi-software/map-utilities'
52
+ import '@abi-software/map-utilities/dist/style.css'
51
53
 
52
54
  export default {
53
55
  name: "Scaffold",
@@ -41,6 +41,9 @@ export default {
41
41
  useHelpModeDialog() {
42
42
  return this.settingsStore.useHelpModeDialog;
43
43
  },
44
+ connectivityInfoSidebar() {
45
+ return this.settingsStore.connectivityInfoSidebar;
46
+ },
44
47
  },
45
48
  mounted: function () {
46
49
  EventBus.on("startHelp", () => {
@@ -66,6 +69,8 @@ export default {
66
69
  EventBus.emit("OpenNewMap", type);
67
70
  this.trackOpenMap(`open_new_${type}_map`);
68
71
  }
72
+
73
+ this.onConnectivityInfoClose();
69
74
  },
70
75
  trackOpenMap: function (category) {
71
76
  // GA Tagging
@@ -486,6 +491,12 @@ export default {
486
491
  this.endHelp();
487
492
  }
488
493
  },
494
+ onConnectivityInfoOpen: function (connectivityInfoData) {
495
+ EventBus.emit('connectivity-info-open', connectivityInfoData);
496
+ },
497
+ onConnectivityInfoClose: function () {
498
+ EventBus.emit('connectivity-info-close');
499
+ },
489
500
  },
490
501
  data: function () {
491
502
  return {
@@ -26,6 +26,7 @@ export const useSettingsStore = defineStore('settings', {
26
26
  featuredDatasetIdentifiers: [],
27
27
  helpDelay: 0,
28
28
  useHelpModeDialog: false,
29
+ connectivityInfoSidebar: false,
29
30
  }
30
31
  },
31
32
  getters: {
@@ -150,5 +151,8 @@ export const useSettingsStore = defineStore('settings', {
150
151
  updateUseHelpModeDialog(helpModeOption) {
151
152
  this.useHelpModeDialog = helpModeOption;
152
153
  },
154
+ updateConnectivityInfoSidebar(connectivityInfoSidebar) {
155
+ this.connectivityInfoSidebar = connectivityInfoSidebar;
156
+ },
153
157
  }
154
158
  });
@@ -0,0 +1,26 @@
1
+ import path from "path";
2
+ import { defineConfig } from 'vite'
3
+ import rootConfig from './vite.config.js'
4
+
5
+ // defineWorkspace provides a nice type hinting DX
6
+ export default defineConfig((configEnv) => {
7
+ const config = rootConfig(configEnv);
8
+ config.build = {
9
+ lib: {
10
+ entry: path.resolve(__dirname, "./src/components/index.js"),
11
+ name: "MapintegratedVuer",
12
+ fileName: "mapintegratedvuer",
13
+ },
14
+ rollupOptions: {
15
+ external: ["vue", "pinia"],
16
+ output: {
17
+ globals: {
18
+ vue: "Vue",
19
+ pinia: "pinia",
20
+ },
21
+ },
22
+ },
23
+ };
24
+
25
+ return config;
26
+ })
package/vite.config.js CHANGED
@@ -1,70 +1,53 @@
1
- import path from "path";
2
- import { defineConfig } from 'vite'
3
- import vue from '@vitejs/plugin-vue'
4
- import Components from 'unplugin-vue-components/vite'
5
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
1
+ import { defineConfig } from "vite";
2
+ import vue from "@vitejs/plugin-vue";
3
+ import Components from "unplugin-vue-components/vite";
4
+ import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
6
5
 
7
6
  // https://vitejs.dev/config/
8
7
  export default defineConfig(({ command, mode }) => {
9
8
  const config = {
10
9
  css: {
11
- preprocessorOptions: {
12
- scss: {
13
- additionalData: `@use './src/assets/styles' as *;`
14
- },
10
+ preprocessorOptions: {
11
+ scss: {
12
+ additionalData: `@use './src/assets/styles' as *;`,
15
13
  },
14
+ },
16
15
  },
17
16
  plugins: [
18
- vue(),
19
- Components({
20
- // allow auto load markdown components under `./src/components/`
21
- extensions: ['vue', 'md'],
22
- // allow auto import and register components used in markdown
23
- include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
24
- resolvers: [
25
- ElementPlusResolver({
26
- importStyle: 'sass',
27
- }),
28
- ],
29
- dts: 'src/components.d.ts',
30
- }),
17
+ vue(),
18
+ Components({
19
+ // allow auto load markdown components under `./src/components/`
20
+ extensions: ["vue", "md"],
21
+ // allow auto import and register components used in markdown
22
+ include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
23
+ resolvers: [
24
+ ElementPlusResolver({
25
+ importStyle: "sass",
26
+ }),
27
+ ],
28
+ dts: "src/components.d.ts",
29
+ }),
31
30
 
32
- // https://github.com/antfu/unocss
33
- // see unocss.config.ts for config
31
+ // https://github.com/antfu/unocss
32
+ // see unocss.config.ts for config
34
33
  ],
35
- build: {
36
- lib: {
37
- entry: path.resolve(__dirname, "./src/components/index.js"),
38
- name: "MapintegratedVuer",
39
- fileName: 'mapintegratedvuer',
40
- },
41
- rollupOptions: {
42
- external: ["vue", "pinia"],
43
- output: {
44
- globals: {
45
- vue: "Vue",
46
- pinia: "pinia"
47
- },
48
- },
49
- },
50
- },
51
34
  // for cypress component test
52
35
  // to prevent reloading after optimized dependencies changed
53
36
  optimizeDeps: {
54
- exclude: ['vue-router'],
37
+ exclude: ["vue-router"],
55
38
  },
56
39
  };
57
40
 
58
- if (command === 'serve') {
59
- config.server = {
41
+ if (command === "serve") {
42
+ config.server = {
60
43
  port: 8081,
61
44
  };
62
45
  config.define = {
63
- 'process.env.HTTP_PROXY': 8081,
64
- global: 'globalThis',
46
+ "process.env.HTTP_PROXY": 8081,
47
+ global: "globalThis",
65
48
  // If you want to exposes all env variables, which is not recommended
66
49
  // 'process.env': env
67
50
  };
68
- };
51
+ }
69
52
  return config;
70
- })
53
+ });
@@ -1,66 +0,0 @@
1
- import { mapStores as n } from "pinia";
2
- import { u as p } from "./index-pesDJRzH.js";
3
- const d = function(r) {
4
- return r ? [...new Set(r.map((e) => JSON.stringify(e)))].map(
5
- (e) => JSON.parse(e)
6
- ) : [];
7
- }, f = {
8
- computed: {
9
- ...n(p)
10
- },
11
- methods: {
12
- flatmapPanZoomCallback: function(r) {
13
- if (this.mouseHovered) {
14
- const e = {
15
- paneIndex: this.entry.id,
16
- eventType: "panZoom",
17
- payload: r,
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(r) {
28
- if (!this.flatmapReady)
29
- return;
30
- let e = r;
31
- if (e || (e = this.getFlatmapImp()), e) {
32
- let m = this.settingsStore.markers;
33
- m = d(m);
34
- let i = this.removeMarkersNotOnFlatmap(e, m);
35
- e.clearMarkers(), e.clearDatasetMarkers(), e.addDatasetMarkers(i);
36
- let l = this.settingsStore.hoveredMarkers, t = this.settingsStore.previousHoveredMarkers;
37
- l.forEach((a) => {
38
- e.addMarker(a, { className: "standard-marker hovered", cluster: !1 });
39
- }), t !== null && t.length >= 0 && t.forEach((a) => {
40
- e.addMarker(a, { className: "standard-marker", cluster: !0 });
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(r, e) {
46
- let m = r.anatomicalIdentifiers, i = [];
47
- for (let l = 0; l < e.length; l++) {
48
- let t = e[l], a = { id: t.id, terms: [] };
49
- for (let s = 0; s < t.terms.length; s++)
50
- m.includes(t.terms[s]) && a.terms.push(t.terms[s]);
51
- i.push(a);
52
- }
53
- return i;
54
- },
55
- flatmapReadyForMarkerUpdates: function(r) {
56
- if (r) {
57
- r.enablePanZoomEvents(!0), this.flatmapReady = !0;
58
- const e = r.mapImp;
59
- this.flatmapMarkerUpdate(e);
60
- }
61
- }
62
- }
63
- };
64
- export {
65
- f as D
66
- };