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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/.build/shared/utils/response_handlers/load.js +5 -2
  2. package/app/assets/geode_objects.ts +37 -108
  3. package/app/assets/img/geode_objects/HorizonStack3D.svg +10 -0
  4. package/app/components/CrsSelector.vue +6 -6
  5. package/app/components/ExtensionSelector.vue +21 -14
  6. package/app/components/MissingFilesSelector.vue +1 -1
  7. package/app/components/ObjectSelector.vue +7 -14
  8. package/app/components/ThresholdFilter.vue +1 -1
  9. package/app/components/TimeSeriesTargetSelector.vue +2 -5
  10. package/app/components/Viewer/ContextMenu/ContextMenu.vue +1 -1
  11. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +12 -9
  12. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +2 -2
  13. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +12 -9
  14. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +1 -1
  15. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +12 -9
  16. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -3
  17. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +12 -8
  18. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +12 -9
  19. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +1 -1
  20. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +12 -9
  21. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +1 -1
  22. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +16 -17
  23. package/app/components/Viewer/Generic/Model/ComponentEdgesOptions.vue +11 -6
  24. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +11 -6
  25. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +7 -8
  26. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +7 -8
  27. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +9 -10
  28. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +9 -10
  29. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +2 -2
  30. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +1 -1
  31. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +3 -4
  32. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +16 -17
  33. package/app/components/Viewer/ObjectTree/Layout.vue +2 -2
  34. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +2 -1
  35. package/app/components/Viewer/Options/AttributeSelector.vue +1 -1
  36. package/app/components/Viewer/Options/ColorPicker.vue +3 -3
  37. package/app/components/Viewer/Options/ColoringTypeSelector.vue +8 -8
  38. package/app/components/Viewer/Options/TextureItem.vue +2 -6
  39. package/app/components/Viewer/Options/TexturesSelector.vue +1 -1
  40. package/app/components/Viewer/OverlappingObjectsPicker.vue +3 -3
  41. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +4 -5
  42. package/app/components/Viewer/Scene/BackgroundOptions.vue +2 -2
  43. package/app/components/Viewer/Scene/TextOptions.vue +2 -2
  44. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +12 -12
  45. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +1 -1
  46. package/app/components/Viewer/Surface/PolygonsColoring.vue +12 -12
  47. package/app/components/Viewer/Surface/PolygonsOptions.vue +1 -1
  48. package/app/composables/attribute_selector.ts +1 -1
  49. package/app/composables/batch_style.ts +3 -3
  50. package/app/composables/batch_style_model.ts +1 -1
  51. package/app/composables/clipping_slices.ts +2 -1
  52. package/app/composables/hover_highlight.ts +10 -7
  53. package/app/composables/live_data_item.ts +1 -1
  54. package/app/composables/model_menu_context.ts +11 -4
  55. package/app/composables/project_manager_helpers/types.ts +2 -2
  56. package/app/composables/use_overlapping_picker.ts +10 -8
  57. package/app/composables/viewer_context_menu.ts +4 -2
  58. package/app/composables/viewer_reset.ts +4 -5
  59. package/app/stores/basemap_helpers/builds.ts +2 -2
  60. package/app/stores/basemap_helpers/viewer.ts +1 -1
  61. package/app/stores/crs.ts +12 -12
  62. package/app/stores/data.ts +4 -5
  63. package/app/stores/data_helpers/mesh.ts +2 -1
  64. package/app/stores/data_style.ts +4 -3
  65. package/app/stores/menu.ts +18 -12
  66. package/app/stores/treeview.ts +5 -4
  67. package/app/types/attribute.ts +5 -21
  68. package/app/types/identifiers.ts +5 -15
  69. package/app/utils/attribute_range.ts +1 -1
  70. package/app/utils/attributes.ts +2 -1
  71. package/app/utils/clipping_planes.ts +1 -1
  72. package/app/utils/color_picker.ts +3 -3
  73. package/app/utils/crs.ts +6 -6
  74. package/app/utils/default_styles/constants.ts +17 -22
  75. package/app/utils/default_styles/index.ts +3 -3
  76. package/app/utils/default_styles/mesh_components.ts +15 -11
  77. package/app/utils/default_styles/meshes.ts +1 -1
  78. package/app/utils/default_styles/model_components.ts +14 -10
  79. package/app/utils/default_styles/models.ts +1 -1
  80. package/app/utils/import_workflow.ts +3 -1
  81. package/app/utils/legacy_data_id.ts +2 -1
  82. package/app/utils/slice.ts +2 -1
  83. package/app/utils/threshold_sources.ts +1 -1
  84. package/internal/stores/data_style/attribute_types.ts +6 -6
  85. package/internal/stores/data_style/mesh/base_style.ts +6 -7
  86. package/internal/stores/data_style/mesh/cells/cell.ts +6 -6
  87. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +8 -6
  88. package/internal/stores/data_style/mesh/cells/cell_config.ts +5 -6
  89. package/internal/stores/data_style/mesh/cells/color.ts +6 -6
  90. package/internal/stores/data_style/mesh/cells/opacity.ts +3 -4
  91. package/internal/stores/data_style/mesh/cells/vertex.ts +6 -6
  92. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +8 -6
  93. package/internal/stores/data_style/mesh/cells/vertex_config.ts +5 -6
  94. package/internal/stores/data_style/mesh/cells/visibility.ts +1 -1
  95. package/internal/stores/data_style/mesh/edges/color.ts +6 -6
  96. package/internal/stores/data_style/mesh/edges/edge.ts +6 -6
  97. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +8 -6
  98. package/internal/stores/data_style/mesh/edges/edge_config.ts +5 -6
  99. package/internal/stores/data_style/mesh/edges/opacity.ts +3 -4
  100. package/internal/stores/data_style/mesh/edges/vertex.ts +6 -6
  101. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +8 -6
  102. package/internal/stores/data_style/mesh/edges/vertex_config.ts +5 -6
  103. package/internal/stores/data_style/mesh/edges/visibility.ts +1 -1
  104. package/internal/stores/data_style/mesh/edges/width.ts +6 -6
  105. package/internal/stores/data_style/mesh/index.ts +3 -4
  106. package/internal/stores/data_style/mesh/points/color.ts +6 -6
  107. package/internal/stores/data_style/mesh/points/common.ts +1 -1
  108. package/internal/stores/data_style/mesh/points/opacity.ts +3 -4
  109. package/internal/stores/data_style/mesh/points/size.ts +6 -6
  110. package/internal/stores/data_style/mesh/points/vertex.ts +6 -6
  111. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +8 -6
  112. package/internal/stores/data_style/mesh/points/vertex_config.ts +5 -6
  113. package/internal/stores/data_style/mesh/points/visibility.ts +1 -1
  114. package/internal/stores/data_style/mesh/polygons/color.ts +6 -6
  115. package/internal/stores/data_style/mesh/polygons/opacity.ts +3 -4
  116. package/internal/stores/data_style/mesh/polygons/polygon.ts +6 -6
  117. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +8 -6
  118. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +5 -6
  119. package/internal/stores/data_style/mesh/polygons/vertex.ts +6 -6
  120. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +8 -6
  121. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +5 -6
  122. package/internal/stores/data_style/mesh/polygons/visibility.ts +1 -1
  123. package/internal/stores/data_style/mesh/polyhedra/color.ts +6 -6
  124. package/internal/stores/data_style/mesh/polyhedra/opacity.ts +3 -4
  125. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +6 -6
  126. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +8 -6
  127. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +5 -6
  128. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +6 -6
  129. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +8 -6
  130. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +5 -6
  131. package/internal/stores/data_style/mesh/polyhedra/visibility.ts +1 -1
  132. package/internal/stores/data_style/model/blocks/color.ts +6 -6
  133. package/internal/stores/data_style/model/blocks/coloring_groups.ts +2 -2
  134. package/internal/stores/data_style/model/blocks/polyhedron.ts +12 -9
  135. package/internal/stores/data_style/model/blocks/vertex.ts +12 -9
  136. package/internal/stores/data_style/model/blocks/visibility.ts +1 -1
  137. package/internal/stores/data_style/model/color.ts +10 -11
  138. package/internal/stores/data_style/model/common.ts +3 -4
  139. package/internal/stores/data_style/model/corners/color.ts +6 -6
  140. package/internal/stores/data_style/model/corners/index.ts +2 -2
  141. package/internal/stores/data_style/model/corners/vertex.ts +12 -9
  142. package/internal/stores/data_style/model/corners/visibility.ts +1 -1
  143. package/internal/stores/data_style/model/edges/component.ts +13 -13
  144. package/internal/stores/data_style/model/edges/visibility.ts +1 -1
  145. package/internal/stores/data_style/model/edges/width.ts +6 -6
  146. package/internal/stores/data_style/model/lines/color.ts +6 -6
  147. package/internal/stores/data_style/model/lines/coloring_groups.ts +2 -2
  148. package/internal/stores/data_style/model/lines/edge.ts +12 -9
  149. package/internal/stores/data_style/model/lines/vertex.ts +12 -9
  150. package/internal/stores/data_style/model/lines/visibility.ts +1 -1
  151. package/internal/stores/data_style/model/points/component.ts +17 -13
  152. package/internal/stores/data_style/model/points/index.ts +2 -2
  153. package/internal/stores/data_style/model/points/size.ts +6 -6
  154. package/internal/stores/data_style/model/points/visibility.ts +1 -1
  155. package/internal/stores/data_style/model/surfaces/color.ts +6 -6
  156. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +2 -2
  157. package/internal/stores/data_style/model/surfaces/polygon.ts +12 -9
  158. package/internal/stores/data_style/model/surfaces/vertex.ts +12 -9
  159. package/internal/stores/data_style/model/surfaces/visibility.ts +1 -1
  160. package/internal/stores/data_style/model/visibility.ts +1 -1
  161. package/internal/stores/data_style/scene.ts +5 -5
  162. package/internal/stores/data_style/time_step.ts +3 -2
  163. package/internal/stores/data_style/types.ts +3 -4
  164. package/internal/stores/hybrid_viewer/camera.ts +1 -1
  165. package/internal/stores/hybrid_viewer/filters.ts +2 -2
  166. package/internal/stores/hybrid_viewer/highlight.ts +2 -1
  167. package/internal/stores/hybrid_viewer/scene.ts +3 -3
  168. package/package.json +5 -4
  169. package/shared/utils/response_handlers/load.ts +19 -11
  170. package/app/types/style.ts +0 -13
@@ -1,6 +1,6 @@
1
1
  import { type DataItem, useDataStore } from "@ogw_front/stores/data";
2
2
  import type { EffectScope, MaybeRefOrGetter, ShallowRef } from "vue";
3
- import type { DataId } from "@ogw_front/types/identifiers";
3
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
4
4
 
5
5
  // Live view of a data item whose id can change: tree labels are reused by the virtual list,
6
6
  // And the info card shows whichever object the menu was last opened on.
@@ -1,10 +1,12 @@
1
1
  import { type ComputedRef, type Ref, computed, ref, watch } from "vue";
2
- import type { ModelId, ModelIdentified, ViewerObjectTyped } from "@ogw_front/types/identifiers";
2
+ import type { ModelId, ModelIdentified } from "@ogw_front/types/identifiers";
3
3
  import type { CollectionComponent } from "@ogw_front/stores/data_helpers/collections";
4
4
  import { MESH_COMPONENT_TYPES } from "@ogw_front/utils/default_styles";
5
+ import type { MenuViewerObjectType } from "@ogw_front/stores/menu";
5
6
  import { useDataStore } from "@ogw_front/stores/data";
6
7
 
7
- interface ModelMenuMetaData extends Partial<ViewerObjectTyped>, Partial<ModelIdentified> {
8
+ interface ModelMenuMetaData extends Partial<ModelIdentified> {
9
+ viewer_object_type?: MenuViewerObjectType;
8
10
  pickedComponentId?: string;
9
11
  modelComponentType?: string;
10
12
  targetComponentIds?: string[];
@@ -35,6 +37,11 @@ function useModelMenuContext(getItemProps: () => ModelMenuItemProps): ModelMenuC
35
37
  const componentType = ref<string | undefined>(undefined);
36
38
  const collections = ref<CollectionComponent[] | undefined>(undefined);
37
39
 
40
+ // A function so the check after an await is not narrowed by the one before it
41
+ function isComponentTypeMenu(): boolean {
42
+ return metaData.value.viewer_object_type === "model_component_type";
43
+ }
44
+
38
45
  watch(
39
46
  () => [
40
47
  modelId.value,
@@ -45,7 +52,7 @@ function useModelMenuContext(getItemProps: () => ModelMenuItemProps): ModelMenuC
45
52
  async () => {
46
53
  componentType.value = undefined;
47
54
  collections.value = undefined;
48
- if (metaData.value.viewer_object_type === "model_component_type") {
55
+ if (isComponentTypeMenu()) {
49
56
  const { modelComponentType = "", targetComponentIds: ids = [] } = metaData.value;
50
57
  if (MESH_COMPONENT_TYPES.includes(modelComponentType)) {
51
58
  componentType.value = modelComponentType;
@@ -63,7 +70,7 @@ function useModelMenuContext(getItemProps: () => ModelMenuItemProps): ModelMenuC
63
70
  if (
64
71
  modelId.value === currentModelId &&
65
72
  componentId.value === currentCompId &&
66
- metaData.value.viewer_object_type !== "model_component_type"
73
+ !isComponentTypeMenu()
67
74
  ) {
68
75
  componentType.value = type;
69
76
  }
@@ -1,5 +1,5 @@
1
1
  import type { BasemapSnapshot } from "@ogw_front/stores/basemap";
2
- import type { CRSList } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
2
+ import type { CRS } from "@geode/opengeodeweb-back/schema_types";
3
3
  import type { CameraSnapshot } from "@ogw_internal/stores/hybrid_viewer/camera";
4
4
  import type { DataStyleSnapshot } from "@ogw_front/stores/data_style";
5
5
  import type { LegacyDataId } from "@ogw_front/utils/legacy_data_id";
@@ -23,7 +23,7 @@ interface ProjectSnapshot {
23
23
  data?: ProjectDataSnapshot;
24
24
  hybridViewer?: CameraSnapshot;
25
25
  dataStyle?: DataStyleSnapshot;
26
- crs?: { projectCrs?: CRSList };
26
+ crs?: { projectCrs?: CRS };
27
27
  basemap?: BasemapSnapshot;
28
28
  }
29
29
 
@@ -1,31 +1,33 @@
1
1
  import { ref } from "vue";
2
2
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
3
3
 
4
+ import { type DataItem, useDataStore } from "@ogw_front/stores/data";
4
5
  import type {
5
- DataIdentified,
6
6
  GeodeObjectType,
7
7
  ViewerObjectType,
8
- } from "@ogw_front/types/identifiers";
9
- import { type DataItem, useDataStore } from "@ogw_front/stores/data";
8
+ } from "@geode/opengeodeweb-microservice/data_types";
9
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
10
+ import type { DataIdentified } from "@ogw_front/types/identifiers";
11
+ import type { ViewerId } from "@geode/opengeodeweb-viewer/schema_types";
10
12
  import { computeMenuPosition } from "@ogw_front/composables/overlapping_picker_menu";
11
13
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
12
14
  import { useViewerStore } from "@ogw_front/stores/viewer";
13
15
 
14
16
  interface PickedItem {
15
- id: string;
16
- viewer_id: number | undefined;
17
+ id: DataId;
18
+ viewer_id: ViewerId | undefined;
17
19
  }
18
20
 
19
21
  interface ProposedItem extends DataIdentified {
20
- viewer_id: number | undefined;
22
+ viewer_id: ViewerId | undefined;
21
23
  name: string;
22
24
  viewer_object_type: ViewerObjectType | undefined;
23
25
  geode_object_type: GeodeObjectType | undefined;
24
26
  }
25
27
 
26
28
  interface ViewerIdResult {
27
- id: string | undefined;
28
- viewer_id: number | undefined;
29
+ id: DataId | undefined;
30
+ viewer_id: ViewerId | undefined;
29
31
  // True when objects were under the cursor but the user closed the picker without choosing
30
32
  dismissed?: boolean;
31
33
  }
@@ -1,7 +1,9 @@
1
1
  import { type MenuMetaData, useMenuStore } from "@ogw_front/stores/menu";
2
2
  import type { Ref, ShallowRef } from "vue";
3
3
  import { BASEMAP_GROUP_ID } from "@ogw_front/utils/basemap_tree";
4
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
4
5
  import type { TreeMenuPayload } from "@ogw_front/utils/treeview";
6
+ import type { ViewerId } from "@geode/opengeodeweb-viewer/schema_types";
5
7
  import type { ViewerIdResult } from "@ogw_front/composables/use_overlapping_picker";
6
8
  import { useDataStore } from "@ogw_front/stores/data";
7
9
  import { useElementSize } from "@vueuse/core";
@@ -69,8 +71,8 @@ async function treeMenuTarget(
69
71
 
70
72
  async function viewerMenuTarget(
71
73
  dataStore: ReturnType<typeof useDataStore>,
72
- pickedId: string,
73
- viewer_id: number | undefined,
74
+ pickedId: DataId,
75
+ viewer_id: ViewerId | undefined,
74
76
  ): Promise<MenuTarget> {
75
77
  const item = await dataStore.item(pickedId);
76
78
  const meta_data: MenuMetaData = { ...item };
@@ -1,4 +1,4 @@
1
- import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
1
+ import type { ColorRGB, ColorRGBA } from "@geode/opengeodeweb-viewer/schema_types";
2
2
  import type { ViewerRequest } from "@ogw_front/stores/viewer_helpers/request";
3
3
  // Third party imports
4
4
  import { consola } from "consola";
@@ -11,10 +11,9 @@ import {
11
11
  resetOrientationMarkerVisibility,
12
12
  } from "@ogw_front/composables/orientation_overlay";
13
13
 
14
- // oxlint-disable-next-line id-length -- the viewer schema requires { r, g, b }
15
- function toViewerColor(color: RGBAColor): { r: number; g: number; b: number } {
16
- // oxlint-disable-next-line id-length -- the viewer schema requires { r, g, b }
17
- return { r: color.red, g: color.green, b: color.blue };
14
+ // The scene colors of the viewer have no alpha (the text one takes it as its opacity)
15
+ function toViewerColor({ red, green, blue }: ColorRGBA): ColorRGB {
16
+ return { red, green, blue };
18
17
  }
19
18
 
20
19
  // A reset viewer draws its own scene colors: give it the app's (`ogwFront.sceneColors`), which the default
@@ -1,10 +1,10 @@
1
1
  import { type MapStyle, sortedMaps } from "@ogw_front/utils/basemap_tree";
2
2
  import back_schemas, {
3
3
  type BasemapBuildResponse,
4
- type CRSList,
5
4
  } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
6
5
  import { ignoreError, useBasemapViewer } from "./viewer.js";
7
6
  import type { BasemapLayers } from "./layers.js";
7
+ import type { CRS } from "@geode/opengeodeweb-back/schema_types";
8
8
  import type { Extent } from "./extent.js";
9
9
  import type { Ref } from "vue";
10
10
  import { useBackStore } from "@ogw_front/stores/back";
@@ -73,7 +73,7 @@ function useBasemapBuilds(
73
73
  await hybridViewerStore.remoteRender();
74
74
  }
75
75
 
76
- async function display(build: number, extent: Extent, crs: CRSList): Promise<void> {
76
+ async function display(build: number, extent: Extent, crs: CRS): Promise<void> {
77
77
  const response = await backStore.request({
78
78
  schema: back_schemas.opengeodeweb_back.basemap.build,
79
79
  params: { maps: [...maps.value], crs, ...extent },
@@ -2,7 +2,7 @@ import back_schemas, {
2
2
  type BasemapBuildResponse,
3
3
  } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
4
4
  import type { MapStyle } from "@ogw_front/utils/basemap_tree";
5
- import type { Opacity } from "@ogw_front/types/style";
5
+ import type { Opacity } from "@geode/opengeodeweb-viewer/schema_types";
6
6
  import { useBackStore } from "@ogw_front/stores/back";
7
7
  import { useDataStore } from "@ogw_front/stores/data";
8
8
  import { useViewerStore } from "@ogw_front/stores/viewer";
package/app/stores/crs.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { DataId, GeodeObjectType } from "@ogw_front/types/identifiers";
2
- import back_schemas, {
3
- type CRSList,
4
- } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
5
1
  import { oldestCrs, sameCrs } from "@ogw_front/utils/crs";
2
+ import type { CRS } from "@geode/opengeodeweb-back/schema_types";
3
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
4
+ import type { GeodeObjectType } from "@geode/opengeodeweb-microservice/data_types";
5
+ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
6
6
  import { useBackStore } from "@ogw_front/stores/back";
7
7
  import { useDataStore } from "@ogw_front/stores/data";
8
8
 
@@ -11,12 +11,12 @@ import { useDataStore } from "@ogw_front/stores/data";
11
11
  export const useCrsStore = defineStore("crs", () => {
12
12
  const backStore = useBackStore();
13
13
  // OpenGeode geosciences lists the same geographic CRS for 2D and 3D data: one list for all types
14
- let geographicListPromise: Promise<CRSList[]> | undefined = undefined;
14
+ let geographicListPromise: Promise<CRS[]> | undefined = undefined;
15
15
  const crsEditEnabled = ref(false);
16
16
  const crsEditRequest = ref<string | undefined>(undefined);
17
17
  const dataStore = useDataStore();
18
18
  const crsItems = dataStore.refCrsItems();
19
- const projectCrs = ref<CRSList | undefined>(undefined);
19
+ const projectCrs = ref<CRS | undefined>(undefined);
20
20
  const projectCrsEditRequest = ref(false);
21
21
 
22
22
  // The project follows its data: once every georeferenced data is in one CRS, it is the project
@@ -44,7 +44,7 @@ export const useCrsStore = defineStore("crs", () => {
44
44
  // Data without CRS are listed too (value undefined): they could not follow the project
45
45
  const mismatchedCrs = computed(() => {
46
46
  const project = projectCrs.value;
47
- const mismatched = new Map<string, CRSList | undefined>();
47
+ const mismatched = new Map<string, CRS | undefined>();
48
48
  for (const item of crsItems.value) {
49
49
  if (project !== undefined && !sameCrs(item.crs, project)) {
50
50
  mismatched.set(item.data_id, item.crs);
@@ -53,7 +53,7 @@ export const useCrsStore = defineStore("crs", () => {
53
53
  return mismatched;
54
54
  });
55
55
 
56
- async function fetchGeographicList(geodeObjectType: GeodeObjectType): Promise<CRSList[]> {
56
+ async function fetchGeographicList(geodeObjectType: GeodeObjectType): Promise<CRS[]> {
57
57
  try {
58
58
  const response = await backStore.request({
59
59
  schema: back_schemas.opengeodeweb_back.crs.geographic_list,
@@ -70,7 +70,7 @@ export const useCrsStore = defineStore("crs", () => {
70
70
  return [];
71
71
  }
72
72
 
73
- async function geographicList(geodeObjectType: GeodeObjectType): Promise<CRSList[]> {
73
+ async function geographicList(geodeObjectType: GeodeObjectType): Promise<CRS[]> {
74
74
  // The promise is cached, so dialogs opened together share a single request.
75
75
  // The back still checks each CRS against the list of the data dimension
76
76
  geographicListPromise ??= fetchGeographicList(geodeObjectType);
@@ -90,7 +90,7 @@ export const useCrsStore = defineStore("crs", () => {
90
90
  crsEditRequest.value = undefined;
91
91
  }
92
92
 
93
- function setProjectCrs(crs: CRSList): void {
93
+ function setProjectCrs(crs: CRS): void {
94
94
  projectCrs.value = crs;
95
95
  }
96
96
 
@@ -107,12 +107,12 @@ export const useCrsStore = defineStore("crs", () => {
107
107
  projectCrs.value = undefined;
108
108
  }
109
109
 
110
- function exportStores(): { projectCrs?: CRSList } {
110
+ function exportStores(): { projectCrs?: CRS } {
111
111
  return { projectCrs: projectCrs.value };
112
112
  }
113
113
 
114
114
  // Called once the project data is imported: a project saved without it falls back to its oldest data
115
- function importStores(snapshot: { projectCrs?: CRSList } | undefined): void {
115
+ function importStores(snapshot: { projectCrs?: CRS } | undefined): void {
116
116
  projectCrs.value = snapshot?.projectCrs ?? oldestCrs(crsItems.value);
117
117
  }
118
118
 
@@ -1,15 +1,14 @@
1
1
  // oxlint-disable eslint/max-lines
2
2
  // Third party imports
3
- import type { CRSList } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
3
+ import type { CRS } from "@geode/opengeodeweb-back/schema_types";
4
4
  import type { Table } from "dexie";
5
5
  import { useObservable } from "@vueuse/rxjs";
6
6
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
7
7
 
8
8
  // Local imports
9
+ import type { DataId, GeodeId } from "@geode/opengeodeweb-microservice/schema_types";
9
10
  import type {
10
- DataId,
11
11
  DataIdentified,
12
- GeodeId,
13
12
  GeodeIdentified,
14
13
  GeodeObjectTyped,
15
14
  ModelId,
@@ -29,7 +28,7 @@ interface DataItem extends DataIdentified, GeodeIdentified, GeodeObjectTyped, Vi
29
28
  created_at: string;
30
29
  is_viewable?: boolean;
31
30
  binary_light_viewable?: string;
32
- crs?: CRSList;
31
+ crs?: CRS;
33
32
  }
34
33
 
35
34
  // What the CRS features read of a data: light to copy on each change
@@ -49,7 +48,7 @@ interface NewDataItem extends DataIdentified, GeodeIdentified, GeodeObjectTyped,
49
48
  name?: string;
50
49
  is_viewable?: boolean;
51
50
  binary_light_viewable?: string;
52
- crs?: CRSList;
51
+ crs?: CRS;
53
52
  // Set on saved data: kept by the project snapshot
54
53
  created_at?: string;
55
54
  mesh_components?: ModelComponentInput[];
@@ -1,6 +1,7 @@
1
1
  import type { DataIdentified, GeodeIdentified, ModelId } from "@ogw_front/types/identifiers";
2
2
  import type { ReadonlyTreeGroup } from "@ogw_front/types/tree";
3
3
  import type { Table } from "dexie";
4
+ import type { ViewerId } from "@geode/opengeodeweb-viewer/schema_types";
4
5
  import { database } from "@ogw_internal/database/database.js";
5
6
  import { liveObservable } from "@ogw_front/utils/live_observable";
6
7
  import { useObservable } from "@vueuse/rxjs";
@@ -16,7 +17,7 @@ interface FormattedComponent extends Readonly<GeodeIdentified> {
16
17
  readonly id: string;
17
18
  readonly title: string;
18
19
  readonly category: string;
19
- readonly viewer_id: number;
20
+ readonly viewer_id: ViewerId;
20
21
  readonly is_active: boolean;
21
22
  }
22
23
 
@@ -1,4 +1,3 @@
1
- import type { DataId, GeodeObjectType } from "@ogw_front/types/identifiers";
2
1
  import { type LegacyDataId, fromLegacyDataId } from "@ogw_front/utils/legacy_data_id";
3
2
  import type {
4
3
  ModelComponentStyle,
@@ -6,8 +5,10 @@ import type {
6
5
  ObjectStyle,
7
6
  SceneStyle,
8
7
  } from "@ogw_internal/stores/data_style/types";
8
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
9
+ import type { GeodeObjectType } from "@geode/opengeodeweb-microservice/data_types";
9
10
  import type { Table } from "dexie";
10
- import type { Visibility } from "@ogw_front/types/style";
11
+ import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types";
11
12
  import { database } from "@ogw_internal/database/database.js";
12
13
  import { getDefaultStyle } from "@ogw_front/utils/default_styles";
13
14
  import { useAttributeTimeStepStyle } from "@ogw_internal/stores/data_style/time_step";
@@ -98,7 +99,7 @@ export const useDataStyleStore = defineStore("dataStyle", () => {
98
99
  if (viewer_object_type === "model") {
99
100
  return modelStyleStore.applyModelStyle(dataId);
100
101
  }
101
- throw new Error(`Unknown viewer_object_type: ${viewer_object_type}`);
102
+ throw new Error(`Unknown viewer_object_type: ${String(viewer_object_type)}`);
102
103
  }
103
104
 
104
105
  function exportStores(): DataStyleSnapshot {
@@ -1,14 +1,22 @@
1
1
  import type {
2
- DataIdentified,
3
2
  GeodeObjectType,
4
- GeodeObjectTyped,
5
3
  ViewerObjectType,
6
- ViewerObjectTyped,
7
- } from "@ogw_front/types/identifiers";
4
+ } from "@geode/opengeodeweb-microservice/data_types";
8
5
  import { type MenuItems, menusData } from "./menu_helpers/menus_data.js";
9
-
10
- interface MenuMetaData
11
- extends Partial<DataIdentified>, Partial<GeodeObjectTyped>, Partial<ViewerObjectTyped> {
6
+ import type { DataIdentified } from "@ogw_front/types/identifiers";
7
+
8
+ // What the menus of an entry are chosen by: its viewer_object_type and geode_object_type, or keys when it is not a data
9
+ type MenuViewerObjectType =
10
+ | ViewerObjectType
11
+ | "scene"
12
+ | "basemap"
13
+ | "model_component"
14
+ | "model_component_type";
15
+ type MenuObjectType = GeodeObjectType | "scene" | "Basemap" | "Map" | "component" | "type";
16
+
17
+ interface MenuMetaData extends Partial<DataIdentified> {
18
+ viewer_object_type?: MenuViewerObjectType;
19
+ geode_object_type?: MenuObjectType;
12
20
  targetIds?: string[];
13
21
  [key: string]: unknown;
14
22
  }
@@ -44,14 +52,12 @@ export const useMenuStore = defineStore("menu", () => {
44
52
  );
45
53
 
46
54
  function getMenuItems(
47
- viewerObjectType: ViewerObjectType | undefined,
48
- geodeObjectType: GeodeObjectType | undefined,
55
+ viewerObjectType: MenuViewerObjectType | undefined,
56
+ geodeObjectType: MenuObjectType | undefined,
49
57
  ): MenuItems {
50
58
  if (
51
59
  viewerObjectType === undefined ||
52
- viewerObjectType === "" ||
53
60
  geodeObjectType === undefined ||
54
- geodeObjectType === "" ||
55
61
  !menus.value[viewerObjectType]
56
62
  ) {
57
63
  return [];
@@ -138,4 +144,4 @@ export const useMenuStore = defineStore("menu", () => {
138
144
  };
139
145
  });
140
146
 
141
- export type { MenuMetaData };
147
+ export type { MenuMetaData, MenuViewerObjectType };
@@ -4,15 +4,16 @@ import { consola } from "consola";
4
4
  // oxlint-disable eslint/sort-imports, eslint/max-lines
5
5
  import { defineStore } from "pinia";
6
6
 
7
+ import type { DataId, GeodeId } from "@geode/opengeodeweb-microservice/schema_types";
7
8
  import type {
8
- DataId,
9
- GeodeId,
10
9
  GeodeIdentified,
11
- GeodeObjectType,
12
10
  GeodeObjectTyped,
13
- ViewerObjectType,
14
11
  ViewerObjectTyped,
15
12
  } from "@ogw_front/types/identifiers";
13
+ import type {
14
+ GeodeObjectType,
15
+ ViewerObjectType,
16
+ } from "@geode/opengeodeweb-microservice/data_types";
16
17
  import type { TreeGroup, TreeNode } from "@ogw_front/types/tree";
17
18
  import { ref, watch } from "vue";
18
19
  import { getTable } from "@ogw_internal/database/database";
@@ -1,8 +1,7 @@
1
- // What an attribute of a data is called
2
- type AttributeName = string;
3
-
4
- // Which item of an attribute colors a data, an attribute having one or several items
5
- type AttributeItem = number;
1
+ import type {
2
+ AttributeRangeMaximum,
3
+ AttributeRangeMinimum,
4
+ } from "@geode/opengeodeweb-viewer/schema_types";
6
5
 
7
6
  // The name of the color map that colors a data by an attribute
8
7
  type AttributeColorMap = string;
@@ -10,12 +9,6 @@ type AttributeColorMap = string;
10
9
  // Which time step of its series an attribute is read at, an index into the time steps of the attribute
11
10
  type AttributeTimeStep = number;
12
11
 
13
- // The lower bound of the range an attribute coloring covers
14
- type AttributeRangeMinimum = number;
15
-
16
- // The upper bound of the range an attribute coloring covers
17
- type AttributeRangeMaximum = number;
18
-
19
12
  // The range an attribute coloring covers, a bound being undefined until one is stored for it
20
13
  type AttributeRange = [
21
14
  minimum: AttributeRangeMinimum | undefined,
@@ -25,13 +18,4 @@ type AttributeRange = [
25
18
  // A range of an attribute with both of its bounds set
26
19
  type ValidAttributeRange = [minimum: AttributeRangeMinimum, maximum: AttributeRangeMaximum];
27
20
 
28
- export type {
29
- AttributeColorMap,
30
- AttributeItem,
31
- AttributeName,
32
- AttributeRange,
33
- AttributeRangeMaximum,
34
- AttributeRangeMinimum,
35
- AttributeTimeStep,
36
- ValidAttributeRange,
37
- };
21
+ export type { AttributeColorMap, AttributeRange, AttributeTimeStep, ValidAttributeRange };
@@ -1,8 +1,8 @@
1
- // Id given by OpenGeode to an object (a uuid): the same data loaded twice has the same geode_id
2
- type GeodeId = string;
3
-
4
- // Id of a data loaded in the app, unique even when the same data is loaded twice (see GeodeId)
5
- type DataId = string;
1
+ import type { DataId, GeodeId } from "@geode/opengeodeweb-microservice/schema_types";
2
+ import type {
3
+ GeodeObjectType,
4
+ ViewerObjectType,
5
+ } from "@geode/opengeodeweb-microservice/data_types";
6
6
 
7
7
  // Id of a component of a model (a corner, a line, a surface or a block): its geode_id
8
8
  type ModelComponentId = GeodeId;
@@ -25,12 +25,6 @@ type SurfaceId = ModelComponentId;
25
25
  // A block of a model, by its id in the model
26
26
  type BlockId = ModelComponentId;
27
27
 
28
- // Type of an OpenGeode object, as named by OpenGeode (BRep, TriangulatedSurface3D, ...)
29
- type GeodeObjectType = string;
30
-
31
- // What a data is displayed as in the viewer: mesh, model, or an entry of the menus (basemap, model_component, ...)
32
- type ViewerObjectType = string;
33
-
34
28
  interface GeodeIdentified {
35
29
  geode_id: GeodeId;
36
30
  }
@@ -55,11 +49,8 @@ interface ModelIdentified {
55
49
  export type {
56
50
  BlockId,
57
51
  CornerId,
58
- DataId,
59
52
  DataIdentified,
60
- GeodeId,
61
53
  GeodeIdentified,
62
- GeodeObjectType,
63
54
  GeodeObjectTyped,
64
55
  LineId,
65
56
  MeshId,
@@ -67,6 +58,5 @@ export type {
67
58
  ModelId,
68
59
  ModelIdentified,
69
60
  SurfaceId,
70
- ViewerObjectType,
71
61
  ViewerObjectTyped,
72
62
  };
@@ -1,4 +1,4 @@
1
- import type { AttributeName } from "@ogw_front/types/attribute";
1
+ import type { AttributeName } from "@geode/opengeodeweb-viewer/schema_types";
2
2
  import type { JsonRpcSchema } from "@ogw_shared/utils/types.js";
3
3
  import { useBackStore } from "@ogw_front/stores/back";
4
4
 
@@ -1,4 +1,5 @@
1
- import type { AttributeName, AttributeTimeStep } from "@ogw_front/types/attribute";
1
+ import type { AttributeName } from "@geode/opengeodeweb-viewer/schema_types";
2
+ import type { AttributeTimeStep } from "@ogw_front/types/attribute";
2
3
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
3
4
 
4
5
  interface AttributeRangeSource {
@@ -1,4 +1,4 @@
1
- import type { Opacity } from "@ogw_front/types/style";
1
+ import type { Opacity } from "@geode/opengeodeweb-viewer/schema_types";
2
2
 
3
3
  const AXIS_SCALE = 0.45;
4
4
  const SIZE_RATIO = 0.1;
@@ -1,4 +1,4 @@
1
- import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
1
+ import type { ColorRGBA } from "@geode/opengeodeweb-viewer/schema_types";
2
2
 
3
3
  const RGB_MAX = 255;
4
4
  const PERCENT_MAX = 100;
@@ -24,7 +24,7 @@ function parseAlpha(alphaText: string | undefined): number {
24
24
  return Math.min(1, Math.max(0, roundedAlpha));
25
25
  }
26
26
 
27
- function parseColorString(colorText: string): RGBAColor | undefined {
27
+ function parseColorString(colorText: string): ColorRGBA | undefined {
28
28
  if (colorText === "") {
29
29
  return undefined;
30
30
  }
@@ -47,7 +47,7 @@ function parseColorString(colorText: string): RGBAColor | undefined {
47
47
  return { red, green, blue, alpha };
48
48
  }
49
49
 
50
- function formatColorString(color: RGBAColor, mode: string): string {
50
+ function formatColorString(color: ColorRGBA, mode: string): string {
51
51
  const { red, green, blue, alpha } = color;
52
52
  const roundRed = Math.round(red);
53
53
  const roundGreen = Math.round(green);
package/app/utils/crs.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import type { CrsItem, NewDataItem } from "@ogw_front/stores/data";
2
- import type { CRSList } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
2
+ import type { CRS } from "@geode/opengeodeweb-back/schema_types";
3
3
  import type { LegacyDataId } from "@ogw_front/utils/legacy_data_id";
4
4
 
5
- function formatCrs(crs: CRSList | undefined): string {
5
+ function formatCrs(crs: CRS | undefined): string {
6
6
  return crs ? `${crs.authority}:${crs.code} — ${crs.name}` : "None";
7
7
  }
8
8
 
9
9
  // Code alone, for narrow places: the full name goes in a tooltip
10
- function formatCrsCode(crs: CRSList | undefined): string {
10
+ function formatCrsCode(crs: CRS | undefined): string {
11
11
  return crs ? `${crs.authority}:${crs.code}` : "None";
12
12
  }
13
13
 
14
14
  // The name is only a label: two CRS are the same when their authority code is
15
- function sameCrs(left: CRSList | undefined, right: CRSList | undefined): boolean {
15
+ function sameCrs(left: CRS | undefined, right: CRS | undefined): boolean {
16
16
  return (
17
17
  left !== undefined &&
18
18
  right !== undefined &&
@@ -22,7 +22,7 @@ function sameCrs(left: CRSList | undefined, right: CRSList | undefined): boolean
22
22
  }
23
23
 
24
24
  // Same CRS, or both still in local coordinates
25
- function sameCrsState(left: CRSList | undefined, right: CRSList | undefined): boolean {
25
+ function sameCrsState(left: CRS | undefined, right: CRS | undefined): boolean {
26
26
  return (left === undefined && right === undefined) || sameCrs(left, right);
27
27
  }
28
28
 
@@ -31,7 +31,7 @@ function oldestCrs(
31
31
  items:
32
32
  | readonly Pick<CrsItem, "crs" | "created_at">[]
33
33
  | readonly (LegacyDataId<NewDataItem> | NewDataItem)[],
34
- ): CRSList | undefined {
34
+ ): CRS | undefined {
35
35
  return items
36
36
  .filter((item) => item.crs !== undefined)
37
37
  .toSorted((left, right) => (left.created_at ?? "").localeCompare(right.created_at ?? ""))[0]