Skip to content

Commit b58ef13

Browse files
save wip
1 parent 6c0cf11 commit b58ef13

File tree

15 files changed

+557
-277
lines changed

15 files changed

+557
-277
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./tests

internal_stores/mesh/edges.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export function useMeshEdgesStyle() {
1818
{
1919
response_function: () => {
2020
edges_style.visibility = visibility
21-
console.log(`${setEdgesVisibility.name} ${setEdgesVisibility(id)}`)
21+
console.log(
22+
`${setEdgesVisibility.name} ${id} ${setEdgesVisibility(id)}`,
23+
)
2224
},
2325
},
2426
)
@@ -27,19 +29,19 @@ export function useMeshEdgesStyle() {
2729
function edgesActiveColoring(id) {
2830
return edgesStyle(id).coloring.active
2931
}
30-
async function setEdgesActiveColoring(id, type) {
32+
function setEdgesActiveColoring(id, type) {
3133
const coloring = edgesStyle(id).coloring
32-
if (type == "color") {
33-
setEdgesColor(id, coloring.color)
34-
// else if (type == "vertex") {
35-
// const vertex = coloring.vertex
36-
// if (vertex !== null) setEdgesVertexAttribute(id, vertex)
37-
// } else if (type == "edges") {
38-
// const edges = coloring.edges
39-
// if (edges !== null) setEdgesEdgeAttribute(id, edges)
40-
} else throw new Error("Unknown edges coloring type: " + type)
4134
coloring.active = type
42-
console.log(`${setEdgesActiveColoring.name} ${edgesActiveColoring(id)}`)
35+
console.log(
36+
`${setEdgesActiveColoring.name} ${id} ${edgesActiveColoring(id)}`,
37+
)
38+
if (type === "color") {
39+
return setEdgesColor(id, coloring.color)
40+
// } else if (type == "vertex" && coloring.vertex !== null) {
41+
// return setEdgesVertexAttribute(id, coloring.vertex)
42+
// } else if (type == "edges" && coloring.edges !== null) {
43+
// return setEdgesEdgeAttribute(id, coloring.edges)
44+
} else throw new Error("Unknown edges coloring type: " + type)
4345
}
4446

4547
function edgesColor(id) {
@@ -52,7 +54,9 @@ export function useMeshEdgesStyle() {
5254
{
5355
response_function: () => {
5456
coloring_style.color = color
55-
console.log(`${setEdgesColor.name} ${JSON.stringify(edgesColor(id))}`)
57+
console.log(
58+
`${setEdgesColor.name} ${id} ${JSON.stringify(edgesColor(id))}`,
59+
)
5660
},
5761
},
5862
)
@@ -68,13 +72,13 @@ export function useMeshEdgesStyle() {
6872
{
6973
response_function: () => {
7074
edges_style.width = width
71-
console.log(`${setEdgesWidth.name} ${edgesWidth(id)}`)
75+
console.log(`${setEdgesWidth.name} ${id} ${edgesWidth(id)}`)
7276
},
7377
},
7478
)
7579
}
7680

77-
async function applyEdgesStyle(id, style) {
81+
function applyEdgesStyle(id, style) {
7882
return Promise.all([
7983
setEdgesVisibility(id, style.visibility),
8084
setEdgesActiveColoring(id, style.coloring.active),

internal_stores/mesh/index.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,23 @@ export default function useMeshStyle() {
2828
)
2929
}
3030

31-
async function applyMeshDefaultStyle(id) {
32-
return new Promise(async (resolve) => {
33-
const style = dataStyleStore.getStyle(id)
34-
for (const [key, value] of Object.entries(style)) {
35-
if (key == "visibility") {
36-
await setMeshVisibility(id, value)
37-
} else if (key == "points") {
38-
await pointsStyleStore.applyPointsStyle(id, value)
39-
} else if (key == "edges") {
40-
await edgesStyleStore.applyEdgesStyle(id, value)
41-
} else if (key == "polygons") {
42-
await polygonsStyleStore.applyPolygonsStyle(id, value)
43-
} else if (key == "polyhedra") {
44-
await polyhedraStyleStore.applyPolyhedraStyle(id, value)
45-
}
31+
function applyMeshDefaultStyle(id) {
32+
const style = dataStyleStore.getStyle(id)
33+
const promise_array = []
34+
for (const [key, value] of Object.entries(style)) {
35+
if (key == "visibility") {
36+
promise_array.push(setMeshVisibility(id, value))
37+
} else if (key == "points") {
38+
promise_array.push(pointsStyleStore.applyPointsStyle(id, value))
39+
} else if (key == "edges") {
40+
promise_array.push(edgesStyleStore.applyEdgesStyle(id, value))
41+
} else if (key == "polygons") {
42+
promise_array.push(polygonsStyleStore.applyPolygonsStyle(id, value))
43+
} else if (key == "polyhedra") {
44+
promise_array.push(polyhedraStyleStore.applyPolyhedraStyle(id, value))
4645
}
47-
resolve()
48-
})
46+
}
47+
return promise_array
4948
}
5049

5150
return {

internal_stores/mesh/points.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export function useMeshPointsStyle() {
1818
{
1919
response_function: () => {
2020
points_style.visibility = visibility
21-
console.log(`${setPointsVisibility.name} ${pointsVisibility(id)}`)
21+
console.log(
22+
`${setPointsVisibility.name} ${id} ${pointsVisibility(id)}`,
23+
)
2224
},
2325
},
2426
)
@@ -29,13 +31,15 @@ export function useMeshPointsStyle() {
2931
}
3032
function setPointsActiveColoring(id, type) {
3133
const coloring = pointsStyle(id).coloring
32-
if (type == "color") dataStyleStore.setPointsColor(id, coloring.color)
33-
else if (type == "vertex") {
34-
if (coloring.vertex !== null)
35-
dataStyleStore.setPointsVertexAttribute(id, coloring.vertex)
36-
} else throw new Error("Unknown points coloring type: " + type)
3734
coloring.active = type
38-
console.log(`${setPointsActiveColoring.name} ${pointsActiveColoring(id)}`)
35+
console.log(
36+
`${setPointsActiveColoring.name} ${id} ${pointsActiveColoring(id)}`,
37+
)
38+
if (type == "color") {
39+
return dataStyleStore.setPointsColor(id, coloring.color)
40+
} else if (type == "vertex" && coloring.vertex !== null) {
41+
return dataStyleStore.setPointsVertexAttribute(id, coloring.vertex)
42+
} else throw new Error("Unknown points coloring type: " + type)
3943
}
4044

4145
function pointsColor(id) {
@@ -49,7 +53,7 @@ export function useMeshPointsStyle() {
4953
response_function: () => {
5054
coloring_style.color = color
5155
console.log(
52-
`${setPointsColor.name} ${JSON.stringify(pointsColor(id))}`,
56+
`${setPointsColor.name} ${id} ${JSON.stringify(pointsColor(id))}`,
5357
)
5458
},
5559
},
@@ -69,7 +73,7 @@ export function useMeshPointsStyle() {
6973
response_function: () => {
7074
coloring_style.vertex = vertex_attribute
7175
console.log(
72-
`${setPointsVertexAttribute.name} ${pointsVertexAttribute(id)}`,
76+
`${setPointsVertexAttribute.name} ${id} ${pointsVertexAttribute(id)}`,
7377
)
7478
},
7579
},
@@ -86,7 +90,7 @@ export function useMeshPointsStyle() {
8690
{
8791
response_function: () => {
8892
points_style.size = size
89-
console.log(`${setPointsSize.name} ${pointsSize(id)}`)
93+
console.log(`${setPointsSize.name} ${id} ${pointsSize(id)}`)
9094
},
9195
},
9296
)

internal_stores/mesh/polygons.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ export function useMeshPolygonsStyle() {
3030
}
3131
function setPolygonsActiveColoring(id, type) {
3232
const coloring = polygonsStyle(id).coloring
33-
if (type == "color") {
34-
setPolygonsColor(id, coloring.color)
35-
} else if (type == "textures" && coloring.textures !== null) {
36-
setPolygonsTextures(id, coloring.textures)
37-
} else if (type == "vertex" && coloring.vertex !== null) {
38-
setPolygonsVertexAttribute(id, coloring.vertex)
39-
} else if (type == "polygon" && coloring.polygon !== null) {
40-
setPolygonsPolygonAttribute(id, coloring.polygon)
41-
} else throw new Error("Unknown polygons coloring type: " + type)
4233
coloring.active = type
4334
console.log(
4435
`${setPolygonsActiveColoring.name} ${id} ${polygonsActiveColoring(id)}`,
4536
)
37+
if (type === "color") {
38+
return setPolygonsColor(id, coloring.color)
39+
} else if (type === "textures" && coloring.textures !== null) {
40+
return setPolygonsTextures(id, coloring.textures)
41+
} else if (type === "vertex" && coloring.vertex !== null) {
42+
return setPolygonsVertexAttribute(id, coloring.vertex)
43+
} else if (type === "polygon" && coloring.polygon !== null) {
44+
return setPolygonsPolygonAttribute(id, coloring.polygon)
45+
} else throw new Error("Unknown polygons coloring type: " + type)
4646
}
4747

4848
function polygonsColor(id) {

internal_stores/mesh/polyhedra.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ export function useMeshPolyhedraStyle() {
2828
}
2929
function setPolyhedraActiveColoring(id, type) {
3030
const coloring = polyhedraStyle(id).coloring
31-
if (type == "color") setPolyhedraColor(id, coloring.color)
32-
else if (type == "vertex" && coloring.vertex !== null)
33-
setPolyhedraVertexAttribute(id, coloring.vertex)
34-
else if (type == "polyhedron" && coloring.polyhedron !== null)
35-
setPolyhedraPolyhedronAttribute(id, coloring.polyhedron)
36-
else throw new Error("Unknown polyhedra coloring type: " + type)
3731
coloring.active = type
3832
console.log(
3933
`${setPolyhedraActiveColoring.name} ${polyhedraActiveColoring(id)}`,
4034
)
35+
if (type === "color") {
36+
return setPolyhedraColor(id, coloring.color)
37+
} else if (type === "vertex" && coloring.vertex !== null) {
38+
return setPolyhedraVertexAttribute(id, coloring.vertex)
39+
} else if (type === "polyhedron" && coloring.polyhedron !== null) {
40+
return setPolyhedraPolyhedronAttribute(id, coloring.polyhedron)
41+
} else throw new Error("Unknown polyhedra coloring type: " + type)
4142
}
4243

4344
function polyhedraColor(id) {

package-lock.json

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"pinia": "3.0.3",
6060
"sass": "1.87.0",
6161
"semver": "7.7.1",
62-
"tree-kill": "1.2.2",
6362
"uuid": "11.1.0",
6463
"vue-recaptcha": "2.0.3",
6564
"vue3-carousel": "0.3.4",
@@ -83,4 +82,4 @@
8382
"publishConfig": {
8483
"access": "public"
8584
}
86-
}
85+
}

stores/data_style.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ export const useDataStyleStore = defineStore("dataStyle", () => {
1010
const dataBaseStore = useDataBaseStore()
1111

1212
/** Actions **/
13-
function addDataStyle(id, geode_object, object_type) {
13+
async function addDataStyle(id, geode_object, object_type) {
1414
dataStyleState.styles[id] = getDefaultStyle(geode_object)
1515
if (object_type === "mesh") {
16-
return Promise.all([meshStyleStore.applyMeshDefaultStyle(id)])
16+
return meshStyleStore.applyMeshDefaultStyle(id)
1717
} else if (object_type === "model") {
1818
return Promise.all([
1919
modelStyleStore.setMeshComponentsDefaultStyle(id),
2020
modelStyleStore.applyModelDefaultStyle(id),
2121
])
22+
} else {
23+
throw new Error("Unknown object type")
2224
}
2325
}
2426

tests/integration/microservices/viewer/requirements.txt

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ click==8.3.0
3030
# flask
3131
# opengeodeweb-microservice
3232
# opengeodeweb-viewer
33+
contourpy==1.3.3
34+
# via
35+
# matplotlib
36+
# opengeodeweb-viewer
37+
cycler==0.12.1
38+
# via
39+
# matplotlib
40+
# opengeodeweb-viewer
3341
fastjsonschema==2.21.1
3442
# via
3543
# opengeodeweb-microservice
@@ -43,6 +51,10 @@ flask-sqlalchemy==3.1.1
4351
# via
4452
# opengeodeweb-microservice
4553
# opengeodeweb-viewer
54+
fonttools==4.60.1
55+
# via
56+
# matplotlib
57+
# opengeodeweb-viewer
4658
frozenlist==1.7.0
4759
# via
4860
# aiohttp
@@ -67,27 +79,60 @@ jinja2==3.1.6
6779
# flask
6880
# opengeodeweb-microservice
6981
# opengeodeweb-viewer
82+
kiwisolver==1.4.10rc0
83+
# via
84+
# matplotlib
85+
# opengeodeweb-viewer
7086
markupsafe==3.0.2
7187
# via
7288
# flask
7389
# jinja2
7490
# opengeodeweb-microservice
7591
# opengeodeweb-viewer
7692
# werkzeug
93+
matplotlib==3.10.6
94+
# via
95+
# opengeodeweb-viewer
96+
# vtk
7797
multidict==6.6.4
7898
# via
7999
# aiohttp
80100
# opengeodeweb-viewer
81101
# yarl
102+
numpy==2.3.3
103+
# via
104+
# contourpy
105+
# matplotlib
106+
# opengeodeweb-viewer
82107
opengeodeweb-microservice==1.0.1rc1
83108
# via opengeodeweb-viewer
84-
opengeodeweb-viewer==1.11.0rc8
109+
opengeodeweb-viewer==1.11.0rc9
85110
# via -r requirements-internal.in
111+
packaging==25.0
112+
# via
113+
# matplotlib
114+
# opengeodeweb-viewer
115+
pillow==11.3.0
116+
# via
117+
# matplotlib
118+
# opengeodeweb-viewer
86119
propcache==0.3.2
87120
# via
88121
# aiohttp
89122
# opengeodeweb-viewer
90123
# yarl
124+
pyparsing==3.3.0a1
125+
# via
126+
# matplotlib
127+
# opengeodeweb-viewer
128+
python-dateutil==2.9.0.post0
129+
# via
130+
# matplotlib
131+
# opengeodeweb-viewer
132+
six==1.17.0
133+
# via
134+
# opengeodeweb-viewer
135+
# python-dateutil
91136
sqlalchemy==2.0.43
92137
# via
93138
# flask-sqlalchemy
@@ -99,6 +144,8 @@ typing-extensions==4.15.0
99144
# opengeodeweb-microservice
100145
# opengeodeweb-viewer
101146
# sqlalchemy
147+
vtk==9.5.2
148+
# via opengeodeweb-viewer
102149
websocket-client==1.8.0
103150
# via opengeodeweb-viewer
104151
werkzeug==3.1.3

0 commit comments

Comments
 (0)