@abi-software/scaffoldvuer 0.3.1 → 0.3.2-beta.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.
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.1",
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: {
@@ -951,6 +990,10 @@ export default {
951
990
  }
952
991
  }
953
992
  // Triggers when an object has been selected
993
+ if (this.viewingMode === 'Annotation') {
994
+ //Make sure the tooltip is displayed with annotation mode
995
+ this.showRegionTooltipWithAnnotations(event.identifiers, true, true);
996
+ }
954
997
  this.$emit("scaffold-selected", event.identifiers);
955
998
  } else if (event.eventType == 2) {
956
999
  if (this.selectedObjects.length === 0) {
@@ -969,6 +1012,7 @@ export default {
969
1012
  ? event.identifiers[0].data.id
970
1013
  : event.identifiers[0].data.group;
971
1014
  if (event.identifiers[0].coords) {
1015
+ this.tData.active = false;
972
1016
  this.tData.visible = true;
973
1017
  this.tData.label = id;
974
1018
  if (event.identifiers[0].data.region)
@@ -1156,6 +1200,11 @@ export default {
1156
1200
  );
1157
1201
  }
1158
1202
  } else {
1203
+ if (!name.includes("Search Results for")) {
1204
+ this.tData.active = true;
1205
+ } else {
1206
+ this.tData.active = false;
1207
+ }
1159
1208
  this.tData.visible = true;
1160
1209
  this.tData.label = name;
1161
1210
  this.tData.x = coords.position.x;
@@ -1257,6 +1306,7 @@ export default {
1257
1306
  //Unset the tracking
1258
1307
  this.$module.setupLiveCoordinates(undefined);
1259
1308
  }
1309
+ this.tData.active = false;
1260
1310
  this.tData.visible = false;
1261
1311
  this.tData.region = undefined;
1262
1312
  },
@@ -1596,6 +1646,11 @@ export default {
1596
1646
  }
1597
1647
  }
1598
1648
 
1649
+ .backgroundSpacer {
1650
+ border-bottom: 1px solid #e4e7ed;
1651
+ margin-bottom: 10px;
1652
+ }
1653
+
1599
1654
  .warning-icon {
1600
1655
  color: $warning;
1601
1656
  top: 15px;
@@ -1730,7 +1785,7 @@ export default {
1730
1785
  background-color: #ffffff;
1731
1786
  border: 1px solid $app-primary-color;
1732
1787
  box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
1733
- height: 72px;
1788
+ height: 124px;
1734
1789
  width: 128px;
1735
1790
  min-width: 128px;
1736
1791
 
@@ -1742,6 +1797,10 @@ export default {
1742
1797
  }
1743
1798
  }
1744
1799
  }
1800
+
1801
+ .el-row ~ .el-row {
1802
+ margin-top: 8px;
1803
+ }
1745
1804
  }
1746
1805
 
1747
1806
  ::v-deep .open-map-popper {
@@ -1964,6 +2023,13 @@ export default {
1964
2023
  color: rgb(48, 49, 51);
1965
2024
  margin-left: 8px;
1966
2025
 
2026
+ &.viewing-mode {
2027
+ width: unset;
2028
+ ::v-deep .el-input__inner {
2029
+ line-height:30px
2030
+ }
2031
+ }
2032
+
1967
2033
  ::v-deep .el-input__inner {
1968
2034
  color: $app-primary-color;
1969
2035
  height: 22px;
@@ -1972,6 +2038,9 @@ export default {
1972
2038
  border: none;
1973
2039
  font-family: "Asap", sans-serif;
1974
2040
  line-height: 22px;
2041
+ &is-focus, &:focus {
2042
+ border: 1px solid $app-primary-color;
2043
+ }
1975
2044
  }
1976
2045
 
1977
2046
  ::v-deep .el-input,