@geode/opengeodeweb-front 10.34.0-rc.8 → 10.34.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 (282) hide show
  1. package/{server → .build/server}/utils/app_config.js +10 -9
  2. package/{server → .build/server}/utils/cleanup.js +31 -17
  3. package/{server → .build/server}/utils/cloud.js +1 -4
  4. package/{server → .build/server}/utils/microservices.js +21 -9
  5. package/{server → .build/server}/utils/path.js +4 -4
  6. package/{server → .build/server}/utils/scripts.js +9 -9
  7. package/.build/server/utils/server_config.js +51 -0
  8. package/.build/server/utils/stream.js +6 -0
  9. package/{server → .build/server}/utils/ws_client.js +18 -3
  10. package/{shared → .build/shared}/scripts.js +10 -10
  11. package/.build/shared/utils/call_raw.js +31 -0
  12. package/{shared → .build/shared}/utils/call_schema.js +2 -2
  13. package/.build/shared/utils/fetch_raw.js +52 -0
  14. package/{shared → .build/shared}/utils/fetch_schema.js +2 -2
  15. package/{shared → .build/shared}/utils/file.js +3 -1
  16. package/{shared → .build/shared}/utils/response_handlers/load.js +10 -7
  17. package/{shared → .build/shared}/utils/validate_schema.js +1 -1
  18. package/app/components/ActionButton.vue +6 -6
  19. package/app/components/CameraManager/List.vue +5 -5
  20. package/app/components/CameraManager/Saver.vue +3 -5
  21. package/app/components/CameraManager.vue +6 -4
  22. package/app/components/CameraOrientation.vue +12 -12
  23. package/app/components/ClippingPlaneCard.vue +4 -2
  24. package/app/components/ClippingPlanes.vue +8 -8
  25. package/app/components/CrsSelector.vue +9 -10
  26. package/app/components/DeleteDialog.vue +4 -2
  27. package/app/components/DragAndDrop.vue +10 -12
  28. package/app/components/DragAndDropInternal/DragAndDropInline.vue +4 -2
  29. package/app/components/ExtensionSelector.vue +4 -4
  30. package/app/components/FeedBack/ErrorBanner.vue +3 -1
  31. package/app/components/FeedBack/Snackers.vue +4 -3
  32. package/app/components/FileSelector.vue +10 -8
  33. package/app/components/FileUploader.vue +11 -11
  34. package/app/components/GlassCard.vue +1 -1
  35. package/app/components/HybridRenderingView.vue +7 -5
  36. package/app/components/HybridViewerTooltip.vue +7 -7
  37. package/app/components/Launcher.vue +1 -1
  38. package/app/components/Loading/EcoMessages.vue +9 -3
  39. package/app/components/Loading.vue +2 -2
  40. package/app/components/MissingFilesSelector.vue +12 -10
  41. package/app/components/ObjectSelector.vue +10 -9
  42. package/app/components/PackagesVersions.vue +6 -5
  43. package/app/components/Recaptcha.vue +3 -3
  44. package/app/components/RemoteRenderingView.vue +6 -7
  45. package/app/components/Ruler.vue +3 -3
  46. package/app/components/Screenshot.vue +6 -6
  47. package/app/components/SearchBar.vue +4 -2
  48. package/app/components/ShrinkFilter.vue +7 -7
  49. package/app/components/Step.vue +6 -5
  50. package/app/components/Stepper.vue +4 -3
  51. package/app/components/ToolPanel.vue +6 -3
  52. package/app/components/ViewToolbar.vue +25 -28
  53. package/app/components/Viewer/ContextMenu/CenterButton.vue +7 -5
  54. package/app/components/Viewer/ContextMenu/CircularItems.vue +3 -3
  55. package/app/components/Viewer/ContextMenu/ContextMenu.vue +22 -19
  56. package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +10 -8
  57. package/app/components/Viewer/ContextMenu/InfoCard.vue +11 -12
  58. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +13 -17
  59. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +11 -15
  60. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +12 -16
  61. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +8 -12
  62. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +11 -15
  63. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +11 -15
  64. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +67 -38
  65. package/app/components/Viewer/Generic/Model/CornersOptions.vue +53 -23
  66. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +1 -3
  67. package/app/components/Viewer/Generic/Model/LinesOptions.vue +67 -38
  68. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +31 -15
  69. package/app/components/Viewer/Generic/Model/ModelStyleOptions.vue +2 -3
  70. package/app/components/Viewer/Generic/Model/PointsOptions.vue +6 -6
  71. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +69 -38
  72. package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +64 -46
  73. package/app/components/Viewer/ObjectTree/Base/Controls.vue +5 -5
  74. package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +13 -9
  75. package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +5 -5
  76. package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +10 -10
  77. package/app/components/Viewer/ObjectTree/Box.vue +6 -4
  78. package/app/components/Viewer/ObjectTree/Layout.vue +23 -21
  79. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +14 -14
  80. package/app/components/Viewer/ObjectTree/Views/{ModelCollections.vue → ModelTree.vue} +59 -24
  81. package/app/components/Viewer/Options/AttributeColorBar.vue +4 -2
  82. package/app/components/Viewer/Options/AttributeRangeSelector.vue +4 -2
  83. package/app/components/Viewer/Options/AttributeSelector.vue +7 -9
  84. package/app/components/Viewer/Options/ColorMapList.vue +15 -13
  85. package/app/components/Viewer/Options/ColorMapPicker.vue +4 -4
  86. package/app/components/Viewer/Options/ColorPicker.vue +223 -41
  87. package/app/components/Viewer/Options/ColoringTypeSelector.vue +16 -16
  88. package/app/components/Viewer/Options/ColormapQuickPicker.vue +7 -5
  89. package/app/components/Viewer/Options/OptionsSection.vue +1 -1
  90. package/app/components/Viewer/Options/TextureItem.vue +8 -6
  91. package/app/components/Viewer/Options/TexturesSelector.vue +1 -1
  92. package/app/components/Viewer/OverlappingObjectsPicker.vue +8 -9
  93. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +2 -6
  94. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +12 -16
  95. package/app/components/Viewer/Surface/PolygonsOptions.vue +12 -16
  96. package/app/components/Viewer/Ui.vue +2 -2
  97. package/app/components/Wrapper.vue +1 -4
  98. package/app/components/ZScaling.vue +5 -3
  99. package/app/components/csv-preview/CsvPreviewer.vue +38 -37
  100. package/app/components/csv-preview/CsvSettings.vue +6 -4
  101. package/app/components/csv-preview/CsvTable.vue +1 -1
  102. package/app/composables/batch_style.ts +5 -6
  103. package/app/composables/clipping_planes_widget.ts +73 -181
  104. package/app/composables/clipping_planes_widget_entries.ts +189 -0
  105. package/app/composables/copy_to_clipboard.ts +7 -0
  106. package/app/composables/global_attribute_style.ts +163 -83
  107. package/app/composables/hover_highlight.ts +46 -14
  108. package/app/composables/model_collections.ts +26 -13
  109. package/app/composables/model_components.ts +26 -13
  110. package/app/composables/project_manager.ts +76 -19
  111. package/app/composables/responsive_middle_truncate.ts +13 -13
  112. package/app/composables/stepper_tree.ts +34 -11
  113. package/app/composables/tree_filter.ts +66 -44
  114. package/app/composables/tree_keyboard_nav.ts +25 -11
  115. package/app/composables/tree_scroll.ts +44 -14
  116. package/app/composables/use_adaptive_styles.ts +66 -23
  117. package/app/composables/use_overlapping_picker.ts +66 -16
  118. package/app/composables/use_quick_colormap.ts +16 -5
  119. package/app/composables/virtual_tree.ts +75 -43
  120. package/app/composables/vtk_implicit_plane_widget.d.ts +2 -0
  121. package/app/plugins/auto_store_register.ts +2 -7
  122. package/app/plugins/click_outside_ignore_snackbars.client.ts +39 -0
  123. package/app/stores/app.ts +57 -192
  124. package/app/stores/app_helpers/extension.ts +179 -0
  125. package/app/stores/back.ts +37 -21
  126. package/app/stores/camera_manager.ts +22 -20
  127. package/app/stores/cloud.ts +17 -13
  128. package/app/stores/data.ts +88 -47
  129. package/app/stores/data_helpers/collections.ts +36 -38
  130. package/app/stores/data_helpers/mesh.ts +45 -36
  131. package/app/stores/data_style.ts +50 -28
  132. package/app/stores/feedback.ts +6 -6
  133. package/app/stores/hybrid_viewer.ts +41 -52
  134. package/app/stores/infra.ts +39 -37
  135. package/app/stores/menu.ts +23 -14
  136. package/app/stores/treeview.ts +72 -42
  137. package/app/stores/viewer.ts +39 -27
  138. package/app/utils/attributes.ts +3 -3
  139. package/app/utils/clipping_planes.ts +111 -14
  140. package/app/utils/color_picker.ts +57 -0
  141. package/app/utils/colormap.ts +58 -35
  142. package/app/utils/default_styles/index.ts +2 -2
  143. package/app/utils/default_styles/meshes.ts +107 -13
  144. package/app/utils/default_styles/models.ts +83 -14
  145. package/app/utils/extension.ts +47 -20
  146. package/app/utils/import_workflow.ts +21 -13
  147. package/app/utils/name_cleaner.ts +1 -1
  148. package/app/utils/string.ts +1 -1
  149. package/app/utils/treeview.ts +2 -2
  150. package/internal/database/base_database.ts +7 -3
  151. package/internal/database/database.ts +36 -26
  152. package/internal/database/extended_database.ts +1 -1
  153. package/internal/stores/data_style/mesh/cells/cell.ts +70 -34
  154. package/internal/stores/data_style/mesh/cells/color.ts +12 -6
  155. package/internal/stores/data_style/mesh/cells/common.ts +18 -8
  156. package/internal/stores/data_style/mesh/cells/index.ts +122 -42
  157. package/internal/stores/data_style/mesh/cells/textures.ts +12 -6
  158. package/internal/stores/data_style/mesh/cells/vertex.ts +75 -34
  159. package/internal/stores/data_style/mesh/cells/visibility.ts +15 -4
  160. package/internal/stores/data_style/mesh/edges/color.ts +12 -6
  161. package/internal/stores/data_style/mesh/edges/common.ts +14 -6
  162. package/internal/stores/data_style/mesh/edges/edge.ts +71 -39
  163. package/internal/stores/data_style/mesh/edges/index.ts +117 -42
  164. package/internal/stores/data_style/mesh/edges/vertex.ts +76 -39
  165. package/internal/stores/data_style/mesh/edges/visibility.ts +15 -4
  166. package/internal/stores/data_style/mesh/edges/width.ts +12 -4
  167. package/internal/stores/data_style/mesh/index.ts +30 -11
  168. package/internal/stores/data_style/mesh/points/color.ts +12 -6
  169. package/internal/stores/data_style/mesh/points/common.ts +21 -8
  170. package/internal/stores/data_style/mesh/points/index.ts +101 -50
  171. package/internal/stores/data_style/mesh/points/size.ts +12 -4
  172. package/internal/stores/data_style/mesh/points/vertex.ts +75 -34
  173. package/internal/stores/data_style/mesh/points/visibility.ts +17 -7
  174. package/internal/stores/data_style/mesh/polygons/color.ts +12 -6
  175. package/internal/stores/data_style/mesh/polygons/common.ts +23 -6
  176. package/internal/stores/data_style/mesh/polygons/index.ts +130 -70
  177. package/internal/stores/data_style/mesh/polygons/polygon.ts +77 -43
  178. package/internal/stores/data_style/mesh/polygons/textures.ts +12 -6
  179. package/internal/stores/data_style/mesh/polygons/vertex.ts +79 -39
  180. package/internal/stores/data_style/mesh/polygons/visibility.ts +16 -6
  181. package/internal/stores/data_style/mesh/polyhedra/color.ts +12 -6
  182. package/internal/stores/data_style/mesh/polyhedra/common.ts +14 -6
  183. package/internal/stores/data_style/mesh/polyhedra/index.ts +115 -56
  184. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +80 -39
  185. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +79 -39
  186. package/internal/stores/data_style/mesh/polyhedra/visibility.ts +16 -6
  187. package/internal/stores/data_style/model/blocks/color.ts +43 -13
  188. package/internal/stores/data_style/model/blocks/common.ts +21 -6
  189. package/internal/stores/data_style/model/blocks/index.ts +89 -59
  190. package/internal/stores/data_style/model/blocks/polyhedron.ts +101 -44
  191. package/internal/stores/data_style/model/blocks/vertex.ts +107 -42
  192. package/internal/stores/data_style/model/blocks/visibility.ts +17 -4
  193. package/internal/stores/data_style/model/color.ts +171 -83
  194. package/internal/stores/data_style/model/common.ts +70 -21
  195. package/internal/stores/data_style/model/corners/color.ts +43 -11
  196. package/internal/stores/data_style/model/corners/common.ts +25 -6
  197. package/internal/stores/data_style/model/corners/index.ts +66 -41
  198. package/internal/stores/data_style/model/corners/vertex.ts +105 -74
  199. package/internal/stores/data_style/model/corners/visibility.ts +19 -4
  200. package/internal/stores/data_style/model/edges/common.ts +12 -4
  201. package/internal/stores/data_style/model/edges/index.ts +2 -1
  202. package/internal/stores/data_style/model/edges/visibility.ts +24 -7
  203. package/internal/stores/data_style/model/index.ts +24 -11
  204. package/internal/stores/data_style/model/lines/color.ts +41 -11
  205. package/internal/stores/data_style/model/lines/common.ts +17 -6
  206. package/internal/stores/data_style/model/lines/edge.ts +105 -42
  207. package/internal/stores/data_style/model/lines/index.ts +86 -59
  208. package/internal/stores/data_style/model/lines/vertex.ts +105 -42
  209. package/internal/stores/data_style/model/lines/visibility.ts +17 -4
  210. package/internal/stores/data_style/model/points/common.ts +8 -4
  211. package/internal/stores/data_style/model/points/index.ts +10 -3
  212. package/internal/stores/data_style/model/points/size.ts +12 -4
  213. package/internal/stores/data_style/model/points/visibility.ts +16 -6
  214. package/internal/stores/data_style/model/selection.ts +80 -58
  215. package/internal/stores/data_style/model/surfaces/color.ts +41 -11
  216. package/internal/stores/data_style/model/surfaces/common.ts +23 -6
  217. package/internal/stores/data_style/model/surfaces/index.ts +89 -59
  218. package/internal/stores/data_style/model/surfaces/polygon.ts +107 -67
  219. package/internal/stores/data_style/model/surfaces/vertex.ts +111 -67
  220. package/internal/stores/data_style/model/surfaces/visibility.ts +18 -5
  221. package/internal/stores/data_style/model/visibility.ts +82 -20
  222. package/internal/stores/data_style/state.ts +77 -65
  223. package/internal/stores/hybrid_viewer/brightness.ts +49 -31
  224. package/internal/stores/hybrid_viewer/camera.ts +191 -177
  225. package/internal/stores/hybrid_viewer/camera_animation.ts +11 -10
  226. package/internal/stores/hybrid_viewer/core.ts +64 -0
  227. package/internal/stores/hybrid_viewer/filters.ts +10 -16
  228. package/internal/stores/hybrid_viewer/highlight.ts +91 -130
  229. package/internal/stores/hybrid_viewer/ruler.ts +24 -15
  230. package/internal/stores/hybrid_viewer/scene.ts +96 -117
  231. package/internal/stores/hybrid_viewer/viewport.ts +74 -65
  232. package/internal/stores/hybrid_viewer/vtk_types.ts +13 -29
  233. package/internal/utils/api_fetch.ts +54 -23
  234. package/internal/utils/upload_file.ts +74 -53
  235. package/internal/utils/viewer_call.ts +22 -13
  236. package/internal/utils/ws_client.ts +24 -13
  237. package/nuxt.config.ts +58 -1
  238. package/package.json +20 -8
  239. package/server/api/cloud/extensions/run.post.ts +6 -10
  240. package/server/api/local/app/project_folder_path.post.ts +4 -4
  241. package/server/api/local/app/run_back.post.ts +5 -7
  242. package/server/api/local/app/run_viewer.post.ts +5 -7
  243. package/server/api/local/extensions/kill.post.ts +4 -3
  244. package/server/api/local/extensions/run.post.ts +7 -10
  245. package/server/api/local/extensions/upload.put.ts +44 -54
  246. package/server/api/microservice/app/get_is_app_ready.get.ts +4 -5
  247. package/server/api/microservice/app/set_app_base_url.post.ts +5 -6
  248. package/server/api/microservice/app/set_back_base_url.post.ts +5 -6
  249. package/server/api/microservice/app/set_is_app_ready.post.ts +5 -6
  250. package/server/api/microservice/app/set_viewer_base_url.post.ts +5 -6
  251. package/server/api/microservice/extensions/download.post.ts +5 -4
  252. package/server/api/serverless/run_cloud.post.ts +53 -11
  253. package/server/utils/app_config.ts +29 -22
  254. package/server/utils/cleanup.ts +60 -30
  255. package/server/utils/cloud.ts +9 -8
  256. package/server/utils/extension.ts +23 -9
  257. package/server/utils/microservices.ts +33 -24
  258. package/server/utils/path.ts +4 -4
  259. package/server/utils/scripts.ts +26 -23
  260. package/server/utils/server.ts +2 -2
  261. package/server/utils/server_config.ts +41 -27
  262. package/server/utils/stream.ts +6 -0
  263. package/server/utils/ws_client.ts +42 -8
  264. package/shared/scripts.ts +15 -10
  265. package/shared/utils/call_raw.ts +23 -16
  266. package/shared/utils/call_schema.ts +5 -8
  267. package/shared/utils/fetch_raw.ts +87 -47
  268. package/shared/utils/fetch_schema.ts +6 -9
  269. package/shared/utils/file.ts +8 -2
  270. package/shared/utils/response_handlers/load.ts +26 -11
  271. package/shared/utils/types.ts +9 -9
  272. package/shared/utils/validate_schema.ts +1 -1
  273. package/app/components/Viewer/ObjectTree/Views/ModelComponents.vue +0 -276
  274. package/server/types/vendor.d.ts +0 -64
  275. package/server/utils/server_config.js +0 -43
  276. package/shared/utils/call_raw.js +0 -30
  277. package/shared/utils/fetch_raw.js +0 -40
  278. /package/{opengeodeweb_front_schemas.js → .build/opengeodeweb_front_schemas.js} +0 -0
  279. /package/{server → .build/server}/utils/server.js +0 -0
  280. /package/{shared → .build/shared}/app_mode.js +0 -0
  281. /package/{shared → .build/shared}/utils/parse_boolean.js +0 -0
  282. /package/{shared → .build/shared}/utils/types.js +0 -0
@@ -1,17 +1,25 @@
1
1
  import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
2
2
  import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
3
3
 
4
- export function useModelEdgesCommonStyle() {
4
+ export function useModelEdgesCommonStyle(): {
5
+ modelEdgesStyle: (id: string) => StyleValues;
6
+ mutateModelEdgesStyle: (id: string, values: StyleValues) => Promise<string>;
7
+ } {
5
8
  const dataStyleState = useDataStyleState();
6
9
 
7
- function mutateModelEdgesStyle(id: string, values: StyleValues) {
8
- return dataStyleState.mutateStyle(id, {
10
+ async function mutateModelEdgesStyle(id: string, values: StyleValues): Promise<string> {
11
+ const result = await dataStyleState.mutateStyle(id, {
9
12
  edges: values,
10
13
  });
14
+ return result;
11
15
  }
12
16
 
13
17
  function modelEdgesStyle(id: string): StyleValues {
14
- return dataStyleState.getStyle(id).edges as StyleValues;
18
+ const { edges } = dataStyleState.getStyle(id);
19
+ if (edges === undefined) {
20
+ return {};
21
+ }
22
+ return edges;
15
23
  }
16
24
 
17
25
  return {
@@ -1,7 +1,8 @@
1
1
  import { useModelEdgesCommonStyle } from "./common";
2
2
  import { useModelEdgesVisibilityStyle } from "./visibility";
3
3
 
4
- export function useModelEdgesStyle() {
4
+ export function useModelEdgesStyle(): ReturnType<typeof useModelEdgesCommonStyle> &
5
+ ReturnType<typeof useModelEdgesVisibilityStyle> {
5
6
  const modelEdgesCommonStyle = useModelEdgesCommonStyle();
6
7
  const modelEdgesVisibilityStyle = useModelEdgesVisibilityStyle();
7
8
 
@@ -7,27 +7,44 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
  // Local constants
8
8
  const schema = viewer_schemas.opengeodeweb_viewer.model.edges.visibility;
9
9
 
10
- export function useModelEdgesVisibilityStyle() {
10
+ interface ModelEdgesVisibilityStyleApi {
11
+ modelEdgesVisibility: (id: string) => boolean | undefined;
12
+ setModelEdgesVisibility: (id: string, visibility: boolean | undefined) => Promise<unknown>;
13
+ applyModelEdgesStyle: (id: string) => Promise<unknown[]>;
14
+ }
15
+
16
+ export function useModelEdgesVisibilityStyle(): ModelEdgesVisibilityStyleApi {
11
17
  const viewerStore = useViewerStore();
12
18
  const modelEdgesCommonStyle = useModelEdgesCommonStyle();
13
19
 
14
20
  function modelEdgesVisibility(id: string): boolean | undefined {
15
- return modelEdgesCommonStyle.modelEdgesStyle(id).visibility as boolean | undefined;
21
+ const { visibility } = modelEdgesCommonStyle.modelEdgesStyle(id);
22
+ if (typeof visibility === "boolean") {
23
+ return visibility;
24
+ }
25
+ return undefined;
16
26
  }
17
27
 
18
- function setModelEdgesVisibility(id: string, visibility: boolean | undefined) {
28
+ async function setModelEdgesVisibility(
29
+ id: string,
30
+ visibility: boolean | undefined,
31
+ ): Promise<unknown> {
19
32
  const params = { id, visibility };
20
- return viewerStore.request(
33
+ const result = await viewerStore.request(
21
34
  { schema, params },
22
35
  {
23
- response_function: () => modelEdgesCommonStyle.mutateModelEdgesStyle(id, { visibility }),
36
+ response_function: async () => {
37
+ await modelEdgesCommonStyle.mutateModelEdgesStyle(id, { visibility });
38
+ },
24
39
  },
25
40
  );
41
+ return result;
26
42
  }
27
43
 
28
- function applyModelEdgesStyle(id: string) {
44
+ async function applyModelEdgesStyle(id: string): Promise<unknown[]> {
29
45
  const visibility = modelEdgesVisibility(id);
30
- return Promise.resolve([setModelEdgesVisibility(id, visibility)]);
46
+ const result = await setModelEdgesVisibility(id, visibility);
47
+ return [result];
31
48
  }
32
49
 
33
50
  return {
@@ -1,3 +1,4 @@
1
+ import type { ComputedRef } from "vue";
1
2
  import { useDataStore } from "@ogw_front/stores/data";
2
3
  import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
3
4
  import { useModelBlocksStyle } from "./blocks";
@@ -10,8 +11,21 @@ import { useModelSelection } from "./selection";
10
11
  import { useModelSurfacesStyle } from "./surfaces";
11
12
  import { useModelVisibilityStyle } from "./visibility";
12
13
 
14
+ type UseModelStyleReturn = ReturnType<typeof useModelColorStyle> &
15
+ ReturnType<typeof useModelVisibilityStyle> &
16
+ ReturnType<typeof useModelBlocksStyle> &
17
+ ReturnType<typeof useModelCornersStyle> &
18
+ ReturnType<typeof useModelEdgesStyle> &
19
+ ReturnType<typeof useModelLinesStyle> &
20
+ ReturnType<typeof useModelPointsStyle> &
21
+ ReturnType<typeof useModelSurfacesStyle> & {
22
+ visibleMeshComponents: (modelId: string) => ComputedRef<string[]>;
23
+ applyModelStyle: (modelId: string) => Promise<unknown[]>;
24
+ setModelMeshComponentsDefaultStyle: (modelId: string) => Promise<unknown[]>;
25
+ };
26
+
13
27
  // oxlint-disable-next-line max-lines-per-function, max-statements
14
- function useModelStyle() {
28
+ function useModelStyle(): UseModelStyleReturn {
15
29
  const dataStore = useDataStore();
16
30
  const dataStyleState = useDataStyleState();
17
31
  const modelCornersStyle = useModelCornersStyle();
@@ -31,15 +45,15 @@ function useModelStyle() {
31
45
  const modelColorStyle = useModelColorStyle(componentStyleFunctions);
32
46
  const modelVisibilityStyle = useModelVisibilityStyle(componentStyleFunctions);
33
47
 
34
- function visibleMeshComponents(modelId: string) {
48
+ function visibleMeshComponents(modelId: string): ComputedRef<string[]> {
35
49
  return useModelSelection(modelId, dataStyleState);
36
50
  }
37
51
 
38
- function applyModelStyle(modelId: string) {
52
+ async function applyModelStyle(modelId: string): Promise<unknown[]> {
39
53
  const style = dataStyleState.getStyle(modelId);
40
54
 
41
- return Promise.all([
42
- modelVisibilityStyle.setModelVisibility(modelId, style.visibility as boolean),
55
+ const results = await Promise.all([
56
+ modelVisibilityStyle.setModelVisibility(modelId, style.visibility ?? false),
43
57
  modelBlocksStyle.applyModelBlocksStyle(modelId),
44
58
  modelSurfacesStyle.applyModelSurfacesStyle(modelId),
45
59
  modelLinesStyle.applyModelLinesStyle(modelId),
@@ -47,19 +61,18 @@ function useModelStyle() {
47
61
  modelPointsStyle.applyModelPointsStyle(modelId),
48
62
  modelEdgesStyle.applyModelEdgesStyle(modelId),
49
63
  ]);
64
+ return results;
50
65
  }
51
66
 
52
- async function setModelMeshComponentsDefaultStyle(modelId: string) {
53
- const item = await dataStore.item(modelId);
54
- if (!item) {
55
- return;
56
- }
57
- return await Promise.all([
67
+ async function setModelMeshComponentsDefaultStyle(modelId: string): Promise<unknown[]> {
68
+ await dataStore.item(modelId);
69
+ const results = await Promise.all([
58
70
  modelBlocksStyle.setModelBlocksDefaultStyle(modelId),
59
71
  modelSurfacesStyle.setModelSurfacesDefaultStyle(modelId),
60
72
  modelLinesStyle.setModelLinesDefaultStyle(modelId),
61
73
  modelCornersStyle.setModelCornersDefaultStyle(modelId),
62
74
  ]);
75
+ return results;
63
76
  }
64
77
 
65
78
  return {
@@ -1,21 +1,39 @@
1
- // Not auto-fixable (eslint's sort-imports core rule has no autofixer) and this file's import order doesn't match its syntax-kind-then-alphabetical requirement - left as-is rather than manually reordered across the codebase for a purely cosmetic rule.
2
- // oxlint-disable eslint/sort-imports
3
- import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
4
1
  import { isModelLinesEdgeAttributeValid, useModelLinesEdgeAttribute } from "./edge";
5
2
  import { isModelLinesVertexAttributeValid, useModelLinesVertexAttribute } from "./vertex";
3
+ import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
4
+ import { useDataStore } from "@ogw_front/stores/data";
6
5
  import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
7
6
  import { useModelLinesCommonStyle } from "./common";
8
7
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
9
8
 
10
9
  const schema = viewer_schemas.opengeodeweb_viewer.model.lines.color;
11
10
 
12
- export function useModelLinesColor() {
11
+ export function useModelLinesColor(): {
12
+ setModelLinesColor: (
13
+ modelId: string,
14
+ lines_ids: string[],
15
+ color: unknown,
16
+ activeColoring?: string,
17
+ collectionId?: string,
18
+ ) => Promise<unknown>;
19
+ modelLineColoring: (id: string, line_id?: string) => StyleValues;
20
+ modelLineColor: (id: string, line_id?: string) => unknown;
21
+ modelLineActiveColoring: (id: string, line_id?: string) => unknown;
22
+ setModelLinesActiveColoring: (
23
+ modelId: string,
24
+ lines_ids: string[],
25
+ activeColoring: string,
26
+ collectionId?: string,
27
+ ) => Promise<unknown>;
28
+ } {
29
+ const dataStore = useDataStore();
13
30
  const modelCommonStyle = useModelCommonStyle();
14
31
  const modelLinesCommonStyle = useModelLinesCommonStyle();
15
32
  const modelLinesVertexAttribute = useModelLinesVertexAttribute();
16
33
  const modelLinesEdgeAttribute = useModelLinesEdgeAttribute();
17
34
 
18
35
  function modelLineColoring(id: string, line_id?: string): StyleValues {
36
+ // oxlint-disable-next-line no-unsafe-type-assertion -- coloring shape is defined by the data style schema.
19
37
  return modelLinesCommonStyle.modelLineStyle(id, line_id).coloring as StyleValues;
20
38
  }
21
39
 
@@ -23,13 +41,22 @@ export function useModelLinesColor() {
23
41
  return modelLineColoring(id, line_id).constant;
24
42
  }
25
43
 
26
- function setModelLinesColor(
44
+ async function setModelLinesColor(
27
45
  modelId: string,
28
46
  lines_ids: string[],
29
47
  color: unknown,
30
48
  activeColoring = "constant",
31
- ) {
32
- return modelCommonStyle.setModelTypeColor(modelId, lines_ids, color, schema, activeColoring);
49
+ collectionId?: string,
50
+ ): Promise<unknown> {
51
+ const result = await modelCommonStyle.setModelTypeColor(
52
+ modelId,
53
+ lines_ids,
54
+ color,
55
+ schema,
56
+ activeColoring,
57
+ collectionId,
58
+ );
59
+ return result;
33
60
  }
34
61
 
35
62
  function modelLineActiveColoring(id: string, line_id?: string): unknown {
@@ -40,9 +67,11 @@ export function useModelLinesColor() {
40
67
  modelId: string,
41
68
  lines_ids: string[],
42
69
  activeColoring: string,
43
- ) {
44
- if (lines_ids.length > 1) {
45
- modelLinesCommonStyle.mutateModelLinesTypeColoring(modelId, {
70
+ collectionId?: string,
71
+ ): Promise<unknown> {
72
+ const totalLineIds = await dataStore.getLinesGeodeIds(modelId);
73
+ if (lines_ids.length === totalLineIds.length) {
74
+ await modelLinesCommonStyle.mutateModelLinesTypeColoring(modelId, {
46
75
  active: activeColoring,
47
76
  });
48
77
  }
@@ -51,7 +80,7 @@ export function useModelLinesColor() {
51
80
  });
52
81
  if (activeColoring === "constant" || activeColoring === "random") {
53
82
  const color = modelLineColor(modelId, lines_ids[0]);
54
- return setModelLinesColor(modelId, lines_ids, color, activeColoring);
83
+ return setModelLinesColor(modelId, lines_ids, color, activeColoring, collectionId);
55
84
  }
56
85
 
57
86
  if (activeColoring === "vertex") {
@@ -89,6 +118,7 @@ export function useModelLinesColor() {
89
118
  return modelLinesEdgeAttribute.setModelLinesEdgeAttribute(modelId, lines_ids, attribute);
90
119
  }
91
120
  }
121
+ return undefined;
92
122
  }
93
123
 
94
124
  return {
@@ -3,12 +3,18 @@ import merge from "lodash/merge";
3
3
  import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
4
4
  import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
5
5
 
6
- export function useModelLinesCommonStyle() {
6
+ export function useModelLinesCommonStyle(): {
7
+ modelLinesStyle: (id: string) => StyleValues;
8
+ modelLineStyle: (id: string, line_id?: string) => StyleValues;
9
+ modelLineColoring: (id: string, line_id?: string) => StyleValues;
10
+ mutateModelLinesColoring: (id: string, lines_ids: string[], values: StyleValues) => Promise<void>;
11
+ mutateModelLinesTypeColoring: (id: string, values: StyleValues) => Promise<void>;
12
+ } {
7
13
  const dataStyleState = useDataStyleState();
8
14
  const modelCommonStyle = useModelCommonStyle();
9
15
 
10
16
  function modelLinesStyle(id: string): StyleValues {
11
- return dataStyleState.getStyle(id).lines as StyleValues;
17
+ return dataStyleState.getStyle(id).lines ?? {};
12
18
  }
13
19
 
14
20
  function modelComponentTypeLinesStyle(id: string): StyleValues {
@@ -27,17 +33,22 @@ export function useModelLinesCommonStyle() {
27
33
  }
28
34
 
29
35
  function modelLineColoring(id: string, line_id?: string): StyleValues {
36
+ // oxlint-disable-next-line no-unsafe-type-assertion -- coloring shape is defined by the data style schema.
30
37
  return modelLineStyle(id, line_id).coloring as StyleValues;
31
38
  }
32
39
 
33
- function mutateModelLinesColoring(id: string, lines_ids: string[], values: StyleValues) {
34
- return modelCommonStyle.mutateComponentStyles(id, lines_ids, {
40
+ async function mutateModelLinesColoring(
41
+ id: string,
42
+ lines_ids: string[],
43
+ values: StyleValues,
44
+ ): Promise<void> {
45
+ await modelCommonStyle.mutateComponentStyles(id, lines_ids, {
35
46
  coloring: values,
36
47
  });
37
48
  }
38
49
 
39
- function mutateModelLinesTypeColoring(id: string, values: StyleValues) {
40
- return modelCommonStyle.mutateModelComponentTypeStyle(id, "Line", {
50
+ async function mutateModelLinesTypeColoring(id: string, values: StyleValues): Promise<void> {
51
+ await modelCommonStyle.mutateModelComponentTypeStyle(id, "Line", {
41
52
  coloring: values,
42
53
  });
43
54
  }
@@ -1,3 +1,4 @@
1
+ // oxlint-disable eslint/max-lines
1
2
  import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
2
3
  // Third party imports
3
4
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
@@ -49,12 +50,61 @@ function isModelLinesEdgeAttributeValid({
49
50
  );
50
51
  }
51
52
 
53
+ interface UseModelLinesEdgeAttributeReturn {
54
+ modelLinesEdgeAttributeName: (modelId: string, lineId?: string) => string | undefined;
55
+ modelLinesEdgeAttributeItem: (modelId: string, lineId?: string) => number;
56
+ modelLinesEdgeAttributeRange: (
57
+ modelId: string,
58
+ lineId?: string,
59
+ ) => [number | undefined, number | undefined];
60
+ modelLinesEdgeAttributeColorMap: (modelId: string, lineId?: string) => string | undefined;
61
+ modelLinesEdgeAttributeStoredConfig: (
62
+ modelId: string,
63
+ lineId: string | undefined,
64
+ name: string | undefined,
65
+ item: number | undefined,
66
+ ) => AttributeStoredConfig;
67
+ setModelLinesEdgeAttribute: (
68
+ modelId: string,
69
+ lineIds: string[],
70
+ input: AttributeInput,
71
+ ) => Promise<unknown>;
72
+ setModelLinesEdgeAttributeName: (
73
+ modelId: string,
74
+ lineIds: string[],
75
+ name: string,
76
+ ) => Promise<unknown>;
77
+ setModelLinesEdgeAttributeItem: (
78
+ modelId: string,
79
+ lineIds: string[],
80
+ item: number,
81
+ ) => Promise<unknown>;
82
+ setModelLinesEdgeAttributeRange: (
83
+ modelId: string,
84
+ lineIds: string[],
85
+ minimum: number,
86
+ maximum: number,
87
+ ) => Promise<unknown>;
88
+ setModelLinesEdgeAttributeColorMap: (
89
+ modelId: string,
90
+ lineIds: string[],
91
+ colorMap: string | undefined,
92
+ ) => Promise<unknown>;
93
+ modelLinesEdgeAttributeNoDataColor: (modelId: string, lineId?: string) => unknown;
94
+ setModelLinesEdgeAttributeNoDataColor: (
95
+ modelId: string,
96
+ lineIds: string[],
97
+ no_data_color: unknown,
98
+ ) => Promise<unknown>;
99
+ }
100
+
52
101
  // oxlint-disable-next-line max-lines-per-function
53
- function useModelLinesEdgeAttribute() {
102
+ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
54
103
  const dataStore = useDataStore();
55
104
  const modelLinesCommonStyle = useModelLinesCommonStyle();
56
105
  const viewerStore = useViewerStore();
57
106
  function modelLinesEdgeAttribute(modelId: string, lineId?: string): AttributeState {
107
+ // oxlint-disable-next-line no-unsafe-type-assertion -- coloring.edge shape is defined by the data style schema.
58
108
  return modelLinesCommonStyle.modelLineColoring(modelId, lineId).edge as AttributeState;
59
109
  }
60
110
  function modelLinesEdgeAttributeStoredConfig(
@@ -64,14 +114,10 @@ function useModelLinesEdgeAttribute() {
64
114
  item: number | undefined,
65
115
  ): AttributeStoredConfig {
66
116
  const { storedConfigs } = modelLinesEdgeAttribute(modelId, lineId);
67
- if (
68
- storedConfigs &&
69
- name !== undefined &&
70
- name in storedConfigs &&
71
- item !== undefined &&
72
- item in storedConfigs[name]!
73
- ) {
74
- return storedConfigs[name]![item]!;
117
+ const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
118
+ const itemConfig = item === undefined ? undefined : nameConfig?.[item];
119
+ if (itemConfig !== undefined) {
120
+ return itemConfig;
75
121
  }
76
122
  return {
77
123
  minimum: undefined,
@@ -80,32 +126,41 @@ function useModelLinesEdgeAttribute() {
80
126
  no_data_color: DEFAULT_NO_DATA_COLOR,
81
127
  };
82
128
  }
83
- function mutateModelLinesEdgeStyle(
129
+ async function mutateModelLinesEdgeStyle(
84
130
  modelId: string,
85
131
  lineIds: string[],
86
132
  values: Record<string, unknown>,
87
- ) {
88
- if (lineIds.length > 1) {
89
- modelLinesCommonStyle.mutateModelLinesTypeColoring(modelId, {
133
+ ): Promise<void> {
134
+ const tasks: Promise<void>[] = [
135
+ modelLinesCommonStyle.mutateModelLinesColoring(modelId, lineIds, {
90
136
  edge: values,
91
- });
137
+ }),
138
+ ];
139
+ const totalLineIds = await dataStore.getLinesGeodeIds(modelId);
140
+ if (lineIds.length === totalLineIds.length) {
141
+ tasks.push(
142
+ modelLinesCommonStyle.mutateModelLinesTypeColoring(modelId, {
143
+ edge: values,
144
+ }),
145
+ );
92
146
  }
93
- return modelLinesCommonStyle.mutateModelLinesColoring(modelId, lineIds, {
94
- edge: values,
95
- });
147
+ await Promise.all(tasks);
96
148
  }
97
- function setModelLinesEdgeAttributeStoredConfig(
149
+ async function setModelLinesEdgeAttributeStoredConfig(
98
150
  modelId: string,
99
151
  lineIds: string[],
100
152
  name: string | undefined,
101
153
  item: number | undefined,
102
154
  config: Partial<AttributeStoredConfig>,
103
- ) {
104
- return mutateModelLinesEdgeStyle(modelId, lineIds, {
155
+ ): Promise<void> {
156
+ if (name === undefined || item === undefined) {
157
+ return;
158
+ }
159
+ await mutateModelLinesEdgeStyle(modelId, lineIds, {
105
160
  storedConfigs: {
106
- [name as string]: {
161
+ [name]: {
107
162
  lastItem: item,
108
- [item as number]: config,
163
+ [item]: config,
109
164
  },
110
165
  },
111
166
  });
@@ -119,8 +174,9 @@ function useModelLinesEdgeAttribute() {
119
174
  name: string | undefined,
120
175
  ): number {
121
176
  const { storedConfigs } = modelLinesEdgeAttribute(modelId, lineId);
122
- if (storedConfigs && name !== undefined && name in storedConfigs) {
123
- return storedConfigs[name]!.lastItem;
177
+ const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
178
+ if (nameConfig !== undefined) {
179
+ return nameConfig.lastItem;
124
180
  }
125
181
  return 0;
126
182
  }
@@ -157,18 +213,18 @@ function useModelLinesEdgeAttribute() {
157
213
  colorMap,
158
214
  no_data_color = DEFAULT_NO_DATA_COLOR,
159
215
  }: AttributeInput,
160
- ) {
161
- mutateModelLinesEdgeStyle(modelId, lineIds, {
216
+ ): Promise<unknown> {
217
+ await mutateModelLinesEdgeStyle(modelId, lineIds, {
162
218
  name,
163
219
  item,
164
220
  });
165
- setModelLinesEdgeAttributeStoredConfig(modelId, lineIds, name, item, {
221
+ await setModelLinesEdgeAttributeStoredConfig(modelId, lineIds, name, item, {
166
222
  minimum,
167
223
  maximum,
168
224
  colorMap,
169
225
  no_data_color,
170
226
  });
171
- const points = getRGBPointsFromPreset(colorMap as string);
227
+ const points = getRGBPointsFromPreset(colorMap ?? "");
172
228
  const line_viewer_ids = await dataStore.getMeshComponentsViewerIds(modelId, lineIds);
173
229
  const params = {
174
230
  id: modelId,
@@ -185,7 +241,7 @@ function useModelLinesEdgeAttribute() {
185
241
  params,
186
242
  });
187
243
  }
188
- function applyEdgeAttribute(modelId: string, lineIds: string[]) {
244
+ async function applyEdgeAttribute(modelId: string, lineIds: string[]): Promise<void> {
189
245
  const name = modelLinesEdgeAttributeName(modelId, lineIds[0]);
190
246
  const item = modelLinesEdgeAttributeItem(modelId, lineIds[0]);
191
247
  const storedConfig = modelLinesEdgeAttributeStoredConfig(modelId, lineIds[0], name, item);
@@ -198,46 +254,53 @@ function useModelLinesEdgeAttribute() {
198
254
  no_data_color: storedConfig.no_data_color,
199
255
  };
200
256
  if (isModelLinesEdgeAttributeValid(attribute)) {
201
- return setModelLinesEdgeAttribute(modelId, lineIds, attribute);
257
+ await setModelLinesEdgeAttribute(modelId, lineIds, attribute);
202
258
  }
203
- return Promise.resolve();
204
259
  }
205
- function setModelLinesEdgeAttributeName(modelId: string, lineIds: string[], name: string) {
260
+ async function setModelLinesEdgeAttributeName(
261
+ modelId: string,
262
+ lineIds: string[],
263
+ name: string,
264
+ ): Promise<unknown> {
206
265
  const item = modelLinesEdgeAttributeLastItem(modelId, lineIds[0], name);
207
- mutateModelLinesEdgeStyle(modelId, lineIds, {
266
+ await mutateModelLinesEdgeStyle(modelId, lineIds, {
208
267
  name,
209
268
  item,
210
269
  });
211
270
  return applyEdgeAttribute(modelId, lineIds);
212
271
  }
213
- function setModelLinesEdgeAttributeItem(modelId: string, lineIds: string[], item: number) {
214
- mutateModelLinesEdgeStyle(modelId, lineIds, {
272
+ async function setModelLinesEdgeAttributeItem(
273
+ modelId: string,
274
+ lineIds: string[],
275
+ item: number,
276
+ ): Promise<unknown> {
277
+ await mutateModelLinesEdgeStyle(modelId, lineIds, {
215
278
  item,
216
279
  });
217
280
  return applyEdgeAttribute(modelId, lineIds);
218
281
  }
219
- function setModelLinesEdgeAttributeRange(
282
+ async function setModelLinesEdgeAttributeRange(
220
283
  modelId: string,
221
284
  lineIds: string[],
222
285
  minimum: number,
223
286
  maximum: number,
224
- ) {
287
+ ): Promise<unknown> {
225
288
  const name = modelLinesEdgeAttributeName(modelId, lineIds[0]);
226
289
  const item = modelLinesEdgeAttributeItem(modelId, lineIds[0]);
227
- setModelLinesEdgeAttributeStoredConfig(modelId, lineIds, name, item, {
290
+ await setModelLinesEdgeAttributeStoredConfig(modelId, lineIds, name, item, {
228
291
  minimum,
229
292
  maximum,
230
293
  });
231
294
  return applyEdgeAttribute(modelId, lineIds);
232
295
  }
233
- function setModelLinesEdgeAttributeColorMap(
296
+ async function setModelLinesEdgeAttributeColorMap(
234
297
  modelId: string,
235
298
  lineIds: string[],
236
299
  colorMap: string | undefined,
237
- ) {
300
+ ): Promise<unknown> {
238
301
  const name = modelLinesEdgeAttributeName(modelId, lineIds[0]);
239
302
  const item = modelLinesEdgeAttributeItem(modelId, lineIds[0]);
240
- setModelLinesEdgeAttributeStoredConfig(modelId, lineIds, name, item, {
303
+ await setModelLinesEdgeAttributeStoredConfig(modelId, lineIds, name, item, {
241
304
  colorMap,
242
305
  });
243
306
  return applyEdgeAttribute(modelId, lineIds);
@@ -252,7 +315,7 @@ function useModelLinesEdgeAttribute() {
252
315
  modelId: string,
253
316
  lineIds: string[],
254
317
  no_data_color: unknown,
255
- ) {
318
+ ): Promise<unknown> {
256
319
  const name = modelLinesEdgeAttributeName(modelId, lineIds[0]);
257
320
  const item = modelLinesEdgeAttributeItem(modelId, lineIds[0]);
258
321
  const storedConfig = modelLinesEdgeAttributeStoredConfig(modelId, lineIds[0], name, item);