@geode/opengeodeweb-front 10.43.2 → 10.44.0-rc.10

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 (254) hide show
  1. package/.build/server/utils/cleanup.js +7 -2
  2. package/.build/server/utils/microservices.js +9 -81
  3. package/.build/server/utils/microservices_process.js +85 -0
  4. package/.build/server/utils/scripts.js +34 -23
  5. package/.build/server/utils/typed_handler.js +5 -1
  6. package/.build/server/utils/ws_client.js +7 -2
  7. package/.build/shared/utils/fetch_raw.js +2 -2
  8. package/.build/shared/utils/parse_boolean.js +2 -1
  9. package/app/assets/geode_objects.ts +1 -0
  10. package/app/components/BasemapAttribution.vue +28 -0
  11. package/app/components/ClippingPlanes.vue +22 -78
  12. package/app/components/CrsSelector.vue +53 -46
  13. package/app/components/DragAndDrop.vue +16 -79
  14. package/app/components/FeedBack/Snackers.vue +27 -0
  15. package/app/components/FileSelector.vue +9 -6
  16. package/app/components/HybridViewerTooltip.vue +8 -2
  17. package/app/components/MissingFilesSelector.vue +40 -23
  18. package/app/components/ObjectSelector.vue +34 -20
  19. package/app/components/ProjectCrs.vue +37 -0
  20. package/app/components/Screenshot.vue +17 -59
  21. package/app/components/ThresholdCard.vue +205 -0
  22. package/app/components/ThresholdFilter.vue +81 -216
  23. package/app/components/ViewToolbar.vue +15 -231
  24. package/app/components/Viewer/Basemap/CropOptions.vue +50 -0
  25. package/app/components/Viewer/Basemap/OpacityOptions.vue +52 -0
  26. package/app/components/Viewer/ContextMenu/CircularItems.vue +1 -2
  27. package/app/components/Viewer/ContextMenu/ContextMenu.vue +11 -6
  28. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +10 -7
  29. package/app/components/Viewer/ContextMenu/InfoCard.vue +30 -0
  30. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +209 -0
  31. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +3 -191
  32. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +221 -0
  33. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +3 -210
  34. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +211 -0
  35. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -192
  36. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +13 -0
  37. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +227 -0
  38. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +3 -215
  39. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +221 -0
  40. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +3 -203
  41. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +14 -12
  42. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +2 -18
  43. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +145 -0
  44. package/app/components/Viewer/Generic/Model/CornersOptions.vue +15 -294
  45. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +173 -0
  46. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +218 -0
  47. package/app/components/Viewer/Generic/Model/LinesOptions.vue +15 -427
  48. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +229 -0
  49. package/app/components/Viewer/Generic/Model/ModelCardTabs.vue +35 -0
  50. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +34 -25
  51. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +34 -25
  52. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +17 -5
  53. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +16 -12
  54. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +4 -1
  55. package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +71 -1
  56. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +55 -10
  57. package/app/components/Viewer/Options/AttributeRangeSelector.vue +11 -4
  58. package/app/components/Viewer/Options/AttributeSelector.vue +40 -136
  59. package/app/components/Viewer/Options/ColorPicker.vue +4 -1
  60. package/app/components/Viewer/Options/ColoringTypeSelector.vue +48 -74
  61. package/app/components/Viewer/Options/ColormapQuickPicker.vue +13 -7
  62. package/app/components/Viewer/Options/NoDataColorInfo.vue +56 -0
  63. package/app/components/Viewer/Options/Sliders/Opacity.vue +22 -0
  64. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +13 -0
  65. package/app/components/Viewer/Scene/BackgroundOptions.vue +37 -0
  66. package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +48 -0
  67. package/app/components/Viewer/Scene/TextOptions.vue +63 -0
  68. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +217 -0
  69. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +4 -199
  70. package/app/components/Viewer/Surface/PolygonsColoring.vue +224 -0
  71. package/app/components/Viewer/Surface/PolygonsOptions.vue +3 -213
  72. package/app/components/Viewer/Ui.vue +9 -0
  73. package/app/components/csv-preview/CsvPreviewer.vue +4 -1
  74. package/app/composables/attribute_coloring_style.ts +8 -2
  75. package/app/composables/attribute_selector.ts +126 -0
  76. package/app/composables/batch_style_model.ts +34 -0
  77. package/app/composables/clipping_slices.ts +166 -0
  78. package/app/composables/global_attribute_style.ts +4 -3
  79. package/app/composables/hover_highlight.ts +19 -18
  80. package/app/composables/live_data_item.ts +39 -0
  81. package/app/composables/model_tabs.ts +86 -0
  82. package/app/composables/overlapping_picker_menu.ts +43 -0
  83. package/app/composables/project_manager.ts +5 -81
  84. package/app/composables/project_manager_helpers/reset.ts +34 -0
  85. package/app/composables/project_manager_helpers/restore.ts +67 -0
  86. package/app/composables/project_manager_helpers/types.ts +24 -0
  87. package/app/composables/project_manager_helpers/viewer_session.ts +25 -0
  88. package/app/composables/stepper_tree.ts +10 -2
  89. package/app/composables/tree_filter.ts +11 -2
  90. package/app/composables/tree_keyboard_nav.ts +4 -2
  91. package/app/composables/use_overlapping_picker.ts +30 -42
  92. package/app/composables/view_toolbar_options.ts +126 -0
  93. package/app/composables/view_toolbar_tool_options.ts +115 -0
  94. package/app/composables/view_toolbar_tools.ts +108 -0
  95. package/app/composables/viewer_context_menu.ts +19 -1
  96. package/app/composables/virtual_tree.ts +20 -131
  97. package/app/composables/virtual_tree_flatten.ts +109 -0
  98. package/app/composables/virtual_tree_types.ts +81 -0
  99. package/app/stores/app.ts +8 -55
  100. package/app/stores/app_helpers/extension.ts +90 -51
  101. package/app/stores/app_helpers/registry.ts +69 -0
  102. package/app/stores/basemap.ts +52 -0
  103. package/app/stores/basemap_detail.ts +51 -0
  104. package/app/stores/basemap_helpers/builds.ts +158 -0
  105. package/app/stores/basemap_helpers/detail_layers.ts +72 -0
  106. package/app/stores/basemap_helpers/detail_map.ts +62 -0
  107. package/app/stores/basemap_helpers/detail_refresh.ts +134 -0
  108. package/app/stores/basemap_helpers/detail_view.ts +94 -0
  109. package/app/stores/basemap_helpers/extent.ts +40 -0
  110. package/app/stores/basemap_helpers/georeferenced.ts +50 -0
  111. package/app/stores/basemap_helpers/layers.ts +66 -0
  112. package/app/stores/basemap_helpers/settings.ts +87 -0
  113. package/app/stores/basemap_helpers/viewer.ts +114 -0
  114. package/app/stores/crs.ts +136 -0
  115. package/app/stores/data.ts +24 -1
  116. package/app/stores/data_style.ts +8 -0
  117. package/app/stores/feedback.ts +12 -2
  118. package/app/stores/hybrid_viewer.ts +1 -1
  119. package/app/stores/infra.ts +26 -21
  120. package/app/stores/menu.ts +8 -124
  121. package/app/stores/menu_helpers/basemap.ts +10 -0
  122. package/app/stores/menu_helpers/menus_data.ts +27 -0
  123. package/app/stores/menu_helpers/mesh/edged_curve.ts +12 -0
  124. package/app/stores/menu_helpers/mesh/grid.ts +24 -0
  125. package/app/stores/menu_helpers/mesh/point_set.ts +11 -0
  126. package/app/stores/menu_helpers/mesh/solid.ts +29 -0
  127. package/app/stores/menu_helpers/mesh/surface.ts +22 -0
  128. package/app/stores/menu_helpers/model.ts +25 -0
  129. package/app/stores/menu_helpers/scene.ts +10 -0
  130. package/app/stores/menu_helpers/types.ts +5 -0
  131. package/app/stores/treeview.ts +17 -10
  132. package/app/stores/viewer.ts +17 -79
  133. package/app/stores/viewer_helpers/actions.ts +68 -0
  134. package/app/stores/viewer_helpers/request.ts +61 -0
  135. package/app/utils/basemap_tree.ts +76 -0
  136. package/app/utils/clipping_planes.ts +4 -131
  137. package/app/utils/clipping_planes_scene.ts +131 -0
  138. package/app/utils/color_picker.ts +18 -15
  139. package/app/utils/coloring_styles.ts +101 -0
  140. package/app/utils/crs.ts +38 -0
  141. package/app/utils/default_styles/constants.ts +10 -0
  142. package/app/utils/default_styles/index.ts +17 -1
  143. package/app/utils/default_styles/mesh_components.ts +168 -0
  144. package/app/utils/default_styles/meshes.ts +13 -153
  145. package/app/utils/default_styles/model_components.ts +170 -0
  146. package/app/utils/default_styles/models.ts +16 -153
  147. package/app/utils/drag_and_drop.ts +80 -0
  148. package/app/utils/extension.ts +1 -1
  149. package/app/utils/import_workflow.ts +26 -11
  150. package/app/utils/model_component_coloring.ts +46 -0
  151. package/app/utils/threshold.ts +33 -0
  152. package/app/utils/threshold_sources.ts +51 -0
  153. package/app/utils/treeview.ts +12 -1
  154. package/app/utils/upload_path.ts +15 -9
  155. package/app/utils/visible_map_area.ts +129 -0
  156. package/internal/database/base_database.ts +2 -0
  157. package/internal/database/database.ts +47 -29
  158. package/internal/database/tables/scene_style.ts +6 -0
  159. package/internal/stores/data_style/mesh/base_style.ts +74 -0
  160. package/internal/stores/data_style/mesh/cells/cell.ts +27 -150
  161. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +74 -0
  162. package/internal/stores/data_style/mesh/cells/cell_config.ts +152 -0
  163. package/internal/stores/data_style/mesh/cells/color.ts +3 -1
  164. package/internal/stores/data_style/mesh/cells/index.ts +17 -1
  165. package/internal/stores/data_style/mesh/cells/opacity.ts +54 -0
  166. package/internal/stores/data_style/mesh/cells/vertex.ts +26 -157
  167. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +80 -0
  168. package/internal/stores/data_style/mesh/cells/vertex_config.ts +152 -0
  169. package/internal/stores/data_style/mesh/edges/color.ts +3 -1
  170. package/internal/stores/data_style/mesh/edges/edge.ts +27 -150
  171. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +74 -0
  172. package/internal/stores/data_style/mesh/edges/edge_config.ts +152 -0
  173. package/internal/stores/data_style/mesh/edges/index.ts +17 -1
  174. package/internal/stores/data_style/mesh/edges/opacity.ts +54 -0
  175. package/internal/stores/data_style/mesh/edges/vertex.ts +26 -157
  176. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +80 -0
  177. package/internal/stores/data_style/mesh/edges/vertex_config.ts +152 -0
  178. package/internal/stores/data_style/mesh/index.ts +2 -57
  179. package/internal/stores/data_style/mesh/points/color.ts +3 -1
  180. package/internal/stores/data_style/mesh/points/index.ts +17 -1
  181. package/internal/stores/data_style/mesh/points/opacity.ts +54 -0
  182. package/internal/stores/data_style/mesh/points/vertex.ts +26 -157
  183. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +80 -0
  184. package/internal/stores/data_style/mesh/points/vertex_config.ts +152 -0
  185. package/internal/stores/data_style/mesh/polygons/color.ts +3 -1
  186. package/internal/stores/data_style/mesh/polygons/index.ts +17 -1
  187. package/internal/stores/data_style/mesh/polygons/opacity.ts +54 -0
  188. package/internal/stores/data_style/mesh/polygons/polygon.ts +27 -152
  189. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +80 -0
  190. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +148 -0
  191. package/internal/stores/data_style/mesh/polygons/vertex.ts +26 -157
  192. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +80 -0
  193. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +152 -0
  194. package/internal/stores/data_style/mesh/polyhedra/color.ts +3 -1
  195. package/internal/stores/data_style/mesh/polyhedra/index.ts +17 -1
  196. package/internal/stores/data_style/mesh/polyhedra/opacity.ts +54 -0
  197. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +27 -160
  198. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +82 -0
  199. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +157 -0
  200. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +26 -157
  201. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +80 -0
  202. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +152 -0
  203. package/internal/stores/data_style/model/blocks/apply_coloring.ts +173 -0
  204. package/internal/stores/data_style/model/blocks/color.ts +58 -57
  205. package/internal/stores/data_style/model/blocks/coloring_groups.ts +18 -0
  206. package/internal/stores/data_style/model/blocks/index.ts +12 -140
  207. package/internal/stores/data_style/model/blocks/polyhedron.ts +102 -54
  208. package/internal/stores/data_style/model/blocks/vertex.ts +102 -54
  209. package/internal/stores/data_style/model/color.ts +25 -26
  210. package/internal/stores/data_style/model/common.ts +10 -119
  211. package/internal/stores/data_style/model/common_mutations.ts +184 -0
  212. package/internal/stores/data_style/model/corners/index.ts +85 -78
  213. package/internal/stores/data_style/model/corners/vertex.ts +97 -49
  214. package/internal/stores/data_style/model/lines/apply_coloring.ts +154 -0
  215. package/internal/stores/data_style/model/lines/color.ts +53 -40
  216. package/internal/stores/data_style/model/lines/coloring_groups.ts +18 -0
  217. package/internal/stores/data_style/model/lines/edge.ts +102 -54
  218. package/internal/stores/data_style/model/lines/index.ts +10 -134
  219. package/internal/stores/data_style/model/lines/vertex.ts +102 -54
  220. package/internal/stores/data_style/model/surfaces/apply_coloring.ts +186 -0
  221. package/internal/stores/data_style/model/surfaces/color.ts +68 -56
  222. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +18 -0
  223. package/internal/stores/data_style/model/surfaces/index.ts +16 -160
  224. package/internal/stores/data_style/model/surfaces/polygon.ts +94 -46
  225. package/internal/stores/data_style/model/surfaces/vertex.ts +94 -46
  226. package/internal/stores/data_style/model/visibility.ts +3 -156
  227. package/internal/stores/data_style/model/visibility_dispatch.ts +110 -0
  228. package/internal/stores/data_style/scene.ts +118 -0
  229. package/internal/stores/data_style/state.ts +5 -181
  230. package/internal/stores/data_style/state_shared.ts +199 -0
  231. package/internal/stores/data_style/types.ts +24 -1
  232. package/internal/stores/hybrid_viewer/brightness.ts +8 -2
  233. package/internal/stores/hybrid_viewer/camera.ts +7 -161
  234. package/internal/stores/hybrid_viewer/camera_animation.ts +4 -3
  235. package/internal/stores/hybrid_viewer/camera_helpers.ts +120 -0
  236. package/internal/stores/hybrid_viewer/camera_orientation.ts +60 -0
  237. package/internal/stores/hybrid_viewer/filters.ts +54 -11
  238. package/internal/stores/hybrid_viewer/highlight.ts +80 -63
  239. package/internal/stores/hybrid_viewer/ruler.ts +4 -3
  240. package/internal/stores/hybrid_viewer/scene.ts +34 -26
  241. package/internal/stores/hybrid_viewer/vtk_types.ts +2 -1
  242. package/internal/utils/ws_client.ts +8 -1
  243. package/package.json +5 -5
  244. package/server/api/local/extensions/run.post.ts +6 -4
  245. package/server/api/local/extensions/upload.put.ts +47 -20
  246. package/server/utils/cleanup.ts +12 -2
  247. package/server/utils/microservices.ts +10 -102
  248. package/server/utils/microservices_process.ts +127 -0
  249. package/server/utils/scripts.ts +35 -30
  250. package/server/utils/typed_handler.ts +8 -1
  251. package/server/utils/ws_client.ts +15 -2
  252. package/shared/utils/fetch_raw.ts +2 -2
  253. package/shared/utils/parse_boolean.ts +4 -1
  254. package/app/components/Viewer/Options/OptionsSection.vue +0 -76
@@ -1,13 +1,18 @@
1
1
  <script setup lang="ts">
2
+ // oxlint-disable max-dependencies
2
3
  import {
3
- type DataMenuPayload,
4
- type GeodeObjectTypeMenuPayload,
5
- compareSelections,
6
- } from "@ogw_front/utils/treeview";
4
+ type MapStyle,
5
+ basemapGroup,
6
+ isBasemapId,
7
+ mapId,
8
+ nextBasemapMaps,
9
+ } from "@ogw_front/utils/basemap_tree";
10
+ import { type TreeMenuPayload, compareSelections } from "@ogw_front/utils/treeview";
7
11
  import CommonTreeView from "@ogw_front/components/Viewer/ObjectTree/Base/CommonTreeView.vue";
8
12
  import type { DisplayItem } from "@ogw_front/composables/virtual_tree";
9
13
  import ObjectTreeControls from "@ogw_front/components/Viewer/ObjectTree/Base/Controls.vue";
10
14
  import ObjectTreeItemLabel from "@ogw_front/components/Viewer/ObjectTree/Base/ItemLabel.vue";
15
+ import { useBasemapStore } from "@ogw_front/stores/basemap";
11
16
  import { useDataStore } from "@ogw_front/stores/data";
12
17
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
13
18
  import { useHoverhighlight } from "@ogw_front/composables/hover_highlight";
@@ -19,10 +24,11 @@ const treeviewStore = useTreeviewStore();
19
24
  const dataStore = useDataStore();
20
25
  const dataStyleStore = useDataStyleStore();
21
26
  const hybridViewerStore = useHybridViewerStore();
27
+ const basemapStore = useBasemapStore();
22
28
  const { onHoverEnter, onHoverLeave } = useHoverhighlight();
23
29
 
24
30
  interface Emits {
25
- "show-menu": [payload: DataMenuPayload | GeodeObjectTypeMenuPayload];
31
+ "show-menu": [payload: TreeMenuPayload];
26
32
  }
27
33
 
28
34
  const emit = defineEmits<Emits>();
@@ -53,11 +59,40 @@ const {
53
59
  applySearchFilter,
54
60
  } = useTreeFilter(() => treeviewStore.items, { recursiveSort: true });
55
61
 
62
+ // The basemap category comes first, out of the data sort and filters
63
+ const displayedItems = computed(() => {
64
+ if (!basemapStore.available) {
65
+ return processedItems.value;
66
+ }
67
+ return [basemapGroup(), ...processedItems.value];
68
+ });
69
+
70
+ // The basemap rows show the basemap state: they are never stored in the data selection
71
+ const basemapRows = computed<string[]>(() => basemapStore.maps.map((mapStyle) => mapId(mapStyle)));
72
+
73
+ async function showBasemap(maps: MapStyle[]): Promise<void> {
74
+ try {
75
+ await basemapStore.setMaps(maps);
76
+ } catch {
77
+ // Already reported by the request feedback
78
+ }
79
+ }
80
+
81
+ // Basemap rows are never filtered out by the search
56
82
  function onUpdateSelection(val: string[]): void {
57
- treeviewStore.selection = applySearchFilter(val, treeviewStore.selection);
83
+ const { added, removed } = compareSelections(val, basemapRows.value);
84
+ const maps = nextBasemapMaps(basemapStore.maps, basemapStore.shown, added, removed);
85
+ if (maps.join(",") !== basemapStore.maps.join(",")) {
86
+ void showBasemap(maps);
87
+ }
88
+ const data = val.filter((id) => !isBasemapId(id));
89
+ treeviewStore.selection = applySearchFilter(data, treeviewStore.selection);
58
90
  }
59
91
 
60
- const visibleSelection = computed<string[]>(() => applySearchFilter(treeviewStore.selection, []));
92
+ const visibleSelection = computed<string[]>(() => [
93
+ ...applySearchFilter(treeviewStore.selection, []),
94
+ ...basemapRows.value,
95
+ ]);
61
96
 
62
97
  watch(
63
98
  () => treeviewStore.selection,
@@ -88,6 +123,10 @@ watch(
88
123
 
89
124
  function showMenu(event: MouseEvent, item: TreeGroupItem): void {
90
125
  const actualItem = item.raw || item;
126
+ if (isBasemapId(actualItem.id)) {
127
+ emit("show-menu", { event, itemId: actualItem.id, context_type: "basemap" });
128
+ return;
129
+ }
91
130
  if (!actualItem.children) {
92
131
  emit("show-menu", { event, itemId: actualItem.id });
93
132
  return;
@@ -126,7 +165,12 @@ function handleHoverEnter({
126
165
 
127
166
  onHoverEnter(
128
167
  actualItem.id,
129
- async () => (is_model ? await dataStore.getAllModelComponentsViewerIds(actualItem.id) : []),
168
+ async () => {
169
+ if (is_model) {
170
+ return await dataStore.getAllModelComponentsViewerIds(actualItem.id);
171
+ }
172
+ return [];
173
+ },
130
174
  is_model ? "model" : "mesh",
131
175
  immediate,
132
176
  );
@@ -150,7 +194,7 @@ function expandAll(): void {
150
194
  }
151
195
  }
152
196
  }
153
- traverse(treeviewStore.items);
197
+ traverse(displayedItems.value);
154
198
  opened.value = allIds;
155
199
  }
156
200
  </script>
@@ -172,7 +216,7 @@ function expandAll(): void {
172
216
  :selected="visibleSelection"
173
217
  v-model:opened="opened"
174
218
  v-model:active="treeviewStore.activeItems"
175
- :items="processedItems"
219
+ :items="displayedItems"
176
220
  :options="{
177
221
  selection: { selectable: true },
178
222
  search,
@@ -193,6 +237,7 @@ function expandAll(): void {
193
237
  <ObjectTreeItemLabel
194
238
  :item="item as unknown as DisplayItem"
195
239
  :is-leaf="isLeaf"
240
+ :show-crs="isLeaf && !isBasemapId(item.id as string)"
196
241
  @contextmenu="showMenu($event, item as unknown as TreeGroupItem)"
197
242
  />
198
243
  </template>
@@ -11,10 +11,17 @@ const maximum = defineModel<number>("maximum");
11
11
  const minimumText = ref<string>("");
12
12
  const maximumText = ref<string>("");
13
13
 
14
- watch(minimum, (value) => (minimumText.value = value === undefined ? "" : String(value)), {
14
+ function formatValue(value: number | undefined): string {
15
+ if (value === undefined) {
16
+ return "";
17
+ }
18
+ return String(value);
19
+ }
20
+
21
+ watch(minimum, (value) => (minimumText.value = formatValue(value)), {
15
22
  immediate: true,
16
23
  });
17
- watch(maximum, (value) => (maximumText.value = value === undefined ? "" : String(value)), {
24
+ watch(maximum, (value) => (maximumText.value = formatValue(value)), {
18
25
  immediate: true,
19
26
  });
20
27
 
@@ -27,7 +34,7 @@ function parseValue(text: string): number | undefined {
27
34
  function commitMinimum(): void {
28
35
  const value = parseValue(minimumText.value);
29
36
  if (value === undefined) {
30
- minimumText.value = minimum.value === undefined ? "" : String(minimum.value);
37
+ minimumText.value = formatValue(minimum.value);
31
38
  return;
32
39
  }
33
40
  minimum.value = value;
@@ -36,7 +43,7 @@ function commitMinimum(): void {
36
43
  function commitMaximum(): void {
37
44
  const value = parseValue(maximumText.value);
38
45
  if (value === undefined) {
39
- maximumText.value = maximum.value === undefined ? "" : String(maximum.value);
46
+ maximumText.value = formatValue(maximum.value);
40
47
  return;
41
48
  }
42
49
  maximum.value = value;
@@ -1,18 +1,23 @@
1
1
  <script setup lang="ts">
2
2
  import {
3
- type AttributeRange,
4
- type RangesPerData,
5
- useBatchGroup,
6
- } from "@ogw_front/composables/batch_style";
3
+ type AttributeInfo,
4
+ type AttributeRequestParams,
5
+ attributeItemOptions,
6
+ attributeRangesPerTarget,
7
+ attributeRequestParams,
8
+ useAttributeRangeBounds,
9
+ useSeriesTimeStepCommit,
10
+ } from "@ogw_front/composables/attribute_selector";
7
11
  import {
8
12
  type AttributeRangeInfo,
9
13
  type AttributeSchemas,
10
14
  fetchAttributeRange,
11
15
  } from "@ogw_front/utils/attribute_range";
16
+ import { type RangesPerData, useBatchGroup } from "@ogw_front/composables/batch_style";
12
17
  import { getAttributeRange, intersectAttributes } from "@ogw_front/utils/attributes";
13
18
  import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
14
19
  import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar.vue";
15
- import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
20
+ import ViewerOptionsNoDataColorInfo from "@ogw_front/components/Viewer/Options/NoDataColorInfo.vue";
16
21
  import ViewerOptionsTimeStepSlider from "@ogw_front/components/Viewer/Options/TimeStepSlider.vue";
17
22
  import { requestForTargets } from "@ogw_front/utils/request_for_targets";
18
23
  import { useBackStore } from "@ogw_front/stores/back";
@@ -44,13 +49,6 @@ interface Emits {
44
49
 
45
50
  const emit = defineEmits<Emits>();
46
51
 
47
- interface AttributeInfo {
48
- attribute_name: string;
49
- nb_items: number;
50
- time_steps?: number[];
51
- [key: string]: unknown;
52
- }
53
-
54
52
  const attributes = ref<AttributeInfo[]>([]);
55
53
  let attributesPerTarget = new Map<string, AttributeInfo[]>();
56
54
  const rangesPerTarget = ref(new Map<string, AttributeRangeInfo>());
@@ -67,96 +65,49 @@ const noData = computed<boolean>(() =>
67
65
  [...rangesPerTarget.value.values()].some((range) => range.no_data),
68
66
  );
69
67
 
70
- let committedSeries: string | undefined = undefined;
71
-
72
- function commitSeriesTimeStep(): void {
73
- if (timeSteps.value.length === 0) {
74
- committedSeries = undefined;
75
- return;
76
- }
77
- const name = currentAttribute.value?.attribute_name;
78
- if (name === committedSeries) {
79
- return;
80
- }
81
- committedSeries = name;
82
- const current = attributeTimeStep.value;
83
- const valid = current !== undefined && current >= 0 && current < timeSteps.value.length;
84
- // A valid step is already stored and applied with the series: emitting it again re-applies the attribute
85
- if (!valid) {
68
+ const commitSeriesTimeStep = useSeriesTimeStepCommit(
69
+ timeSteps,
70
+ () => currentAttribute.value?.attribute_name,
71
+ attributeTimeStep,
72
+ () => {
86
73
  emit("update:attributeTimeStep", 0);
87
- }
88
- }
89
-
90
- const cssNoDataColor = computed<string>(() => {
91
- const { red, green, blue, alpha } = attributeNoDataColor.value ?? DEFAULT_NO_DATA_COLOR;
92
- return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
93
- });
94
- const rangeMin = computed<number | undefined>({
95
- get: () => attributeRange.value[0],
96
- set: (val: number | undefined) => {
97
- if (val === undefined) {
98
- return;
99
- }
100
- const [, currentMax] = attributeRange.value;
101
- let newMin = val;
102
- if (typeof currentMax === "number" && val > currentMax) {
103
- newMin = currentMax;
104
- }
105
- attributeRange.value = [newMin, currentMax];
106
74
  },
107
- });
108
- const rangeMax = computed<number | undefined>({
109
- get: () => attributeRange.value[1],
110
- set: (val: number | undefined) => {
111
- if (val === undefined) {
112
- return;
113
- }
114
- const [currentMin] = attributeRange.value;
115
- let newMax = val;
116
- if (typeof currentMin === "number" && val < currentMin) {
117
- newMax = currentMin;
118
- }
119
- attributeRange.value = [currentMin, newMax];
120
- },
121
- });
75
+ );
76
+
77
+ const { rangeMin, rangeMax } = useAttributeRangeBounds(attributeRange);
122
78
 
123
79
  const componentItems = computed<{ title: string; value: number }[]>(() => {
124
- if (!currentAttribute.value) {
125
- return [];
80
+ if (currentAttribute.value) {
81
+ return attributeItemOptions(currentAttribute.value.nb_items);
126
82
  }
127
- return Array.from({ length: currentAttribute.value.nb_items }, (_, index) => ({
128
- title: `Item ${index + 1}`,
129
- value: index,
130
- }));
83
+ return [];
131
84
  });
132
85
 
133
- function hasSelectedComponent(components: unknown): boolean {
134
- return Array.isArray(components) && components.length > 0;
86
+ function requestParams(): AttributeRequestParams | undefined {
87
+ return attributeRequestParams(schemas, id, componentIds);
135
88
  }
136
89
 
137
- function requestParams(): { id: string; component_ids?: string[] } | undefined {
138
- const schemaProperties = schemas.names.properties as Record<string, unknown> | undefined;
139
- if (schemaProperties?.component_ids === undefined) {
140
- return { id };
90
+ function getRangeTargets(name: string): [string, AttributeRequestParams | undefined][] {
91
+ if (groupTargetIds.value) {
92
+ return [...attributesPerTarget]
93
+ .filter(([, targetAttributes]) =>
94
+ targetAttributes.some((attribute) => attribute.attribute_name === name),
95
+ )
96
+ .map(([targetId]) => [targetId, { id: targetId }]);
141
97
  }
142
- return hasSelectedComponent(componentIds) ? { id, component_ids: componentIds } : undefined;
98
+ return [[id, requestParams()]];
143
99
  }
144
100
 
145
101
  // Ranges are computed by the back for the selected attribute only, as scanning every step of every series is slow
146
102
  async function requestRanges(name: string): Promise<void> {
147
- const targets: [string, { id: string; component_ids?: string[] } | undefined][] =
148
- groupTargetIds.value
149
- ? [...attributesPerTarget]
150
- .filter(([, targetAttributes]) =>
151
- targetAttributes.some((attribute) => attribute.attribute_name === name),
152
- )
153
- .map(([targetId]) => [targetId, { id: targetId }])
154
- : [[id, requestParams()]];
103
+ const targets = getRangeTargets(name);
155
104
  const entries = await Promise.all(
156
- targets.map(async ([targetId, params]): Promise<[string, AttributeRangeInfo | undefined]> => [
157
- targetId,
158
- params ? await fetchAttributeRange(schemas.range, params, name) : undefined,
159
- ]),
105
+ targets.map(async ([targetId, params]): Promise<[string, AttributeRangeInfo | undefined]> => {
106
+ if (!params) {
107
+ return [targetId, undefined];
108
+ }
109
+ return [targetId, await fetchAttributeRange(schemas.range, params, name)];
110
+ }),
160
111
  );
161
112
  if (rangesName !== name) {
162
113
  return;
@@ -206,13 +157,8 @@ async function initGroupAttribute(name: string, item: number): Promise<void> {
206
157
  if (attributeName.value !== name) {
207
158
  return;
208
159
  }
209
- const ranges = new Map<string, AttributeRange>();
210
- for (const [targetId, range] of rangesPerTarget.value) {
211
- const { min, max } = getAttributeRange(range, item);
212
- ranges.set(targetId, [min, max]);
213
- }
214
160
  emit("update:attributeColorMap", attributeColorMap.value ?? "batlow");
215
- emit("ranges_per_data", ranges);
161
+ emit("ranges_per_data", attributeRangesPerTarget(rangesPerTarget.value, item));
216
162
  }
217
163
 
218
164
  async function getAttributes(): Promise<void> {
@@ -300,29 +246,7 @@ watch([attributeName, attributeItem, currentAttribute], async () => {
300
246
  hide-details
301
247
  />
302
248
  <ViewerOptionsTimeStepSlider v-model="attributeTimeStep" :time-steps="timeSteps" />
303
- <div
304
- v-if="currentAttribute && noData"
305
- class="text-caption text-high-emphasis mt-1 d-flex align-center ga-1"
306
- data-testid="noDataInfo"
307
- >
308
- <v-icon icon="mdi-information-outline" size="14" color="info" />
309
- <span>Contains unmapped elements</span>
310
- <v-menu :close-on-content-click="false">
311
- <template #activator="{ props }">
312
- <button
313
- v-bind="props"
314
- type="button"
315
- class="color-picker-rect-btn ml-1"
316
- :style="{ backgroundColor: cssNoDataColor }"
317
- v-tooltip="'Change unmapped elements color'"
318
- data-testid="noDataColorBtn"
319
- />
320
- </template>
321
- <v-card class="pa-2">
322
- <ViewerOptionsColorPicker v-model="attributeNoDataColor" disabled-alpha />
323
- </v-card>
324
- </v-menu>
325
- </div>
249
+ <ViewerOptionsNoDataColorInfo v-if="currentAttribute && noData" v-model="attributeNoDataColor" />
326
250
  <ViewerOptionsAttributeColorBar
327
251
  v-if="attributeName"
328
252
  v-model:minimum="rangeMin"
@@ -332,23 +256,3 @@ watch([attributeName, attributeItem, currentAttribute], async () => {
332
256
  @reset="resetRange"
333
257
  />
334
258
  </template>
335
-
336
- <style scoped>
337
- .color-picker-rect-btn {
338
- width: 26px;
339
- height: 15px;
340
- border-radius: 3px;
341
- border: 2px solid rgba(255, 255, 255, 0.912);
342
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
343
- cursor: pointer;
344
- outline: none;
345
- transition:
346
- border-color 0.15s ease,
347
- transform 0.15s ease;
348
- }
349
-
350
- .color-picker-rect-btn:hover {
351
- border-color: rgba(255, 255, 255, 0.9);
352
- transform: scale(1.1);
353
- }
354
- </style>
@@ -50,7 +50,10 @@ function onPickerUpdate(color: VuetifyColor): void {
50
50
  const red = Math.round(color.r);
51
51
  const green = Math.round(color.g);
52
52
  const blue = Math.round(color.b);
53
- const alpha = disabledAlpha ? 1 : Number(color.a.toFixed(2));
53
+ let alpha = 1;
54
+ if (!disabledAlpha) {
55
+ alpha = Number(color.a.toFixed(2));
56
+ }
54
57
 
55
58
  vuetifyColor.value = { r: red, g: green, b: blue, a: alpha };
56
59
  updateInputTextFromColor(red, green, blue, alpha);
@@ -1,11 +1,16 @@
1
1
  <script setup lang="ts">
2
- import type { AttributeSchemas } from "@ogw_front/utils/attribute_range";
2
+ import {
3
+ COLORING_STYLES,
4
+ type Schemas,
5
+ buildColoringStyles,
6
+ resolveAttributeSchemas,
7
+ } from "@ogw_front/utils/coloring_styles";
3
8
  import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
4
9
  import type { RangesPerData } from "@ogw_front/composables/batch_style";
5
10
  import ViewerOptionsAttributeSelector from "@ogw_front/components/Viewer/Options/AttributeSelector.vue";
6
11
  import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
12
+ import ViewerOptionsOpacitySlider from "@ogw_front/components/Viewer/Options/Sliders/Opacity.vue";
7
13
  import ViewerOptionsTexturesSelector from "@ogw_front/components/Viewer/Options/TexturesSelector.vue";
8
- import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
9
14
 
10
15
  interface Texture {
11
16
  id: string;
@@ -17,14 +22,6 @@ interface CapabilityConfig {
17
22
  hasColorMap?: boolean;
18
23
  }
19
24
 
20
- interface Schemas {
21
- vertex?: AttributeSchemas;
22
- edge?: AttributeSchemas;
23
- cell?: AttributeSchemas;
24
- polygon?: AttributeSchemas;
25
- polyhedron?: AttributeSchemas;
26
- }
27
-
28
25
  const coloring_style_key = defineModel<string>("coloring_style_key");
29
26
 
30
27
  interface Emits {
@@ -38,6 +35,7 @@ interface Emits {
38
35
  const emit = defineEmits<Emits>();
39
36
 
40
37
  const color = defineModel<RGBAColor>("color");
38
+ const opacity = defineModel<number>("opacity");
41
39
  const textures = defineModel<Texture[]>("textures");
42
40
 
43
41
  const vertex_attribute_name = defineModel<string>("vertex_attribute_name");
@@ -95,27 +93,13 @@ const {
95
93
  allowRandom = false,
96
94
  } = defineProps<Props>();
97
95
 
98
- const backSchemas = back_schemas.opengeodeweb_back;
99
- const vertexSchemas = schemas.vertex ?? {
100
- names: backSchemas.vertex_attribute_names,
101
- range: backSchemas.vertex_attribute_range,
102
- };
103
- const edgeSchemas = schemas.edge ?? {
104
- names: backSchemas.edge_attribute_names,
105
- range: backSchemas.edge_attribute_range,
106
- };
107
- const cellSchemas = schemas.cell ?? {
108
- names: backSchemas.cell_attribute_names,
109
- range: backSchemas.cell_attribute_range,
110
- };
111
- const polygonSchemas = schemas.polygon ?? {
112
- names: backSchemas.polygon_attribute_names,
113
- range: backSchemas.polygon_attribute_range,
114
- };
115
- const polyhedronSchemas = schemas.polyhedron ?? {
116
- names: backSchemas.polyhedron_attribute_names,
117
- range: backSchemas.polyhedron_attribute_range,
118
- };
96
+ const {
97
+ vertex: vertexSchemas,
98
+ edge: edgeSchemas,
99
+ cell: cellSchemas,
100
+ polygon: polygonSchemas,
101
+ polyhedron: polyhedronSchemas,
102
+ } = resolveAttributeSchemas(schemas);
119
103
 
120
104
  function isAvailable(key: string): boolean {
121
105
  if (capabilities[key] && capabilities[key].available === false) {
@@ -156,49 +140,29 @@ const has_polyhedra = computed<boolean>(
156
140
  hasColorMap("polyhedron"),
157
141
  );
158
142
 
159
- const color_dict = { name: "Constant", value: "constant" };
160
- const random_dict = { name: "Random", value: "random" };
161
- const textures_dict = { name: "Textures", value: "textures" };
162
- const vertex_dict = { name: "Vertex attribute", value: "vertex" };
163
- const edge_dict = { name: "Edge attribute", value: "edge" };
164
- const cell_dict = { name: "Cell attribute", value: "cell" };
165
- const polygon_dict = { name: "Polygon attribute", value: "polygon" };
166
- const polyhedron_dict = {
167
- name: "Polyhedron attribute",
168
- value: "polyhedron",
169
- };
170
- const coloring_styles = computed<{ labels: string[]; values: string[] }>(() => {
171
- const array = [];
172
- if (has_color.value) {
173
- array.push(color_dict);
174
- if (allowRandom) {
175
- array.push(random_dict);
176
- }
177
- }
178
- if (has_textures.value) {
179
- array.push(textures_dict);
180
- }
181
- if (has_vertex.value) {
182
- array.push(vertex_dict);
183
- }
184
- if (has_edge.value) {
185
- array.push(edge_dict);
186
- }
187
- if (has_cells.value) {
188
- array.push(cell_dict);
189
- }
190
- if (has_polygons.value) {
191
- array.push(polygon_dict);
192
- }
193
- if (has_polyhedra.value) {
194
- array.push(polyhedron_dict);
195
- }
196
-
197
- const labels = array.map((coloring) => coloring.name);
198
- const values = array.map((coloring) => coloring.value);
199
-
200
- return { labels, values };
201
- });
143
+ const {
144
+ color: color_dict,
145
+ textures: textures_dict,
146
+ vertex: vertex_dict,
147
+ edge: edge_dict,
148
+ cell: cell_dict,
149
+ polygon: polygon_dict,
150
+ polyhedron: polyhedron_dict,
151
+ } = COLORING_STYLES;
152
+ const coloring_styles = computed<{ labels: string[]; values: string[] }>(() =>
153
+ buildColoringStyles(
154
+ {
155
+ color: has_color.value,
156
+ textures: has_textures.value,
157
+ vertex: has_vertex.value,
158
+ edge: has_edge.value,
159
+ cell: has_cells.value,
160
+ polygon: has_polygons.value,
161
+ polyhedron: has_polyhedra.value,
162
+ },
163
+ allowRandom,
164
+ ),
165
+ );
202
166
 
203
167
  const coloring_style_label = ref<string>("");
204
168
 
@@ -207,6 +171,11 @@ const active_key = computed<string | undefined>(() => {
207
171
  return index === -1 ? coloring_style_key.value : coloring_styles.value.values[index];
208
172
  });
209
173
 
174
+ // The constant color picker already edits the opacity as its alpha
175
+ const has_opacity = computed<boolean>(
176
+ () => opacity.value !== undefined && active_key.value !== color_dict.value,
177
+ );
178
+
210
179
  watch(
211
180
  [
212
181
  coloring_style_label,
@@ -342,4 +311,9 @@ watch(
342
311
  </template>
343
312
  </v-col>
344
313
  </v-row>
314
+ <v-row v-if="has_opacity" class="mt-2" no-gutters>
315
+ <v-col cols="12">
316
+ <ViewerOptionsOpacitySlider v-model="opacity" />
317
+ </v-col>
318
+ </v-row>
345
319
  </template>
@@ -19,6 +19,18 @@ const { dataId = undefined, blockIds = undefined, x, y } = defineProps<Props>();
19
19
  const show = defineModel<boolean>("show", { default: false });
20
20
 
21
21
  const dataIdRef = computed<string>(() => dataId);
22
+ function useAttributeStyle():
23
+ | ReturnType<typeof useGlobalAttributeStyle>
24
+ | ReturnType<typeof useModelAttributeStyle> {
25
+ if (blockIds === undefined) {
26
+ return useGlobalAttributeStyle(dataIdRef);
27
+ }
28
+ return useModelAttributeStyle(
29
+ dataIdRef,
30
+ computed<number[]>(() => blockIds),
31
+ );
32
+ }
33
+
22
34
  // The parent keys this picker on the picked data: a mesh or a model, so the style is chosen once here
23
35
  const {
24
36
  currentColormap,
@@ -28,13 +40,7 @@ const {
28
40
  currentTimeSteps,
29
41
  currentTimeStep,
30
42
  loadTimeSteps,
31
- } =
32
- blockIds === undefined
33
- ? useGlobalAttributeStyle(dataIdRef)
34
- : useModelAttributeStyle(
35
- dataIdRef,
36
- computed<number[]>(() => blockIds),
37
- );
43
+ } = useAttributeStyle();
38
44
 
39
45
  watch(show, async (isShown) => {
40
46
  if (isShown) {
@@ -0,0 +1,56 @@
1
+ <script setup lang="ts">
2
+ import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
3
+ import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
4
+
5
+ const attributeNoDataColor = defineModel<typeof DEFAULT_NO_DATA_COLOR>();
6
+
7
+ const cssNoDataColor = computed<string>(() => {
8
+ const { red, green, blue, alpha } = attributeNoDataColor.value ?? DEFAULT_NO_DATA_COLOR;
9
+ return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
10
+ });
11
+ </script>
12
+
13
+ <template>
14
+ <div
15
+ class="text-caption text-high-emphasis mt-1 d-flex align-center ga-1"
16
+ data-testid="noDataInfo"
17
+ >
18
+ <v-icon icon="mdi-information-outline" size="14" color="info" />
19
+ <span>Contains unmapped elements</span>
20
+ <v-menu :close-on-content-click="false">
21
+ <template #activator="{ props }">
22
+ <button
23
+ v-bind="props"
24
+ type="button"
25
+ class="color-picker-rect-btn ml-1"
26
+ :style="{ backgroundColor: cssNoDataColor }"
27
+ v-tooltip="'Change unmapped elements color'"
28
+ data-testid="noDataColorBtn"
29
+ />
30
+ </template>
31
+ <v-card class="pa-2">
32
+ <ViewerOptionsColorPicker v-model="attributeNoDataColor" disabled-alpha />
33
+ </v-card>
34
+ </v-menu>
35
+ </div>
36
+ </template>
37
+
38
+ <style scoped>
39
+ .color-picker-rect-btn {
40
+ width: 26px;
41
+ height: 15px;
42
+ border-radius: 3px;
43
+ border: 2px solid rgba(255, 255, 255, 0.912);
44
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
45
+ cursor: pointer;
46
+ outline: none;
47
+ transition:
48
+ border-color 0.15s ease,
49
+ transform 0.15s ease;
50
+ }
51
+
52
+ .color-picker-rect-btn:hover {
53
+ border-color: rgba(255, 255, 255, 0.9);
54
+ transform: scale(1.1);
55
+ }
56
+ </style>