Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
545 changes: 481 additions & 64 deletions opengeodeweb_viewer_schemas.json

Large diffs are not rendered by default.

1,067 changes: 349 additions & 718 deletions opengeodeweb_viewer_typed_schemas.d.ts

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
"files": [
"opengeodeweb_viewer_schemas.json",
"opengeodeweb_viewer_typed_schemas.js",
"opengeodeweb_viewer_typed_schemas.d.ts"
"opengeodeweb_viewer_typed_schemas.d.ts",
"src/opengeodeweb_viewer/schema_types.json",
"src/opengeodeweb_viewer/schema_types.d.ts",
"src/opengeodeweb_viewer/schema_types.py"
],
"exports": {
"./opengeodeweb_viewer_schemas.json": {
Expand All @@ -29,6 +32,9 @@
"./opengeodeweb_viewer_typed_schemas.js": {
"types": "./opengeodeweb_viewer_typed_schemas.d.ts",
"default": "./opengeodeweb_viewer_typed_schemas.js"
},
"./schema_types": {
"types": "./src/opengeodeweb_viewer/schema_types.d.ts"
}
},
"publishConfig": {
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies = { file = ["requirements.txt"] }
where = ["src"]

[tool.setuptools.package-data]
"opengeodeweb_viewer" = ["schema_definitions.json"]
"opengeodeweb_viewer.rpc.schemas" = ["*.json"]
"opengeodeweb_viewer.rpc.generic.schemas" = ["*.json"]
"opengeodeweb_viewer.rpc.mesh.schemas" = ["*.json"]
Expand Down
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==2.6.0
yarl==1.*
# via aiohttp

opengeodeweb-microservice==1.*,>=1.3.3
4 changes: 1 addition & 3 deletions src/opengeodeweb_viewer/rpc/generic/schemas/deregister.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 32,
"maxLength": 32
"title": "DataId"
}
},
"required": [
Expand Down
3 changes: 2 additions & 1 deletion src/opengeodeweb_viewer/rpc/generic/schemas/deregister.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from opengeodeweb_microservice.schema_types import DataId
from pathlib import Path
from opengeodeweb_microservice.schemas import Route, load_schema
from dataclasses_json import DataClassJsonMixin
Expand All @@ -10,7 +11,7 @@ class Deregister(DataClassJsonMixin):
def __post_init__(self) -> None:
print_dataclass(self)

id: str
id: DataId


@dataclass
Expand Down
4 changes: 1 addition & 3 deletions src/opengeodeweb_viewer/rpc/generic/schemas/register.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 32,
"maxLength": 32
"title": "DataId"
},
"name": {
"type": "string"
Expand Down
3 changes: 2 additions & 1 deletion src/opengeodeweb_viewer/rpc/generic/schemas/register.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from opengeodeweb_microservice.schema_types import DataId
from pathlib import Path
from opengeodeweb_microservice.schemas import Route, load_schema
from dataclasses_json import DataClassJsonMixin
Expand All @@ -10,7 +11,7 @@ class Register(DataClassJsonMixin):
def __post_init__(self) -> None:
print_dataclass(self)

id: str
id: DataId
name: str


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,25 @@
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 32,
"maxLength": 32
"title": "DataId"
},
"name": {
"type": "string",
"minLength": 1
"title": "AttributeName"
},
"item": {
"type": "integer",
"minimum": 0
"title": "AttributeItem"
},
"points": {
"type": "array",
"description": "Flat array of [value, r, g, b, ...]",
"items": {
"type": "number"
},
"minItems": 8
"title": "ColorMapPoints"
},
"minimum": {
"type": "number"
"title": "AttributeRangeMinimum"
},
"maximum": {
"type": "number"
"title": "AttributeRangeMaximum"
},
"no_data_color": {
"type": "object",
"properties": {
"red": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"green": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"blue": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"alpha": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"red",
"green",
"blue",
"alpha"
],
"additionalProperties": false
"title": "ColorRGBA"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
from opengeodeweb_microservice.schema_types import DataId
from opengeodeweb_viewer.schema_types import AttributeItem, AttributeName, AttributeRangeMaximum, AttributeRangeMinimum, ColorMapPoints, ColorRGBA
from pathlib import Path
from opengeodeweb_microservice.schemas import Route, load_schema
from dataclasses_json import DataClassJsonMixin
from opengeodeweb_microservice.schemas import print_dataclass
from dataclasses import dataclass
from typing import List, Optional


@dataclass
class NoDataColor(DataClassJsonMixin):
def __post_init__(self) -> None:
print_dataclass(self)

alpha: float
blue: int
green: int
red: int
from typing import Optional


@dataclass
class Attribute(DataClassJsonMixin):
def __post_init__(self) -> None:
print_dataclass(self)

id: str
item: int
maximum: float
minimum: float
name: str
points: List[float]
id: DataId
item: AttributeItem
maximum: AttributeRangeMaximum
minimum: AttributeRangeMinimum
name: AttributeName
points: ColorMapPoints
"""Flat array of [value, r, g, b, ...]"""

no_data_color: Optional[NoDataColor] = None
no_data_color: Optional[ColorRGBA] = None


@dataclass
Expand All @@ -47,4 +38,4 @@ def __post_init__(self) -> None:
response=AttributeResponse,
)

__all__ = ["NoDataColor", "Attribute", "AttributeResponse", "attribute_route"]
__all__ = ["ColorRGBA", "Attribute", "AttributeResponse", "attribute_route"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,25 @@
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 32,
"maxLength": 32
"title": "DataId"
},
"name": {
"type": "string",
"minLength": 1
"title": "AttributeName"
},
"item": {
"type": "integer",
"minimum": 0
"title": "AttributeItem"
},
"points": {
"type": "array",
"description": "Flat array of [value, r, g, b, ...]",
"items": {
"type": "number"
},
"minItems": 8
"title": "ColorMapPoints"
},
"minimum": {
"type": "number"
"title": "AttributeRangeMinimum"
},
"maximum": {
"type": "number"
"title": "AttributeRangeMaximum"
},
"no_data_color": {
"type": "object",
"properties": {
"red": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"green": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"blue": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"alpha": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"red",
"green",
"blue",
"alpha"
],
"additionalProperties": false
"title": "ColorRGBA"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
from opengeodeweb_microservice.schema_types import DataId
from opengeodeweb_viewer.schema_types import AttributeItem, AttributeName, AttributeRangeMaximum, AttributeRangeMinimum, ColorMapPoints, ColorRGBA
from pathlib import Path
from opengeodeweb_microservice.schemas import Route, load_schema
from dataclasses_json import DataClassJsonMixin
from opengeodeweb_microservice.schemas import print_dataclass
from dataclasses import dataclass
from typing import List, Optional


@dataclass
class NoDataColor(DataClassJsonMixin):
def __post_init__(self) -> None:
print_dataclass(self)

alpha: float
blue: int
green: int
red: int
from typing import Optional


@dataclass
class Attribute(DataClassJsonMixin):
def __post_init__(self) -> None:
print_dataclass(self)

id: str
item: int
maximum: float
minimum: float
name: str
points: List[float]
id: DataId
item: AttributeItem
maximum: AttributeRangeMaximum
minimum: AttributeRangeMinimum
name: AttributeName
points: ColorMapPoints
"""Flat array of [value, r, g, b, ...]"""

no_data_color: Optional[NoDataColor] = None
no_data_color: Optional[ColorRGBA] = None


@dataclass
Expand All @@ -47,4 +38,4 @@ def __post_init__(self) -> None:
response=AttributeResponse,
)

__all__ = ["NoDataColor", "Attribute", "AttributeResponse", "attribute_route"]
__all__ = ["ColorRGBA", "Attribute", "AttributeResponse", "attribute_route"]
35 changes: 2 additions & 33 deletions src/opengeodeweb_viewer/rpc/mesh/cells/schemas/color.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,10 @@
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 32,
"maxLength": 32
"title": "DataId"
},
"color": {
"type": "object",
"properties": {
"red": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"green": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"blue": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"alpha": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"red",
"green",
"blue",
"alpha"
],
"additionalProperties": false
"title": "ColorRGBA"
}
},
"required": [
Expand Down
Loading
Loading