Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9c2aca1
fix(colorbar): simplifying attribute protocols
MaxNumerique Jan 29, 2026
13eec4a
fixing tests with workflow
MaxNumerique Jan 29, 2026
b6be71c
Apply prepare changes
MaxNumerique Jan 29, 2026
69083aa
rm comments
MaxNumerique Jan 29, 2026
3086f1a
Merge branch 'feat/color-bar' of https://github.com/Geode-solutions/O…
MaxNumerique Jan 29, 2026
2510cfc
rm com
MaxNumerique Jan 29, 2026
16a8fe8
test scalar_range comparison
MaxNumerique Jan 30, 2026
6eaa40a
coms
MaxNumerique Jan 30, 2026
ac8183b
update mesh color map schemas to use flattened point arrays and remov…
MaxNumerique Jan 30, 2026
bbffeb3
Apply prepare changes
MaxNumerique Jan 30, 2026
4f09594
refacto scalar range and color map setup by integrating lookup table
MaxNumerique Jan 30, 2026
0afbe7e
Merge branch 'feat/color-bar' of https://github.com/Geode-solutions/O…
MaxNumerique Jan 30, 2026
540e4ca
minimum adn maximum added to setupColorMap
MaxNumerique Jan 30, 2026
7460325
Apply prepare changes
MaxNumerique Jan 30, 2026
d89007a
fixed schemas
MaxNumerique Jan 30, 2026
5abce2a
Merge branch 'feat/color-bar' of https://github.com/Geode-solutions/O…
MaxNumerique Jan 30, 2026
3411729
Apply prepare changes
MaxNumerique Jan 30, 2026
89fe79b
missed this one
MaxNumerique Jan 30, 2026
a36e482
Merge branch 'feat/color-bar' of https://github.com/Geode-solutions/O…
MaxNumerique Jan 30, 2026
9b90ac5
Apply prepare changes
MaxNumerique Jan 30, 2026
dea10d7
removedAllPoints not needed
MaxNumerique Jan 30, 2026
e9d071d
Merge branch 'feat/color-bar' of https://github.com/Geode-solutions/O…
MaxNumerique Jan 30, 2026
421fc92
new architecture
MaxNumerique Feb 3, 2026
04a8862
Apply prepare changes
MaxNumerique Feb 3, 2026
66ad44c
new architecture for attributes
MaxNumerique Feb 4, 2026
4f6cd7c
Merge branch 'feat/color-bar' of https://github.com/Geode-solutions/O…
MaxNumerique Feb 4, 2026
f1500af
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Feb 4, 2026
dfc7831
Apply prepare changes
MaxNumerique Feb 4, 2026
ddf89cb
rm this ?
MaxNumerique Feb 4, 2026
59413a5
Merge branch 'feat/color-bar' of https://github.com/Geode-solutions/O…
MaxNumerique Feb 4, 2026
53c3800
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Feb 4, 2026
f4273b8
Apply prepare changes
MaxNumerique Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,189 changes: 658 additions & 531 deletions opengeodeweb_viewer_schemas.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ wslink==1.12.4
yarl>=1
# via aiohttp

opengeodeweb-microservice==1.*,>=1.0.13
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Standard library imports
import os

# Third party imports
from wslink import register as exportRpc # type: ignore
from opengeodeweb_microservice.schemas import get_schemas_dict

# Local application imports
from opengeodeweb_viewer.utils_functions import (
validate_schema,
RpcParams,
)
from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView
from . import schemas


class VtkMeshCellsAttributeCellView(VtkMeshView):
mesh_cells_attribute_cell_prefix = "opengeodeweb_viewer.mesh.cells.attribute.cell."
mesh_cells_attribute_cell_schemas_dict = get_schemas_dict(
os.path.join(os.path.dirname(__file__), "schemas")
)

def __init__(self) -> None:
super().__init__()

@exportRpc(
mesh_cells_attribute_cell_prefix
+ mesh_cells_attribute_cell_schemas_dict["name"]["rpc"]
)
def setMeshCellsCellAttribute(self, rpc_params: RpcParams) -> None:
validate_schema(
rpc_params,
self.mesh_cells_attribute_cell_schemas_dict["name"],
self.mesh_cells_attribute_cell_prefix,
)
params = schemas.Name.from_dict(rpc_params)
self.displayAttributeOnCells(params.id, params.name)

@exportRpc(
mesh_cells_attribute_cell_prefix
+ mesh_cells_attribute_cell_schemas_dict["scalar_range"]["rpc"]
)
def setMeshCellsCellScalarRange(self, rpc_params: RpcParams) -> None:
validate_schema(
rpc_params,
self.mesh_cells_attribute_cell_schemas_dict["scalar_range"],
self.mesh_cells_attribute_cell_prefix,
)
params = schemas.ScalarRange.from_dict(rpc_params)
self.displayScalarRange(params.id, params.minimum, params.maximum)

@exportRpc(
mesh_cells_attribute_cell_prefix
+ mesh_cells_attribute_cell_schemas_dict["color_map"]["rpc"]
)
def setMeshCellsCellColorMap(self, rpc_params: RpcParams) -> None:
validate_schema(
rpc_params,
self.mesh_cells_attribute_cell_schemas_dict["color_map"],
self.mesh_cells_attribute_cell_prefix,
)
params = schemas.ColorMap.from_dict(rpc_params)
self.setupColorMap(params.id, params.points, params.minimum, params.maximum)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .scalar_range import *
from .name import *
from .color_map import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"rpc": "color_map",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"points": {
"type": "array",
"description": "Flat array of [value, r, g, b, ...]",
"items": {
"type": "number"
},
"minItems": 8
},
"minimum": {
"type": "number"
},
"maximum": {
"type": "number"
}
},
"required": ["id", "points", "minimum", "maximum"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from dataclasses_json import DataClassJsonMixin
from dataclasses import dataclass
from typing import List


@dataclass
class PolygonScalarRange(DataClassJsonMixin):
class ColorMap(DataClassJsonMixin):
def __post_init__(self) -> None:
print(self, flush=True)

id: str
maximum: float
minimum: float
points: List[float]
"""Flat array of [value, r, g, b, ...]"""
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rpc": "cell_attribute",
"rpc": "name",
"type": "object",
"properties": {
"id": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


@dataclass
class CellAttribute(DataClassJsonMixin):
class Name(DataClassJsonMixin):
def __post_init__(self) -> None:
print(self, flush=True)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rpc": "cell_scalar_range",
"rpc": "scalar_range",
"type": "object",
"properties": {
"id": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


@dataclass
class CellScalarRange(DataClassJsonMixin):
class ScalarRange(DataClassJsonMixin):
def __post_init__(self) -> None:
print(self, flush=True)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Standard library imports
import os

# Third party imports
from wslink import register as exportRpc # type: ignore
from opengeodeweb_microservice.schemas import get_schemas_dict

# Local application imports
from opengeodeweb_viewer.utils_functions import (
validate_schema,
RpcParams,
)
from opengeodeweb_viewer.rpc.mesh.mesh_protocols import VtkMeshView
from . import schemas


class VtkMeshCellsAttributeVertexView(VtkMeshView):
mesh_cells_attribute_vertex_prefix = (
"opengeodeweb_viewer.mesh.cells.attribute.vertex."
)
mesh_cells_attribute_vertex_schemas_dict = get_schemas_dict(
os.path.join(os.path.dirname(__file__), "schemas")
)

def __init__(self) -> None:
super().__init__()

@exportRpc(
mesh_cells_attribute_vertex_prefix
+ mesh_cells_attribute_vertex_schemas_dict["name"]["rpc"]
)
def setMeshCellsVertexName(self, rpc_params: RpcParams) -> None:
validate_schema(
rpc_params,
self.mesh_cells_attribute_vertex_schemas_dict["name"],
self.mesh_cells_attribute_vertex_prefix,
)
params = schemas.Name.from_dict(rpc_params)
self.displayAttributeOnVertices(params.id, params.name)

@exportRpc(
mesh_cells_attribute_vertex_prefix
+ mesh_cells_attribute_vertex_schemas_dict["scalar_range"]["rpc"]
)
def setMeshCellsVertexScalarRange(self, rpc_params: RpcParams) -> None:
validate_schema(
rpc_params,
self.mesh_cells_attribute_vertex_schemas_dict["scalar_range"],
self.mesh_cells_attribute_vertex_prefix,
)
params = schemas.ScalarRange.from_dict(rpc_params)
self.displayScalarRange(params.id, params.minimum, params.maximum)

@exportRpc(
mesh_cells_attribute_vertex_prefix
+ mesh_cells_attribute_vertex_schemas_dict["color_map"]["rpc"]
)
def setMeshCellsVertexColorMap(self, rpc_params: RpcParams) -> None:
validate_schema(
rpc_params,
self.mesh_cells_attribute_vertex_schemas_dict["color_map"],
self.mesh_cells_attribute_vertex_prefix,
)
params = schemas.ColorMap.from_dict(rpc_params)
self.setupColorMap(params.id, params.points, params.minimum, params.maximum)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .scalar_range import *
from .name import *
from .color_map import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"rpc": "color_map",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"points": {
"type": "array",
"description": "Flat array of [value, r, g, b, ...]",
"items": {
"type": "number"
},
"minItems": 8
},
"minimum": {
"type": "number"
},
"maximum": {
"type": "number"
}
},
"required": ["id", "points", "minimum", "maximum"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from dataclasses_json import DataClassJsonMixin
from dataclasses import dataclass
from typing import List


@dataclass
class ColorMap(DataClassJsonMixin):
def __post_init__(self) -> None:
print(self, flush=True)

id: str
maximum: float
minimum: float
points: List[float]
"""Flat array of [value, r, g, b, ...]"""
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rpc": "vertex_attribute",
"rpc": "name",
"type": "object",
"properties": {
"id": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


@dataclass
class EdgeAttribute(DataClassJsonMixin):
class Name(DataClassJsonMixin):
def __post_init__(self) -> None:
print(self, flush=True)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rpc": "vertex_scalar_range",
"rpc": "scalar_range",
"type": "object",
"properties": {
"id": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


@dataclass
class VertexScalarRange(DataClassJsonMixin):
class ScalarRange(DataClassJsonMixin):
def __post_init__(self) -> None:
print(self, flush=True)

Expand Down
4 changes: 2 additions & 2 deletions src/opengeodeweb_viewer/rpc/mesh/cells/cells_protocols.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Module has no attribute "VertexAttribute" [attr-defined]

params = schemas.VertexAttribute.from_dict(rpc_params)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Module has no attribute "CellAttribute" [attr-defined]

params = schemas.CellAttribute.from_dict(rpc_params)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Module has no attribute "VertexScalarRange" [attr-defined]

params = schemas.VertexScalarRange.from_dict(rpc_params)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Module has no attribute "CellScalarRange" [attr-defined]

params = schemas.CellScalarRange.from_dict(rpc_params)

Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def setMeshCellsVertexColorMap(self, rpc_params: RpcParams) -> None:
self.mesh_cells_prefix,
)
params = schemas.VertexColorMap.from_dict(rpc_params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Module has no attribute "VertexColorMap" [attr-defined]

self.setupColorMap(params.id, params.points)
self.setupColorMap(params.id, params.points, params.minimum, params.maximum)

@exportRpc(mesh_cells_prefix + mesh_cells_schemas_dict["cell_color_map"]["rpc"])
def setMeshCellsCellColorMap(self, rpc_params: RpcParams) -> None:
Expand All @@ -104,4 +104,4 @@ def setMeshCellsCellColorMap(self, rpc_params: RpcParams) -> None:
self.mesh_cells_prefix,
)
params = schemas.CellColorMap.from_dict(rpc_params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [mypy] reported by reviewdog 🐶
Module has no attribute "CellColorMap" [attr-defined]

self.setupColorMap(params.id, params.points)
self.setupColorMap(params.id, params.points, params.minimum, params.maximum)
6 changes: 0 additions & 6 deletions src/opengeodeweb_viewer/rpc/mesh/cells/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
from .visibility import *
from .vertex_scalar_range import *
from .vertex_color_map import *
from .vertex_attribute import *
from .color import *
from .cell_scalar_range import *
from .cell_color_map import *
from .cell_attribute import *
25 changes: 0 additions & 25 deletions src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.json

This file was deleted.

12 changes: 0 additions & 12 deletions src/opengeodeweb_viewer/rpc/mesh/cells/schemas/cell_color_map.py

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions src/opengeodeweb_viewer/rpc/mesh/cells/schemas/vertex_color_map.py

This file was deleted.

Loading
Loading