@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,5 +1,23 @@
1
1
  // oxlint-disable eslint/max-lines
2
+ import type {
3
+ AttributeColorMap,
4
+ AttributeItem,
5
+ AttributeName,
6
+ AttributeRange,
7
+ AttributeRangeMaximum,
8
+ AttributeRangeMinimum,
9
+ AttributeTimeStep,
10
+ } from "@ogw_front/types/attribute";
11
+ import type {
12
+ AttributeInput,
13
+ AttributeState,
14
+ AttributeStoredConfig,
15
+ ValidAttributeInput,
16
+ } from "@ogw_internal/stores/data_style/attribute_types";
2
17
  import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
18
+ import type { LineId, ModelId } from "@ogw_front/types/identifiers";
19
+ import { defaultAttributeStoredConfig } from "@ogw_internal/stores/data_style/attribute_default";
20
+ import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
3
21
  // Third party imports
4
22
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
5
23
 
@@ -16,97 +34,59 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
16
34
  // Local constants
17
35
  const attributeSchema = viewer_schemas.opengeodeweb_viewer.model.lines.attribute.vertex.attribute;
18
36
 
19
- interface AttributeStoredConfig {
20
- minimum: number | undefined;
21
- maximum: number | undefined;
22
- colorMap: string | undefined;
23
- no_data_color: RGBAColor;
24
- }
25
-
26
- interface AttributeState {
27
- name?: string;
28
- item?: number;
29
- storedConfigs?: Record<string, { lastItem: number } & Record<string, AttributeStoredConfig>>;
30
- }
31
-
32
- interface AttributeInput {
33
- name: string | undefined;
34
- item: number | undefined;
35
- minimum: number | undefined;
36
- maximum: number | undefined;
37
- colorMap: string | undefined;
38
- no_data_color?: RGBAColor;
39
- }
40
-
41
- interface ValidAttributeInput {
42
- name: string;
43
- item: number;
44
- minimum: number;
45
- maximum: number;
46
- colorMap: string;
47
- no_data_color?: RGBAColor;
48
- }
49
-
50
- function isModelLinesVertexAttributeValid(input: AttributeInput): input is ValidAttributeInput {
51
- return (
52
- input.name !== undefined &&
53
- input.item !== undefined &&
54
- input.minimum !== undefined &&
55
- input.maximum !== undefined &&
56
- input.colorMap !== undefined
57
- );
58
- }
59
-
60
37
  interface UseModelLinesVertexAttributeReturn {
61
- modelLinesVertexAttributeName: (modelId: string, lineId?: string) => string | undefined;
62
- modelLinesVertexAttributeItem: (modelId: string, lineId?: string) => number;
63
- modelLinesVertexAttributeRange: (
64
- modelId: string,
65
- lineId?: string,
66
- ) => [number | undefined, number | undefined];
67
- modelLinesVertexAttributeTimeStep: (modelId: string, lineId?: string) => number | undefined;
38
+ modelLinesVertexAttributeName: (modelId: ModelId, lineId?: LineId) => AttributeName | undefined;
39
+ modelLinesVertexAttributeItem: (modelId: ModelId, lineId?: LineId) => AttributeItem;
40
+ modelLinesVertexAttributeRange: (modelId: ModelId, lineId?: LineId) => AttributeRange;
41
+ modelLinesVertexAttributeTimeStep: (
42
+ modelId: ModelId,
43
+ lineId?: LineId,
44
+ ) => AttributeTimeStep | undefined;
68
45
  setModelLinesVertexAttributeTimeStep: (
69
- modelId: string,
70
- lineIds: string[],
71
- timeStep: number,
46
+ modelId: ModelId,
47
+ lineIds: LineId[],
48
+ timeStep: AttributeTimeStep,
72
49
  ) => Promise<void>;
73
- modelLinesVertexAttributeColorMap: (modelId: string, lineId?: string) => string | undefined;
50
+ modelLinesVertexAttributeColorMap: (
51
+ modelId: ModelId,
52
+ lineId?: LineId,
53
+ ) => AttributeColorMap | undefined;
74
54
  modelLinesVertexAttributeStoredConfig: (
75
- modelId: string,
76
- lineId: string | undefined,
77
- name: string | undefined,
78
- item: number | undefined,
55
+ modelId: ModelId,
56
+ lineId: LineId | undefined,
57
+ name: AttributeName | undefined,
58
+ item: AttributeItem | undefined,
79
59
  ) => AttributeStoredConfig;
80
60
  setModelLinesVertexAttribute: (
81
- modelId: string,
82
- lineIds: string[],
61
+ modelId: ModelId,
62
+ lineIds: LineId[],
83
63
  input: ValidAttributeInput,
84
64
  ) => Promise<unknown>;
85
65
  setModelLinesVertexAttributeName: (
86
- modelId: string,
87
- lineIds: string[],
88
- name: string,
66
+ modelId: ModelId,
67
+ lineIds: LineId[],
68
+ name: AttributeName,
89
69
  ) => Promise<unknown>;
90
70
  setModelLinesVertexAttributeItem: (
91
- modelId: string,
92
- lineIds: string[],
93
- item: number,
71
+ modelId: ModelId,
72
+ lineIds: LineId[],
73
+ item: AttributeItem,
94
74
  ) => Promise<unknown>;
95
75
  setModelLinesVertexAttributeRange: (
96
- modelId: string,
97
- lineIds: string[],
98
- minimum: number,
99
- maximum: number,
76
+ modelId: ModelId,
77
+ lineIds: LineId[],
78
+ minimum: AttributeRangeMinimum,
79
+ maximum: AttributeRangeMaximum,
100
80
  ) => Promise<unknown>;
101
81
  setModelLinesVertexAttributeColorMap: (
102
- modelId: string,
103
- lineIds: string[],
104
- colorMap: string | undefined,
82
+ modelId: ModelId,
83
+ lineIds: LineId[],
84
+ colorMap: AttributeColorMap | undefined,
105
85
  ) => Promise<unknown>;
106
- modelLinesVertexAttributeNoDataColor: (modelId: string, lineId?: string) => RGBAColor;
86
+ modelLinesVertexAttributeNoDataColor: (modelId: ModelId, lineId?: LineId) => RGBAColor;
107
87
  setModelLinesVertexAttributeNoDataColor: (
108
- modelId: string,
109
- lineIds: string[],
88
+ modelId: ModelId,
89
+ lineIds: LineId[],
110
90
  no_data_color: RGBAColor,
111
91
  ) => Promise<unknown>;
112
92
  }
@@ -122,9 +102,9 @@ type ModelLinesVertexAttributeGetters = Pick<
122
102
  | "modelLinesVertexAttributeTimeStep"
123
103
  > & {
124
104
  modelLinesVertexAttributeLastItem: (
125
- modelId: string,
105
+ modelId: ModelId,
126
106
  componentId: string | undefined,
127
- name: string | undefined,
107
+ name: AttributeName | undefined,
128
108
  ) => number;
129
109
  };
130
110
 
@@ -133,15 +113,15 @@ function useModelLinesVertexAttributeGetters(
133
113
  modelLinesCommonStyle: ReturnType<typeof useModelLinesCommonStyle>,
134
114
  ): ModelLinesVertexAttributeGetters {
135
115
  const { attributeTimeStep } = useAttributeTimeStepStyle();
136
- function modelLinesVertexAttribute(modelId: string, lineId?: string): AttributeState {
116
+ function modelLinesVertexAttribute(modelId: ModelId, lineId?: LineId): AttributeState {
137
117
  // oxlint-disable-next-line no-unsafe-type-assertion -- coloring.vertex shape is defined by the data style schema.
138
118
  return modelLinesCommonStyle.modelLineColoring(modelId, lineId).vertex as AttributeState;
139
119
  }
140
120
  function modelLinesVertexAttributeStoredConfig(
141
- modelId: string,
142
- lineId: string | undefined,
143
- name: string | undefined,
144
- item: number | undefined,
121
+ modelId: ModelId,
122
+ lineId: LineId | undefined,
123
+ name: AttributeName | undefined,
124
+ item: AttributeItem | undefined,
145
125
  ): AttributeStoredConfig {
146
126
  const { storedConfigs } = modelLinesVertexAttribute(modelId, lineId);
147
127
  const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
@@ -149,20 +129,18 @@ function useModelLinesVertexAttributeGetters(
149
129
  if (itemConfig !== undefined) {
150
130
  return itemConfig;
151
131
  }
152
- return {
153
- minimum: undefined,
154
- maximum: undefined,
155
- colorMap: undefined,
156
- no_data_color: DEFAULT_NO_DATA_COLOR,
157
- };
132
+ return defaultAttributeStoredConfig();
158
133
  }
159
- function modelLinesVertexAttributeName(modelId: string, lineId?: string): string | undefined {
134
+ function modelLinesVertexAttributeName(
135
+ modelId: ModelId,
136
+ lineId?: LineId,
137
+ ): AttributeName | undefined {
160
138
  return modelLinesVertexAttribute(modelId, lineId).name;
161
139
  }
162
140
  function modelLinesVertexAttributeLastItem(
163
- modelId: string,
164
- lineId: string | undefined,
165
- name: string | undefined,
141
+ modelId: ModelId,
142
+ lineId: LineId | undefined,
143
+ name: AttributeName | undefined,
166
144
  ): number {
167
145
  const { storedConfigs } = modelLinesVertexAttribute(modelId, lineId);
168
146
  const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
@@ -171,36 +149,39 @@ function useModelLinesVertexAttributeGetters(
171
149
  }
172
150
  return 0;
173
151
  }
174
- function modelLinesVertexAttributeItem(modelId: string, lineId?: string): number {
152
+ function modelLinesVertexAttributeItem(modelId: ModelId, lineId?: LineId): AttributeItem {
175
153
  const vertexAttribute = modelLinesVertexAttribute(modelId, lineId);
176
154
  return (
177
155
  vertexAttribute.item ??
178
156
  modelLinesVertexAttributeLastItem(modelId, lineId, vertexAttribute.name)
179
157
  );
180
158
  }
181
- function modelLinesVertexAttributeRange(
182
- modelId: string,
183
- lineId?: string,
184
- ): [number | undefined, number | undefined] {
159
+ function modelLinesVertexAttributeRange(modelId: ModelId, lineId?: LineId): AttributeRange {
185
160
  const name = modelLinesVertexAttributeName(modelId, lineId);
186
161
  const item = modelLinesVertexAttributeItem(modelId, lineId);
187
162
  const storedConfig = modelLinesVertexAttributeStoredConfig(modelId, lineId, name, item);
188
163
  const { minimum, maximum } = storedConfig;
189
164
  return [minimum, maximum];
190
165
  }
191
- function modelLinesVertexAttributeColorMap(modelId: string, lineId?: string): string | undefined {
166
+ function modelLinesVertexAttributeColorMap(
167
+ modelId: ModelId,
168
+ lineId?: LineId,
169
+ ): AttributeColorMap | undefined {
192
170
  const name = modelLinesVertexAttributeName(modelId, lineId);
193
171
  const item = modelLinesVertexAttributeItem(modelId, lineId);
194
172
  const storedConfig = modelLinesVertexAttributeStoredConfig(modelId, lineId, name, item);
195
173
  return storedConfig.colorMap;
196
174
  }
197
- function modelLinesVertexAttributeNoDataColor(modelId: string, lineId?: string): RGBAColor {
175
+ function modelLinesVertexAttributeNoDataColor(modelId: ModelId, lineId?: LineId): RGBAColor {
198
176
  const name = modelLinesVertexAttributeName(modelId, lineId);
199
177
  const item = modelLinesVertexAttributeItem(modelId, lineId);
200
178
  const storedConfig = modelLinesVertexAttributeStoredConfig(modelId, lineId, name, item);
201
179
  return storedConfig.no_data_color;
202
180
  }
203
- function modelLinesVertexAttributeTimeStep(modelId: string, lineId?: string): number | undefined {
181
+ function modelLinesVertexAttributeTimeStep(
182
+ modelId: ModelId,
183
+ lineId?: LineId,
184
+ ): AttributeTimeStep | undefined {
204
185
  return attributeTimeStep(
205
186
  modelId,
206
187
  attributeSchema.$id,
@@ -236,8 +217,8 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
236
217
  } = useModelLinesVertexAttributeGetters(modelLinesCommonStyle);
237
218
  const viewerStore = useViewerStore();
238
219
  async function mutateModelLinesVertexStyle(
239
- modelId: string,
240
- lineIds: string[],
220
+ modelId: ModelId,
221
+ lineIds: LineId[],
241
222
  values: Record<string, unknown>,
242
223
  ): Promise<void> {
243
224
  const tasks: Promise<void>[] = [
@@ -256,10 +237,10 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
256
237
  await Promise.all(tasks);
257
238
  }
258
239
  async function setModelLinesVertexAttributeStoredConfig(
259
- modelId: string,
260
- lineIds: string[],
261
- name: string | undefined,
262
- item: number | undefined,
240
+ modelId: ModelId,
241
+ lineIds: LineId[],
242
+ name: AttributeName | undefined,
243
+ item: AttributeItem | undefined,
263
244
  config: Partial<AttributeStoredConfig>,
264
245
  ): Promise<void> {
265
246
  if (name === undefined || item === undefined) {
@@ -275,8 +256,8 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
275
256
  });
276
257
  }
277
258
  async function setModelLinesVertexAttribute(
278
- modelId: string,
279
- lineIds: string[],
259
+ modelId: ModelId,
260
+ lineIds: LineId[],
280
261
  {
281
262
  name,
282
263
  item,
@@ -313,7 +294,7 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
313
294
  params,
314
295
  });
315
296
  }
316
- async function applyVertexAttribute(modelId: string, lineIds: string[]): Promise<void> {
297
+ async function applyVertexAttribute(modelId: ModelId, lineIds: LineId[]): Promise<void> {
317
298
  const name = modelLinesVertexAttributeName(modelId, lineIds[0]);
318
299
  const item = modelLinesVertexAttributeItem(modelId, lineIds[0]);
319
300
  const storedConfig = modelLinesVertexAttributeStoredConfig(modelId, lineIds[0], name, item);
@@ -325,14 +306,14 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
325
306
  colorMap: storedConfig.colorMap,
326
307
  no_data_color: storedConfig.no_data_color,
327
308
  };
328
- if (isModelLinesVertexAttributeValid(attribute)) {
309
+ if (isAttributeValid(attribute)) {
329
310
  await setModelLinesVertexAttribute(modelId, lineIds, attribute);
330
311
  }
331
312
  }
332
313
  async function setModelLinesVertexAttributeName(
333
- modelId: string,
334
- lineIds: string[],
335
- name: string,
314
+ modelId: ModelId,
315
+ lineIds: LineId[],
316
+ name: AttributeName,
336
317
  ): Promise<unknown> {
337
318
  const item = modelLinesVertexAttributeLastItem(modelId, lineIds[0], name);
338
319
  await mutateModelLinesVertexStyle(modelId, lineIds, {
@@ -342,9 +323,9 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
342
323
  return applyVertexAttribute(modelId, lineIds);
343
324
  }
344
325
  async function setModelLinesVertexAttributeItem(
345
- modelId: string,
346
- lineIds: string[],
347
- item: number,
326
+ modelId: ModelId,
327
+ lineIds: LineId[],
328
+ item: AttributeItem,
348
329
  ): Promise<unknown> {
349
330
  await mutateModelLinesVertexStyle(modelId, lineIds, {
350
331
  item,
@@ -352,9 +333,9 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
352
333
  return applyVertexAttribute(modelId, lineIds);
353
334
  }
354
335
  async function setModelLinesVertexAttributeTimeStep(
355
- modelId: string,
356
- lineIds: string[],
357
- timeStep: number,
336
+ modelId: ModelId,
337
+ lineIds: LineId[],
338
+ timeStep: AttributeTimeStep,
358
339
  ): Promise<void> {
359
340
  const name = modelLinesVertexAttributeName(modelId, lineIds[0]);
360
341
  if (name === undefined) {
@@ -387,10 +368,10 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
387
368
  ]);
388
369
  }
389
370
  async function setModelLinesVertexAttributeRange(
390
- modelId: string,
391
- lineIds: string[],
392
- minimum: number,
393
- maximum: number,
371
+ modelId: ModelId,
372
+ lineIds: LineId[],
373
+ minimum: AttributeRangeMinimum,
374
+ maximum: AttributeRangeMaximum,
394
375
  ): Promise<unknown> {
395
376
  const name = modelLinesVertexAttributeName(modelId, lineIds[0]);
396
377
  const item = modelLinesVertexAttributeItem(modelId, lineIds[0]);
@@ -401,9 +382,9 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
401
382
  return applyVertexAttribute(modelId, lineIds);
402
383
  }
403
384
  async function setModelLinesVertexAttributeColorMap(
404
- modelId: string,
405
- lineIds: string[],
406
- colorMap: string | undefined,
385
+ modelId: ModelId,
386
+ lineIds: LineId[],
387
+ colorMap: AttributeColorMap | undefined,
407
388
  ): Promise<unknown> {
408
389
  const name = modelLinesVertexAttributeName(modelId, lineIds[0]);
409
390
  const item = modelLinesVertexAttributeItem(modelId, lineIds[0]);
@@ -413,8 +394,8 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
413
394
  return applyVertexAttribute(modelId, lineIds);
414
395
  }
415
396
  async function setModelLinesVertexAttributeNoDataColor(
416
- modelId: string,
417
- lineIds: string[],
397
+ modelId: ModelId,
398
+ lineIds: LineId[],
418
399
  no_data_color: RGBAColor,
419
400
  ): Promise<unknown> {
420
401
  const name = modelLinesVertexAttributeName(modelId, lineIds[0]);
@@ -443,4 +424,4 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
443
424
  setModelLinesVertexAttributeNoDataColor,
444
425
  };
445
426
  }
446
- export { isModelLinesVertexAttributeValid, useModelLinesVertexAttribute };
427
+ export { useModelLinesVertexAttribute };
@@ -1,3 +1,5 @@
1
+ import type { LineId, ModelId } from "@ogw_front/types/identifiers";
2
+ import type { Visibility } from "@ogw_front/types/style";
1
3
  import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
2
4
  import { useModelLinesCommonStyle } from "./common";
3
5
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
@@ -6,23 +8,23 @@ const schema = viewer_schemas.opengeodeweb_viewer.model.lines.visibility;
6
8
 
7
9
  export function useModelLinesVisibility(): {
8
10
  setModelLinesVisibility: (
9
- modelId: string,
10
- lines_ids: string[],
11
- visibility: boolean,
11
+ modelId: ModelId,
12
+ lines_ids: LineId[],
13
+ visibility: Visibility,
12
14
  ) => Promise<unknown>;
13
- modelLineVisibility: (id: string, line_id?: string) => unknown;
15
+ modelLineVisibility: (modelId: ModelId, line_id?: LineId) => unknown;
14
16
  } {
15
17
  const modelCommonStyle = useModelCommonStyle();
16
18
  const modelLinesCommonStyle = useModelLinesCommonStyle();
17
19
 
18
- function modelLineVisibility(id: string, line_id?: string): unknown {
19
- return modelLinesCommonStyle.modelLineStyle(id, line_id).visibility;
20
+ function modelLineVisibility(modelId: ModelId, line_id?: LineId): unknown {
21
+ return modelLinesCommonStyle.modelLineStyle(modelId, line_id).visibility;
20
22
  }
21
23
 
22
24
  async function setModelLinesVisibility(
23
- modelId: string,
24
- lines_ids: string[],
25
- visibility: boolean,
25
+ modelId: ModelId,
26
+ lines_ids: LineId[],
27
+ visibility: Visibility,
26
28
  ): Promise<unknown> {
27
29
  const result = await modelCommonStyle.setModelTypeVisibility(
28
30
  modelId,
@@ -1,21 +1,22 @@
1
+ import type { ModelId } from "@ogw_front/types/identifiers";
1
2
  import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
2
3
  import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
3
4
 
4
5
  export function useModelPointsCommonStyle(): {
5
- modelPointsStyle: (id: string) => StyleValues;
6
- mutateModelPointsStyle: (id: string, values: StyleValues) => Promise<unknown>;
6
+ modelPointsStyle: (modelId: ModelId) => StyleValues;
7
+ mutateModelPointsStyle: (modelId: ModelId, values: StyleValues) => Promise<unknown>;
7
8
  } {
8
9
  const dataStyleState = useDataStyleState();
9
10
 
10
- async function mutateModelPointsStyle(id: string, values: StyleValues): Promise<unknown> {
11
- const result = await dataStyleState.mutateStyle(id, {
11
+ async function mutateModelPointsStyle(modelId: ModelId, values: StyleValues): Promise<unknown> {
12
+ const result = await dataStyleState.mutateStyle(modelId, {
12
13
  points: values,
13
14
  });
14
15
  return result;
15
16
  }
16
17
 
17
- function modelPointsStyle(id: string): StyleValues {
18
- return dataStyleState.getStyle(id).points ?? {};
18
+ function modelPointsStyle(modelId: ModelId): StyleValues {
19
+ return dataStyleState.getStyle(modelId).points ?? {};
19
20
  }
20
21
 
21
22
  return {