@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
@@ -1,181 +0,0 @@
1
- // Third party imports
2
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
-
4
- // Local imports
5
- import { useDataStyleStateStore } from "../data_style_state"
6
- import { useViewerStore } from "@ogw_front/stores/viewer"
7
-
8
- // Local constants
9
- const mesh_polygons_schemas = viewer_schemas.opengeodeweb_viewer.mesh.polygons
10
-
11
- export function useMeshPolygonsStyle() {
12
- const dataStyleStateStore = useDataStyleStateStore()
13
- const viewerStore = useViewerStore()
14
-
15
- function meshPolygonsStyle(id) {
16
- return dataStyleStateStore.getStyle(id).polygons
17
- }
18
-
19
- function meshPolygonsVisibility(id) {
20
- return meshPolygonsStyle(id).visibility
21
- }
22
- function setMeshPolygonsVisibility(id, visibility) {
23
- const polygons_style = meshPolygonsStyle(id)
24
- return viewerStore.request(
25
- mesh_polygons_schemas.visibility,
26
- { id, visibility },
27
- {
28
- response_function: () => {
29
- polygons_style.visibility = visibility
30
- console.log(
31
- setMeshPolygonsVisibility.name,
32
- { id },
33
- meshPolygonsVisibility(id),
34
- )
35
- },
36
- },
37
- )
38
- }
39
-
40
- function meshPolygonsColor(id) {
41
- return meshPolygonsStyle(id).coloring.color
42
- }
43
- function setMeshPolygonsColor(id, color) {
44
- const coloring_style = meshPolygonsStyle(id).coloring
45
- return viewerStore.request(
46
- mesh_polygons_schemas.color,
47
- { id, color },
48
- {
49
- response_function: () => {
50
- coloring_style.color = color
51
- console.log(
52
- setMeshPolygonsColor.name,
53
- { id },
54
- JSON.stringify(meshPolygonsColor(id)),
55
- )
56
- },
57
- },
58
- )
59
- }
60
-
61
- function meshPolygonsTextures(id) {
62
- return meshPolygonsStyle(id).coloring.textures
63
- }
64
- function setMeshPolygonsTextures(id, textures) {
65
- const coloring_style = meshPolygonsStyle(id).coloring
66
- return viewerStore.request(
67
- mesh_polygons_schemas.apply_textures,
68
- { id, textures },
69
- {
70
- response_function: () => {
71
- coloring_style.textures = textures
72
- console.log(
73
- setMeshPolygonsTextures.name,
74
- { id },
75
- meshPolygonsTextures(id),
76
- )
77
- },
78
- },
79
- )
80
- }
81
-
82
- function meshPolygonsVertexAttribute(id) {
83
- return meshPolygonsStyle(id).coloring.vertex
84
- }
85
-
86
- function setMeshPolygonsVertexAttribute(id, vertex_attribute) {
87
- const coloring_style = meshPolygonsStyle(id).coloring
88
- return viewerStore.request(
89
- mesh_polygons_schemas.vertex_attribute,
90
- { id, ...vertex_attribute },
91
- {
92
- response_function: () => {
93
- coloring_style.vertex = vertex_attribute
94
- console.log(
95
- setMeshPolygonsVertexAttribute.name,
96
- { id },
97
- meshPolygonsVertexAttribute(id),
98
- )
99
- },
100
- },
101
- )
102
- }
103
-
104
- function meshPolygonsPolygonAttribute(id) {
105
- return meshPolygonsStyle(id).coloring.polygon
106
- }
107
- function setMeshPolygonsPolygonAttribute(id, polygon_attribute) {
108
- const coloring_style = meshPolygonsStyle(id).coloring
109
- return viewerStore.request(
110
- mesh_polygons_schemas.polygon_attribute,
111
- { id, ...polygon_attribute },
112
- {
113
- response_function: () => {
114
- coloring_style.polygon = polygon_attribute
115
- console.log(
116
- setMeshPolygonsPolygonAttribute.name,
117
- { id },
118
- meshPolygonsPolygonAttribute(id),
119
- )
120
- },
121
- },
122
- )
123
- }
124
-
125
- function meshPolygonsActiveColoring(id) {
126
- return meshPolygonsStyle(id).coloring.active
127
- }
128
- function setMeshPolygonsActiveColoring(id, type) {
129
- const coloring = meshPolygonsStyle(id).coloring
130
- coloring.active = type
131
- console.log(
132
- setMeshPolygonsActiveColoring.name,
133
- { id },
134
- meshPolygonsActiveColoring(id),
135
- )
136
- if (type === "color") {
137
- return setMeshPolygonsColor(id, coloring.color)
138
- } else if (type === "textures") {
139
- if (coloring.textures === null) {
140
- throw new Error("Textures not set")
141
- }
142
- return setMeshPolygonsTextures(id, coloring.textures)
143
- } else if (type === "vertex") {
144
- if (coloring.vertex === null) {
145
- throw new Error("Vertex attribute not set")
146
- }
147
- return setMeshPolygonsVertexAttribute(id, coloring.vertex)
148
- } else if (type === "polygon") {
149
- if (coloring.polygon === null) {
150
- throw new Error("Polygon attribute not set")
151
- }
152
- return setMeshPolygonsPolygonAttribute(id, coloring.polygon)
153
- } else {
154
- throw new Error("Unknown mesh polygons coloring type: " + type)
155
- }
156
- }
157
-
158
- function applyMeshPolygonsStyle(id) {
159
- const style = meshPolygonsStyle(id)
160
- return Promise.all([
161
- setMeshPolygonsVisibility(id, style.visibility),
162
- setMeshPolygonsActiveColoring(id, style.coloring.active),
163
- ])
164
- }
165
-
166
- return {
167
- meshPolygonsVisibility,
168
- meshPolygonsActiveColoring,
169
- meshPolygonsColor,
170
- meshPolygonsTextures,
171
- meshPolygonsPolygonAttribute,
172
- meshPolygonsVertexAttribute,
173
- setMeshPolygonsVisibility,
174
- setMeshPolygonsActiveColoring,
175
- setMeshPolygonsColor,
176
- setMeshPolygonsTextures,
177
- setMeshPolygonsVertexAttribute,
178
- setMeshPolygonsPolygonAttribute,
179
- applyMeshPolygonsStyle,
180
- }
181
- }
@@ -1,151 +0,0 @@
1
- // Third party imports
2
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json"
3
-
4
- // Local imports
5
- import { useDataStyleStateStore } from "../data_style_state"
6
- import { useViewerStore } from "@ogw_front/stores/viewer"
7
-
8
- // Local constants
9
- const mesh_polyhedra_schemas = viewer_schemas.opengeodeweb_viewer.mesh.polyhedra
10
-
11
- export function useMeshPolyhedraStyle() {
12
- const dataStyleStateStore = useDataStyleStateStore()
13
- const viewerStore = useViewerStore()
14
-
15
- function meshPolyhedraStyle(id) {
16
- return dataStyleStateStore.getStyle(id).polyhedra
17
- }
18
-
19
- function meshPolyhedraVisibility(id) {
20
- return meshPolyhedraStyle(id).visibility
21
- }
22
- function setMeshPolyhedraVisibility(id, visibility) {
23
- const polyhedra_style = meshPolyhedraStyle(id)
24
- return viewerStore.request(
25
- mesh_polyhedra_schemas.visibility,
26
- { id, visibility },
27
- {
28
- response_function: () => {
29
- polyhedra_style.visibility = visibility
30
- console.log(
31
- setMeshPolyhedraVisibility.name,
32
- { id },
33
- meshPolyhedraVisibility(id),
34
- )
35
- },
36
- },
37
- )
38
- }
39
- function meshPolyhedraActiveColoring(id) {
40
- return meshPolyhedraStyle(id).coloring.active
41
- }
42
- function setMeshPolyhedraActiveColoring(id, type) {
43
- const coloring = meshPolyhedraStyle(id).coloring
44
- coloring.active = type
45
- console.log(
46
- setMeshPolyhedraActiveColoring.name,
47
- { id },
48
- meshPolyhedraActiveColoring(id),
49
- )
50
- if (type === "color") {
51
- return setMeshPolyhedraColor(id, coloring.color)
52
- } else if (type === "vertex") {
53
- if (coloring.vertex === null) {
54
- throw new Error("Vertex attribute not set")
55
- }
56
- return setMeshPolyhedraVertexAttribute(id, coloring.vertex)
57
- } else if (type === "polyhedron") {
58
- if (coloring.polyhedron === null) {
59
- throw new Error("Polyhedron attribute not set")
60
- }
61
- return setMeshPolyhedraPolyhedronAttribute(id, coloring.polyhedron)
62
- } else {
63
- throw new Error("Unknown mesh polyhedra coloring type: " + type)
64
- }
65
- }
66
-
67
- function meshPolyhedraColor(id) {
68
- return meshPolyhedraStyle(id).coloring.color
69
- }
70
- function setMeshPolyhedraColor(id, color) {
71
- const coloring = meshPolyhedraStyle(id).coloring
72
- return viewerStore.request(
73
- mesh_polyhedra_schemas.color,
74
- { id, color },
75
- {
76
- response_function: () => {
77
- coloring.color = color
78
- console.log(
79
- setMeshPolyhedraColor.name,
80
- { id },
81
- JSON.stringify(meshPolyhedraColor(id)),
82
- )
83
- },
84
- },
85
- )
86
- }
87
-
88
- function meshPolyhedraVertexAttribute(id) {
89
- return meshPolyhedraStyle(id).coloring.vertex
90
- }
91
- function setMeshPolyhedraVertexAttribute(id, vertex_attribute) {
92
- const coloring_style = meshPolyhedraStyle(id).coloring
93
- return viewerStore.request(
94
- mesh_polyhedra_schemas.vertex_attribute,
95
- { id, ...vertex_attribute },
96
- {
97
- response_function: () => {
98
- coloring_style.vertex = vertex_attribute
99
- console.log(
100
- setMeshPolyhedraVertexAttribute.name,
101
- { id },
102
- meshPolyhedraVertexAttribute(id),
103
- )
104
- },
105
- },
106
- )
107
- }
108
-
109
- function meshPolyhedraPolyhedronAttribute(id) {
110
- return meshPolyhedraStyle(id).coloring.polyhedron
111
- }
112
- function setMeshPolyhedraPolyhedronAttribute(id, polyhedron_attribute) {
113
- const coloring = meshPolyhedraStyle(id).coloring
114
- return viewerStore.request(
115
- mesh_polyhedra_schemas.polyhedron_attribute,
116
- { id, ...polyhedron_attribute },
117
- {
118
- response_function: () => {
119
- coloring.polyhedron = polyhedron_attribute
120
- console.log(
121
- setMeshPolyhedraPolyhedronAttribute.name,
122
- { id },
123
- meshPolyhedraPolyhedronAttribute(id),
124
- )
125
- },
126
- },
127
- )
128
- }
129
-
130
- function applyMeshPolyhedraStyle(id) {
131
- const style = meshPolyhedraStyle(id)
132
- return Promise.all([
133
- setMeshPolyhedraVisibility(id, style.visibility),
134
- setMeshPolyhedraActiveColoring(id, style.coloring.active),
135
- ])
136
- }
137
-
138
- return {
139
- applyMeshPolyhedraStyle,
140
- meshPolyhedraActiveColoring,
141
- meshPolyhedraColor,
142
- meshPolyhedraVertexAttribute,
143
- meshPolyhedraVisibility,
144
- meshPolyhedraPolyhedronAttribute,
145
- setMeshPolyhedraActiveColoring,
146
- setMeshPolyhedraColor,
147
- setMeshPolyhedraPolyhedronAttribute,
148
- setMeshPolyhedraVertexAttribute,
149
- setMeshPolyhedraVisibility,
150
- }
151
- }