@abi-software/scaffoldvuer 0.3.1 → 0.3.2-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,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/scaffoldvuer",
3
- "version": "0.3.1",
3
+ "version": "0.3.2-beta.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,6 +29,7 @@
29
29
  "*.js"
30
30
  ],
31
31
  "dependencies": {
32
+ "@abi-software/flatmapvuer": "^0.5.9-beta.3",
32
33
  "@abi-software/svg-sprite": "^0.3.0",
33
34
  "axios": "^0.21.2",
34
35
  "core-js": "^3.22.5",
package/src/App.vue CHANGED
@@ -8,6 +8,7 @@
8
8
  <ScaffoldVuer
9
9
  ref="scaffold"
10
10
  class="vuer"
11
+ :flatmapAPI="flatmapAPI"
11
12
  :display-u-i="displayUI"
12
13
  :url="url"
13
14
  :help-mode="helpMode"
@@ -341,6 +342,7 @@ export default {
341
342
  searchText: "",
342
343
  loadTextureVolumeOnReady: false,
343
344
  readyCallback: undefined,
345
+ flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v4/",
344
346
  };
345
347
  },
346
348
  watch: {
@@ -12,6 +12,13 @@
12
12
  <template v-popover:tooltip>
13
13
  <div class="tooltip-text">{{ label }}</div>
14
14
  <div class="tooltip-text" v-if="region">Region: {{ region }}</div>
15
+ <Tooltip
16
+ class="p-tooltip"
17
+ v-show="annotationDisplay"
18
+ ref="annotationTooltip"
19
+ :annotationDisplay="true"
20
+ :annotationEntry="annotationEntry"
21
+ />
15
22
  </template>
16
23
  </el-popover>
17
24
  </div>
@@ -21,6 +28,7 @@
21
28
  /* eslint-disable no-alert, no-console */
22
29
  import Vue from "vue";
23
30
  import { Popover } from "element-ui";
31
+ import Tooltip from "@abi-software/flatmapvuer/src/components/Tooltip";
24
32
  import lang from "element-ui/lib/locale/lang/en";
25
33
  import locale from "element-ui/lib/locale";
26
34
 
@@ -32,11 +40,18 @@ Vue.use(Popover);
32
40
  */
33
41
  export default {
34
42
  name: "ScaffoldTooltip",
43
+ components: {
44
+ Tooltip,
45
+ },
35
46
  props: {
36
47
  label: {
37
48
  type: String,
38
49
  default: "",
39
50
  },
51
+ annotationDisplay: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
40
55
  region: {
41
56
  type: String,
42
57
  default: "",
@@ -54,9 +69,11 @@ export default {
54
69
  default: 200,
55
70
  },
56
71
  },
72
+ inject: ['scaffoldUrl'],
57
73
  data: function () {
58
74
  return {
59
75
  display: false,
76
+ annotationEntry: { }
60
77
  };
61
78
  },
62
79
  computed: {
@@ -69,23 +86,43 @@ export default {
69
86
  return { left: x + "px", top: this.y - yOffset + "px" };
70
87
  },
71
88
  },
89
+ methods: {
90
+ checkForDisplay: function () {
91
+ if (this.visible && this.label && this.label !== "") {
92
+ this.display = true;
93
+ if (this.annotationDisplay) {
94
+ const region = this.region ? this.region +"/" : "";
95
+ this.annotationEntry = {
96
+ "featureId": encodeURIComponent(region + this.label),
97
+ "resourceId": encodeURIComponent(this.scaffoldUrl),
98
+ };
99
+ }
100
+ }
101
+ else {
102
+ this.display = false;
103
+ this.annotationEntry = { };
104
+ }
105
+ }
106
+ },
72
107
  watch: {
73
108
  label: {
74
109
  handler: function () {
75
- if (this.visible && this.label && this.label !== "")
76
- this.display = true;
77
- else this.display = false;
110
+ this.checkForDisplay();
78
111
  },
79
112
  immediate: true,
80
113
  },
81
114
  visible: {
82
115
  handler: function () {
83
- if (this.visible && this.label && this.label !== "")
84
- this.display = true;
85
- else this.display = false;
116
+ this.checkForDisplay();
86
117
  },
87
118
  immediate: true,
88
119
  },
120
+ annotationDisplay: {
121
+ handler: function () {
122
+ this.checkForDisplay();
123
+ },
124
+ immediate: true,
125
+ }
89
126
  },
90
127
  };
91
128
  </script>
@@ -138,5 +175,17 @@ export default {
138
175
  user-select: none;
139
176
  pointer-events: none;
140
177
  }
178
+
179
+ .p-tooltip {
180
+ display: flex;
181
+ width: 300px;
182
+ white-space:normal;
183
+ .attribute-content {
184
+ color: rgb(44, 62, 80);
185
+ }
186
+ &::before, &::after {
187
+ display:none;
188
+ }
189
+ }
141
190
  }
142
191
  </style>
@@ -14,6 +14,7 @@
14
14
  :visible="tData.visible"
15
15
  :x="tData.x"
16
16
  :y="tData.y"
17
+ :annotationDisplay="viewingMode === 'Annotation' && tData.active === true"
17
18
  />
18
19
  <div
19
20
  id="organsDisplayArea"
@@ -246,6 +247,23 @@
246
247
  trigger="click"
247
248
  popper-class="background-popper non-selectable"
248
249
  >
250
+ <el-row class="backgroundText">Viewing Mode</el-row>
251
+ <el-row class="backgroundControl">
252
+ <el-select
253
+ :popper-append-to-body="false"
254
+ v-model="viewingMode"
255
+ placeholder="Select"
256
+ class="select-box viewing-mode"
257
+ popper-class="scaffold_viewer_dropdownr"
258
+ >
259
+ <el-option v-for="item in viewingModes" :key="item" :label="item" :value="item">
260
+ <el-row>
261
+ <el-col :span="12">{{ item }}</el-col>
262
+ </el-row>
263
+ </el-option>
264
+ </el-select>
265
+ </el-row>
266
+ <el-row class="backgroundSpacer"></el-row>
249
267
  <el-row class="backgroundText"> Change background </el-row>
250
268
  <el-row class="backgroundChooser">
251
269
  <div
@@ -526,6 +544,21 @@ export default {
526
544
  type: Boolean,
527
545
  default: true,
528
546
  },
547
+ /**
548
+ * Specify the endpoint of the flatmap server.
549
+ * This is used by annotation service included in
550
+ * third party flatmapvuer library.
551
+ */
552
+ flatmapAPI: {
553
+ type: String,
554
+ default: "https://mapcore-demo.org/current/flatmap/v3/"
555
+ },
556
+ },
557
+ provide() {
558
+ return {
559
+ flatmapAPI: this.flatmapAPI,
560
+ scaffoldUrl: this.url,
561
+ };
529
562
  },
530
563
  data: function () {
531
564
  return {
@@ -594,9 +627,15 @@ export default {
594
627
  visible: false,
595
628
  x: 200,
596
629
  y: 200,
630
+ active: false,
597
631
  },
598
632
  fileFormat: "metadata",
599
633
  previousMarkerLabels: [],
634
+ viewingMode: "Exploration",
635
+ viewingModes: [
636
+ "Annotation",
637
+ "Exploration",
638
+ ]
600
639
  };
601
640
  },
602
641
  watch: {
@@ -969,6 +1008,7 @@ export default {
969
1008
  ? event.identifiers[0].data.id
970
1009
  : event.identifiers[0].data.group;
971
1010
  if (event.identifiers[0].coords) {
1011
+ this.tData.active = false;
972
1012
  this.tData.visible = true;
973
1013
  this.tData.label = id;
974
1014
  if (event.identifiers[0].data.region)
@@ -1156,6 +1196,11 @@ export default {
1156
1196
  );
1157
1197
  }
1158
1198
  } else {
1199
+ if (!name.includes("Search Results for")) {
1200
+ this.tData.active = true;
1201
+ } else {
1202
+ this.tData.active = false;
1203
+ }
1159
1204
  this.tData.visible = true;
1160
1205
  this.tData.label = name;
1161
1206
  this.tData.x = coords.position.x;
@@ -1257,6 +1302,7 @@ export default {
1257
1302
  //Unset the tracking
1258
1303
  this.$module.setupLiveCoordinates(undefined);
1259
1304
  }
1305
+ this.tData.active = false;
1260
1306
  this.tData.visible = false;
1261
1307
  this.tData.region = undefined;
1262
1308
  },
@@ -1596,6 +1642,11 @@ export default {
1596
1642
  }
1597
1643
  }
1598
1644
 
1645
+ .backgroundSpacer {
1646
+ border-bottom: 1px solid #e4e7ed;
1647
+ margin-bottom: 10px;
1648
+ }
1649
+
1599
1650
  .warning-icon {
1600
1651
  color: $warning;
1601
1652
  top: 15px;
@@ -1730,7 +1781,7 @@ export default {
1730
1781
  background-color: #ffffff;
1731
1782
  border: 1px solid $app-primary-color;
1732
1783
  box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
1733
- height: 72px;
1784
+ height: 124px;
1734
1785
  width: 128px;
1735
1786
  min-width: 128px;
1736
1787
 
@@ -1742,6 +1793,10 @@ export default {
1742
1793
  }
1743
1794
  }
1744
1795
  }
1796
+
1797
+ .el-row ~ .el-row {
1798
+ margin-top: 8px;
1799
+ }
1745
1800
  }
1746
1801
 
1747
1802
  ::v-deep .open-map-popper {
@@ -1964,6 +2019,13 @@ export default {
1964
2019
  color: rgb(48, 49, 51);
1965
2020
  margin-left: 8px;
1966
2021
 
2022
+ &.viewing-mode {
2023
+ width: unset;
2024
+ ::v-deep .el-input__inner {
2025
+ line-height:30px
2026
+ }
2027
+ }
2028
+
1967
2029
  ::v-deep .el-input__inner {
1968
2030
  color: $app-primary-color;
1969
2031
  height: 22px;
@@ -1972,6 +2034,9 @@ export default {
1972
2034
  border: none;
1973
2035
  font-family: "Asap", sans-serif;
1974
2036
  line-height: 22px;
2037
+ &is-focus, &:focus {
2038
+ border: 1px solid $app-primary-color;
2039
+ }
1975
2040
  }
1976
2041
 
1977
2042
  ::v-deep .el-input,