@geode/opengeodeweb-front 11.2.2-rc.1 → 12.0.0-rc.2

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 (260) hide show
  1. package/.build/shared/utils/response_handlers/load.js +5 -2
  2. package/.build/tests/browser/helpers/object_trees/main_object_tree.js +3 -3
  3. package/.build/tests/browser/helpers/object_trees/model_components_object_tree.js +2 -2
  4. package/.build/tests/browser/suites/model/surfaces.js +1 -1
  5. package/app/app.config.ts +28 -0
  6. package/app/assets/css/main.css +11 -0
  7. package/app/assets/geode_objects.ts +37 -108
  8. package/app/assets/img/geode_objects/HorizonStack3D.svg +10 -0
  9. package/app/components/ActionButton.vue +9 -2
  10. package/app/components/CameraManager/List.vue +6 -6
  11. package/app/components/CameraManager.vue +0 -1
  12. package/app/components/CameraOrientation.vue +12 -7
  13. package/app/components/ChromeTheme.vue +20 -0
  14. package/app/components/ClippingPlaneCard.vue +2 -3
  15. package/app/components/ClippingPlanes.vue +2 -2
  16. package/app/components/CrsSelector.vue +8 -8
  17. package/app/components/DeleteDialog.vue +12 -16
  18. package/app/components/DragAndDropInternal/DragAndDropInline.vue +7 -7
  19. package/app/components/DragAndDropInternal/DragAndDropOverlay.vue +87 -82
  20. package/app/components/ExtensionSelector.vue +21 -14
  21. package/app/components/FactorFilterPanel.vue +0 -1
  22. package/app/components/FeedBack/ErrorBanner.vue +8 -9
  23. package/app/components/FeedBack/Snackers.vue +5 -7
  24. package/app/components/FileUploader.vue +13 -21
  25. package/app/components/GlassCard.vue +3 -1
  26. package/app/components/HybridRenderingView.vue +2 -0
  27. package/app/components/HybridViewerTooltip.vue +4 -4
  28. package/app/components/Launcher.vue +1 -1
  29. package/app/components/Loading/EcoMessages.vue +17 -11
  30. package/app/components/Loading/Footer.vue +2 -2
  31. package/app/components/Loading/Header.vue +9 -4
  32. package/app/components/Loading/Progress.vue +7 -3
  33. package/app/components/Loading.vue +54 -46
  34. package/app/components/MissingFilesSelector.vue +5 -5
  35. package/app/components/ObjectSelector.vue +8 -15
  36. package/app/components/PackagesVersions.vue +1 -3
  37. package/app/components/ProjectCrs.vue +1 -1
  38. package/app/components/Screenshot.vue +23 -15
  39. package/app/components/SearchBar.vue +1 -3
  40. package/app/components/SliceCard.vue +1 -2
  41. package/app/components/Step.vue +1 -1
  42. package/app/components/Stepper.vue +13 -11
  43. package/app/components/ThresholdCard.vue +1 -1
  44. package/app/components/ThresholdFilter.vue +2 -2
  45. package/app/components/TimeSeriesTargetSelector.vue +3 -6
  46. package/app/components/ToolPanel.vue +3 -9
  47. package/app/components/Viewer/Basemap/CropOptions.vue +1 -1
  48. package/app/components/Viewer/Basemap/OpacityOptions.vue +1 -1
  49. package/app/components/Viewer/ContextMenu/CenterButton.vue +9 -3
  50. package/app/components/Viewer/ContextMenu/ContextMenu.vue +1 -1
  51. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +17 -6
  52. package/app/components/Viewer/ContextMenu/InfoCard.vue +12 -13
  53. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +12 -9
  54. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +2 -2
  55. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +12 -9
  56. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +1 -1
  57. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +12 -9
  58. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -3
  59. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +12 -8
  60. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +12 -9
  61. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +1 -1
  62. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +12 -9
  63. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +1 -1
  64. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +16 -17
  65. package/app/components/Viewer/Generic/Model/ComponentEdgesOptions.vue +11 -6
  66. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +11 -6
  67. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +7 -8
  68. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +7 -8
  69. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +9 -10
  70. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +9 -10
  71. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +2 -2
  72. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +1 -1
  73. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +3 -4
  74. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +16 -17
  75. package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +4 -4
  76. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +1 -1
  77. package/app/components/Viewer/ObjectTree/Base/Controls.vue +22 -18
  78. package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +11 -11
  79. package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +3 -3
  80. package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +6 -9
  81. package/app/components/Viewer/ObjectTree/Box.vue +20 -21
  82. package/app/components/Viewer/ObjectTree/Layout.vue +28 -25
  83. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +4 -3
  84. package/app/components/Viewer/ObjectTree/Views/ModelTree.vue +1 -1
  85. package/app/components/Viewer/Options/AttributeRangeSelector.vue +1 -1
  86. package/app/components/Viewer/Options/AttributeSelector.vue +1 -1
  87. package/app/components/Viewer/Options/ColorMapList.vue +7 -9
  88. package/app/components/Viewer/Options/ColorMapPicker.vue +2 -2
  89. package/app/components/Viewer/Options/ColorPicker.vue +9 -9
  90. package/app/components/Viewer/Options/ColoringTypeSelector.vue +9 -9
  91. package/app/components/Viewer/Options/NoDataColorInfo.vue +4 -4
  92. package/app/components/Viewer/Options/Sliders/Opacity.vue +1 -1
  93. package/app/components/Viewer/Options/Sliders/Slider.vue +1 -1
  94. package/app/components/Viewer/Options/TextureItem.vue +11 -8
  95. package/app/components/Viewer/Options/TexturesSelector.vue +3 -3
  96. package/app/components/Viewer/Options/VisibilitySwitch.vue +1 -1
  97. package/app/components/Viewer/OrientationCompass.vue +223 -0
  98. package/app/components/Viewer/OrientationGlobe.vue +376 -0
  99. package/app/components/Viewer/OrientationOverlay.vue +47 -0
  100. package/app/components/Viewer/OverlappingObjectsPicker.vue +10 -7
  101. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +4 -5
  102. package/app/components/Viewer/Scene/BackgroundOptions.vue +3 -3
  103. package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +1 -1
  104. package/app/components/Viewer/Scene/TextOptions.vue +3 -3
  105. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +12 -12
  106. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +1 -1
  107. package/app/components/Viewer/Surface/PolygonsColoring.vue +12 -12
  108. package/app/components/Viewer/Surface/PolygonsOptions.vue +1 -1
  109. package/app/components/Viewer/ToolActiveChip.vue +1 -1
  110. package/app/components/Viewer/Ui.vue +2 -2
  111. package/app/components/csv-preview/CsvPreviewer.vue +17 -24
  112. package/app/components/csv-preview/CsvSettings.vue +6 -6
  113. package/app/components/csv-preview/CsvTable.vue +11 -9
  114. package/app/composables/attribute_selector.ts +1 -1
  115. package/app/composables/batch_style.ts +3 -3
  116. package/app/composables/batch_style_model.ts +1 -1
  117. package/app/composables/chrome_theme.ts +23 -0
  118. package/app/composables/clipping_slices.ts +2 -1
  119. package/app/composables/hover_highlight.ts +10 -7
  120. package/app/composables/live_data_item.ts +1 -1
  121. package/app/composables/model_menu_context.ts +11 -4
  122. package/app/composables/orientation_overlay.ts +133 -0
  123. package/app/composables/project_manager_helpers/reset.ts +2 -0
  124. package/app/composables/project_manager_helpers/types.ts +2 -2
  125. package/app/composables/use_adaptive_styles.ts +42 -21
  126. package/app/composables/use_overlapping_picker.ts +10 -8
  127. package/app/composables/view_toolbar_options.ts +7 -7
  128. package/app/composables/view_toolbar_tool_options.ts +9 -11
  129. package/app/composables/viewer_context_menu.ts +4 -2
  130. package/app/composables/viewer_reset.ts +54 -0
  131. package/app/plugins/chrome_theme.ts +10 -0
  132. package/app/plugins/phosphor_icons.ts +13 -0
  133. package/app/plugins/scene_colors.ts +10 -0
  134. package/app/stores/basemap_helpers/builds.ts +2 -2
  135. package/app/stores/basemap_helpers/viewer.ts +1 -1
  136. package/app/stores/crs.ts +12 -12
  137. package/app/stores/data.ts +4 -5
  138. package/app/stores/data_helpers/mesh.ts +2 -1
  139. package/app/stores/data_style.ts +4 -3
  140. package/app/stores/hybrid_viewer.ts +5 -3
  141. package/app/stores/menu.ts +18 -12
  142. package/app/stores/treeview.ts +5 -4
  143. package/app/stores/viewer.ts +2 -0
  144. package/app/types/attribute.ts +5 -21
  145. package/app/types/identifiers.ts +5 -15
  146. package/app/utils/attribute_range.ts +1 -1
  147. package/app/utils/attributes.ts +2 -1
  148. package/app/utils/clipping_planes.ts +1 -1
  149. package/app/utils/color_picker.ts +3 -3
  150. package/app/utils/crs.ts +6 -6
  151. package/app/utils/default_styles/constants.ts +17 -22
  152. package/app/utils/default_styles/index.ts +24 -3
  153. package/app/utils/default_styles/mesh_components.ts +15 -11
  154. package/app/utils/default_styles/meshes.ts +1 -1
  155. package/app/utils/default_styles/model_components.ts +14 -10
  156. package/app/utils/default_styles/models.ts +1 -1
  157. package/app/utils/import_workflow.ts +3 -1
  158. package/app/utils/legacy_data_id.ts +2 -1
  159. package/app/utils/orientation_compass.ts +103 -0
  160. package/app/utils/orientation_gizmo.ts +73 -0
  161. package/app/utils/orientation_globe.ts +145 -0
  162. package/app/utils/orientation_strata.ts +119 -0
  163. package/app/utils/phosphor_icons.ts +105 -0
  164. package/app/utils/slice.ts +2 -1
  165. package/app/utils/threshold_sources.ts +1 -1
  166. package/internal/stores/data_style/attribute_types.ts +6 -6
  167. package/internal/stores/data_style/mesh/base_style.ts +6 -7
  168. package/internal/stores/data_style/mesh/cells/cell.ts +6 -6
  169. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +8 -6
  170. package/internal/stores/data_style/mesh/cells/cell_config.ts +5 -6
  171. package/internal/stores/data_style/mesh/cells/color.ts +6 -6
  172. package/internal/stores/data_style/mesh/cells/opacity.ts +3 -4
  173. package/internal/stores/data_style/mesh/cells/vertex.ts +6 -6
  174. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +8 -6
  175. package/internal/stores/data_style/mesh/cells/vertex_config.ts +5 -6
  176. package/internal/stores/data_style/mesh/cells/visibility.ts +1 -1
  177. package/internal/stores/data_style/mesh/edges/color.ts +6 -6
  178. package/internal/stores/data_style/mesh/edges/edge.ts +6 -6
  179. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +8 -6
  180. package/internal/stores/data_style/mesh/edges/edge_config.ts +5 -6
  181. package/internal/stores/data_style/mesh/edges/opacity.ts +3 -4
  182. package/internal/stores/data_style/mesh/edges/vertex.ts +6 -6
  183. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +8 -6
  184. package/internal/stores/data_style/mesh/edges/vertex_config.ts +5 -6
  185. package/internal/stores/data_style/mesh/edges/visibility.ts +1 -1
  186. package/internal/stores/data_style/mesh/edges/width.ts +6 -6
  187. package/internal/stores/data_style/mesh/index.ts +3 -4
  188. package/internal/stores/data_style/mesh/points/color.ts +6 -6
  189. package/internal/stores/data_style/mesh/points/common.ts +1 -1
  190. package/internal/stores/data_style/mesh/points/opacity.ts +3 -4
  191. package/internal/stores/data_style/mesh/points/size.ts +6 -6
  192. package/internal/stores/data_style/mesh/points/vertex.ts +6 -6
  193. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +8 -6
  194. package/internal/stores/data_style/mesh/points/vertex_config.ts +5 -6
  195. package/internal/stores/data_style/mesh/points/visibility.ts +1 -1
  196. package/internal/stores/data_style/mesh/polygons/color.ts +6 -6
  197. package/internal/stores/data_style/mesh/polygons/opacity.ts +3 -4
  198. package/internal/stores/data_style/mesh/polygons/polygon.ts +6 -6
  199. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +8 -6
  200. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +5 -6
  201. package/internal/stores/data_style/mesh/polygons/vertex.ts +6 -6
  202. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +8 -6
  203. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +5 -6
  204. package/internal/stores/data_style/mesh/polygons/visibility.ts +1 -1
  205. package/internal/stores/data_style/mesh/polyhedra/color.ts +6 -6
  206. package/internal/stores/data_style/mesh/polyhedra/opacity.ts +3 -4
  207. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +6 -6
  208. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +8 -6
  209. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +5 -6
  210. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +6 -6
  211. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +8 -6
  212. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +5 -6
  213. package/internal/stores/data_style/mesh/polyhedra/visibility.ts +1 -1
  214. package/internal/stores/data_style/model/blocks/color.ts +6 -6
  215. package/internal/stores/data_style/model/blocks/coloring_groups.ts +2 -2
  216. package/internal/stores/data_style/model/blocks/polyhedron.ts +12 -9
  217. package/internal/stores/data_style/model/blocks/vertex.ts +12 -9
  218. package/internal/stores/data_style/model/blocks/visibility.ts +1 -1
  219. package/internal/stores/data_style/model/color.ts +10 -11
  220. package/internal/stores/data_style/model/common.ts +3 -4
  221. package/internal/stores/data_style/model/corners/color.ts +6 -6
  222. package/internal/stores/data_style/model/corners/index.ts +2 -2
  223. package/internal/stores/data_style/model/corners/vertex.ts +12 -9
  224. package/internal/stores/data_style/model/corners/visibility.ts +1 -1
  225. package/internal/stores/data_style/model/edges/component.ts +13 -13
  226. package/internal/stores/data_style/model/edges/visibility.ts +1 -1
  227. package/internal/stores/data_style/model/edges/width.ts +6 -6
  228. package/internal/stores/data_style/model/lines/color.ts +6 -6
  229. package/internal/stores/data_style/model/lines/coloring_groups.ts +2 -2
  230. package/internal/stores/data_style/model/lines/edge.ts +12 -9
  231. package/internal/stores/data_style/model/lines/vertex.ts +12 -9
  232. package/internal/stores/data_style/model/lines/visibility.ts +1 -1
  233. package/internal/stores/data_style/model/points/component.ts +17 -13
  234. package/internal/stores/data_style/model/points/index.ts +2 -2
  235. package/internal/stores/data_style/model/points/size.ts +6 -6
  236. package/internal/stores/data_style/model/points/visibility.ts +1 -1
  237. package/internal/stores/data_style/model/surfaces/color.ts +6 -6
  238. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +2 -2
  239. package/internal/stores/data_style/model/surfaces/polygon.ts +12 -9
  240. package/internal/stores/data_style/model/surfaces/vertex.ts +12 -9
  241. package/internal/stores/data_style/model/surfaces/visibility.ts +1 -1
  242. package/internal/stores/data_style/model/visibility.ts +1 -1
  243. package/internal/stores/data_style/scene.ts +31 -19
  244. package/internal/stores/data_style/time_step.ts +3 -2
  245. package/internal/stores/data_style/types.ts +3 -4
  246. package/internal/stores/hybrid_viewer/brightness.ts +14 -7
  247. package/internal/stores/hybrid_viewer/camera.ts +1 -1
  248. package/internal/stores/hybrid_viewer/constants.ts +1 -12
  249. package/internal/stores/hybrid_viewer/filters.ts +2 -2
  250. package/internal/stores/hybrid_viewer/highlight.ts +2 -1
  251. package/internal/stores/hybrid_viewer/scene.ts +11 -4
  252. package/nuxt.config.ts +9 -1
  253. package/package.json +4 -2
  254. package/shared/utils/response_handlers/load.ts +19 -11
  255. package/tests/browser/helpers/object_trees/main_object_tree.ts +3 -3
  256. package/tests/browser/helpers/object_trees/model_components_object_tree.ts +2 -2
  257. package/tests/browser/suites/model/surfaces.ts +1 -1
  258. package/tests/unit/helpers/phosphor_glyphs.ts +46 -0
  259. package/app/assets/viewer_svgs/camera-bookmark.svg +0 -64
  260. package/app/types/style.ts +0 -13
@@ -0,0 +1,103 @@
1
+ // Heading math of the compass overlay (Viewer/OrientationCompass.vue). Same convention as the VTK
2
+ // Compass of OpenGeodeWeb-Viewer (orientation_marker.py): north = world +Y, east = +X, up = +Z.
3
+ import type { CameraPose, Vec3, ViewBasis } from "@ogw_front/utils/orientation_gizmo";
4
+
5
+ const DEGREES_PER_HALF_TURN = 180;
6
+ const RADIANS_PER_DEGREE = Math.PI / DEGREES_PER_HALF_TURN;
7
+ // Under this horizontal length, the screen right is (nearly) vertical: no heading can be read
8
+ const MIN_HORIZONTAL_RIGHT = 1e-3;
9
+ // The dial is flattened with the camera elevation, down to this ratio so its letters stay readable
10
+ const MIN_COMPASS_TILT = 0.6;
11
+ // Under this heading gap in degrees, the camera already faces the direction: nothing to turn
12
+ const FACING_TOLERANCE = 0.5;
13
+ const FULL_TURN = 360;
14
+
15
+ interface DialPoint {
16
+ x: number;
17
+ y: number;
18
+ }
19
+
20
+ // Clockwise angle in degrees from north to the direction the camera looks at, on the ground plane.
21
+ // Read from the screen right vector, which stays horizontal both for side views and for views
22
+ // Straight down or up (where the view direction has no horizontal part). Undefined when the camera
23
+ // Is rolled until its right vector is vertical.
24
+ function compassHeading(basis: ViewBasis): number | undefined {
25
+ const [rightX, rightY] = basis.right;
26
+ if (Math.hypot(rightX, rightY) < MIN_HORIZONTAL_RIGHT) {
27
+ return undefined;
28
+ }
29
+ // The ground direction the camera looks at is the screen right turned by a quarter turn
30
+ return Math.atan2(-rightY, rightX) / RADIANS_PER_DEGREE;
31
+ }
32
+
33
+ // Vertical scale of the dial: 1 seen from straight above or below, flatter towards the horizon
34
+ function compassTilt(basis: ViewBasis): number {
35
+ return Math.max(MIN_COMPASS_TILT, Math.abs(basis.toViewer[2]));
36
+ }
37
+
38
+ // SVG position (y downwards) of the dial point at the given clockwise angle from north, once the
39
+ // Dial is turned by -heading and flattened by tilt
40
+ function compassDialPoint(angle: number, radius: number, heading: number, tilt: number): DialPoint {
41
+ const screenAngle = (angle - heading) * RADIANS_PER_DEGREE;
42
+ return {
43
+ x: radius * Math.sin(screenAngle),
44
+ y: -radius * Math.cos(screenAngle) * tilt,
45
+ };
46
+ }
47
+
48
+ // Whether the camera already looks towards the given heading, clockwise in degrees from north
49
+ function isFacing(basis: ViewBasis, targetHeading: number): boolean {
50
+ const heading = compassHeading(basis);
51
+ if (heading === undefined) {
52
+ return false;
53
+ }
54
+ const gap = (((heading - targetHeading) % FULL_TURN) + FULL_TURN) % FULL_TURN;
55
+ return Math.min(gap, FULL_TURN - gap) < FACING_TOLERANCE;
56
+ }
57
+
58
+ function rotateAroundZ(vector: Vec3, angle: number): Vec3 {
59
+ const cosine = Math.cos(angle);
60
+ const sine = Math.sin(angle);
61
+ return [vector[0] * cosine - vector[1] * sine, vector[0] * sine + vector[1] * cosine, vector[2]];
62
+ }
63
+
64
+ // Same camera turned around the vertical axis through its focal point so that it looks towards the
65
+ // Given heading, clockwise in degrees from north (keeps the elevation and the distance). Undefined when
66
+ // No heading can be read.
67
+ function facingCameraPose(
68
+ pose: CameraPose,
69
+ basis: ViewBasis,
70
+ targetHeading: number,
71
+ ): CameraPose | undefined {
72
+ const heading = compassHeading(basis);
73
+ if (heading === undefined) {
74
+ return undefined;
75
+ }
76
+ // A counterclockwise turn by the heading difference brings the view direction to the target
77
+ const angle = (heading - targetHeading) * RADIANS_PER_DEGREE;
78
+ const [focalX, focalY, focalZ] = pose.focal_point;
79
+ const offset = rotateAroundZ(
80
+ [pose.position[0] - focalX, pose.position[1] - focalY, pose.position[2] - focalZ],
81
+ angle,
82
+ );
83
+ return {
84
+ focal_point: pose.focal_point,
85
+ position: [focalX + offset[0], focalY + offset[1], focalZ + offset[2]],
86
+ view_up: rotateAroundZ(pose.view_up, angle),
87
+ };
88
+ }
89
+
90
+ function northUpCameraPose(pose: CameraPose, basis: ViewBasis): CameraPose | undefined {
91
+ return facingCameraPose(pose, basis, 0);
92
+ }
93
+
94
+ export {
95
+ MIN_COMPASS_TILT,
96
+ compassDialPoint,
97
+ compassHeading,
98
+ compassTilt,
99
+ facingCameraPose,
100
+ isFacing,
101
+ northUpCameraPose,
102
+ };
103
+ export type { DialPoint };
@@ -0,0 +1,73 @@
1
+ // Camera frame of the orientation overlay (Viewer/OrientationGlobe.vue), drawn by the front over the
2
+ // Viewer image. Pure math on the camera pose (position, focal point, view up): no vtk.js nor Vue here.
3
+
4
+ type Vec3 = readonly [number, number, number];
5
+
6
+ interface CameraPose {
7
+ position: Vec3;
8
+ focal_point: Vec3;
9
+ view_up: Vec3;
10
+ }
11
+
12
+ // Camera frame in world coordinates: screen right, screen up, and the direction towards the viewer
13
+ interface ViewBasis {
14
+ right: Vec3;
15
+ upward: Vec3;
16
+ toViewer: Vec3;
17
+ }
18
+
19
+ const EPSILON = 1e-9;
20
+ const VECTOR_SIZE = 3;
21
+
22
+ function subtract(first: Vec3, second: Vec3): Vec3 {
23
+ return [first[0] - second[0], first[1] - second[1], first[2] - second[2]];
24
+ }
25
+
26
+ function cross(first: Vec3, second: Vec3): Vec3 {
27
+ return [
28
+ first[1] * second[2] - first[2] * second[1],
29
+ first[2] * second[0] - first[0] * second[2],
30
+ first[0] * second[1] - first[1] * second[0],
31
+ ];
32
+ }
33
+
34
+ function normalize(vector: Vec3): Vec3 | undefined {
35
+ const length = Math.hypot(...vector);
36
+ if (length < EPSILON) {
37
+ return undefined;
38
+ }
39
+ return [vector[0] / length, vector[1] / length, vector[2] / length];
40
+ }
41
+
42
+ function isVec3(value: unknown): value is Vec3 {
43
+ return (
44
+ Array.isArray(value) &&
45
+ value.length === VECTOR_SIZE &&
46
+ value.every((item) => typeof item === "number" && Number.isFinite(item))
47
+ );
48
+ }
49
+
50
+ // Reads a pose from the loosely typed camera options of the hybrid viewer store
51
+ function toCameraPose(options: Record<string, unknown>): CameraPose | undefined {
52
+ const { position, focal_point, view_up } = options;
53
+ if (!isVec3(position) || !isVec3(focal_point) || !isVec3(view_up)) {
54
+ return undefined;
55
+ }
56
+ return { position, focal_point, view_up };
57
+ }
58
+
59
+ // Undefined for a degenerate camera (position on the focal point, view up along the view direction)
60
+ function cameraViewBasis(pose: CameraPose): ViewBasis | undefined {
61
+ const toViewer = normalize(subtract(pose.position, pose.focal_point));
62
+ if (!toViewer) {
63
+ return undefined;
64
+ }
65
+ const right = normalize(cross(pose.view_up, toViewer));
66
+ if (!right) {
67
+ return undefined;
68
+ }
69
+ return { right, upward: cross(toViewer, right), toViewer };
70
+ }
71
+
72
+ export { cameraViewBasis, toCameraPose };
73
+ export type { CameraPose, Vec3, ViewBasis };
@@ -0,0 +1,145 @@
1
+ // Geometry of the orientation globe (Viewer/OrientationGlobe.vue): a sphere crossed by horizontal strata
2
+ // (latitude rings, horizontal in the world, so the tilt reads at a glance), the world axes from its
3
+ // Center and the north (+Y) on its equator. Pure math on the camera view basis: no vtk.js nor Vue here.
4
+ // SVG coordinates: origin at the globe center, y grows downwards.
5
+ import type { Vec3, ViewBasis } from "@ogw_front/utils/orientation_gizmo";
6
+
7
+ type GlobeAxis = "x" | "y" | "z";
8
+
9
+ interface GlobeLabel {
10
+ axis: GlobeAxis;
11
+ // Text drawn at the end of the axis: X, Y or Z
12
+ text: string;
13
+ // Key of the camera orientation looking from this end (see camera_helpers ORIENTATIONS)
14
+ key: string;
15
+ // Projected end of the axis, on the sphere
16
+ tipX: number;
17
+ tipY: number;
18
+ // Label position, outside the sphere along the projected axis
19
+ x: number;
20
+ y: number;
21
+ // Component towards the viewer: 1 points at the viewer, -1 away from it
22
+ depth: number;
23
+ // The axis points (nearly) at or away from the viewer: its label sits next to the center
24
+ foreshortened: boolean;
25
+ }
26
+
27
+ interface RingPaths {
28
+ front: string;
29
+ back: string;
30
+ }
31
+
32
+ const DEGREES_PER_HALF_TURN = 180;
33
+ const RADIANS_PER_DEGREE = Math.PI / DEGREES_PER_HALF_TURN;
34
+ const FULL_TURN_DEGREES = 360;
35
+ const RING_SEGMENTS = 96;
36
+ // Heights of the latitude rings (unit sphere), the equator in the middle
37
+ const STRATA_LINE_HEIGHT = 0.62;
38
+ const STRATA_LINES = [STRATA_LINE_HEIGHT, 0, -STRATA_LINE_HEIGHT] as const;
39
+ // Gap between the sphere and the labels, in SVG units
40
+ const LABEL_GAP = 11;
41
+ // Under this projected length (ratio of the radius), the axis points at the viewer
42
+ const FORESHORTENED_RATIO = 0.18;
43
+ const FORESHORTENED_OFFSET = 8;
44
+ const AXES: readonly { axis: GlobeAxis; vector: Vec3; key: string }[] = [
45
+ { axis: "x", vector: [1, 0, 0], key: "xplus" },
46
+ { axis: "y", vector: [0, 1, 0], key: "yplus" },
47
+ { axis: "z", vector: [0, 0, 1], key: "zplus" },
48
+ ];
49
+
50
+ function dot(first: Vec3, second: Vec3): number {
51
+ return first[0] * second[0] + first[1] * second[1] + first[2] * second[2];
52
+ }
53
+
54
+ // Screen position of a point of the unit sphere (world coordinates) for a globe of the given radius
55
+ function projectOnGlobe(basis: ViewBasis, radius: number, point: Vec3): [number, number, number] {
56
+ return [
57
+ radius * dot(point, basis.right),
58
+ -radius * dot(point, basis.upward),
59
+ dot(point, basis.toViewer),
60
+ ];
61
+ }
62
+
63
+ function pathPoint(previous: boolean | undefined, current: boolean, x: number, y: number): string {
64
+ const command = previous === current ? "L" : "M";
65
+ return `${command}${x.toFixed(2)} ${y.toFixed(2)}`;
66
+ }
67
+
68
+ // Latitude ring at the given height of the unit sphere, split into its half facing the viewer and its
69
+ // Hidden half (drawn fainter)
70
+ function latitudeRing(basis: ViewBasis, radius: number, height: number): RingPaths {
71
+ const ringRadius = Math.sqrt(Math.max(0, 1 - height * height));
72
+ let front = "";
73
+ let back = "";
74
+ let previous: boolean | undefined = undefined;
75
+ for (let index = 0; index <= RING_SEGMENTS; index += 1) {
76
+ const angle = (2 * Math.PI * index) / RING_SEGMENTS;
77
+ const [x, y, depth] = projectOnGlobe(basis, radius, [
78
+ ringRadius * Math.cos(angle),
79
+ ringRadius * Math.sin(angle),
80
+ height,
81
+ ]);
82
+ const facing = depth >= 0;
83
+ if (facing) {
84
+ front += pathPoint(previous, true, x, y);
85
+ } else {
86
+ back += pathPoint(previous === false ? false : undefined, false, x, y);
87
+ }
88
+ previous = facing;
89
+ }
90
+ return { front, back };
91
+ }
92
+
93
+ function strataRings(basis: ViewBasis, radius: number): (RingPaths & { equator: boolean })[] {
94
+ return STRATA_LINES.map((height) => {
95
+ const { front, back } = latitudeRing(basis, radius, height);
96
+ return { front, back, equator: height === 0 };
97
+ });
98
+ }
99
+
100
+ // Axis labels, back to front so the nearest axis is drawn last
101
+ function globeLabels(basis: ViewBasis, radius: number): GlobeLabel[] {
102
+ const labels: GlobeLabel[] = [];
103
+ for (const { axis, vector, key } of AXES) {
104
+ const text = axis.toUpperCase();
105
+ const [tipX, tipY, depth] = projectOnGlobe(basis, radius, vector);
106
+ const length = Math.hypot(tipX, tipY);
107
+ const foreshortened = length < radius * FORESHORTENED_RATIO;
108
+ const scale = foreshortened ? 0 : (radius + LABEL_GAP) / length;
109
+ labels.push({
110
+ axis,
111
+ text,
112
+ key,
113
+ tipX,
114
+ tipY,
115
+ x: foreshortened ? FORESHORTENED_OFFSET : tipX * scale,
116
+ y: foreshortened ? -FORESHORTENED_OFFSET : tipY * scale,
117
+ depth,
118
+ foreshortened,
119
+ });
120
+ }
121
+ return labels.toSorted((first, second) => first.depth - second.depth);
122
+ }
123
+
124
+ // North (+Y) on the equator
125
+ function northPoint(basis: ViewBasis, radius: number): { x: number; y: number; depth: number } {
126
+ const [x, y, depth] = projectOnGlobe(basis, radius, [0, 1, 0]);
127
+ return { x, y, depth };
128
+ }
129
+
130
+ // Angle of the camera above the horizon, in degrees: 90 looking straight down
131
+ function cameraElevation(basis: ViewBasis): number {
132
+ return Math.asin(Math.max(-1, Math.min(1, basis.toViewer[2]))) / RADIANS_PER_DEGREE;
133
+ }
134
+
135
+ // Geologist's reading of the view: azimuth of the view direction, then elevation ("N 030° · 25°")
136
+ function orientationReadout(heading: number, elevation: number): string {
137
+ const azimuth = Math.round(
138
+ ((heading % FULL_TURN_DEGREES) + FULL_TURN_DEGREES) % FULL_TURN_DEGREES,
139
+ );
140
+ const padded = String(azimuth % FULL_TURN_DEGREES).padStart(3, "0");
141
+ return `N ${padded}° · ${Math.round(elevation)}°`;
142
+ }
143
+
144
+ export { cameraElevation, globeLabels, latitudeRing, northPoint, orientationReadout, strataRings };
145
+ export type { GlobeAxis, GlobeLabel, RingPaths };
@@ -0,0 +1,119 @@
1
+ // Strata fills of the orientation globe (Viewer/OrientationGlobe.vue): the sphere is cut by horizontal
2
+ // Planes of the world into alternate light and clear layers, like the slices of the Geode Solutions mark.
3
+ // Rasterized per pixel with supersampling for smooth edges. Pure math: no vtk.js nor Vue here.
4
+ import type { ViewBasis } from "@ogw_front/utils/orientation_gizmo";
5
+
6
+ interface Strata {
7
+ // World height range of the stratum on the unit sphere
8
+ bottom: number;
9
+ top: number;
10
+ // Fill opacity, 0 for the strata left clear
11
+ opacity: number;
12
+ }
13
+
14
+ interface StrataSample {
15
+ coverage: number;
16
+ shade: number;
17
+ }
18
+
19
+ // Same heights as the latitude rings of the globe (orientation_globe.ts)
20
+ const STRATA_LINE_HEIGHT = 0.62;
21
+ const LIGHT_OPACITY = 0.62;
22
+ const SHADOW_OPACITY = 0.38;
23
+ const STRATA: readonly Strata[] = [
24
+ { bottom: STRATA_LINE_HEIGHT, top: 1, opacity: LIGHT_OPACITY },
25
+ { bottom: 0, top: STRATA_LINE_HEIGHT, opacity: 0 },
26
+ { bottom: -STRATA_LINE_HEIGHT, top: 0, opacity: SHADOW_OPACITY },
27
+ { bottom: -1, top: -STRATA_LINE_HEIGHT, opacity: 0 },
28
+ ];
29
+ const SUPERSAMPLING = 3;
30
+ const SAMPLE_CENTER = 0.5;
31
+ const SHADE_BASE = 0.85;
32
+ const SHADE_RANGE = 0.15;
33
+ const BYTES_PER_PIXEL = 4;
34
+ const MAX_CHANNEL = 255;
35
+ const RGB_CHANNELS = 3;
36
+ const HEX_BASE = 16;
37
+ const HEX_CHANNEL_LENGTH = 2;
38
+
39
+ // World height of the visible sphere point under the given screen offset, as a ratio of the radius
40
+ // (x right, y down). Undefined outside the sphere.
41
+ function visibleHeight(basis: ViewBasis, x: number, y: number): number | undefined {
42
+ const squared = x * x + y * y;
43
+ if (squared > 1) {
44
+ return undefined;
45
+ }
46
+ const towardsViewer = Math.sqrt(1 - squared);
47
+ return x * basis.right[2] - y * basis.upward[2] + towardsViewer * basis.toViewer[2];
48
+ }
49
+
50
+ // Fill opacity of the stratum at this world height
51
+ function strataOpacity(height: number): number {
52
+ return STRATA.find(({ bottom, top }) => height >= bottom && height <= top)?.opacity ?? 0;
53
+ }
54
+
55
+ // "#RRGGBB" to its red, green and blue channels
56
+ function hexChannels(color: string): number[] {
57
+ return Array.from({ length: RGB_CHANNELS }, (_item, channel) => {
58
+ const start = 1 + channel * HEX_CHANNEL_LENGTH;
59
+ return Number.parseInt(color.slice(start, start + HEX_CHANNEL_LENGTH), HEX_BASE);
60
+ });
61
+ }
62
+
63
+ // Coverage and lighting of one sample of the globe (x, y in radius units, y down)
64
+ function strataSample(basis: ViewBasis, x: number, y: number): StrataSample {
65
+ const height = visibleHeight(basis, x, y);
66
+ if (height === undefined) {
67
+ return { coverage: 0, shade: 0 };
68
+ }
69
+ const coverage = strataOpacity(height);
70
+ const towardsViewer = Math.sqrt(Math.max(0, 1 - x * x - y * y));
71
+ return { coverage, shade: coverage * (SHADE_BASE + SHADE_RANGE * towardsViewer) };
72
+ }
73
+
74
+ // Supersampled coverage and lighting of one canvas pixel
75
+ function strataPixel(
76
+ basis: ViewBasis,
77
+ column: number,
78
+ row: number,
79
+ pixelsPerRadius: number,
80
+ ): StrataSample {
81
+ const total: StrataSample = { coverage: 0, shade: 0 };
82
+ for (let index = 0; index < SUPERSAMPLING * SUPERSAMPLING; index += 1) {
83
+ const sampleColumn = index % SUPERSAMPLING;
84
+ const sampleRow = Math.floor(index / SUPERSAMPLING);
85
+ const x = (column + (sampleColumn + SAMPLE_CENTER) / SUPERSAMPLING) / pixelsPerRadius - 1;
86
+ const y = (row + (sampleRow + SAMPLE_CENTER) / SUPERSAMPLING) / pixelsPerRadius - 1;
87
+ const sample = strataSample(basis, x, y);
88
+ total.coverage += sample.coverage;
89
+ total.shade += sample.shade;
90
+ }
91
+ return total;
92
+ }
93
+
94
+ // RGBA pixels of the strata fills for a square canvas of the given side covering the globe:
95
+ // Alternate light and clear layers, like the slices of the brand mark, lit a bit more towards the viewer
96
+ function strataPixels(basis: ViewBasis, side: number, color: string): Uint8ClampedArray {
97
+ const channels = hexChannels(color);
98
+ const pixels = new Uint8ClampedArray(side * side * BYTES_PER_PIXEL);
99
+ const pixelsPerRadius = side / 2;
100
+ const samples = SUPERSAMPLING * SUPERSAMPLING;
101
+ for (let index = 0; index < side * side; index += 1) {
102
+ const { coverage, shade } = strataPixel(
103
+ basis,
104
+ index % side,
105
+ Math.floor(index / side),
106
+ pixelsPerRadius,
107
+ );
108
+ if (coverage > 0) {
109
+ const offset = index * BYTES_PER_PIXEL;
110
+ for (let channel = 0; channel < RGB_CHANNELS; channel += 1) {
111
+ pixels[offset + channel] = (channels[channel] ?? 0) * (shade / coverage);
112
+ }
113
+ pixels[offset + RGB_CHANNELS] = (MAX_CHANNEL * coverage) / samples;
114
+ }
115
+ }
116
+ return pixels;
117
+ }
118
+
119
+ export { strataOpacity, strataPixels, visibleHeight };
@@ -0,0 +1,105 @@
1
+ // Third party imports
2
+ import type { IconAliases, IconOptions, IconProps, IconSet } from "vuetify";
3
+ import { type VNode, h } from "vue";
4
+
5
+ // Icons of the apps: Phosphor (https://phosphoricons.com), the flat line icons of the Geode Solutions
6
+ // Brand book. An icon is written "ph-<name>" for the regular weight or "ph-fill ph-<name>" for the
7
+ // Fill one, optionally followed by other classes. The font CSS is registered in nuxt.config `css`.
8
+ const PHOSPHOR_SET_NAME = "ph";
9
+ const REGULAR_WEIGHT = "ph";
10
+ const FILL_WEIGHT = "ph-fill";
11
+
12
+ // Classes of the rendered tag: the weight class, then the icon classes as written
13
+ function phosphorIconClass(icon: string): string {
14
+ const classes = icon.trim().split(/\s+/u);
15
+ if (classes[0] !== FILL_WEIGHT) {
16
+ classes.unshift(REGULAR_WEIGHT);
17
+ }
18
+ return classes.join(" ");
19
+ }
20
+
21
+ // Same shape as Vuetify's VClassIcon: the v-icon classes, styles and attributes fall through to the
22
+ // Rendered tag, so sizes and colors behave as with any font icon set
23
+ function PhosphorIcon(props: IconProps): VNode {
24
+ return h(props.tag, { class: phosphorIconClass(String(props.icon ?? "")) });
25
+ }
26
+ PhosphorIcon.props = ["icon", "tag"];
27
+
28
+ const phosphor: IconSet = { component: PhosphorIcon };
29
+
30
+ // Icons Vuetify components draw by themselves ($close, $checkboxOn, $expand...)
31
+ const PHOSPHOR_ALIASES: IconAliases = {
32
+ collapse: "ph-caret-up",
33
+ complete: "ph-check",
34
+ cancel: "ph-x-circle",
35
+ close: "ph-x",
36
+ delete: "ph-x-circle",
37
+ clear: "ph-x-circle",
38
+ success: "ph-check-circle",
39
+ info: "ph-info",
40
+ warning: "ph-warning-circle",
41
+ error: "ph-x-circle",
42
+ prev: "ph-caret-left",
43
+ next: "ph-caret-right",
44
+ checkboxOn: "ph-check-square",
45
+ checkboxOff: "ph-square",
46
+ checkboxIndeterminate: "ph-minus-square",
47
+ delimiter: "ph-fill ph-circle",
48
+ sortAsc: "ph-arrow-up",
49
+ sortDesc: "ph-arrow-down",
50
+ expand: "ph-caret-down",
51
+ menu: "ph-list",
52
+ subgroup: "ph-caret-down",
53
+ dropdown: "ph-caret-down",
54
+ radioOn: "ph-radio-button",
55
+ radioOff: "ph-circle",
56
+ edit: "ph-pencil-simple",
57
+ ratingEmpty: "ph-star",
58
+ ratingFull: "ph-fill ph-star",
59
+ ratingHalf: "ph-fill ph-star-half",
60
+ loading: "ph-arrows-clockwise",
61
+ first: "ph-caret-line-left",
62
+ last: "ph-caret-line-right",
63
+ unfold: "ph-caret-up-down",
64
+ file: "ph-paperclip",
65
+ plus: "ph-plus",
66
+ minus: "ph-minus",
67
+ calendar: "ph-calendar-blank",
68
+ treeviewCollapse: "ph-caret-down",
69
+ treeviewExpand: "ph-caret-right",
70
+ tableGroupCollapse: "ph-caret-down",
71
+ tableGroupExpand: "ph-caret-right",
72
+ eyeDropper: "ph-eyedropper",
73
+ upload: "ph-cloud-arrow-up",
74
+ color: "ph-palette",
75
+ command: "ph-command",
76
+ ctrl: "ph-control",
77
+ space: "ph-keyboard",
78
+ shift: "ph-arrow-fat-up",
79
+ alt: "ph-option",
80
+ enter: "ph-key-return",
81
+ arrowup: "ph-arrow-up",
82
+ arrowdown: "ph-arrow-down",
83
+ arrowleft: "ph-arrow-left",
84
+ arrowright: "ph-arrow-right",
85
+ backspace: "ph-backspace",
86
+ play: "ph-play",
87
+ pause: "ph-pause",
88
+ fullscreen: "ph-corners-out",
89
+ fullscreenExit: "ph-corners-in",
90
+ volumeHigh: "ph-speaker-high",
91
+ volumeMedium: "ph-speaker-low",
92
+ volumeLow: "ph-speaker-none",
93
+ volumeOff: "ph-speaker-x",
94
+ search: "ph-magnifying-glass",
95
+ };
96
+
97
+ function phosphorIconOptions(): IconOptions {
98
+ return {
99
+ defaultSet: PHOSPHOR_SET_NAME,
100
+ aliases: PHOSPHOR_ALIASES,
101
+ sets: { [PHOSPHOR_SET_NAME]: phosphor },
102
+ };
103
+ }
104
+
105
+ export { PHOSPHOR_ALIASES, PHOSPHOR_SET_NAME, phosphor, phosphorIconClass, phosphorIconOptions };
@@ -1,4 +1,5 @@
1
- import type { DataIdentified, GeodeObjectType } from "@ogw_front/types/identifiers";
1
+ import type { DataIdentified } from "@ogw_front/types/identifiers";
2
+ import type { GeodeObjectType } from "@geode/opengeodeweb-microservice/data_types";
2
3
 
3
4
  const GRID_TYPES = new Set([
4
5
  "RegularGrid2D",
@@ -4,7 +4,7 @@ import {
4
4
  MODEL_COMPONENT_KINDS,
5
5
  } from "@ogw_front/utils/attributes";
6
6
  import type { AttributeSource } from "@ogw_front/utils/threshold";
7
- import type { DataId } from "@ogw_front/types/identifiers";
7
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
8
8
  import { attributeSchemas } from "@ogw_front/composables/attribute_coloring_style";
9
9
  import type { useDataStore } from "@ogw_front/stores/data";
10
10
 
@@ -1,11 +1,11 @@
1
1
  import type {
2
- AttributeColorMap,
3
2
  AttributeItem,
4
3
  AttributeName,
5
4
  AttributeRangeMaximum,
6
5
  AttributeRangeMinimum,
7
- } from "@ogw_front/types/attribute";
8
- import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
6
+ ColorRGBA,
7
+ } from "@geode/opengeodeweb-viewer/schema_types";
8
+ import type { AttributeColorMap } from "@ogw_front/types/attribute";
9
9
 
10
10
  // The same fields while the user has not chosen them yet
11
11
  type Undefinable<Fields> = { [Field in keyof Fields]: Fields[Field] | undefined };
@@ -28,7 +28,7 @@ interface AttributeColorMapped {
28
28
  // What is kept of an attribute coloring when another attribute is picked
29
29
  interface AttributeStoredConfig
30
30
  extends Undefinable<AttributeBounds>, Undefinable<AttributeColorMapped> {
31
- no_data_color: RGBAColor;
31
+ no_data_color: ColorRGBA;
32
32
  }
33
33
 
34
34
  // The input of an attribute coloring while the user has not chosen all of it yet
@@ -37,11 +37,11 @@ interface AttributeInput
37
37
  Undefinable<AttributeSelection>,
38
38
  Undefinable<AttributeBounds>,
39
39
  Undefinable<AttributeColorMapped> {
40
- no_data_color?: RGBAColor;
40
+ no_data_color?: ColorRGBA;
41
41
  }
42
42
 
43
43
  interface ValidAttributeInput extends AttributeSelection, AttributeBounds, AttributeColorMapped {
44
- no_data_color?: RGBAColor;
44
+ no_data_color?: ColorRGBA;
45
45
  }
46
46
 
47
47
  interface AttributeState extends Partial<AttributeSelection> {
@@ -1,6 +1,5 @@
1
+ import type { ColorRGBA, Visibility } from "@geode/opengeodeweb-viewer/schema_types";
1
2
  import type { MeshId } from "@ogw_front/types/identifiers";
2
- import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
3
- import type { Visibility } from "@ogw_front/types/style";
4
3
  // Third party imports
5
4
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
6
5
 
@@ -16,8 +15,8 @@ const meshSchemas = viewer_schemas.opengeodeweb_viewer.mesh;
16
15
  interface MeshBaseStyle {
17
16
  meshVisibility: (meshId: MeshId) => Visibility | undefined;
18
17
  setMeshVisibility: (meshId: MeshId, visibility: Visibility) => Promise<unknown>;
19
- meshColor: (meshId: MeshId) => RGBAColor | undefined;
20
- setMeshColor: (meshId: MeshId, color: RGBAColor) => Promise<unknown>;
18
+ meshColor: (meshId: MeshId) => ColorRGBA | undefined;
19
+ setMeshColor: (meshId: MeshId, color: ColorRGBA) => Promise<unknown>;
21
20
  }
22
21
 
23
22
  export function useMeshBaseStyle(): MeshBaseStyle {
@@ -49,12 +48,12 @@ export function useMeshBaseStyle(): MeshBaseStyle {
49
48
  return result;
50
49
  }
51
50
 
52
- function meshColor(meshId: MeshId): RGBAColor | undefined {
51
+ function meshColor(meshId: MeshId): ColorRGBA | undefined {
53
52
  // oxlint-disable-next-line no-unsafe-type-assertion -- color shape is defined by the data style schema.
54
- return dataStyleState.getStyle(meshId).color as RGBAColor | undefined;
53
+ return dataStyleState.getStyle(meshId).color as ColorRGBA | undefined;
55
54
  }
56
55
 
57
- async function setMeshColor(meshId: MeshId, color: RGBAColor): Promise<unknown> {
56
+ async function setMeshColor(meshId: MeshId, color: ColorRGBA): Promise<unknown> {
58
57
  const schema = meshSchemas.color;
59
58
  const params = { id: meshId, color };
60
59
  const result = await viewerStore.request(
@@ -1,17 +1,17 @@
1
+ import type { AttributeColorMap, AttributeTimeStep } from "@ogw_front/types/attribute";
1
2
  import type {
2
- AttributeColorMap,
3
3
  AttributeItem,
4
4
  AttributeName,
5
5
  AttributeRangeMaximum,
6
6
  AttributeRangeMinimum,
7
- AttributeTimeStep,
8
- } from "@ogw_front/types/attribute";
9
- import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
7
+ ColorRGBA,
8
+ } from "@geode/opengeodeweb-viewer/schema_types";
9
+ import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
10
10
  import type { MeshId } from "@ogw_front/types/identifiers";
11
11
  import type { ValidAttributeInput } from "@ogw_internal/stores/data_style/attribute_types";
12
- import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
13
12
  // Third party imports
14
13
  import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
14
+ import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
15
15
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
16
16
 
17
17
  // Local imports
@@ -162,7 +162,7 @@ function useMeshCellsCellAttributeStyle(): UseMeshCellsCellAttributeStyleReturn
162
162
  }
163
163
  async function setMeshCellsCellAttributeNoDataColor(
164
164
  meshId: MeshId,
165
- no_data_color: RGBAColor,
165
+ no_data_color: ColorRGBA,
166
166
  ): Promise<unknown> {
167
167
  const name = meshCellsCellAttributeName(meshId);
168
168
  const item = meshCellsCellAttributeItem(meshId);