@geode/opengeodeweb-front 12.2.0-rc.4 → 12.2.0-rc.6

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 (124) hide show
  1. package/app/components/CameraOrientation.vue +85 -68
  2. package/app/components/CameraOrientationDial.vue +195 -0
  3. package/app/components/ClippingPlanes.vue +1 -1
  4. package/app/components/FactorFilterPanel.vue +1 -1
  5. package/app/components/Launcher.vue +3 -2
  6. package/app/components/ThresholdFilter.vue +1 -2
  7. package/app/components/Viewer/Basemap/CropOptions.vue +7 -8
  8. package/app/components/Viewer/Basemap/OpacityOptions.vue +7 -8
  9. package/app/components/Viewer/ContextMenu/CircularItems.vue +6 -43
  10. package/app/components/Viewer/ContextMenu/ContextMenu.vue +1 -6
  11. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +14 -16
  12. package/app/components/Viewer/EdgedCurve/PointsOptions.vue +5 -4
  13. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +10 -13
  14. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +8 -11
  15. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +16 -13
  16. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +28 -31
  17. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +9 -11
  18. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +8 -11
  19. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +1 -1
  20. package/app/components/Viewer/Generic/Model/CornersOptions.vue +1 -1
  21. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +1 -1
  22. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +7 -8
  23. package/app/components/Viewer/Generic/Model/LinesOptions.vue +1 -1
  24. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +1 -1
  25. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +5 -7
  26. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +5 -7
  27. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +5 -7
  28. package/app/components/Viewer/Generic/Model/ModelStyleOptions.vue +7 -8
  29. package/app/components/Viewer/Generic/Model/PointsOptions.vue +7 -8
  30. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +1 -1
  31. package/app/components/Viewer/Grid/2D/CellsOptions.vue +6 -4
  32. package/app/components/Viewer/Grid/2D/EdgesOptions.vue +6 -4
  33. package/app/components/Viewer/Grid/2D/PointsOptions.vue +5 -4
  34. package/app/components/Viewer/Grid/3D/CellsOptions.vue +6 -4
  35. package/app/components/Viewer/Grid/3D/EdgesOptions.vue +6 -4
  36. package/app/components/Viewer/Grid/3D/FacetsOptions.vue +6 -4
  37. package/app/components/Viewer/Grid/3D/PointsOptions.vue +5 -4
  38. package/app/components/Viewer/Image/ImageOptions.vue +10 -13
  39. package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +5 -0
  40. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +2 -2
  41. package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +4 -1
  42. package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +6 -8
  43. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +10 -15
  44. package/app/components/Viewer/ObjectTree/Views/ModelTree.vue +3 -0
  45. package/app/components/Viewer/OrientationCompass.vue +11 -34
  46. package/app/components/Viewer/OrientationGlobe.vue +2 -2
  47. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +28 -31
  48. package/app/components/Viewer/Scene/BackgroundOptions.vue +4 -7
  49. package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +4 -7
  50. package/app/components/Viewer/Scene/TextOptions.vue +4 -7
  51. package/app/components/Viewer/Solid/EdgesOptions.vue +6 -4
  52. package/app/components/Viewer/Solid/PointsOptions.vue +5 -4
  53. package/app/components/Viewer/Solid/PolygonsOptions.vue +6 -4
  54. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +8 -11
  55. package/app/components/Viewer/Surface/EdgesOptions.vue +6 -4
  56. package/app/components/Viewer/Surface/PointsOptions.vue +6 -4
  57. package/app/components/Viewer/Surface/PolygonsOptions.vue +8 -11
  58. package/app/components/Viewer/Surface/Triangulated/TrianglesOptions.vue +5 -4
  59. package/app/components/Viewer/TetrahedralSolid/TetrahedraOptions.vue +6 -4
  60. package/app/components/Viewer/TetrahedralSolid/TrianglesOptions.vue +6 -4
  61. package/app/composables/circular_menu.ts +45 -0
  62. package/app/composables/compass_dial.ts +40 -0
  63. package/app/composables/hover_highlight.ts +1 -1
  64. package/app/composables/model_menu_context.ts +7 -11
  65. package/app/composables/model_tree.ts +3 -3
  66. package/app/composables/project_manager_helpers/types.ts +2 -3
  67. package/app/composables/use_overlapping_picker.ts +7 -19
  68. package/app/composables/viewer_context_menu.ts +2 -1
  69. package/app/stores/api.ts +6 -59
  70. package/app/stores/app.ts +21 -55
  71. package/app/stores/back.ts +86 -145
  72. package/app/stores/camera_manager.ts +12 -25
  73. package/app/stores/cloud.ts +21 -101
  74. package/app/stores/crs.ts +3 -2
  75. package/app/stores/data.ts +66 -409
  76. package/app/stores/data_style.ts +99 -93
  77. package/app/stores/feedback.ts +57 -53
  78. package/app/stores/infra.ts +61 -101
  79. package/app/stores/treeview.ts +12 -31
  80. package/app/stores/viewer.ts +9 -29
  81. package/app/stores/viewer_helpers/actions.ts +1 -23
  82. package/app/utils/backend_lifecycle.ts +155 -0
  83. package/app/utils/brand_colors.ts +9 -0
  84. package/app/utils/camera_orientations.ts +136 -0
  85. package/app/utils/import_item.ts +5 -4
  86. package/app/utils/orientation_compass.ts +15 -0
  87. package/app/utils/orientation_cube_style.ts +70 -0
  88. package/app/utils/threshold_sources.ts +3 -2
  89. package/app/utils/treeview.ts +25 -1
  90. package/app/utils/viewer_object_type.ts +21 -0
  91. package/internal/database/base_database.ts +2 -1
  92. package/internal/database/database.ts +90 -7
  93. package/internal/database/queries.ts +45 -0
  94. package/internal/database/tables/camera_positions.ts +11 -1
  95. package/internal/database/tables/data.ts +20 -1
  96. package/internal/database/tables/data_style.ts +3 -1
  97. package/internal/database/tables/model_component_datastyle.ts +3 -1
  98. package/internal/database/tables/model_component_type_datastyle.ts +3 -1
  99. package/internal/database/tables/model_components.ts +12 -1
  100. package/internal/database/tables/model_components_relation.ts +11 -1
  101. package/internal/database/tables/scene_style.ts +3 -1
  102. package/internal/database/tables/treeview_config.ts +31 -0
  103. package/internal/stores/data/items.ts +110 -0
  104. package/internal/stores/data/model/collections.ts +107 -0
  105. package/internal/stores/data/model/components.ts +129 -0
  106. package/internal/stores/data/model/mesh_components.ts +134 -0
  107. package/internal/stores/data/model/relations.ts +76 -0
  108. package/internal/stores/data/model/types.ts +14 -0
  109. package/internal/stores/data/registration.ts +54 -0
  110. package/internal/stores/data/snapshot.ts +83 -0
  111. package/internal/stores/data/types.ts +26 -0
  112. package/internal/stores/data_style/model/common_mutations.ts +47 -77
  113. package/internal/stores/data_style/model/selection.ts +3 -10
  114. package/internal/stores/data_style/scene.ts +2 -2
  115. package/internal/stores/data_style/state.ts +10 -8
  116. package/internal/stores/data_style/state_shared.ts +10 -7
  117. package/internal/stores/hybrid_viewer/highlight.ts +9 -14
  118. package/internal/stores/hybrid_viewer/scene.ts +1 -1
  119. package/internal/stores/microservice.ts +192 -0
  120. package/package.json +1 -1
  121. package/tests/browser/helpers/data/helpers/attribute.ts +2 -1
  122. package/app/stores/data_helpers/collections.ts +0 -122
  123. package/app/stores/data_helpers/mesh.ts +0 -167
  124. package/app/stores/data_helpers/relations.ts +0 -94
@@ -1,8 +1,19 @@
1
1
  <script setup lang="ts">
2
+ import {
3
+ type CameraOrientation,
4
+ cameraOrientations,
5
+ isNorth,
6
+ } from "@ogw_front/utils/camera_orientations";
7
+ import { BRAND_ORANGE } from "@ogw_front/utils/brand_colors";
2
8
  import type { CameraOptions } from "@ogw_internal/stores/hybrid_viewer/vtk_types.js";
9
+ import CameraOrientationDial from "@ogw_front/components/CameraOrientationDial.vue";
3
10
  import ToolPanel from "@ogw_front/components/ToolPanel.vue";
4
11
  import { applyCameraOptions } from "@ogw_internal/stores/hybrid_viewer/camera";
12
+ import { orientationCubeStyle } from "@ogw_front/utils/orientation_cube_style";
13
+ import { useChromeTheme } from "@ogw_front/composables/chrome_theme";
14
+ import { useDataStyleStore } from "@ogw_front/stores/data_style";
5
15
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
16
+ import { useTheme } from "vuetify";
6
17
  import { newInstance as vtkAnnotatedCubeActor } from "@kitware/vtk.js/Rendering/Core/AnnotatedCubeActor";
7
18
  import { newInstance as vtkGenericRenderWindow } from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow";
8
19
 
@@ -28,56 +39,22 @@ const emit = defineEmits<Emits>();
28
39
 
29
40
  const show = defineModel<boolean>("show", { default: false });
30
41
 
31
- const orientations = [
32
- {
33
- label: "Z+",
34
- value: "zplus",
35
- face: "top",
36
- vtkKey: "ZPlus",
37
- rotation: 0,
38
- position: { top: "15%", left: "50%" },
39
- },
40
- {
41
- label: "Z-",
42
- value: "zminus",
43
- face: "bottom",
44
- vtkKey: "ZMinus",
45
- rotation: 0,
46
- position: { top: "85%", left: "50%" },
47
- },
48
- {
49
- label: "Y+",
50
- value: "yplus",
51
- face: "front",
52
- vtkKey: "YPlus",
53
- rotation: 180,
54
- position: { top: "35%", left: "22%" },
55
- },
56
- {
57
- label: "Y-",
58
- value: "yminus",
59
- face: "back",
60
- vtkKey: "YMinus",
61
- rotation: 0,
62
- position: { top: "65%", left: "78%" },
63
- },
64
- {
65
- label: "X+",
66
- value: "xplus",
67
- face: "right",
68
- vtkKey: "XPlus",
69
- rotation: 90,
70
- position: { top: "35%", left: "78%" },
71
- },
72
- {
73
- label: "X-",
74
- value: "xminus",
75
- face: "left",
76
- vtkKey: "XMinus",
77
- rotation: -90,
78
- position: { top: "65%", left: "22%" },
79
- },
80
- ];
42
+ // With the compass marker, the orientations read north, east, south, west, up and down
43
+ const dataStyleStore = useDataStyleStore();
44
+ const isCompass = computed(() => dataStyleStore.sceneStyle.orientation_widget === "compass");
45
+ const orientations = computed(() =>
46
+ cameraOrientations(dataStyleStore.sceneStyle.orientation_widget),
47
+ );
48
+
49
+ // The cube follows the theme it is shown in: the chrome theme of the panel (GlassCard), the app
50
+ // Theme for the menu
51
+ const theme = useTheme();
52
+ const chromeTheme = useChromeTheme();
53
+ const cubeStyle = computed(() => {
54
+ const name = panel ? chromeTheme.value : theme.global.name.value;
55
+ const colors = theme.computedThemes.value[name]?.colors;
56
+ return orientationCubeStyle({ surface: colors?.surface, "on-surface": colors?.["on-surface"] });
57
+ });
81
58
 
82
59
  const hoveredFace = ref<string | undefined>(undefined);
83
60
  const hybridViewerStore = useHybridViewerStore();
@@ -87,6 +64,43 @@ let genericRenderWindow: unknown = undefined;
87
64
  let cubeActor: unknown = undefined;
88
65
  let isInteracting = false;
89
66
 
67
+ function faceStyle(
68
+ orientation: CameraOrientation,
69
+ hovered: boolean,
70
+ ): { faceColor: string; fontColor: string } {
71
+ const style = cubeStyle.value;
72
+ if (hovered) {
73
+ return { faceColor: style.hoveredFaceColor, fontColor: style.hoveredFontColor };
74
+ }
75
+ return {
76
+ faceColor: style.faceColor,
77
+ fontColor: isNorth(orientation) ? BRAND_ORANGE : style.fontColor,
78
+ };
79
+ }
80
+
81
+ function labelFaces(): void {
82
+ for (const orientation of orientations.value) {
83
+ cubeActor[`set${orientation.vtkKey}FaceProperty`]({
84
+ text: orientation.label,
85
+ faceRotation: orientation.rotation,
86
+ ...faceStyle(orientation, orientation.face === hoveredFace.value),
87
+ });
88
+ }
89
+ }
90
+
91
+ function edgeStyle(): { edgeColor: string } {
92
+ return { edgeColor: cubeStyle.value.edgeColor };
93
+ }
94
+
95
+ watch([orientations, cubeStyle], () => {
96
+ if (!cubeActor) {
97
+ return;
98
+ }
99
+ cubeActor.setDefaultStyle(edgeStyle());
100
+ labelFaces();
101
+ genericRenderWindow.getRenderWindow().render();
102
+ });
103
+
90
104
  function initVTK(): void {
91
105
  if (genericRenderWindow) {
92
106
  return;
@@ -109,21 +123,13 @@ function initVTK(): void {
109
123
  cubeActor.setDefaultStyle({
110
124
  fontFamily: "sans-serif",
111
125
  fontStyle: "bold",
112
- faceColor: "rgba(60, 60, 60, 1)",
113
- fontColor: "white",
114
- edgeColor: "rgba(255, 255, 255, 0.4)",
126
+ ...edgeStyle(),
115
127
  edgeThickness: 0.1,
116
128
  resolution: 400,
117
129
  fontSizeScale: (resolution: number) => resolution / 4,
118
130
  });
119
131
 
120
- for (const orientation of orientations) {
121
- cubeActor[`set${orientation.vtkKey}FaceProperty`]({
122
- text: orientation.label,
123
- faceRotation: orientation.rotation,
124
- });
125
- }
126
-
132
+ labelFaces();
127
133
  cubeActor.getProperty().setBackfaceCulling(true);
128
134
 
129
135
  const renderer = genericRenderWindow.getRenderer();
@@ -166,12 +172,9 @@ watch(hoveredFace, (newFace, oldFace) => {
166
172
  return;
167
173
  }
168
174
  function updateFace(face: string | undefined, active: boolean): void {
169
- const config = orientations.find((orientation) => orientation.face === face);
175
+ const config = orientations.value.find((orientation) => orientation.face === face);
170
176
  if (config) {
171
- cubeActor[`set${config.vtkKey}FaceProperty`]({
172
- faceColor: active ? "rgba(255, 255, 255, 0.95)" : "rgba(60, 60, 60, 1)",
173
- fontColor: active ? "black" : "white",
174
- });
177
+ cubeActor[`set${config.vtkKey}FaceProperty`](faceStyle(config, active));
175
178
  }
176
179
  }
177
180
 
@@ -189,7 +192,16 @@ watch(hoveredFace, (newFace, oldFace) => {
189
192
  :width="width"
190
193
  :escapeFunction="escapeFunction"
191
194
  >
195
+ <CameraOrientationDial
196
+ v-if="isCompass"
197
+ v-model:hoveredFace="hoveredFace"
198
+ :orientations="orientations"
199
+ @select="(value) => emit('select', value)"
200
+ >
201
+ <div ref="cubeContainer" style="width: 70px; height: 70px; pointer-events: none" />
202
+ </CameraOrientationDial>
192
203
  <div
204
+ v-else
193
205
  class="pa-0 overflow-hidden position-relative"
194
206
  style="
195
207
  height: 220px;
@@ -236,7 +248,7 @@ watch(hoveredFace, (newFace, oldFace) => {
236
248
  @mouseleave="hoveredFace = undefined"
237
249
  @click.stop="emit('select', orientation.value)"
238
250
  >
239
- <v-tooltip activator="parent" location="top">{{ orientation.value }} View</v-tooltip>
251
+ <v-tooltip activator="parent" location="top">{{ orientation.tooltip }}</v-tooltip>
240
252
  <span class="text-caption font-weight-black" style="font-size: 0.7rem !important">{{
241
253
  orientation.label
242
254
  }}</span>
@@ -266,8 +278,10 @@ watch(hoveredFace, (newFace, oldFace) => {
266
278
  @mouseleave="hoveredFace = undefined"
267
279
  @click.stop="emit('select', orientation.value)"
268
280
  >
269
- <v-tooltip activator="parent" location="top">{{ orientation.label }}</v-tooltip>
270
- <span class="text-caption font-weight-black">{{ orientation.label }}</span>
281
+ <v-tooltip activator="parent" location="top">{{ orientation.tooltip }}</v-tooltip>
282
+ <span class="text-caption font-weight-black" :class="{ north: isNorth(orientation) }">{{
283
+ orientation.label
284
+ }}</span>
271
285
  </v-btn>
272
286
  </div>
273
287
  </div>
@@ -290,6 +304,9 @@ watch(hoveredFace, (newFace, oldFace) => {
290
304
  .transition-all {
291
305
  transition: all 0.4s ease;
292
306
  }
307
+ .north {
308
+ color: v-bind(BRAND_ORANGE);
309
+ }
293
310
  .orientation-menu {
294
311
  min-width: 180px;
295
312
  background: rgb(var(--v-theme-surface)) !important;
@@ -0,0 +1,195 @@
1
+ <script setup lang="ts">
2
+ import { BRAND_ORANGE, BRAND_ORANGE_BORDER } from "@ogw_front/utils/brand_colors";
3
+ import {
4
+ COMPASS_TICK_ANGLES,
5
+ compassDialPoint,
6
+ isCardinalAngle,
7
+ } from "@ogw_front/utils/orientation_compass";
8
+ import { type CameraOrientation, isNorth } from "@ogw_front/utils/camera_orientations";
9
+ import { useCompassDial } from "@ogw_front/composables/compass_dial";
10
+
11
+ // Compass layout of the orientation panel, in the look of the scene compass (Viewer/OrientationCompass.vue):
12
+ // The cardinal buttons sit on a dial turned with the camera heading and flattened with its elevation,
13
+ // So each one stays on its side of the cube drawn in the middle (slot). Up and down sit apart.
14
+
15
+ interface Props {
16
+ orientations: CameraOrientation[];
17
+ }
18
+
19
+ const { orientations } = defineProps<Props>();
20
+
21
+ interface Emits {
22
+ select: [value: string];
23
+ }
24
+
25
+ const emit = defineEmits<Emits>();
26
+
27
+ const hoveredFace = defineModel<string | undefined>("hoveredFace");
28
+
29
+ const BUTTON_RADIUS = 82;
30
+ const TICK_OUTER_RADIUS = 62;
31
+ const TICK_INNER_RADIUS = 57;
32
+ const CARDINAL_TICK_INNER_RADIUS = 51;
33
+ // Up and down, in pixels from the panel center
34
+ const VERTICAL_X = 98;
35
+ const VERTICAL_Y = 80;
36
+
37
+ const { heading, tilt } = useCompassDial();
38
+
39
+ const dialTransform = computed(() => `scale(1 ${tilt.value}) rotate(${-heading.value})`);
40
+
41
+ interface PlacedOrientation {
42
+ orientation: CameraOrientation;
43
+ x: number;
44
+ y: number;
45
+ }
46
+
47
+ const placed = computed<PlacedOrientation[]>(() =>
48
+ orientations.map((orientation) => {
49
+ if (orientation.vertical !== undefined) {
50
+ const sign = orientation.vertical === "up" ? -1 : 1;
51
+ return { orientation, x: VERTICAL_X, y: sign * VERTICAL_Y };
52
+ }
53
+ const { x, y } = compassDialPoint(
54
+ orientation.heading ?? 0,
55
+ BUTTON_RADIUS,
56
+ heading.value,
57
+ tilt.value,
58
+ );
59
+ return { orientation, x, y };
60
+ }),
61
+ );
62
+
63
+ const hoveredHeading = computed(
64
+ () => orientations.find((orientation) => orientation.face === hoveredFace.value)?.heading,
65
+ );
66
+
67
+ function tickInnerRadius(angle: number): number {
68
+ return isCardinalAngle(angle) ? CARDINAL_TICK_INNER_RADIUS : TICK_INNER_RADIUS;
69
+ }
70
+
71
+ function nodeStyle({ x, y }: PlacedOrientation): Record<string, string> {
72
+ return { top: `calc(50% + ${y}px)`, left: `calc(50% + ${x}px)` };
73
+ }
74
+ </script>
75
+
76
+ <template>
77
+ <div class="compass-dial position-relative" data-testid="cameraOrientationDial">
78
+ <svg class="position-absolute w-100 h-100" aria-hidden="true">
79
+ <svg x="50%" y="50%" overflow="visible">
80
+ <g :transform="dialTransform">
81
+ <ellipse class="ring" :rx="TICK_OUTER_RADIUS" :ry="TICK_OUTER_RADIUS" />
82
+ <line
83
+ v-for="angle in COMPASS_TICK_ANGLES"
84
+ :key="angle"
85
+ class="tick"
86
+ :class="{ north: angle === 0, hovered: angle === hoveredHeading }"
87
+ :y1="-tickInnerRadius(angle)"
88
+ :y2="-TICK_OUTER_RADIUS"
89
+ :transform="`rotate(${angle})`"
90
+ />
91
+ </g>
92
+ </svg>
93
+ </svg>
94
+
95
+ <div class="cube position-absolute">
96
+ <slot />
97
+ </div>
98
+
99
+ <v-btn
100
+ v-for="item in placed"
101
+ :key="item.orientation.value"
102
+ icon
103
+ variant="text"
104
+ size="32"
105
+ class="compass-node position-absolute"
106
+ :class="{
107
+ north: isNorth(item.orientation),
108
+ vertical: item.orientation.vertical !== undefined,
109
+ }"
110
+ :style="nodeStyle(item)"
111
+ :data-testid="`cameraOrientation${item.orientation.vtkKey}Button`"
112
+ @mouseenter="hoveredFace = item.orientation.face"
113
+ @mouseleave="hoveredFace = undefined"
114
+ @click.stop="emit('select', item.orientation.value)"
115
+ >
116
+ <v-tooltip activator="parent" location="top">{{ item.orientation.tooltip }}</v-tooltip>
117
+ <span class="compass-letter">{{ item.orientation.label }}</span>
118
+ </v-btn>
119
+ </div>
120
+ </template>
121
+
122
+ <style scoped>
123
+ .compass-dial {
124
+ height: 220px;
125
+ }
126
+
127
+ .cube {
128
+ top: 50%;
129
+ left: 50%;
130
+ transform: translate(-50%, -50%);
131
+ }
132
+
133
+ .ring {
134
+ fill: rgba(var(--v-theme-surface), 0.72);
135
+ stroke: rgba(var(--v-border-color), var(--v-border-opacity));
136
+ stroke-width: 1px;
137
+ vector-effect: non-scaling-stroke;
138
+ }
139
+
140
+ .tick {
141
+ stroke: rgba(var(--v-theme-on-surface), 0.35);
142
+ stroke-width: 1px;
143
+ vector-effect: non-scaling-stroke;
144
+ transition: stroke 0.2s ease;
145
+ }
146
+
147
+ .tick.north,
148
+ .tick.north.hovered {
149
+ stroke: v-bind(BRAND_ORANGE);
150
+ }
151
+
152
+ .tick.hovered {
153
+ stroke: rgb(var(--v-theme-on-surface));
154
+ stroke-width: 2px;
155
+ }
156
+
157
+ /* Round targets of the scene compass: translucent surface, thin border, brighter on hover */
158
+ .compass-node {
159
+ transform: translate(-50%, -50%);
160
+ border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
161
+ background: rgba(var(--v-theme-surface), 0.72) !important;
162
+ backdrop-filter: blur(6px);
163
+ transition:
164
+ background-color 0.2s ease,
165
+ border-color 0.2s ease;
166
+ }
167
+
168
+ .compass-node:hover,
169
+ .compass-node:focus-visible {
170
+ border-color: rgba(var(--v-theme-on-surface), 0.35);
171
+ background: rgba(var(--v-theme-surface), 0.86) !important;
172
+ }
173
+
174
+ .compass-node.north,
175
+ .compass-node.north:hover {
176
+ border-color: v-bind(BRAND_ORANGE_BORDER);
177
+ }
178
+
179
+ .compass-letter {
180
+ color: rgb(var(--v-theme-on-surface));
181
+ font-size: 11px;
182
+ font-weight: 500;
183
+ letter-spacing: 0;
184
+ text-transform: none;
185
+ }
186
+
187
+ .compass-node.north .compass-letter {
188
+ color: v-bind(BRAND_ORANGE);
189
+ font-weight: 600;
190
+ }
191
+
192
+ .compass-node.vertical .compass-letter {
193
+ font-size: 10px;
194
+ }
195
+ </style>
@@ -35,7 +35,7 @@ function createPlane(origin: ClippingPlane["origin"], normal: number[]): Clippin
35
35
  return { id: newItemId(), origin, normal, opacity: DEFAULT_PLANE_OPACITY };
36
36
  }
37
37
  const planes = ref<ClippingPlane[]>([createPlane(undefined, [1, 0, 0])]);
38
- const allItems = dataStore.refRegisteredItems();
38
+ const allItems = computed(() => dataStore.registeredItems);
39
39
  const targetIds = computed<string[]>(() => {
40
40
  if (targetAllVisible.value) {
41
41
  return allItems.value.map((item) => item.data_id);
@@ -43,7 +43,7 @@ const targetAllVisible = ref<boolean>(true);
43
43
  const selectedDatasetIds = ref<string[]>([]);
44
44
  const factor = ref<number>(factorRange.defaultValue);
45
45
 
46
- const allItems = dataStore.refRegisteredItems();
46
+ const allItems = computed(() => dataStore.registeredItems);
47
47
  const availableDatasets = computed<{ title: string; value: string }[]>(() =>
48
48
  allItems.value.map((item) => ({
49
49
  title: item.name || item.data_id,
@@ -2,6 +2,7 @@
2
2
  import Loading from "@ogw_front/components/Loading.vue";
3
3
  import { Status } from "@ogw_front/utils/status";
4
4
  import { appMode } from "@ogw_shared/app_mode";
5
+ import { createBackend } from "@ogw_front/utils/backend_lifecycle";
5
6
  import { getCloudUrlParam } from "@ogw_front/utils/cloud";
6
7
  import { useInfraStore } from "@ogw_front/stores/infra";
7
8
 
@@ -24,11 +25,11 @@ const infraStore = useInfraStore();
24
25
  // In cloud mode, wait for the user to authenticate and load the app, unless a `?cloud_url=` link
25
26
  // Points at an already running service: that one is connected straight away, without authentication.
26
27
  if (infraStore.app_mode !== appMode.CLOUD || getCloudUrlParam() !== undefined) {
27
- infraStore.create_backend(authToken);
28
+ void createBackend(authToken);
28
29
  }
29
30
 
30
31
  function cloudCreateBackend(): Promise<void> {
31
- return infraStore.create_backend(authToken);
32
+ return createBackend(authToken);
32
33
  }
33
34
  </script>
34
35
 
@@ -30,9 +30,8 @@ const thresholds = computed<Threshold[]>(() => {
30
30
  });
31
31
  const cards = useTemplateRef("cards");
32
32
 
33
- const allItems = dataStore.refAllItems();
34
33
  const availableDatasets = computed<{ title: string; value: string }[]>(() =>
35
- allItems.value.map((item) => ({
34
+ dataStore.items.map((item) => ({
36
35
  title: item.name || item.data_id,
37
36
  value: item.data_id,
38
37
  })),
@@ -1,20 +1,20 @@
1
1
  <script setup lang="ts">
2
2
  import { MAP_STYLES, mapStyleOf } from "@ogw_front/utils/basemap_tree";
3
- import ViewerContextMenuItem, {
4
- type ItemProps,
5
- } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
3
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
4
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
6
5
  import { useBasemapStore } from "@ogw_front/stores/basemap";
7
6
 
8
7
  interface Props {
9
- itemProps: ItemProps & { index: number };
8
+ dataId: DataId;
9
+ index: number;
10
10
  tooltip?: string;
11
11
  }
12
12
 
13
- const { itemProps, tooltip = "Crop to data" } = defineProps<Props>();
13
+ const { dataId, index, tooltip = "Crop to data" } = defineProps<Props>();
14
14
  const basemapStore = useBasemapStore();
15
15
  // A map menu crops that map, the basemap category menu crops every map
16
16
  const mapStyles = computed(() => {
17
- const mapStyle = mapStyleOf(itemProps.id);
17
+ const mapStyle = mapStyleOf(dataId);
18
18
  if (mapStyle === undefined) {
19
19
  return MAP_STYLES;
20
20
  }
@@ -28,8 +28,7 @@ const indeterminate = computed(() => new Set(cropped.value).size > 1);
28
28
  <template>
29
29
  <ViewerContextMenuItem
30
30
  data-testid="basemapCropMenu"
31
- :index="itemProps.index"
32
- :itemProps="itemProps"
31
+ :index="index"
33
32
  :tooltip="tooltip"
34
33
  btnIcon="ph-panorama"
35
34
  >
@@ -1,19 +1,19 @@
1
1
  <script setup lang="ts">
2
- import ViewerContextMenuItem, {
3
- type ItemProps,
4
- } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
2
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
3
+ import ViewerContextMenuItem from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
5
4
  import { mapStyleOf } from "@ogw_front/utils/basemap_tree";
6
5
  import { useBasemapStore } from "@ogw_front/stores/basemap";
7
6
 
8
7
  interface Props {
9
- itemProps: ItemProps & { index: number };
8
+ dataId: DataId;
9
+ index: number;
10
10
  tooltip?: string;
11
11
  }
12
12
 
13
- const { itemProps, tooltip = "Opacity" } = defineProps<Props>();
13
+ const { dataId, index, tooltip = "Opacity" } = defineProps<Props>();
14
14
  const basemapStore = useBasemapStore();
15
15
  const PERCENT = 100;
16
- const mapStyle = computed(() => mapStyleOf(itemProps.id));
16
+ const mapStyle = computed(() => mapStyleOf(dataId));
17
17
  // The slider works in percent, the store in 0..1
18
18
  const opacityPercent = computed({
19
19
  get: () => Math.round((mapStyle.value ? basemapStore.opacities[mapStyle.value] : 1) * PERCENT),
@@ -28,8 +28,7 @@ const opacityPercent = computed({
28
28
  <template>
29
29
  <ViewerContextMenuItem
30
30
  data-testid="basemapOpacityMenu"
31
- :index="itemProps.index"
32
- :itemProps="itemProps"
31
+ :index="index"
33
32
  :tooltip="tooltip"
34
33
  btnIcon="ph-circle-half"
35
34
  >
@@ -1,25 +1,22 @@
1
1
  <script setup lang="ts">
2
2
  import type { Component } from "vue";
3
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
4
+ import { provideMenuItemCount } from "@ogw_front/composables/circular_menu";
3
5
  import { useMenuStore } from "@ogw_front/stores/menu";
4
6
 
5
7
  interface Props {
6
8
  menuItems: Component[];
7
- id: string;
8
- metaData: Record<string, unknown>;
9
+ dataId: DataId;
9
10
  menuItemCount: number;
10
11
  }
11
12
 
12
- const { menuItems, id, metaData, menuItemCount } = defineProps<Props>();
13
+ const { menuItems, dataId, menuItemCount } = defineProps<Props>();
13
14
 
14
15
  const Z_INDEX_ACTIVE_ITEM = 10;
15
16
  const Z_INDEX_BASE_ITEM = 1;
16
- const FULL_ANGLE = 360;
17
- const ANGLE_45 = 45;
18
- const ANGLE_135 = 135;
19
- const ANGLE_225 = 225;
20
- const ANGLE_315 = 315;
21
17
 
22
18
  const menuStore = useMenuStore();
19
+ provideMenuItemCount(() => menuItemCount);
23
20
 
24
21
  function getItemStyle(index: number): Record<string, string> {
25
22
  const angle = (index / menuItemCount) * 2 * Math.PI;
@@ -30,34 +27,6 @@ function getItemStyle(index: number): Record<string, string> {
30
27
  zIndex: menuStore.active_item_index === index ? Z_INDEX_ACTIVE_ITEM : Z_INDEX_BASE_ITEM,
31
28
  };
32
29
  }
33
-
34
- function getTooltipLocation(index: number): string {
35
- const angle = (index / menuItemCount) * FULL_ANGLE;
36
- if (angle < ANGLE_45 || angle >= ANGLE_315) {
37
- return "right";
38
- }
39
- if (angle >= ANGLE_45 && angle < ANGLE_135) {
40
- return "top";
41
- }
42
- if (angle >= ANGLE_135 && angle < ANGLE_225) {
43
- return "left";
44
- }
45
- return "bottom";
46
- }
47
-
48
- function getTooltipOrigin(index: number): string {
49
- const angle = (index / menuItemCount) * FULL_ANGLE;
50
- if (angle < ANGLE_45 || angle >= ANGLE_315) {
51
- return "left";
52
- }
53
- if (angle >= ANGLE_45 && angle < ANGLE_135) {
54
- return "bottom";
55
- }
56
- if (angle >= ANGLE_135 && angle < ANGLE_225) {
57
- return "right";
58
- }
59
- return "top";
60
- }
61
30
  </script>
62
31
 
63
32
  <template>
@@ -66,13 +35,7 @@ function getTooltipOrigin(index: number): string {
66
35
  :is="item"
67
36
  :key="index"
68
37
  :index="index"
69
- :itemProps="{
70
- id: id,
71
- meta_data: metaData,
72
- tooltip_location: getTooltipLocation(index),
73
- tooltip_origin: getTooltipOrigin(index),
74
- totalItems: menuItemCount,
75
- }"
38
+ :data-id="dataId"
76
39
  class="menu-item-wrapper"
77
40
  :style="getItemStyle(index)"
78
41
  @mousedown.stop
@@ -182,12 +182,7 @@ function toggleShowName(): void {
182
182
  class="circular-menu-items"
183
183
  :style="{ width: `${menuStore.menuRadius * 2}px`, height: `${menuStore.menuRadius * 2}px` }"
184
184
  >
185
- <CircularItems
186
- :menu-items="menu_items"
187
- :id="id"
188
- :meta-data="meta_data"
189
- :menu-item-count="menuItemCount"
190
- />
185
+ <CircularItems :menu-items="menu_items" :data-id="id" :menu-item-count="menuItemCount" />
191
186
 
192
187
  <CenterButton
193
188
  v-if="!isSceneMenu"