@geode/opengeodeweb-front 10.22.0 → 10.22.1-rc.2

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 (82) hide show
  1. package/app/components/CrsSelector.vue +7 -4
  2. package/app/components/ExtensionSelector.vue +2 -4
  3. package/app/components/FileSelector.vue +1 -1
  4. package/app/components/Inspector/InspectionButton.vue +10 -7
  5. package/app/components/MissingFilesSelector.vue +8 -9
  6. package/app/components/ObjectSelector.vue +9 -5
  7. package/app/components/PackagesVersions.vue +1 -2
  8. package/app/components/RemoteRenderingView.vue +3 -4
  9. package/app/components/Screenshot.vue +8 -4
  10. package/app/components/ViewToolbar.vue +6 -2
  11. package/app/components/Viewer/Options/AttributeSelector.vue +2 -2
  12. package/app/components/Viewer/Options/TextureItem.vue +9 -10
  13. package/app/composables/hover_highlight.js +2 -2
  14. package/app/composables/project_manager.js +3 -6
  15. package/app/composables/use_overlapping_picker.js +6 -3
  16. package/app/stores/app.js +10 -7
  17. package/app/stores/back.js +13 -11
  18. package/app/stores/camera_manager.js +3 -3
  19. package/app/stores/cloud.js +21 -18
  20. package/app/stores/data.js +6 -2
  21. package/app/stores/hybrid_viewer.js +13 -10
  22. package/app/stores/viewer.js +18 -16
  23. package/app/utils/extension.js +1 -1
  24. package/app/utils/import_workflow.js +4 -3
  25. package/app/utils/local/microservices.js +7 -7
  26. package/app/utils/local/path.js +68 -13
  27. package/internal/stores/data_style/mesh/cells/cell.js +19 -6
  28. package/internal/stores/data_style/mesh/cells/color.js +6 -3
  29. package/internal/stores/data_style/mesh/cells/textures.js +6 -3
  30. package/internal/stores/data_style/mesh/cells/vertex.js +10 -6
  31. package/internal/stores/data_style/mesh/cells/visibility.js +6 -3
  32. package/internal/stores/data_style/mesh/edges/color.js +6 -3
  33. package/internal/stores/data_style/mesh/edges/edge.js +13 -6
  34. package/internal/stores/data_style/mesh/edges/vertex.js +10 -6
  35. package/internal/stores/data_style/mesh/edges/visibility.js +6 -3
  36. package/internal/stores/data_style/mesh/edges/width.js +6 -3
  37. package/internal/stores/data_style/mesh/index.js +12 -4
  38. package/internal/stores/data_style/mesh/points/color.js +6 -3
  39. package/internal/stores/data_style/mesh/points/size.js +6 -3
  40. package/internal/stores/data_style/mesh/points/vertex.js +11 -6
  41. package/internal/stores/data_style/mesh/points/visibility.js +6 -3
  42. package/internal/stores/data_style/mesh/polygons/color.js +6 -3
  43. package/internal/stores/data_style/mesh/polygons/polygon.js +9 -6
  44. package/internal/stores/data_style/mesh/polygons/textures.js +6 -3
  45. package/internal/stores/data_style/mesh/polygons/vertex.js +10 -6
  46. package/internal/stores/data_style/mesh/polygons/visibility.js +6 -3
  47. package/internal/stores/data_style/mesh/polyhedra/color.js +6 -3
  48. package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +14 -6
  49. package/internal/stores/data_style/mesh/polyhedra/vertex.js +14 -6
  50. package/internal/stores/data_style/mesh/polyhedra/visibility.js +6 -3
  51. package/internal/stores/data_style/model/common.js +24 -22
  52. package/internal/stores/data_style/model/edges/visibility.js +3 -3
  53. package/internal/stores/data_style/model/points/size.js +6 -3
  54. package/internal/stores/data_style/model/points/visibility.js +3 -3
  55. package/internal/stores/data_style/model/visibility.js +3 -2
  56. package/internal/stores/hybrid_viewer.js +27 -33
  57. package/internal/stores/hybrid_viewer_camera.js +9 -6
  58. package/internal/stores/hybrid_viewer_constants.js +21 -0
  59. package/internal/stores/hybrid_viewer_highlight.js +2 -1
  60. package/internal/utils/api_fetch.js +2 -1
  61. package/internal/utils/viewer_call.js +2 -2
  62. package/package.json +3 -3
  63. package/server/api/extensions/run.post.js +4 -2
  64. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +12 -8
  65. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +12 -8
  66. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +3 -2
  67. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +12 -8
  68. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +12 -8
  69. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +12 -8
  70. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +6 -13
  71. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +6 -13
  72. package/tests/integration/stores/data_style/model/edges.nuxt.test.js +3 -2
  73. package/tests/integration/stores/data_style/model/index.nuxt.test.js +3 -2
  74. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +6 -13
  75. package/tests/integration/stores/data_style/model/points.nuxt.test.js +6 -4
  76. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +6 -13
  77. package/tests/integration/stores/viewer.nuxt.test.js +1 -2
  78. package/tests/unit/components/CrsSelector.nuxt.test.js +1 -1
  79. package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +1 -1
  80. package/tests/unit/components/MissingFilesSelector.nuxt.test.js +1 -1
  81. package/tests/unit/composables/api_fetch.nuxt.test.js +5 -6
  82. package/tests/vitest.config.js +0 -1
@@ -10,8 +10,8 @@ import pTimeout from "p-timeout";
10
10
 
11
11
  // Local imports
12
12
  import { commandExistsSync, waitForReady } from "./scripts.js";
13
- import { executableName, executablePath } from "./path.js";
14
13
  import { microservicesMetadatasPath, projectMicroservices } from "./cleanup.js";
14
+ import { executablePath } from "./path.js";
15
15
 
16
16
  const DEFAULT_TIMEOUT_SECONDS = 60;
17
17
  const MILLISECONDS_PER_SECOND = 1000;
@@ -24,8 +24,8 @@ function getAvailablePort() {
24
24
  }
25
25
 
26
26
  async function runScript(
27
- execName,
28
27
  execPath,
28
+ execName,
29
29
  args,
30
30
  expectedResponse,
31
31
  timeoutSeconds = DEFAULT_TIMEOUT_SECONDS,
@@ -34,7 +34,7 @@ async function runScript(
34
34
  if (commandExistsSync(execName)) {
35
35
  command = execName;
36
36
  } else {
37
- command = path.join(executablePath(execPath), executableName(execName));
37
+ command = path.join(executablePath(execPath, execName));
38
38
  }
39
39
  console.log("runScript", command, args);
40
40
 
@@ -82,8 +82,8 @@ async function runBack(execName, execPath, args = {}) {
82
82
  if (process.env.NODE_ENV === "development" || !process.env.NODE_ENV) {
83
83
  backArgs.push("--debug");
84
84
  }
85
- console.log("runBack", execName, execPath, backArgs);
86
- await runScript(execName, execPath, backArgs, "Serving Flask app");
85
+ console.log("runBack", execPath, execName, backArgs);
86
+ await runScript(execPath, execName, backArgs, "Serving Flask app");
87
87
  return port;
88
88
  }
89
89
 
@@ -98,8 +98,8 @@ async function runViewer(execName, execPath, args = {}) {
98
98
  `--data_folder_path ${projectFolderPath}`,
99
99
  `--timeout ${0}`,
100
100
  ];
101
- console.log("runViewer", execName, execPath, viewerArgs);
102
- await runScript(execName, execPath, viewerArgs, "Starting factory");
101
+ console.log("runViewer", execPath, execName, viewerArgs);
102
+ await runScript(execPath, execName, viewerArgs, "Starting factory");
103
103
  return port;
104
104
  }
105
105
 
@@ -2,6 +2,7 @@
2
2
  import fs from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
+ import { setTimeout } from "node:timers/promises";
5
6
 
6
7
  // Third party imports
7
8
  import { v4 as uuidv4 } from "uuid";
@@ -9,22 +10,31 @@ import { v4 as uuidv4 } from "uuid";
9
10
  // Local imports
10
11
  import { appMode } from "./app_mode.js";
11
12
 
12
- function executablePath(microservicePath) {
13
+ function executablePath(execPath, execName) {
13
14
  const resourcesPath = process.env.RESOURCES_PATH;
14
15
  const mode = process.env.MODE;
15
16
  const nodeEnv = process.env.NODE_ENV;
16
- console.log("[executablePath]", { microservicePath, mode, nodeEnv, resourcesPath });
17
+ console.log("[executablePath]", { execPath, execName, mode, nodeEnv, resourcesPath });
17
18
  if (mode === appMode.DESKTOP && nodeEnv === "production") {
18
- return resourcesPath;
19
+ const execPathInResources = path.join(resourcesPath, executableName(execName));
20
+ if (fs.existsSync(execPathInResources)) {
21
+ console.log(`[executablePath] Found executable in resources path: ${execPathInResources}`);
22
+ return execPathInResources;
23
+ }
19
24
  }
20
- return microservicePath;
25
+ const localExecPath = path.join(execPath, executableName(execName));
26
+ if (fs.existsSync(localExecPath)) {
27
+ console.log(`[executablePath] Found executable in local path: ${localExecPath}`);
28
+ return localExecPath;
29
+ }
30
+ throw new Error(`Executable not found: ${execName}`);
21
31
  }
22
32
 
23
- function executableName(name) {
33
+ function executableName(execName) {
24
34
  if (process.platform === "win32") {
25
- return `${name}.exe`;
35
+ return `${execName}.exe`;
26
36
  }
27
- return name;
37
+ return execName;
28
38
  }
29
39
 
30
40
  function createPath(dirPath) {
@@ -39,17 +49,62 @@ function generateProjectFolderPath(projectName) {
39
49
  return path.join(os.tmpdir(), projectName.replaceAll("/", "_"), uuidv4());
40
50
  }
41
51
 
42
- function extensionFrontendPath(unzippedExtensionPath, frontendFile, rootPath, extensionId) {
43
- if (process.env.NODE_ENV === "production") {
44
- return path.join(unzippedExtensionPath, frontendFile);
52
+ async function lookForLocalExtensionDistPath(rootPath, extentionRepoName, frontendFile) {
53
+ const localExtensionPath = path.join(rootPath, "..", extentionRepoName);
54
+ const localExtensionDistPath = path.join(localExtensionPath, "dist");
55
+
56
+ if (!fs.existsSync(localExtensionDistPath)) {
57
+ return;
58
+ }
59
+ console.log(
60
+ `[extensionFrontendPath] Found existing folder: ${localExtensionDistPath}, deleting it...`,
61
+ );
62
+ fs.rmSync(localExtensionDistPath, { recursive: true, force: true });
63
+ const now = new Date();
64
+ fs.utimesSync(path.join(localExtensionPath, "package.json"), now, now);
65
+
66
+ const rebuiltFilePath = path.join(localExtensionDistPath, frontendFile);
67
+ const MAX_DELETE_FOLDER_RETRIES = 10;
68
+ const MILLISECONDS_PER_RETRY = 1000;
69
+
70
+ for (let i = 0; i <= MAX_DELETE_FOLDER_RETRIES; i += 1) {
71
+ if (fs.existsSync(rebuiltFilePath)) {
72
+ console.log(`Found rebuilt file: ${rebuiltFilePath}`);
73
+ return rebuiltFilePath;
74
+ }
75
+ console.log(`Waiting for rebuild... attempt ${i}/${MAX_DELETE_FOLDER_RETRIES}`);
76
+ // oxlint-disable-next-line no-await-in-loop
77
+ await setTimeout(MILLISECONDS_PER_RETRY);
45
78
  }
79
+
80
+ throw new Error(`Failed to find local extension dist path: ${rebuiltFilePath}`);
81
+ }
82
+ async function extensionFrontendPath(unzippedExtensionPath, frontendFile, rootPath, extensionId) {
83
+ console.log("[extensionFrontendPath]", {
84
+ unzippedExtensionPath,
85
+ frontendFile,
86
+ rootPath,
87
+ extensionId,
88
+ });
46
89
  const extentionRepoName = extensionId
47
90
  .split("-")
48
91
  .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
49
92
  .join("-");
50
- const localExtensionPath = path.join(rootPath, "..", extentionRepoName, "dist", frontendFile);
51
- console.log("runExtensions", { localExtensionPath });
52
- return localExtensionPath;
93
+
94
+ const localFilePath = await lookForLocalExtensionDistPath(
95
+ rootPath,
96
+ extentionRepoName,
97
+ frontendFile,
98
+ );
99
+ if (localFilePath) {
100
+ return localFilePath;
101
+ }
102
+
103
+ const unzippedfrontendFilePath = path.join(unzippedExtensionPath, frontendFile);
104
+ if (fs.existsSync(unzippedfrontendFilePath)) {
105
+ return unzippedfrontendFilePath;
106
+ }
107
+ throw new Error(`Failed to find ${unzippedfrontendFilePath}`);
53
108
  }
54
109
 
55
110
  export {
@@ -9,6 +9,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
9
9
  // Local constants
10
10
  const meshCellsCellAttributeSchemas = viewer_schemas.opengeodeweb_viewer.mesh.cells.attribute.cell;
11
11
 
12
+ // oxlint-disable-next-line max-lines-per-function
12
13
  export function useMeshCellsCellAttributeStyle() {
13
14
  const viewerStore = useViewerStore();
14
15
  const meshCellsCommonStyle = useMeshCellsCommonStyle();
@@ -42,9 +43,13 @@ export function useMeshCellsCellAttributeStyle() {
42
43
  }
43
44
 
44
45
  function setMeshCellsCellAttributeName(id, name) {
46
+ const schema = meshCellsCellAttributeSchemas.name;
47
+ const params = { id, name };
45
48
  return viewerStore.request(
46
- meshCellsCellAttributeSchemas.name,
47
- { id, name },
49
+ {
50
+ schema,
51
+ params,
52
+ },
48
53
  {
49
54
  response_function: () => meshCellsCommonStyle.mutateMeshCellsCellStyle(id, { name }),
50
55
  },
@@ -62,9 +67,13 @@ export function useMeshCellsCellAttributeStyle() {
62
67
  const name = meshCellsCellAttributeName(id);
63
68
  const points = getRGBPointsFromPreset(meshCellsCellAttributeColorMap(id));
64
69
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
70
+ const schema = meshCellsCellAttributeSchemas.color_map;
71
+ const params = { id, points, minimum, maximum };
65
72
  return viewerStore.request(
66
- meshCellsCellAttributeSchemas.color_map,
67
- { id, points, minimum, maximum },
73
+ {
74
+ schema,
75
+ params,
76
+ },
68
77
  {
69
78
  response_function: () =>
70
79
  setMeshCellsCellAttributeStoredConfig(id, name, { minimum, maximum }),
@@ -87,9 +96,13 @@ export function useMeshCellsCellAttributeStyle() {
87
96
  const points = getRGBPointsFromPreset(colorMap);
88
97
  const { minimum, maximum } = storedConfig;
89
98
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
99
+ const schema = meshCellsCellAttributeSchemas.color_map;
100
+ const params = { id, points, minimum, maximum };
90
101
  return viewerStore.request(
91
- meshCellsCellAttributeSchemas.color_map,
92
- { id, points, minimum, maximum },
102
+ {
103
+ schema,
104
+ params,
105
+ },
93
106
  {
94
107
  response_function: () => setMeshCellsCellAttributeStoredConfig(id, name, { colorMap }),
95
108
  },
@@ -6,7 +6,7 @@ import { useMeshCellsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshCellsColorSchemas = viewer_schemas.opengeodeweb_viewer.mesh.cells.color;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.cells.color;
10
10
 
11
11
  export function useMeshCellsColorStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshCellsColorStyle() {
16
16
  return meshCellsCommonStyle.meshCellsColoring(id).color;
17
17
  }
18
18
  function setMeshCellsColor(id, color) {
19
+ const params = { id, color };
19
20
  return viewerStore.request(
20
- meshCellsColorSchemas,
21
- { id, color },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () =>
24
27
  meshCellsCommonStyle.mutateMeshCellsColoring(id, {
@@ -6,7 +6,7 @@ import { useMeshCellsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshCellsTexturesSchemas = viewer_schemas.opengeodeweb_viewer.mesh.cells.apply_textures;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.cells.apply_textures;
10
10
 
11
11
  export function useMeshCellsTexturesStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshCellsTexturesStyle() {
16
16
  return meshCellsCommonStyle.meshCellsColoring(id).textures;
17
17
  }
18
18
  function setMeshCellsTextures(id, textures) {
19
+ const params = { id, textures };
19
20
  return viewerStore.request(
20
- meshCellsTexturesSchemas,
21
- { id, textures },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () =>
24
27
  meshCellsCommonStyle.mutateMeshCellsStyle(id, {
@@ -10,6 +10,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
10
10
  const meshCellsVertexAttributeSchemas =
11
11
  viewer_schemas.opengeodeweb_viewer.mesh.cells.attribute.vertex;
12
12
 
13
+ // oxlint-disable-next-line max-lines-per-function
13
14
  export function useMeshCellsVertexAttributeStyle() {
14
15
  const viewerStore = useViewerStore();
15
16
  const meshCellsCommonStyle = useMeshCellsCommonStyle();
@@ -51,9 +52,10 @@ export function useMeshCellsVertexAttributeStyle() {
51
52
  }
52
53
 
53
54
  function setMeshCellsVertexAttributeName(id, name) {
55
+ const schema = meshCellsVertexAttributeSchemas.name;
56
+ const params = { id, name };
54
57
  return viewerStore.request(
55
- meshCellsVertexAttributeSchemas.name,
56
- { id, name },
58
+ { schema, params },
57
59
  {
58
60
  response_function: () => {
59
61
  const updates = { name };
@@ -84,9 +86,10 @@ export function useMeshCellsVertexAttributeStyle() {
84
86
  const name = meshCellsVertexAttributeName(id);
85
87
  const points = getRGBPointsFromPreset(meshCellsVertexAttributeColorMap(id));
86
88
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
89
+ const schema = meshCellsVertexAttributeSchemas.color_map;
90
+ const params = { id, points, minimum, maximum };
87
91
  return viewerStore.request(
88
- meshCellsVertexAttributeSchemas.color_map,
89
- { id, points, minimum, maximum },
92
+ { schema, params },
90
93
  {
91
94
  response_function: () =>
92
95
  setMeshCellsVertexAttributeStoredConfig(id, name, { minimum, maximum }),
@@ -112,9 +115,10 @@ export function useMeshCellsVertexAttributeStyle() {
112
115
  const points = getRGBPointsFromPreset(colorMap);
113
116
  const { minimum, maximum } = storedConfig;
114
117
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
118
+ const schema = meshCellsVertexAttributeSchemas.color_map;
119
+ const params = { id, points, minimum, maximum };
115
120
  return viewerStore.request(
116
- meshCellsVertexAttributeSchemas.color_map,
117
- { id, points, minimum, maximum },
121
+ { schema, params },
118
122
  {
119
123
  response_function: () => setMeshCellsVertexAttributeStoredConfig(id, name, { colorMap }),
120
124
  },
@@ -6,7 +6,7 @@ import { useMeshCellsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshCellsVisibilitySchema = viewer_schemas.opengeodeweb_viewer.mesh.cells.visibility;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.cells.visibility;
10
10
 
11
11
  export function useMeshCellsVisibilityStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshCellsVisibilityStyle() {
16
16
  return meshCellsCommonStyle.meshCellsStyle(id).visibility;
17
17
  }
18
18
  function setMeshCellsVisibility(id, visibility) {
19
+ const params = { id, visibility };
19
20
  return viewerStore.request(
20
- meshCellsVisibilitySchema,
21
- { id, visibility },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () => meshCellsCommonStyle.mutateMeshCellsStyle(id, { visibility }),
24
27
  },
@@ -6,7 +6,7 @@ import { useMeshEdgesCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshEdgesColorSchemas = viewer_schemas.opengeodeweb_viewer.mesh.edges.color;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.edges.color;
10
10
 
11
11
  export function useMeshEdgesColorStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshEdgesColorStyle() {
16
16
  return meshEdgesCommonStyle.meshEdgesColoring(id).color;
17
17
  }
18
18
  function setMeshEdgesColor(id, color) {
19
+ const params = { id, color };
19
20
  return viewerStore.request(
20
- meshEdgesColorSchemas,
21
- { id, color },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () =>
24
27
  meshEdgesCommonStyle.mutateMeshEdgesColoring(id, {
@@ -9,6 +9,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
9
9
  // Local constants
10
10
  const meshEdgesEdgeAttributeSchemas = viewer_schemas.opengeodeweb_viewer.mesh.edges.attribute.edge;
11
11
 
12
+ // oxlint-disable-next-line max-lines-per-function
12
13
  export function useMeshEdgesEdgeAttributeStyle() {
13
14
  const viewerStore = useViewerStore();
14
15
  const meshEdgesCommonStyle = useMeshEdgesCommonStyle();
@@ -54,9 +55,13 @@ export function useMeshEdgesEdgeAttributeStyle() {
54
55
  }
55
56
 
56
57
  function setMeshEdgesEdgeAttributeName(id, name) {
58
+ const schema = meshEdgesEdgeAttributeSchemas.name;
59
+ const params = { id, name };
57
60
  return viewerStore.request(
58
- meshEdgesEdgeAttributeSchemas.name,
59
- { id, name },
61
+ {
62
+ schema,
63
+ params,
64
+ },
60
65
  {
61
66
  response_function: () => {
62
67
  const updates = { name };
@@ -87,9 +92,10 @@ export function useMeshEdgesEdgeAttributeStyle() {
87
92
  const name = meshEdgesEdgeAttributeName(id);
88
93
  const points = getRGBPointsFromPreset(meshEdgesEdgeAttributeColorMap(id));
89
94
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
95
+ const schema = meshEdgesEdgeAttributeSchemas.color_map;
96
+ const params = { id, points, minimum, maximum };
90
97
  return viewerStore.request(
91
- meshEdgesEdgeAttributeSchemas.color_map,
92
- { id, points, minimum, maximum },
98
+ { schema, params },
93
99
  {
94
100
  response_function: () =>
95
101
  setMeshEdgesEdgeAttributeStoredConfig(id, name, { minimum, maximum }),
@@ -115,9 +121,10 @@ export function useMeshEdgesEdgeAttributeStyle() {
115
121
  const points = getRGBPointsFromPreset(colorMap);
116
122
  const { minimum, maximum } = storedConfig;
117
123
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
124
+ const schema = meshEdgesEdgeAttributeSchemas.color_map;
125
+ const params = { id, points, minimum, maximum };
118
126
  return viewerStore.request(
119
- meshEdgesEdgeAttributeSchemas.color_map,
120
- { id, points, minimum, maximum },
127
+ { schema, params },
121
128
  {
122
129
  response_function: () => setMeshEdgesEdgeAttributeStoredConfig(id, name, { colorMap }),
123
130
  },
@@ -9,6 +9,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
9
9
  const meshEdgesVertexAttributeSchemas =
10
10
  viewer_schemas.opengeodeweb_viewer.mesh.edges.attribute.vertex;
11
11
 
12
+ // oxlint-disable-next-line max-lines-per-function
12
13
  export function useMeshEdgesVertexAttributeStyle() {
13
14
  const viewerStore = useViewerStore();
14
15
  const meshEdgesCommonStyle = useMeshEdgesCommonStyle();
@@ -53,9 +54,10 @@ export function useMeshEdgesVertexAttributeStyle() {
53
54
  return meshEdgesVertexAttribute(id).name;
54
55
  }
55
56
  function setMeshEdgesVertexAttributeName(id, name) {
57
+ const schema = meshEdgesVertexAttributeSchemas.name;
58
+ const params = { id, name };
56
59
  return viewerStore.request(
57
- meshEdgesVertexAttributeSchemas.name,
58
- { id, name },
60
+ { schema, params },
59
61
  {
60
62
  response_function: () => {
61
63
  const updates = { name };
@@ -85,9 +87,10 @@ export function useMeshEdgesVertexAttributeStyle() {
85
87
  const name = meshEdgesVertexAttributeName(id);
86
88
  const points = getRGBPointsFromPreset(meshEdgesVertexAttributeColorMap(id));
87
89
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
90
+ const schema = meshEdgesVertexAttributeSchemas.color_map;
91
+ const params = { id, points, minimum, maximum };
88
92
  return viewerStore.request(
89
- meshEdgesVertexAttributeSchemas.color_map,
90
- { id, points, minimum, maximum },
93
+ { schema, params },
91
94
  {
92
95
  response_function: () =>
93
96
  setMeshEdgesVertexAttributeStoredConfig(id, name, { minimum, maximum }),
@@ -112,9 +115,10 @@ export function useMeshEdgesVertexAttributeStyle() {
112
115
  const points = getRGBPointsFromPreset(colorMap);
113
116
  const { minimum, maximum } = storedConfig;
114
117
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
118
+ const schema = meshEdgesVertexAttributeSchemas.color_map;
119
+ const params = { id, points, minimum, maximum };
115
120
  return viewerStore.request(
116
- meshEdgesVertexAttributeSchemas.color_map,
117
- { id, points, minimum, maximum },
121
+ { schema, params },
118
122
  {
119
123
  response_function: () => setMeshEdgesVertexAttributeStoredConfig(id, name, { colorMap }),
120
124
  },
@@ -5,7 +5,7 @@ import { useMeshEdgesCommonStyle } from "./common";
5
5
  import { useViewerStore } from "@ogw_front/stores/viewer";
6
6
 
7
7
  // Local constants
8
- const meshEdgesVisibilitySchema = viewer_schemas.opengeodeweb_viewer.mesh.edges.visibility;
8
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.edges.visibility;
9
9
 
10
10
  export function useMeshEdgesVisibilityStyle() {
11
11
  const viewerStore = useViewerStore();
@@ -15,9 +15,12 @@ export function useMeshEdgesVisibilityStyle() {
15
15
  return meshEdgesCommonStyle.meshEdgesStyle(id).visibility;
16
16
  }
17
17
  function setMeshEdgesVisibility(id, visibility) {
18
+ const params = { id, visibility };
18
19
  return viewerStore.request(
19
- meshEdgesVisibilitySchema,
20
- { id, visibility },
20
+ {
21
+ schema,
22
+ params,
23
+ },
21
24
  {
22
25
  response_function: () => meshEdgesCommonStyle.mutateMeshEdgesStyle(id, { visibility }),
23
26
  },
@@ -5,7 +5,7 @@ import { useMeshEdgesCommonStyle } from "./common";
5
5
  import { useViewerStore } from "@ogw_front/stores/viewer";
6
6
 
7
7
  // Local constants
8
- const meshEdgesWidthSchemas = viewer_schemas.opengeodeweb_viewer.mesh.edges.width;
8
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.edges.width;
9
9
 
10
10
  export function useMeshEdgesWidthStyle() {
11
11
  const viewerStore = useViewerStore();
@@ -15,9 +15,12 @@ export function useMeshEdgesWidthStyle() {
15
15
  return meshEdgesCommonStyle.meshEdgesStyle(id).width;
16
16
  }
17
17
  function setMeshEdgesWidth(id, width) {
18
+ const params = { id, width };
18
19
  return viewerStore.request(
19
- meshEdgesWidthSchemas,
20
- { id, width },
20
+ {
21
+ schema,
22
+ params,
23
+ },
21
24
  {
22
25
  response_function: () => meshEdgesCommonStyle.mutateMeshEdgesStyle(id, { width }),
23
26
  },
@@ -29,9 +29,13 @@ export function useMeshStyle() {
29
29
  return dataStyleState.getStyle(id).visibility;
30
30
  }
31
31
  function setMeshVisibility(id, visibility) {
32
+ const schema = meshSchemas.visibility;
33
+ const params = { id, visibility };
32
34
  return viewerStore.request(
33
- meshSchemas.visibility,
34
- { id, visibility },
35
+ {
36
+ schema,
37
+ params,
38
+ },
35
39
  {
36
40
  response_function: async () => {
37
41
  await hybridViewerStore.setVisibility(id, visibility);
@@ -46,9 +50,13 @@ export function useMeshStyle() {
46
50
  }
47
51
 
48
52
  function setMeshColor(id, color) {
53
+ const schema = meshSchemas.color;
54
+ const params = { id, color };
49
55
  return viewerStore.request(
50
- meshSchemas.color,
51
- { id, color },
56
+ {
57
+ schema,
58
+ params,
59
+ },
52
60
  {
53
61
  response_function: () => dataStyleState.mutateStyle(id, { color }),
54
62
  },
@@ -6,7 +6,7 @@ import { useMeshPointsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshPointsColorSchemas = viewer_schemas.opengeodeweb_viewer.mesh.points.color;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.points.color;
10
10
 
11
11
  export function useMeshPointsColorStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshPointsColorStyle() {
16
16
  return meshPointsCommonStyle.meshPointsColoring(id).color;
17
17
  }
18
18
  function setMeshPointsColor(id, color) {
19
+ const params = { id, color };
19
20
  return viewerStore.request(
20
- meshPointsColorSchemas,
21
- { id, color },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () =>
24
27
  meshPointsCommonStyle.mutateMeshPointsColoring(id, {
@@ -6,7 +6,7 @@ import { useMeshPointsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshPointsSizeSchemas = viewer_schemas.opengeodeweb_viewer.mesh.points.size;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.points.size;
10
10
 
11
11
  export function useMeshPointsSizeStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshPointsSizeStyle() {
16
16
  return meshPointsCommonStyle.meshPointsStyle(id).size;
17
17
  }
18
18
  function setMeshPointsSize(id, size) {
19
+ const params = { id, size };
19
20
  return viewerStore.request(
20
- meshPointsSizeSchemas,
21
- { id, size },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () => meshPointsCommonStyle.mutateMeshPointsStyle(id, { size }),
24
27
  },
@@ -10,6 +10,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
10
10
  const meshPointsVertexAttributeSchemas =
11
11
  viewer_schemas.opengeodeweb_viewer.mesh.points.attribute.vertex;
12
12
 
13
+ // oxlint-disable-next-line max-lines-per-function
13
14
  function useMeshPointsVertexAttributeConfig() {
14
15
  const meshPointsCommonStyle = useMeshPointsCommonStyle();
15
16
 
@@ -74,14 +75,16 @@ function useMeshPointsVertexAttributeConfig() {
74
75
  };
75
76
  }
76
77
 
78
+ // oxlint-disable-next-line max-lines-per-function
77
79
  function useMeshPointsVertexAttributeActions() {
78
80
  const viewerStore = useViewerStore();
79
81
  const config = useMeshPointsVertexAttributeConfig();
80
82
 
81
83
  function setMeshPointsVertexAttributeName(id, name) {
84
+ const schema = meshPointsVertexAttributeSchemas.name;
85
+ const params = { id, name };
82
86
  return viewerStore.request(
83
- meshPointsVertexAttributeSchemas.name,
84
- { id, name },
87
+ { schema, params },
85
88
  {
86
89
  response_function: () => {
87
90
  const updates = { name };
@@ -105,9 +108,10 @@ function useMeshPointsVertexAttributeActions() {
105
108
  const name = config.meshPointsVertexAttributeName(id);
106
109
  const points = getRGBPointsFromPreset(config.meshPointsVertexAttributeColorMap(id));
107
110
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
111
+ const schema = meshPointsVertexAttributeSchemas.color_map;
112
+ const params = { id, points, minimum, maximum };
108
113
  return viewerStore.request(
109
- meshPointsVertexAttributeSchemas.color_map,
110
- { id, points, minimum, maximum },
114
+ { schema, params },
111
115
  {
112
116
  response_function: () =>
113
117
  config.setMeshPointsVertexAttributeStoredConfig(id, name, { minimum, maximum }),
@@ -126,9 +130,10 @@ function useMeshPointsVertexAttributeActions() {
126
130
  const points = getRGBPointsFromPreset(colorMap);
127
131
  const { minimum, maximum } = storedConfig;
128
132
  if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
133
+ const schema = meshPointsVertexAttributeSchemas.color_map;
134
+ const params = { id, points, minimum, maximum };
129
135
  return viewerStore.request(
130
- meshPointsVertexAttributeSchemas.color_map,
131
- { id, points, minimum, maximum },
136
+ { schema, params },
132
137
  {
133
138
  response_function: () =>
134
139
  config.setMeshPointsVertexAttributeStoredConfig(id, name, { colorMap }),
@@ -6,7 +6,7 @@ import { useMeshPointsCommonStyle } from "./common";
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
7
7
 
8
8
  // Local constants
9
- const meshPointsVisibilitySchema = viewer_schemas.opengeodeweb_viewer.mesh.points.visibility;
9
+ const schema = viewer_schemas.opengeodeweb_viewer.mesh.points.visibility;
10
10
 
11
11
  export function useMeshPointsVisibilityStyle() {
12
12
  const viewerStore = useViewerStore();
@@ -16,9 +16,12 @@ export function useMeshPointsVisibilityStyle() {
16
16
  return meshPointsCommonStyle.meshPointsStyle(id).visibility;
17
17
  }
18
18
  function setMeshPointsVisibility(id, visibility) {
19
+ const params = { id, visibility };
19
20
  return viewerStore.request(
20
- meshPointsVisibilitySchema,
21
- { id, visibility },
21
+ {
22
+ schema,
23
+ params,
24
+ },
22
25
  {
23
26
  response_function: () => meshPointsCommonStyle.mutateMeshPointsStyle(id, { visibility }),
24
27
  },