@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
@@ -1,4 +1,5 @@
1
- import { BACKGROUND_GREY_VALUE, RGB_MAX } from "./constants";
1
+ import { RGB_MAX } from "./constants";
2
+ import { getDefaultSceneStyle } from "@ogw_front/utils/default_styles";
2
3
  import { useHybridViewerCore } from "./core";
3
4
 
4
5
  const RGBA_CHANNELS = 4;
@@ -66,11 +67,17 @@ function sampleMinBrightness(
66
67
  return minBrightness;
67
68
  }
68
69
 
70
+ // Brightness of the scene background a reset viewer draws, for as long as no viewer image can be sampled
71
+ function defaultBackgroundBrightness(): number {
72
+ const { red, green, blue } = getDefaultSceneStyle().background_color;
73
+ return (red + green + blue) / (3 * RGB_MAX);
74
+ }
75
+
69
76
  function computeAverageBrightness(rect: Rect, options: BrightnessOptions): number {
70
77
  const { latestImage, offscreenCtx, offscreenCanvas } = options;
71
78
  const { genericRenderWindow } = useHybridViewerCore();
72
79
  if (!latestImage || !offscreenCtx || !offscreenCanvas || !genericRenderWindow.value) {
73
- return BACKGROUND_GREY_VALUE / RGB_MAX;
80
+ return defaultBackgroundBrightness();
74
81
  }
75
82
  // oxlint-disable-next-line no-unsafe-assignment -- vtk.js has no types for getApiSpecificRenderWindow(); narrowed below.
76
83
  const webGLRenderWindow = genericRenderWindow.value.getApiSpecificRenderWindow();
@@ -80,21 +87,21 @@ function computeAverageBrightness(rect: Rect, options: BrightnessOptions): numbe
80
87
  };
81
88
  const canvas = apiSpecificRenderWindow.getCanvas();
82
89
  if (canvas === undefined || canvas === null) {
83
- return BACKGROUND_GREY_VALUE / RGB_MAX;
90
+ return defaultBackgroundBrightness();
84
91
  }
85
92
  if (rect.width <= 0 || rect.height <= 0) {
86
- return BACKGROUND_GREY_VALUE / RGB_MAX;
93
+ return defaultBackgroundBrightness();
87
94
  }
88
95
  const relRect = mapRect(rect, latestImage, canvas.getBoundingClientRect());
89
96
  if (relRect.relW <= 0 || relRect.relH <= 0) {
90
- return BACKGROUND_GREY_VALUE / RGB_MAX;
97
+ return defaultBackgroundBrightness();
91
98
  }
92
99
  offscreenCanvas.width = SAMPLE_SIZE;
93
100
  offscreenCanvas.height = SAMPLE_SIZE;
94
101
  try {
95
102
  return sampleMinBrightness(offscreenCtx, latestImage, relRect);
96
103
  } catch {
97
- return BACKGROUND_GREY_VALUE / RGB_MAX;
104
+ return defaultBackgroundBrightness();
98
105
  }
99
106
  }
100
107
  function createOffscreenCanvas(): HTMLCanvasElement | undefined {
@@ -127,4 +134,4 @@ function useHybridViewerBrightness(): {
127
134
  getAverageBrightness,
128
135
  };
129
136
  }
130
- export { computeAverageBrightness, useHybridViewerBrightness };
137
+ export { computeAverageBrightness, defaultBackgroundBrightness, useHybridViewerBrightness };
@@ -2,7 +2,7 @@ import { EASE_EXPONENT, applyCameraOptions, getImageStyle, toBounds } from "./ca
2
2
  import { animateCamera, computeAnimationDuration, getCameraOptions } from "./camera_animation";
3
3
  import { requireRenderWindow, useHybridViewerCore } from "./core";
4
4
  import type { CameraOptions } from "./vtk_types";
5
- import type { DataId } from "@ogw_front/types/identifiers";
5
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
6
6
  import { animateCameraOrientation } from "./camera_orientation";
7
7
  import { useHybridViewerScene } from "./scene";
8
8
  import { useViewerStore } from "@ogw_front/stores/viewer";
@@ -1,21 +1,10 @@
1
1
  const RGB_MAX = 255;
2
- const BACKGROUND_GREY_VALUE = 180;
3
2
  const ACTOR_DARK_VALUE = 20;
4
3
 
5
- const bgVal = BACKGROUND_GREY_VALUE / RGB_MAX;
6
- const BACKGROUND_COLOR: [number, number, number] = [bgVal, bgVal, bgVal];
7
4
  const actVal = ACTOR_DARK_VALUE / RGB_MAX;
8
5
  const ACTOR_COLOR: [number, number, number] = [actVal, actVal, actVal];
9
6
  const HOVER_TIMEOUT_MS = 500;
10
7
  const WHEEL_TIME_OUT_MS = 600;
11
8
  const HOVER_DEBOUNCE_MS = 50;
12
9
 
13
- export {
14
- ACTOR_COLOR,
15
- BACKGROUND_COLOR,
16
- BACKGROUND_GREY_VALUE,
17
- HOVER_DEBOUNCE_MS,
18
- HOVER_TIMEOUT_MS,
19
- RGB_MAX,
20
- WHEEL_TIME_OUT_MS,
21
- };
10
+ export { ACTOR_COLOR, HOVER_DEBOUNCE_MS, HOVER_TIMEOUT_MS, RGB_MAX, WHEEL_TIME_OUT_MS };
@@ -2,8 +2,8 @@ import type { JsonRpcSchema, ParamsOf, ResponseOf } from "@ogw_shared/utils/type
2
2
  import viewer_schemas, {
3
3
  type ViewerClippingPlanesParams,
4
4
  } from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
5
- import type { AttributeName } from "@ogw_front/types/attribute";
6
- import type { DataId } from "@ogw_front/types/identifiers";
5
+ import type { AttributeName } from "@geode/opengeodeweb-viewer/schema_types";
6
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
7
7
  import type { SliceAxis } from "@ogw_front/utils/slice";
8
8
  import { useHybridViewerCore } from "./core";
9
9
  import { useViewerStore } from "@ogw_front/stores/viewer";
@@ -1,10 +1,11 @@
1
- import type { GeodeId, GeodeIdentified, ModelId } from "@ogw_front/types/identifiers";
1
+ import type { GeodeIdentified, ModelId } from "@ogw_front/types/identifiers";
2
2
  import { HOVER_DEBOUNCE_MS, HOVER_TIMEOUT_MS } from "./constants";
3
3
  import type { HoverComponentInfo, HoverData } from "./vtk_types";
4
4
  import viewer_schemas, {
5
5
  type PickedFieldType,
6
6
  type ViewerHighlightResponse,
7
7
  } from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
8
+ import type { GeodeId } from "@geode/opengeodeweb-microservice/schema_types";
8
9
  import type { IndexableType } from "dexie";
9
10
  import { database } from "@ogw_internal/database/database.js";
10
11
  import { useHybridViewerCore } from "./core";
@@ -4,10 +4,11 @@ import { requireRenderWindow, useHybridViewerCore } from "./core";
4
4
  import viewer_schemas, {
5
5
  type ViewerSetBackgroundColorParams,
6
6
  } from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
7
- import type { DataId } from "@ogw_front/types/identifiers";
8
- import type { Visibility } from "@ogw_front/types/style";
7
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
8
+ import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types";
9
9
  import { base64ToArrayBuffer } from "./base64";
10
10
  import { getCameraOptions } from "./camera_animation";
11
+ import { getDefaultSceneStyle } from "@ogw_front/utils/default_styles";
11
12
  import { useDataStore } from "@ogw_front/stores/data";
12
13
  import { useViewerStore } from "@ogw_front/stores/viewer";
13
14
  import { newInstance as vtkActor } from "@kitware/vtk.js/Rendering/Core/Actor";
@@ -15,10 +16,16 @@ import { newInstance as vtkMapper } from "@kitware/vtk.js/Rendering/Core/Mapper"
15
16
  import type vtkPolyData from "@kitware/vtk.js/Common/DataModel/PolyData";
16
17
  import { newInstance as vtkXMLPolyDataReader } from "@kitware/vtk.js/IO/XML/XMLPolyDataReader";
17
18
 
19
+ // The local renderer shows while the camera moves: it starts on the scene background the viewer gets after a reset
20
+ function localBackgroundColor(): [number, number, number] {
21
+ const { red, green, blue } = getDefaultSceneStyle().background_color;
22
+ return [red / RGB_MAX, green / RGB_MAX, blue / RGB_MAX];
23
+ }
24
+
18
25
  async function setBackgroundColor(color: ViewerSetBackgroundColorParams["color"]): Promise<void> {
19
26
  const { genericRenderWindow, remoteRender } = useHybridViewerCore();
20
27
  const renderer = requireRenderWindow(genericRenderWindow).getRenderer();
21
- renderer.setBackground([color.r / RGB_MAX, color.g / RGB_MAX, color.b / RGB_MAX]);
28
+ renderer.setBackground([color.red / RGB_MAX, color.green / RGB_MAX, color.blue / RGB_MAX]);
22
29
  const renderWindow = requireRenderWindow(genericRenderWindow).getRenderWindow();
23
30
  renderWindow.render();
24
31
  const viewerStore = useViewerStore();
@@ -174,4 +181,4 @@ const useHybridViewerScene = createSharedComposable(() => {
174
181
  };
175
182
  });
176
183
 
177
- export { followZScaling, useHybridViewerScene };
184
+ export { followZScaling, localBackgroundColor, useHybridViewerScene };
package/nuxt.config.ts CHANGED
@@ -115,7 +115,13 @@ export default defineNuxtConfig({
115
115
  },
116
116
 
117
117
  // ** Global CSS
118
- css: ["vuetify/lib/styles/main.sass", path.resolve(__dirname, "app/assets/css/main.css")],
118
+ // Phosphor regular and fill weights, rendered through the icon set of app/plugins/phosphor_icons.ts
119
+ css: [
120
+ "vuetify/lib/styles/main.sass",
121
+ "@phosphor-icons/web/regular",
122
+ "@phosphor-icons/web/fill",
123
+ path.resolve(__dirname, "app/assets/css/main.css"),
124
+ ],
119
125
 
120
126
  // ** Build configuration
121
127
  build: {
@@ -131,6 +137,8 @@ export default defineNuxtConfig({
131
137
  },
132
138
  },
133
139
  vuetifyOptions: {
140
+ // The Phosphor icon set is registered by app/plugins/phosphor_icons.ts (no MDI font)
141
+ icons: false,
134
142
  defaults: {
135
143
  VTooltip: {
136
144
  openDelay: 500,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "11.2.2-rc.1",
3
+ "version": "12.0.0-rc.2",
4
4
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
5
5
  "homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
6
6
  "bugs": {
@@ -24,6 +24,7 @@
24
24
  "tests/browser/helpers",
25
25
  "tests/browser/suites",
26
26
  "tests/browser/data",
27
+ "tests/unit/helpers/phosphor_glyphs.ts",
27
28
  ".build",
28
29
  "nuxt.config.ts",
29
30
  "opengeodeweb_front_schemas.json",
@@ -83,10 +84,11 @@
83
84
  "dependencies": {
84
85
  "@geode/cloud-api": "next",
85
86
  "@geode/opengeodeweb-back": "next",
87
+ "@geode/opengeodeweb-microservice": "next",
86
88
  "@geode/opengeodeweb-viewer": "next",
87
89
  "@kitware/vtk.js": "33.3.0",
88
- "@mdi/font": "7.4.47",
89
90
  "@msgpack/msgpack": "2.8.0",
91
+ "@phosphor-icons/web": "2.1.2",
90
92
  "@pinia/nuxt": "1.0.1",
91
93
  "@types/busboy": "1.5.4",
92
94
  "@types/node": "22.20.3",
@@ -1,21 +1,29 @@
1
+ import type { GeodeObjectType } from "@geode/opengeodeweb-microservice/data_types";
2
+
1
3
  interface AllowedObject {
2
4
  readonly is_loadable: number;
3
5
  readonly object_priority?: number;
4
6
  readonly loadable_family?: string;
5
7
  }
6
- type AllowedObjectMap = Record<string, AllowedObject>;
8
+ type AllowedObjectMap = Partial<Record<GeodeObjectType, AllowedObject>>;
7
9
  // Mirrors the allowed_objects route response
8
10
  interface AllowedObjectsResponse {
9
11
  readonly allowed_objects: AllowedObjectMap;
10
12
  // One type per content of the file, empty when the user has to choose
11
- readonly objects_to_load: readonly string[];
13
+ readonly objects_to_load: readonly GeodeObjectType[];
12
14
  }
13
15
 
14
16
  function getFileExtension(filename: string): string {
15
17
  return filename.slice(filename.lastIndexOf(".") + 1);
16
18
  }
17
19
 
18
- function getObject(objectMap: AllowedObjectMap, key: string): AllowedObject {
20
+ // The types of a map of allowed objects
21
+ function allowedObjectTypes(objectMap: AllowedObjectMap): GeodeObjectType[] {
22
+ // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- Object.keys loses the key type of the map
23
+ return Object.keys(objectMap) as GeodeObjectType[];
24
+ }
25
+
26
+ function getObject(objectMap: AllowedObjectMap, key: GeodeObjectType): AllowedObject {
19
27
  const object = objectMap[key];
20
28
  if (!object) {
21
29
  throw new Error(`Unknown geode object key: ${key}`);
@@ -24,14 +32,14 @@ function getObject(objectMap: AllowedObjectMap, key: string): AllowedObject {
24
32
  }
25
33
 
26
34
  function intersectAllowedObjects(allowedObjectsList: readonly AllowedObjectMap[]): {
27
- commonKeys: string[];
28
- allKeys: string[];
35
+ commonKeys: GeodeObjectType[];
36
+ allKeys: GeodeObjectType[];
29
37
  mergedAllowedObjects: AllowedObjectMap;
30
38
  } {
31
- const allKeys = [...new Set(allowedObjectsList.flatMap((object) => Object.keys(object)))];
39
+ const allKeys = [...new Set(allowedObjectsList.flatMap((object) => allowedObjectTypes(object)))];
32
40
  const commonKeys = allKeys.filter((key) => allowedObjectsList.every((object) => key in object));
33
41
 
34
- const mergedEntries = commonKeys.map((key): [string, AllowedObject] => {
42
+ const mergedEntries = commonKeys.map((key): [GeodeObjectType, AllowedObject] => {
35
43
  const loadScores = allowedObjectsList.map((object) => getObject(object, key).is_loadable);
36
44
  const priorities = allowedObjectsList
37
45
  .map((object) => getObject(object, key).object_priority)
@@ -69,13 +77,13 @@ function resolveAllowedObjects(
69
77
  interface FileAllowedObjects {
70
78
  readonly filename: string;
71
79
  // Loadable types only, sorted by best is_loadable then best object_priority
72
- readonly candidates: string[];
80
+ readonly candidates: GeodeObjectType[];
73
81
  // Types the backend selected to load every content of the file, empty when the user has to choose
74
- readonly selectedGeodeObjects: string[];
82
+ readonly selectedGeodeObjects: GeodeObjectType[];
75
83
  }
76
84
 
77
- function sortCandidates(objectMap: AllowedObjectMap): string[] {
78
- return Object.keys(objectMap)
85
+ function sortCandidates(objectMap: AllowedObjectMap): GeodeObjectType[] {
86
+ return allowedObjectTypes(objectMap)
79
87
  .filter((key) => getObject(objectMap, key).is_loadable > 0)
80
88
  .toSorted((keyA, keyB) => {
81
89
  const objectA = getObject(objectMap, keyA);
@@ -21,11 +21,11 @@ function getMainObjectTree(window: Page): Locator {
21
21
 
22
22
  async function collapseMainObjectTree(window: Page): Promise<void> {
23
23
  const mainObjectTree = getMainObjectTree(window);
24
- await clickCollapseOrExpandAll(window, mainObjectTree, "mdi-collapse-all-outline");
24
+ await clickCollapseOrExpandAll(window, mainObjectTree, "ph-arrows-in-line-vertical");
25
25
  }
26
26
  async function expandMainObjectTree(window: Page): Promise<void> {
27
27
  const mainObjectTree = getMainObjectTree(window);
28
- await clickCollapseOrExpandAll(window, mainObjectTree, "mdi-expand-all-outline");
28
+ await clickCollapseOrExpandAll(window, mainObjectTree, "ph-arrows-out-line-vertical");
29
29
  }
30
30
 
31
31
  async function collapseMainObjectTreeGroup(window: Page, groupName: string): Promise<void> {
@@ -85,7 +85,7 @@ async function focusObjectInTree(
85
85
  await expandGeodeObjectType(window, geodeObjectType);
86
86
  const mainObjectTree = getMainObjectTree(window);
87
87
  const row = await getTreeRowByTextAndParent(window, geodeObjectType, dataName, mainObjectTree);
88
- await row.locator("button:has(.mdi-target)").click({ force: true });
88
+ await row.locator("button:has(.ph-target)").click({ force: true });
89
89
  await waitForActionSettled(window);
90
90
  }
91
91
 
@@ -22,11 +22,11 @@ function getModelComponentTypeTab(window: Page): Locator {
22
22
 
23
23
  async function collapseModelComponentsObjectTree(window: Page): Promise<void> {
24
24
  const modelComponentsObjectTree = getModelComponentsObjectTree(window);
25
- await clickCollapseOrExpandAll(window, modelComponentsObjectTree, "mdi-collapse-all-outline");
25
+ await clickCollapseOrExpandAll(window, modelComponentsObjectTree, "ph-arrows-in-line-vertical");
26
26
  }
27
27
  async function expandModelComponentsObjectTree(window: Page): Promise<void> {
28
28
  const modelComponentsObjectTree = getModelComponentsObjectTree(window);
29
- await clickCollapseOrExpandAll(window, modelComponentsObjectTree, "mdi-expand-all-outline");
29
+ await clickCollapseOrExpandAll(window, modelComponentsObjectTree, "ph-arrows-out-line-vertical");
30
30
  }
31
31
 
32
32
  async function collapseModelComponentsObjectTreeGroup(
@@ -151,7 +151,7 @@ function registerTests({ test, loadTestDatas }: SuiteRuntime): void {
151
151
  await modelComponentsObjectTree
152
152
  .locator(".tree-row-wrapper", { hasText: "00000000-" })
153
153
  .nth(4)
154
- .locator(".mdi-eye-off-outline")
154
+ .locator(".ph-eye-slash")
155
155
  .first()
156
156
  .click();
157
157
  await waitForActionSettled(window);
@@ -0,0 +1,46 @@
1
+ // Node imports
2
+ import { createRequire } from "node:module";
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+
6
+ const require = createRequire(import.meta.url);
7
+ const SOURCE_EXTENSIONS = new Set([".ts", ".vue"]);
8
+ // An icon name: ph-<name>, not the weight class ph-fill
9
+ const ICON_NAME = /\bph-(?!fill\b)[a-z0-9]+(?:-[a-z0-9]+)*/gu;
10
+
11
+ // Every glyph of the Phosphor regular and fill weights
12
+ const PHOSPHOR_GLYPHS = new Set(
13
+ [
14
+ fs.readFileSync(require.resolve("@phosphor-icons/web/regular"), "utf8"),
15
+ fs.readFileSync(require.resolve("@phosphor-icons/web/fill"), "utf8"),
16
+ ].flatMap((css) =>
17
+ [...css.matchAll(/\.(?<glyph>ph-[a-z0-9-]+):before/gu)].map((match) => match.groups?.glyph),
18
+ ),
19
+ );
20
+
21
+ function iconNames(value: string): string[] {
22
+ return value.match(ICON_NAME) ?? [];
23
+ }
24
+
25
+ function sourceFiles(folder: string): string[] {
26
+ return fs.readdirSync(folder, { recursive: true, encoding: "utf8" }).flatMap((file) => {
27
+ const filePath = path.join(folder, file);
28
+ if (!SOURCE_EXTENSIONS.has(path.extname(file)) || !fs.statSync(filePath).isFile()) {
29
+ return [];
30
+ }
31
+ return [filePath];
32
+ });
33
+ }
34
+
35
+ // The icon names written in the sources of the folders that are no Phosphor glyph, as "<file>: <name>"
36
+ function missingPhosphorIcons(root: string, folders: string[]): string[] {
37
+ return folders
38
+ .flatMap((folder) => sourceFiles(path.join(root, folder)))
39
+ .flatMap((file) =>
40
+ iconNames(fs.readFileSync(file, "utf8"))
41
+ .filter((name) => !PHOSPHOR_GLYPHS.has(name))
42
+ .map((name) => `${path.relative(root, file)}: ${name}`),
43
+ );
44
+ }
45
+
46
+ export { PHOSPHOR_GLYPHS, iconNames, missingPhosphorIcons };
@@ -1,64 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- version="1.0"
4
- width="514px"
5
- height="486px"
6
- viewBox="0 0 514 486"
7
- preserveAspectRatio="xMidYMid meet"
8
- id="svg14"
9
- sodipodi:docname="camera-bookmark.svg"
10
- inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
11
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
13
- xmlns="http://www.w3.org/2000/svg"
14
- xmlns:svg="http://www.w3.org/2000/svg">
15
- <defs
16
- id="defs18" />
17
- <sodipodi:namedview
18
- id="namedview16"
19
- pagecolor="#505050"
20
- bordercolor="#eeeeee"
21
- borderopacity="1"
22
- inkscape:pageshadow="0"
23
- inkscape:pageopacity="0"
24
- inkscape:pagecheckerboard="0"
25
- showgrid="false"
26
- inkscape:zoom="1.1756014"
27
- inkscape:cx="202.02426"
28
- inkscape:cy="238.60128"
29
- inkscape:window-width="1920"
30
- inkscape:window-height="964"
31
- inkscape:window-x="0"
32
- inkscape:window-y="0"
33
- inkscape:window-maximized="1"
34
- inkscape:current-layer="g12">
35
- <inkscape:grid
36
- type="xygrid"
37
- id="grid160" />
38
- </sodipodi:namedview>
39
- <g
40
- fill="#000000"
41
- id="g12"
42
- transform="matrix(1.0257024,0,0,1.0257024,-37.052727,-7.1977612)">
43
- <path
44
- d="m 201.51433,384.71831 c -9.66032,-3.00746 -16.58659,-10.3894 -18.77383,-19.68518 -0.45568,-1.73156 -0.82021,-34.72246 -0.82021,-73.36372 l -0.0911,-70.174 25.33553,-0.45567 c 28.16074,-0.54681 28.88983,-0.72908 35.81608,-7.0174 2.18725,-1.91384 4.9213,-5.55924 6.10606,-8.29329 1.82269,-4.19222 2.0961,-6.19718 2.0961,-16.13091 v -11.39188 h 6.83513 6.83513 v -17.6802 c 0,-9.75145 0.36455,-18.77383 0.82021,-19.95858 0.54682,-1.27589 1.82271,-2.64292 3.00746,-3.00745 2.27838,-0.82022 90.49712,-0.54682 92.77549,0.18226 0.72908,0.27341 4.37449,3.82768 7.92875,7.92875 3.6454,4.10108 9.02237,10.02486 11.84756,13.12346 l 5.28584,5.65036 7.2908,0.18227 7.29081,0.18228 0.63794,-4.19222 c 0.2734,-2.27837 0.82022,-4.64788 1.18476,-5.10356 0.82021,-1.45816 27.06711,-1.36703 28.52527,0.0911 0.63795,0.63795 1.09362,2.82518 1.09362,5.01242 0,2.46065 0.45568,4.10108 1.18475,4.28335 0.54682,0.18227 3.18973,0.82021 5.65038,1.36703 7.47307,1.8227 15.67523,9.84259 17.86248,17.6802 1.54928,5.37697 2.00496,172.97434 0.5468,180.08288 -1.18475,6.10605 -5.1947,12.21209 -10.48053,16.22203 -7.92875,6.01492 -1.36703,5.74152 -127.68022,5.65038 -89.40349,0 -115.28584,-0.27341 -118.11103,-1.18475 z m 139.0721,-41.19305 c 12.7589,-4.00995 20.77879,-9.11351 31.44159,-20.04972 20.41426,-20.96106 25.24441,-52.58492 12.02983,-79.10523 -7.0174,-13.94367 -17.58907,-24.69759 -31.62386,-31.89727 -9.75146,-5.01242 -15.67523,-6.74399 -26.33804,-7.74648 -21.69014,-2.00497 -41.92213,5.83264 -57.23281,22.05468 -15.12843,16.03978 -21.59902,35.26928 -19.32064,57.14169 2.64291,24.60646 19.77631,46.93456 43.74483,57.05055 15.03728,6.37945 32.26181,7.2908 47.2991,2.55178 z m 7.56421,-176.80201 c 2.0961,-2.00498 1.8227,-5.10357 -1.00249,-11.30076 -1.5493,-3.6454 -3.09859,-5.65037 -4.28335,-5.92377 -3.82767,-0.91136 -43.83596,-1.09363 -45.84093,-0.18227 -1.27589,0.5468 -2.82519,3.00745 -4.28335,6.65286 -2.73405,6.74399 -2.91632,8.8401 -0.91135,10.75394 1.18476,1.27589 5.01243,1.45815 28.16073,1.45815 23.14831,0 26.97598,-0.18226 28.16074,-1.45815 z"
45
- id="path2"
46
- style="stroke-width:0.911351" />
47
- <path
48
- d="m 309.14483,317.55177 c -9.75145,-2.27838 -22.32809,-12.2121 -27.34052,-21.69015 -8.8401,-16.49544 -5.92377,-37.00083 7.29081,-50.67109 22.87489,-23.60398 61.97184,-14.39934 72.36123,16.95113 2.09611,6.56172 2.46065,18.86494 0.72908,24.87986 -4.00994,13.76139 -16.22203,26.06463 -29.80116,30.07457 -5.37697,1.5493 -17.4068,1.82271 -23.23944,0.45568 z"
49
- id="path4"
50
- style="stroke-width:0.911351" />
51
- <path
52
- d="m 129.80545,209.69281 c -15.94627,-0.85865 -18.39954,-1.96262 -20.73015,-9.81309 -0.85864,-2.94393 -1.10397,-22.69277 -0.85864,-56.91591 L 108.58465,90.341125 113.1232,86.170562 117.78442,82 h 44.52689 44.64955 l 14.22898,14.351642 14.35164,14.474308 v 44.52688 c 0,49.31078 -0.12266,50.41475 -7.72781,53.48133 -4.17057,1.7173 -68.93694,2.20795 -98.00822,0.85865 z m 93.22434,-11.40772 c 1.10398,-1.10397 1.47197,-12.14369 1.47197,-41.82829 v -40.47898 l -10.67174,-10.91707 -10.79439,-10.794389 -41.09231,-0.367992 -41.09231,-0.245327 -0.36799,52.377358 -0.24532,52.50002 49.31076,0.368 c 27.23132,0.12266 50.04675,0.36799 50.78273,0.61331 0.61332,0.12267 1.83995,-0.36799 2.6986,-1.22664 z"
53
- id="path6"
54
- style="stroke-width:1.22663" />
55
- <path
56
- d="m 163.78327,186.75471 c -8.21846,-4.29322 -11.65304,-9.69042 -11.65304,-18.39953 0,-14.35164 14.22897,-24.04207 27.72197,-18.8902 7.85048,3.0666 13.73833,13.98365 12.1437,22.5701 -2.45327,12.87968 -17.17291,20.48482 -28.21263,14.71963 z"
57
- id="path8"
58
- style="stroke-width:1.22663" />
59
- <path
60
- d="m 131.64541,130.20679 c -1.10397,-0.36799 -1.59463,-4.29323 -1.59463,-13.37032 v -12.75702 h 31.27921 31.27922 v 12.87968 c 0,9.4451 -0.36799,12.87967 -1.47196,13.00234 -9.32243,0.49065 -58.38787,0.73598 -59.49184,0.24532 z"
61
- id="path10"
62
- style="stroke-width:1.22663" />
63
- </g>
64
- </svg>
@@ -1,13 +0,0 @@
1
- // Whether something is shown in the viewer
2
- type Visibility = boolean;
3
-
4
- // How wide the edges of a data are drawn in the viewer
5
- type Width = number;
6
-
7
- // How big the points of a data are drawn in the viewer
8
- type Size = number;
9
-
10
- // How opaque something is drawn in the viewer
11
- type Opacity = number;
12
-
13
- export type { Opacity, Size, Visibility, Width };