@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,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 UseMeshEdgesEdgeAttributeStyleReturn,
|
|
9
|
-
type ValidAttributeInput,
|
|
10
|
-
isMeshEdgesEdgeAttributeValid,
|
|
11
|
-
} from "./edge_attribute";
|
|
12
18
|
import {
|
|
13
19
|
useMeshEdgesEdgeAttributeConfig,
|
|
14
20
|
useMeshEdgesEdgeAttributeConfigValues,
|
|
15
21
|
useMeshEdgesEdgeAttributeConfigWriter,
|
|
16
22
|
} from "./edge_config";
|
|
23
|
+
import type { UseMeshEdgesEdgeAttributeStyleReturn } from "./edge_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";
|
|
@@ -40,11 +47,11 @@ function useMeshEdgesEdgeAttributeStyle(): UseMeshEdgesEdgeAttributeStyleReturn
|
|
|
40
47
|
} = useMeshEdgesEdgeAttributeConfigValues();
|
|
41
48
|
const { mutateMeshEdgesEdgeStyle, setMeshEdgesEdgeAttributeStoredConfig } =
|
|
42
49
|
useMeshEdgesEdgeAttributeConfigWriter();
|
|
43
|
-
function meshEdgesEdgeAttributeTimeStep(
|
|
44
|
-
return attributeTimeStep(
|
|
50
|
+
function meshEdgesEdgeAttributeTimeStep(meshId: MeshId): AttributeTimeStep | undefined {
|
|
51
|
+
return attributeTimeStep(meshId, attributeNamesSchema.$id, meshEdgesEdgeAttribute(meshId).name);
|
|
45
52
|
}
|
|
46
53
|
async function setMeshEdgesEdgeAttribute(
|
|
47
|
-
|
|
54
|
+
meshId: MeshId,
|
|
48
55
|
{
|
|
49
56
|
name,
|
|
50
57
|
item,
|
|
@@ -54,11 +61,11 @@ function useMeshEdgesEdgeAttributeStyle(): UseMeshEdgesEdgeAttributeStyleReturn
|
|
|
54
61
|
no_data_color = DEFAULT_NO_DATA_COLOR,
|
|
55
62
|
}: ValidAttributeInput,
|
|
56
63
|
): Promise<unknown> {
|
|
57
|
-
await mutateMeshEdgesEdgeStyle(
|
|
64
|
+
await mutateMeshEdgesEdgeStyle(meshId, {
|
|
58
65
|
name,
|
|
59
66
|
item,
|
|
60
67
|
});
|
|
61
|
-
await setMeshEdgesEdgeAttributeStoredConfig(
|
|
68
|
+
await setMeshEdgesEdgeAttributeStoredConfig(meshId, name, item, {
|
|
62
69
|
minimum,
|
|
63
70
|
maximum,
|
|
64
71
|
colorMap,
|
|
@@ -67,8 +74,8 @@ function useMeshEdgesEdgeAttributeStyle(): UseMeshEdgesEdgeAttributeStyleReturn
|
|
|
67
74
|
const points = [...getRGBPointsFromPreset(colorMap)];
|
|
68
75
|
const schema = meshEdgesEdgeAttributeSchemas.attribute;
|
|
69
76
|
const params = {
|
|
70
|
-
id,
|
|
71
|
-
name: seriesArrayName(
|
|
77
|
+
id: meshId,
|
|
78
|
+
name: seriesArrayName(meshId, attributeNamesSchema.$id, name),
|
|
72
79
|
item,
|
|
73
80
|
points,
|
|
74
81
|
minimum,
|
|
@@ -80,10 +87,10 @@ function useMeshEdgesEdgeAttributeStyle(): UseMeshEdgesEdgeAttributeStyleReturn
|
|
|
80
87
|
params,
|
|
81
88
|
});
|
|
82
89
|
}
|
|
83
|
-
async function applyEdgeAttribute(
|
|
84
|
-
const name = meshEdgesEdgeAttributeName(
|
|
85
|
-
const item = meshEdgesEdgeAttributeItem(
|
|
86
|
-
const storedConfig = meshEdgesEdgeAttributeStoredConfig(
|
|
90
|
+
async function applyEdgeAttribute(meshId: MeshId): Promise<unknown> {
|
|
91
|
+
const name = meshEdgesEdgeAttributeName(meshId);
|
|
92
|
+
const item = meshEdgesEdgeAttributeItem(meshId);
|
|
93
|
+
const storedConfig = meshEdgesEdgeAttributeStoredConfig(meshId, name, item);
|
|
87
94
|
const attribute = {
|
|
88
95
|
name,
|
|
89
96
|
item,
|
|
@@ -92,70 +99,79 @@ function useMeshEdgesEdgeAttributeStyle(): UseMeshEdgesEdgeAttributeStyleReturn
|
|
|
92
99
|
colorMap: storedConfig.colorMap,
|
|
93
100
|
no_data_color: storedConfig.no_data_color,
|
|
94
101
|
};
|
|
95
|
-
if (
|
|
96
|
-
const result = await setMeshEdgesEdgeAttribute(
|
|
102
|
+
if (isAttributeValid(attribute)) {
|
|
103
|
+
const result = await setMeshEdgesEdgeAttribute(meshId, attribute);
|
|
97
104
|
return result;
|
|
98
105
|
}
|
|
99
106
|
return undefined;
|
|
100
107
|
}
|
|
101
|
-
async function setMeshEdgesEdgeAttributeName(
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
async function setMeshEdgesEdgeAttributeName(
|
|
109
|
+
meshId: MeshId,
|
|
110
|
+
name: AttributeName,
|
|
111
|
+
): Promise<unknown> {
|
|
112
|
+
const item = meshEdgesEdgeAttributeLastItem(meshId, name);
|
|
113
|
+
await mutateMeshEdgesEdgeStyle(meshId, {
|
|
104
114
|
name,
|
|
105
115
|
item,
|
|
106
116
|
});
|
|
107
|
-
return applyEdgeAttribute(
|
|
117
|
+
return applyEdgeAttribute(meshId);
|
|
108
118
|
}
|
|
109
|
-
async function setMeshEdgesEdgeAttributeItem(
|
|
110
|
-
|
|
119
|
+
async function setMeshEdgesEdgeAttributeItem(
|
|
120
|
+
meshId: MeshId,
|
|
121
|
+
item: AttributeItem,
|
|
122
|
+
): Promise<unknown> {
|
|
123
|
+
await mutateMeshEdgesEdgeStyle(meshId, {
|
|
111
124
|
item,
|
|
112
125
|
});
|
|
113
|
-
return applyEdgeAttribute(
|
|
126
|
+
return applyEdgeAttribute(meshId);
|
|
114
127
|
}
|
|
115
|
-
async function setMeshEdgesEdgeAttributeTimeStep(
|
|
116
|
-
|
|
128
|
+
async function setMeshEdgesEdgeAttributeTimeStep(
|
|
129
|
+
meshId: MeshId,
|
|
130
|
+
timeStep: AttributeTimeStep,
|
|
131
|
+
): Promise<unknown> {
|
|
132
|
+
const name = meshEdgesEdgeAttributeName(meshId);
|
|
117
133
|
if (name === undefined) {
|
|
118
134
|
return undefined;
|
|
119
135
|
}
|
|
120
|
-
await setAttributeTimeStep(
|
|
121
|
-
return applyEdgeAttribute(
|
|
136
|
+
await setAttributeTimeStep(meshId, attributeNamesSchema.$id, name, timeStep);
|
|
137
|
+
return applyEdgeAttribute(meshId);
|
|
122
138
|
}
|
|
123
139
|
async function setMeshEdgesEdgeAttributeRange(
|
|
124
|
-
|
|
125
|
-
minimum:
|
|
126
|
-
maximum:
|
|
140
|
+
meshId: MeshId,
|
|
141
|
+
minimum: AttributeRangeMinimum,
|
|
142
|
+
maximum: AttributeRangeMaximum,
|
|
127
143
|
): Promise<unknown> {
|
|
128
|
-
const name = meshEdgesEdgeAttributeName(
|
|
129
|
-
const item = meshEdgesEdgeAttributeItem(
|
|
130
|
-
await setMeshEdgesEdgeAttributeStoredConfig(
|
|
144
|
+
const name = meshEdgesEdgeAttributeName(meshId);
|
|
145
|
+
const item = meshEdgesEdgeAttributeItem(meshId);
|
|
146
|
+
await setMeshEdgesEdgeAttributeStoredConfig(meshId, name, item, {
|
|
131
147
|
minimum,
|
|
132
148
|
maximum,
|
|
133
149
|
});
|
|
134
|
-
return applyEdgeAttribute(
|
|
150
|
+
return applyEdgeAttribute(meshId);
|
|
135
151
|
}
|
|
136
152
|
async function setMeshEdgesEdgeAttributeColorMap(
|
|
137
|
-
|
|
138
|
-
colorMap:
|
|
153
|
+
meshId: MeshId,
|
|
154
|
+
colorMap: AttributeColorMap | undefined,
|
|
139
155
|
): Promise<unknown> {
|
|
140
|
-
const name = meshEdgesEdgeAttributeName(
|
|
141
|
-
const item = meshEdgesEdgeAttributeItem(
|
|
142
|
-
await setMeshEdgesEdgeAttributeStoredConfig(
|
|
156
|
+
const name = meshEdgesEdgeAttributeName(meshId);
|
|
157
|
+
const item = meshEdgesEdgeAttributeItem(meshId);
|
|
158
|
+
await setMeshEdgesEdgeAttributeStoredConfig(meshId, name, item, {
|
|
143
159
|
colorMap,
|
|
144
160
|
});
|
|
145
|
-
return applyEdgeAttribute(
|
|
161
|
+
return applyEdgeAttribute(meshId);
|
|
146
162
|
}
|
|
147
163
|
async function setMeshEdgesEdgeAttributeNoDataColor(
|
|
148
|
-
|
|
164
|
+
meshId: MeshId,
|
|
149
165
|
no_data_color: RGBAColor,
|
|
150
166
|
): Promise<unknown> {
|
|
151
|
-
const name = meshEdgesEdgeAttributeName(
|
|
152
|
-
const item = meshEdgesEdgeAttributeItem(
|
|
153
|
-
const storedConfig = meshEdgesEdgeAttributeStoredConfig(
|
|
154
|
-
await setMeshEdgesEdgeAttributeStoredConfig(
|
|
167
|
+
const name = meshEdgesEdgeAttributeName(meshId);
|
|
168
|
+
const item = meshEdgesEdgeAttributeItem(meshId);
|
|
169
|
+
const storedConfig = meshEdgesEdgeAttributeStoredConfig(meshId, name, item);
|
|
170
|
+
await setMeshEdgesEdgeAttributeStoredConfig(meshId, name, item, {
|
|
155
171
|
...storedConfig,
|
|
156
172
|
no_data_color,
|
|
157
173
|
});
|
|
158
|
-
return applyEdgeAttribute(
|
|
174
|
+
return applyEdgeAttribute(meshId);
|
|
159
175
|
}
|
|
160
176
|
return {
|
|
161
177
|
meshEdgesEdgeAttributeName,
|
|
@@ -175,4 +191,3 @@ function useMeshEdgesEdgeAttributeStyle(): UseMeshEdgesEdgeAttributeStyleReturn
|
|
|
175
191
|
};
|
|
176
192
|
}
|
|
177
193
|
export { useMeshEdgesEdgeAttributeStyle };
|
|
178
|
-
export { isMeshEdgesEdgeAttributeValid } from "./edge_attribute";
|
|
@@ -1,74 +1,50 @@
|
|
|
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 isMeshEdgesEdgeAttributeValid(input: AttributeInput): input is ValidAttributeInput {
|
|
35
|
-
return (
|
|
36
|
-
input.name !== undefined &&
|
|
37
|
-
input.item !== undefined &&
|
|
38
|
-
input.minimum !== undefined &&
|
|
39
|
-
input.maximum !== undefined &&
|
|
40
|
-
input.colorMap !== undefined
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
17
|
interface UseMeshEdgesEdgeAttributeStyleReturn {
|
|
45
|
-
meshEdgesEdgeAttributeName: (
|
|
46
|
-
meshEdgesEdgeAttributeItem: (
|
|
47
|
-
meshEdgesEdgeAttributeRange: (
|
|
48
|
-
meshEdgesEdgeAttributeTimeStep: (
|
|
49
|
-
setMeshEdgesEdgeAttributeTimeStep: (
|
|
50
|
-
|
|
18
|
+
meshEdgesEdgeAttributeName: (meshId: MeshId) => AttributeName | undefined;
|
|
19
|
+
meshEdgesEdgeAttributeItem: (meshId: MeshId) => AttributeItem;
|
|
20
|
+
meshEdgesEdgeAttributeRange: (meshId: MeshId) => AttributeRange;
|
|
21
|
+
meshEdgesEdgeAttributeTimeStep: (meshId: MeshId) => AttributeTimeStep | undefined;
|
|
22
|
+
setMeshEdgesEdgeAttributeTimeStep: (
|
|
23
|
+
meshId: MeshId,
|
|
24
|
+
timeStep: AttributeTimeStep,
|
|
25
|
+
) => Promise<unknown>;
|
|
26
|
+
meshEdgesEdgeAttributeColorMap: (meshId: MeshId) => AttributeColorMap | undefined;
|
|
51
27
|
meshEdgesEdgeAttributeStoredConfig: (
|
|
52
|
-
|
|
53
|
-
name:
|
|
54
|
-
item:
|
|
28
|
+
meshId: MeshId,
|
|
29
|
+
name: AttributeName | undefined,
|
|
30
|
+
item: AttributeItem | undefined,
|
|
55
31
|
) => AttributeStoredConfig;
|
|
56
|
-
setMeshEdgesEdgeAttribute: (
|
|
57
|
-
setMeshEdgesEdgeAttributeName: (
|
|
58
|
-
setMeshEdgesEdgeAttributeItem: (
|
|
32
|
+
setMeshEdgesEdgeAttribute: (meshId: MeshId, input: ValidAttributeInput) => Promise<unknown>;
|
|
33
|
+
setMeshEdgesEdgeAttributeName: (meshId: MeshId, name: AttributeName) => Promise<unknown>;
|
|
34
|
+
setMeshEdgesEdgeAttributeItem: (meshId: MeshId, item: AttributeItem) => Promise<unknown>;
|
|
59
35
|
setMeshEdgesEdgeAttributeRange: (
|
|
60
|
-
|
|
61
|
-
minimum:
|
|
62
|
-
maximum:
|
|
36
|
+
meshId: MeshId,
|
|
37
|
+
minimum: AttributeRangeMinimum,
|
|
38
|
+
maximum: AttributeRangeMaximum,
|
|
39
|
+
) => Promise<unknown>;
|
|
40
|
+
setMeshEdgesEdgeAttributeColorMap: (
|
|
41
|
+
meshId: MeshId,
|
|
42
|
+
colorMap: AttributeColorMap | undefined,
|
|
43
|
+
) => Promise<unknown>;
|
|
44
|
+
meshEdgesEdgeAttributeNoDataColor: (meshId: MeshId) => RGBAColor;
|
|
45
|
+
setMeshEdgesEdgeAttributeNoDataColor: (
|
|
46
|
+
meshId: MeshId,
|
|
47
|
+
no_data_color: RGBAColor,
|
|
63
48
|
) => Promise<unknown>;
|
|
64
|
-
setMeshEdgesEdgeAttributeColorMap: (id: string, colorMap: string | undefined) => Promise<unknown>;
|
|
65
|
-
meshEdgesEdgeAttributeNoDataColor: (id: string) => RGBAColor;
|
|
66
|
-
setMeshEdgesEdgeAttributeNoDataColor: (id: string, no_data_color: RGBAColor) => Promise<unknown>;
|
|
67
49
|
}
|
|
68
|
-
export {
|
|
69
|
-
export type {
|
|
70
|
-
AttributeStoredConfig,
|
|
71
|
-
AttributeState,
|
|
72
|
-
ValidAttributeInput,
|
|
73
|
-
UseMeshEdgesEdgeAttributeStyleReturn,
|
|
74
|
-
};
|
|
50
|
+
export type { UseMeshEdgesEdgeAttributeStyleReturn };
|
|
@@ -1,69 +1,75 @@
|
|
|
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 { useMeshEdgesCommonStyle } from "./common";
|
|
6
17
|
|
|
7
18
|
interface UseMeshEdgesEdgeAttributeConfigReturn {
|
|
8
|
-
meshEdgesEdgeAttribute: (
|
|
9
|
-
meshEdgesEdgeAttributeName: (
|
|
10
|
-
meshEdgesEdgeAttributeLastItem: (
|
|
11
|
-
meshEdgesEdgeAttributeItem: (
|
|
19
|
+
meshEdgesEdgeAttribute: (meshId: MeshId) => AttributeState;
|
|
20
|
+
meshEdgesEdgeAttributeName: (meshId: MeshId) => AttributeName | undefined;
|
|
21
|
+
meshEdgesEdgeAttributeLastItem: (meshId: MeshId, name: AttributeName | undefined) => number;
|
|
22
|
+
meshEdgesEdgeAttributeItem: (meshId: MeshId) => AttributeItem;
|
|
12
23
|
meshEdgesEdgeAttributeStoredConfig: (
|
|
13
|
-
|
|
14
|
-
name:
|
|
15
|
-
item:
|
|
24
|
+
meshId: MeshId,
|
|
25
|
+
name: AttributeName | undefined,
|
|
26
|
+
item: AttributeItem | undefined,
|
|
16
27
|
) => AttributeStoredConfig;
|
|
17
28
|
}
|
|
18
29
|
|
|
19
30
|
interface UseMeshEdgesEdgeAttributeConfigWriterReturn {
|
|
20
|
-
mutateMeshEdgesEdgeStyle: (
|
|
31
|
+
mutateMeshEdgesEdgeStyle: (meshId: MeshId, values: Record<string, unknown>) => Promise<string>;
|
|
21
32
|
setMeshEdgesEdgeAttributeStoredConfig: (
|
|
22
|
-
|
|
23
|
-
name:
|
|
24
|
-
item:
|
|
33
|
+
meshId: MeshId,
|
|
34
|
+
name: AttributeName | undefined,
|
|
35
|
+
item: AttributeItem | undefined,
|
|
25
36
|
config: Partial<AttributeStoredConfig>,
|
|
26
37
|
) => Promise<string>;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
function useMeshEdgesEdgeAttributeConfig(): UseMeshEdgesEdgeAttributeConfigReturn {
|
|
30
41
|
const meshEdgesCommonStyle = useMeshEdgesCommonStyle();
|
|
31
|
-
function meshEdgesEdgeAttribute(
|
|
42
|
+
function meshEdgesEdgeAttribute(meshId: MeshId): AttributeState {
|
|
32
43
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring.edge shape is defined by the data style schema.
|
|
33
|
-
return meshEdgesCommonStyle.meshEdgesColoring(
|
|
44
|
+
return meshEdgesCommonStyle.meshEdgesColoring(meshId).edge as AttributeState;
|
|
34
45
|
}
|
|
35
46
|
function meshEdgesEdgeAttributeStoredConfig(
|
|
36
|
-
|
|
37
|
-
name:
|
|
38
|
-
item:
|
|
47
|
+
meshId: MeshId,
|
|
48
|
+
name: AttributeName | undefined,
|
|
49
|
+
item: AttributeItem | undefined,
|
|
39
50
|
): AttributeStoredConfig {
|
|
40
|
-
const { storedConfigs } = meshEdgesEdgeAttribute(
|
|
51
|
+
const { storedConfigs } = meshEdgesEdgeAttribute(meshId);
|
|
41
52
|
const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
|
|
42
53
|
const itemConfig = item === undefined ? undefined : nameConfig?.[item];
|
|
43
54
|
if (itemConfig !== undefined) {
|
|
44
55
|
return itemConfig;
|
|
45
56
|
}
|
|
46
|
-
return
|
|
47
|
-
minimum: undefined,
|
|
48
|
-
maximum: undefined,
|
|
49
|
-
colorMap: undefined,
|
|
50
|
-
no_data_color: DEFAULT_NO_DATA_COLOR,
|
|
51
|
-
};
|
|
57
|
+
return defaultAttributeStoredConfig();
|
|
52
58
|
}
|
|
53
|
-
function meshEdgesEdgeAttributeName(
|
|
54
|
-
return meshEdgesEdgeAttribute(
|
|
59
|
+
function meshEdgesEdgeAttributeName(meshId: MeshId): AttributeName | undefined {
|
|
60
|
+
return meshEdgesEdgeAttribute(meshId).name;
|
|
55
61
|
}
|
|
56
|
-
function meshEdgesEdgeAttributeLastItem(
|
|
57
|
-
const { storedConfigs } = meshEdgesEdgeAttribute(
|
|
62
|
+
function meshEdgesEdgeAttributeLastItem(meshId: MeshId, name: AttributeName | undefined): number {
|
|
63
|
+
const { storedConfigs } = meshEdgesEdgeAttribute(meshId);
|
|
58
64
|
const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
|
|
59
65
|
if (nameConfig !== undefined) {
|
|
60
66
|
return nameConfig.lastItem;
|
|
61
67
|
}
|
|
62
68
|
return 0;
|
|
63
69
|
}
|
|
64
|
-
function meshEdgesEdgeAttributeItem(
|
|
65
|
-
const { item, name } = meshEdgesEdgeAttribute(
|
|
66
|
-
return item ?? meshEdgesEdgeAttributeLastItem(
|
|
70
|
+
function meshEdgesEdgeAttributeItem(meshId: MeshId): AttributeItem {
|
|
71
|
+
const { item, name } = meshEdgesEdgeAttribute(meshId);
|
|
72
|
+
return item ?? meshEdgesEdgeAttributeLastItem(meshId, name);
|
|
67
73
|
}
|
|
68
74
|
return {
|
|
69
75
|
meshEdgesEdgeAttribute,
|
|
@@ -75,9 +81,9 @@ function useMeshEdgesEdgeAttributeConfig(): UseMeshEdgesEdgeAttributeConfigRetur
|
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
interface UseMeshEdgesEdgeAttributeConfigValuesReturn {
|
|
78
|
-
meshEdgesEdgeAttributeRange: (
|
|
79
|
-
meshEdgesEdgeAttributeColorMap: (
|
|
80
|
-
meshEdgesEdgeAttributeNoDataColor: (
|
|
84
|
+
meshEdgesEdgeAttributeRange: (meshId: MeshId) => AttributeRange;
|
|
85
|
+
meshEdgesEdgeAttributeColorMap: (meshId: MeshId) => AttributeColorMap | undefined;
|
|
86
|
+
meshEdgesEdgeAttributeNoDataColor: (meshId: MeshId) => RGBAColor;
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
function useMeshEdgesEdgeAttributeConfigValues(): UseMeshEdgesEdgeAttributeConfigValuesReturn {
|
|
@@ -86,22 +92,22 @@ function useMeshEdgesEdgeAttributeConfigValues(): UseMeshEdgesEdgeAttributeConfi
|
|
|
86
92
|
meshEdgesEdgeAttributeItem,
|
|
87
93
|
meshEdgesEdgeAttributeStoredConfig,
|
|
88
94
|
} = useMeshEdgesEdgeAttributeConfig();
|
|
89
|
-
function meshEdgesEdgeAttributeRange(
|
|
90
|
-
const name = meshEdgesEdgeAttributeName(
|
|
91
|
-
const item = meshEdgesEdgeAttributeItem(
|
|
92
|
-
const storedConfig = meshEdgesEdgeAttributeStoredConfig(
|
|
95
|
+
function meshEdgesEdgeAttributeRange(meshId: MeshId): AttributeRange {
|
|
96
|
+
const name = meshEdgesEdgeAttributeName(meshId);
|
|
97
|
+
const item = meshEdgesEdgeAttributeItem(meshId);
|
|
98
|
+
const storedConfig = meshEdgesEdgeAttributeStoredConfig(meshId, name, item);
|
|
93
99
|
return [storedConfig.minimum, storedConfig.maximum];
|
|
94
100
|
}
|
|
95
|
-
function meshEdgesEdgeAttributeColorMap(
|
|
96
|
-
const name = meshEdgesEdgeAttributeName(
|
|
97
|
-
const item = meshEdgesEdgeAttributeItem(
|
|
98
|
-
const storedConfig = meshEdgesEdgeAttributeStoredConfig(
|
|
101
|
+
function meshEdgesEdgeAttributeColorMap(meshId: MeshId): AttributeColorMap | undefined {
|
|
102
|
+
const name = meshEdgesEdgeAttributeName(meshId);
|
|
103
|
+
const item = meshEdgesEdgeAttributeItem(meshId);
|
|
104
|
+
const storedConfig = meshEdgesEdgeAttributeStoredConfig(meshId, name, item);
|
|
99
105
|
return storedConfig.colorMap;
|
|
100
106
|
}
|
|
101
|
-
function meshEdgesEdgeAttributeNoDataColor(
|
|
102
|
-
const name = meshEdgesEdgeAttributeName(
|
|
103
|
-
const item = meshEdgesEdgeAttributeItem(
|
|
104
|
-
const storedConfig = meshEdgesEdgeAttributeStoredConfig(
|
|
107
|
+
function meshEdgesEdgeAttributeNoDataColor(meshId: MeshId): RGBAColor {
|
|
108
|
+
const name = meshEdgesEdgeAttributeName(meshId);
|
|
109
|
+
const item = meshEdgesEdgeAttributeItem(meshId);
|
|
110
|
+
const storedConfig = meshEdgesEdgeAttributeStoredConfig(meshId, name, item);
|
|
105
111
|
return storedConfig.no_data_color;
|
|
106
112
|
}
|
|
107
113
|
return {
|
|
@@ -114,10 +120,10 @@ function useMeshEdgesEdgeAttributeConfigValues(): UseMeshEdgesEdgeAttributeConfi
|
|
|
114
120
|
function useMeshEdgesEdgeAttributeConfigWriter(): UseMeshEdgesEdgeAttributeConfigWriterReturn {
|
|
115
121
|
const meshEdgesCommonStyle = useMeshEdgesCommonStyle();
|
|
116
122
|
async function mutateMeshEdgesEdgeStyle(
|
|
117
|
-
|
|
123
|
+
meshId: MeshId,
|
|
118
124
|
values: Record<string, unknown>,
|
|
119
125
|
): Promise<string> {
|
|
120
|
-
const result = await meshEdgesCommonStyle.mutateMeshEdgesStyle(
|
|
126
|
+
const result = await meshEdgesCommonStyle.mutateMeshEdgesStyle(meshId, {
|
|
121
127
|
coloring: {
|
|
122
128
|
edge: values,
|
|
123
129
|
},
|
|
@@ -125,12 +131,12 @@ function useMeshEdgesEdgeAttributeConfigWriter(): UseMeshEdgesEdgeAttributeConfi
|
|
|
125
131
|
return result;
|
|
126
132
|
}
|
|
127
133
|
async function setMeshEdgesEdgeAttributeStoredConfig(
|
|
128
|
-
|
|
129
|
-
name:
|
|
130
|
-
item:
|
|
134
|
+
meshId: MeshId,
|
|
135
|
+
name: AttributeName | undefined,
|
|
136
|
+
item: AttributeItem | undefined,
|
|
131
137
|
config: Partial<AttributeStoredConfig>,
|
|
132
138
|
): Promise<string> {
|
|
133
|
-
const result = await mutateMeshEdgesEdgeStyle(
|
|
139
|
+
const result = await mutateMeshEdgesEdgeStyle(meshId, {
|
|
134
140
|
storedConfigs: {
|
|
135
141
|
[name ?? ""]: {
|
|
136
142
|
lastItem: item,
|