@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,18 +1,14 @@
|
|
|
1
|
+
import type { LineId } from "@ogw_front/types/identifiers";
|
|
1
2
|
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
3
|
+
import type { ValidAttributeInput } from "@ogw_internal/stores/data_style/attribute_types";
|
|
2
4
|
|
|
3
5
|
interface ColorGroup {
|
|
4
6
|
color: RGBAColor | undefined;
|
|
5
|
-
lines_ids:
|
|
7
|
+
lines_ids: LineId[];
|
|
6
8
|
}
|
|
7
9
|
|
|
8
|
-
interface AttributeGroup {
|
|
9
|
-
|
|
10
|
-
item: number;
|
|
11
|
-
minimum: number;
|
|
12
|
-
maximum: number;
|
|
13
|
-
colorMap: string;
|
|
14
|
-
no_data_color?: RGBAColor;
|
|
15
|
-
lines_ids: string[];
|
|
10
|
+
interface AttributeGroup extends ValidAttributeInput {
|
|
11
|
+
lines_ids: LineId[];
|
|
16
12
|
}
|
|
17
13
|
|
|
18
14
|
export type { AttributeGroup, ColorGroup };
|
|
@@ -1,54 +1,62 @@
|
|
|
1
|
+
import type { LineId, ModelId } from "@ogw_front/types/identifiers";
|
|
1
2
|
import type { StyleValues } from "@ogw_internal/stores/data_style/types.js";
|
|
2
3
|
import merge from "lodash/merge";
|
|
3
4
|
import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
|
|
4
5
|
import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
|
|
5
6
|
|
|
6
7
|
export function useModelLinesCommonStyle(): {
|
|
7
|
-
modelLinesStyle: (
|
|
8
|
-
modelLineStyle: (
|
|
9
|
-
modelLineColoring: (
|
|
10
|
-
mutateModelLinesColoring: (
|
|
11
|
-
|
|
8
|
+
modelLinesStyle: (modelId: ModelId) => StyleValues;
|
|
9
|
+
modelLineStyle: (modelId: ModelId, line_id?: LineId) => StyleValues;
|
|
10
|
+
modelLineColoring: (modelId: ModelId, line_id?: LineId) => StyleValues;
|
|
11
|
+
mutateModelLinesColoring: (
|
|
12
|
+
modelId: ModelId,
|
|
13
|
+
lines_ids: LineId[],
|
|
14
|
+
values: StyleValues,
|
|
15
|
+
) => Promise<void>;
|
|
16
|
+
mutateModelLinesTypeColoring: (modelId: ModelId, values: StyleValues) => Promise<void>;
|
|
12
17
|
} {
|
|
13
18
|
const dataStyleState = useDataStyleState();
|
|
14
19
|
const modelCommonStyle = useModelCommonStyle();
|
|
15
20
|
|
|
16
|
-
function modelLinesStyle(
|
|
17
|
-
return dataStyleState.getStyle(
|
|
21
|
+
function modelLinesStyle(modelId: ModelId): StyleValues {
|
|
22
|
+
return dataStyleState.getStyle(modelId).lines ?? {};
|
|
18
23
|
}
|
|
19
24
|
|
|
20
|
-
function modelComponentTypeLinesStyle(
|
|
21
|
-
const defaultStyle = modelLinesStyle(
|
|
22
|
-
const typeStyle = dataStyleState.getModelComponentTypeStyle(
|
|
25
|
+
function modelComponentTypeLinesStyle(modelId: ModelId): StyleValues {
|
|
26
|
+
const defaultStyle = modelLinesStyle(modelId);
|
|
27
|
+
const typeStyle = dataStyleState.getModelComponentTypeStyle(modelId, "Line");
|
|
23
28
|
return merge({}, defaultStyle, typeStyle);
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
function modelLineStyle(
|
|
31
|
+
function modelLineStyle(modelId: ModelId, line_id?: LineId): StyleValues {
|
|
27
32
|
if (line_id === undefined) {
|
|
28
|
-
return modelComponentTypeLinesStyle(
|
|
33
|
+
return modelComponentTypeLinesStyle(modelId);
|
|
29
34
|
}
|
|
30
|
-
const typeStyle = modelComponentTypeLinesStyle(
|
|
31
|
-
const individualStyle = dataStyleState.getComponentStyle(
|
|
35
|
+
const typeStyle = modelComponentTypeLinesStyle(modelId);
|
|
36
|
+
const individualStyle = dataStyleState.getComponentStyle(modelId, line_id);
|
|
32
37
|
return merge({}, typeStyle, individualStyle);
|
|
33
38
|
}
|
|
34
39
|
|
|
35
|
-
function modelLineColoring(
|
|
40
|
+
function modelLineColoring(modelId: ModelId, line_id?: LineId): StyleValues {
|
|
36
41
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring shape is defined by the data style schema.
|
|
37
|
-
return modelLineStyle(
|
|
42
|
+
return modelLineStyle(modelId, line_id).coloring as StyleValues;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
async function mutateModelLinesColoring(
|
|
41
|
-
|
|
42
|
-
lines_ids:
|
|
46
|
+
modelId: ModelId,
|
|
47
|
+
lines_ids: LineId[],
|
|
43
48
|
values: StyleValues,
|
|
44
49
|
): Promise<void> {
|
|
45
|
-
await modelCommonStyle.mutateComponentStyles(
|
|
50
|
+
await modelCommonStyle.mutateComponentStyles(modelId, lines_ids, {
|
|
46
51
|
coloring: values,
|
|
47
52
|
});
|
|
48
53
|
}
|
|
49
54
|
|
|
50
|
-
async function mutateModelLinesTypeColoring(
|
|
51
|
-
|
|
55
|
+
async function mutateModelLinesTypeColoring(
|
|
56
|
+
modelId: ModelId,
|
|
57
|
+
values: StyleValues,
|
|
58
|
+
): Promise<void> {
|
|
59
|
+
await modelCommonStyle.mutateModelComponentTypeStyle(modelId, "Line", {
|
|
52
60
|
coloring: values,
|
|
53
61
|
});
|
|
54
62
|
}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
// oxlint-disable eslint/max-lines
|
|
2
|
+
import type {
|
|
3
|
+
AttributeColorMap,
|
|
4
|
+
AttributeItem,
|
|
5
|
+
AttributeName,
|
|
6
|
+
AttributeRange,
|
|
7
|
+
AttributeRangeMaximum,
|
|
8
|
+
AttributeRangeMinimum,
|
|
9
|
+
AttributeTimeStep,
|
|
10
|
+
} from "@ogw_front/types/attribute";
|
|
11
|
+
import type {
|
|
12
|
+
AttributeInput,
|
|
13
|
+
AttributeState,
|
|
14
|
+
AttributeStoredConfig,
|
|
15
|
+
ValidAttributeInput,
|
|
16
|
+
} from "@ogw_internal/stores/data_style/attribute_types";
|
|
2
17
|
import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
18
|
+
import type { LineId, ModelId } from "@ogw_front/types/identifiers";
|
|
19
|
+
import { defaultAttributeStoredConfig } from "@ogw_internal/stores/data_style/attribute_default";
|
|
20
|
+
import { isAttributeValid } from "@ogw_internal/stores/data_style/attribute_valid";
|
|
3
21
|
// Third party imports
|
|
4
22
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
5
23
|
|
|
@@ -16,97 +34,59 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
16
34
|
// Local constants
|
|
17
35
|
const attributeSchema = viewer_schemas.opengeodeweb_viewer.model.lines.attribute.edge.attribute;
|
|
18
36
|
|
|
19
|
-
interface AttributeStoredConfig {
|
|
20
|
-
minimum: number | undefined;
|
|
21
|
-
maximum: number | undefined;
|
|
22
|
-
colorMap: string | undefined;
|
|
23
|
-
no_data_color: RGBAColor;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface AttributeState {
|
|
27
|
-
name?: string;
|
|
28
|
-
item?: number;
|
|
29
|
-
storedConfigs?: Record<string, { lastItem: number } & Record<string, AttributeStoredConfig>>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface AttributeInput {
|
|
33
|
-
name: string | undefined;
|
|
34
|
-
item: number | undefined;
|
|
35
|
-
minimum: number | undefined;
|
|
36
|
-
maximum: number | undefined;
|
|
37
|
-
colorMap: string | undefined;
|
|
38
|
-
no_data_color?: RGBAColor;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface ValidAttributeInput {
|
|
42
|
-
name: string;
|
|
43
|
-
item: number;
|
|
44
|
-
minimum: number;
|
|
45
|
-
maximum: number;
|
|
46
|
-
colorMap: string;
|
|
47
|
-
no_data_color?: RGBAColor;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function isModelLinesEdgeAttributeValid(input: AttributeInput): input is ValidAttributeInput {
|
|
51
|
-
return (
|
|
52
|
-
input.name !== undefined &&
|
|
53
|
-
input.item !== undefined &&
|
|
54
|
-
input.minimum !== undefined &&
|
|
55
|
-
input.maximum !== undefined &&
|
|
56
|
-
input.colorMap !== undefined
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
37
|
interface UseModelLinesEdgeAttributeReturn {
|
|
61
|
-
modelLinesEdgeAttributeName: (modelId:
|
|
62
|
-
modelLinesEdgeAttributeItem: (modelId:
|
|
63
|
-
modelLinesEdgeAttributeRange: (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
38
|
+
modelLinesEdgeAttributeName: (modelId: ModelId, lineId?: LineId) => AttributeName | undefined;
|
|
39
|
+
modelLinesEdgeAttributeItem: (modelId: ModelId, lineId?: LineId) => AttributeItem;
|
|
40
|
+
modelLinesEdgeAttributeRange: (modelId: ModelId, lineId?: LineId) => AttributeRange;
|
|
41
|
+
modelLinesEdgeAttributeTimeStep: (
|
|
42
|
+
modelId: ModelId,
|
|
43
|
+
lineId?: LineId,
|
|
44
|
+
) => AttributeTimeStep | undefined;
|
|
68
45
|
setModelLinesEdgeAttributeTimeStep: (
|
|
69
|
-
modelId:
|
|
70
|
-
lineIds:
|
|
71
|
-
timeStep:
|
|
46
|
+
modelId: ModelId,
|
|
47
|
+
lineIds: LineId[],
|
|
48
|
+
timeStep: AttributeTimeStep,
|
|
72
49
|
) => Promise<void>;
|
|
73
|
-
modelLinesEdgeAttributeColorMap: (
|
|
50
|
+
modelLinesEdgeAttributeColorMap: (
|
|
51
|
+
modelId: ModelId,
|
|
52
|
+
lineId?: LineId,
|
|
53
|
+
) => AttributeColorMap | undefined;
|
|
74
54
|
modelLinesEdgeAttributeStoredConfig: (
|
|
75
|
-
modelId:
|
|
76
|
-
lineId:
|
|
77
|
-
name:
|
|
78
|
-
item:
|
|
55
|
+
modelId: ModelId,
|
|
56
|
+
lineId: LineId | undefined,
|
|
57
|
+
name: AttributeName | undefined,
|
|
58
|
+
item: AttributeItem | undefined,
|
|
79
59
|
) => AttributeStoredConfig;
|
|
80
60
|
setModelLinesEdgeAttribute: (
|
|
81
|
-
modelId:
|
|
82
|
-
lineIds:
|
|
61
|
+
modelId: ModelId,
|
|
62
|
+
lineIds: LineId[],
|
|
83
63
|
input: ValidAttributeInput,
|
|
84
64
|
) => Promise<unknown>;
|
|
85
65
|
setModelLinesEdgeAttributeName: (
|
|
86
|
-
modelId:
|
|
87
|
-
lineIds:
|
|
88
|
-
name:
|
|
66
|
+
modelId: ModelId,
|
|
67
|
+
lineIds: LineId[],
|
|
68
|
+
name: AttributeName,
|
|
89
69
|
) => Promise<unknown>;
|
|
90
70
|
setModelLinesEdgeAttributeItem: (
|
|
91
|
-
modelId:
|
|
92
|
-
lineIds:
|
|
93
|
-
item:
|
|
71
|
+
modelId: ModelId,
|
|
72
|
+
lineIds: LineId[],
|
|
73
|
+
item: AttributeItem,
|
|
94
74
|
) => Promise<unknown>;
|
|
95
75
|
setModelLinesEdgeAttributeRange: (
|
|
96
|
-
modelId:
|
|
97
|
-
lineIds:
|
|
98
|
-
minimum:
|
|
99
|
-
maximum:
|
|
76
|
+
modelId: ModelId,
|
|
77
|
+
lineIds: LineId[],
|
|
78
|
+
minimum: AttributeRangeMinimum,
|
|
79
|
+
maximum: AttributeRangeMaximum,
|
|
100
80
|
) => Promise<unknown>;
|
|
101
81
|
setModelLinesEdgeAttributeColorMap: (
|
|
102
|
-
modelId:
|
|
103
|
-
lineIds:
|
|
104
|
-
colorMap:
|
|
82
|
+
modelId: ModelId,
|
|
83
|
+
lineIds: LineId[],
|
|
84
|
+
colorMap: AttributeColorMap | undefined,
|
|
105
85
|
) => Promise<unknown>;
|
|
106
|
-
modelLinesEdgeAttributeNoDataColor: (modelId:
|
|
86
|
+
modelLinesEdgeAttributeNoDataColor: (modelId: ModelId, lineId?: LineId) => RGBAColor;
|
|
107
87
|
setModelLinesEdgeAttributeNoDataColor: (
|
|
108
|
-
modelId:
|
|
109
|
-
lineIds:
|
|
88
|
+
modelId: ModelId,
|
|
89
|
+
lineIds: LineId[],
|
|
110
90
|
no_data_color: RGBAColor,
|
|
111
91
|
) => Promise<unknown>;
|
|
112
92
|
}
|
|
@@ -122,9 +102,9 @@ type ModelLinesEdgeAttributeGetters = Pick<
|
|
|
122
102
|
| "modelLinesEdgeAttributeTimeStep"
|
|
123
103
|
> & {
|
|
124
104
|
modelLinesEdgeAttributeLastItem: (
|
|
125
|
-
modelId:
|
|
105
|
+
modelId: ModelId,
|
|
126
106
|
componentId: string | undefined,
|
|
127
|
-
name:
|
|
107
|
+
name: AttributeName | undefined,
|
|
128
108
|
) => number;
|
|
129
109
|
};
|
|
130
110
|
|
|
@@ -133,15 +113,15 @@ function useModelLinesEdgeAttributeGetters(
|
|
|
133
113
|
modelLinesCommonStyle: ReturnType<typeof useModelLinesCommonStyle>,
|
|
134
114
|
): ModelLinesEdgeAttributeGetters {
|
|
135
115
|
const { attributeTimeStep } = useAttributeTimeStepStyle();
|
|
136
|
-
function modelLinesEdgeAttribute(modelId:
|
|
116
|
+
function modelLinesEdgeAttribute(modelId: ModelId, lineId?: LineId): AttributeState {
|
|
137
117
|
// oxlint-disable-next-line no-unsafe-type-assertion -- coloring.edge shape is defined by the data style schema.
|
|
138
118
|
return modelLinesCommonStyle.modelLineColoring(modelId, lineId).edge as AttributeState;
|
|
139
119
|
}
|
|
140
120
|
function modelLinesEdgeAttributeStoredConfig(
|
|
141
|
-
modelId:
|
|
142
|
-
lineId:
|
|
143
|
-
name:
|
|
144
|
-
item:
|
|
121
|
+
modelId: ModelId,
|
|
122
|
+
lineId: LineId | undefined,
|
|
123
|
+
name: AttributeName | undefined,
|
|
124
|
+
item: AttributeItem | undefined,
|
|
145
125
|
): AttributeStoredConfig {
|
|
146
126
|
const { storedConfigs } = modelLinesEdgeAttribute(modelId, lineId);
|
|
147
127
|
const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
|
|
@@ -149,20 +129,18 @@ function useModelLinesEdgeAttributeGetters(
|
|
|
149
129
|
if (itemConfig !== undefined) {
|
|
150
130
|
return itemConfig;
|
|
151
131
|
}
|
|
152
|
-
return
|
|
153
|
-
minimum: undefined,
|
|
154
|
-
maximum: undefined,
|
|
155
|
-
colorMap: undefined,
|
|
156
|
-
no_data_color: DEFAULT_NO_DATA_COLOR,
|
|
157
|
-
};
|
|
132
|
+
return defaultAttributeStoredConfig();
|
|
158
133
|
}
|
|
159
|
-
function modelLinesEdgeAttributeName(
|
|
134
|
+
function modelLinesEdgeAttributeName(
|
|
135
|
+
modelId: ModelId,
|
|
136
|
+
lineId?: LineId,
|
|
137
|
+
): AttributeName | undefined {
|
|
160
138
|
return modelLinesEdgeAttribute(modelId, lineId).name;
|
|
161
139
|
}
|
|
162
140
|
function modelLinesEdgeAttributeLastItem(
|
|
163
|
-
modelId:
|
|
164
|
-
lineId:
|
|
165
|
-
name:
|
|
141
|
+
modelId: ModelId,
|
|
142
|
+
lineId: LineId | undefined,
|
|
143
|
+
name: AttributeName | undefined,
|
|
166
144
|
): number {
|
|
167
145
|
const { storedConfigs } = modelLinesEdgeAttribute(modelId, lineId);
|
|
168
146
|
const nameConfig = name === undefined ? undefined : storedConfigs?.[name];
|
|
@@ -171,35 +149,38 @@ function useModelLinesEdgeAttributeGetters(
|
|
|
171
149
|
}
|
|
172
150
|
return 0;
|
|
173
151
|
}
|
|
174
|
-
function modelLinesEdgeAttributeItem(modelId:
|
|
152
|
+
function modelLinesEdgeAttributeItem(modelId: ModelId, lineId?: LineId): AttributeItem {
|
|
175
153
|
const edgeAttribute = modelLinesEdgeAttribute(modelId, lineId);
|
|
176
154
|
return (
|
|
177
155
|
edgeAttribute.item ?? modelLinesEdgeAttributeLastItem(modelId, lineId, edgeAttribute.name)
|
|
178
156
|
);
|
|
179
157
|
}
|
|
180
|
-
function modelLinesEdgeAttributeRange(
|
|
181
|
-
modelId: string,
|
|
182
|
-
lineId?: string,
|
|
183
|
-
): [number | undefined, number | undefined] {
|
|
158
|
+
function modelLinesEdgeAttributeRange(modelId: ModelId, lineId?: LineId): AttributeRange {
|
|
184
159
|
const name = modelLinesEdgeAttributeName(modelId, lineId);
|
|
185
160
|
const item = modelLinesEdgeAttributeItem(modelId, lineId);
|
|
186
161
|
const storedConfig = modelLinesEdgeAttributeStoredConfig(modelId, lineId, name, item);
|
|
187
162
|
const { minimum, maximum } = storedConfig;
|
|
188
163
|
return [minimum, maximum];
|
|
189
164
|
}
|
|
190
|
-
function modelLinesEdgeAttributeColorMap(
|
|
165
|
+
function modelLinesEdgeAttributeColorMap(
|
|
166
|
+
modelId: ModelId,
|
|
167
|
+
lineId?: LineId,
|
|
168
|
+
): AttributeColorMap | undefined {
|
|
191
169
|
const name = modelLinesEdgeAttributeName(modelId, lineId);
|
|
192
170
|
const item = modelLinesEdgeAttributeItem(modelId, lineId);
|
|
193
171
|
const storedConfig = modelLinesEdgeAttributeStoredConfig(modelId, lineId, name, item);
|
|
194
172
|
return storedConfig.colorMap;
|
|
195
173
|
}
|
|
196
|
-
function modelLinesEdgeAttributeNoDataColor(modelId:
|
|
174
|
+
function modelLinesEdgeAttributeNoDataColor(modelId: ModelId, lineId?: LineId): RGBAColor {
|
|
197
175
|
const name = modelLinesEdgeAttributeName(modelId, lineId);
|
|
198
176
|
const item = modelLinesEdgeAttributeItem(modelId, lineId);
|
|
199
177
|
const storedConfig = modelLinesEdgeAttributeStoredConfig(modelId, lineId, name, item);
|
|
200
178
|
return storedConfig.no_data_color;
|
|
201
179
|
}
|
|
202
|
-
function modelLinesEdgeAttributeTimeStep(
|
|
180
|
+
function modelLinesEdgeAttributeTimeStep(
|
|
181
|
+
modelId: ModelId,
|
|
182
|
+
lineId?: LineId,
|
|
183
|
+
): AttributeTimeStep | undefined {
|
|
203
184
|
return attributeTimeStep(
|
|
204
185
|
modelId,
|
|
205
186
|
attributeSchema.$id,
|
|
@@ -235,8 +216,8 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
235
216
|
} = useModelLinesEdgeAttributeGetters(modelLinesCommonStyle);
|
|
236
217
|
const viewerStore = useViewerStore();
|
|
237
218
|
async function mutateModelLinesEdgeStyle(
|
|
238
|
-
modelId:
|
|
239
|
-
lineIds:
|
|
219
|
+
modelId: ModelId,
|
|
220
|
+
lineIds: LineId[],
|
|
240
221
|
values: Record<string, unknown>,
|
|
241
222
|
): Promise<void> {
|
|
242
223
|
const tasks: Promise<void>[] = [
|
|
@@ -255,10 +236,10 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
255
236
|
await Promise.all(tasks);
|
|
256
237
|
}
|
|
257
238
|
async function setModelLinesEdgeAttributeStoredConfig(
|
|
258
|
-
modelId:
|
|
259
|
-
lineIds:
|
|
260
|
-
name:
|
|
261
|
-
item:
|
|
239
|
+
modelId: ModelId,
|
|
240
|
+
lineIds: LineId[],
|
|
241
|
+
name: AttributeName | undefined,
|
|
242
|
+
item: AttributeItem | undefined,
|
|
262
243
|
config: Partial<AttributeStoredConfig>,
|
|
263
244
|
): Promise<void> {
|
|
264
245
|
if (name === undefined || item === undefined) {
|
|
@@ -274,8 +255,8 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
274
255
|
});
|
|
275
256
|
}
|
|
276
257
|
async function setModelLinesEdgeAttribute(
|
|
277
|
-
modelId:
|
|
278
|
-
lineIds:
|
|
258
|
+
modelId: ModelId,
|
|
259
|
+
lineIds: LineId[],
|
|
279
260
|
{
|
|
280
261
|
name,
|
|
281
262
|
item,
|
|
@@ -312,7 +293,7 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
312
293
|
params,
|
|
313
294
|
});
|
|
314
295
|
}
|
|
315
|
-
async function applyEdgeAttribute(modelId:
|
|
296
|
+
async function applyEdgeAttribute(modelId: ModelId, lineIds: LineId[]): Promise<void> {
|
|
316
297
|
const name = modelLinesEdgeAttributeName(modelId, lineIds[0]);
|
|
317
298
|
const item = modelLinesEdgeAttributeItem(modelId, lineIds[0]);
|
|
318
299
|
const storedConfig = modelLinesEdgeAttributeStoredConfig(modelId, lineIds[0], name, item);
|
|
@@ -324,14 +305,14 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
324
305
|
colorMap: storedConfig.colorMap,
|
|
325
306
|
no_data_color: storedConfig.no_data_color,
|
|
326
307
|
};
|
|
327
|
-
if (
|
|
308
|
+
if (isAttributeValid(attribute)) {
|
|
328
309
|
await setModelLinesEdgeAttribute(modelId, lineIds, attribute);
|
|
329
310
|
}
|
|
330
311
|
}
|
|
331
312
|
async function setModelLinesEdgeAttributeName(
|
|
332
|
-
modelId:
|
|
333
|
-
lineIds:
|
|
334
|
-
name:
|
|
313
|
+
modelId: ModelId,
|
|
314
|
+
lineIds: LineId[],
|
|
315
|
+
name: AttributeName,
|
|
335
316
|
): Promise<unknown> {
|
|
336
317
|
const item = modelLinesEdgeAttributeLastItem(modelId, lineIds[0], name);
|
|
337
318
|
await mutateModelLinesEdgeStyle(modelId, lineIds, {
|
|
@@ -341,9 +322,9 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
341
322
|
return applyEdgeAttribute(modelId, lineIds);
|
|
342
323
|
}
|
|
343
324
|
async function setModelLinesEdgeAttributeItem(
|
|
344
|
-
modelId:
|
|
345
|
-
lineIds:
|
|
346
|
-
item:
|
|
325
|
+
modelId: ModelId,
|
|
326
|
+
lineIds: LineId[],
|
|
327
|
+
item: AttributeItem,
|
|
347
328
|
): Promise<unknown> {
|
|
348
329
|
await mutateModelLinesEdgeStyle(modelId, lineIds, {
|
|
349
330
|
item,
|
|
@@ -351,9 +332,9 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
351
332
|
return applyEdgeAttribute(modelId, lineIds);
|
|
352
333
|
}
|
|
353
334
|
async function setModelLinesEdgeAttributeTimeStep(
|
|
354
|
-
modelId:
|
|
355
|
-
lineIds:
|
|
356
|
-
timeStep:
|
|
335
|
+
modelId: ModelId,
|
|
336
|
+
lineIds: LineId[],
|
|
337
|
+
timeStep: AttributeTimeStep,
|
|
357
338
|
): Promise<void> {
|
|
358
339
|
const name = modelLinesEdgeAttributeName(modelId, lineIds[0]);
|
|
359
340
|
if (name === undefined) {
|
|
@@ -386,10 +367,10 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
386
367
|
]);
|
|
387
368
|
}
|
|
388
369
|
async function setModelLinesEdgeAttributeRange(
|
|
389
|
-
modelId:
|
|
390
|
-
lineIds:
|
|
391
|
-
minimum:
|
|
392
|
-
maximum:
|
|
370
|
+
modelId: ModelId,
|
|
371
|
+
lineIds: LineId[],
|
|
372
|
+
minimum: AttributeRangeMinimum,
|
|
373
|
+
maximum: AttributeRangeMaximum,
|
|
393
374
|
): Promise<unknown> {
|
|
394
375
|
const name = modelLinesEdgeAttributeName(modelId, lineIds[0]);
|
|
395
376
|
const item = modelLinesEdgeAttributeItem(modelId, lineIds[0]);
|
|
@@ -400,9 +381,9 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
400
381
|
return applyEdgeAttribute(modelId, lineIds);
|
|
401
382
|
}
|
|
402
383
|
async function setModelLinesEdgeAttributeColorMap(
|
|
403
|
-
modelId:
|
|
404
|
-
lineIds:
|
|
405
|
-
colorMap:
|
|
384
|
+
modelId: ModelId,
|
|
385
|
+
lineIds: LineId[],
|
|
386
|
+
colorMap: AttributeColorMap | undefined,
|
|
406
387
|
): Promise<unknown> {
|
|
407
388
|
const name = modelLinesEdgeAttributeName(modelId, lineIds[0]);
|
|
408
389
|
const item = modelLinesEdgeAttributeItem(modelId, lineIds[0]);
|
|
@@ -412,8 +393,8 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
412
393
|
return applyEdgeAttribute(modelId, lineIds);
|
|
413
394
|
}
|
|
414
395
|
async function setModelLinesEdgeAttributeNoDataColor(
|
|
415
|
-
modelId:
|
|
416
|
-
lineIds:
|
|
396
|
+
modelId: ModelId,
|
|
397
|
+
lineIds: LineId[],
|
|
417
398
|
no_data_color: RGBAColor,
|
|
418
399
|
): Promise<unknown> {
|
|
419
400
|
const name = modelLinesEdgeAttributeName(modelId, lineIds[0]);
|
|
@@ -442,4 +423,4 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
442
423
|
setModelLinesEdgeAttributeNoDataColor,
|
|
443
424
|
};
|
|
444
425
|
}
|
|
445
|
-
export {
|
|
426
|
+
export { useModelLinesEdgeAttribute };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LineId, ModelId } from "@ogw_front/types/identifiers";
|
|
1
2
|
import {
|
|
2
3
|
applyModelLinesConstantColoring,
|
|
3
4
|
applyModelLinesEdgeColoring,
|
|
@@ -22,8 +23,8 @@ export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle
|
|
|
22
23
|
ReturnType<typeof useModelLinesPointsStyle> &
|
|
23
24
|
ReturnType<typeof useModelLinesVertexAttribute> &
|
|
24
25
|
ReturnType<typeof useModelLinesEdgeAttribute> & {
|
|
25
|
-
applyModelLinesStyle: (modelId:
|
|
26
|
-
setModelLinesDefaultStyle: (
|
|
26
|
+
applyModelLinesStyle: (modelId: ModelId) => Promise<void>;
|
|
27
|
+
setModelLinesDefaultStyle: (modelId: ModelId) => Promise<void>;
|
|
27
28
|
} {
|
|
28
29
|
const dataStore = useDataStore();
|
|
29
30
|
const modelCommonStyle = useModelLinesCommonStyle();
|
|
@@ -34,8 +35,8 @@ export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle
|
|
|
34
35
|
const modelLinesPointsStyle = useModelLinesPointsStyle();
|
|
35
36
|
|
|
36
37
|
async function applyModelLinesVisibilityStyle(
|
|
37
|
-
modelId:
|
|
38
|
-
lines_ids:
|
|
38
|
+
modelId: ModelId,
|
|
39
|
+
lines_ids: LineId[],
|
|
39
40
|
): Promise<void> {
|
|
40
41
|
const visibilityGroups: Record<string, string[]> = {};
|
|
41
42
|
for (const line_id of lines_ids) {
|
|
@@ -57,8 +58,8 @@ export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle
|
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
async function applyModelLinesColoringStyle(
|
|
60
|
-
modelId:
|
|
61
|
-
lines_ids:
|
|
61
|
+
modelId: ModelId,
|
|
62
|
+
lines_ids: LineId[],
|
|
62
63
|
): Promise<unknown[]> {
|
|
63
64
|
const activeColoringGroups: Record<string, string[]> = {};
|
|
64
65
|
for (const line_id of lines_ids) {
|
|
@@ -92,7 +93,7 @@ export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle
|
|
|
92
93
|
return results;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
async function applyModelLinesStyle(modelId:
|
|
96
|
+
async function applyModelLinesStyle(modelId: ModelId): Promise<void> {
|
|
96
97
|
const lines_ids = await dataStore.getLinesGeodeIds(modelId);
|
|
97
98
|
if (lines_ids.length === 0) {
|
|
98
99
|
return;
|