@geode/opengeodeweb-front 10.44.0 → 10.44.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 +1 -1
- package/shared/utils/fetch_raw.ts +7 -8
|
@@ -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.polyhedra.opacity;
|
|
|
11
13
|
|
|
12
14
|
// The opacity is the constant color alpha, the viewer applies it whatever the coloring
|
|
13
15
|
export function useMeshPolyhedraOpacityStyle(): {
|
|
14
|
-
meshPolyhedraOpacity: (
|
|
15
|
-
setMeshPolyhedraOpacity: (
|
|
16
|
+
meshPolyhedraOpacity: (meshId: MeshId) => Opacity | undefined;
|
|
17
|
+
setMeshPolyhedraOpacity: (meshId: MeshId, opacity: Opacity) => Promise<unknown>;
|
|
16
18
|
} {
|
|
17
19
|
const viewerStore = useViewerStore();
|
|
18
20
|
const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
|
|
19
21
|
|
|
20
|
-
function meshPolyhedraConstantColor(
|
|
22
|
+
function meshPolyhedraConstantColor(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 meshPolyhedraCommonStyle.meshPolyhedraColoring(
|
|
24
|
+
return meshPolyhedraCommonStyle.meshPolyhedraColoring(meshId).constant as RGBAColor | undefined;
|
|
23
25
|
}
|
|
24
|
-
function meshPolyhedraOpacity(
|
|
25
|
-
return meshPolyhedraConstantColor(
|
|
26
|
+
function meshPolyhedraOpacity(meshId: MeshId): Opacity | undefined {
|
|
27
|
+
return meshPolyhedraConstantColor(meshId)?.alpha;
|
|
26
28
|
}
|
|
27
|
-
async function setMeshPolyhedraOpacity(
|
|
28
|
-
const params = { id, opacity };
|
|
29
|
+
async function setMeshPolyhedraOpacity(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 useMeshPolyhedraOpacityStyle(): {
|
|
|
33
35
|
},
|
|
34
36
|
{
|
|
35
37
|
response_function: async () => {
|
|
36
|
-
const color = meshPolyhedraConstantColor(
|
|
38
|
+
const color = meshPolyhedraConstantColor(meshId);
|
|
37
39
|
if (color === undefined) {
|
|
38
40
|
return undefined;
|
|
39
41
|
}
|
|
40
|
-
const mutateResult = await meshPolyhedraCommonStyle.mutateMeshPolyhedraColoring(
|
|
42
|
+
const mutateResult = await meshPolyhedraCommonStyle.mutateMeshPolyhedraColoring(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 UseMeshPolyhedraPolyhedronAttributeStyleReturn,
|
|
9
|
-
type ValidAttributeInput,
|
|
10
|
-
isMeshPolyhedraPolyhedronAttributeValid,
|
|
11
|
-
} from "./polyhedron_attribute";
|
|
12
18
|
import {
|
|
13
19
|
useMeshPolyhedraPolyhedronAttributeConfig,
|
|
14
20
|
useMeshPolyhedraPolyhedronAttributeConfigValues,
|
|
15
21
|
useMeshPolyhedraPolyhedronAttributeConfigWriter,
|
|
16
22
|
} from "./polyhedron_config";
|
|
23
|
+
import type { UseMeshPolyhedraPolyhedronAttributeStyleReturn } from "./polyhedron_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,15 +48,15 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): UseMeshPolyhedraPolyhedronA
|
|
|
41
48
|
} = useMeshPolyhedraPolyhedronAttributeConfigValues();
|
|
42
49
|
const { mutateMeshPolyhedraPolyhedronStyle, setMeshPolyhedraPolyhedronAttributeStoredConfig } =
|
|
43
50
|
useMeshPolyhedraPolyhedronAttributeConfigWriter();
|
|
44
|
-
function meshPolyhedraPolyhedronAttributeTimeStep(
|
|
51
|
+
function meshPolyhedraPolyhedronAttributeTimeStep(meshId: MeshId): AttributeTimeStep | undefined {
|
|
45
52
|
return attributeTimeStep(
|
|
46
|
-
|
|
53
|
+
meshId,
|
|
47
54
|
attributeNamesSchema.$id,
|
|
48
|
-
meshPolyhedraPolyhedronAttribute(
|
|
55
|
+
meshPolyhedraPolyhedronAttribute(meshId).name,
|
|
49
56
|
);
|
|
50
57
|
}
|
|
51
58
|
async function setMeshPolyhedraPolyhedronAttribute(
|
|
52
|
-
|
|
59
|
+
meshId: MeshId,
|
|
53
60
|
{
|
|
54
61
|
name,
|
|
55
62
|
item,
|
|
@@ -59,11 +66,11 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): UseMeshPolyhedraPolyhedronA
|
|
|
59
66
|
no_data_color = DEFAULT_NO_DATA_COLOR,
|
|
60
67
|
}: ValidAttributeInput,
|
|
61
68
|
): Promise<unknown> {
|
|
62
|
-
await mutateMeshPolyhedraPolyhedronStyle(
|
|
69
|
+
await mutateMeshPolyhedraPolyhedronStyle(meshId, {
|
|
63
70
|
name,
|
|
64
71
|
item,
|
|
65
72
|
});
|
|
66
|
-
await setMeshPolyhedraPolyhedronAttributeStoredConfig(
|
|
73
|
+
await setMeshPolyhedraPolyhedronAttributeStoredConfig(meshId, name, item, {
|
|
67
74
|
minimum,
|
|
68
75
|
maximum,
|
|
69
76
|
colorMap,
|
|
@@ -72,8 +79,8 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): UseMeshPolyhedraPolyhedronA
|
|
|
72
79
|
const points = [...getRGBPointsFromPreset(colorMap)];
|
|
73
80
|
const schema = meshPolyhedraPolyhedronAttributeSchemas.attribute;
|
|
74
81
|
const params = {
|
|
75
|
-
id,
|
|
76
|
-
name: seriesArrayName(
|
|
82
|
+
id: meshId,
|
|
83
|
+
name: seriesArrayName(meshId, attributeNamesSchema.$id, name),
|
|
77
84
|
item,
|
|
78
85
|
points,
|
|
79
86
|
minimum,
|
|
@@ -85,10 +92,10 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): UseMeshPolyhedraPolyhedronA
|
|
|
85
92
|
params,
|
|
86
93
|
});
|
|
87
94
|
}
|
|
88
|
-
async function applyPolyhedronAttribute(
|
|
89
|
-
const name = meshPolyhedraPolyhedronAttributeName(
|
|
90
|
-
const item = meshPolyhedraPolyhedronAttributeItem(
|
|
91
|
-
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(
|
|
95
|
+
async function applyPolyhedronAttribute(meshId: MeshId): Promise<unknown> {
|
|
96
|
+
const name = meshPolyhedraPolyhedronAttributeName(meshId);
|
|
97
|
+
const item = meshPolyhedraPolyhedronAttributeItem(meshId);
|
|
98
|
+
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(meshId, name, item);
|
|
92
99
|
const attribute = {
|
|
93
100
|
name,
|
|
94
101
|
item,
|
|
@@ -97,79 +104,79 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): UseMeshPolyhedraPolyhedronA
|
|
|
97
104
|
colorMap: storedConfig.colorMap,
|
|
98
105
|
no_data_color: storedConfig.no_data_color,
|
|
99
106
|
};
|
|
100
|
-
if (
|
|
101
|
-
const result = await setMeshPolyhedraPolyhedronAttribute(
|
|
107
|
+
if (isAttributeValid(attribute)) {
|
|
108
|
+
const result = await setMeshPolyhedraPolyhedronAttribute(meshId, attribute);
|
|
102
109
|
return result;
|
|
103
110
|
}
|
|
104
111
|
return undefined;
|
|
105
112
|
}
|
|
106
113
|
async function setMeshPolyhedraPolyhedronAttributeName(
|
|
107
|
-
|
|
108
|
-
name:
|
|
114
|
+
meshId: MeshId,
|
|
115
|
+
name: AttributeName,
|
|
109
116
|
): Promise<unknown> {
|
|
110
|
-
const item = meshPolyhedraPolyhedronAttributeLastItem(
|
|
111
|
-
await mutateMeshPolyhedraPolyhedronStyle(
|
|
117
|
+
const item = meshPolyhedraPolyhedronAttributeLastItem(meshId, name);
|
|
118
|
+
await mutateMeshPolyhedraPolyhedronStyle(meshId, {
|
|
112
119
|
name,
|
|
113
120
|
item,
|
|
114
121
|
});
|
|
115
|
-
return applyPolyhedronAttribute(
|
|
122
|
+
return applyPolyhedronAttribute(meshId);
|
|
116
123
|
}
|
|
117
124
|
async function setMeshPolyhedraPolyhedronAttributeItem(
|
|
118
|
-
|
|
119
|
-
item:
|
|
125
|
+
meshId: MeshId,
|
|
126
|
+
item: AttributeItem,
|
|
120
127
|
): Promise<unknown> {
|
|
121
|
-
await mutateMeshPolyhedraPolyhedronStyle(
|
|
128
|
+
await mutateMeshPolyhedraPolyhedronStyle(meshId, {
|
|
122
129
|
item,
|
|
123
130
|
});
|
|
124
|
-
return applyPolyhedronAttribute(
|
|
131
|
+
return applyPolyhedronAttribute(meshId);
|
|
125
132
|
}
|
|
126
133
|
async function setMeshPolyhedraPolyhedronAttributeTimeStep(
|
|
127
|
-
|
|
128
|
-
timeStep:
|
|
134
|
+
meshId: MeshId,
|
|
135
|
+
timeStep: AttributeTimeStep,
|
|
129
136
|
): Promise<unknown> {
|
|
130
|
-
const name = meshPolyhedraPolyhedronAttributeName(
|
|
137
|
+
const name = meshPolyhedraPolyhedronAttributeName(meshId);
|
|
131
138
|
if (name === undefined) {
|
|
132
139
|
return undefined;
|
|
133
140
|
}
|
|
134
|
-
await setAttributeTimeStep(
|
|
135
|
-
return applyPolyhedronAttribute(
|
|
141
|
+
await setAttributeTimeStep(meshId, attributeNamesSchema.$id, name, timeStep);
|
|
142
|
+
return applyPolyhedronAttribute(meshId);
|
|
136
143
|
}
|
|
137
144
|
async function setMeshPolyhedraPolyhedronAttributeRange(
|
|
138
|
-
|
|
139
|
-
minimum:
|
|
140
|
-
maximum:
|
|
145
|
+
meshId: MeshId,
|
|
146
|
+
minimum: AttributeRangeMinimum,
|
|
147
|
+
maximum: AttributeRangeMaximum,
|
|
141
148
|
): Promise<unknown> {
|
|
142
|
-
const name = meshPolyhedraPolyhedronAttributeName(
|
|
143
|
-
const item = meshPolyhedraPolyhedronAttributeItem(
|
|
144
|
-
await setMeshPolyhedraPolyhedronAttributeStoredConfig(
|
|
149
|
+
const name = meshPolyhedraPolyhedronAttributeName(meshId);
|
|
150
|
+
const item = meshPolyhedraPolyhedronAttributeItem(meshId);
|
|
151
|
+
await setMeshPolyhedraPolyhedronAttributeStoredConfig(meshId, name, item, {
|
|
145
152
|
minimum,
|
|
146
153
|
maximum,
|
|
147
154
|
});
|
|
148
|
-
return applyPolyhedronAttribute(
|
|
155
|
+
return applyPolyhedronAttribute(meshId);
|
|
149
156
|
}
|
|
150
157
|
async function setMeshPolyhedraPolyhedronAttributeColorMap(
|
|
151
|
-
|
|
152
|
-
colorMap:
|
|
158
|
+
meshId: MeshId,
|
|
159
|
+
colorMap: AttributeColorMap | undefined,
|
|
153
160
|
): Promise<unknown> {
|
|
154
|
-
const name = meshPolyhedraPolyhedronAttributeName(
|
|
155
|
-
const item = meshPolyhedraPolyhedronAttributeItem(
|
|
156
|
-
await setMeshPolyhedraPolyhedronAttributeStoredConfig(
|
|
161
|
+
const name = meshPolyhedraPolyhedronAttributeName(meshId);
|
|
162
|
+
const item = meshPolyhedraPolyhedronAttributeItem(meshId);
|
|
163
|
+
await setMeshPolyhedraPolyhedronAttributeStoredConfig(meshId, name, item, {
|
|
157
164
|
colorMap,
|
|
158
165
|
});
|
|
159
|
-
return applyPolyhedronAttribute(
|
|
166
|
+
return applyPolyhedronAttribute(meshId);
|
|
160
167
|
}
|
|
161
168
|
async function setMeshPolyhedraPolyhedronAttributeNoDataColor(
|
|
162
|
-
|
|
169
|
+
meshId: MeshId,
|
|
163
170
|
no_data_color: RGBAColor,
|
|
164
171
|
): Promise<unknown> {
|
|
165
|
-
const name = meshPolyhedraPolyhedronAttributeName(
|
|
166
|
-
const item = meshPolyhedraPolyhedronAttributeItem(
|
|
167
|
-
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(
|
|
168
|
-
await setMeshPolyhedraPolyhedronAttributeStoredConfig(
|
|
172
|
+
const name = meshPolyhedraPolyhedronAttributeName(meshId);
|
|
173
|
+
const item = meshPolyhedraPolyhedronAttributeItem(meshId);
|
|
174
|
+
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(meshId, name, item);
|
|
175
|
+
await setMeshPolyhedraPolyhedronAttributeStoredConfig(meshId, name, item, {
|
|
169
176
|
...storedConfig,
|
|
170
177
|
no_data_color,
|
|
171
178
|
});
|
|
172
|
-
return applyPolyhedronAttribute(
|
|
179
|
+
return applyPolyhedronAttribute(meshId);
|
|
173
180
|
}
|
|
174
181
|
return {
|
|
175
182
|
meshPolyhedraPolyhedronAttributeName,
|
|
@@ -189,4 +196,3 @@ function useMeshPolyhedraPolyhedronAttributeStyle(): UseMeshPolyhedraPolyhedronA
|
|
|
189
196
|
};
|
|
190
197
|
}
|
|
191
198
|
export { useMeshPolyhedraPolyhedronAttributeStyle };
|
|
192
|
-
export { isMeshPolyhedraPolyhedronAttributeValid } from "./polyhedron_attribute";
|
|
@@ -1,82 +1,59 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AttributeColorMap,
|
|
3
|
+
AttributeItem,
|
|
4
|
+
AttributeName,
|
|
5
|
+
AttributeRange,
|
|
6
|
+
AttributeRangeMaximum,
|
|
7
|
+
AttributeRangeMinimum,
|
|
8
|
+
AttributeTimeStep,
|
|
9
|
+
} from "@ogw_front/types/attribute";
|
|
10
|
+
import type {
|
|
11
|
+
AttributeStoredConfig,
|
|
12
|
+
ValidAttributeInput,
|
|
13
|
+
} from "@ogw_internal/stores/data_style/attribute_types";
|
|
14
|
+
import type { MeshId } from "@ogw_front/types/identifiers";
|
|
1
15
|
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
2
16
|
|
|
3
|
-
interface AttributeStoredConfig {
|
|
4
|
-
minimum: number | undefined;
|
|
5
|
-
maximum: number | undefined;
|
|
6
|
-
colorMap: string | undefined;
|
|
7
|
-
no_data_color: RGBAColor;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface AttributeState {
|
|
11
|
-
name?: string;
|
|
12
|
-
item?: number;
|
|
13
|
-
storedConfigs?: Record<string, { lastItem: number } & Record<string, AttributeStoredConfig>>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface AttributeInput {
|
|
17
|
-
name: string | undefined;
|
|
18
|
-
item: number | undefined;
|
|
19
|
-
minimum: number | undefined;
|
|
20
|
-
maximum: number | undefined;
|
|
21
|
-
colorMap: string | undefined;
|
|
22
|
-
no_data_color?: RGBAColor;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface ValidAttributeInput {
|
|
26
|
-
name: string;
|
|
27
|
-
item: number;
|
|
28
|
-
minimum: number;
|
|
29
|
-
maximum: number;
|
|
30
|
-
colorMap: string;
|
|
31
|
-
no_data_color?: RGBAColor;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function isMeshPolyhedraPolyhedronAttributeValid(
|
|
35
|
-
input: AttributeInput,
|
|
36
|
-
): input is ValidAttributeInput {
|
|
37
|
-
return (
|
|
38
|
-
input.name !== undefined &&
|
|
39
|
-
input.item !== undefined &&
|
|
40
|
-
input.minimum !== undefined &&
|
|
41
|
-
input.maximum !== undefined &&
|
|
42
|
-
input.colorMap !== undefined
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
17
|
interface UseMeshPolyhedraPolyhedronAttributeStyleReturn {
|
|
47
|
-
meshPolyhedraPolyhedronAttributeName: (
|
|
48
|
-
meshPolyhedraPolyhedronAttributeItem: (
|
|
49
|
-
meshPolyhedraPolyhedronAttributeRange: (
|
|
50
|
-
meshPolyhedraPolyhedronAttributeTimeStep: (
|
|
51
|
-
setMeshPolyhedraPolyhedronAttributeTimeStep: (
|
|
52
|
-
|
|
18
|
+
meshPolyhedraPolyhedronAttributeName: (meshId: MeshId) => AttributeName | undefined;
|
|
19
|
+
meshPolyhedraPolyhedronAttributeItem: (meshId: MeshId) => AttributeItem;
|
|
20
|
+
meshPolyhedraPolyhedronAttributeRange: (meshId: MeshId) => AttributeRange;
|
|
21
|
+
meshPolyhedraPolyhedronAttributeTimeStep: (meshId: MeshId) => AttributeTimeStep | undefined;
|
|
22
|
+
setMeshPolyhedraPolyhedronAttributeTimeStep: (
|
|
23
|
+
meshId: MeshId,
|
|
24
|
+
timeStep: AttributeTimeStep,
|
|
25
|
+
) => Promise<unknown>;
|
|
26
|
+
meshPolyhedraPolyhedronAttributeColorMap: (meshId: MeshId) => AttributeColorMap | undefined;
|
|
53
27
|
meshPolyhedraPolyhedronAttributeStoredConfig: (
|
|
54
|
-
|
|
55
|
-
name:
|
|
56
|
-
item:
|
|
28
|
+
meshId: MeshId,
|
|
29
|
+
name: AttributeName | undefined,
|
|
30
|
+
item: AttributeItem | undefined,
|
|
57
31
|
) => AttributeStoredConfig;
|
|
58
|
-
setMeshPolyhedraPolyhedronAttribute: (
|
|
59
|
-
|
|
60
|
-
|
|
32
|
+
setMeshPolyhedraPolyhedronAttribute: (
|
|
33
|
+
meshId: MeshId,
|
|
34
|
+
input: ValidAttributeInput,
|
|
35
|
+
) => Promise<unknown>;
|
|
36
|
+
setMeshPolyhedraPolyhedronAttributeName: (
|
|
37
|
+
meshId: MeshId,
|
|
38
|
+
name: AttributeName,
|
|
39
|
+
) => Promise<unknown>;
|
|
40
|
+
setMeshPolyhedraPolyhedronAttributeItem: (
|
|
41
|
+
meshId: MeshId,
|
|
42
|
+
item: AttributeItem,
|
|
43
|
+
) => Promise<unknown>;
|
|
61
44
|
setMeshPolyhedraPolyhedronAttributeRange: (
|
|
62
|
-
|
|
63
|
-
minimum:
|
|
64
|
-
maximum:
|
|
45
|
+
meshId: MeshId,
|
|
46
|
+
minimum: AttributeRangeMinimum,
|
|
47
|
+
maximum: AttributeRangeMaximum,
|
|
65
48
|
) => Promise<unknown>;
|
|
66
49
|
setMeshPolyhedraPolyhedronAttributeColorMap: (
|
|
67
|
-
|
|
68
|
-
colorMap:
|
|
50
|
+
meshId: MeshId,
|
|
51
|
+
colorMap: AttributeColorMap | undefined,
|
|
69
52
|
) => Promise<unknown>;
|
|
70
|
-
meshPolyhedraPolyhedronAttributeNoDataColor: (
|
|
53
|
+
meshPolyhedraPolyhedronAttributeNoDataColor: (meshId: MeshId) => RGBAColor;
|
|
71
54
|
setMeshPolyhedraPolyhedronAttributeNoDataColor: (
|
|
72
|
-
|
|
55
|
+
meshId: MeshId,
|
|
73
56
|
no_data_color: RGBAColor,
|
|
74
57
|
) => Promise<unknown>;
|
|
75
58
|
}
|
|
76
|
-
export {
|
|
77
|
-
export type {
|
|
78
|
-
AttributeStoredConfig,
|
|
79
|
-
AttributeState,
|
|
80
|
-
ValidAttributeInput,
|
|
81
|
-
UseMeshPolyhedraPolyhedronAttributeStyleReturn,
|
|
82
|
-
};
|
|
59
|
+
export type { UseMeshPolyhedraPolyhedronAttributeStyleReturn };
|
|
@@ -1,72 +1,84 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
AttributeColorMap,
|
|
3
|
+
AttributeItem,
|
|
4
|
+
AttributeName,
|
|
5
|
+
AttributeRange,
|
|
6
|
+
} from "@ogw_front/types/attribute";
|
|
7
|
+
import type {
|
|
8
|
+
AttributeState,
|
|
9
|
+
AttributeStoredConfig,
|
|
10
|
+
} from "@ogw_internal/stores/data_style/attribute_types";
|
|
11
|
+
import type { MeshId } from "@ogw_front/types/identifiers";
|
|
12
|
+
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
13
|
+
import { defaultAttributeStoredConfig } from "@ogw_internal/stores/data_style/attribute_default";
|
|
3
14
|
|
|
4
15
|
// Local imports
|
|
5
16
|
import { useMeshPolyhedraCommonStyle } from "./common";
|
|
6
17
|
|
|
7
18
|
interface UseMeshPolyhedraPolyhedronAttributeConfigReturn {
|
|
8
|
-
meshPolyhedraPolyhedronAttribute: (
|
|
9
|
-
meshPolyhedraPolyhedronAttributeName: (
|
|
10
|
-
meshPolyhedraPolyhedronAttributeLastItem: (
|
|
11
|
-
|
|
19
|
+
meshPolyhedraPolyhedronAttribute: (meshId: MeshId) => AttributeState;
|
|
20
|
+
meshPolyhedraPolyhedronAttributeName: (meshId: MeshId) => AttributeName | undefined;
|
|
21
|
+
meshPolyhedraPolyhedronAttributeLastItem: (
|
|
22
|
+
meshId: MeshId,
|
|
23
|
+
name: AttributeName | undefined,
|
|
24
|
+
) => number;
|
|
25
|
+
meshPolyhedraPolyhedronAttributeItem: (meshId: MeshId) => AttributeItem;
|
|
12
26
|
meshPolyhedraPolyhedronAttributeStoredConfig: (
|
|
13
|
-
|
|
14
|
-
name:
|
|
15
|
-
item:
|
|
27
|
+
meshId: MeshId,
|
|
28
|
+
name: AttributeName | undefined,
|
|
29
|
+
item: AttributeItem | undefined,
|
|
16
30
|
) => AttributeStoredConfig;
|
|
17
31
|
}
|
|
18
32
|
|
|
19
33
|
interface UseMeshPolyhedraPolyhedronAttributeConfigWriterReturn {
|
|
20
34
|
mutateMeshPolyhedraPolyhedronStyle: (
|
|
21
|
-
|
|
35
|
+
meshId: MeshId,
|
|
22
36
|
values: Record<string, unknown>,
|
|
23
37
|
) => Promise<string>;
|
|
24
38
|
setMeshPolyhedraPolyhedronAttributeStoredConfig: (
|
|
25
|
-
|
|
26
|
-
name:
|
|
27
|
-
item:
|
|
39
|
+
meshId: MeshId,
|
|
40
|
+
name: AttributeName | undefined,
|
|
41
|
+
item: AttributeItem | undefined,
|
|
28
42
|
config: Partial<AttributeStoredConfig>,
|
|
29
43
|
) => Promise<string>;
|
|
30
44
|
}
|
|
31
45
|
|
|
32
46
|
function useMeshPolyhedraPolyhedronAttributeConfig(): UseMeshPolyhedraPolyhedronAttributeConfigReturn {
|
|
33
47
|
const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
|
|
34
|
-
function meshPolyhedraPolyhedronAttribute(
|
|
48
|
+
function meshPolyhedraPolyhedronAttribute(meshId: MeshId): AttributeState {
|
|
35
49
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring.polyhedron shape is defined by the data style schema.
|
|
36
|
-
return meshPolyhedraCommonStyle.meshPolyhedraColoring(
|
|
50
|
+
return meshPolyhedraCommonStyle.meshPolyhedraColoring(meshId).polyhedron as AttributeState;
|
|
37
51
|
}
|
|
38
52
|
function meshPolyhedraPolyhedronAttributeStoredConfig(
|
|
39
|
-
|
|
40
|
-
name:
|
|
41
|
-
item:
|
|
53
|
+
meshId: MeshId,
|
|
54
|
+
name: AttributeName | undefined,
|
|
55
|
+
item: AttributeItem | undefined,
|
|
42
56
|
): AttributeStoredConfig {
|
|
43
|
-
const { storedConfigs } = meshPolyhedraPolyhedronAttribute(
|
|
57
|
+
const { storedConfigs } = meshPolyhedraPolyhedronAttribute(meshId);
|
|
44
58
|
const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
|
|
45
59
|
const itemConfig = item === undefined ? undefined : nameConfig?.[item];
|
|
46
60
|
if (itemConfig !== undefined) {
|
|
47
61
|
return itemConfig;
|
|
48
62
|
}
|
|
49
|
-
return
|
|
50
|
-
minimum: undefined,
|
|
51
|
-
maximum: undefined,
|
|
52
|
-
colorMap: undefined,
|
|
53
|
-
no_data_color: DEFAULT_NO_DATA_COLOR,
|
|
54
|
-
};
|
|
63
|
+
return defaultAttributeStoredConfig();
|
|
55
64
|
}
|
|
56
|
-
function meshPolyhedraPolyhedronAttributeName(
|
|
57
|
-
return meshPolyhedraPolyhedronAttribute(
|
|
65
|
+
function meshPolyhedraPolyhedronAttributeName(meshId: MeshId): AttributeName | undefined {
|
|
66
|
+
return meshPolyhedraPolyhedronAttribute(meshId).name;
|
|
58
67
|
}
|
|
59
|
-
function meshPolyhedraPolyhedronAttributeLastItem(
|
|
60
|
-
|
|
68
|
+
function meshPolyhedraPolyhedronAttributeLastItem(
|
|
69
|
+
meshId: MeshId,
|
|
70
|
+
name: AttributeName | undefined,
|
|
71
|
+
): number {
|
|
72
|
+
const { storedConfigs } = meshPolyhedraPolyhedronAttribute(meshId);
|
|
61
73
|
const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
|
|
62
74
|
if (nameConfig !== undefined) {
|
|
63
75
|
return nameConfig.lastItem;
|
|
64
76
|
}
|
|
65
77
|
return 0;
|
|
66
78
|
}
|
|
67
|
-
function meshPolyhedraPolyhedronAttributeItem(
|
|
68
|
-
const { item, name } = meshPolyhedraPolyhedronAttribute(
|
|
69
|
-
return item ?? meshPolyhedraPolyhedronAttributeLastItem(
|
|
79
|
+
function meshPolyhedraPolyhedronAttributeItem(meshId: MeshId): AttributeItem {
|
|
80
|
+
const { item, name } = meshPolyhedraPolyhedronAttribute(meshId);
|
|
81
|
+
return item ?? meshPolyhedraPolyhedronAttributeLastItem(meshId, name);
|
|
70
82
|
}
|
|
71
83
|
return {
|
|
72
84
|
meshPolyhedraPolyhedronAttribute,
|
|
@@ -78,9 +90,9 @@ function useMeshPolyhedraPolyhedronAttributeConfig(): UseMeshPolyhedraPolyhedron
|
|
|
78
90
|
}
|
|
79
91
|
|
|
80
92
|
interface UseMeshPolyhedraPolyhedronAttributeConfigValuesReturn {
|
|
81
|
-
meshPolyhedraPolyhedronAttributeRange: (
|
|
82
|
-
meshPolyhedraPolyhedronAttributeColorMap: (
|
|
83
|
-
meshPolyhedraPolyhedronAttributeNoDataColor: (
|
|
93
|
+
meshPolyhedraPolyhedronAttributeRange: (meshId: MeshId) => AttributeRange;
|
|
94
|
+
meshPolyhedraPolyhedronAttributeColorMap: (meshId: MeshId) => AttributeColorMap | undefined;
|
|
95
|
+
meshPolyhedraPolyhedronAttributeNoDataColor: (meshId: MeshId) => RGBAColor;
|
|
84
96
|
}
|
|
85
97
|
|
|
86
98
|
function useMeshPolyhedraPolyhedronAttributeConfigValues(): UseMeshPolyhedraPolyhedronAttributeConfigValuesReturn {
|
|
@@ -89,24 +101,22 @@ function useMeshPolyhedraPolyhedronAttributeConfigValues(): UseMeshPolyhedraPoly
|
|
|
89
101
|
meshPolyhedraPolyhedronAttributeItem,
|
|
90
102
|
meshPolyhedraPolyhedronAttributeStoredConfig,
|
|
91
103
|
} = useMeshPolyhedraPolyhedronAttributeConfig();
|
|
92
|
-
function meshPolyhedraPolyhedronAttributeRange(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
const item = meshPolyhedraPolyhedronAttributeItem(id);
|
|
97
|
-
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(id, name, item);
|
|
104
|
+
function meshPolyhedraPolyhedronAttributeRange(meshId: MeshId): AttributeRange {
|
|
105
|
+
const name = meshPolyhedraPolyhedronAttributeName(meshId);
|
|
106
|
+
const item = meshPolyhedraPolyhedronAttributeItem(meshId);
|
|
107
|
+
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(meshId, name, item);
|
|
98
108
|
return [storedConfig.minimum, storedConfig.maximum];
|
|
99
109
|
}
|
|
100
|
-
function meshPolyhedraPolyhedronAttributeColorMap(
|
|
101
|
-
const name = meshPolyhedraPolyhedronAttributeName(
|
|
102
|
-
const item = meshPolyhedraPolyhedronAttributeItem(
|
|
103
|
-
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(
|
|
110
|
+
function meshPolyhedraPolyhedronAttributeColorMap(meshId: MeshId): AttributeColorMap | undefined {
|
|
111
|
+
const name = meshPolyhedraPolyhedronAttributeName(meshId);
|
|
112
|
+
const item = meshPolyhedraPolyhedronAttributeItem(meshId);
|
|
113
|
+
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(meshId, name, item);
|
|
104
114
|
return storedConfig.colorMap;
|
|
105
115
|
}
|
|
106
|
-
function meshPolyhedraPolyhedronAttributeNoDataColor(
|
|
107
|
-
const name = meshPolyhedraPolyhedronAttributeName(
|
|
108
|
-
const item = meshPolyhedraPolyhedronAttributeItem(
|
|
109
|
-
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(
|
|
116
|
+
function meshPolyhedraPolyhedronAttributeNoDataColor(meshId: MeshId): RGBAColor {
|
|
117
|
+
const name = meshPolyhedraPolyhedronAttributeName(meshId);
|
|
118
|
+
const item = meshPolyhedraPolyhedronAttributeItem(meshId);
|
|
119
|
+
const storedConfig = meshPolyhedraPolyhedronAttributeStoredConfig(meshId, name, item);
|
|
110
120
|
return storedConfig.no_data_color;
|
|
111
121
|
}
|
|
112
122
|
return {
|
|
@@ -119,10 +129,10 @@ function useMeshPolyhedraPolyhedronAttributeConfigValues(): UseMeshPolyhedraPoly
|
|
|
119
129
|
function useMeshPolyhedraPolyhedronAttributeConfigWriter(): UseMeshPolyhedraPolyhedronAttributeConfigWriterReturn {
|
|
120
130
|
const meshPolyhedraCommonStyle = useMeshPolyhedraCommonStyle();
|
|
121
131
|
async function mutateMeshPolyhedraPolyhedronStyle(
|
|
122
|
-
|
|
132
|
+
meshId: MeshId,
|
|
123
133
|
values: Record<string, unknown>,
|
|
124
134
|
): Promise<string> {
|
|
125
|
-
const result = await meshPolyhedraCommonStyle.mutateMeshPolyhedraStyle(
|
|
135
|
+
const result = await meshPolyhedraCommonStyle.mutateMeshPolyhedraStyle(meshId, {
|
|
126
136
|
coloring: {
|
|
127
137
|
polyhedron: values,
|
|
128
138
|
},
|
|
@@ -130,12 +140,12 @@ function useMeshPolyhedraPolyhedronAttributeConfigWriter(): UseMeshPolyhedraPoly
|
|
|
130
140
|
return result;
|
|
131
141
|
}
|
|
132
142
|
async function setMeshPolyhedraPolyhedronAttributeStoredConfig(
|
|
133
|
-
|
|
134
|
-
name:
|
|
135
|
-
item:
|
|
143
|
+
meshId: MeshId,
|
|
144
|
+
name: AttributeName | undefined,
|
|
145
|
+
item: AttributeItem | undefined,
|
|
136
146
|
config: Partial<AttributeStoredConfig>,
|
|
137
147
|
): Promise<string> {
|
|
138
|
-
const result = await mutateMeshPolyhedraPolyhedronStyle(
|
|
148
|
+
const result = await mutateMeshPolyhedraPolyhedronStyle(meshId, {
|
|
139
149
|
storedConfigs: {
|
|
140
150
|
[name ?? ""]: {
|
|
141
151
|
lastItem: item,
|