@geode/opengeodeweb-front 10.44.0-rc.3 → 10.44.0-rc.5

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 (125) hide show
  1. package/.build/server/utils/microservices.js +9 -85
  2. package/.build/server/utils/microservices_process.js +85 -0
  3. package/app/components/ClippingPlanes.vue +16 -82
  4. package/app/components/DragAndDrop.vue +1 -74
  5. package/app/components/ThresholdCard.vue +205 -0
  6. package/app/components/ThresholdFilter.vue +77 -216
  7. package/app/components/ViewToolbar.vue +15 -231
  8. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +209 -0
  9. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +3 -191
  10. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +221 -0
  11. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +3 -210
  12. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +211 -0
  13. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -192
  14. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +13 -0
  15. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +227 -0
  16. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +3 -215
  17. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +221 -0
  18. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +3 -203
  19. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +2 -18
  20. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +145 -0
  21. package/app/components/Viewer/Generic/Model/CornersOptions.vue +13 -294
  22. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +173 -0
  23. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +218 -0
  24. package/app/components/Viewer/Generic/Model/LinesOptions.vue +13 -425
  25. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +229 -0
  26. package/app/components/Viewer/Options/AttributeSelector.vue +26 -133
  27. package/app/components/Viewer/Options/ColoringTypeSelector.vue +48 -74
  28. package/app/components/Viewer/Options/NoDataColorInfo.vue +56 -0
  29. package/app/components/Viewer/Options/Sliders/Opacity.vue +22 -0
  30. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +13 -0
  31. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +217 -0
  32. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +4 -199
  33. package/app/components/Viewer/Surface/PolygonsColoring.vue +224 -0
  34. package/app/components/Viewer/Surface/PolygonsOptions.vue +3 -213
  35. package/app/composables/attribute_selector.ts +126 -0
  36. package/app/composables/batch_style_model.ts +34 -0
  37. package/app/composables/clipping_slices.ts +166 -0
  38. package/app/composables/view_toolbar_options.ts +126 -0
  39. package/app/composables/view_toolbar_tool_options.ts +115 -0
  40. package/app/composables/view_toolbar_tools.ts +108 -0
  41. package/app/composables/virtual_tree.ts +20 -138
  42. package/app/composables/virtual_tree_flatten.ts +86 -0
  43. package/app/composables/virtual_tree_types.ts +81 -0
  44. package/app/stores/app.ts +8 -55
  45. package/app/stores/app_helpers/registry.ts +69 -0
  46. package/app/stores/menu.ts +1 -124
  47. package/app/stores/menu_helpers/menus_data.ts +127 -0
  48. package/app/stores/viewer.ts +17 -78
  49. package/app/stores/viewer_helpers/actions.ts +68 -0
  50. package/app/stores/viewer_helpers/request.ts +61 -0
  51. package/app/utils/clipping_planes.ts +4 -132
  52. package/app/utils/clipping_planes_scene.ts +131 -0
  53. package/app/utils/coloring_styles.ts +101 -0
  54. package/app/utils/default_styles/mesh_components.ts +168 -0
  55. package/app/utils/default_styles/meshes.ts +13 -153
  56. package/app/utils/default_styles/model_components.ts +170 -0
  57. package/app/utils/default_styles/models.ts +16 -153
  58. package/app/utils/drag_and_drop.ts +80 -0
  59. package/app/utils/model_component_coloring.ts +46 -0
  60. package/app/utils/threshold.ts +33 -0
  61. package/app/utils/threshold_sources.ts +51 -0
  62. package/internal/stores/data_style/mesh/cells/cell.ts +27 -150
  63. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +74 -0
  64. package/internal/stores/data_style/mesh/cells/cell_config.ts +152 -0
  65. package/internal/stores/data_style/mesh/cells/color.ts +3 -1
  66. package/internal/stores/data_style/mesh/cells/index.ts +17 -1
  67. package/internal/stores/data_style/mesh/cells/opacity.ts +54 -0
  68. package/internal/stores/data_style/mesh/cells/vertex.ts +26 -157
  69. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +80 -0
  70. package/internal/stores/data_style/mesh/cells/vertex_config.ts +152 -0
  71. package/internal/stores/data_style/mesh/edges/color.ts +3 -1
  72. package/internal/stores/data_style/mesh/edges/edge.ts +27 -150
  73. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +74 -0
  74. package/internal/stores/data_style/mesh/edges/edge_config.ts +152 -0
  75. package/internal/stores/data_style/mesh/edges/index.ts +17 -1
  76. package/internal/stores/data_style/mesh/edges/opacity.ts +54 -0
  77. package/internal/stores/data_style/mesh/edges/vertex.ts +26 -157
  78. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +80 -0
  79. package/internal/stores/data_style/mesh/edges/vertex_config.ts +152 -0
  80. package/internal/stores/data_style/mesh/points/color.ts +3 -1
  81. package/internal/stores/data_style/mesh/points/index.ts +17 -1
  82. package/internal/stores/data_style/mesh/points/opacity.ts +54 -0
  83. package/internal/stores/data_style/mesh/points/vertex.ts +26 -157
  84. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +80 -0
  85. package/internal/stores/data_style/mesh/points/vertex_config.ts +152 -0
  86. package/internal/stores/data_style/mesh/polygons/color.ts +3 -1
  87. package/internal/stores/data_style/mesh/polygons/index.ts +17 -1
  88. package/internal/stores/data_style/mesh/polygons/opacity.ts +54 -0
  89. package/internal/stores/data_style/mesh/polygons/polygon.ts +27 -152
  90. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +80 -0
  91. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +148 -0
  92. package/internal/stores/data_style/mesh/polygons/vertex.ts +26 -157
  93. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +80 -0
  94. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +152 -0
  95. package/internal/stores/data_style/mesh/polyhedra/color.ts +3 -1
  96. package/internal/stores/data_style/mesh/polyhedra/index.ts +17 -1
  97. package/internal/stores/data_style/mesh/polyhedra/opacity.ts +54 -0
  98. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +27 -160
  99. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +82 -0
  100. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +157 -0
  101. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +26 -157
  102. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +80 -0
  103. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +152 -0
  104. package/internal/stores/data_style/model/blocks/apply_coloring.ts +173 -0
  105. package/internal/stores/data_style/model/blocks/coloring_groups.ts +18 -0
  106. package/internal/stores/data_style/model/blocks/index.ts +12 -140
  107. package/internal/stores/data_style/model/common.ts +10 -119
  108. package/internal/stores/data_style/model/common_mutations.ts +184 -0
  109. package/internal/stores/data_style/model/lines/apply_coloring.ts +154 -0
  110. package/internal/stores/data_style/model/lines/coloring_groups.ts +18 -0
  111. package/internal/stores/data_style/model/lines/index.ts +10 -134
  112. package/internal/stores/data_style/model/surfaces/apply_coloring.ts +186 -0
  113. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +18 -0
  114. package/internal/stores/data_style/model/surfaces/index.ts +16 -160
  115. package/internal/stores/data_style/model/visibility.ts +3 -156
  116. package/internal/stores/data_style/model/visibility_dispatch.ts +160 -0
  117. package/internal/stores/data_style/state.ts +1 -181
  118. package/internal/stores/data_style/state_shared.ts +191 -0
  119. package/internal/stores/hybrid_viewer/camera.ts +7 -161
  120. package/internal/stores/hybrid_viewer/camera_helpers.ts +120 -0
  121. package/internal/stores/hybrid_viewer/camera_orientation.ts +60 -0
  122. package/internal/stores/hybrid_viewer/filters.ts +54 -11
  123. package/package.json +1 -1
  124. package/server/utils/microservices.ts +10 -109
  125. package/server/utils/microservices_process.ts +127 -0
@@ -0,0 +1,127 @@
1
+ // Node imports
2
+ import child_process from "node:child_process";
3
+ import path from "node:path";
4
+
5
+ // Third party imports
6
+ import { consola } from "consola";
7
+
8
+ // Local imports
9
+ import { type NamedChildProcess, waitForReady } from "./scripts.js";
10
+ import { executablePath } from "./path.js";
11
+
12
+ interface RunArgs {
13
+ projectFolderPath: string;
14
+ uploadFolderPath?: string;
15
+ [key: string]: unknown;
16
+ }
17
+
18
+ const MILLISECONDS_PER_SECOND = 1000;
19
+ const DEFAULT_TIMEOUT_SECONDS = 120;
20
+ const MAX_PORT_RETRIES = 1;
21
+ const DEFAULT_RUN_ARGS: RunArgs = { projectFolderPath: "" };
22
+ const LISTENING_LOG_PATTERN = /^Listening on https?:\/\/.+:\d+\/?\s*$/mu;
23
+
24
+ async function runScript(
25
+ execPath: string,
26
+ execName: string,
27
+ args: readonly string[],
28
+ expectedResponse: string,
29
+ timeoutSeconds = DEFAULT_TIMEOUT_SECONDS,
30
+ ): Promise<NamedChildProcess> {
31
+ const command = executablePath(execPath, execName);
32
+ consola.debug("runScript", command, args);
33
+ const child = child_process.spawn(command, args, {
34
+ stdio: ["ignore", "pipe", "pipe"],
35
+ }) as NamedChildProcess;
36
+ child.name = command.replace(/^.*[\\/]/u, "");
37
+ child.on("spawn", () => {
38
+ consola.info(`[${child.name}] spawned, pid=${child.pid}`);
39
+ });
40
+ const controller = new AbortController();
41
+ const timer = setTimeout(() => {
42
+ controller.abort();
43
+ }, timeoutSeconds * MILLISECONDS_PER_SECOND);
44
+ if (typeof timer.unref === "function") {
45
+ timer.unref();
46
+ }
47
+ try {
48
+ const result = await waitForReady(child, expectedResponse, controller.signal);
49
+ clearTimeout(timer);
50
+ return result;
51
+ } catch (error) {
52
+ clearTimeout(timer);
53
+ child.kill();
54
+ throw error;
55
+ }
56
+ }
57
+
58
+ function isPortInUseError(error: unknown): boolean {
59
+ return /EADDRINUSE|address already in use|port already in use/iu.test(String(error));
60
+ }
61
+
62
+ function resolveUploadFolderPath(
63
+ projectFolderPath: string,
64
+ uploadFolderPath: string | undefined,
65
+ ): string {
66
+ if (uploadFolderPath !== undefined && uploadFolderPath !== "") {
67
+ return uploadFolderPath;
68
+ }
69
+ return path.join(projectFolderPath, "uploads");
70
+ }
71
+
72
+ function backArgs(args: RunArgs, port: number): string[] {
73
+ const { projectFolderPath } = args;
74
+ if (!projectFolderPath) {
75
+ throw new Error("projectFolderPath is required");
76
+ }
77
+ const uploadFolderPath = resolveUploadFolderPath(projectFolderPath, args.uploadFolderPath);
78
+ const executableArgs = [
79
+ "--port",
80
+ String(port),
81
+ "--project_folder_path",
82
+ projectFolderPath,
83
+ "--upload_folder_path",
84
+ uploadFolderPath,
85
+ "--allowed_origins",
86
+ "http://localhost:*",
87
+ "--timeout",
88
+ "0",
89
+ ];
90
+ if (process.env.NODE_ENV === undefined || process.env.NODE_ENV === "development") {
91
+ executableArgs.push("--debug");
92
+ }
93
+ return executableArgs;
94
+ }
95
+
96
+ async function waitUntilListening(
97
+ child: child_process.ChildProcessWithoutNullStreams,
98
+ ): Promise<void> {
99
+ child.stderr.on("data", (data: Buffer) => {
100
+ consola.info(`[${child.spawnfile}] STDERR:`, data.toString().trim());
101
+ });
102
+ child.on("close", (code) => {
103
+ consola.info(`[${child.spawnfile}] exited with code ${code}`);
104
+ });
105
+ // oxlint-disable-next-line typescript/no-unnecessary-condition
106
+ for await (const chunk of child.stdout) {
107
+ const output = String(chunk);
108
+ consola.info(`[${child.spawnfile}] STDOUT:`, output.trim());
109
+ if (LISTENING_LOG_PATTERN.test(output)) {
110
+ child.stdout.on("data", (data: Buffer) => {
111
+ consola.info(`[${child.spawnfile}] STDOUT:`, data.toString().trim());
112
+ });
113
+ return;
114
+ }
115
+ }
116
+ throw new Error(`${child.spawnfile} exited before becoming ready`);
117
+ }
118
+
119
+ export {
120
+ DEFAULT_RUN_ARGS,
121
+ MAX_PORT_RETRIES,
122
+ backArgs,
123
+ isPortInUseError,
124
+ runScript,
125
+ waitUntilListening,
126
+ };
127
+ export type { RunArgs };