@geode/opengeodeweb-front 10.44.0 → 10.44.1-rc.1
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.
- package/app/components/ClippingPlanes.vue +7 -5
- package/app/components/CrsSelector.vue +2 -1
- package/app/components/ExtensionSelector.vue +8 -7
- package/app/components/FactorFilterPanel.vue +4 -4
- package/app/components/MissingFilesSelector.vue +2 -1
- package/app/components/ObjectSelector.vue +4 -3
- package/app/components/ThresholdCard.vue +6 -5
- package/app/components/ThresholdFilter.vue +11 -10
- package/app/components/TimeSeriesTargetSelector.vue +10 -7
- package/app/components/Viewer/ContextMenu/InfoCard.vue +12 -10
- package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +72 -63
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +12 -10
- package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +76 -71
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +8 -6
- package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +72 -63
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +12 -10
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +54 -45
- package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +76 -73
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +8 -6
- package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +72 -67
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +8 -6
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +29 -21
- package/app/components/Viewer/Generic/Model/ComponentEdgesOptions.vue +8 -6
- package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +8 -6
- package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +15 -7
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +2 -1
- package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +13 -6
- package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +19 -11
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +2 -1
- package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +17 -10
- package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +3 -2
- package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +2 -1
- package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +3 -2
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +29 -21
- package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +2 -2
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +2 -3
- package/app/components/Viewer/Options/AttributeSelector.vue +11 -7
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +10 -13
- package/app/components/Viewer/Options/TextureItem.vue +5 -4
- package/app/components/Viewer/Options/TexturesSelector.vue +5 -8
- package/app/components/Viewer/Options/TimeStepSlider.vue +3 -1
- package/app/components/Viewer/OverlappingObjectsPicker.vue +6 -13
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +40 -38
- package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +69 -65
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +8 -6
- package/app/components/Viewer/Surface/PolygonsColoring.vue +73 -71
- package/app/components/Viewer/Surface/PolygonsOptions.vue +8 -6
- package/app/composables/attribute_coloring_style.ts +17 -12
- package/app/composables/attribute_selector.ts +9 -15
- package/app/composables/batch_style.ts +25 -16
- package/app/composables/batch_style_model.ts +6 -5
- package/app/composables/clipping_planes_widget.ts +2 -5
- package/app/composables/clipping_slices.ts +2 -1
- package/app/composables/hover_highlight.ts +17 -16
- package/app/composables/live_data_item.ts +3 -2
- package/app/composables/model_attribute_style.ts +2 -1
- package/app/composables/model_menu_context.ts +3 -4
- package/app/composables/model_tree.ts +3 -2
- package/app/composables/project_manager_helpers/types.ts +10 -4
- package/app/composables/tree_filter.ts +3 -3
- package/app/composables/tree_keyboard_nav.ts +1 -6
- package/app/composables/tree_scroll.ts +2 -0
- package/app/composables/use_overlapping_picker.ts +9 -9
- package/app/stores/basemap_helpers/georeferenced.ts +1 -1
- package/app/stores/basemap_helpers/viewer.ts +2 -1
- package/app/stores/crs.ts +6 -5
- package/app/stores/data.ts +84 -69
- package/app/stores/data_helpers/collections.ts +13 -21
- package/app/stores/data_helpers/mesh.ts +19 -24
- package/app/stores/data_helpers/relations.ts +12 -12
- package/app/stores/data_style.ts +26 -20
- package/app/stores/menu.ts +17 -11
- package/app/stores/treeview.ts +28 -27
- package/app/types/attribute.ts +37 -0
- package/app/types/identifiers.ts +72 -0
- package/app/types/style.ts +13 -0
- package/app/types/texture.ts +6 -0
- package/app/types/tree.ts +17 -0
- package/app/utils/attribute_range.ts +2 -1
- package/app/utils/attributes.ts +13 -4
- package/app/utils/basemap_tree.ts +3 -5
- package/app/utils/clipping_planes.ts +6 -4
- package/app/utils/clipping_planes_scene.ts +4 -3
- package/app/utils/crs.ts +4 -1
- package/app/utils/default_styles/constants.ts +8 -1
- package/app/utils/default_styles/mesh_components.ts +21 -25
- package/app/utils/default_styles/meshes.ts +7 -22
- package/app/utils/default_styles/model_components.ts +22 -26
- package/app/utils/default_styles/models.ts +11 -13
- package/app/utils/import_workflow.ts +37 -29
- package/app/utils/legacy_data_id.ts +16 -0
- package/app/utils/slice.ts +7 -2
- package/app/utils/threshold.ts +1 -8
- package/app/utils/threshold_sources.ts +8 -5
- package/app/utils/treeview.ts +3 -2
- package/internal/database/tables/data.ts +1 -1
- package/internal/database/tables/data_style.ts +1 -1
- package/internal/database/tables/model_components.ts +1 -1
- package/internal/database/tables/model_components_relation.ts +1 -1
- package/internal/stores/data_style/attribute_default.ts +14 -0
- package/internal/stores/data_style/attribute_types.ts +59 -0
- package/internal/stores/data_style/attribute_valid.ts +16 -0
- package/internal/stores/data_style/mesh/base_style.ts +17 -15
- package/internal/stores/data_style/mesh/cells/cell.ts +64 -49
- package/internal/stores/data_style/mesh/cells/cell_attribute.ts +42 -66
- package/internal/stores/data_style/mesh/cells/cell_config.ts +59 -53
- package/internal/stores/data_style/mesh/cells/color.ts +8 -7
- package/internal/stores/data_style/mesh/cells/common.ts +16 -15
- package/internal/stores/data_style/mesh/cells/index.ts +49 -47
- package/internal/stores/data_style/mesh/cells/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/cells/textures.ts +8 -7
- package/internal/stores/data_style/mesh/cells/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/cells/vertex_config.ts +62 -53
- package/internal/stores/data_style/mesh/cells/visibility.ts +11 -7
- package/internal/stores/data_style/mesh/edges/color.ts +8 -7
- package/internal/stores/data_style/mesh/edges/common.ts +13 -12
- package/internal/stores/data_style/mesh/edges/edge.ts +64 -49
- package/internal/stores/data_style/mesh/edges/edge_attribute.ts +42 -66
- package/internal/stores/data_style/mesh/edges/edge_config.ts +59 -53
- package/internal/stores/data_style/mesh/edges/index.ts +49 -47
- package/internal/stores/data_style/mesh/edges/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/edges/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/edges/vertex_config.ts +62 -53
- package/internal/stores/data_style/mesh/edges/visibility.ts +11 -7
- package/internal/stores/data_style/mesh/edges/width.ts +9 -7
- package/internal/stores/data_style/mesh/index.ts +27 -24
- package/internal/stores/data_style/mesh/points/color.ts +8 -7
- package/internal/stores/data_style/mesh/points/common.ts +16 -14
- package/internal/stores/data_style/mesh/points/index.ts +39 -37
- package/internal/stores/data_style/mesh/points/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/points/size.ts +9 -7
- package/internal/stores/data_style/mesh/points/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/points/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/points/vertex_config.ts +62 -53
- package/internal/stores/data_style/mesh/points/visibility.ts +8 -6
- package/internal/stores/data_style/mesh/polygons/color.ts +8 -7
- package/internal/stores/data_style/mesh/polygons/common.ts +19 -15
- package/internal/stores/data_style/mesh/polygons/index.ts +49 -50
- package/internal/stores/data_style/mesh/polygons/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/polygons/polygon.ts +66 -50
- package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/polygons/polygon_config.ts +65 -53
- package/internal/stores/data_style/mesh/polygons/textures.ts +8 -7
- package/internal/stores/data_style/mesh/polygons/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/polygons/vertex_config.ts +65 -53
- package/internal/stores/data_style/mesh/polygons/visibility.ts +12 -7
- package/internal/stores/data_style/mesh/polyhedra/color.ts +13 -9
- package/internal/stores/data_style/mesh/polyhedra/common.ts +13 -12
- package/internal/stores/data_style/mesh/polyhedra/index.ts +51 -51
- package/internal/stores/data_style/mesh/polyhedra/opacity.ts +12 -10
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +59 -53
- package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +46 -69
- package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +65 -55
- package/internal/stores/data_style/mesh/polyhedra/vertex.ts +66 -50
- package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +37 -67
- package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +65 -53
- package/internal/stores/data_style/mesh/polyhedra/visibility.ts +12 -7
- package/internal/stores/data_style/model/blocks/apply_coloring.ts +11 -12
- package/internal/stores/data_style/model/blocks/color.ts +25 -26
- package/internal/stores/data_style/model/blocks/coloring_groups.ts +5 -9
- package/internal/stores/data_style/model/blocks/common.ts +26 -22
- package/internal/stores/data_style/model/blocks/index.ts +8 -7
- package/internal/stores/data_style/model/blocks/polyhedron.ts +114 -135
- package/internal/stores/data_style/model/blocks/vertex.ts +110 -132
- package/internal/stores/data_style/model/blocks/visibility.ts +11 -9
- package/internal/stores/data_style/model/color.ts +55 -41
- package/internal/stores/data_style/model/common.ts +16 -14
- package/internal/stores/data_style/model/component_style.ts +0 -16
- package/internal/stores/data_style/model/corners/color.ts +21 -19
- package/internal/stores/data_style/model/corners/common.ts +26 -22
- package/internal/stores/data_style/model/corners/index.ts +21 -24
- package/internal/stores/data_style/model/corners/vertex.ts +103 -122
- package/internal/stores/data_style/model/corners/visibility.ts +11 -9
- package/internal/stores/data_style/model/edges/common.ts +7 -6
- package/internal/stores/data_style/model/edges/component.ts +63 -55
- package/internal/stores/data_style/model/edges/visibility.ts +24 -16
- package/internal/stores/data_style/model/edges/width.ts +10 -8
- package/internal/stores/data_style/model/index.ts +7 -6
- package/internal/stores/data_style/model/lines/apply_coloring.ts +11 -9
- package/internal/stores/data_style/model/lines/color.ts +25 -23
- package/internal/stores/data_style/model/lines/coloring_groups.ts +5 -9
- package/internal/stores/data_style/model/lines/common.ts +29 -21
- package/internal/stores/data_style/model/lines/edge.ts +109 -128
- package/internal/stores/data_style/model/lines/index.ts +8 -7
- package/internal/stores/data_style/model/lines/vertex.ts +109 -128
- package/internal/stores/data_style/model/lines/visibility.ts +11 -9
- package/internal/stores/data_style/model/points/common.ts +7 -6
- package/internal/stores/data_style/model/points/component.ts +62 -54
- package/internal/stores/data_style/model/points/index.ts +12 -7
- package/internal/stores/data_style/model/points/size.ts +10 -8
- package/internal/stores/data_style/model/points/visibility.ts +13 -8
- package/internal/stores/data_style/model/selection.ts +6 -11
- package/internal/stores/data_style/model/surfaces/apply_coloring.ts +11 -15
- package/internal/stores/data_style/model/surfaces/color.ts +31 -23
- package/internal/stores/data_style/model/surfaces/coloring_groups.ts +5 -9
- package/internal/stores/data_style/model/surfaces/common.ts +26 -22
- package/internal/stores/data_style/model/surfaces/index.ts +8 -7
- package/internal/stores/data_style/model/surfaces/polygon.ts +113 -138
- package/internal/stores/data_style/model/surfaces/vertex.ts +117 -133
- package/internal/stores/data_style/model/surfaces/visibility.ts +11 -9
- package/internal/stores/data_style/model/visibility.ts +18 -16
- package/internal/stores/data_style/model/visibility_dispatch.ts +4 -4
- package/internal/stores/data_style/state.ts +7 -6
- package/internal/stores/data_style/state_shared.ts +11 -10
- package/internal/stores/data_style/time_step.ts +21 -15
- package/internal/stores/data_style/types.ts +4 -3
- package/internal/stores/hybrid_viewer/camera.ts +11 -6
- package/internal/stores/hybrid_viewer/filters.ts +16 -14
- package/internal/stores/hybrid_viewer/highlight.ts +6 -5
- package/internal/stores/hybrid_viewer/scene.ts +20 -18
- package/internal/stores/hybrid_viewer/vtk_types.ts +2 -2
- package/internal/utils/api_fetch.ts +1 -1
- package/internal/utils/upload_file.ts +1 -7
- package/package.json +4 -4
- package/shared/utils/fetch_raw.ts +7 -8
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MeshId } from "@ogw_front/types/identifiers";
|
|
1
2
|
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
2
3
|
// Third party imports
|
|
3
4
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
@@ -11,18 +12,18 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
11
12
|
const schema = viewer_schemas.opengeodeweb_viewer.mesh.polygons.color;
|
|
12
13
|
|
|
13
14
|
export function useMeshPolygonsColorStyle(): ReturnType<typeof useMeshPolygonsOpacityStyle> & {
|
|
14
|
-
meshPolygonsColor: (
|
|
15
|
-
setMeshPolygonsColor: (
|
|
15
|
+
meshPolygonsColor: (meshId: MeshId) => RGBAColor | undefined;
|
|
16
|
+
setMeshPolygonsColor: (meshId: MeshId, color: RGBAColor) => Promise<unknown>;
|
|
16
17
|
} {
|
|
17
18
|
const viewerStore = useViewerStore();
|
|
18
19
|
const meshPolygonsCommonStyle = useMeshPolygonsCommonStyle();
|
|
19
20
|
|
|
20
|
-
function meshPolygonsColor(
|
|
21
|
+
function meshPolygonsColor(meshId: MeshId): RGBAColor | undefined {
|
|
21
22
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring.constant shape is defined by the data style schema.
|
|
22
|
-
return meshPolygonsCommonStyle.meshPolygonsColoring(
|
|
23
|
+
return meshPolygonsCommonStyle.meshPolygonsColoring(meshId).constant as RGBAColor | undefined;
|
|
23
24
|
}
|
|
24
|
-
async function setMeshPolygonsColor(
|
|
25
|
-
const params = { id, color };
|
|
25
|
+
async function setMeshPolygonsColor(meshId: MeshId, color: RGBAColor): Promise<unknown> {
|
|
26
|
+
const params = { id: meshId, color };
|
|
26
27
|
const result = await viewerStore.request(
|
|
27
28
|
{
|
|
28
29
|
schema,
|
|
@@ -30,7 +31,7 @@ export function useMeshPolygonsColorStyle(): ReturnType<typeof useMeshPolygonsOp
|
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
33
|
response_function: async () => {
|
|
33
|
-
const mutateResult = await meshPolygonsCommonStyle.mutateMeshPolygonsColoring(
|
|
34
|
+
const mutateResult = await meshPolygonsCommonStyle.mutateMeshPolygonsColoring(meshId, {
|
|
34
35
|
constant: color,
|
|
35
36
|
});
|
|
36
37
|
return mutateResult;
|
|
@@ -1,40 +1,44 @@
|
|
|
1
|
+
import type { MeshId } from "@ogw_front/types/identifiers";
|
|
1
2
|
import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
|
|
2
3
|
import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
|
|
3
4
|
|
|
4
5
|
export function useMeshPolygonsCommonStyle(): {
|
|
5
|
-
meshPolygonsStyle: (
|
|
6
|
-
meshPolygonsColoring: (
|
|
7
|
-
mutateMeshPolygonsStyle: (
|
|
8
|
-
mutateMeshPolygonsColoring: (
|
|
9
|
-
mutateMeshPolygonsPolygonStyle: (
|
|
6
|
+
meshPolygonsStyle: (meshId: MeshId) => StyleValues;
|
|
7
|
+
meshPolygonsColoring: (meshId: MeshId) => StyleValues;
|
|
8
|
+
mutateMeshPolygonsStyle: (meshId: MeshId, values: StyleValues) => Promise<string>;
|
|
9
|
+
mutateMeshPolygonsColoring: (meshId: MeshId, values: StyleValues) => Promise<string>;
|
|
10
|
+
mutateMeshPolygonsPolygonStyle: (meshId: MeshId, values: StyleValues) => Promise<string>;
|
|
10
11
|
} {
|
|
11
12
|
const dataStyleState = useDataStyleState();
|
|
12
13
|
|
|
13
|
-
async function mutateMeshPolygonsStyle(
|
|
14
|
-
const result = await dataStyleState.mutateStyle(
|
|
14
|
+
async function mutateMeshPolygonsStyle(meshId: MeshId, values: StyleValues): Promise<string> {
|
|
15
|
+
const result = await dataStyleState.mutateStyle(meshId, {
|
|
15
16
|
polygons: values,
|
|
16
17
|
});
|
|
17
18
|
return result;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
function meshPolygonsStyle(
|
|
21
|
-
return dataStyleState.getStyle(
|
|
21
|
+
function meshPolygonsStyle(meshId: MeshId): StyleValues {
|
|
22
|
+
return dataStyleState.getStyle(meshId).polygons ?? {};
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
function meshPolygonsColoring(
|
|
25
|
+
function meshPolygonsColoring(meshId: MeshId): StyleValues {
|
|
25
26
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring shape is defined by the data style schema.
|
|
26
|
-
return meshPolygonsStyle(
|
|
27
|
+
return meshPolygonsStyle(meshId).coloring as StyleValues;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
async function mutateMeshPolygonsColoring(
|
|
30
|
-
const result = await mutateMeshPolygonsStyle(
|
|
30
|
+
async function mutateMeshPolygonsColoring(meshId: MeshId, values: StyleValues): Promise<string> {
|
|
31
|
+
const result = await mutateMeshPolygonsStyle(meshId, {
|
|
31
32
|
coloring: values,
|
|
32
33
|
});
|
|
33
34
|
return result;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
async function mutateMeshPolygonsPolygonStyle(
|
|
37
|
-
|
|
37
|
+
async function mutateMeshPolygonsPolygonStyle(
|
|
38
|
+
meshId: MeshId,
|
|
39
|
+
values: StyleValues,
|
|
40
|
+
): Promise<string> {
|
|
41
|
+
const result = await mutateMeshPolygonsColoring(meshId, {
|
|
38
42
|
polygon: values,
|
|
39
43
|
});
|
|
40
44
|
return result;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
// Third party imports
|
|
2
2
|
|
|
3
3
|
// Local imports
|
|
4
|
-
import {
|
|
5
|
-
isMeshPolygonsPolygonAttributeValid,
|
|
6
|
-
useMeshPolygonsPolygonAttributeStyle,
|
|
7
|
-
} from "./polygon";
|
|
8
|
-
import { isMeshPolygonsVertexAttributeValid, useMeshPolygonsVertexAttributeStyle } from "./vertex";
|
|
4
|
+
import type { MeshId } from "@ogw_front/types/identifiers";
|
|
9
5
|
import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
|
|
6
|
+
import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
|
|
10
7
|
import { useMeshPolygonsColorStyle } from "./color";
|
|
11
8
|
import { useMeshPolygonsCommonStyle } from "./common";
|
|
9
|
+
import { useMeshPolygonsPolygonAttributeStyle } from "./polygon";
|
|
12
10
|
import { useMeshPolygonsTexturesStyle } from "./textures";
|
|
11
|
+
import { useMeshPolygonsVertexAttributeStyle } from "./vertex";
|
|
13
12
|
import { useMeshPolygonsVisibilityStyle } from "./visibility";
|
|
14
13
|
import { whenDefined } from "@ogw_internal/stores/data_style/when_defined";
|
|
15
14
|
|
|
@@ -24,30 +23,30 @@ interface MeshPolygonsActiveColoringDeps {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
function handleMeshPolygonsVertexColoring(
|
|
27
|
-
|
|
26
|
+
meshId: MeshId,
|
|
28
27
|
vertexAttributeStyle: ReturnType<typeof useMeshPolygonsVertexAttributeStyle>,
|
|
29
28
|
): Promise<unknown> | undefined {
|
|
30
|
-
const name = vertexAttributeStyle.meshPolygonsVertexAttributeName(
|
|
31
|
-
const item = vertexAttributeStyle.meshPolygonsVertexAttributeItem(
|
|
32
|
-
const [minimum, maximum] = vertexAttributeStyle.meshPolygonsVertexAttributeRange(
|
|
33
|
-
const colorMap = vertexAttributeStyle.meshPolygonsVertexAttributeColorMap(
|
|
34
|
-
const no_data_color = vertexAttributeStyle.meshPolygonsVertexAttributeNoDataColor(
|
|
29
|
+
const name = vertexAttributeStyle.meshPolygonsVertexAttributeName(meshId);
|
|
30
|
+
const item = vertexAttributeStyle.meshPolygonsVertexAttributeItem(meshId);
|
|
31
|
+
const [minimum, maximum] = vertexAttributeStyle.meshPolygonsVertexAttributeRange(meshId);
|
|
32
|
+
const colorMap = vertexAttributeStyle.meshPolygonsVertexAttributeColorMap(meshId);
|
|
33
|
+
const no_data_color = vertexAttributeStyle.meshPolygonsVertexAttributeNoDataColor(meshId);
|
|
35
34
|
const vertex_attribute = { name, item, minimum, maximum, colorMap, no_data_color };
|
|
36
|
-
if (!
|
|
35
|
+
if (!isAttributeValid(vertex_attribute)) {
|
|
37
36
|
return undefined;
|
|
38
37
|
}
|
|
39
|
-
return vertexAttributeStyle.setMeshPolygonsVertexAttribute(
|
|
38
|
+
return vertexAttributeStyle.setMeshPolygonsVertexAttribute(meshId, vertex_attribute);
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
function handleMeshPolygonsPolygonColoring(
|
|
43
|
-
|
|
42
|
+
meshId: MeshId,
|
|
44
43
|
polygonAttributeStyle: ReturnType<typeof useMeshPolygonsPolygonAttributeStyle>,
|
|
45
44
|
): Promise<unknown> | undefined {
|
|
46
|
-
const name = polygonAttributeStyle.meshPolygonsPolygonAttributeName(
|
|
47
|
-
const item = polygonAttributeStyle.meshPolygonsPolygonAttributeItem(
|
|
48
|
-
const [minimum, maximum] = polygonAttributeStyle.meshPolygonsPolygonAttributeRange(
|
|
49
|
-
const colorMap = polygonAttributeStyle.meshPolygonsPolygonAttributeColorMap(
|
|
50
|
-
const no_data_color = polygonAttributeStyle.meshPolygonsPolygonAttributeNoDataColor(
|
|
45
|
+
const name = polygonAttributeStyle.meshPolygonsPolygonAttributeName(meshId);
|
|
46
|
+
const item = polygonAttributeStyle.meshPolygonsPolygonAttributeItem(meshId);
|
|
47
|
+
const [minimum, maximum] = polygonAttributeStyle.meshPolygonsPolygonAttributeRange(meshId);
|
|
48
|
+
const colorMap = polygonAttributeStyle.meshPolygonsPolygonAttributeColorMap(meshId);
|
|
49
|
+
const no_data_color = polygonAttributeStyle.meshPolygonsPolygonAttributeNoDataColor(meshId);
|
|
51
50
|
const polygon_attribute = {
|
|
52
51
|
name,
|
|
53
52
|
item,
|
|
@@ -56,57 +55,57 @@ function handleMeshPolygonsPolygonColoring(
|
|
|
56
55
|
colorMap,
|
|
57
56
|
no_data_color,
|
|
58
57
|
};
|
|
59
|
-
if (!
|
|
58
|
+
if (!isAttributeValid(polygon_attribute)) {
|
|
60
59
|
return undefined;
|
|
61
60
|
}
|
|
62
|
-
return polygonAttributeStyle.setMeshPolygonsPolygonAttribute(
|
|
61
|
+
return polygonAttributeStyle.setMeshPolygonsPolygonAttribute(meshId, polygon_attribute);
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
async function applyMeshPolygonsActiveColoring(
|
|
66
|
-
|
|
65
|
+
meshId: MeshId,
|
|
67
66
|
type: string | undefined,
|
|
68
67
|
deps: MeshPolygonsActiveColoringDeps,
|
|
69
68
|
): Promise<unknown> {
|
|
70
|
-
await deps.commonStyle.mutateMeshPolygonsStyle(
|
|
69
|
+
await deps.commonStyle.mutateMeshPolygonsStyle(meshId, {
|
|
71
70
|
coloring: { active: type },
|
|
72
71
|
});
|
|
73
72
|
if (type === "constant") {
|
|
74
|
-
const result = await whenDefined(deps.colorStyle.meshPolygonsColor(
|
|
75
|
-
const applied = await deps.colorStyle.setMeshPolygonsColor(
|
|
73
|
+
const result = await whenDefined(deps.colorStyle.meshPolygonsColor(meshId), async (value) => {
|
|
74
|
+
const applied = await deps.colorStyle.setMeshPolygonsColor(meshId, value);
|
|
76
75
|
return applied;
|
|
77
76
|
});
|
|
78
77
|
return result;
|
|
79
78
|
}
|
|
80
79
|
if (type === "textures") {
|
|
81
|
-
const textures = deps.texturesStyle.meshPolygonsTextures(
|
|
80
|
+
const textures = deps.texturesStyle.meshPolygonsTextures(meshId);
|
|
82
81
|
// The viewer requires at least one texture: nothing to apply until one is picked.
|
|
83
82
|
if (textures === undefined || textures.length === 0) {
|
|
84
83
|
return undefined;
|
|
85
84
|
}
|
|
86
|
-
const result = await deps.texturesStyle.setMeshPolygonsTextures(
|
|
85
|
+
const result = await deps.texturesStyle.setMeshPolygonsTextures(meshId, textures);
|
|
87
86
|
return result;
|
|
88
87
|
}
|
|
89
88
|
if (type === "vertex") {
|
|
90
|
-
const result = await handleMeshPolygonsVertexColoring(
|
|
89
|
+
const result = await handleMeshPolygonsVertexColoring(meshId, deps.vertexAttributeStyle);
|
|
91
90
|
return result;
|
|
92
91
|
}
|
|
93
92
|
if (type === "polygon") {
|
|
94
|
-
const result = await handleMeshPolygonsPolygonColoring(
|
|
93
|
+
const result = await handleMeshPolygonsPolygonColoring(meshId, deps.polygonAttributeStyle);
|
|
95
94
|
return result;
|
|
96
95
|
}
|
|
97
96
|
throw new Error(`Unknown mesh polygons coloring type: ${type}`);
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
async function setMeshPolygonsActiveColoring(
|
|
101
|
-
|
|
100
|
+
meshId: MeshId,
|
|
102
101
|
type: string | undefined,
|
|
103
102
|
deps: MeshPolygonsActiveColoringDeps,
|
|
104
103
|
): Promise<unknown> {
|
|
105
|
-
const result = await applyMeshPolygonsActiveColoring(
|
|
104
|
+
const result = await applyMeshPolygonsActiveColoring(meshId, type, deps);
|
|
106
105
|
if (type !== "constant") {
|
|
107
106
|
// Attribute and textures colorings keep the actor opacity: restore the stored one
|
|
108
|
-
await whenDefined(deps.colorStyle.meshPolygonsOpacity(
|
|
109
|
-
const applied = await deps.colorStyle.setMeshPolygonsOpacity(
|
|
107
|
+
await whenDefined(deps.colorStyle.meshPolygonsOpacity(meshId), async (value) => {
|
|
108
|
+
const applied = await deps.colorStyle.setMeshPolygonsOpacity(meshId, value);
|
|
110
109
|
return applied;
|
|
111
110
|
});
|
|
112
111
|
}
|
|
@@ -114,26 +113,26 @@ async function setMeshPolygonsActiveColoring(
|
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
async function applyMeshPolygonsStyle(
|
|
117
|
-
|
|
116
|
+
meshId: MeshId,
|
|
118
117
|
visibilityStyle: ReturnType<typeof useMeshPolygonsVisibilityStyle>,
|
|
119
118
|
activeColoringType: string | undefined,
|
|
120
119
|
deps: MeshPolygonsActiveColoringDeps,
|
|
121
120
|
): Promise<unknown[]> {
|
|
122
121
|
const result = await Promise.all([
|
|
123
|
-
whenDefined(visibilityStyle.meshPolygonsVisibility(
|
|
124
|
-
const applied = await visibilityStyle.setMeshPolygonsVisibility(
|
|
122
|
+
whenDefined(visibilityStyle.meshPolygonsVisibility(meshId), async (value) => {
|
|
123
|
+
const applied = await visibilityStyle.setMeshPolygonsVisibility(meshId, value);
|
|
125
124
|
return applied;
|
|
126
125
|
}),
|
|
127
|
-
setMeshPolygonsActiveColoring(
|
|
126
|
+
setMeshPolygonsActiveColoring(meshId, activeColoringType, deps),
|
|
128
127
|
]);
|
|
129
128
|
return result;
|
|
130
129
|
}
|
|
131
130
|
|
|
132
131
|
type UseMeshPolygonsStyleReturn = ReturnType<typeof useMeshPolygonsCommonStyle> & {
|
|
133
|
-
meshPolygonsColoring: (
|
|
134
|
-
meshPolygonsActiveColoring: (
|
|
135
|
-
setMeshPolygonsActiveColoring: (
|
|
136
|
-
applyMeshPolygonsStyle: (
|
|
132
|
+
meshPolygonsColoring: (meshId: MeshId) => StyleValues;
|
|
133
|
+
meshPolygonsActiveColoring: (meshId: MeshId) => string | undefined;
|
|
134
|
+
setMeshPolygonsActiveColoring: (meshId: MeshId, type: string | undefined) => Promise<unknown>;
|
|
135
|
+
applyMeshPolygonsStyle: (meshId: MeshId) => Promise<unknown[]>;
|
|
137
136
|
} & ReturnType<typeof useMeshPolygonsVisibilityStyle> &
|
|
138
137
|
ReturnType<typeof useMeshPolygonsColorStyle> &
|
|
139
138
|
ReturnType<typeof useMeshPolygonsTexturesStyle> &
|
|
@@ -156,28 +155,28 @@ export function useMeshPolygonsStyle(): UseMeshPolygonsStyleReturn {
|
|
|
156
155
|
polygonAttributeStyle: meshPolygonsPolygonAttributeStyle,
|
|
157
156
|
};
|
|
158
157
|
|
|
159
|
-
function meshPolygonsColoring(
|
|
160
|
-
return meshPolygonsCommonStyle.meshPolygonsColoring(
|
|
158
|
+
function meshPolygonsColoring(meshId: MeshId): StyleValues {
|
|
159
|
+
return meshPolygonsCommonStyle.meshPolygonsColoring(meshId);
|
|
161
160
|
}
|
|
162
161
|
|
|
163
|
-
function meshPolygonsActiveColoring(
|
|
162
|
+
function meshPolygonsActiveColoring(meshId: MeshId): string | undefined {
|
|
164
163
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring.active is defined as string in the data style schema.
|
|
165
|
-
return meshPolygonsColoring(
|
|
164
|
+
return meshPolygonsColoring(meshId).active as string | undefined;
|
|
166
165
|
}
|
|
167
166
|
|
|
168
167
|
async function boundSetMeshPolygonsActiveColoring(
|
|
169
|
-
|
|
168
|
+
meshId: MeshId,
|
|
170
169
|
type: string | undefined,
|
|
171
170
|
): Promise<unknown> {
|
|
172
|
-
const result = await setMeshPolygonsActiveColoring(
|
|
171
|
+
const result = await setMeshPolygonsActiveColoring(meshId, type, activeColoringDeps);
|
|
173
172
|
return result;
|
|
174
173
|
}
|
|
175
174
|
|
|
176
|
-
async function boundApplyMeshPolygonsStyle(
|
|
175
|
+
async function boundApplyMeshPolygonsStyle(meshId: MeshId): Promise<unknown[]> {
|
|
177
176
|
const result = await applyMeshPolygonsStyle(
|
|
178
|
-
|
|
177
|
+
meshId,
|
|
179
178
|
meshPolygonsVisibility,
|
|
180
|
-
meshPolygonsActiveColoring(
|
|
179
|
+
meshPolygonsActiveColoring(meshId),
|
|
181
180
|
activeColoringDeps,
|
|
182
181
|
);
|
|
183
182
|
return result;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { MeshId } from "@ogw_front/types/identifiers";
|
|
2
|
+
import type { Opacity } from "@ogw_front/types/style";
|
|
1
3
|
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
2
4
|
// Third party imports
|
|
3
5
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
@@ -11,21 +13,21 @@ const schema = viewer_schemas.opengeodeweb_viewer.mesh.polygons.opacity;
|
|
|
11
13
|
|
|
12
14
|
// The opacity is the constant color alpha, the viewer applies it whatever the coloring
|
|
13
15
|
export function useMeshPolygonsOpacityStyle(): {
|
|
14
|
-
meshPolygonsOpacity: (
|
|
15
|
-
setMeshPolygonsOpacity: (
|
|
16
|
+
meshPolygonsOpacity: (meshId: MeshId) => Opacity | undefined;
|
|
17
|
+
setMeshPolygonsOpacity: (meshId: MeshId, opacity: Opacity) => Promise<unknown>;
|
|
16
18
|
} {
|
|
17
19
|
const viewerStore = useViewerStore();
|
|
18
20
|
const meshPolygonsCommonStyle = useMeshPolygonsCommonStyle();
|
|
19
21
|
|
|
20
|
-
function meshPolygonsConstantColor(
|
|
22
|
+
function meshPolygonsConstantColor(meshId: MeshId): RGBAColor | undefined {
|
|
21
23
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring.constant shape is defined by the data style schema.
|
|
22
|
-
return meshPolygonsCommonStyle.meshPolygonsColoring(
|
|
24
|
+
return meshPolygonsCommonStyle.meshPolygonsColoring(meshId).constant as RGBAColor | undefined;
|
|
23
25
|
}
|
|
24
|
-
function meshPolygonsOpacity(
|
|
25
|
-
return meshPolygonsConstantColor(
|
|
26
|
+
function meshPolygonsOpacity(meshId: MeshId): Opacity | undefined {
|
|
27
|
+
return meshPolygonsConstantColor(meshId)?.alpha;
|
|
26
28
|
}
|
|
27
|
-
async function setMeshPolygonsOpacity(
|
|
28
|
-
const params = { id, opacity };
|
|
29
|
+
async function setMeshPolygonsOpacity(meshId: MeshId, opacity: Opacity): Promise<unknown> {
|
|
30
|
+
const params = { id: meshId, opacity };
|
|
29
31
|
const result = await viewerStore.request(
|
|
30
32
|
{
|
|
31
33
|
schema,
|
|
@@ -33,11 +35,11 @@ export function useMeshPolygonsOpacityStyle(): {
|
|
|
33
35
|
},
|
|
34
36
|
{
|
|
35
37
|
response_function: async () => {
|
|
36
|
-
const color = meshPolygonsConstantColor(
|
|
38
|
+
const color = meshPolygonsConstantColor(meshId);
|
|
37
39
|
if (color === undefined) {
|
|
38
40
|
return undefined;
|
|
39
41
|
}
|
|
40
|
-
const mutateResult = await meshPolygonsCommonStyle.mutateMeshPolygonsColoring(
|
|
42
|
+
const mutateResult = await meshPolygonsCommonStyle.mutateMeshPolygonsColoring(meshId, {
|
|
41
43
|
constant: { ...color, alpha: opacity },
|
|
42
44
|
});
|
|
43
45
|
return mutateResult;
|
|
@@ -1,19 +1,26 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AttributeColorMap,
|
|
3
|
+
AttributeItem,
|
|
4
|
+
AttributeName,
|
|
5
|
+
AttributeRangeMaximum,
|
|
6
|
+
AttributeRangeMinimum,
|
|
7
|
+
AttributeTimeStep,
|
|
8
|
+
} from "@ogw_front/types/attribute";
|
|
1
9
|
import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
10
|
+
import type { MeshId } from "@ogw_front/types/identifiers";
|
|
11
|
+
import type { ValidAttributeInput } from "@ogw_internal/stores/data_style/attribute_types";
|
|
12
|
+
import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
|
|
2
13
|
// Third party imports
|
|
3
14
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
4
15
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
5
16
|
|
|
6
17
|
// Local imports
|
|
7
|
-
import {
|
|
8
|
-
type UseMeshPolygonsPolygonAttributeStyleReturn,
|
|
9
|
-
type ValidAttributeInput,
|
|
10
|
-
isMeshPolygonsPolygonAttributeValid,
|
|
11
|
-
} from "./polygon_attribute";
|
|
12
18
|
import {
|
|
13
19
|
useMeshPolygonsPolygonAttributeConfig,
|
|
14
20
|
useMeshPolygonsPolygonAttributeConfigValues,
|
|
15
21
|
useMeshPolygonsPolygonAttributeConfigWriter,
|
|
16
22
|
} from "./polygon_config";
|
|
23
|
+
import type { UseMeshPolygonsPolygonAttributeStyleReturn } from "./polygon_attribute";
|
|
17
24
|
import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
|
|
18
25
|
import { useAttributeTimeStepStyle } from "@ogw_internal/stores/data_style/time_step";
|
|
19
26
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
@@ -41,11 +48,15 @@ function useMeshPolygonsPolygonAttributeStyle(): UseMeshPolygonsPolygonAttribute
|
|
|
41
48
|
} = useMeshPolygonsPolygonAttributeConfigValues();
|
|
42
49
|
const { mutateMeshPolygonsPolygonStyle, setMeshPolygonsPolygonAttributeStoredConfig } =
|
|
43
50
|
useMeshPolygonsPolygonAttributeConfigWriter();
|
|
44
|
-
function meshPolygonsPolygonAttributeTimeStep(
|
|
45
|
-
return attributeTimeStep(
|
|
51
|
+
function meshPolygonsPolygonAttributeTimeStep(meshId: MeshId): AttributeTimeStep | undefined {
|
|
52
|
+
return attributeTimeStep(
|
|
53
|
+
meshId,
|
|
54
|
+
attributeNamesSchema.$id,
|
|
55
|
+
meshPolygonsPolygonAttribute(meshId).name,
|
|
56
|
+
);
|
|
46
57
|
}
|
|
47
58
|
async function setMeshPolygonsPolygonAttribute(
|
|
48
|
-
|
|
59
|
+
meshId: MeshId,
|
|
49
60
|
{
|
|
50
61
|
name,
|
|
51
62
|
item,
|
|
@@ -55,11 +66,11 @@ function useMeshPolygonsPolygonAttributeStyle(): UseMeshPolygonsPolygonAttribute
|
|
|
55
66
|
no_data_color = DEFAULT_NO_DATA_COLOR,
|
|
56
67
|
}: ValidAttributeInput,
|
|
57
68
|
): Promise<unknown> {
|
|
58
|
-
await mutateMeshPolygonsPolygonStyle(
|
|
69
|
+
await mutateMeshPolygonsPolygonStyle(meshId, {
|
|
59
70
|
name,
|
|
60
71
|
item,
|
|
61
72
|
});
|
|
62
|
-
await setMeshPolygonsPolygonAttributeStoredConfig(
|
|
73
|
+
await setMeshPolygonsPolygonAttributeStoredConfig(meshId, name, item, {
|
|
63
74
|
minimum,
|
|
64
75
|
maximum,
|
|
65
76
|
colorMap,
|
|
@@ -68,8 +79,8 @@ function useMeshPolygonsPolygonAttributeStyle(): UseMeshPolygonsPolygonAttribute
|
|
|
68
79
|
const points = [...getRGBPointsFromPreset(colorMap)];
|
|
69
80
|
const schema = meshPolygonsPolygonAttributeSchemas.attribute;
|
|
70
81
|
const params = {
|
|
71
|
-
id,
|
|
72
|
-
name: seriesArrayName(
|
|
82
|
+
id: meshId,
|
|
83
|
+
name: seriesArrayName(meshId, attributeNamesSchema.$id, name),
|
|
73
84
|
item,
|
|
74
85
|
points,
|
|
75
86
|
minimum,
|
|
@@ -81,10 +92,10 @@ function useMeshPolygonsPolygonAttributeStyle(): UseMeshPolygonsPolygonAttribute
|
|
|
81
92
|
params,
|
|
82
93
|
});
|
|
83
94
|
}
|
|
84
|
-
async function applyPolygonAttribute(
|
|
85
|
-
const name = meshPolygonsPolygonAttributeName(
|
|
86
|
-
const item = meshPolygonsPolygonAttributeItem(
|
|
87
|
-
const storedConfig = meshPolygonsPolygonAttributeStoredConfig(
|
|
95
|
+
async function applyPolygonAttribute(meshId: MeshId): Promise<unknown> {
|
|
96
|
+
const name = meshPolygonsPolygonAttributeName(meshId);
|
|
97
|
+
const item = meshPolygonsPolygonAttributeItem(meshId);
|
|
98
|
+
const storedConfig = meshPolygonsPolygonAttributeStoredConfig(meshId, name, item);
|
|
88
99
|
const attribute = {
|
|
89
100
|
name,
|
|
90
101
|
item,
|
|
@@ -93,73 +104,79 @@ function useMeshPolygonsPolygonAttributeStyle(): UseMeshPolygonsPolygonAttribute
|
|
|
93
104
|
colorMap: storedConfig.colorMap,
|
|
94
105
|
no_data_color: storedConfig.no_data_color,
|
|
95
106
|
};
|
|
96
|
-
if (
|
|
97
|
-
const result = await setMeshPolygonsPolygonAttribute(
|
|
107
|
+
if (isAttributeValid(attribute)) {
|
|
108
|
+
const result = await setMeshPolygonsPolygonAttribute(meshId, attribute);
|
|
98
109
|
return result;
|
|
99
110
|
}
|
|
100
111
|
return undefined;
|
|
101
112
|
}
|
|
102
|
-
async function setMeshPolygonsPolygonAttributeName(
|
|
103
|
-
|
|
104
|
-
|
|
113
|
+
async function setMeshPolygonsPolygonAttributeName(
|
|
114
|
+
meshId: MeshId,
|
|
115
|
+
name: AttributeName,
|
|
116
|
+
): Promise<unknown> {
|
|
117
|
+
const item = meshPolygonsPolygonAttributeLastItem(meshId, name);
|
|
118
|
+
await mutateMeshPolygonsPolygonStyle(meshId, {
|
|
105
119
|
name,
|
|
106
120
|
item,
|
|
107
121
|
});
|
|
108
|
-
return applyPolygonAttribute(
|
|
122
|
+
return applyPolygonAttribute(meshId);
|
|
109
123
|
}
|
|
110
|
-
async function setMeshPolygonsPolygonAttributeItem(
|
|
111
|
-
|
|
124
|
+
async function setMeshPolygonsPolygonAttributeItem(
|
|
125
|
+
meshId: MeshId,
|
|
126
|
+
item: AttributeItem,
|
|
127
|
+
): Promise<unknown> {
|
|
128
|
+
await mutateMeshPolygonsPolygonStyle(meshId, {
|
|
112
129
|
item,
|
|
113
130
|
});
|
|
114
|
-
return applyPolygonAttribute(
|
|
131
|
+
return applyPolygonAttribute(meshId);
|
|
115
132
|
}
|
|
116
133
|
async function setMeshPolygonsPolygonAttributeTimeStep(
|
|
117
|
-
|
|
118
|
-
timeStep:
|
|
134
|
+
meshId: MeshId,
|
|
135
|
+
timeStep: AttributeTimeStep,
|
|
119
136
|
): Promise<unknown> {
|
|
120
|
-
const name = meshPolygonsPolygonAttributeName(
|
|
137
|
+
const name = meshPolygonsPolygonAttributeName(meshId);
|
|
121
138
|
if (name === undefined) {
|
|
122
139
|
return undefined;
|
|
123
140
|
}
|
|
124
|
-
await setAttributeTimeStep(
|
|
125
|
-
return applyPolygonAttribute(
|
|
141
|
+
await setAttributeTimeStep(meshId, attributeNamesSchema.$id, name, timeStep);
|
|
142
|
+
return applyPolygonAttribute(meshId);
|
|
126
143
|
}
|
|
127
144
|
async function setMeshPolygonsPolygonAttributeRange(
|
|
128
|
-
|
|
129
|
-
minimum:
|
|
130
|
-
maximum:
|
|
145
|
+
meshId: MeshId,
|
|
146
|
+
minimum: AttributeRangeMinimum,
|
|
147
|
+
maximum: AttributeRangeMaximum,
|
|
131
148
|
): Promise<unknown> {
|
|
132
|
-
const name = meshPolygonsPolygonAttributeName(
|
|
133
|
-
const item = meshPolygonsPolygonAttributeItem(
|
|
134
|
-
await setMeshPolygonsPolygonAttributeStoredConfig(
|
|
149
|
+
const name = meshPolygonsPolygonAttributeName(meshId);
|
|
150
|
+
const item = meshPolygonsPolygonAttributeItem(meshId);
|
|
151
|
+
await setMeshPolygonsPolygonAttributeStoredConfig(meshId, name, item, {
|
|
135
152
|
minimum,
|
|
136
153
|
maximum,
|
|
137
154
|
});
|
|
138
|
-
return applyPolygonAttribute(
|
|
155
|
+
return applyPolygonAttribute(meshId);
|
|
139
156
|
}
|
|
140
157
|
async function setMeshPolygonsPolygonAttributeColorMap(
|
|
141
|
-
|
|
142
|
-
colorMap:
|
|
158
|
+
meshId: MeshId,
|
|
159
|
+
colorMap: AttributeColorMap | undefined,
|
|
143
160
|
): Promise<unknown> {
|
|
144
|
-
const name = meshPolygonsPolygonAttributeName(
|
|
145
|
-
const item = meshPolygonsPolygonAttributeItem(
|
|
146
|
-
await setMeshPolygonsPolygonAttributeStoredConfig(
|
|
161
|
+
const name = meshPolygonsPolygonAttributeName(meshId);
|
|
162
|
+
const item = meshPolygonsPolygonAttributeItem(meshId);
|
|
163
|
+
await setMeshPolygonsPolygonAttributeStoredConfig(meshId, name, item, {
|
|
147
164
|
colorMap,
|
|
148
165
|
});
|
|
149
|
-
return applyPolygonAttribute(
|
|
166
|
+
return applyPolygonAttribute(meshId);
|
|
150
167
|
}
|
|
151
168
|
async function setMeshPolygonsPolygonAttributeNoDataColor(
|
|
152
|
-
|
|
169
|
+
meshId: MeshId,
|
|
153
170
|
no_data_color: RGBAColor,
|
|
154
171
|
): Promise<unknown> {
|
|
155
|
-
const name = meshPolygonsPolygonAttributeName(
|
|
156
|
-
const item = meshPolygonsPolygonAttributeItem(
|
|
157
|
-
const storedConfig = meshPolygonsPolygonAttributeStoredConfig(
|
|
158
|
-
await setMeshPolygonsPolygonAttributeStoredConfig(
|
|
172
|
+
const name = meshPolygonsPolygonAttributeName(meshId);
|
|
173
|
+
const item = meshPolygonsPolygonAttributeItem(meshId);
|
|
174
|
+
const storedConfig = meshPolygonsPolygonAttributeStoredConfig(meshId, name, item);
|
|
175
|
+
await setMeshPolygonsPolygonAttributeStoredConfig(meshId, name, item, {
|
|
159
176
|
...storedConfig,
|
|
160
177
|
no_data_color,
|
|
161
178
|
});
|
|
162
|
-
return applyPolygonAttribute(
|
|
179
|
+
return applyPolygonAttribute(meshId);
|
|
163
180
|
}
|
|
164
181
|
return {
|
|
165
182
|
meshPolygonsPolygonAttributeName,
|
|
@@ -179,4 +196,3 @@ function useMeshPolygonsPolygonAttributeStyle(): UseMeshPolygonsPolygonAttribute
|
|
|
179
196
|
};
|
|
180
197
|
}
|
|
181
198
|
export { useMeshPolygonsPolygonAttributeStyle };
|
|
182
|
-
export { isMeshPolygonsPolygonAttributeValid } from "./polygon_attribute";
|