@geode/opengeodeweb-front 10.44.0 → 10.44.1

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 (218) hide show
  1. package/app/components/ClippingPlanes.vue +7 -5
  2. package/app/components/CrsSelector.vue +2 -1
  3. package/app/components/ExtensionSelector.vue +8 -7
  4. package/app/components/FactorFilterPanel.vue +4 -4
  5. package/app/components/MissingFilesSelector.vue +2 -1
  6. package/app/components/ObjectSelector.vue +4 -3
  7. package/app/components/ThresholdCard.vue +6 -5
  8. package/app/components/ThresholdFilter.vue +11 -10
  9. package/app/components/TimeSeriesTargetSelector.vue +10 -7
  10. package/app/components/Viewer/ContextMenu/InfoCard.vue +12 -10
  11. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +72 -63
  12. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +12 -10
  13. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +76 -71
  14. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +8 -6
  15. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +72 -63
  16. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +12 -10
  17. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +54 -45
  18. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +76 -73
  19. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +8 -6
  20. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +72 -67
  21. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +8 -6
  22. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +29 -21
  23. package/app/components/Viewer/Generic/Model/ComponentEdgesOptions.vue +8 -6
  24. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +8 -6
  25. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +15 -7
  26. package/app/components/Viewer/Generic/Model/CornersOptions.vue +2 -1
  27. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +13 -6
  28. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +19 -11
  29. package/app/components/Viewer/Generic/Model/LinesOptions.vue +2 -1
  30. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +17 -10
  31. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +3 -2
  32. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +2 -1
  33. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +3 -2
  34. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +29 -21
  35. package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +2 -2
  36. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +2 -3
  37. package/app/components/Viewer/Options/AttributeSelector.vue +11 -7
  38. package/app/components/Viewer/Options/ColoringTypeSelector.vue +10 -13
  39. package/app/components/Viewer/Options/TextureItem.vue +5 -4
  40. package/app/components/Viewer/Options/TexturesSelector.vue +5 -8
  41. package/app/components/Viewer/Options/TimeStepSlider.vue +3 -1
  42. package/app/components/Viewer/OverlappingObjectsPicker.vue +6 -13
  43. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +40 -38
  44. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +69 -65
  45. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +8 -6
  46. package/app/components/Viewer/Surface/PolygonsColoring.vue +73 -71
  47. package/app/components/Viewer/Surface/PolygonsOptions.vue +8 -6
  48. package/app/composables/attribute_coloring_style.ts +17 -12
  49. package/app/composables/attribute_selector.ts +9 -15
  50. package/app/composables/batch_style.ts +25 -16
  51. package/app/composables/batch_style_model.ts +6 -5
  52. package/app/composables/clipping_planes_widget.ts +2 -5
  53. package/app/composables/clipping_slices.ts +2 -1
  54. package/app/composables/hover_highlight.ts +17 -16
  55. package/app/composables/live_data_item.ts +3 -2
  56. package/app/composables/model_attribute_style.ts +2 -1
  57. package/app/composables/model_menu_context.ts +3 -4
  58. package/app/composables/model_tree.ts +3 -2
  59. package/app/composables/project_manager_helpers/types.ts +10 -4
  60. package/app/composables/tree_filter.ts +3 -3
  61. package/app/composables/tree_keyboard_nav.ts +1 -6
  62. package/app/composables/tree_scroll.ts +2 -0
  63. package/app/composables/use_overlapping_picker.ts +9 -9
  64. package/app/stores/basemap_helpers/georeferenced.ts +1 -1
  65. package/app/stores/basemap_helpers/viewer.ts +2 -1
  66. package/app/stores/crs.ts +6 -5
  67. package/app/stores/data.ts +84 -69
  68. package/app/stores/data_helpers/collections.ts +13 -21
  69. package/app/stores/data_helpers/mesh.ts +19 -24
  70. package/app/stores/data_helpers/relations.ts +12 -12
  71. package/app/stores/data_style.ts +26 -20
  72. package/app/stores/menu.ts +17 -11
  73. package/app/stores/treeview.ts +28 -27
  74. package/app/types/attribute.ts +37 -0
  75. package/app/types/identifiers.ts +72 -0
  76. package/app/types/style.ts +13 -0
  77. package/app/types/texture.ts +6 -0
  78. package/app/types/tree.ts +17 -0
  79. package/app/utils/attribute_range.ts +2 -1
  80. package/app/utils/attributes.ts +13 -4
  81. package/app/utils/basemap_tree.ts +3 -5
  82. package/app/utils/clipping_planes.ts +6 -4
  83. package/app/utils/clipping_planes_scene.ts +4 -3
  84. package/app/utils/crs.ts +4 -1
  85. package/app/utils/default_styles/constants.ts +8 -1
  86. package/app/utils/default_styles/mesh_components.ts +21 -25
  87. package/app/utils/default_styles/meshes.ts +7 -22
  88. package/app/utils/default_styles/model_components.ts +22 -26
  89. package/app/utils/default_styles/models.ts +11 -13
  90. package/app/utils/import_workflow.ts +37 -29
  91. package/app/utils/legacy_data_id.ts +16 -0
  92. package/app/utils/slice.ts +7 -2
  93. package/app/utils/threshold.ts +1 -8
  94. package/app/utils/threshold_sources.ts +8 -5
  95. package/app/utils/treeview.ts +3 -2
  96. package/internal/database/tables/data.ts +1 -1
  97. package/internal/database/tables/data_style.ts +1 -1
  98. package/internal/database/tables/model_components.ts +1 -1
  99. package/internal/database/tables/model_components_relation.ts +1 -1
  100. package/internal/stores/data_style/attribute_default.ts +14 -0
  101. package/internal/stores/data_style/attribute_types.ts +59 -0
  102. package/internal/stores/data_style/attribute_valid.ts +16 -0
  103. package/internal/stores/data_style/mesh/base_style.ts +17 -15
  104. package/internal/stores/data_style/mesh/cells/cell.ts +64 -49
  105. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +42 -66
  106. package/internal/stores/data_style/mesh/cells/cell_config.ts +59 -53
  107. package/internal/stores/data_style/mesh/cells/color.ts +8 -7
  108. package/internal/stores/data_style/mesh/cells/common.ts +16 -15
  109. package/internal/stores/data_style/mesh/cells/index.ts +49 -47
  110. package/internal/stores/data_style/mesh/cells/opacity.ts +12 -10
  111. package/internal/stores/data_style/mesh/cells/textures.ts +8 -7
  112. package/internal/stores/data_style/mesh/cells/vertex.ts +66 -50
  113. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +37 -67
  114. package/internal/stores/data_style/mesh/cells/vertex_config.ts +62 -53
  115. package/internal/stores/data_style/mesh/cells/visibility.ts +11 -7
  116. package/internal/stores/data_style/mesh/edges/color.ts +8 -7
  117. package/internal/stores/data_style/mesh/edges/common.ts +13 -12
  118. package/internal/stores/data_style/mesh/edges/edge.ts +64 -49
  119. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +42 -66
  120. package/internal/stores/data_style/mesh/edges/edge_config.ts +59 -53
  121. package/internal/stores/data_style/mesh/edges/index.ts +49 -47
  122. package/internal/stores/data_style/mesh/edges/opacity.ts +12 -10
  123. package/internal/stores/data_style/mesh/edges/vertex.ts +66 -50
  124. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +37 -67
  125. package/internal/stores/data_style/mesh/edges/vertex_config.ts +62 -53
  126. package/internal/stores/data_style/mesh/edges/visibility.ts +11 -7
  127. package/internal/stores/data_style/mesh/edges/width.ts +9 -7
  128. package/internal/stores/data_style/mesh/index.ts +27 -24
  129. package/internal/stores/data_style/mesh/points/color.ts +8 -7
  130. package/internal/stores/data_style/mesh/points/common.ts +16 -14
  131. package/internal/stores/data_style/mesh/points/index.ts +39 -37
  132. package/internal/stores/data_style/mesh/points/opacity.ts +12 -10
  133. package/internal/stores/data_style/mesh/points/size.ts +9 -7
  134. package/internal/stores/data_style/mesh/points/vertex.ts +66 -50
  135. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +37 -67
  136. package/internal/stores/data_style/mesh/points/vertex_config.ts +62 -53
  137. package/internal/stores/data_style/mesh/points/visibility.ts +8 -6
  138. package/internal/stores/data_style/mesh/polygons/color.ts +8 -7
  139. package/internal/stores/data_style/mesh/polygons/common.ts +19 -15
  140. package/internal/stores/data_style/mesh/polygons/index.ts +49 -50
  141. package/internal/stores/data_style/mesh/polygons/opacity.ts +12 -10
  142. package/internal/stores/data_style/mesh/polygons/polygon.ts +66 -50
  143. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +37 -67
  144. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +65 -53
  145. package/internal/stores/data_style/mesh/polygons/textures.ts +8 -7
  146. package/internal/stores/data_style/mesh/polygons/vertex.ts +66 -50
  147. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +37 -67
  148. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +65 -53
  149. package/internal/stores/data_style/mesh/polygons/visibility.ts +12 -7
  150. package/internal/stores/data_style/mesh/polyhedra/color.ts +13 -9
  151. package/internal/stores/data_style/mesh/polyhedra/common.ts +13 -12
  152. package/internal/stores/data_style/mesh/polyhedra/index.ts +51 -51
  153. package/internal/stores/data_style/mesh/polyhedra/opacity.ts +12 -10
  154. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +59 -53
  155. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +46 -69
  156. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +65 -55
  157. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +66 -50
  158. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +37 -67
  159. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +65 -53
  160. package/internal/stores/data_style/mesh/polyhedra/visibility.ts +12 -7
  161. package/internal/stores/data_style/model/blocks/apply_coloring.ts +11 -12
  162. package/internal/stores/data_style/model/blocks/color.ts +25 -26
  163. package/internal/stores/data_style/model/blocks/coloring_groups.ts +5 -9
  164. package/internal/stores/data_style/model/blocks/common.ts +26 -22
  165. package/internal/stores/data_style/model/blocks/index.ts +8 -7
  166. package/internal/stores/data_style/model/blocks/polyhedron.ts +114 -135
  167. package/internal/stores/data_style/model/blocks/vertex.ts +110 -132
  168. package/internal/stores/data_style/model/blocks/visibility.ts +11 -9
  169. package/internal/stores/data_style/model/color.ts +55 -41
  170. package/internal/stores/data_style/model/common.ts +16 -14
  171. package/internal/stores/data_style/model/component_style.ts +0 -16
  172. package/internal/stores/data_style/model/corners/color.ts +21 -19
  173. package/internal/stores/data_style/model/corners/common.ts +26 -22
  174. package/internal/stores/data_style/model/corners/index.ts +21 -24
  175. package/internal/stores/data_style/model/corners/vertex.ts +103 -122
  176. package/internal/stores/data_style/model/corners/visibility.ts +11 -9
  177. package/internal/stores/data_style/model/edges/common.ts +7 -6
  178. package/internal/stores/data_style/model/edges/component.ts +63 -55
  179. package/internal/stores/data_style/model/edges/visibility.ts +24 -16
  180. package/internal/stores/data_style/model/edges/width.ts +10 -8
  181. package/internal/stores/data_style/model/index.ts +7 -6
  182. package/internal/stores/data_style/model/lines/apply_coloring.ts +11 -9
  183. package/internal/stores/data_style/model/lines/color.ts +25 -23
  184. package/internal/stores/data_style/model/lines/coloring_groups.ts +5 -9
  185. package/internal/stores/data_style/model/lines/common.ts +29 -21
  186. package/internal/stores/data_style/model/lines/edge.ts +109 -128
  187. package/internal/stores/data_style/model/lines/index.ts +8 -7
  188. package/internal/stores/data_style/model/lines/vertex.ts +109 -128
  189. package/internal/stores/data_style/model/lines/visibility.ts +11 -9
  190. package/internal/stores/data_style/model/points/common.ts +7 -6
  191. package/internal/stores/data_style/model/points/component.ts +62 -54
  192. package/internal/stores/data_style/model/points/index.ts +12 -7
  193. package/internal/stores/data_style/model/points/size.ts +10 -8
  194. package/internal/stores/data_style/model/points/visibility.ts +13 -8
  195. package/internal/stores/data_style/model/selection.ts +6 -11
  196. package/internal/stores/data_style/model/surfaces/apply_coloring.ts +11 -15
  197. package/internal/stores/data_style/model/surfaces/color.ts +31 -23
  198. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +5 -9
  199. package/internal/stores/data_style/model/surfaces/common.ts +26 -22
  200. package/internal/stores/data_style/model/surfaces/index.ts +8 -7
  201. package/internal/stores/data_style/model/surfaces/polygon.ts +113 -138
  202. package/internal/stores/data_style/model/surfaces/vertex.ts +117 -133
  203. package/internal/stores/data_style/model/surfaces/visibility.ts +11 -9
  204. package/internal/stores/data_style/model/visibility.ts +18 -16
  205. package/internal/stores/data_style/model/visibility_dispatch.ts +4 -4
  206. package/internal/stores/data_style/state.ts +7 -6
  207. package/internal/stores/data_style/state_shared.ts +11 -10
  208. package/internal/stores/data_style/time_step.ts +21 -15
  209. package/internal/stores/data_style/types.ts +4 -3
  210. package/internal/stores/hybrid_viewer/camera.ts +11 -6
  211. package/internal/stores/hybrid_viewer/filters.ts +16 -14
  212. package/internal/stores/hybrid_viewer/highlight.ts +6 -5
  213. package/internal/stores/hybrid_viewer/scene.ts +20 -18
  214. package/internal/stores/hybrid_viewer/vtk_types.ts +2 -2
  215. package/internal/utils/api_fetch.ts +1 -1
  216. package/internal/utils/upload_file.ts +1 -7
  217. package/package.json +1 -1
  218. package/shared/utils/fetch_raw.ts +7 -8
@@ -1,11 +1,13 @@
1
1
  // Third party imports
2
2
 
3
3
  // Local imports
4
- import { isMeshEdgesEdgeAttributeValid, useMeshEdgesEdgeAttributeStyle } from "./edge";
5
- import { isMeshEdgesVertexAttributeValid, useMeshEdgesVertexAttributeStyle } from "./vertex";
4
+ import type { MeshId } from "@ogw_front/types/identifiers";
6
5
  import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
6
+ import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
7
7
  import { useMeshEdgesColorStyle } from "./color";
8
8
  import { useMeshEdgesCommonStyle } from "./common";
9
+ import { useMeshEdgesEdgeAttributeStyle } from "./edge";
10
+ import { useMeshEdgesVertexAttributeStyle } from "./vertex";
9
11
  import { useMeshEdgesVisibilityStyle } from "./visibility";
10
12
  import { useMeshEdgesWidthStyle } from "./width";
11
13
  import { whenDefined } from "@ogw_internal/stores/data_style/when_defined";
@@ -20,73 +22,73 @@ interface MeshEdgesActiveColoringDeps {
20
22
  }
21
23
 
22
24
  function handleMeshEdgesVertexColoring(
23
- id: string,
25
+ meshId: MeshId,
24
26
  vertexAttributeStyle: ReturnType<typeof useMeshEdgesVertexAttributeStyle>,
25
27
  ): Promise<unknown> | undefined {
26
- const name = vertexAttributeStyle.meshEdgesVertexAttributeName(id);
27
- const item = vertexAttributeStyle.meshEdgesVertexAttributeItem(id);
28
- const [minimum, maximum] = vertexAttributeStyle.meshEdgesVertexAttributeRange(id);
29
- const colorMap = vertexAttributeStyle.meshEdgesVertexAttributeColorMap(id);
30
- const no_data_color = vertexAttributeStyle.meshEdgesVertexAttributeNoDataColor(id);
28
+ const name = vertexAttributeStyle.meshEdgesVertexAttributeName(meshId);
29
+ const item = vertexAttributeStyle.meshEdgesVertexAttributeItem(meshId);
30
+ const [minimum, maximum] = vertexAttributeStyle.meshEdgesVertexAttributeRange(meshId);
31
+ const colorMap = vertexAttributeStyle.meshEdgesVertexAttributeColorMap(meshId);
32
+ const no_data_color = vertexAttributeStyle.meshEdgesVertexAttributeNoDataColor(meshId);
31
33
  const vertex_attribute = { name, item, minimum, maximum, colorMap, no_data_color };
32
- if (!isMeshEdgesVertexAttributeValid(vertex_attribute)) {
34
+ if (!isAttributeValid(vertex_attribute)) {
33
35
  return undefined;
34
36
  }
35
- return vertexAttributeStyle.setMeshEdgesVertexAttribute(id, vertex_attribute);
37
+ return vertexAttributeStyle.setMeshEdgesVertexAttribute(meshId, vertex_attribute);
36
38
  }
37
39
 
38
40
  function handleMeshEdgesEdgeColoring(
39
- id: string,
41
+ meshId: MeshId,
40
42
  edgeAttributeStyle: ReturnType<typeof useMeshEdgesEdgeAttributeStyle>,
41
43
  ): Promise<unknown> | undefined {
42
- const name = edgeAttributeStyle.meshEdgesEdgeAttributeName(id);
43
- const item = edgeAttributeStyle.meshEdgesEdgeAttributeItem(id);
44
- const [minimum, maximum] = edgeAttributeStyle.meshEdgesEdgeAttributeRange(id);
45
- const colorMap = edgeAttributeStyle.meshEdgesEdgeAttributeColorMap(id);
46
- const no_data_color = edgeAttributeStyle.meshEdgesEdgeAttributeNoDataColor(id);
44
+ const name = edgeAttributeStyle.meshEdgesEdgeAttributeName(meshId);
45
+ const item = edgeAttributeStyle.meshEdgesEdgeAttributeItem(meshId);
46
+ const [minimum, maximum] = edgeAttributeStyle.meshEdgesEdgeAttributeRange(meshId);
47
+ const colorMap = edgeAttributeStyle.meshEdgesEdgeAttributeColorMap(meshId);
48
+ const no_data_color = edgeAttributeStyle.meshEdgesEdgeAttributeNoDataColor(meshId);
47
49
  const edge_attribute = { name, item, minimum, maximum, colorMap, no_data_color };
48
- if (!isMeshEdgesEdgeAttributeValid(edge_attribute)) {
50
+ if (!isAttributeValid(edge_attribute)) {
49
51
  return undefined;
50
52
  }
51
- return edgeAttributeStyle.setMeshEdgesEdgeAttribute(id, edge_attribute);
53
+ return edgeAttributeStyle.setMeshEdgesEdgeAttribute(meshId, edge_attribute);
52
54
  }
53
55
 
54
56
  async function applyMeshEdgesActiveColoring(
55
- id: string,
57
+ meshId: MeshId,
56
58
  type: string | undefined,
57
59
  deps: MeshEdgesActiveColoringDeps,
58
60
  ): Promise<unknown> {
59
- await deps.commonStyle.mutateMeshEdgesStyle(id, {
61
+ await deps.commonStyle.mutateMeshEdgesStyle(meshId, {
60
62
  coloring: { active: type },
61
63
  });
62
64
  if (type === "constant") {
63
- const result = await whenDefined(deps.colorStyle.meshEdgesColor(id), async (value) => {
64
- const applied = await deps.colorStyle.setMeshEdgesColor(id, value);
65
+ const result = await whenDefined(deps.colorStyle.meshEdgesColor(meshId), async (value) => {
66
+ const applied = await deps.colorStyle.setMeshEdgesColor(meshId, value);
65
67
  return applied;
66
68
  });
67
69
  return result;
68
70
  }
69
71
  if (type === "vertex") {
70
- const result = await handleMeshEdgesVertexColoring(id, deps.vertexAttributeStyle);
72
+ const result = await handleMeshEdgesVertexColoring(meshId, deps.vertexAttributeStyle);
71
73
  return result;
72
74
  }
73
75
  if (type === "edge") {
74
- const result = await handleMeshEdgesEdgeColoring(id, deps.edgeAttributeStyle);
76
+ const result = await handleMeshEdgesEdgeColoring(meshId, deps.edgeAttributeStyle);
75
77
  return result;
76
78
  }
77
79
  throw new Error(`Unknown mesh edges coloring type: ${type}`);
78
80
  }
79
81
 
80
82
  async function setMeshEdgesActiveColoring(
81
- id: string,
83
+ meshId: MeshId,
82
84
  type: string | undefined,
83
85
  deps: MeshEdgesActiveColoringDeps,
84
86
  ): Promise<unknown> {
85
- const result = await applyMeshEdgesActiveColoring(id, type, deps);
87
+ const result = await applyMeshEdgesActiveColoring(meshId, type, deps);
86
88
  if (type !== "constant") {
87
89
  // Attribute and textures colorings keep the actor opacity: restore the stored one
88
- await whenDefined(deps.colorStyle.meshEdgesOpacity(id), async (value) => {
89
- const applied = await deps.colorStyle.setMeshEdgesOpacity(id, value);
90
+ await whenDefined(deps.colorStyle.meshEdgesOpacity(meshId), async (value) => {
91
+ const applied = await deps.colorStyle.setMeshEdgesOpacity(meshId, value);
90
92
  return applied;
91
93
  });
92
94
  }
@@ -94,31 +96,31 @@ async function setMeshEdgesActiveColoring(
94
96
  }
95
97
 
96
98
  async function applyMeshEdgesStyle(
97
- id: string,
99
+ meshId: MeshId,
98
100
  visibilityStyle: ReturnType<typeof useMeshEdgesVisibilityStyle>,
99
101
  widthStyle: ReturnType<typeof useMeshEdgesWidthStyle>,
100
102
  activeColoringType: string | undefined,
101
103
  deps: MeshEdgesActiveColoringDeps,
102
104
  ): Promise<unknown[]> {
103
105
  const result = await Promise.all([
104
- whenDefined(visibilityStyle.meshEdgesVisibility(id), async (value) => {
105
- const applied = await visibilityStyle.setMeshEdgesVisibility(id, value);
106
+ whenDefined(visibilityStyle.meshEdgesVisibility(meshId), async (value) => {
107
+ const applied = await visibilityStyle.setMeshEdgesVisibility(meshId, value);
106
108
  return applied;
107
109
  }),
108
- whenDefined(widthStyle.meshEdgesWidth(id), async (value) => {
109
- const applied = await widthStyle.setMeshEdgesWidth(id, value);
110
+ whenDefined(widthStyle.meshEdgesWidth(meshId), async (value) => {
111
+ const applied = await widthStyle.setMeshEdgesWidth(meshId, value);
110
112
  return applied;
111
113
  }),
112
- setMeshEdgesActiveColoring(id, activeColoringType, deps),
114
+ setMeshEdgesActiveColoring(meshId, activeColoringType, deps),
113
115
  ]);
114
116
  return result;
115
117
  }
116
118
 
117
119
  type UseMeshEdgesStyleReturn = ReturnType<typeof useMeshEdgesCommonStyle> & {
118
- meshEdgesColoring: (id: string) => StyleValues;
119
- meshEdgesActiveColoring: (id: string) => string | undefined;
120
- setMeshEdgesActiveColoring: (id: string, type: string | undefined) => Promise<unknown>;
121
- applyMeshEdgesStyle: (id: string) => Promise<unknown[]>;
120
+ meshEdgesColoring: (meshId: MeshId) => StyleValues;
121
+ meshEdgesActiveColoring: (meshId: MeshId) => string | undefined;
122
+ setMeshEdgesActiveColoring: (meshId: MeshId, type: string | undefined) => Promise<unknown>;
123
+ applyMeshEdgesStyle: (meshId: MeshId) => Promise<unknown[]>;
122
124
  } & ReturnType<typeof useMeshEdgesVisibilityStyle> &
123
125
  ReturnType<typeof useMeshEdgesColorStyle> &
124
126
  ReturnType<typeof useMeshEdgesWidthStyle> &
@@ -140,29 +142,29 @@ export function useMeshEdgesStyle(): UseMeshEdgesStyleReturn {
140
142
  edgeAttributeStyle: meshEdgesEdgeAttributeStyle,
141
143
  };
142
144
 
143
- function meshEdgesColoring(id: string): StyleValues {
144
- return meshEdgesCommonStyle.meshEdgesColoring(id);
145
+ function meshEdgesColoring(meshId: MeshId): StyleValues {
146
+ return meshEdgesCommonStyle.meshEdgesColoring(meshId);
145
147
  }
146
148
 
147
- function meshEdgesActiveColoring(id: string): string | undefined {
149
+ function meshEdgesActiveColoring(meshId: MeshId): string | undefined {
148
150
  // oxlint-disable-next-line no-unsafe-type-assertion -- coloring.active is defined as string in the data style schema.
149
- return meshEdgesColoring(id).active as string | undefined;
151
+ return meshEdgesColoring(meshId).active as string | undefined;
150
152
  }
151
153
 
152
154
  async function boundSetMeshEdgesActiveColoring(
153
- id: string,
155
+ meshId: MeshId,
154
156
  type: string | undefined,
155
157
  ): Promise<unknown> {
156
- const result = await setMeshEdgesActiveColoring(id, type, activeColoringDeps);
158
+ const result = await setMeshEdgesActiveColoring(meshId, type, activeColoringDeps);
157
159
  return result;
158
160
  }
159
161
 
160
- async function boundApplyMeshEdgesStyle(id: string): Promise<unknown[]> {
162
+ async function boundApplyMeshEdgesStyle(meshId: MeshId): Promise<unknown[]> {
161
163
  const result = await applyMeshEdgesStyle(
162
- id,
164
+ meshId,
163
165
  meshEdgesVisibility,
164
166
  meshEdgesWidthStyle,
165
- meshEdgesActiveColoring(id),
167
+ meshEdgesActiveColoring(meshId),
166
168
  activeColoringDeps,
167
169
  );
168
170
  return result;
@@ -1,3 +1,5 @@
1
+ import type { MeshId } from "@ogw_front/types/identifiers";
2
+ import type { Opacity } from "@ogw_front/types/style";
1
3
  import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
4
  // Third party imports
3
5
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
@@ -11,21 +13,21 @@ const schema = viewer_schemas.opengeodeweb_viewer.mesh.edges.opacity;
11
13
 
12
14
  // The opacity is the constant color alpha, the viewer applies it whatever the coloring
13
15
  export function useMeshEdgesOpacityStyle(): {
14
- meshEdgesOpacity: (id: string) => number | undefined;
15
- setMeshEdgesOpacity: (id: string, opacity: number) => Promise<unknown>;
16
+ meshEdgesOpacity: (meshId: MeshId) => Opacity | undefined;
17
+ setMeshEdgesOpacity: (meshId: MeshId, opacity: Opacity) => Promise<unknown>;
16
18
  } {
17
19
  const viewerStore = useViewerStore();
18
20
  const meshEdgesCommonStyle = useMeshEdgesCommonStyle();
19
21
 
20
- function meshEdgesConstantColor(id: string): RGBAColor | undefined {
22
+ function meshEdgesConstantColor(meshId: MeshId): RGBAColor | undefined {
21
23
  // oxlint-disable-next-line no-unsafe-type-assertion -- coloring.constant shape is defined by the data style schema.
22
- return meshEdgesCommonStyle.meshEdgesColoring(id).constant as RGBAColor | undefined;
24
+ return meshEdgesCommonStyle.meshEdgesColoring(meshId).constant as RGBAColor | undefined;
23
25
  }
24
- function meshEdgesOpacity(id: string): number | undefined {
25
- return meshEdgesConstantColor(id)?.alpha;
26
+ function meshEdgesOpacity(meshId: MeshId): Opacity | undefined {
27
+ return meshEdgesConstantColor(meshId)?.alpha;
26
28
  }
27
- async function setMeshEdgesOpacity(id: string, opacity: number): Promise<unknown> {
28
- const params = { id, opacity };
29
+ async function setMeshEdgesOpacity(meshId: MeshId, opacity: Opacity): Promise<unknown> {
30
+ const params = { id: meshId, opacity };
29
31
  const result = await viewerStore.request(
30
32
  {
31
33
  schema,
@@ -33,11 +35,11 @@ export function useMeshEdgesOpacityStyle(): {
33
35
  },
34
36
  {
35
37
  response_function: async () => {
36
- const color = meshEdgesConstantColor(id);
38
+ const color = meshEdgesConstantColor(meshId);
37
39
  if (color === undefined) {
38
40
  return undefined;
39
41
  }
40
- const mutateResult = await meshEdgesCommonStyle.mutateMeshEdgesColoring(id, {
42
+ const mutateResult = await meshEdgesCommonStyle.mutateMeshEdgesColoring(meshId, {
41
43
  constant: { ...color, alpha: opacity },
42
44
  });
43
45
  return mutateResult;
@@ -1,19 +1,26 @@
1
+ import type {
2
+ AttributeColorMap,
3
+ AttributeItem,
4
+ AttributeName,
5
+ AttributeRangeMaximum,
6
+ AttributeRangeMinimum,
7
+ AttributeTimeStep,
8
+ } from "@ogw_front/types/attribute";
1
9
  import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
10
+ import type { MeshId } from "@ogw_front/types/identifiers";
11
+ import type { ValidAttributeInput } from "@ogw_internal/stores/data_style/attribute_types";
12
+ import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
2
13
  // Third party imports
3
14
  import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
4
15
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
5
16
 
6
17
  // Local imports
7
- import {
8
- type UseMeshEdgesVertexAttributeStyleReturn,
9
- type ValidAttributeInput,
10
- isMeshEdgesVertexAttributeValid,
11
- } from "./vertex_attribute";
12
18
  import {
13
19
  useMeshEdgesVertexAttributeConfig,
14
20
  useMeshEdgesVertexAttributeConfigValues,
15
21
  useMeshEdgesVertexAttributeConfigWriter,
16
22
  } from "./vertex_config";
23
+ import type { UseMeshEdgesVertexAttributeStyleReturn } from "./vertex_attribute";
17
24
  import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
18
25
  import { useAttributeTimeStepStyle } from "@ogw_internal/stores/data_style/time_step";
19
26
  import { useViewerStore } from "@ogw_front/stores/viewer";
@@ -41,11 +48,15 @@ function useMeshEdgesVertexAttributeStyle(): UseMeshEdgesVertexAttributeStyleRet
41
48
  } = useMeshEdgesVertexAttributeConfigValues();
42
49
  const { mutateMeshEdgesVertexStyle, setMeshEdgesVertexAttributeStoredConfig } =
43
50
  useMeshEdgesVertexAttributeConfigWriter();
44
- function meshEdgesVertexAttributeTimeStep(id: string): number | undefined {
45
- return attributeTimeStep(id, attributeNamesSchema.$id, meshEdgesVertexAttribute(id).name);
51
+ function meshEdgesVertexAttributeTimeStep(meshId: MeshId): AttributeTimeStep | undefined {
52
+ return attributeTimeStep(
53
+ meshId,
54
+ attributeNamesSchema.$id,
55
+ meshEdgesVertexAttribute(meshId).name,
56
+ );
46
57
  }
47
58
  async function setMeshEdgesVertexAttribute(
48
- id: string,
59
+ meshId: MeshId,
49
60
  {
50
61
  name,
51
62
  item,
@@ -55,11 +66,11 @@ function useMeshEdgesVertexAttributeStyle(): UseMeshEdgesVertexAttributeStyleRet
55
66
  no_data_color = DEFAULT_NO_DATA_COLOR,
56
67
  }: ValidAttributeInput,
57
68
  ): Promise<unknown> {
58
- await mutateMeshEdgesVertexStyle(id, {
69
+ await mutateMeshEdgesVertexStyle(meshId, {
59
70
  name,
60
71
  item,
61
72
  });
62
- await setMeshEdgesVertexAttributeStoredConfig(id, name, item, {
73
+ await setMeshEdgesVertexAttributeStoredConfig(meshId, name, item, {
63
74
  minimum,
64
75
  maximum,
65
76
  colorMap,
@@ -68,8 +79,8 @@ function useMeshEdgesVertexAttributeStyle(): UseMeshEdgesVertexAttributeStyleRet
68
79
  const points = [...getRGBPointsFromPreset(colorMap)];
69
80
  const schema = meshEdgesVertexAttributeSchemas.attribute;
70
81
  const params = {
71
- id,
72
- name: seriesArrayName(id, attributeNamesSchema.$id, name),
82
+ id: meshId,
83
+ name: seriesArrayName(meshId, attributeNamesSchema.$id, name),
73
84
  item,
74
85
  points,
75
86
  minimum,
@@ -81,10 +92,10 @@ function useMeshEdgesVertexAttributeStyle(): UseMeshEdgesVertexAttributeStyleRet
81
92
  params,
82
93
  });
83
94
  }
84
- async function applyVertexAttribute(id: string): Promise<unknown> {
85
- const name = meshEdgesVertexAttributeName(id);
86
- const item = meshEdgesVertexAttributeItem(id);
87
- const storedConfig = meshEdgesVertexAttributeStoredConfig(id, name, item);
95
+ async function applyVertexAttribute(meshId: MeshId): Promise<unknown> {
96
+ const name = meshEdgesVertexAttributeName(meshId);
97
+ const item = meshEdgesVertexAttributeItem(meshId);
98
+ const storedConfig = meshEdgesVertexAttributeStoredConfig(meshId, name, item);
88
99
  const attribute = {
89
100
  name,
90
101
  item,
@@ -93,73 +104,79 @@ function useMeshEdgesVertexAttributeStyle(): UseMeshEdgesVertexAttributeStyleRet
93
104
  colorMap: storedConfig.colorMap,
94
105
  no_data_color: storedConfig.no_data_color,
95
106
  };
96
- if (isMeshEdgesVertexAttributeValid(attribute)) {
97
- const result = await setMeshEdgesVertexAttribute(id, attribute);
107
+ if (isAttributeValid(attribute)) {
108
+ const result = await setMeshEdgesVertexAttribute(meshId, attribute);
98
109
  return result;
99
110
  }
100
111
  return undefined;
101
112
  }
102
- async function setMeshEdgesVertexAttributeName(id: string, name: string): Promise<unknown> {
103
- const item = meshEdgesVertexAttributeLastItem(id, name);
104
- await mutateMeshEdgesVertexStyle(id, {
113
+ async function setMeshEdgesVertexAttributeName(
114
+ meshId: MeshId,
115
+ name: AttributeName,
116
+ ): Promise<unknown> {
117
+ const item = meshEdgesVertexAttributeLastItem(meshId, name);
118
+ await mutateMeshEdgesVertexStyle(meshId, {
105
119
  name,
106
120
  item,
107
121
  });
108
- return applyVertexAttribute(id);
122
+ return applyVertexAttribute(meshId);
109
123
  }
110
- async function setMeshEdgesVertexAttributeItem(id: string, item: number): Promise<unknown> {
111
- await mutateMeshEdgesVertexStyle(id, {
124
+ async function setMeshEdgesVertexAttributeItem(
125
+ meshId: MeshId,
126
+ item: AttributeItem,
127
+ ): Promise<unknown> {
128
+ await mutateMeshEdgesVertexStyle(meshId, {
112
129
  item,
113
130
  });
114
- return applyVertexAttribute(id);
131
+ return applyVertexAttribute(meshId);
115
132
  }
116
133
  async function setMeshEdgesVertexAttributeTimeStep(
117
- id: string,
118
- timeStep: number,
134
+ meshId: MeshId,
135
+ timeStep: AttributeTimeStep,
119
136
  ): Promise<unknown> {
120
- const name = meshEdgesVertexAttributeName(id);
137
+ const name = meshEdgesVertexAttributeName(meshId);
121
138
  if (name === undefined) {
122
139
  return undefined;
123
140
  }
124
- await setAttributeTimeStep(id, attributeNamesSchema.$id, name, timeStep);
125
- return applyVertexAttribute(id);
141
+ await setAttributeTimeStep(meshId, attributeNamesSchema.$id, name, timeStep);
142
+ return applyVertexAttribute(meshId);
126
143
  }
127
144
  async function setMeshEdgesVertexAttributeRange(
128
- id: string,
129
- minimum: number,
130
- maximum: number,
145
+ meshId: MeshId,
146
+ minimum: AttributeRangeMinimum,
147
+ maximum: AttributeRangeMaximum,
131
148
  ): Promise<unknown> {
132
- const name = meshEdgesVertexAttributeName(id);
133
- const item = meshEdgesVertexAttributeItem(id);
134
- await setMeshEdgesVertexAttributeStoredConfig(id, name, item, {
149
+ const name = meshEdgesVertexAttributeName(meshId);
150
+ const item = meshEdgesVertexAttributeItem(meshId);
151
+ await setMeshEdgesVertexAttributeStoredConfig(meshId, name, item, {
135
152
  minimum,
136
153
  maximum,
137
154
  });
138
- return applyVertexAttribute(id);
155
+ return applyVertexAttribute(meshId);
139
156
  }
140
157
  async function setMeshEdgesVertexAttributeColorMap(
141
- id: string,
142
- colorMap: string | undefined,
158
+ meshId: MeshId,
159
+ colorMap: AttributeColorMap | undefined,
143
160
  ): Promise<unknown> {
144
- const name = meshEdgesVertexAttributeName(id);
145
- const item = meshEdgesVertexAttributeItem(id);
146
- await setMeshEdgesVertexAttributeStoredConfig(id, name, item, {
161
+ const name = meshEdgesVertexAttributeName(meshId);
162
+ const item = meshEdgesVertexAttributeItem(meshId);
163
+ await setMeshEdgesVertexAttributeStoredConfig(meshId, name, item, {
147
164
  colorMap,
148
165
  });
149
- return applyVertexAttribute(id);
166
+ return applyVertexAttribute(meshId);
150
167
  }
151
168
  async function setMeshEdgesVertexAttributeNoDataColor(
152
- id: string,
169
+ meshId: MeshId,
153
170
  no_data_color: RGBAColor,
154
171
  ): Promise<unknown> {
155
- const name = meshEdgesVertexAttributeName(id);
156
- const item = meshEdgesVertexAttributeItem(id);
157
- const storedConfig = meshEdgesVertexAttributeStoredConfig(id, name, item);
158
- await setMeshEdgesVertexAttributeStoredConfig(id, name, item, {
172
+ const name = meshEdgesVertexAttributeName(meshId);
173
+ const item = meshEdgesVertexAttributeItem(meshId);
174
+ const storedConfig = meshEdgesVertexAttributeStoredConfig(meshId, name, item);
175
+ await setMeshEdgesVertexAttributeStoredConfig(meshId, name, item, {
159
176
  ...storedConfig,
160
177
  no_data_color,
161
178
  });
162
- return applyVertexAttribute(id);
179
+ return applyVertexAttribute(meshId);
163
180
  }
164
181
  return {
165
182
  meshEdgesVertexAttributeName,
@@ -179,4 +196,3 @@ function useMeshEdgesVertexAttributeStyle(): UseMeshEdgesVertexAttributeStyleRet
179
196
  };
180
197
  }
181
198
  export { useMeshEdgesVertexAttributeStyle };
182
- export { isMeshEdgesVertexAttributeValid } from "./vertex_attribute";
@@ -1,80 +1,50 @@
1
+ import type {
2
+ AttributeColorMap,
3
+ AttributeItem,
4
+ AttributeName,
5
+ AttributeRange,
6
+ AttributeRangeMaximum,
7
+ AttributeRangeMinimum,
8
+ AttributeTimeStep,
9
+ } from "@ogw_front/types/attribute";
10
+ import type {
11
+ AttributeStoredConfig,
12
+ ValidAttributeInput,
13
+ } from "@ogw_internal/stores/data_style/attribute_types";
14
+ import type { MeshId } from "@ogw_front/types/identifiers";
1
15
  import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
16
 
3
- interface AttributeStoredConfig {
4
- minimum: number | undefined;
5
- maximum: number | undefined;
6
- colorMap: string | undefined;
7
- no_data_color: RGBAColor;
8
- }
9
-
10
- interface AttributeState {
11
- name?: string;
12
- item?: number;
13
- storedConfigs?: Record<string, { lastItem: number } & Record<string, AttributeStoredConfig>>;
14
- }
15
-
16
- interface AttributeInput {
17
- name: string | undefined;
18
- item: number | undefined;
19
- minimum: number | undefined;
20
- maximum: number | undefined;
21
- colorMap: string | undefined;
22
- no_data_color?: RGBAColor;
23
- }
24
-
25
- interface ValidAttributeInput {
26
- name: string;
27
- item: number;
28
- minimum: number;
29
- maximum: number;
30
- colorMap: string;
31
- no_data_color?: RGBAColor;
32
- }
33
-
34
- function isMeshEdgesVertexAttributeValid(input: AttributeInput): input is ValidAttributeInput {
35
- return (
36
- input.name !== undefined &&
37
- input.item !== undefined &&
38
- input.minimum !== undefined &&
39
- input.maximum !== undefined &&
40
- input.colorMap !== undefined
41
- );
42
- }
43
-
44
17
  interface UseMeshEdgesVertexAttributeStyleReturn {
45
- meshEdgesVertexAttributeName: (id: string) => string | undefined;
46
- meshEdgesVertexAttributeItem: (id: string) => number;
47
- meshEdgesVertexAttributeRange: (id: string) => [number | undefined, number | undefined];
48
- meshEdgesVertexAttributeTimeStep: (id: string) => number | undefined;
49
- setMeshEdgesVertexAttributeTimeStep: (id: string, timeStep: number) => Promise<unknown>;
50
- meshEdgesVertexAttributeColorMap: (id: string) => string | undefined;
18
+ meshEdgesVertexAttributeName: (meshId: MeshId) => AttributeName | undefined;
19
+ meshEdgesVertexAttributeItem: (meshId: MeshId) => AttributeItem;
20
+ meshEdgesVertexAttributeRange: (meshId: MeshId) => AttributeRange;
21
+ meshEdgesVertexAttributeTimeStep: (meshId: MeshId) => AttributeTimeStep | undefined;
22
+ setMeshEdgesVertexAttributeTimeStep: (
23
+ meshId: MeshId,
24
+ timeStep: AttributeTimeStep,
25
+ ) => Promise<unknown>;
26
+ meshEdgesVertexAttributeColorMap: (meshId: MeshId) => AttributeColorMap | undefined;
51
27
  meshEdgesVertexAttributeStoredConfig: (
52
- id: string,
53
- name: string | undefined,
54
- item: number | undefined,
28
+ meshId: MeshId,
29
+ name: AttributeName | undefined,
30
+ item: AttributeItem | undefined,
55
31
  ) => AttributeStoredConfig;
56
- setMeshEdgesVertexAttribute: (id: string, input: ValidAttributeInput) => Promise<unknown>;
57
- setMeshEdgesVertexAttributeName: (id: string, name: string) => Promise<unknown>;
58
- setMeshEdgesVertexAttributeItem: (id: string, item: number) => Promise<unknown>;
32
+ setMeshEdgesVertexAttribute: (meshId: MeshId, input: ValidAttributeInput) => Promise<unknown>;
33
+ setMeshEdgesVertexAttributeName: (meshId: MeshId, name: AttributeName) => Promise<unknown>;
34
+ setMeshEdgesVertexAttributeItem: (meshId: MeshId, item: AttributeItem) => Promise<unknown>;
59
35
  setMeshEdgesVertexAttributeRange: (
60
- id: string,
61
- minimum: number,
62
- maximum: number,
36
+ meshId: MeshId,
37
+ minimum: AttributeRangeMinimum,
38
+ maximum: AttributeRangeMaximum,
63
39
  ) => Promise<unknown>;
64
40
  setMeshEdgesVertexAttributeColorMap: (
65
- id: string,
66
- colorMap: string | undefined,
41
+ meshId: MeshId,
42
+ colorMap: AttributeColorMap | undefined,
67
43
  ) => Promise<unknown>;
68
- meshEdgesVertexAttributeNoDataColor: (id: string) => RGBAColor;
44
+ meshEdgesVertexAttributeNoDataColor: (meshId: MeshId) => RGBAColor;
69
45
  setMeshEdgesVertexAttributeNoDataColor: (
70
- id: string,
46
+ meshId: MeshId,
71
47
  no_data_color: RGBAColor,
72
48
  ) => Promise<unknown>;
73
49
  }
74
- export { isMeshEdgesVertexAttributeValid };
75
- export type {
76
- AttributeStoredConfig,
77
- AttributeState,
78
- ValidAttributeInput,
79
- UseMeshEdgesVertexAttributeStyleReturn,
80
- };
50
+ export type { UseMeshEdgesVertexAttributeStyleReturn };