@geode/opengeodeweb-front 10.2.1 → 10.3.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 (83) hide show
  1. package/.github/workflows/manual_release.yml +11 -0
  2. package/app/components/Step.vue +2 -2
  3. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +63 -19
  4. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +65 -18
  5. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +8 -15
  6. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +8 -9
  7. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +8 -8
  8. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +6 -6
  9. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +2 -2
  10. package/app/components/Viewer/Generic/Model/PointsOptions.vue +4 -4
  11. package/app/components/Viewer/Options/AttributeColorBar.vue +58 -0
  12. package/app/components/Viewer/Options/CellAttributeSelector.vue +51 -19
  13. package/app/components/Viewer/Options/ColorMapList.vue +216 -0
  14. package/app/components/Viewer/Options/ColorMapPicker.vue +168 -0
  15. package/app/components/Viewer/Options/ColoringTypeSelector.vue +46 -24
  16. package/app/components/Viewer/Options/EdgeAttributeSelector.vue +53 -41
  17. package/app/components/Viewer/Options/PolygonAttributeSelector.vue +52 -19
  18. package/app/components/Viewer/Options/PolyhedronAttributeSelector.vue +57 -20
  19. package/app/components/Viewer/Options/VertexAttributeSelector.vue +47 -15
  20. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +38 -14
  21. package/app/components/Viewer/PolygonalSurface/SpecificPolygonsOptions.vue +74 -18
  22. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +75 -17
  23. package/app/components/Viewer/TreeComponent.vue +26 -76
  24. package/app/stores/data_style.js +3 -3
  25. package/app/utils/colormap.js +5 -0
  26. package/app/utils/default_styles.js +36 -9
  27. package/internal/stores/data_style/mesh/cells/cell.js +153 -0
  28. package/internal/stores/data_style/mesh/cells/color.js +40 -0
  29. package/internal/stores/data_style/mesh/cells/common.js +23 -0
  30. package/internal/stores/data_style/mesh/cells/index.js +84 -0
  31. package/internal/stores/data_style/mesh/cells/textures.js +36 -0
  32. package/internal/stores/data_style/mesh/cells/vertex.js +153 -0
  33. package/internal/stores/data_style/mesh/cells/visibility.js +40 -0
  34. package/internal/stores/data_style/mesh/edges/color.js +40 -0
  35. package/internal/stores/data_style/mesh/edges/common.js +23 -0
  36. package/internal/stores/data_style/mesh/edges/edge.js +141 -0
  37. package/internal/stores/data_style/mesh/edges/index.js +88 -0
  38. package/internal/stores/data_style/mesh/edges/vertex.js +153 -0
  39. package/internal/stores/data_style/mesh/edges/visibility.js +40 -0
  40. package/internal/stores/data_style/mesh/edges/width.js +40 -0
  41. package/internal/stores/{mesh → data_style/mesh}/index.js +25 -23
  42. package/internal/stores/data_style/mesh/points/color.js +40 -0
  43. package/internal/stores/data_style/mesh/points/common.js +23 -0
  44. package/internal/stores/data_style/mesh/points/index.js +89 -0
  45. package/internal/stores/data_style/mesh/points/size.js +40 -0
  46. package/internal/stores/data_style/mesh/points/vertex.js +153 -0
  47. package/internal/stores/data_style/mesh/points/visibility.js +40 -0
  48. package/internal/stores/data_style/mesh/polygons/color.js +40 -0
  49. package/internal/stores/data_style/mesh/polygons/common.js +23 -0
  50. package/internal/stores/data_style/mesh/polygons/index.js +89 -0
  51. package/internal/stores/data_style/mesh/polygons/polygon.js +145 -0
  52. package/internal/stores/data_style/mesh/polygons/textures.js +40 -0
  53. package/internal/stores/data_style/mesh/polygons/vertex.js +153 -0
  54. package/internal/stores/data_style/mesh/polygons/visibility.js +40 -0
  55. package/internal/stores/data_style/mesh/polyhedra/color.js +40 -0
  56. package/internal/stores/data_style/mesh/polyhedra/common.js +23 -0
  57. package/internal/stores/data_style/mesh/polyhedra/index.js +83 -0
  58. package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +139 -0
  59. package/internal/stores/data_style/mesh/polyhedra/vertex.js +153 -0
  60. package/internal/stores/data_style/mesh/polyhedra/visibility.js +41 -0
  61. package/internal/stores/{model → data_style/model}/blocks.js +1 -1
  62. package/internal/stores/{model → data_style/model}/corners.js +1 -1
  63. package/internal/stores/{model → data_style/model}/edges.js +1 -1
  64. package/internal/stores/{model → data_style/model}/index.js +3 -3
  65. package/internal/stores/{model → data_style/model}/lines.js +1 -1
  66. package/internal/stores/{model → data_style/model}/points.js +1 -1
  67. package/internal/stores/{model → data_style/model}/surfaces.js +1 -1
  68. package/internal/stores/{data_style_state.js → data_style/state.js} +6 -3
  69. package/package.json +1 -1
  70. package/tests/integration/microservices/back/requirements.txt +1 -1
  71. package/tests/integration/microservices/viewer/requirements.txt +1 -1
  72. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +18 -18
  73. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +22 -16
  74. package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +1 -1
  75. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +14 -12
  76. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +16 -19
  77. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +16 -19
  78. package/tests/vitest.config.js +3 -0
  79. package/internal/stores/mesh/cells.js +0 -175
  80. package/internal/stores/mesh/edges.js +0 -171
  81. package/internal/stores/mesh/points.js +0 -142
  82. package/internal/stores/mesh/polygons.js +0 -181
  83. package/internal/stores/mesh/polyhedra.js +0 -151
@@ -0,0 +1,153 @@
1
+ // Third party imports
2
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
+
4
+ // Local imports
5
+ import { useViewerStore } from "@ogw_front/stores/viewer"
6
+ import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap"
7
+ import { useMeshPolyhedraCommonStyle } from "./common"
8
+
9
+ // Local constants
10
+ const meshPolyhedraVertexAttributeSchemas =
11
+ viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.attribute.vertex
12
+
13
+ export function useMeshPolyhedraVertexAttributeStyle() {
14
+ const viewerStore = useViewerStore()
15
+ const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle()
16
+
17
+ function meshPolyhedraVertexAttribute(id) {
18
+ return meshPolyhedraCommonStyle.meshPolyhedraColoring(id).vertex
19
+ }
20
+
21
+ async function updateMeshPolyhedraVertexAttribute(id) {
22
+ const name = meshPolyhedraVertexAttributeName(id)
23
+ const storedConfig = meshPolyhedraVertexAttributeStoredConfig(id, name)
24
+ await meshPolyhedraVertexAttributeRange(
25
+ id,
26
+ storedConfig.minimum,
27
+ storedConfig.maximum,
28
+ )
29
+ await meshPolyhedraVertexAttributeColorMap(id, storedConfig.colorMap)
30
+ }
31
+
32
+ function meshPolyhedraVertexAttributeStoredConfig(id, name) {
33
+ const storedConfigs = meshPolyhedraVertexAttribute(id).storedConfigs
34
+ if (name in storedConfigs) {
35
+ return storedConfigs[name]
36
+ }
37
+ return setMeshPolyhedraVertexAttributeStoredConfig(id, name, {
38
+ minimum: 0,
39
+ maximum: 1,
40
+ colorMap: "Cool to Warm",
41
+ })
42
+ }
43
+
44
+ function setMeshPolyhedraVertexAttributeStoredConfig(
45
+ id,
46
+ name,
47
+ { minimum, maximum, colorMap },
48
+ ) {
49
+ const storedConfigs = meshPolyhedraVertexAttribute(id).storedConfigs
50
+ storedConfigs[name] = { minimum, maximum, colorMap }
51
+ return storedConfigs[name]
52
+ }
53
+
54
+ function meshPolyhedraVertexAttributeName(id) {
55
+ console.log(
56
+ meshPolyhedraVertexAttributeName.name,
57
+ { id },
58
+ meshPolyhedraVertexAttribute(id),
59
+ )
60
+ return meshPolyhedraVertexAttribute(id).name
61
+ }
62
+ function setMeshPolyhedraVertexAttributeName(id, name) {
63
+ console.log(setMeshPolyhedraVertexAttributeName.name, { id, name })
64
+ return viewerStore.request(
65
+ meshPolyhedraVertexAttributeSchemas.name,
66
+ { id, name },
67
+ {
68
+ response_function: async () => {
69
+ meshPolyhedraVertexAttribute(id).name = name
70
+ const { minimum, maximum, colorMap } =
71
+ meshPolyhedraVertexAttributeStoredConfig(id, name)
72
+ await setMeshPolyhedraVertexAttributeRange(id, minimum, maximum)
73
+ await setMeshPolyhedraVertexAttributeColorMap(id, colorMap)
74
+ console.log(
75
+ setMeshPolyhedraVertexAttributeName.name,
76
+ { id },
77
+ meshPolyhedraVertexAttributeName(id),
78
+ )
79
+ },
80
+ },
81
+ )
82
+ }
83
+
84
+ function meshPolyhedraVertexAttributeRange(id) {
85
+ const name = meshPolyhedraVertexAttributeName(id)
86
+ const storedConfig = meshPolyhedraVertexAttributeStoredConfig(id, name)
87
+ const { minimum, maximum } = storedConfig
88
+ return [minimum, maximum]
89
+ }
90
+ function setMeshPolyhedraVertexAttributeRange(id, minimum, maximum) {
91
+ const name = meshPolyhedraVertexAttributeName(id)
92
+ const storedConfig = meshPolyhedraVertexAttributeStoredConfig(id, name)
93
+ return viewerStore.request(
94
+ meshPolyhedraVertexAttributeSchemas.scalar_range,
95
+ { id, minimum, maximum },
96
+ {
97
+ response_function: () => {
98
+ storedConfig.minimum = minimum
99
+ storedConfig.maximum = maximum
100
+ console.log(
101
+ setMeshPolyhedraVertexAttributeRange.name,
102
+ { id },
103
+ meshPolyhedraVertexAttributeRange(id),
104
+ )
105
+ },
106
+ },
107
+ )
108
+ }
109
+
110
+ function meshPolyhedraVertexAttributeColorMap(id) {
111
+ const name = meshPolyhedraVertexAttributeName(id)
112
+ const storedConfig = meshPolyhedraVertexAttributeStoredConfig(id, name)
113
+ const { colorMap } = storedConfig
114
+ return colorMap
115
+ }
116
+ function setMeshPolyhedraVertexAttributeColorMap(id, colorMap) {
117
+ const name = meshPolyhedraVertexAttributeName(id)
118
+ const storedConfig = meshPolyhedraVertexAttributeStoredConfig(id, name)
119
+ const points = getRGBPointsFromPreset(colorMap)
120
+ const { minimum, maximum } = storedConfig
121
+
122
+ console.log(setMeshPolyhedraVertexAttributeColorMap.name, {
123
+ id,
124
+ minimum,
125
+ maximum,
126
+ colorMap,
127
+ })
128
+ return viewerStore.request(
129
+ meshPolyhedraVertexAttributeSchemas.color_map,
130
+ { id, points, minimum, maximum },
131
+ {
132
+ response_function: () => {
133
+ storedConfig.colorMap = colorMap
134
+ console.log(
135
+ setMeshPolyhedraVertexAttributeColorMap.name,
136
+ { id },
137
+ meshPolyhedraVertexAttributeColorMap(id),
138
+ )
139
+ },
140
+ },
141
+ )
142
+ }
143
+
144
+ return {
145
+ meshPolyhedraVertexAttributeName,
146
+ meshPolyhedraVertexAttributeRange,
147
+ meshPolyhedraVertexAttributeColorMap,
148
+ setMeshPolyhedraVertexAttributeName,
149
+ setMeshPolyhedraVertexAttributeRange,
150
+ setMeshPolyhedraVertexAttributeColorMap,
151
+ updateMeshPolyhedraVertexAttribute,
152
+ }
153
+ }
@@ -0,0 +1,41 @@
1
+ // Third party imports
2
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
+
4
+ // Local imports
5
+ import { useViewerStore } from "@ogw_front/stores/viewer"
6
+ import { useMeshPolyhedraCommonStyle } from "./common"
7
+
8
+ // Local constants
9
+ const meshPolyhedraVisibilitySchema =
10
+ viewer_schemas.opengeodeweb_viewer.mesh.polyhedra.visibility
11
+
12
+ export function useMeshPolyhedraVisibilityStyle() {
13
+ const viewerStore = useViewerStore()
14
+ const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle()
15
+
16
+ function meshPolyhedraVisibility(id) {
17
+ return meshPolyhedraCommonStyle.meshPolyhedraStyle(id).visibility
18
+ }
19
+ function setMeshPolyhedraVisibility(id, visibility) {
20
+ return viewerStore.request(
21
+ meshPolyhedraVisibilitySchema,
22
+ { id, visibility },
23
+ {
24
+ response_function: () => {
25
+ meshPolyhedraCommonStyle.meshPolyhedraStyle(id).visibility =
26
+ visibility
27
+ console.log(
28
+ setMeshPolyhedraVisibility.name,
29
+ { id },
30
+ meshPolyhedraVisibility(id),
31
+ )
32
+ },
33
+ },
34
+ )
35
+ }
36
+
37
+ return {
38
+ meshPolyhedraVisibility,
39
+ setMeshPolyhedraVisibility,
40
+ }
41
+ }
@@ -3,7 +3,7 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
3
3
 
4
4
  // Local imports
5
5
  import { useDataStore } from "@ogw_front/stores/data"
6
- import { useDataStyleStateStore } from "../data_style_state"
6
+ import { useDataStyleStateStore } from "../state"
7
7
  import { useViewerStore } from "@ogw_front/stores/viewer"
8
8
 
9
9
  // Local constants
@@ -3,7 +3,7 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
3
3
 
4
4
  // Local imports
5
5
  import { useDataStore } from "@ogw_front/stores/data"
6
- import { useDataStyleStateStore } from "../data_style_state"
6
+ import { useDataStyleStateStore } from "../state"
7
7
  import { useViewerStore } from "@ogw_front/stores/viewer"
8
8
 
9
9
  // Local constants
@@ -2,7 +2,7 @@
2
2
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
3
 
4
4
  // Local imports
5
- import { useDataStyleStateStore } from "../data_style_state"
5
+ import { useDataStyleStateStore } from "../state"
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer"
7
7
 
8
8
  // Local constants
@@ -3,7 +3,7 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
3
3
 
4
4
  // Local imports
5
5
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer"
6
- import { useDataStyleStateStore } from "../data_style_state"
6
+ import { useDataStyleStateStore } from "../state"
7
7
  import { useDataStore } from "@ogw_front/stores/data"
8
8
  import { useViewerStore } from "@ogw_front/stores/viewer"
9
9
  import { useModelSurfacesStyle } from "./surfaces"
@@ -98,7 +98,7 @@ export default function useModelStyle() {
98
98
  )
99
99
  }
100
100
 
101
- async function setModelMeshComponentVisibility(
101
+ async function setModelMeshComponentsVisibility(
102
102
  id,
103
103
  component_geode_ids,
104
104
  visibility,
@@ -188,7 +188,7 @@ export default function useModelStyle() {
188
188
  modelMeshComponentVisibility,
189
189
  setModelVisibility,
190
190
  setModelColor,
191
- setModelMeshComponentVisibility,
191
+ setModelMeshComponentsVisibility,
192
192
  applyModelStyle,
193
193
  setModelMeshComponentsDefaultStyle,
194
194
  ...useModelBlocksStyle(),
@@ -3,7 +3,7 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
3
3
 
4
4
  // Local imports
5
5
  import { useDataStore } from "@ogw_front/stores/data"
6
- import { useDataStyleStateStore } from "../data_style_state"
6
+ import { useDataStyleStateStore } from "../state"
7
7
  import { useViewerStore } from "@ogw_front/stores/viewer"
8
8
 
9
9
  // Local constants
@@ -2,7 +2,7 @@
2
2
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
3
 
4
4
  // Local imports
5
- import { useDataStyleStateStore } from "../data_style_state"
5
+ import { useDataStyleStateStore } from "../state"
6
6
  import { useViewerStore } from "@ogw_front/stores/viewer"
7
7
 
8
8
  // Local constants
@@ -3,7 +3,7 @@ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schem
3
3
 
4
4
  // Local imports
5
5
  import { useDataStore } from "@ogw_front/stores/data"
6
- import { useDataStyleStateStore } from "../data_style_state"
6
+ import { useDataStyleStateStore } from "../state"
7
7
  import { useViewerStore } from "@ogw_front/stores/viewer"
8
8
 
9
9
  // Local constants
@@ -1,5 +1,3 @@
1
- import { reactive, computed } from "vue"
2
-
3
1
  export const useDataStyleStateStore = defineStore("dataStyleState", () => {
4
2
  const styles = reactive({})
5
3
 
@@ -23,5 +21,10 @@ export const useDataStyleStateStore = defineStore("dataStyleState", () => {
23
21
  return styles[id]
24
22
  }
25
23
 
26
- return { getStyle, styles, objectVisibility, selectedObjects }
24
+ return {
25
+ getStyle,
26
+ styles,
27
+ objectVisibility,
28
+ selectedObjects,
29
+ }
27
30
  })
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@geode/opengeodeweb-front",
3
3
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
4
4
  "type": "module",
5
- "version": "10.2.1",
5
+ "version": "10.3.0",
6
6
  "main": "./nuxt.config.js",
7
7
  "scripts": {
8
8
  "lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
@@ -5,4 +5,4 @@
5
5
  # pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in
6
6
  #
7
7
 
8
- opengeodeweb-back==6.*,>=6.1.0
8
+ opengeodeweb-back==6.*,>=6.1.3
@@ -5,4 +5,4 @@
5
5
  # pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in
6
6
  #
7
7
 
8
- opengeodeweb-viewer==1.*,>=1.15.1rc2
8
+ opengeodeweb-viewer==1.*,>=1.15.2
@@ -87,21 +87,21 @@ describe("Mesh cells", () => {
87
87
  const dataStyleStore = useDataStyleStore()
88
88
  const viewerStore = useViewerStore()
89
89
  const spy = vi.spyOn(viewerStore, "request")
90
- const result = dataStyleStore.setMeshCellsVertexAttribute(
90
+ const result = dataStyleStore.setMeshCellsVertexAttributeName(
91
91
  id,
92
- vertex_attribute,
92
+ vertex_attribute.name,
93
93
  )
94
94
  expect(result).toBeInstanceOf(Promise)
95
95
  await result
96
96
  expect(spy).toHaveBeenCalledWith(
97
- mesh_cells_schemas.vertex_attribute,
97
+ mesh_cells_schemas.attribute.vertex.name,
98
98
  { id, ...vertex_attribute },
99
99
  {
100
100
  response_function: expect.any(Function),
101
101
  },
102
102
  )
103
- expect(dataStyleStore.meshCellsVertexAttribute(id)).toStrictEqual(
104
- vertex_attribute,
103
+ expect(dataStyleStore.meshCellsVertexAttributeName(id)).toBe(
104
+ vertex_attribute.name,
105
105
  )
106
106
  expect(viewerStore.status).toBe(Status.CONNECTED)
107
107
  })
@@ -112,21 +112,21 @@ describe("Mesh cells", () => {
112
112
  const dataStyleStore = useDataStyleStore()
113
113
  const viewerStore = useViewerStore()
114
114
  const spy = vi.spyOn(viewerStore, "request")
115
- const result = dataStyleStore.setMeshCellsCellAttribute(
115
+ const result = dataStyleStore.setMeshCellsCellAttributeName(
116
116
  id,
117
- cell_attribute,
117
+ cell_attribute.name,
118
118
  )
119
119
  expect(result).toBeInstanceOf(Promise)
120
120
  await result
121
121
  expect(spy).toHaveBeenCalledWith(
122
- mesh_cells_schemas.cell_attribute,
122
+ mesh_cells_schemas.attribute.cell.name,
123
123
  { id, ...cell_attribute },
124
124
  {
125
125
  response_function: expect.any(Function),
126
126
  },
127
127
  )
128
- expect(dataStyleStore.meshCellsCellAttribute(id)).toStrictEqual(
129
- cell_attribute,
128
+ expect(dataStyleStore.meshCellsCellAttributeName(id)).toBe(
129
+ cell_attribute.name,
130
130
  )
131
131
  expect(viewerStore.status).toBe(Status.CONNECTED)
132
132
  })
@@ -141,22 +141,22 @@ describe("Mesh cells", () => {
141
141
  {
142
142
  name: "vertex",
143
143
  function: () =>
144
- dataStyleStore.setMeshCellsVertexAttribute(id, vertex_attribute),
144
+ dataStyleStore.setMeshCellsVertexAttributeName(
145
+ id,
146
+ vertex_attribute.name,
147
+ ),
145
148
  },
146
149
  {
147
150
  name: "cell",
148
151
  function: () =>
149
- dataStyleStore.setMeshCellsCellAttribute(id, cell_attribute),
152
+ dataStyleStore.setMeshCellsCellAttributeName(
153
+ id,
154
+ cell_attribute.name,
155
+ ),
150
156
  },
151
157
  ]
152
158
  for (let i = 0; i < coloringTypes.length; i++) {
153
159
  if (coloringTypes[i].function) {
154
- expect(() =>
155
- dataStyleStore.setMeshCellsActiveColoring(
156
- id,
157
- coloringTypes[i].name,
158
- ),
159
- ).toThrowError()
160
160
  await coloringTypes[i].function()
161
161
  }
162
162
  const result = dataStyleStore.setMeshCellsActiveColoring(
@@ -83,16 +83,19 @@ describe("Mesh edges", () => {
83
83
  const viewerStore = useViewerStore()
84
84
 
85
85
  const spy = vi.spyOn(viewerStore, "request")
86
- await dataStyleStore.setMeshEdgesVertexAttribute(id, vertex_attribute)
86
+ await dataStyleStore.setMeshEdgesVertexAttributeName(
87
+ id,
88
+ vertex_attribute.name,
89
+ )
87
90
  expect(spy).toHaveBeenCalledWith(
88
- mesh_edges_schemas.vertex_attribute,
91
+ mesh_edges_schemas.attribute.vertex.name,
89
92
  { id, ...vertex_attribute },
90
93
  {
91
94
  response_function: expect.any(Function),
92
95
  },
93
96
  )
94
- expect(dataStyleStore.meshEdgesVertexAttribute(id)).toStrictEqual(
95
- vertex_attribute,
97
+ expect(dataStyleStore.meshEdgesVertexAttributeName(id)).toBe(
98
+ vertex_attribute.name,
96
99
  )
97
100
  expect(viewerStore.status).toBe(Status.CONNECTED)
98
101
  })
@@ -102,16 +105,19 @@ describe("Mesh edges", () => {
102
105
  const viewerStore = useViewerStore()
103
106
 
104
107
  const spy = vi.spyOn(viewerStore, "request")
105
- await dataStyleStore.setMeshEdgesEdgeAttribute(id, edge_attribute)
108
+ await dataStyleStore.setMeshEdgesEdgeAttributeName(
109
+ id,
110
+ edge_attribute.name,
111
+ )
106
112
  expect(spy).toHaveBeenCalledWith(
107
- mesh_edges_schemas.edge_attribute,
113
+ mesh_edges_schemas.attribute.edge.name,
108
114
  { id, ...edge_attribute },
109
115
  {
110
116
  response_function: expect.any(Function),
111
117
  },
112
118
  )
113
- expect(dataStyleStore.meshEdgesEdgeAttribute(id)).toStrictEqual(
114
- edge_attribute,
119
+ expect(dataStyleStore.meshEdgesEdgeAttributeName(id)).toBe(
120
+ edge_attribute.name,
115
121
  )
116
122
  expect(viewerStore.status).toBe(Status.CONNECTED)
117
123
  })
@@ -124,22 +130,22 @@ describe("Mesh edges", () => {
124
130
  {
125
131
  name: "vertex",
126
132
  function: () =>
127
- dataStyleStore.setMeshEdgesVertexAttribute(id, vertex_attribute),
133
+ dataStyleStore.setMeshEdgesVertexAttributeName(
134
+ id,
135
+ vertex_attribute.name,
136
+ ),
128
137
  },
129
138
  {
130
139
  name: "edge",
131
140
  function: () =>
132
- dataStyleStore.setMeshEdgesEdgeAttribute(id, edge_attribute),
141
+ dataStyleStore.setMeshEdgesEdgeAttributeName(
142
+ id,
143
+ edge_attribute.name,
144
+ ),
133
145
  },
134
146
  ]
135
147
  for (let i = 0; i < coloringTypes.length; i++) {
136
148
  if (coloringTypes[i].function) {
137
- expect(() =>
138
- dataStyleStore.setMeshEdgesActiveColoring(
139
- id,
140
- coloringTypes[i].name,
141
- ),
142
- ).toThrowError()
143
149
  await coloringTypes[i].function()
144
150
  }
145
151
  const result = dataStyleStore.setMeshEdgesActiveColoring(
@@ -59,7 +59,7 @@ describe("Mesh", () => {
59
59
  })
60
60
 
61
61
  describe("Apply mesh default style", () => {
62
- test("test", async () => {
62
+ test("Apply mesh default style", async () => {
63
63
  const dataStyleStore = useDataStyleStore()
64
64
  const viewerStore = useViewerStore()
65
65
  const result = dataStyleStore.applyMeshStyle(id)
@@ -89,17 +89,14 @@ describe("Mesh points", () => {
89
89
  {
90
90
  name: "vertex",
91
91
  function: () =>
92
- dataStyleStore.setMeshPointsVertexAttribute(id, vertex_attribute),
92
+ dataStyleStore.setMeshPointsVertexAttributeName(
93
+ id,
94
+ vertex_attribute.name,
95
+ ),
93
96
  },
94
97
  ]
95
98
  for (let i = 0; i < coloringTypes.length; i++) {
96
99
  if (coloringTypes[i].function) {
97
- expect(() =>
98
- dataStyleStore.setMeshPointsActiveColoring(
99
- id,
100
- coloringTypes[i].name,
101
- ),
102
- ).toThrowError()
103
100
  await coloringTypes[i].function()
104
101
  }
105
102
  const result = dataStyleStore.setMeshPointsActiveColoring(
@@ -135,22 +132,27 @@ describe("Mesh points", () => {
135
132
  expect(dataStyleStore.meshPointsSize(id)).toBe(size)
136
133
  expect(viewerStore.status).toBe(Status.CONNECTED)
137
134
  })
135
+ })
138
136
 
139
- test("Points vertex attribute", async () => {
137
+ describe("Points vertex attribute", () => {
138
+ test("test coloring", async () => {
140
139
  const dataStyleStore = useDataStyleStore()
141
140
  const viewerStore = useViewerStore()
142
141
 
143
142
  const spy = vi.spyOn(viewerStore, "request")
144
- await dataStyleStore.setMeshPointsVertexAttribute(id, vertex_attribute)
143
+ await dataStyleStore.setMeshPointsVertexAttributeName(
144
+ id,
145
+ vertex_attribute.name,
146
+ )
145
147
  expect(spy).toHaveBeenCalledWith(
146
- mesh_points_schemas.vertex_attribute,
148
+ mesh_points_schemas.attribute.vertex.name,
147
149
  { id, ...vertex_attribute },
148
150
  {
149
151
  response_function: expect.any(Function),
150
152
  },
151
153
  )
152
- expect(dataStyleStore.meshPointsVertexAttribute(id)).toStrictEqual(
153
- vertex_attribute,
154
+ expect(dataStyleStore.meshPointsVertexAttributeName(id)).toBe(
155
+ vertex_attribute.name,
154
156
  )
155
157
  expect(viewerStore.status).toBe(Status.CONNECTED)
156
158
  })
@@ -87,21 +87,21 @@ describe("Mesh polygons", () => {
87
87
  const dataStyleStore = useDataStyleStore()
88
88
  const viewerStore = useViewerStore()
89
89
  const spy = vi.spyOn(viewerStore, "request")
90
- const result = dataStyleStore.setMeshPolygonsVertexAttribute(
90
+ const result = dataStyleStore.setMeshPolygonsVertexAttributeName(
91
91
  id,
92
- vertex_attribute,
92
+ vertex_attribute.name,
93
93
  )
94
94
  expect(result).toBeInstanceOf(Promise)
95
95
  await result
96
96
  expect(spy).toHaveBeenCalledWith(
97
- mesh_polygons_schemas.vertex_attribute,
97
+ mesh_polygons_schemas.attribute.vertex.name,
98
98
  { id, ...vertex_attribute },
99
99
  {
100
100
  response_function: expect.any(Function),
101
101
  },
102
102
  )
103
- expect(dataStyleStore.meshPolygonsVertexAttribute(id)).toStrictEqual(
104
- vertex_attribute,
103
+ expect(dataStyleStore.meshPolygonsVertexAttributeName(id)).toBe(
104
+ vertex_attribute.name,
105
105
  )
106
106
  expect(viewerStore.status).toBe(Status.CONNECTED)
107
107
  })
@@ -112,21 +112,21 @@ describe("Mesh polygons", () => {
112
112
  const dataStyleStore = useDataStyleStore()
113
113
  const viewerStore = useViewerStore()
114
114
  const spy = vi.spyOn(viewerStore, "request")
115
- const result = dataStyleStore.setMeshPolygonsPolygonAttribute(
115
+ const result = dataStyleStore.setMeshPolygonsPolygonAttributeName(
116
116
  id,
117
- polygon_attribute,
117
+ polygon_attribute.name,
118
118
  )
119
119
  expect(result).toBeInstanceOf(Promise)
120
120
  await result
121
121
  expect(spy).toHaveBeenCalledWith(
122
- mesh_polygons_schemas.polygon_attribute,
122
+ mesh_polygons_schemas.attribute.polygon.name,
123
123
  { id, ...polygon_attribute },
124
124
  {
125
125
  response_function: expect.any(Function),
126
126
  },
127
127
  )
128
- expect(dataStyleStore.meshPolygonsPolygonAttribute(id)).toStrictEqual(
129
- polygon_attribute,
128
+ expect(dataStyleStore.meshPolygonsPolygonAttributeName(id)).toBe(
129
+ polygon_attribute.name,
130
130
  )
131
131
  expect(viewerStore.status).toBe(Status.CONNECTED)
132
132
  })
@@ -141,26 +141,23 @@ describe("Mesh polygons", () => {
141
141
  {
142
142
  name: "vertex",
143
143
  function: () =>
144
- dataStyleStore.setMeshPolygonsVertexAttribute(id, vertex_attribute),
144
+ dataStyleStore.setMeshPolygonsVertexAttributeName(
145
+ id,
146
+ vertex_attribute.name,
147
+ ),
145
148
  },
146
149
  {
147
150
  name: "polygon",
148
151
  function: () =>
149
- dataStyleStore.setMeshPolygonsPolygonAttribute(
152
+ dataStyleStore.setMeshPolygonsPolygonAttributeName(
150
153
  id,
151
- polygon_attribute,
154
+ polygon_attribute.name,
152
155
  ),
153
156
  },
154
157
  ]
155
158
 
156
159
  for (let i = 0; i < coloringTypes.length; i++) {
157
160
  if (coloringTypes[i].function) {
158
- expect(() =>
159
- dataStyleStore.setMeshPolygonsActiveColoring(
160
- id,
161
- coloringTypes[i].name,
162
- ),
163
- ).toThrowError()
164
161
  await coloringTypes[i].function()
165
162
  }
166
163
  const result = dataStyleStore.setMeshPolygonsActiveColoring(