@geode/opengeodeweb-front 10.38.0 → 10.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/app/components/ThresholdFilter.vue +33 -5
  2. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +28 -0
  3. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +28 -0
  4. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +28 -0
  5. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +14 -0
  6. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +28 -0
  7. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +30 -0
  8. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +53 -0
  9. package/app/components/Viewer/Generic/Model/CornersOptions.vue +24 -0
  10. package/app/components/Viewer/Generic/Model/LinesOptions.vue +48 -0
  11. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +58 -0
  12. package/app/components/Viewer/Options/AttributeSelector.vue +25 -0
  13. package/app/components/Viewer/Options/ColoringTypeSelector.vue +10 -0
  14. package/app/components/Viewer/Options/ColormapQuickPicker.vue +17 -2
  15. package/app/components/Viewer/Options/TimeStepSlider.vue +120 -0
  16. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +14 -0
  17. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +30 -0
  18. package/app/components/Viewer/Surface/PolygonsOptions.vue +28 -0
  19. package/app/composables/global_attribute_style.ts +94 -0
  20. package/app/stores/data_style.ts +3 -0
  21. package/app/utils/attributes.ts +46 -9
  22. package/internal/stores/data_style/mesh/cells/cell.ts +20 -1
  23. package/internal/stores/data_style/mesh/cells/index.ts +4 -2
  24. package/internal/stores/data_style/mesh/cells/vertex.ts +23 -1
  25. package/internal/stores/data_style/mesh/edges/edge.ts +20 -1
  26. package/internal/stores/data_style/mesh/edges/index.ts +4 -2
  27. package/internal/stores/data_style/mesh/edges/vertex.ts +23 -1
  28. package/internal/stores/data_style/mesh/index.ts +68 -0
  29. package/internal/stores/data_style/mesh/points/index.ts +2 -1
  30. package/internal/stores/data_style/mesh/points/vertex.ts +23 -1
  31. package/internal/stores/data_style/mesh/polygons/index.ts +11 -2
  32. package/internal/stores/data_style/mesh/polygons/polygon.ts +23 -1
  33. package/internal/stores/data_style/mesh/polygons/vertex.ts +23 -1
  34. package/internal/stores/data_style/mesh/polyhedra/index.ts +11 -2
  35. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +27 -1
  36. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +23 -1
  37. package/internal/stores/data_style/model/blocks/color.ts +11 -2
  38. package/internal/stores/data_style/model/blocks/index.ts +36 -6
  39. package/internal/stores/data_style/model/blocks/polyhedron.ts +61 -7
  40. package/internal/stores/data_style/model/blocks/vertex.ts +61 -7
  41. package/internal/stores/data_style/model/corners/color.ts +5 -1
  42. package/internal/stores/data_style/model/corners/index.ts +18 -3
  43. package/internal/stores/data_style/model/corners/vertex.ts +68 -8
  44. package/internal/stores/data_style/model/lines/color.ts +10 -2
  45. package/internal/stores/data_style/model/lines/edge.ts +58 -7
  46. package/internal/stores/data_style/model/lines/index.ts +35 -6
  47. package/internal/stores/data_style/model/lines/vertex.ts +58 -7
  48. package/internal/stores/data_style/model/surfaces/color.ts +10 -2
  49. package/internal/stores/data_style/model/surfaces/index.ts +53 -6
  50. package/internal/stores/data_style/model/surfaces/polygon.ts +76 -15
  51. package/internal/stores/data_style/model/surfaces/vertex.ts +70 -12
  52. package/internal/stores/data_style/time_step.ts +75 -0
  53. package/internal/stores/data_style/types.ts +1 -0
  54. package/package.json +1 -1
@@ -1,13 +1,16 @@
1
1
  import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
2
  // Third party imports
3
+ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
3
4
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
4
5
 
5
6
  // Local imports
6
7
  import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
8
+ import { useAttributeTimeStepStyle } from "@ogw_internal/stores/data_style/time_step";
7
9
  import { useMeshPolygonsCommonStyle } from "./common";
8
10
  import { useViewerStore } from "@ogw_front/stores/viewer";
9
11
 
10
12
  // Local constants
13
+ const attributeNamesSchema = back_schemas.opengeodeweb_back.polygon_attribute_names;
11
14
  const meshPolygonsPolygonAttributeSchemas =
12
15
  viewer_schemas.opengeodeweb_viewer.mesh.polygons.attribute.polygon;
13
16
 
@@ -57,6 +60,8 @@ function useMeshPolygonsPolygonAttributeStyle(): {
57
60
  meshPolygonsPolygonAttributeName: (id: string) => string | undefined;
58
61
  meshPolygonsPolygonAttributeItem: (id: string) => number;
59
62
  meshPolygonsPolygonAttributeRange: (id: string) => [number | undefined, number | undefined];
63
+ meshPolygonsPolygonAttributeTimeStep: (id: string) => number | undefined;
64
+ setMeshPolygonsPolygonAttributeTimeStep: (id: string, timeStep: number) => Promise<unknown>;
60
65
  meshPolygonsPolygonAttributeColorMap: (id: string) => string | undefined;
61
66
  meshPolygonsPolygonAttributeStoredConfig: (
62
67
  id: string,
@@ -81,6 +86,7 @@ function useMeshPolygonsPolygonAttributeStyle(): {
81
86
  no_data_color: RGBAColor,
82
87
  ) => Promise<unknown>;
83
88
  } {
89
+ const { attributeTimeStep, setAttributeTimeStep, seriesArrayName } = useAttributeTimeStepStyle();
84
90
  const viewerStore = useViewerStore();
85
91
  const meshPolygonsCommonStyle = useMeshPolygonsCommonStyle();
86
92
  function meshPolygonsPolygonAttribute(id: string): AttributeState {
@@ -143,6 +149,9 @@ function useMeshPolygonsPolygonAttributeStyle(): {
143
149
  const { item, name } = meshPolygonsPolygonAttribute(id);
144
150
  return item ?? meshPolygonsPolygonAttributeLastItem(id, name);
145
151
  }
152
+ function meshPolygonsPolygonAttributeTimeStep(id: string): number | undefined {
153
+ return attributeTimeStep(id, attributeNamesSchema.$id, meshPolygonsPolygonAttribute(id).name);
154
+ }
146
155
  async function setMeshPolygonsPolygonAttribute(
147
156
  id: string,
148
157
  {
@@ -168,7 +177,7 @@ function useMeshPolygonsPolygonAttributeStyle(): {
168
177
  const schema = meshPolygonsPolygonAttributeSchemas.attribute;
169
178
  const params = {
170
179
  id,
171
- name,
180
+ name: seriesArrayName(id, attributeNamesSchema.$id, name),
172
181
  item,
173
182
  points,
174
183
  minimum,
@@ -218,6 +227,17 @@ function useMeshPolygonsPolygonAttributeStyle(): {
218
227
  const storedConfig = meshPolygonsPolygonAttributeStoredConfig(id, name, item);
219
228
  return [storedConfig.minimum, storedConfig.maximum];
220
229
  }
230
+ async function setMeshPolygonsPolygonAttributeTimeStep(
231
+ id: string,
232
+ timeStep: number,
233
+ ): Promise<unknown> {
234
+ const name = meshPolygonsPolygonAttributeName(id);
235
+ if (name === undefined) {
236
+ return undefined;
237
+ }
238
+ await setAttributeTimeStep(id, attributeNamesSchema.$id, name, timeStep);
239
+ return applyPolygonAttribute(id);
240
+ }
221
241
  async function setMeshPolygonsPolygonAttributeRange(
222
242
  id: string,
223
243
  minimum: number,
@@ -269,6 +289,8 @@ function useMeshPolygonsPolygonAttributeStyle(): {
269
289
  }
270
290
  return {
271
291
  meshPolygonsPolygonAttributeName,
292
+ meshPolygonsPolygonAttributeTimeStep,
293
+ setMeshPolygonsPolygonAttributeTimeStep,
272
294
  meshPolygonsPolygonAttributeItem,
273
295
  meshPolygonsPolygonAttributeRange,
274
296
  meshPolygonsPolygonAttributeColorMap,
@@ -1,13 +1,16 @@
1
1
  import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
2
  // Third party imports
3
+ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
3
4
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
4
5
 
5
6
  // Local imports
6
7
  import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
8
+ import { useAttributeTimeStepStyle } from "@ogw_internal/stores/data_style/time_step";
7
9
  import { useMeshPolygonsCommonStyle } from "./common";
8
10
  import { useViewerStore } from "@ogw_front/stores/viewer";
9
11
 
10
12
  // Local constants
13
+ const attributeNamesSchema = back_schemas.opengeodeweb_back.vertex_attribute_names;
11
14
  const meshPolygonsVertexAttributeSchemas =
12
15
  viewer_schemas.opengeodeweb_viewer.mesh.polygons.attribute.vertex;
13
16
 
@@ -56,6 +59,8 @@ interface UseMeshPolygonsVertexAttributeStyleReturn {
56
59
  meshPolygonsVertexAttributeName: (id: string) => string | undefined;
57
60
  meshPolygonsVertexAttributeItem: (id: string) => number;
58
61
  meshPolygonsVertexAttributeRange: (id: string) => [number | undefined, number | undefined];
62
+ meshPolygonsVertexAttributeTimeStep: (id: string) => number | undefined;
63
+ setMeshPolygonsVertexAttributeTimeStep: (id: string, timeStep: number) => Promise<unknown>;
59
64
  meshPolygonsVertexAttributeColorMap: (id: string) => string | undefined;
60
65
  meshPolygonsVertexAttributeStoredConfig: (
61
66
  id: string,
@@ -83,6 +88,7 @@ interface UseMeshPolygonsVertexAttributeStyleReturn {
83
88
 
84
89
  // oxlint-disable-next-line max-lines-per-function
85
90
  function useMeshPolygonsVertexAttributeStyle(): UseMeshPolygonsVertexAttributeStyleReturn {
91
+ const { attributeTimeStep, setAttributeTimeStep, seriesArrayName } = useAttributeTimeStepStyle();
86
92
  const viewerStore = useViewerStore();
87
93
  const meshPolygonsCommonStyle = useMeshPolygonsCommonStyle();
88
94
  function meshPolygonsVertexAttribute(id: string): AttributeState {
@@ -149,6 +155,9 @@ function useMeshPolygonsVertexAttributeStyle(): UseMeshPolygonsVertexAttributeSt
149
155
  const { item, name } = meshPolygonsVertexAttribute(id);
150
156
  return item ?? meshPolygonsVertexAttributeLastItem(id, name);
151
157
  }
158
+ function meshPolygonsVertexAttributeTimeStep(id: string): number | undefined {
159
+ return attributeTimeStep(id, attributeNamesSchema.$id, meshPolygonsVertexAttribute(id).name);
160
+ }
152
161
  async function setMeshPolygonsVertexAttribute(
153
162
  id: string,
154
163
  {
@@ -174,7 +183,7 @@ function useMeshPolygonsVertexAttributeStyle(): UseMeshPolygonsVertexAttributeSt
174
183
  const schema = meshPolygonsVertexAttributeSchemas.attribute;
175
184
  const params = {
176
185
  id,
177
- name,
186
+ name: seriesArrayName(id, attributeNamesSchema.$id, name),
178
187
  item,
179
188
  points,
180
189
  minimum,
@@ -224,6 +233,17 @@ function useMeshPolygonsVertexAttributeStyle(): UseMeshPolygonsVertexAttributeSt
224
233
  const storedConfig = meshPolygonsVertexAttributeStoredConfig(id, name, item);
225
234
  return [storedConfig.minimum, storedConfig.maximum];
226
235
  }
236
+ async function setMeshPolygonsVertexAttributeTimeStep(
237
+ id: string,
238
+ timeStep: number,
239
+ ): Promise<unknown> {
240
+ const name = meshPolygonsVertexAttributeName(id);
241
+ if (name === undefined) {
242
+ return undefined;
243
+ }
244
+ await setAttributeTimeStep(id, attributeNamesSchema.$id, name, timeStep);
245
+ return applyVertexAttribute(id);
246
+ }
227
247
  async function setMeshPolygonsVertexAttributeRange(
228
248
  id: string,
229
249
  minimum: number,
@@ -275,6 +295,8 @@ function useMeshPolygonsVertexAttributeStyle(): UseMeshPolygonsVertexAttributeSt
275
295
  }
276
296
  return {
277
297
  meshPolygonsVertexAttributeName,
298
+ meshPolygonsVertexAttributeTimeStep,
299
+ setMeshPolygonsVertexAttributeTimeStep,
278
300
  meshPolygonsVertexAttributeItem,
279
301
  meshPolygonsVertexAttributeRange,
280
302
  meshPolygonsVertexAttributeColorMap,
@@ -32,7 +32,8 @@ function handleMeshPolyhedraVertexColoring(
32
32
  const item = vertexAttributeStyle.meshPolyhedraVertexAttributeItem(id);
33
33
  const [minimum, maximum] = vertexAttributeStyle.meshPolyhedraVertexAttributeRange(id);
34
34
  const colorMap = vertexAttributeStyle.meshPolyhedraVertexAttributeColorMap(id);
35
- const vertex_attribute = { name, item, minimum, maximum, colorMap };
35
+ const no_data_color = vertexAttributeStyle.meshPolyhedraVertexAttributeNoDataColor(id);
36
+ const vertex_attribute = { name, item, minimum, maximum, colorMap, no_data_color };
36
37
  if (!isMeshPolyhedraVertexAttributeValid(vertex_attribute)) {
37
38
  return undefined;
38
39
  }
@@ -47,7 +48,15 @@ function handleMeshPolyhedraPolyhedronColoring(
47
48
  const item = polyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeItem(id);
48
49
  const [minimum, maximum] = polyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeRange(id);
49
50
  const colorMap = polyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeColorMap(id);
50
- const polyhedron_attribute = { name, item, minimum, maximum, colorMap };
51
+ const no_data_color = polyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeNoDataColor(id);
52
+ const polyhedron_attribute = {
53
+ name,
54
+ item,
55
+ minimum,
56
+ maximum,
57
+ colorMap,
58
+ no_data_color,
59
+ };
51
60
  if (!isMeshPolyhedraPolyhedronAttributeValid(polyhedron_attribute)) {
52
61
  return undefined;
53
62
  }
@@ -1,13 +1,16 @@
1
1
  import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
2
  // Third party imports
3
+ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
3
4
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
4
5
 
5
6
  // Local imports
6
7
  import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
8
+ import { useAttributeTimeStepStyle } from "@ogw_internal/stores/data_style/time_step";
7
9
  import { useMeshPolyhedraCommonStyle } from "./common";
8
10
  import { useViewerStore } from "@ogw_front/stores/viewer";
9
11
 
10
12
  // Local constants
13
+ const attributeNamesSchema = back_schemas.opengeodeweb_back.polyhedron_attribute_names;
11
14
  const meshPolyhedraPolyhedronAttributeSchemas =
12
15
  viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.attribute.polyhedron;
13
16
 
@@ -59,6 +62,8 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): {
59
62
  meshPolyhedraPolyhedronAttributeName: (id: string) => string | undefined;
60
63
  meshPolyhedraPolyhedronAttributeItem: (id: string) => number;
61
64
  meshPolyhedraPolyhedronAttributeRange: (id: string) => [number | undefined, number | undefined];
65
+ meshPolyhedraPolyhedronAttributeTimeStep: (id: string) => number | undefined;
66
+ setMeshPolyhedraPolyhedronAttributeTimeStep: (id: string, timeStep: number) => Promise<unknown>;
62
67
  meshPolyhedraPolyhedronAttributeColorMap: (id: string) => string | undefined;
63
68
  meshPolyhedraPolyhedronAttributeStoredConfig: (
64
69
  id: string,
@@ -83,6 +88,7 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): {
83
88
  no_data_color: RGBAColor,
84
89
  ) => Promise<unknown>;
85
90
  } {
91
+ const { attributeTimeStep, setAttributeTimeStep, seriesArrayName } = useAttributeTimeStepStyle();
86
92
  const viewerStore = useViewerStore();
87
93
  const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
88
94
  function meshPolyhedraPolyhedronAttribute(id: string): AttributeState {
@@ -149,6 +155,13 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): {
149
155
  const { item, name } = meshPolyhedraPolyhedronAttribute(id);
150
156
  return item ?? meshPolyhedraPolyhedronAttributeLastItem(id, name);
151
157
  }
158
+ function meshPolyhedraPolyhedronAttributeTimeStep(id: string): number | undefined {
159
+ return attributeTimeStep(
160
+ id,
161
+ attributeNamesSchema.$id,
162
+ meshPolyhedraPolyhedronAttribute(id).name,
163
+ );
164
+ }
152
165
  async function setMeshPolyhedraPolyhedronAttribute(
153
166
  id: string,
154
167
  {
@@ -174,7 +187,7 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): {
174
187
  const schema = meshPolyhedraPolyhedronAttributeSchemas.attribute;
175
188
  const params = {
176
189
  id,
177
- name,
190
+ name: seriesArrayName(id, attributeNamesSchema.$id, name),
178
191
  item,
179
192
  points,
180
193
  minimum,
@@ -232,6 +245,17 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): {
232
245
  const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(id, name, item);
233
246
  return [storedConfig.minimum, storedConfig.maximum];
234
247
  }
248
+ async function setMeshPolyhedraPolyhedronAttributeTimeStep(
249
+ id: string,
250
+ timeStep: number,
251
+ ): Promise<unknown> {
252
+ const name = meshPolyhedraPolyhedronAttributeName(id);
253
+ if (name === undefined) {
254
+ return undefined;
255
+ }
256
+ await setAttributeTimeStep(id, attributeNamesSchema.$id, name, timeStep);
257
+ return applyPolyhedronAttribute(id);
258
+ }
235
259
  async function setMeshPolyhedraPolyhedronAttributeRange(
236
260
  id: string,
237
261
  minimum: number,
@@ -283,6 +307,8 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): {
283
307
  }
284
308
  return {
285
309
  meshPolyhedraPolyhedronAttributeName,
310
+ meshPolyhedraPolyhedronAttributeTimeStep,
311
+ setMeshPolyhedraPolyhedronAttributeTimeStep,
286
312
  meshPolyhedraPolyhedronAttributeItem,
287
313
  meshPolyhedraPolyhedronAttributeRange,
288
314
  meshPolyhedraPolyhedronAttributeColorMap,
@@ -1,13 +1,16 @@
1
1
  import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
2
2
  // Third party imports
3
+ import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
3
4
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
4
5
 
5
6
  // Local imports
6
7
  import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
8
+ import { useAttributeTimeStepStyle } from "@ogw_internal/stores/data_style/time_step";
7
9
  import { useMeshPolyhedraCommonStyle } from "./common";
8
10
  import { useViewerStore } from "@ogw_front/stores/viewer";
9
11
 
10
12
  // Local constants
13
+ const attributeNamesSchema = back_schemas.opengeodeweb_back.vertex_attribute_names;
11
14
  const meshPolyhedraVertexAttributeSchemas =
12
15
  viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.attribute.vertex;
13
16
 
@@ -56,6 +59,8 @@ interface UseMeshPolyhedraVertexAttributeStyleReturn {
56
59
  meshPolyhedraVertexAttributeName: (id: string) => string | undefined;
57
60
  meshPolyhedraVertexAttributeItem: (id: string) => number;
58
61
  meshPolyhedraVertexAttributeRange: (id: string) => [number | undefined, number | undefined];
62
+ meshPolyhedraVertexAttributeTimeStep: (id: string) => number | undefined;
63
+ setMeshPolyhedraVertexAttributeTimeStep: (id: string, timeStep: number) => Promise<unknown>;
59
64
  meshPolyhedraVertexAttributeColorMap: (id: string) => string | undefined;
60
65
  meshPolyhedraVertexAttributeStoredConfig: (
61
66
  id: string,
@@ -83,6 +88,7 @@ interface UseMeshPolyhedraVertexAttributeStyleReturn {
83
88
 
84
89
  // oxlint-disable-next-line max-lines-per-function
85
90
  function useMeshPolyhedraVertexAttributeStyle(): UseMeshPolyhedraVertexAttributeStyleReturn {
91
+ const { attributeTimeStep, setAttributeTimeStep, seriesArrayName } = useAttributeTimeStepStyle();
86
92
  const viewerStore = useViewerStore();
87
93
  const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
88
94
  function meshPolyhedraVertexAttribute(id: string): AttributeState {
@@ -149,6 +155,9 @@ function useMeshPolyhedraVertexAttributeStyle(): UseMeshPolyhedraVertexAttribute
149
155
  const { item, name } = meshPolyhedraVertexAttribute(id);
150
156
  return item ?? meshPolyhedraVertexAttributeLastItem(id, name);
151
157
  }
158
+ function meshPolyhedraVertexAttributeTimeStep(id: string): number | undefined {
159
+ return attributeTimeStep(id, attributeNamesSchema.$id, meshPolyhedraVertexAttribute(id).name);
160
+ }
152
161
  async function setMeshPolyhedraVertexAttribute(
153
162
  id: string,
154
163
  {
@@ -174,7 +183,7 @@ function useMeshPolyhedraVertexAttributeStyle(): UseMeshPolyhedraVertexAttribute
174
183
  const schema = meshPolyhedraVertexAttributeSchemas.attribute;
175
184
  const params = {
176
185
  id,
177
- name,
186
+ name: seriesArrayName(id, attributeNamesSchema.$id, name),
178
187
  item,
179
188
  points,
180
189
  minimum,
@@ -224,6 +233,17 @@ function useMeshPolyhedraVertexAttributeStyle(): UseMeshPolyhedraVertexAttribute
224
233
  const storedConfig = meshPolyhedraVertexAttributeStoredConfig(id, name, item);
225
234
  return [storedConfig.minimum, storedConfig.maximum];
226
235
  }
236
+ async function setMeshPolyhedraVertexAttributeTimeStep(
237
+ id: string,
238
+ timeStep: number,
239
+ ): Promise<unknown> {
240
+ const name = meshPolyhedraVertexAttributeName(id);
241
+ if (name === undefined) {
242
+ return undefined;
243
+ }
244
+ await setAttributeTimeStep(id, attributeNamesSchema.$id, name, timeStep);
245
+ return applyVertexAttribute(id);
246
+ }
227
247
  async function setMeshPolyhedraVertexAttributeRange(
228
248
  id: string,
229
249
  minimum: number,
@@ -275,6 +295,8 @@ function useMeshPolyhedraVertexAttributeStyle(): UseMeshPolyhedraVertexAttribute
275
295
  }
276
296
  return {
277
297
  meshPolyhedraVertexAttributeName,
298
+ meshPolyhedraVertexAttributeTimeStep,
299
+ setMeshPolyhedraVertexAttributeTimeStep,
278
300
  meshPolyhedraVertexAttributeItem,
279
301
  meshPolyhedraVertexAttributeRange,
280
302
  meshPolyhedraVertexAttributeColorMap,
@@ -106,7 +106,11 @@ export function useModelBlocksColor(): {
106
106
  modelId,
107
107
  blocks_ids[0],
108
108
  );
109
- const attribute = { name, item, minimum, maximum, colorMap };
109
+ const no_data_color = modelBlocksVertexAttribute.modelBlocksVertexAttributeNoDataColor(
110
+ modelId,
111
+ blocks_ids[0],
112
+ );
113
+ const attribute = { name, item, minimum, maximum, colorMap, no_data_color };
110
114
  if (isModelBlocksVertexAttributeValid(attribute)) {
111
115
  await modelBlocksVertexAttribute.setModelBlocksVertexAttribute(
112
116
  modelId,
@@ -131,7 +135,12 @@ export function useModelBlocksColor(): {
131
135
  modelId,
132
136
  blocks_ids[0],
133
137
  );
134
- const attribute = { name, item, minimum, maximum, colorMap };
138
+ const no_data_color =
139
+ modelBlocksPolyhedronAttribute.modelBlocksPolyhedronAttributeNoDataColor(
140
+ modelId,
141
+ blocks_ids[0],
142
+ );
143
+ const attribute = { name, item, minimum, maximum, colorMap, no_data_color };
135
144
  if (isModelBlocksPolyhedronAttributeValid(attribute)) {
136
145
  await modelBlocksPolyhedronAttribute.setModelBlocksPolyhedronAttribute(
137
146
  modelId,
@@ -20,6 +20,7 @@ interface AttributeGroup {
20
20
  minimum: number;
21
21
  maximum: number;
22
22
  colorMap: string;
23
+ no_data_color?: RGBAColor;
23
24
  blocks_ids: string[];
24
25
  }
25
26
 
@@ -119,17 +120,30 @@ export function useModelBlocksStyle(): UseModelBlocksStyleReturn {
119
120
  modelId,
120
121
  block_id,
121
122
  );
122
- const attribute = { name, item, minimum, maximum, colorMap };
123
+ const no_data_color = modelBlocksVertexAttribute.modelBlocksVertexAttributeNoDataColor(
124
+ modelId,
125
+ block_id,
126
+ );
127
+ const attribute = {
128
+ name,
129
+ item,
130
+ minimum,
131
+ maximum,
132
+ colorMap,
133
+ no_data_color,
134
+ };
123
135
  if (!isModelBlocksVertexAttributeValid(attribute)) {
124
136
  continue;
125
137
  }
126
- const key = `${name}_${item}_${colorMap}_${minimum}_${maximum}`;
138
+ const key = [name, item, colorMap, minimum, maximum, JSON.stringify(no_data_color)].join(
139
+ "_",
140
+ );
127
141
  vertexGroups[key] ??= { ...attribute, blocks_ids: [] };
128
142
  vertexGroups[key].blocks_ids.push(block_id);
129
143
  }
130
144
  coloringPromises.push(
131
145
  ...Object.values(vertexGroups).map(
132
- async ({ name, item, minimum, maximum, colorMap, blocks_ids: ids }) => {
146
+ async ({ name, item, minimum, maximum, colorMap, no_data_color, blocks_ids: ids }) => {
133
147
  const result = await modelBlocksVertexAttribute.setModelBlocksVertexAttribute(
134
148
  modelId,
135
149
  ids,
@@ -139,6 +153,7 @@ export function useModelBlocksStyle(): UseModelBlocksStyleReturn {
139
153
  minimum,
140
154
  maximum,
141
155
  colorMap,
156
+ no_data_color,
142
157
  },
143
158
  );
144
159
  return result;
@@ -162,17 +177,31 @@ export function useModelBlocksStyle(): UseModelBlocksStyleReturn {
162
177
  modelId,
163
178
  block_id,
164
179
  );
165
- const attribute = { name, item, minimum, maximum, colorMap };
180
+ const no_data_color =
181
+ modelBlocksPolyhedronAttribute.modelBlocksPolyhedronAttributeNoDataColor(
182
+ modelId,
183
+ block_id,
184
+ );
185
+ const attribute = {
186
+ name,
187
+ item,
188
+ minimum,
189
+ maximum,
190
+ colorMap,
191
+ no_data_color,
192
+ };
166
193
  if (!isModelBlocksPolyhedronAttributeValid(attribute)) {
167
194
  continue;
168
195
  }
169
- const key = `${name}_${item}_${colorMap}_${minimum}_${maximum}`;
196
+ const key = [name, item, colorMap, minimum, maximum, JSON.stringify(no_data_color)].join(
197
+ "_",
198
+ );
170
199
  polyhedronGroups[key] ??= { ...attribute, blocks_ids: [] };
171
200
  polyhedronGroups[key].blocks_ids.push(block_id);
172
201
  }
173
202
  coloringPromises.push(
174
203
  ...Object.values(polyhedronGroups).map(
175
- async ({ name, item, minimum, maximum, colorMap, blocks_ids: ids }) => {
204
+ async ({ name, item, minimum, maximum, colorMap, no_data_color, blocks_ids: ids }) => {
176
205
  const result = await modelBlocksPolyhedronAttribute.setModelBlocksPolyhedronAttribute(
177
206
  modelId,
178
207
  ids,
@@ -182,6 +211,7 @@ export function useModelBlocksStyle(): UseModelBlocksStyleReturn {
182
211
  minimum,
183
212
  maximum,
184
213
  colorMap,
214
+ no_data_color,
185
215
  },
186
216
  );
187
217
  return result;
@@ -4,6 +4,10 @@ import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_
4
4
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
5
5
 
6
6
  // Local imports
7
+ import {
8
+ reapplySameSeries,
9
+ useAttributeTimeStepStyle,
10
+ } from "@ogw_internal/stores/data_style/time_step";
7
11
  import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
8
12
  import { useDataStore } from "@ogw_front/stores/data";
9
13
  import { useModelBlocksCommonStyle } from "./common";
@@ -63,6 +67,12 @@ interface UseModelBlocksPolyhedronAttributeReturn {
63
67
  modelId: string,
64
68
  blockId?: string,
65
69
  ) => [number | undefined, number | undefined];
70
+ modelBlocksPolyhedronAttributeTimeStep: (modelId: string, blockId?: string) => number | undefined;
71
+ setModelBlocksPolyhedronAttributeTimeStep: (
72
+ modelId: string,
73
+ blockIds: string[],
74
+ timeStep: number,
75
+ ) => Promise<void>;
66
76
  modelBlocksPolyhedronAttributeColorMap: (modelId: string, blockId?: string) => string | undefined;
67
77
  modelBlocksPolyhedronAttributeStoredConfig: (
68
78
  modelId: string,
@@ -106,6 +116,7 @@ interface UseModelBlocksPolyhedronAttributeReturn {
106
116
 
107
117
  // oxlint-disable-next-line max-lines-per-function
108
118
  function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeReturn {
119
+ const { attributeTimeStep, setAttributeTimeStep, seriesArrayName } = useAttributeTimeStepStyle();
109
120
  const dataStore = useDataStore();
110
121
  const modelBlocksCommonStyle = useModelBlocksCommonStyle();
111
122
  const viewerStore = useViewerStore();
@@ -215,6 +226,22 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
215
226
  const storedConfig = modelBlocksPolyhedronAttributeStoredConfig(modelId, blockId, name, item);
216
227
  return storedConfig.colorMap;
217
228
  }
229
+ function modelBlocksPolyhedronAttributeNoDataColor(modelId: string, blockId?: string): RGBAColor {
230
+ const name = modelBlocksPolyhedronAttributeName(modelId, blockId);
231
+ const item = modelBlocksPolyhedronAttributeItem(modelId, blockId);
232
+ const storedConfig = modelBlocksPolyhedronAttributeStoredConfig(modelId, blockId, name, item);
233
+ return storedConfig.no_data_color;
234
+ }
235
+ function modelBlocksPolyhedronAttributeTimeStep(
236
+ modelId: string,
237
+ blockId?: string,
238
+ ): number | undefined {
239
+ return attributeTimeStep(
240
+ modelId,
241
+ modelBlockPolyhedronAttributeSchema.$id,
242
+ modelBlocksPolyhedronAttribute(modelId, blockId).name,
243
+ );
244
+ }
218
245
  async function setModelBlocksPolyhedronAttribute(
219
246
  modelId: string,
220
247
  blockIds: string[],
@@ -242,7 +269,7 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
242
269
  const params = {
243
270
  id: modelId,
244
271
  block_ids: viewer_ids,
245
- name,
272
+ name: seriesArrayName(modelId, modelBlockPolyhedronAttributeSchema.$id, name),
246
273
  item,
247
274
  points,
248
275
  minimum,
@@ -299,6 +326,37 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
299
326
  });
300
327
  return applyPolyhedronAttribute(modelId, blockIds);
301
328
  }
329
+ async function setModelBlocksPolyhedronAttributeTimeStep(
330
+ modelId: string,
331
+ blockIds: string[],
332
+ timeStep: number,
333
+ ): Promise<void> {
334
+ const name = modelBlocksPolyhedronAttributeName(modelId, blockIds[0]);
335
+ if (name === undefined) {
336
+ return;
337
+ }
338
+ await setAttributeTimeStep(modelId, modelBlockPolyhedronAttributeSchema.$id, name, timeStep);
339
+ await Promise.all([
340
+ applyPolyhedronAttribute(modelId, blockIds),
341
+ reapplySameSeries(
342
+ await dataStore.getBlocksGeodeIds(modelId),
343
+ blockIds,
344
+ (id) =>
345
+ modelBlocksCommonStyle.modelBlockColoring(modelId, id).active === "polyhedron" &&
346
+ modelBlocksPolyhedronAttributeName(modelId, id) === name
347
+ ? [
348
+ modelBlocksPolyhedronAttributeItem(modelId, id),
349
+ modelBlocksPolyhedronAttributeRange(modelId, id),
350
+ modelBlocksPolyhedronAttributeColorMap(modelId, id),
351
+ JSON.stringify(modelBlocksPolyhedronAttributeNoDataColor(modelId, id)),
352
+ ].join("|")
353
+ : undefined,
354
+ async (ids) => {
355
+ await applyPolyhedronAttribute(modelId, ids);
356
+ },
357
+ ),
358
+ ]);
359
+ }
302
360
  async function setModelBlocksPolyhedronAttributeRange(
303
361
  modelId: string,
304
362
  blockIds: string[],
@@ -325,12 +383,6 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
325
383
  });
326
384
  return applyPolyhedronAttribute(modelId, blockIds);
327
385
  }
328
- function modelBlocksPolyhedronAttributeNoDataColor(modelId: string, blockId?: string): RGBAColor {
329
- const name = modelBlocksPolyhedronAttributeName(modelId, blockId);
330
- const item = modelBlocksPolyhedronAttributeItem(modelId, blockId);
331
- const storedConfig = modelBlocksPolyhedronAttributeStoredConfig(modelId, blockId, name, item);
332
- return storedConfig.no_data_color;
333
- }
334
386
  async function setModelBlocksPolyhedronAttributeNoDataColor(
335
387
  modelId: string,
336
388
  blockIds: string[],
@@ -352,6 +404,8 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
352
404
  }
353
405
  return {
354
406
  modelBlocksPolyhedronAttributeName,
407
+ modelBlocksPolyhedronAttributeTimeStep,
408
+ setModelBlocksPolyhedronAttributeTimeStep,
355
409
  modelBlocksPolyhedronAttributeItem,
356
410
  modelBlocksPolyhedronAttributeRange,
357
411
  modelBlocksPolyhedronAttributeColorMap,