@geode/opengeodeweb-front 12.0.0-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 (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 +2 -1
  169. package/shared/utils/response_handlers/load.ts +19 -11
  170. package/app/types/style.ts +0 -13
@@ -1,12 +1,14 @@
1
1
  // oxlint-disable eslint/max-lines
2
+ import type { AttributeColorMap, AttributeRange } from "@ogw_front/types/attribute";
2
3
  import type {
3
- AttributeColorMap,
4
4
  AttributeItem,
5
5
  AttributeName,
6
- AttributeRange,
7
6
  AttributeRangeMaximum,
8
7
  AttributeRangeMinimum,
9
- } from "@ogw_front/types/attribute";
8
+ ColorRGBA,
9
+ PointSize,
10
+ Visibility,
11
+ } from "@geode/opengeodeweb-viewer/schema_types";
10
12
  import type {
11
13
  AttributeState,
12
14
  AttributeStoredConfig,
@@ -15,9 +17,7 @@ import {
15
17
  POINTS_DEFAULT_COLOR,
16
18
  POINTS_DEFAULT_SIZE,
17
19
  POINTS_DEFAULT_VISIBILITY,
18
- type RGBAColor,
19
20
  } from "@ogw_front/utils/default_styles/constants";
20
- import type { Size, Visibility } from "@ogw_front/types/style";
21
21
  import type { ModelId } from "@ogw_front/types/identifiers";
22
22
  import { defaultAttributeStoredConfig } from "@ogw_internal/stores/data_style/attribute_default";
23
23
  import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
@@ -51,10 +51,10 @@ type PointsRequestSchema =
51
51
 
52
52
  interface PointsStyle {
53
53
  visibility?: Visibility;
54
- size?: Size;
54
+ size?: PointSize;
55
55
  coloring?: {
56
56
  active?: string;
57
- constant?: RGBAColor;
57
+ constant?: ColorRGBA;
58
58
  vertex?: AttributeState;
59
59
  };
60
60
  }
@@ -103,11 +103,11 @@ function useModelComponentPointsStyle(type: PointsComponentType) {
103
103
  return pointsStyle(modelId, componentId).visibility ?? POINTS_DEFAULT_VISIBILITY;
104
104
  }
105
105
 
106
- function pointsSize(modelId: ModelId, componentId?: string): Size {
106
+ function pointsSize(modelId: ModelId, componentId?: string): PointSize {
107
107
  return pointsStyle(modelId, componentId).size ?? POINTS_DEFAULT_SIZE;
108
108
  }
109
109
 
110
- function pointsColor(modelId: ModelId, componentId?: string): RGBAColor {
110
+ function pointsColor(modelId: ModelId, componentId?: string): ColorRGBA {
111
111
  return pointsStyle(modelId, componentId).coloring?.constant ?? POINTS_DEFAULT_COLOR;
112
112
  }
113
113
 
@@ -153,7 +153,7 @@ function useModelComponentPointsStyle(type: PointsComponentType) {
153
153
  return storedConfig(modelId, componentId).colorMap;
154
154
  }
155
155
 
156
- function vertexAttributeNoDataColor(modelId: ModelId, componentId?: string): RGBAColor {
156
+ function vertexAttributeNoDataColor(modelId: ModelId, componentId?: string): ColorRGBA {
157
157
  return storedConfig(modelId, componentId).no_data_color;
158
158
  }
159
159
 
@@ -213,7 +213,11 @@ function useModelComponentPointsStyle(type: PointsComponentType) {
213
213
  return result;
214
214
  }
215
215
 
216
- async function setSize(modelId: ModelId, componentIds: string[], size: Size): Promise<unknown> {
216
+ async function setSize(
217
+ modelId: ModelId,
218
+ componentIds: string[],
219
+ size: PointSize,
220
+ ): Promise<unknown> {
217
221
  const result = await requestPoints(modelId, componentIds, schemas.size, {
218
222
  size,
219
223
  style: { size },
@@ -224,7 +228,7 @@ function useModelComponentPointsStyle(type: PointsComponentType) {
224
228
  async function setColor(
225
229
  modelId: ModelId,
226
230
  componentIds: string[],
227
- color: RGBAColor,
231
+ color: ColorRGBA,
228
232
  ): Promise<unknown> {
229
233
  const result = await requestPoints(modelId, componentIds, schemas.color, {
230
234
  color,
@@ -339,7 +343,7 @@ function useModelComponentPointsStyle(type: PointsComponentType) {
339
343
  async function setVertexAttributeNoDataColor(
340
344
  modelId: ModelId,
341
345
  componentIds: string[],
342
- no_data_color: RGBAColor,
346
+ no_data_color: ColorRGBA,
343
347
  ): Promise<unknown> {
344
348
  await mutateStoredConfig(modelId, componentIds, { no_data_color });
345
349
  const result = await applyVertexAttribute(modelId, componentIds);
@@ -1,5 +1,5 @@
1
1
  // Local imports
2
- import type { Size, Visibility } from "@ogw_front/types/style";
2
+ import type { PointSize, Visibility } from "@geode/opengeodeweb-viewer/schema_types";
3
3
  import type { ModelId } from "@ogw_front/types/identifiers";
4
4
  import { useModelPointsCommonStyle } from "./common";
5
5
  import { useModelPointsSizeStyle } from "./size";
@@ -31,7 +31,7 @@ export function useModelPointsStyle(): {
31
31
  ),
32
32
  whenDefined(
33
33
  // oxlint-disable-next-line no-unsafe-type-assertion -- points style values are dynamically typed at runtime.
34
- style.size as Size | undefined,
34
+ style.size as PointSize | undefined,
35
35
  async (size) => {
36
36
  const applied = await modelPointsSizeStyle.setModelPointsSize(modelId, size);
37
37
  return applied;
@@ -7,7 +7,7 @@ import {
7
7
  useModelComponentPointsStyle,
8
8
  } from "@ogw_internal/stores/data_style/model/points/component";
9
9
  import type { ModelId } from "@ogw_front/types/identifiers";
10
- import type { Size } from "@ogw_front/types/style";
10
+ import type { PointSize } from "@geode/opengeodeweb-viewer/schema_types";
11
11
  import { useModelPointsCommonStyle } from "./common";
12
12
  import { useViewerStore } from "@ogw_front/stores/viewer";
13
13
 
@@ -15,8 +15,8 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
15
15
  const schema = viewer_schemas.opengeodeweb_viewer.model.points.size;
16
16
 
17
17
  export function useModelPointsSizeStyle(): {
18
- modelPointsSize: (modelId: ModelId) => Size | undefined;
19
- setModelPointsSize: (modelId: ModelId, size: Size) => Promise<unknown>;
18
+ modelPointsSize: (modelId: ModelId) => PointSize | undefined;
19
+ setModelPointsSize: (modelId: ModelId, size: PointSize) => Promise<unknown>;
20
20
  } {
21
21
  const viewerStore = useViewerStore();
22
22
  const modelPointsCommonStyle = useModelPointsCommonStyle();
@@ -24,12 +24,12 @@ export function useModelPointsSizeStyle(): {
24
24
  useModelComponentPointsStyle(type),
25
25
  );
26
26
 
27
- function modelPointsSize(modelId: ModelId): Size | undefined {
27
+ function modelPointsSize(modelId: ModelId): PointSize | undefined {
28
28
  // oxlint-disable-next-line no-unsafe-type-assertion -- points style values are dynamically typed at runtime.
29
- return modelPointsCommonStyle.modelPointsStyle(modelId).size as Size | undefined;
29
+ return modelPointsCommonStyle.modelPointsStyle(modelId).size as PointSize | undefined;
30
30
  }
31
31
 
32
- async function setModelPointsSize(modelId: ModelId, size: Size): Promise<unknown> {
32
+ async function setModelPointsSize(modelId: ModelId, size: PointSize): Promise<unknown> {
33
33
  const params = { id: modelId, size };
34
34
  const result = await viewerStore.request(
35
35
  {
@@ -7,7 +7,7 @@ import {
7
7
  useModelComponentPointsStyle,
8
8
  } from "@ogw_internal/stores/data_style/model/points/component";
9
9
  import type { ModelId } from "@ogw_front/types/identifiers";
10
- import type { Visibility } from "@ogw_front/types/style";
10
+ import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types";
11
11
  import { useModelPointsCommonStyle } from "./common";
12
12
  import { useViewerStore } from "@ogw_front/stores/viewer";
13
13
 
@@ -1,5 +1,5 @@
1
1
  import type { ModelId, SurfaceId } from "@ogw_front/types/identifiers";
2
- import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
+ import type { ColorRGBA } from "@geode/opengeodeweb-viewer/schema_types";
3
3
  import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
4
4
  import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
5
5
  import { useDataStore } from "@ogw_front/stores/data";
@@ -15,12 +15,12 @@ export function useModelSurfacesColor(): {
15
15
  setModelSurfacesColor: (
16
16
  modelId: ModelId,
17
17
  surfaces_ids: SurfaceId[],
18
- color: RGBAColor | undefined,
18
+ color: ColorRGBA | undefined,
19
19
  activeColoring?: string,
20
20
  collectionId?: string,
21
21
  ) => Promise<unknown>;
22
22
  modelSurfaceColoring: (modelId: ModelId, surface_id?: SurfaceId) => StyleValues;
23
- modelSurfaceColor: (modelId: ModelId, surface_id?: SurfaceId) => RGBAColor | undefined;
23
+ modelSurfaceColor: (modelId: ModelId, surface_id?: SurfaceId) => ColorRGBA | undefined;
24
24
  modelSurfaceActiveColoring: (modelId: ModelId, surface_id?: SurfaceId) => unknown;
25
25
  setModelSurfacesActiveColoring: (
26
26
  modelId: ModelId,
@@ -40,15 +40,15 @@ export function useModelSurfacesColor(): {
40
40
  return modelSurfacesCommonStyle.modelSurfaceStyle(modelId, surface_id).coloring as StyleValues;
41
41
  }
42
42
 
43
- function modelSurfaceColor(modelId: ModelId, surface_id?: SurfaceId): RGBAColor | undefined {
43
+ function modelSurfaceColor(modelId: ModelId, surface_id?: SurfaceId): ColorRGBA | undefined {
44
44
  // oxlint-disable-next-line no-unsafe-type-assertion -- coloring.constant shape is defined by the data style schema.
45
- return modelSurfaceColoring(modelId, surface_id).constant as RGBAColor | undefined;
45
+ return modelSurfaceColoring(modelId, surface_id).constant as ColorRGBA | undefined;
46
46
  }
47
47
 
48
48
  async function setModelSurfacesColor(
49
49
  modelId: ModelId,
50
50
  surfaces_ids: SurfaceId[],
51
- color: RGBAColor | undefined,
51
+ color: ColorRGBA | undefined,
52
52
  activeColoring = "constant",
53
53
  collectionId?: string,
54
54
  ): Promise<unknown> {
@@ -1,9 +1,9 @@
1
- import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
1
+ import type { ColorRGBA } from "@geode/opengeodeweb-viewer/schema_types";
2
2
  import type { SurfaceId } from "@ogw_front/types/identifiers";
3
3
  import type { ValidAttributeInput } from "@ogw_internal/stores/data_style/attribute_types";
4
4
 
5
5
  interface ColorGroup {
6
- color: RGBAColor | undefined;
6
+ color: ColorRGBA | undefined;
7
7
  surfaces_ids: SurfaceId[];
8
8
  }
9
9
 
@@ -1,11 +1,7 @@
1
1
  // oxlint-disable eslint/max-lines
2
2
  import type {
3
3
  AttributeColorMap,
4
- AttributeItem,
5
- AttributeName,
6
4
  AttributeRange,
7
- AttributeRangeMaximum,
8
- AttributeRangeMinimum,
9
5
  AttributeTimeStep,
10
6
  } from "@ogw_front/types/attribute";
11
7
  import type {
@@ -14,8 +10,15 @@ import type {
14
10
  AttributeStoredConfig,
15
11
  ValidAttributeInput,
16
12
  } from "@ogw_internal/stores/data_style/attribute_types";
17
- import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
13
+ import type {
14
+ AttributeItem,
15
+ AttributeName,
16
+ AttributeRangeMaximum,
17
+ AttributeRangeMinimum,
18
+ ColorRGBA,
19
+ } from "@geode/opengeodeweb-viewer/schema_types";
18
20
  import type { ModelId, SurfaceId } from "@ogw_front/types/identifiers";
21
+ import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
19
22
  import { defaultAttributeStoredConfig } from "@ogw_internal/stores/data_style/attribute_default";
20
23
  import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
21
24
  // Third party imports
@@ -87,11 +90,11 @@ interface UseModelSurfacesPolygonAttributeReturn {
87
90
  surfaceIds: SurfaceId[],
88
91
  colorMap: AttributeColorMap | undefined,
89
92
  ) => Promise<void>;
90
- modelSurfacesPolygonAttributeNoDataColor: (modelId: ModelId, surfaceId?: SurfaceId) => RGBAColor;
93
+ modelSurfacesPolygonAttributeNoDataColor: (modelId: ModelId, surfaceId?: SurfaceId) => ColorRGBA;
91
94
  setModelSurfacesPolygonAttributeNoDataColor: (
92
95
  modelId: ModelId,
93
96
  surfaceIds: SurfaceId[],
94
- no_data_color: RGBAColor,
97
+ no_data_color: ColorRGBA,
95
98
  ) => Promise<void>;
96
99
  }
97
100
 
@@ -187,7 +190,7 @@ function useModelSurfacesPolygonAttributeGetters(
187
190
  function modelSurfacesPolygonAttributeNoDataColor(
188
191
  modelId: ModelId,
189
192
  surfaceId?: SurfaceId,
190
- ): RGBAColor {
193
+ ): ColorRGBA {
191
194
  const name = modelSurfacesPolygonAttributeName(modelId, surfaceId);
192
195
  const item = modelSurfacesPolygonAttributeItem(modelId, surfaceId);
193
196
  const storedConfig = modelSurfacesPolygonAttributeStoredConfig(modelId, surfaceId, name, item);
@@ -401,7 +404,7 @@ function useModelSurfacesPolygonAttribute(): UseModelSurfacesPolygonAttributeRet
401
404
  async function setModelSurfacesPolygonAttributeNoDataColor(
402
405
  modelId: ModelId,
403
406
  surfaceIds: SurfaceId[],
404
- no_data_color: RGBAColor,
407
+ no_data_color: ColorRGBA,
405
408
  ): Promise<void> {
406
409
  const name = modelSurfacesPolygonAttributeName(modelId, surfaceIds[0]);
407
410
  const item = modelSurfacesPolygonAttributeItem(modelId, surfaceIds[0]);
@@ -1,11 +1,7 @@
1
1
  // oxlint-disable eslint/max-lines
2
2
  import type {
3
3
  AttributeColorMap,
4
- AttributeItem,
5
- AttributeName,
6
4
  AttributeRange,
7
- AttributeRangeMaximum,
8
- AttributeRangeMinimum,
9
5
  AttributeTimeStep,
10
6
  } from "@ogw_front/types/attribute";
11
7
  import type {
@@ -14,8 +10,15 @@ import type {
14
10
  AttributeStoredConfig,
15
11
  ValidAttributeInput,
16
12
  } from "@ogw_internal/stores/data_style/attribute_types";
17
- import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
13
+ import type {
14
+ AttributeItem,
15
+ AttributeName,
16
+ AttributeRangeMaximum,
17
+ AttributeRangeMinimum,
18
+ ColorRGBA,
19
+ } from "@geode/opengeodeweb-viewer/schema_types";
18
20
  import type { ModelId, SurfaceId } from "@ogw_front/types/identifiers";
21
+ import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
19
22
  import { defaultAttributeStoredConfig } from "@ogw_internal/stores/data_style/attribute_default";
20
23
  import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
21
24
  // Third party imports
@@ -87,11 +90,11 @@ interface UseModelSurfacesVertexAttributeReturn {
87
90
  surfaceIds: SurfaceId[],
88
91
  colorMap: AttributeColorMap | undefined,
89
92
  ) => Promise<unknown>;
90
- modelSurfacesVertexAttributeNoDataColor: (modelId: ModelId, surfaceId?: SurfaceId) => RGBAColor;
93
+ modelSurfacesVertexAttributeNoDataColor: (modelId: ModelId, surfaceId?: SurfaceId) => ColorRGBA;
91
94
  setModelSurfacesVertexAttributeNoDataColor: (
92
95
  modelId: ModelId,
93
96
  surfaceIds: SurfaceId[],
94
- no_data_color: RGBAColor,
97
+ no_data_color: ColorRGBA,
95
98
  ) => Promise<unknown>;
96
99
  }
97
100
 
@@ -187,7 +190,7 @@ function useModelSurfacesVertexAttributeGetters(
187
190
  function modelSurfacesVertexAttributeNoDataColor(
188
191
  modelId: ModelId,
189
192
  surfaceId?: SurfaceId,
190
- ): RGBAColor {
193
+ ): ColorRGBA {
191
194
  const name = modelSurfacesVertexAttributeName(modelId, surfaceId);
192
195
  const item = modelSurfacesVertexAttributeItem(modelId, surfaceId);
193
196
  const storedConfig = modelSurfacesVertexAttributeStoredConfig(modelId, surfaceId, name, item);
@@ -407,7 +410,7 @@ function useModelSurfacesVertexAttribute(): UseModelSurfacesVertexAttributeRetur
407
410
  async function setModelSurfacesVertexAttributeNoDataColor(
408
411
  modelId: ModelId,
409
412
  surfaceIds: SurfaceId[],
410
- no_data_color: RGBAColor,
413
+ no_data_color: ColorRGBA,
411
414
  ): Promise<unknown> {
412
415
  const name = modelSurfacesVertexAttributeName(modelId, surfaceIds[0]);
413
416
  const item = modelSurfacesVertexAttributeItem(modelId, surfaceIds[0]);
@@ -1,5 +1,5 @@
1
1
  import type { ModelId, SurfaceId } from "@ogw_front/types/identifiers";
2
- import type { Visibility } from "@ogw_front/types/style";
2
+ import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types";
3
3
  import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
4
4
  import { useModelSurfacesCommonStyle } from "./common";
5
5
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
@@ -1,7 +1,7 @@
1
1
  import { type ComponentStyleFunctions, dispatchToComponentTypes } from "./visibility_dispatch";
2
2
  import { MESH_COMPONENT_TYPES } from "@ogw_front/utils/default_styles";
3
3
  import type { ModelId } from "@ogw_front/types/identifiers";
4
- import type { Visibility } from "@ogw_front/types/style";
4
+ import type { Visibility } from "@geode/opengeodeweb-viewer/schema_types";
5
5
  import { useDataStore } from "@ogw_front/stores/data";
6
6
  import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
7
7
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
@@ -1,5 +1,5 @@
1
1
  import type { SceneFontFamily, SceneOrientationWidget, SceneStyle } from "./types";
2
- import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
+ import type { ColorRGBA } from "@geode/opengeodeweb-viewer/schema_types";
3
3
  // Third party imports
4
4
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
5
5
 
@@ -22,8 +22,8 @@ const orientation_widget_schema = viewer_schemas.opengeodeweb_viewer.viewer.set_
22
22
 
23
23
  // oxlint-disable-next-line max-lines-per-function
24
24
  export function useSceneStyle(): {
25
- setSceneBackgroundColor: (color: RGBAColor) => Promise<void>;
26
- setSceneTextColor: (color: RGBAColor) => Promise<unknown>;
25
+ setSceneBackgroundColor: (color: ColorRGBA) => Promise<void>;
26
+ setSceneTextColor: (color: ColorRGBA) => Promise<unknown>;
27
27
  setSceneFontFamily: (font_family: SceneFontFamily) => Promise<unknown>;
28
28
  setSceneOrientationWidget: (marker: SceneOrientationWidget) => Promise<unknown>;
29
29
  applySceneStyle: () => Promise<void>;
@@ -85,12 +85,12 @@ export function useSceneStyle(): {
85
85
  }
86
86
  }
87
87
 
88
- async function setSceneBackgroundColor(color: RGBAColor): Promise<void> {
88
+ async function setSceneBackgroundColor(color: ColorRGBA): Promise<void> {
89
89
  await hybridViewerStore.setBackgroundColor(toViewerColor(color));
90
90
  await saveSceneStyle({ background_color: color });
91
91
  }
92
92
 
93
- async function setSceneTextColor(color: RGBAColor): Promise<unknown> {
93
+ async function setSceneTextColor(color: ColorRGBA): Promise<unknown> {
94
94
  const result = await requestTextStyle({ ...sceneStyle.value.text, color });
95
95
  return result;
96
96
  }
@@ -1,5 +1,6 @@
1
- import type { AttributeName, AttributeTimeStep } from "@ogw_front/types/attribute";
2
- import type { DataId } from "@ogw_front/types/identifiers";
1
+ import type { AttributeName } from "@geode/opengeodeweb-viewer/schema_types";
2
+ import type { AttributeTimeStep } from "@ogw_front/types/attribute";
3
+ import type { DataId } from "@geode/opengeodeweb-microservice/schema_types";
3
4
  import { attributeArrayName } from "@ogw_front/utils/attributes";
4
5
  import { useDataStyleState } from "./state";
5
6
 
@@ -1,6 +1,5 @@
1
+ import type { ColorRGBA, Visibility } from "@geode/opengeodeweb-viewer/schema_types";
1
2
  import type { DataIdentified } 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
 
5
4
  type StyleValues = Record<string, unknown>;
6
5
 
@@ -36,9 +35,9 @@ type SceneOrientationWidget = "axes" | "compass";
36
35
 
37
36
  interface SceneStyle {
38
37
  id: "scene";
39
- background_color: RGBAColor;
38
+ background_color: ColorRGBA;
40
39
  text: {
41
- color: RGBAColor;
40
+ color: ColorRGBA;
42
41
  font_family: SceneFontFamily;
43
42
  };
44
43
  orientation_widget: SceneOrientationWidget;
@@ -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";
@@ -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,8 +4,8 @@ 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
11
  import { getDefaultSceneStyle } from "@ogw_front/utils/default_styles";
@@ -25,7 +25,7 @@ function localBackgroundColor(): [number, number, number] {
25
25
  async function setBackgroundColor(color: ViewerSetBackgroundColorParams["color"]): Promise<void> {
26
26
  const { genericRenderWindow, remoteRender } = useHybridViewerCore();
27
27
  const renderer = requireRenderWindow(genericRenderWindow).getRenderer();
28
- 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]);
29
29
  const renderWindow = requireRenderWindow(genericRenderWindow).getRenderWindow();
30
30
  renderWindow.render();
31
31
  const viewerStore = useViewerStore();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "12.0.0-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": {
@@ -84,6 +84,7 @@
84
84
  "dependencies": {
85
85
  "@geode/cloud-api": "next",
86
86
  "@geode/opengeodeweb-back": "next",
87
+ "@geode/opengeodeweb-microservice": "next",
87
88
  "@geode/opengeodeweb-viewer": "next",
88
89
  "@kitware/vtk.js": "33.3.0",
89
90
  "@msgpack/msgpack": "2.8.0",
@@ -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);
@@ -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 };