@geode/opengeodeweb-front 10.44.0-rc.9 → 10.44.1-rc.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 (234) hide show
  1. package/app/components/ClippingPlaneCard.vue +18 -1
  2. package/app/components/ClippingPlanes.vue +21 -10
  3. package/app/components/CrsSelector.vue +2 -1
  4. package/app/components/ExtensionSelector.vue +8 -7
  5. package/app/components/FactorFilterPanel.vue +4 -4
  6. package/app/components/MissingFilesSelector.vue +2 -1
  7. package/app/components/ObjectSelector.vue +4 -3
  8. package/app/components/Screenshot.vue +8 -57
  9. package/app/components/ThresholdCard.vue +6 -5
  10. package/app/components/ThresholdFilter.vue +11 -10
  11. package/app/components/TimeSeriesTargetSelector.vue +10 -7
  12. package/app/components/Viewer/ContextMenu/CircularItems.vue +1 -2
  13. package/app/components/Viewer/ContextMenu/ContextMenu.vue +7 -6
  14. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +4 -5
  15. package/app/components/Viewer/ContextMenu/InfoCard.vue +12 -10
  16. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +72 -63
  17. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +12 -10
  18. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +76 -71
  19. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +8 -6
  20. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +72 -63
  21. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +12 -10
  22. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +54 -45
  23. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +76 -73
  24. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +8 -6
  25. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +72 -67
  26. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +8 -6
  27. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +29 -21
  28. package/app/components/Viewer/Generic/Model/ComponentEdgesOptions.vue +8 -6
  29. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +8 -6
  30. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +15 -7
  31. package/app/components/Viewer/Generic/Model/CornersOptions.vue +2 -1
  32. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +13 -6
  33. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +19 -11
  34. package/app/components/Viewer/Generic/Model/LinesOptions.vue +2 -1
  35. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +17 -10
  36. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +3 -2
  37. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +2 -1
  38. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +3 -2
  39. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +29 -21
  40. package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +2 -2
  41. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +2 -3
  42. package/app/components/Viewer/Options/AttributeSelector.vue +11 -7
  43. package/app/components/Viewer/Options/ColoringTypeSelector.vue +10 -13
  44. package/app/components/Viewer/Options/TextureItem.vue +5 -4
  45. package/app/components/Viewer/Options/TexturesSelector.vue +5 -8
  46. package/app/components/Viewer/Options/TimeStepSlider.vue +3 -1
  47. package/app/components/Viewer/OverlappingObjectsPicker.vue +6 -13
  48. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +40 -38
  49. package/app/components/Viewer/Scene/BackgroundOptions.vue +37 -0
  50. package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +48 -0
  51. package/app/components/Viewer/Scene/TextOptions.vue +63 -0
  52. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +69 -65
  53. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +8 -6
  54. package/app/components/Viewer/Surface/PolygonsColoring.vue +73 -71
  55. package/app/components/Viewer/Surface/PolygonsOptions.vue +8 -6
  56. package/app/composables/attribute_coloring_style.ts +17 -12
  57. package/app/composables/attribute_selector.ts +9 -15
  58. package/app/composables/batch_style.ts +25 -16
  59. package/app/composables/batch_style_model.ts +6 -5
  60. package/app/composables/clipping_planes_widget.ts +2 -5
  61. package/app/composables/clipping_planes_widget_entries.ts +1 -0
  62. package/app/composables/clipping_slices.ts +2 -1
  63. package/app/composables/hover_highlight.ts +17 -16
  64. package/app/composables/live_data_item.ts +3 -2
  65. package/app/composables/model_attribute_style.ts +2 -1
  66. package/app/composables/model_menu_context.ts +3 -4
  67. package/app/composables/model_tree.ts +3 -2
  68. package/app/composables/project_manager_helpers/types.ts +10 -4
  69. package/app/composables/tree_filter.ts +3 -3
  70. package/app/composables/tree_keyboard_nav.ts +1 -6
  71. package/app/composables/tree_scroll.ts +2 -0
  72. package/app/composables/use_overlapping_picker.ts +12 -10
  73. package/app/composables/viewer_context_menu.ts +9 -1
  74. package/app/stores/basemap_helpers/georeferenced.ts +1 -1
  75. package/app/stores/basemap_helpers/viewer.ts +2 -1
  76. package/app/stores/crs.ts +6 -5
  77. package/app/stores/data.ts +84 -69
  78. package/app/stores/data_helpers/collections.ts +13 -21
  79. package/app/stores/data_helpers/mesh.ts +19 -24
  80. package/app/stores/data_helpers/relations.ts +12 -12
  81. package/app/stores/data_style.ts +34 -20
  82. package/app/stores/menu.ts +24 -11
  83. package/app/stores/menu_helpers/menus_data.ts +2 -0
  84. package/app/stores/menu_helpers/scene.ts +10 -0
  85. package/app/stores/treeview.ts +28 -27
  86. package/app/types/attribute.ts +37 -0
  87. package/app/types/identifiers.ts +72 -0
  88. package/app/types/style.ts +13 -0
  89. package/app/types/texture.ts +6 -0
  90. package/app/types/tree.ts +17 -0
  91. package/app/utils/attribute_range.ts +2 -1
  92. package/app/utils/attributes.ts +13 -4
  93. package/app/utils/basemap_tree.ts +3 -5
  94. package/app/utils/clipping_planes.ts +25 -5
  95. package/app/utils/clipping_planes_scene.ts +4 -3
  96. package/app/utils/crs.ts +4 -1
  97. package/app/utils/default_styles/constants.ts +18 -1
  98. package/app/utils/default_styles/index.ts +17 -1
  99. package/app/utils/default_styles/mesh_components.ts +21 -25
  100. package/app/utils/default_styles/meshes.ts +7 -22
  101. package/app/utils/default_styles/model_components.ts +22 -26
  102. package/app/utils/default_styles/models.ts +11 -13
  103. package/app/utils/import_workflow.ts +37 -29
  104. package/app/utils/legacy_data_id.ts +16 -0
  105. package/app/utils/slice.ts +7 -2
  106. package/app/utils/threshold.ts +1 -8
  107. package/app/utils/threshold_sources.ts +8 -5
  108. package/app/utils/treeview.ts +3 -2
  109. package/internal/database/base_database.ts +2 -0
  110. package/internal/database/tables/data.ts +1 -1
  111. package/internal/database/tables/data_style.ts +1 -1
  112. package/internal/database/tables/model_components.ts +1 -1
  113. package/internal/database/tables/model_components_relation.ts +1 -1
  114. package/internal/database/tables/scene_style.ts +6 -0
  115. package/internal/stores/data_style/attribute_default.ts +14 -0
  116. package/internal/stores/data_style/attribute_types.ts +59 -0
  117. package/internal/stores/data_style/attribute_valid.ts +16 -0
  118. package/internal/stores/data_style/mesh/base_style.ts +17 -15
  119. package/internal/stores/data_style/mesh/cells/cell.ts +64 -49
  120. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +42 -66
  121. package/internal/stores/data_style/mesh/cells/cell_config.ts +59 -53
  122. package/internal/stores/data_style/mesh/cells/color.ts +8 -7
  123. package/internal/stores/data_style/mesh/cells/common.ts +16 -15
  124. package/internal/stores/data_style/mesh/cells/index.ts +49 -47
  125. package/internal/stores/data_style/mesh/cells/opacity.ts +12 -10
  126. package/internal/stores/data_style/mesh/cells/textures.ts +8 -7
  127. package/internal/stores/data_style/mesh/cells/vertex.ts +66 -50
  128. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +37 -67
  129. package/internal/stores/data_style/mesh/cells/vertex_config.ts +62 -53
  130. package/internal/stores/data_style/mesh/cells/visibility.ts +11 -7
  131. package/internal/stores/data_style/mesh/edges/color.ts +8 -7
  132. package/internal/stores/data_style/mesh/edges/common.ts +13 -12
  133. package/internal/stores/data_style/mesh/edges/edge.ts +64 -49
  134. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +42 -66
  135. package/internal/stores/data_style/mesh/edges/edge_config.ts +59 -53
  136. package/internal/stores/data_style/mesh/edges/index.ts +49 -47
  137. package/internal/stores/data_style/mesh/edges/opacity.ts +12 -10
  138. package/internal/stores/data_style/mesh/edges/vertex.ts +66 -50
  139. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +37 -67
  140. package/internal/stores/data_style/mesh/edges/vertex_config.ts +62 -53
  141. package/internal/stores/data_style/mesh/edges/visibility.ts +11 -7
  142. package/internal/stores/data_style/mesh/edges/width.ts +9 -7
  143. package/internal/stores/data_style/mesh/index.ts +27 -24
  144. package/internal/stores/data_style/mesh/points/color.ts +8 -7
  145. package/internal/stores/data_style/mesh/points/common.ts +16 -14
  146. package/internal/stores/data_style/mesh/points/index.ts +39 -37
  147. package/internal/stores/data_style/mesh/points/opacity.ts +12 -10
  148. package/internal/stores/data_style/mesh/points/size.ts +9 -7
  149. package/internal/stores/data_style/mesh/points/vertex.ts +66 -50
  150. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +37 -67
  151. package/internal/stores/data_style/mesh/points/vertex_config.ts +62 -53
  152. package/internal/stores/data_style/mesh/points/visibility.ts +8 -6
  153. package/internal/stores/data_style/mesh/polygons/color.ts +8 -7
  154. package/internal/stores/data_style/mesh/polygons/common.ts +19 -15
  155. package/internal/stores/data_style/mesh/polygons/index.ts +49 -50
  156. package/internal/stores/data_style/mesh/polygons/opacity.ts +12 -10
  157. package/internal/stores/data_style/mesh/polygons/polygon.ts +66 -50
  158. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +37 -67
  159. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +65 -53
  160. package/internal/stores/data_style/mesh/polygons/textures.ts +8 -7
  161. package/internal/stores/data_style/mesh/polygons/vertex.ts +66 -50
  162. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +37 -67
  163. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +65 -53
  164. package/internal/stores/data_style/mesh/polygons/visibility.ts +12 -7
  165. package/internal/stores/data_style/mesh/polyhedra/color.ts +13 -9
  166. package/internal/stores/data_style/mesh/polyhedra/common.ts +13 -12
  167. package/internal/stores/data_style/mesh/polyhedra/index.ts +51 -51
  168. package/internal/stores/data_style/mesh/polyhedra/opacity.ts +12 -10
  169. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +59 -53
  170. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +46 -69
  171. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +65 -55
  172. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +66 -50
  173. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +37 -67
  174. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +65 -53
  175. package/internal/stores/data_style/mesh/polyhedra/visibility.ts +12 -7
  176. package/internal/stores/data_style/model/blocks/apply_coloring.ts +11 -12
  177. package/internal/stores/data_style/model/blocks/color.ts +25 -26
  178. package/internal/stores/data_style/model/blocks/coloring_groups.ts +5 -9
  179. package/internal/stores/data_style/model/blocks/common.ts +26 -22
  180. package/internal/stores/data_style/model/blocks/index.ts +8 -7
  181. package/internal/stores/data_style/model/blocks/polyhedron.ts +114 -135
  182. package/internal/stores/data_style/model/blocks/vertex.ts +110 -132
  183. package/internal/stores/data_style/model/blocks/visibility.ts +11 -9
  184. package/internal/stores/data_style/model/color.ts +55 -41
  185. package/internal/stores/data_style/model/common.ts +16 -14
  186. package/internal/stores/data_style/model/component_style.ts +0 -16
  187. package/internal/stores/data_style/model/corners/color.ts +21 -19
  188. package/internal/stores/data_style/model/corners/common.ts +26 -22
  189. package/internal/stores/data_style/model/corners/index.ts +21 -24
  190. package/internal/stores/data_style/model/corners/vertex.ts +103 -122
  191. package/internal/stores/data_style/model/corners/visibility.ts +11 -9
  192. package/internal/stores/data_style/model/edges/common.ts +7 -6
  193. package/internal/stores/data_style/model/edges/component.ts +63 -55
  194. package/internal/stores/data_style/model/edges/visibility.ts +24 -16
  195. package/internal/stores/data_style/model/edges/width.ts +10 -8
  196. package/internal/stores/data_style/model/index.ts +7 -6
  197. package/internal/stores/data_style/model/lines/apply_coloring.ts +11 -9
  198. package/internal/stores/data_style/model/lines/color.ts +25 -23
  199. package/internal/stores/data_style/model/lines/coloring_groups.ts +5 -9
  200. package/internal/stores/data_style/model/lines/common.ts +29 -21
  201. package/internal/stores/data_style/model/lines/edge.ts +109 -128
  202. package/internal/stores/data_style/model/lines/index.ts +8 -7
  203. package/internal/stores/data_style/model/lines/vertex.ts +109 -128
  204. package/internal/stores/data_style/model/lines/visibility.ts +11 -9
  205. package/internal/stores/data_style/model/points/common.ts +7 -6
  206. package/internal/stores/data_style/model/points/component.ts +62 -54
  207. package/internal/stores/data_style/model/points/index.ts +12 -7
  208. package/internal/stores/data_style/model/points/size.ts +10 -8
  209. package/internal/stores/data_style/model/points/visibility.ts +13 -8
  210. package/internal/stores/data_style/model/selection.ts +6 -11
  211. package/internal/stores/data_style/model/surfaces/apply_coloring.ts +11 -15
  212. package/internal/stores/data_style/model/surfaces/color.ts +31 -23
  213. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +5 -9
  214. package/internal/stores/data_style/model/surfaces/common.ts +26 -22
  215. package/internal/stores/data_style/model/surfaces/index.ts +8 -7
  216. package/internal/stores/data_style/model/surfaces/polygon.ts +113 -138
  217. package/internal/stores/data_style/model/surfaces/vertex.ts +117 -133
  218. package/internal/stores/data_style/model/surfaces/visibility.ts +11 -9
  219. package/internal/stores/data_style/model/visibility.ts +18 -16
  220. package/internal/stores/data_style/model/visibility_dispatch.ts +4 -4
  221. package/internal/stores/data_style/scene.ts +118 -0
  222. package/internal/stores/data_style/state.ts +11 -6
  223. package/internal/stores/data_style/state_shared.ts +20 -11
  224. package/internal/stores/data_style/time_step.ts +21 -15
  225. package/internal/stores/data_style/types.ts +28 -4
  226. package/internal/stores/hybrid_viewer/camera.ts +11 -6
  227. package/internal/stores/hybrid_viewer/filters.ts +16 -14
  228. package/internal/stores/hybrid_viewer/highlight.ts +6 -5
  229. package/internal/stores/hybrid_viewer/scene.ts +20 -18
  230. package/internal/stores/hybrid_viewer/vtk_types.ts +2 -2
  231. package/internal/utils/api_fetch.ts +1 -1
  232. package/internal/utils/upload_file.ts +1 -7
  233. package/package.json +1 -1
  234. package/shared/utils/fetch_raw.ts +7 -8
@@ -2,9 +2,11 @@
2
2
  import ViewerContextMenuItem, {
3
3
  type ItemProps,
4
4
  } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
5
+ import type { MeshId } from "@ogw_front/types/identifiers";
5
6
  import SolidPolyhedra from "@ogw_front/assets/viewer_svgs/solid_polyhedra.svg";
6
7
  import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
7
8
  import ViewerSolidSpecificPolyhedraColoring from "@ogw_front/components/Viewer/Solid/SpecificPolyhedraColoring.vue";
9
+ import type { Visibility } from "@ogw_front/types/style";
8
10
  import { useBatchStyle } from "@ogw_front/composables/batch_style";
9
11
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
10
12
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
@@ -20,13 +22,13 @@ interface Props {
20
22
 
21
23
  const { itemProps, tooltip = "Polyhedra options" } = defineProps<Props>();
22
24
 
23
- const id = toRef(() => itemProps.id);
25
+ const dataId = toRef(() => itemProps.id);
24
26
 
25
- const visibility = computed<boolean>({
26
- get: () => dataStyleStore.meshPolyhedraVisibility(id.value),
27
+ const visibility = computed<Visibility>({
28
+ get: () => dataStyleStore.meshPolyhedraVisibility(dataId.value),
27
29
  set: async (newValue) => {
28
- await applyBatchStyle(id.value, (targetId: string) =>
29
- dataStyleStore.setMeshPolyhedraVisibility(targetId, newValue),
30
+ await applyBatchStyle(dataId.value, (meshId: MeshId) =>
31
+ dataStyleStore.setMeshPolyhedraVisibility(meshId, newValue),
30
32
  );
31
33
  hybridViewerStore.remoteRender();
32
34
  },
@@ -47,7 +49,7 @@ const visibility = computed<boolean>({
47
49
  v-model="visibility"
48
50
  />
49
51
  <template v-if="visibility">
50
- <ViewerSolidSpecificPolyhedraColoring :id="id" />
52
+ <ViewerSolidSpecificPolyhedraColoring :data-id="dataId" />
51
53
  </template>
52
54
  </template>
53
55
  </ViewerContextMenuItem>
@@ -1,199 +1,201 @@
1
1
  <script setup lang="ts">
2
+ import type {
3
+ AttributeItem,
4
+ AttributeName,
5
+ AttributeRange,
6
+ AttributeTimeStep,
7
+ } from "@ogw_front/types/attribute";
8
+ import type { DataId, MeshId } from "@ogw_front/types/identifiers";
2
9
  import {
3
10
  type RangesPerData,
4
11
  applyRangesPerData,
5
12
  useBatchStyle,
6
13
  } from "@ogw_front/composables/batch_style";
14
+ import type { Opacity } from "@ogw_front/types/style";
7
15
  import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
16
+ import type { Texture } from "@ogw_front/types/texture";
8
17
  import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
9
18
  import { useBatchStyleModel } from "@ogw_front/composables/batch_style_model";
10
19
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
11
20
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
12
21
 
13
- interface Texture {
14
- id: string;
15
- texture_name: string;
16
- }
17
-
18
22
  const dataStyleStore = useDataStyleStore();
19
23
  const hybridViewerStore = useHybridViewerStore();
20
24
  const { applyBatchStyle } = useBatchStyle();
21
25
 
22
26
  interface Props {
23
- id: string;
27
+ dataId: DataId;
24
28
  }
25
29
 
26
- const { id } = defineProps<Props>();
30
+ const { dataId } = defineProps<Props>();
27
31
 
28
32
  const coloring_style_key = computed<string>({
29
- get: () => dataStyleStore.meshPolygonsActiveColoring(id),
33
+ get: () => dataStyleStore.meshPolygonsActiveColoring(dataId),
30
34
  set: async (newValue) => {
31
- await applyBatchStyle(id, (targetId: string) =>
32
- dataStyleStore.setMeshPolygonsActiveColoring(targetId, newValue),
35
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
36
+ dataStyleStore.setMeshPolygonsActiveColoring(meshId, newValue),
33
37
  );
34
38
  hybridViewerStore.remoteRender();
35
39
  },
36
40
  });
37
41
  const color = useBatchStyleModel<RGBAColor>(
38
- () => id,
39
- (targetId) => dataStyleStore.meshPolygonsColor(targetId) as RGBAColor | undefined,
40
- (targetId, value) => dataStyleStore.setMeshPolygonsColor(targetId, value),
42
+ () => dataId,
43
+ (meshId) => dataStyleStore.meshPolygonsColor(meshId) as RGBAColor | undefined,
44
+ (meshId, value) => dataStyleStore.setMeshPolygonsColor(meshId, value),
41
45
  );
42
- const opacity = useBatchStyleModel<number>(
43
- () => id,
44
- (targetId) => dataStyleStore.meshPolygonsOpacity(targetId),
45
- (targetId, value) => dataStyleStore.setMeshPolygonsOpacity(targetId, value),
46
+ const opacity = useBatchStyleModel<Opacity>(
47
+ () => dataId,
48
+ (meshId) => dataStyleStore.meshPolygonsOpacity(meshId),
49
+ (meshId, value) => dataStyleStore.setMeshPolygonsOpacity(meshId, value),
46
50
  );
47
51
  const textures = useBatchStyleModel<Texture[]>(
48
- () => id,
49
- (targetId) => dataStyleStore.meshPolygonsTextures(targetId) as Texture[] | undefined,
50
- (targetId, value) => dataStyleStore.setMeshPolygonsTextures(targetId, value),
52
+ () => dataId,
53
+ (meshId) => dataStyleStore.meshPolygonsTextures(meshId) as Texture[] | undefined,
54
+ (meshId, value) => dataStyleStore.setMeshPolygonsTextures(meshId, value),
51
55
  );
52
- const vertex_attribute_name = computed<string | undefined>({
53
- get: () => dataStyleStore.meshPolygonsVertexAttributeName(id),
56
+ const vertex_attribute_name = computed<AttributeName | undefined>({
57
+ get: () => dataStyleStore.meshPolygonsVertexAttributeName(dataId),
54
58
  set: async (newValue) => {
55
59
  if (newValue === undefined) {
56
60
  return;
57
61
  }
58
- await applyBatchStyle(id, (targetId: string) =>
59
- Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeName(targetId, newValue)),
62
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
63
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeName(meshId, newValue)),
60
64
  );
61
65
  hybridViewerStore.remoteRender();
62
66
  },
63
67
  });
64
68
 
65
- const vertex_attribute_time_step = computed<number | undefined>({
66
- get: () => dataStyleStore.meshPolygonsVertexAttributeTimeStep(id),
69
+ const vertex_attribute_time_step = computed<AttributeTimeStep | undefined>({
70
+ get: () => dataStyleStore.meshPolygonsVertexAttributeTimeStep(dataId),
67
71
  set: async (newValue) => {
68
72
  if (newValue === undefined) {
69
73
  return;
70
74
  }
71
- await applyBatchStyle(id, (targetId: string) =>
72
- Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeTimeStep(targetId, newValue)),
75
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
76
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeTimeStep(meshId, newValue)),
73
77
  );
74
78
  hybridViewerStore.remoteRender();
75
79
  },
76
80
  });
77
- const vertex_attribute_item = computed<string | undefined>({
78
- get: () => dataStyleStore.meshPolygonsVertexAttributeItem(id),
81
+ const vertex_attribute_item = computed<AttributeItem>({
82
+ get: () => dataStyleStore.meshPolygonsVertexAttributeItem(dataId),
79
83
  set: async (newValue) => {
80
- await applyBatchStyle(id, (targetId: string) =>
81
- Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeItem(targetId, newValue)),
84
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
85
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeItem(meshId, newValue)),
82
86
  );
83
87
  hybridViewerStore.remoteRender();
84
88
  },
85
89
  });
86
- const vertex_attribute_range = computed<[number, number] | undefined>({
87
- get: () => dataStyleStore.meshPolygonsVertexAttributeRange(id),
90
+ const vertex_attribute_range = computed<AttributeRange>({
91
+ get: () => dataStyleStore.meshPolygonsVertexAttributeRange(dataId),
88
92
  set: async (newValue) => {
89
93
  const [minimum, maximum] = newValue;
90
94
  if (minimum === undefined || maximum === undefined) {
91
95
  return;
92
96
  }
93
- await applyBatchStyle(id, (targetId: string) =>
94
- Promise.resolve(
95
- dataStyleStore.setMeshPolygonsVertexAttributeRange(targetId, minimum, maximum),
96
- ),
97
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
98
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeRange(meshId, minimum, maximum)),
97
99
  );
98
100
  hybridViewerStore.remoteRender();
99
101
  },
100
102
  });
101
103
  const vertex_attribute_color_map = computed<Map<string, RGBAColor> | undefined>({
102
- get: () => dataStyleStore.meshPolygonsVertexAttributeColorMap(id),
104
+ get: () => dataStyleStore.meshPolygonsVertexAttributeColorMap(dataId),
103
105
  set: async (newValue) => {
104
- await applyBatchStyle(id, (targetId: string) =>
105
- Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeColorMap(targetId, newValue)),
106
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
107
+ Promise.resolve(dataStyleStore.setMeshPolygonsVertexAttributeColorMap(meshId, newValue)),
106
108
  );
107
109
  hybridViewerStore.remoteRender();
108
110
  },
109
111
  });
110
112
  const vertex_attribute_no_data_color = computed<RGBAColor>({
111
- get: () => dataStyleStore.meshPolygonsVertexAttributeNoDataColor(id),
113
+ get: () => dataStyleStore.meshPolygonsVertexAttributeNoDataColor(dataId),
112
114
  set: async (newValue) => {
113
- await applyBatchStyle(id, (targetId: string) =>
114
- dataStyleStore.setMeshPolygonsVertexAttributeNoDataColor(targetId, newValue),
115
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
116
+ dataStyleStore.setMeshPolygonsVertexAttributeNoDataColor(meshId, newValue),
115
117
  );
116
118
  hybridViewerStore.remoteRender();
117
119
  },
118
120
  });
119
- const polygon_attribute_name = computed<string | undefined>({
120
- get: () => dataStyleStore.meshPolygonsPolygonAttributeName(id),
121
+ const polygon_attribute_name = computed<AttributeName | undefined>({
122
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeName(dataId),
121
123
  set: async (newValue) => {
122
124
  if (newValue === undefined) {
123
125
  return;
124
126
  }
125
- await applyBatchStyle(id, (targetId: string) =>
126
- Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeName(targetId, newValue)),
127
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
128
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeName(meshId, newValue)),
127
129
  );
128
130
  hybridViewerStore.remoteRender();
129
131
  },
130
132
  });
131
133
 
132
- const polygon_attribute_time_step = computed<number | undefined>({
133
- get: () => dataStyleStore.meshPolygonsPolygonAttributeTimeStep(id),
134
+ const polygon_attribute_time_step = computed<AttributeTimeStep | undefined>({
135
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeTimeStep(dataId),
134
136
  set: async (newValue) => {
135
137
  if (newValue === undefined) {
136
138
  return;
137
139
  }
138
- await applyBatchStyle(id, (targetId: string) =>
139
- Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeTimeStep(targetId, newValue)),
140
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
141
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeTimeStep(meshId, newValue)),
140
142
  );
141
143
  hybridViewerStore.remoteRender();
142
144
  },
143
145
  });
144
- const polygon_attribute_item = computed<string | undefined>({
145
- get: () => dataStyleStore.meshPolygonsPolygonAttributeItem(id),
146
+ const polygon_attribute_item = computed<AttributeItem>({
147
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeItem(dataId),
146
148
  set: async (newValue) => {
147
- await applyBatchStyle(id, (targetId: string) =>
148
- Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeItem(targetId, newValue)),
149
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
150
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeItem(meshId, newValue)),
149
151
  );
150
152
  hybridViewerStore.remoteRender();
151
153
  },
152
154
  });
153
- const polygon_attribute_range = computed<[number, number] | undefined>({
154
- get: () => dataStyleStore.meshPolygonsPolygonAttributeRange(id),
155
+ const polygon_attribute_range = computed<AttributeRange>({
156
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeRange(dataId),
155
157
  set: async (newValue) => {
156
158
  const [minimum, maximum] = newValue;
157
159
  if (minimum === undefined || maximum === undefined) {
158
160
  return;
159
161
  }
160
- await applyBatchStyle(id, (targetId: string) =>
162
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
161
163
  Promise.resolve(
162
- dataStyleStore.setMeshPolygonsPolygonAttributeRange(targetId, minimum, maximum),
164
+ dataStyleStore.setMeshPolygonsPolygonAttributeRange(meshId, minimum, maximum),
163
165
  ),
164
166
  );
165
167
  hybridViewerStore.remoteRender();
166
168
  },
167
169
  });
168
170
  const polygon_attribute_color_map = computed<Map<string, RGBAColor> | undefined>({
169
- get: () => dataStyleStore.meshPolygonsPolygonAttributeColorMap(id),
171
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeColorMap(dataId),
170
172
  set: async (newValue) => {
171
- await applyBatchStyle(id, (targetId: string) =>
172
- Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeColorMap(targetId, newValue)),
173
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
174
+ Promise.resolve(dataStyleStore.setMeshPolygonsPolygonAttributeColorMap(meshId, newValue)),
173
175
  );
174
176
  hybridViewerStore.remoteRender();
175
177
  },
176
178
  });
177
179
  const polygon_attribute_no_data_color = computed<RGBAColor>({
178
- get: () => dataStyleStore.meshPolygonsPolygonAttributeNoDataColor(id),
180
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeNoDataColor(dataId),
179
181
  set: async (newValue) => {
180
- await applyBatchStyle(id, (targetId: string) =>
181
- dataStyleStore.setMeshPolygonsPolygonAttributeNoDataColor(targetId, newValue),
182
+ await applyBatchStyle(dataId, (meshId: MeshId) =>
183
+ dataStyleStore.setMeshPolygonsPolygonAttributeNoDataColor(meshId, newValue),
182
184
  );
183
185
  hybridViewerStore.remoteRender();
184
186
  },
185
187
  });
186
188
 
187
189
  async function setVertexAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
188
- await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
189
- dataStyleStore.setMeshPolygonsVertexAttributeRange(targetId, minimum, maximum),
190
+ await applyRangesPerData(ranges, (meshId, minimum, maximum) =>
191
+ dataStyleStore.setMeshPolygonsVertexAttributeRange(meshId, minimum, maximum),
190
192
  );
191
193
  hybridViewerStore.remoteRender();
192
194
  }
193
195
 
194
196
  async function setPolygonAttributeRangesPerData(ranges: RangesPerData): Promise<void> {
195
- await applyRangesPerData(ranges, (targetId, minimum, maximum) =>
196
- dataStyleStore.setMeshPolygonsPolygonAttributeRange(targetId, minimum, maximum),
197
+ await applyRangesPerData(ranges, (meshId, minimum, maximum) =>
198
+ dataStyleStore.setMeshPolygonsPolygonAttributeRange(meshId, minimum, maximum),
197
199
  );
198
200
  hybridViewerStore.remoteRender();
199
201
  }
@@ -201,7 +203,7 @@ async function setPolygonAttributeRangesPerData(ranges: RangesPerData): Promise<
201
203
 
202
204
  <template>
203
205
  <ViewerOptionsColoringTypeSelector
204
- :id="id"
206
+ :data-id="dataId"
205
207
  v-model:coloring_style_key="coloring_style_key"
206
208
  v-model:color="color"
207
209
  v-model:opacity="opacity"
@@ -2,9 +2,11 @@
2
2
  import ViewerContextMenuItem, {
3
3
  type ItemProps,
4
4
  } from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
5
+ import type { MeshId } from "@ogw_front/types/identifiers";
5
6
  import PolygonalSurfacePolygons from "@ogw_front/assets/viewer_svgs/surface_triangles.svg";
6
7
  import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
7
8
  import ViewerSurfacePolygonsColoring from "@ogw_front/components/Viewer/Surface/PolygonsColoring.vue";
9
+ import type { Visibility } from "@ogw_front/types/style";
8
10
  import { useBatchStyle } from "@ogw_front/composables/batch_style";
9
11
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
10
12
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
@@ -20,13 +22,13 @@ interface Props {
20
22
 
21
23
  const { itemProps, tooltip = "Polygons options" } = defineProps<Props>();
22
24
 
23
- const id = toRef(() => itemProps.id);
25
+ const dataId = toRef(() => itemProps.id);
24
26
 
25
- const visibility = computed<boolean>({
26
- get: () => dataStyleStore.meshPolygonsVisibility(id.value),
27
+ const visibility = computed<Visibility>({
28
+ get: () => dataStyleStore.meshPolygonsVisibility(dataId.value),
27
29
  set: async (newValue) => {
28
- await applyBatchStyle(id.value, (targetId: string) =>
29
- dataStyleStore.setMeshPolygonsVisibility(targetId, newValue),
30
+ await applyBatchStyle(dataId.value, (meshId: MeshId) =>
31
+ dataStyleStore.setMeshPolygonsVisibility(meshId, newValue),
30
32
  );
31
33
  hybridViewerStore.remoteRender();
32
34
  },
@@ -47,7 +49,7 @@ const visibility = computed<boolean>({
47
49
  v-model="visibility"
48
50
  />
49
51
  <template v-if="visibility">
50
- <ViewerSurfacePolygonsColoring :id="id" />
52
+ <ViewerSurfacePolygonsColoring :data-id="dataId" />
51
53
  </template>
52
54
  </template>
53
55
  </ViewerContextMenuItem>
@@ -1,7 +1,12 @@
1
+ import type {
2
+ AttributeColorMap,
3
+ AttributeTimeStep,
4
+ ValidAttributeRange,
5
+ } from "@ogw_front/types/attribute";
6
+ import { type AttributeInfo, getAttributeRange } from "@ogw_front/utils/attributes";
1
7
  import { type AttributeSchemas, fetchAttributeRange } from "@ogw_front/utils/attribute_range";
2
8
  import type { JsonRpcSchema } from "@ogw_shared/utils/types";
3
9
  import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
4
- import { getAttributeRange } from "@ogw_front/utils/attributes";
5
10
  import { useBackStore } from "@ogw_front/stores/back";
6
11
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
7
12
 
@@ -15,16 +20,16 @@ interface AttributeColoring {
15
20
  }
16
21
 
17
22
  interface AttributeNamesResponse {
18
- attributes: { attribute_name: string; time_steps?: number[] }[];
23
+ attributes: Pick<AttributeInfo, "attribute_name" | "time_steps">[];
19
24
  }
20
25
 
21
26
  interface AttributeColoringStyle {
22
- currentColormap: ComputedRef<string>;
23
- currentRange: WritableComputedRef<readonly [number, number]>;
24
- applyGlobalColormap: (colorMap: string) => Promise<void>;
27
+ currentColormap: ComputedRef<AttributeColorMap>;
28
+ currentRange: WritableComputedRef<Readonly<ValidAttributeRange>>;
29
+ applyGlobalColormap: (colorMap: AttributeColorMap) => Promise<void>;
25
30
  resetGlobalRange: () => Promise<void>;
26
31
  currentTimeSteps: Ref<number[]>;
27
- currentTimeStep: WritableComputedRef<number>;
32
+ currentTimeStep: WritableComputedRef<AttributeTimeStep>;
28
33
  loadTimeSteps: () => Promise<void>;
29
34
  }
30
35
 
@@ -76,7 +81,7 @@ function useAttributeColoringStyle(colorings: Ref<AttributeColoring[]>): Attribu
76
81
  await hybridViewerStore.remoteRender();
77
82
  }
78
83
 
79
- const currentColormap = computed((): string => {
84
+ const currentColormap = computed((): AttributeColorMap => {
80
85
  const [coloring] = colorings.value;
81
86
  if (!coloring) {
82
87
  return "batlow";
@@ -84,12 +89,12 @@ function useAttributeColoringStyle(colorings: Ref<AttributeColoring[]>): Attribu
84
89
  return String(coloring.read("ColorMap"));
85
90
  });
86
91
 
87
- async function applyGlobalColormap(colorMap: string): Promise<void> {
92
+ async function applyGlobalColormap(colorMap: AttributeColorMap): Promise<void> {
88
93
  await writeAll("ColorMap", colorMap);
89
94
  }
90
95
 
91
- const currentRange = computed<readonly [number, number]>({
92
- get(): readonly [number, number] {
96
+ const currentRange = computed<Readonly<ValidAttributeRange>>({
97
+ get(): Readonly<ValidAttributeRange> {
93
98
  const [coloring] = colorings.value;
94
99
  if (!coloring) {
95
100
  return [0, 1];
@@ -99,7 +104,7 @@ function useAttributeColoringStyle(colorings: Ref<AttributeColoring[]>): Attribu
99
104
  return [minimum, maximum];
100
105
  },
101
106
  // Vue's WritableComputedOptions setter is strictly `(v: T) => void`: the async write is delegated.
102
- set: (range: readonly [number, number]): void => {
107
+ set: (range: Readonly<ValidAttributeRange>): void => {
103
108
  /* oxlint-disable-next-line promise/prefer-await-to-then -- setter cannot be async; see comment above. */
104
109
  writeAll("Range", range[0], range[1]).catch(() => undefined);
105
110
  },
@@ -152,7 +157,7 @@ function useAttributeColoringStyle(colorings: Ref<AttributeColoring[]>): Attribu
152
157
  }
153
158
  }
154
159
 
155
- const currentTimeStep = computed<number>({
160
+ const currentTimeStep = computed<AttributeTimeStep>({
156
161
  get(): number {
157
162
  const coloring = temporalColoring.value;
158
163
  if (!coloring) {
@@ -1,14 +1,8 @@
1
1
  import type { AttributeRangeInfo, AttributeSchemas } from "@ogw_front/utils/attribute_range";
2
- import type { AttributeRange } from "@ogw_front/composables/batch_style";
2
+ import type { AttributeTimeStep, ValidAttributeRange } from "@ogw_front/types/attribute";
3
+ import type { DataId } from "@ogw_front/types/identifiers";
3
4
  import { getAttributeRange } from "@ogw_front/utils/attributes";
4
5
 
5
- interface AttributeInfo {
6
- attribute_name: string;
7
- nb_items: number;
8
- time_steps?: number[];
9
- [key: string]: unknown;
10
- }
11
-
12
6
  // The minimum and maximum of an attribute range: each one is clamped by the other
13
7
  function useAttributeRangeBounds(attributeRange: Ref<(number | undefined)[]>): {
14
8
  rangeMin: WritableComputedRef<number | undefined>;
@@ -57,8 +51,8 @@ function attributeItemOptions(itemCount: number): { title: string; value: number
57
51
  function attributeRangesPerTarget(
58
52
  rangesPerTarget: ReadonlyMap<string, AttributeRangeInfo>,
59
53
  item: number,
60
- ): Map<string, AttributeRange> {
61
- const ranges = new Map<string, AttributeRange>();
54
+ ): Map<string, ValidAttributeRange> {
55
+ const ranges = new Map<string, ValidAttributeRange>();
62
56
  for (const [targetId, range] of rangesPerTarget) {
63
57
  const { min, max } = getAttributeRange(range, item);
64
58
  ranges.set(targetId, [min, max]);
@@ -70,7 +64,7 @@ function attributeRangesPerTarget(
70
64
  function useSeriesTimeStepCommit(
71
65
  timeSteps: ComputedRef<number[]>,
72
66
  seriesName: () => string | undefined,
73
- attributeTimeStep: Readonly<Ref<number | undefined>>,
67
+ attributeTimeStep: Readonly<Ref<AttributeTimeStep | undefined>>,
74
68
  resetTimeStep: () => void,
75
69
  ): () => void {
76
70
  let committedSeries: string | undefined = undefined;
@@ -102,21 +96,21 @@ interface AttributeRequestParams {
102
96
  // Params of the "names" request, or undefined when the schema needs components and none is selected
103
97
  function attributeRequestParams(
104
98
  schemas: AttributeSchemas,
105
- id: string,
99
+ dataId: DataId,
106
100
  componentIds: string[] | undefined,
107
101
  ): AttributeRequestParams | undefined {
108
102
  const { properties } = schemas.names;
109
103
  if (typeof properties !== "object" || properties === null || !("component_ids" in properties)) {
110
- return { id };
104
+ return { id: dataId };
111
105
  }
112
106
  if (!Array.isArray(componentIds) || componentIds.length === 0) {
113
107
  return undefined;
114
108
  }
115
- return { id, component_ids: componentIds };
109
+ return { id: dataId, component_ids: componentIds };
116
110
  }
117
111
 
112
+ export type { AttributeInfo } from "@ogw_front/utils/attributes";
118
113
  export {
119
- type AttributeInfo,
120
114
  type AttributeRequestParams,
121
115
  attributeItemOptions,
122
116
  attributeRequestParams,
@@ -1,3 +1,8 @@
1
+ import type {
2
+ AttributeRangeMaximum,
3
+ AttributeRangeMinimum,
4
+ ValidAttributeRange,
5
+ } from "@ogw_front/types/attribute";
1
6
  import {
2
7
  type ComputedRef,
3
8
  type InjectionKey,
@@ -7,11 +12,11 @@ import {
7
12
  provide,
8
13
  toValue,
9
14
  } from "vue";
15
+ import type { DataId } from "@ogw_front/types/identifiers";
10
16
  import { useDataStore } from "@ogw_front/stores/data";
11
17
  import { useTreeviewStore } from "@ogw_front/stores/treeview";
12
18
 
13
- type AttributeRange = [number, number];
14
- type RangesPerData = ReadonlyMap<string, AttributeRange>;
19
+ type RangesPerData = ReadonlyMap<string, ValidAttributeRange>;
15
20
 
16
21
  const BATCH_GROUP_KEY: InjectionKey<ComputedRef<string[]>> = Symbol("batch_group");
17
22
 
@@ -23,18 +28,22 @@ function injectBatchGroup(): ComputedRef<string[]> {
23
28
  return inject(BATCH_GROUP_KEY, () => computed(() => []), true);
24
29
  }
25
30
 
26
- function groupTargetsOf(targetIds: string[], id: string): string[] | undefined {
27
- return targetIds.includes(id) ? targetIds : undefined;
31
+ function groupTargetsOf(targetIds: string[], dataId: DataId): string[] | undefined {
32
+ return targetIds.includes(dataId) ? targetIds : undefined;
28
33
  }
29
34
 
30
- function useBatchGroup(id: MaybeRefOrGetter<string>): ComputedRef<string[] | undefined> {
35
+ function useBatchGroup(dataId: MaybeRefOrGetter<DataId>): ComputedRef<string[] | undefined> {
31
36
  const group = injectBatchGroup();
32
- return computed(() => groupTargetsOf(group.value, toValue(id)));
37
+ return computed(() => groupTargetsOf(group.value, toValue(dataId)));
33
38
  }
34
39
 
35
40
  async function applyRangesPerData(
36
41
  ranges: RangesPerData,
37
- setRange: (id: string, minimum: number, maximum: number) => unknown,
42
+ setRange: (
43
+ dataId: DataId,
44
+ minimum: AttributeRangeMinimum,
45
+ maximum: AttributeRangeMaximum,
46
+ ) => unknown,
38
47
  ): Promise<void> {
39
48
  await Promise.all(
40
49
  [...ranges].map(async ([targetId, [minimum, maximum]]) => {
@@ -45,7 +54,7 @@ async function applyRangesPerData(
45
54
 
46
55
  async function applyActionOn(
47
56
  targets: readonly string[],
48
- action: (id: string) => Promise<unknown>,
57
+ action: (dataId: DataId) => Promise<unknown>,
49
58
  ): Promise<void> {
50
59
  await Promise.all(
51
60
  targets.map(async (targetId) => {
@@ -60,23 +69,23 @@ function useBatchStyle(): { applyBatchStyle: typeof applyBatchStyle } {
60
69
  const group = injectBatchGroup();
61
70
 
62
71
  async function applyBatchStyle(
63
- id: string,
64
- action: (id: string) => Promise<unknown>,
72
+ dataId: DataId,
73
+ action: (dataId: DataId) => Promise<unknown>,
65
74
  ): Promise<void> {
66
- const groupTargets = groupTargetsOf(group.value, id);
75
+ const groupTargets = groupTargetsOf(group.value, dataId);
67
76
  if (groupTargets) {
68
77
  await applyActionOn(groupTargets, action);
69
78
  return;
70
79
  }
71
80
 
72
- const isActive = treeviewStore.activeItems.includes(id);
81
+ const isActive = treeviewStore.activeItems.includes(dataId);
73
82
  if (!isActive || treeviewStore.activeItems.length <= 1) {
74
- await action(id);
83
+ await action(dataId);
75
84
  return;
76
85
  }
77
86
 
78
87
  try {
79
- const currentItem = await dataStore.item(id);
88
+ const currentItem = await dataStore.item(dataId);
80
89
  const targetType = currentItem.geode_object_type;
81
90
 
82
91
  const promises = treeviewStore.activeItems.map(async (selectedId) => {
@@ -92,7 +101,7 @@ function useBatchStyle(): { applyBatchStyle: typeof applyBatchStyle } {
92
101
 
93
102
  await Promise.all(promises);
94
103
  } catch {
95
- await action(id);
104
+ await action(dataId);
96
105
  }
97
106
  }
98
107
 
@@ -100,4 +109,4 @@ function useBatchStyle(): { applyBatchStyle: typeof applyBatchStyle } {
100
109
  }
101
110
 
102
111
  export { BATCH_GROUP_KEY, applyRangesPerData, provideBatchGroup, useBatchGroup, useBatchStyle };
103
- export type { AttributeRange, RangesPerData };
112
+ export type { RangesPerData };
@@ -1,25 +1,26 @@
1
1
  import { type MaybeRefOrGetter, type WritableComputedRef, computed, toValue } from "vue";
2
+ import type { DataId } from "@ogw_front/types/identifiers";
2
3
  import { useBatchStyle } from "@ogw_front/composables/batch_style";
3
4
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
4
5
 
5
6
  // A style model applied to the whole batch of the data, then rendered
6
7
  function useBatchStyleModel<Value>(
7
- id: MaybeRefOrGetter<string>,
8
- getter: (id: string) => Value | undefined,
9
- setter: (id: string, value: Value) => Promise<unknown>,
8
+ dataId: MaybeRefOrGetter<DataId>,
9
+ getter: (dataId: DataId) => Value | undefined,
10
+ setter: (dataId: DataId, value: Value) => Promise<unknown>,
10
11
  ): WritableComputedRef<Value | undefined> {
11
12
  const hybridViewerStore = useHybridViewerStore();
12
13
  const { applyBatchStyle } = useBatchStyle();
13
14
 
14
15
  async function applyValue(value: Value): Promise<void> {
15
- await applyBatchStyle(toValue(id), async (targetId: string) => {
16
+ await applyBatchStyle(toValue(dataId), async (targetId: string) => {
16
17
  await setter(targetId, value);
17
18
  });
18
19
  await hybridViewerStore.remoteRender();
19
20
  }
20
21
 
21
22
  return computed<Value | undefined>({
22
- get: () => getter(toValue(id)),
23
+ get: () => getter(toValue(dataId)),
23
24
  // Vue's WritableComputedOptions setter is strictly `(v: T) => void`: the async write is delegated.
24
25
  set: (newValue: Value | undefined): void => {
25
26
  if (newValue === undefined) {
@@ -14,20 +14,17 @@ import {
14
14
  type vtkWidgetManager as WidgetManagerInstance,
15
15
  newInstance as vtkWidgetManager,
16
16
  } from "@kitware/vtk.js/Widgets/Core/WidgetManager";
17
+ import type { DataIdentified } from "@ogw_front/types/identifiers";
17
18
  import type { vtkGenericRenderWindow as GenericRenderWindowInstance } from "@ogw_internal/stores/hybrid_viewer/vtk_types";
18
19
  import type { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
19
20
  import type { vtkCamera } from "@kitware/vtk.js/Rendering/Core/Camera";
20
21
  import { newInstance as vtkGenericRenderWindow } from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow";
21
22
 
22
- interface DataItemLike {
23
- id: string;
24
- }
25
-
26
23
  interface ClippingPlanesWidgetParams {
27
24
  planes: Ref<ClippingPlane[]>;
28
25
  targetAllVisible: Ref<boolean>;
29
26
  selectedDatasetIds: Ref<string[]>;
30
- allItems: Ref<DataItemLike[]>;
27
+ allItems: Ref<DataIdentified[]>;
31
28
  hybridViewerStore: ReturnType<typeof useHybridViewerStore>;
32
29
  debouncedApply: (...args: readonly unknown[]) => void;
33
30
  }