@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,7 +1,12 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AttributeColorMap,
|
|
3
|
+
AttributeTimeStep,
|
|
4
|
+
ValidAttributeRange,
|
|
5
|
+
} from "@ogw_front/types/attribute";
|
|
6
|
+
import { type AttributeInfo, getAttributeRange } from "@ogw_front/utils/attributes";
|
|
1
7
|
import { type AttributeSchemas, fetchAttributeRange } from "@ogw_front/utils/attribute_range";
|
|
2
8
|
import type { JsonRpcSchema } from "@ogw_shared/utils/types";
|
|
3
9
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
4
|
-
import { getAttributeRange } from "@ogw_front/utils/attributes";
|
|
5
10
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
6
11
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
7
12
|
|
|
@@ -15,16 +20,16 @@ interface AttributeColoring {
|
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
interface AttributeNamesResponse {
|
|
18
|
-
attributes:
|
|
23
|
+
attributes: Pick<AttributeInfo, "attribute_name" | "time_steps">[];
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
interface AttributeColoringStyle {
|
|
22
|
-
currentColormap: ComputedRef<
|
|
23
|
-
currentRange: WritableComputedRef<
|
|
24
|
-
applyGlobalColormap: (colorMap:
|
|
27
|
+
currentColormap: ComputedRef<AttributeColorMap>;
|
|
28
|
+
currentRange: WritableComputedRef<Readonly<ValidAttributeRange>>;
|
|
29
|
+
applyGlobalColormap: (colorMap: AttributeColorMap) => Promise<void>;
|
|
25
30
|
resetGlobalRange: () => Promise<void>;
|
|
26
31
|
currentTimeSteps: Ref<number[]>;
|
|
27
|
-
currentTimeStep: WritableComputedRef<
|
|
32
|
+
currentTimeStep: WritableComputedRef<AttributeTimeStep>;
|
|
28
33
|
loadTimeSteps: () => Promise<void>;
|
|
29
34
|
}
|
|
30
35
|
|
|
@@ -76,7 +81,7 @@ function useAttributeColoringStyle(colorings: Ref<AttributeColoring[]>): Attribu
|
|
|
76
81
|
await hybridViewerStore.remoteRender();
|
|
77
82
|
}
|
|
78
83
|
|
|
79
|
-
const currentColormap = computed(():
|
|
84
|
+
const currentColormap = computed((): AttributeColorMap => {
|
|
80
85
|
const [coloring] = colorings.value;
|
|
81
86
|
if (!coloring) {
|
|
82
87
|
return "batlow";
|
|
@@ -84,12 +89,12 @@ function useAttributeColoringStyle(colorings: Ref<AttributeColoring[]>): Attribu
|
|
|
84
89
|
return String(coloring.read("ColorMap"));
|
|
85
90
|
});
|
|
86
91
|
|
|
87
|
-
async function applyGlobalColormap(colorMap:
|
|
92
|
+
async function applyGlobalColormap(colorMap: AttributeColorMap): Promise<void> {
|
|
88
93
|
await writeAll("ColorMap", colorMap);
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
const currentRange = computed<
|
|
92
|
-
get():
|
|
96
|
+
const currentRange = computed<Readonly<ValidAttributeRange>>({
|
|
97
|
+
get(): Readonly<ValidAttributeRange> {
|
|
93
98
|
const [coloring] = colorings.value;
|
|
94
99
|
if (!coloring) {
|
|
95
100
|
return [0, 1];
|
|
@@ -99,7 +104,7 @@ function useAttributeColoringStyle(colorings: Ref<AttributeColoring[]>): Attribu
|
|
|
99
104
|
return [minimum, maximum];
|
|
100
105
|
},
|
|
101
106
|
// Vue's WritableComputedOptions setter is strictly `(v: T) => void`: the async write is delegated.
|
|
102
|
-
set: (range:
|
|
107
|
+
set: (range: Readonly<ValidAttributeRange>): void => {
|
|
103
108
|
/* oxlint-disable-next-line promise/prefer-await-to-then -- setter cannot be async; see comment above. */
|
|
104
109
|
writeAll("Range", range[0], range[1]).catch(() => undefined);
|
|
105
110
|
},
|
|
@@ -152,7 +157,7 @@ function useAttributeColoringStyle(colorings: Ref<AttributeColoring[]>): Attribu
|
|
|
152
157
|
}
|
|
153
158
|
}
|
|
154
159
|
|
|
155
|
-
const currentTimeStep = computed<
|
|
160
|
+
const currentTimeStep = computed<AttributeTimeStep>({
|
|
156
161
|
get(): number {
|
|
157
162
|
const coloring = temporalColoring.value;
|
|
158
163
|
if (!coloring) {
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import type { AttributeRangeInfo, AttributeSchemas } from "@ogw_front/utils/attribute_range";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AttributeTimeStep, ValidAttributeRange } from "@ogw_front/types/attribute";
|
|
3
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
3
4
|
import { getAttributeRange } from "@ogw_front/utils/attributes";
|
|
4
5
|
|
|
5
|
-
interface AttributeInfo {
|
|
6
|
-
attribute_name: string;
|
|
7
|
-
nb_items: number;
|
|
8
|
-
time_steps?: number[];
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
6
|
// The minimum and maximum of an attribute range: each one is clamped by the other
|
|
13
7
|
function useAttributeRangeBounds(attributeRange: Ref<(number | undefined)[]>): {
|
|
14
8
|
rangeMin: WritableComputedRef<number | undefined>;
|
|
@@ -57,8 +51,8 @@ function attributeItemOptions(itemCount: number): { title: string; value: number
|
|
|
57
51
|
function attributeRangesPerTarget(
|
|
58
52
|
rangesPerTarget: ReadonlyMap<string, AttributeRangeInfo>,
|
|
59
53
|
item: number,
|
|
60
|
-
): Map<string,
|
|
61
|
-
const ranges = new Map<string,
|
|
54
|
+
): Map<string, ValidAttributeRange> {
|
|
55
|
+
const ranges = new Map<string, ValidAttributeRange>();
|
|
62
56
|
for (const [targetId, range] of rangesPerTarget) {
|
|
63
57
|
const { min, max } = getAttributeRange(range, item);
|
|
64
58
|
ranges.set(targetId, [min, max]);
|
|
@@ -70,7 +64,7 @@ function attributeRangesPerTarget(
|
|
|
70
64
|
function useSeriesTimeStepCommit(
|
|
71
65
|
timeSteps: ComputedRef<number[]>,
|
|
72
66
|
seriesName: () => string | undefined,
|
|
73
|
-
attributeTimeStep: Readonly<Ref<
|
|
67
|
+
attributeTimeStep: Readonly<Ref<AttributeTimeStep | undefined>>,
|
|
74
68
|
resetTimeStep: () => void,
|
|
75
69
|
): () => void {
|
|
76
70
|
let committedSeries: string | undefined = undefined;
|
|
@@ -102,21 +96,21 @@ interface AttributeRequestParams {
|
|
|
102
96
|
// Params of the "names" request, or undefined when the schema needs components and none is selected
|
|
103
97
|
function attributeRequestParams(
|
|
104
98
|
schemas: AttributeSchemas,
|
|
105
|
-
|
|
99
|
+
dataId: DataId,
|
|
106
100
|
componentIds: string[] | undefined,
|
|
107
101
|
): AttributeRequestParams | undefined {
|
|
108
102
|
const { properties } = schemas.names;
|
|
109
103
|
if (typeof properties !== "object" || properties === null || !("component_ids" in properties)) {
|
|
110
|
-
return { id };
|
|
104
|
+
return { id: dataId };
|
|
111
105
|
}
|
|
112
106
|
if (!Array.isArray(componentIds) || componentIds.length === 0) {
|
|
113
107
|
return undefined;
|
|
114
108
|
}
|
|
115
|
-
return { id, component_ids: componentIds };
|
|
109
|
+
return { id: dataId, component_ids: componentIds };
|
|
116
110
|
}
|
|
117
111
|
|
|
112
|
+
export type { AttributeInfo } from "@ogw_front/utils/attributes";
|
|
118
113
|
export {
|
|
119
|
-
type AttributeInfo,
|
|
120
114
|
type AttributeRequestParams,
|
|
121
115
|
attributeItemOptions,
|
|
122
116
|
attributeRequestParams,
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AttributeRangeMaximum,
|
|
3
|
+
AttributeRangeMinimum,
|
|
4
|
+
ValidAttributeRange,
|
|
5
|
+
} from "@ogw_front/types/attribute";
|
|
1
6
|
import {
|
|
2
7
|
type ComputedRef,
|
|
3
8
|
type InjectionKey,
|
|
@@ -7,11 +12,11 @@ import {
|
|
|
7
12
|
provide,
|
|
8
13
|
toValue,
|
|
9
14
|
} from "vue";
|
|
15
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
10
16
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
11
17
|
import { useTreeviewStore } from "@ogw_front/stores/treeview";
|
|
12
18
|
|
|
13
|
-
type
|
|
14
|
-
type RangesPerData = ReadonlyMap<string, AttributeRange>;
|
|
19
|
+
type RangesPerData = ReadonlyMap<string, ValidAttributeRange>;
|
|
15
20
|
|
|
16
21
|
const BATCH_GROUP_KEY: InjectionKey<ComputedRef<string[]>> = Symbol("batch_group");
|
|
17
22
|
|
|
@@ -23,18 +28,22 @@ function injectBatchGroup(): ComputedRef<string[]> {
|
|
|
23
28
|
return inject(BATCH_GROUP_KEY, () => computed(() => []), true);
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
function groupTargetsOf(targetIds: string[],
|
|
27
|
-
return targetIds.includes(
|
|
31
|
+
function groupTargetsOf(targetIds: string[], dataId: DataId): string[] | undefined {
|
|
32
|
+
return targetIds.includes(dataId) ? targetIds : undefined;
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
function useBatchGroup(
|
|
35
|
+
function useBatchGroup(dataId: MaybeRefOrGetter<DataId>): ComputedRef<string[] | undefined> {
|
|
31
36
|
const group = injectBatchGroup();
|
|
32
|
-
return computed(() => groupTargetsOf(group.value, toValue(
|
|
37
|
+
return computed(() => groupTargetsOf(group.value, toValue(dataId)));
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
async function applyRangesPerData(
|
|
36
41
|
ranges: RangesPerData,
|
|
37
|
-
setRange: (
|
|
42
|
+
setRange: (
|
|
43
|
+
dataId: DataId,
|
|
44
|
+
minimum: AttributeRangeMinimum,
|
|
45
|
+
maximum: AttributeRangeMaximum,
|
|
46
|
+
) => unknown,
|
|
38
47
|
): Promise<void> {
|
|
39
48
|
await Promise.all(
|
|
40
49
|
[...ranges].map(async ([targetId, [minimum, maximum]]) => {
|
|
@@ -45,7 +54,7 @@ async function applyRangesPerData(
|
|
|
45
54
|
|
|
46
55
|
async function applyActionOn(
|
|
47
56
|
targets: readonly string[],
|
|
48
|
-
action: (
|
|
57
|
+
action: (dataId: DataId) => Promise<unknown>,
|
|
49
58
|
): Promise<void> {
|
|
50
59
|
await Promise.all(
|
|
51
60
|
targets.map(async (targetId) => {
|
|
@@ -60,23 +69,23 @@ function useBatchStyle(): { applyBatchStyle: typeof applyBatchStyle } {
|
|
|
60
69
|
const group = injectBatchGroup();
|
|
61
70
|
|
|
62
71
|
async function applyBatchStyle(
|
|
63
|
-
|
|
64
|
-
action: (
|
|
72
|
+
dataId: DataId,
|
|
73
|
+
action: (dataId: DataId) => Promise<unknown>,
|
|
65
74
|
): Promise<void> {
|
|
66
|
-
const groupTargets = groupTargetsOf(group.value,
|
|
75
|
+
const groupTargets = groupTargetsOf(group.value, dataId);
|
|
67
76
|
if (groupTargets) {
|
|
68
77
|
await applyActionOn(groupTargets, action);
|
|
69
78
|
return;
|
|
70
79
|
}
|
|
71
80
|
|
|
72
|
-
const isActive = treeviewStore.activeItems.includes(
|
|
81
|
+
const isActive = treeviewStore.activeItems.includes(dataId);
|
|
73
82
|
if (!isActive || treeviewStore.activeItems.length <= 1) {
|
|
74
|
-
await action(
|
|
83
|
+
await action(dataId);
|
|
75
84
|
return;
|
|
76
85
|
}
|
|
77
86
|
|
|
78
87
|
try {
|
|
79
|
-
const currentItem = await dataStore.item(
|
|
88
|
+
const currentItem = await dataStore.item(dataId);
|
|
80
89
|
const targetType = currentItem.geode_object_type;
|
|
81
90
|
|
|
82
91
|
const promises = treeviewStore.activeItems.map(async (selectedId) => {
|
|
@@ -92,7 +101,7 @@ function useBatchStyle(): { applyBatchStyle: typeof applyBatchStyle } {
|
|
|
92
101
|
|
|
93
102
|
await Promise.all(promises);
|
|
94
103
|
} catch {
|
|
95
|
-
await action(
|
|
104
|
+
await action(dataId);
|
|
96
105
|
}
|
|
97
106
|
}
|
|
98
107
|
|
|
@@ -100,4 +109,4 @@ function useBatchStyle(): { applyBatchStyle: typeof applyBatchStyle } {
|
|
|
100
109
|
}
|
|
101
110
|
|
|
102
111
|
export { BATCH_GROUP_KEY, applyRangesPerData, provideBatchGroup, useBatchGroup, useBatchStyle };
|
|
103
|
-
export type {
|
|
112
|
+
export type { RangesPerData };
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { type MaybeRefOrGetter, type WritableComputedRef, computed, toValue } from "vue";
|
|
2
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
2
3
|
import { useBatchStyle } from "@ogw_front/composables/batch_style";
|
|
3
4
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
4
5
|
|
|
5
6
|
// A style model applied to the whole batch of the data, then rendered
|
|
6
7
|
function useBatchStyleModel<Value>(
|
|
7
|
-
|
|
8
|
-
getter: (
|
|
9
|
-
setter: (
|
|
8
|
+
dataId: MaybeRefOrGetter<DataId>,
|
|
9
|
+
getter: (dataId: DataId) => Value | undefined,
|
|
10
|
+
setter: (dataId: DataId, value: Value) => Promise<unknown>,
|
|
10
11
|
): WritableComputedRef<Value | undefined> {
|
|
11
12
|
const hybridViewerStore = useHybridViewerStore();
|
|
12
13
|
const { applyBatchStyle } = useBatchStyle();
|
|
13
14
|
|
|
14
15
|
async function applyValue(value: Value): Promise<void> {
|
|
15
|
-
await applyBatchStyle(toValue(
|
|
16
|
+
await applyBatchStyle(toValue(dataId), async (targetId: string) => {
|
|
16
17
|
await setter(targetId, value);
|
|
17
18
|
});
|
|
18
19
|
await hybridViewerStore.remoteRender();
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
return computed<Value | undefined>({
|
|
22
|
-
get: () => getter(toValue(
|
|
23
|
+
get: () => getter(toValue(dataId)),
|
|
23
24
|
// Vue's WritableComputedOptions setter is strictly `(v: T) => void`: the async write is delegated.
|
|
24
25
|
set: (newValue: Value | undefined): void => {
|
|
25
26
|
if (newValue === undefined) {
|
|
@@ -14,20 +14,17 @@ import {
|
|
|
14
14
|
type vtkWidgetManager as WidgetManagerInstance,
|
|
15
15
|
newInstance as vtkWidgetManager,
|
|
16
16
|
} from "@kitware/vtk.js/Widgets/Core/WidgetManager";
|
|
17
|
+
import type { DataIdentified } from "@ogw_front/types/identifiers";
|
|
17
18
|
import type { vtkGenericRenderWindow as GenericRenderWindowInstance } from "@ogw_internal/stores/hybrid_viewer/vtk_types";
|
|
18
19
|
import type { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
19
20
|
import type { vtkCamera } from "@kitware/vtk.js/Rendering/Core/Camera";
|
|
20
21
|
import { newInstance as vtkGenericRenderWindow } from "@kitware/vtk.js/Rendering/Misc/GenericRenderWindow";
|
|
21
22
|
|
|
22
|
-
interface DataItemLike {
|
|
23
|
-
id: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
23
|
interface ClippingPlanesWidgetParams {
|
|
27
24
|
planes: Ref<ClippingPlane[]>;
|
|
28
25
|
targetAllVisible: Ref<boolean>;
|
|
29
26
|
selectedDatasetIds: Ref<string[]>;
|
|
30
|
-
allItems: Ref<
|
|
27
|
+
allItems: Ref<DataIdentified[]>;
|
|
31
28
|
hybridViewerStore: ReturnType<typeof useHybridViewerStore>;
|
|
32
29
|
debouncedApply: (...args: readonly unknown[]) => void;
|
|
33
30
|
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
type SliceAxis,
|
|
5
5
|
areAllGrids,
|
|
6
6
|
} from "@ogw_front/utils/slice";
|
|
7
|
+
import type { DataIdentified, GeodeObjectType } from "@ogw_front/types/identifiers";
|
|
7
8
|
import type { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
8
9
|
|
|
9
10
|
interface Slice {
|
|
@@ -31,7 +32,7 @@ interface SliceSyncParams {
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
interface ClippingSlicesParams {
|
|
34
|
-
allItems: ComputedRef<
|
|
35
|
+
allItems: ComputedRef<(DataIdentified & { geode_object_type: GeodeObjectType })[]>;
|
|
35
36
|
targetIds: ComputedRef<string[]>;
|
|
36
37
|
getUntargetedIds: () => string[];
|
|
37
38
|
newItemId: () => number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
1
2
|
import type { ParamsOf } from "@ogw_shared/utils/types";
|
|
2
3
|
import { consola } from "consola";
|
|
3
4
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
@@ -18,12 +19,12 @@ export function useHoverhighlight(): {
|
|
|
18
19
|
const dataStore = useDataStore();
|
|
19
20
|
let timer: ReturnType<typeof setTimeout> | undefined = undefined;
|
|
20
21
|
// Item hovered last, whose highlight may still be pending
|
|
21
|
-
let currentId:
|
|
22
|
+
let currentId: DataId | undefined = undefined;
|
|
22
23
|
// Item the viewer was asked to highlight, the only one to unhighlight
|
|
23
|
-
let highlighted: {
|
|
24
|
+
let highlighted: { dataId: DataId; type: HighlightType } | undefined = undefined;
|
|
24
25
|
|
|
25
26
|
function onHoverEnter(
|
|
26
|
-
|
|
27
|
+
dataId: DataId,
|
|
27
28
|
block_ids_provider: BlockIdsProvider = [],
|
|
28
29
|
type: HighlightType = "model",
|
|
29
30
|
immediate = false,
|
|
@@ -35,9 +36,9 @@ export function useHoverhighlight(): {
|
|
|
35
36
|
const schema = vtk_schemas.opengeodeweb_viewer[type].highlight;
|
|
36
37
|
|
|
37
38
|
async function highlightAction(): Promise<void> {
|
|
38
|
-
currentId =
|
|
39
|
+
currentId = dataId;
|
|
39
40
|
|
|
40
|
-
if (!(await dataStore.isItemViewable(
|
|
41
|
+
if (!(await dataStore.isItemViewable(dataId))) {
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -52,20 +53,20 @@ export function useHoverhighlight(): {
|
|
|
52
53
|
.map((blockId) => Math.trunc(blockId))
|
|
53
54
|
.filter((blockId) => !Number.isNaN(blockId));
|
|
54
55
|
|
|
55
|
-
if (currentId !==
|
|
56
|
+
if (currentId !== dataId) {
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
highlighted = {
|
|
60
|
+
highlighted = { dataId, type };
|
|
60
61
|
const params = {
|
|
61
|
-
id,
|
|
62
|
+
id: dataId,
|
|
62
63
|
visibility: true,
|
|
63
64
|
...(type === "model" && { block_ids }),
|
|
64
65
|
};
|
|
65
66
|
try {
|
|
66
67
|
await viewerStore.request({ schema, params });
|
|
67
68
|
} catch (error) {
|
|
68
|
-
consola.error(`Highlight failed for ${type} ${
|
|
69
|
+
consola.error(`Highlight failed for ${type} ${dataId}:`, error);
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
|
|
@@ -90,7 +91,7 @@ export function useHoverhighlight(): {
|
|
|
90
91
|
|
|
91
92
|
async function unhighlightAction(
|
|
92
93
|
type: HighlightType,
|
|
93
|
-
|
|
94
|
+
dataId: DataId,
|
|
94
95
|
request: {
|
|
95
96
|
schema: HighlightSchema;
|
|
96
97
|
params?: ParamsOf<HighlightSchema>;
|
|
@@ -100,28 +101,28 @@ export function useHoverhighlight(): {
|
|
|
100
101
|
try {
|
|
101
102
|
await viewerStore.request(request);
|
|
102
103
|
} catch (error) {
|
|
103
|
-
consola.error(`Unhighlight failed for ${type} ${
|
|
104
|
+
consola.error(`Unhighlight failed for ${type} ${dataId}:`, error);
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
function onHoverLeave(
|
|
108
|
+
function onHoverLeave(dataId: DataId): void {
|
|
108
109
|
if (timer) {
|
|
109
110
|
clearTimeout(timer);
|
|
110
111
|
timer = undefined;
|
|
111
112
|
}
|
|
112
|
-
if (currentId ===
|
|
113
|
+
if (currentId === dataId) {
|
|
113
114
|
currentId = undefined;
|
|
114
115
|
}
|
|
115
|
-
if (highlighted?.
|
|
116
|
+
if (highlighted?.dataId === dataId) {
|
|
116
117
|
const { type } = highlighted;
|
|
117
118
|
const schema = vtk_schemas.opengeodeweb_viewer[type].highlight;
|
|
118
119
|
const params = {
|
|
119
|
-
id,
|
|
120
|
+
id: dataId,
|
|
120
121
|
visibility: false,
|
|
121
122
|
...(type === "model" && { block_ids: [] }),
|
|
122
123
|
};
|
|
123
124
|
// oxlint-disable-next-line typescript/no-floating-promises -- unhighlightAction catches its own errors internally.
|
|
124
|
-
unhighlightAction(type,
|
|
125
|
+
unhighlightAction(type, dataId, { schema, params });
|
|
125
126
|
highlighted = undefined;
|
|
126
127
|
}
|
|
127
128
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { type DataItem, useDataStore } from "@ogw_front/stores/data";
|
|
2
2
|
import type { EffectScope, MaybeRefOrGetter, ShallowRef } from "vue";
|
|
3
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
3
4
|
|
|
4
5
|
// Live view of a data item whose id can change: tree labels are reused by the virtual list,
|
|
5
6
|
// And the info card shows whichever object the menu was last opened on.
|
|
6
7
|
export function useLiveDataItem(
|
|
7
|
-
|
|
8
|
+
dataId: MaybeRefOrGetter<DataId | undefined>,
|
|
8
9
|
): ShallowRef<DataItem | undefined> {
|
|
9
10
|
const dataStore = useDataStore();
|
|
10
11
|
const item = shallowRef<DataItem | undefined>(undefined);
|
|
11
12
|
let itemScope: EffectScope | undefined = undefined;
|
|
12
13
|
|
|
13
14
|
watch(
|
|
14
|
-
() => toValue(
|
|
15
|
+
() => toValue(dataId),
|
|
15
16
|
(newId) => {
|
|
16
17
|
itemScope?.stop();
|
|
17
18
|
itemScope = undefined;
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
storeMethod,
|
|
7
7
|
useAttributeColoringStyle,
|
|
8
8
|
} from "@ogw_front/composables/attribute_coloring_style";
|
|
9
|
+
import type { ModelId } from "@ogw_front/types/identifiers";
|
|
9
10
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
10
11
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
11
12
|
|
|
@@ -19,7 +20,7 @@ interface ComponentGroup {
|
|
|
19
20
|
|
|
20
21
|
function modelColoring(
|
|
21
22
|
dataStyleStore: object,
|
|
22
|
-
modelId:
|
|
23
|
+
modelId: ModelId,
|
|
23
24
|
{ type, activeColoring, componentIds }: ComponentGroup,
|
|
24
25
|
): AttributeColoring {
|
|
25
26
|
const methodName = `${type}s${attributeType(activeColoring)}`;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { type ComputedRef, type Ref, computed, ref, watch } from "vue";
|
|
2
|
+
import type { ModelId, ModelIdentified, ViewerTyped } from "@ogw_front/types/identifiers";
|
|
2
3
|
import type { CollectionComponent } from "@ogw_front/stores/data_helpers/collections";
|
|
3
4
|
import { MESH_COMPONENT_TYPES } from "@ogw_front/utils/default_styles";
|
|
4
5
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
5
6
|
|
|
6
|
-
interface ModelMenuMetaData {
|
|
7
|
-
modelId?: string;
|
|
7
|
+
interface ModelMenuMetaData extends Partial<ViewerTyped>, Partial<ModelIdentified> {
|
|
8
8
|
pickedComponentId?: string;
|
|
9
|
-
viewer_type?: string;
|
|
10
9
|
modelComponentType?: string;
|
|
11
10
|
targetComponentIds?: string[];
|
|
12
11
|
}
|
|
@@ -17,7 +16,7 @@ interface ModelMenuItemProps {
|
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
interface ModelMenuContext {
|
|
20
|
-
modelId: ComputedRef<
|
|
19
|
+
modelId: ComputedRef<ModelId>;
|
|
21
20
|
componentId: ComputedRef<string | undefined>;
|
|
22
21
|
componentType: Ref<string | undefined>;
|
|
23
22
|
collections: Ref<CollectionComponent[] | undefined>;
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
FormattedComponent,
|
|
7
7
|
FormattedComponentGroup,
|
|
8
8
|
} from "@ogw_front/stores/data_helpers/mesh";
|
|
9
|
+
import type { ModelId } from "@ogw_front/types/identifiers";
|
|
9
10
|
import { compareSelections } from "@ogw_front/utils/treeview";
|
|
10
11
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
11
12
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
@@ -14,7 +15,7 @@ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
|
14
15
|
type ModelTreeCategory = FormattedComponentGroup | CollectionComponentGroup;
|
|
15
16
|
type ModelTreeCache = Record<string, (FormattedComponent | CollectionComponent)[]>;
|
|
16
17
|
|
|
17
|
-
function useModelVisibility(modelId:
|
|
18
|
+
function useModelVisibility(modelId: ModelId): {
|
|
18
19
|
selection: typeof selection;
|
|
19
20
|
updateVisibility: typeof updateVisibility;
|
|
20
21
|
} {
|
|
@@ -38,7 +39,7 @@ function useModelVisibility(modelId: string): {
|
|
|
38
39
|
return { selection, updateVisibility };
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
export function useModelTree(modelId:
|
|
42
|
+
export function useModelTree(modelId: ModelId): {
|
|
42
43
|
isLoading: ComputedRef<boolean>;
|
|
43
44
|
localCategories: Ref<ModelTreeCategory[]>;
|
|
44
45
|
cache: Ref<ModelTreeCache | undefined>;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import type { ModelComponentRelationRecord, NewDataItem } from "@ogw_front/stores/data";
|
|
2
1
|
import type { BasemapSnapshot } from "@ogw_front/stores/basemap";
|
|
3
2
|
import type { CRSList } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
4
3
|
import type { CameraSnapshot } from "@ogw_internal/stores/hybrid_viewer/camera";
|
|
5
4
|
import type { DataStyleSnapshot } from "@ogw_front/stores/data_style";
|
|
5
|
+
import type { LegacyDataId } from "@ogw_front/utils/legacy_data_id";
|
|
6
6
|
import type { ModelComponentRecord } from "@ogw_front/stores/data_helpers/mesh.js";
|
|
7
|
+
import type { ModelComponentRelationRecord } from "@ogw_front/stores/data_helpers/relations";
|
|
8
|
+
import type { NewDataItem } from "@ogw_front/stores/data";
|
|
7
9
|
import type { TreeviewSnapshot } from "@ogw_front/stores/treeview";
|
|
8
10
|
|
|
11
|
+
// Projects saved before data_id existed hold the data id of their rows as `id`
|
|
9
12
|
interface ProjectDataSnapshot {
|
|
10
|
-
items: NewDataItem[];
|
|
11
|
-
modelComponents: ModelComponentRecord[];
|
|
12
|
-
modelComponentsRelations:
|
|
13
|
+
items: (LegacyDataId<NewDataItem> | NewDataItem)[];
|
|
14
|
+
modelComponents: (LegacyDataId<ModelComponentRecord> | ModelComponentRecord)[];
|
|
15
|
+
modelComponentsRelations: (
|
|
16
|
+
| LegacyDataId<ModelComponentRelationRecord>
|
|
17
|
+
| ModelComponentRelationRecord
|
|
18
|
+
)[];
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
interface ProjectSnapshot {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { ComputedRef, Ref } from "vue";
|
|
2
|
+
import type { GeodeIdentified } from "@ogw_front/types/identifiers";
|
|
2
3
|
|
|
3
4
|
// Same shape as Vue's MaybeRefOrGetter<T>, kept as a local alias for readability at call sites.
|
|
4
5
|
type ReadonlyMaybeRefOrGetter<Value> = Value | Ref<Value> | (() => Value);
|
|
5
6
|
|
|
6
7
|
// This composable filters/sorts different flavors of "category with children" trees (treeview groups, model component/collection groups, ...); this shape captures just the fields it reads/writes, generically, across all of them.
|
|
7
|
-
interface FilterableItem {
|
|
8
|
+
interface FilterableItem extends Readonly<Partial<GeodeIdentified>> {
|
|
8
9
|
readonly id: unknown;
|
|
9
10
|
readonly title?: string;
|
|
10
|
-
//
|
|
11
|
-
readonly geode_id?: string;
|
|
11
|
+
// Geode objects (data and model components) carry a geode_id, group nodes do not.
|
|
12
12
|
readonly children?: readonly FilterableItem[];
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import type { DisplayItem, EmitFn } from "./virtual_tree";
|
|
2
|
+
import type { ScrollInfo } from "./tree_scroll";
|
|
2
3
|
|
|
3
4
|
interface VisibleBounds {
|
|
4
5
|
firstVisible: number;
|
|
5
6
|
lastVisible: number;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
interface ScrollInfo {
|
|
9
|
-
scrollTop: number;
|
|
10
|
-
containerHeight: number;
|
|
11
|
-
itemHeight: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
9
|
type ReadonlyDisplayItem = Omit<DisplayItem, "raw"> & {
|
|
15
10
|
readonly raw: Record<string, unknown>;
|
|
16
11
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
2
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
3
3
|
|
|
4
|
+
import type { DataIdentified, GeodeObjectType, ViewerType } from "@ogw_front/types/identifiers";
|
|
4
5
|
import { type DataItem, useDataStore } from "@ogw_front/stores/data";
|
|
5
6
|
import { computeMenuPosition } from "@ogw_front/composables/overlapping_picker_menu";
|
|
6
7
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
@@ -11,12 +12,11 @@ interface PickedItem {
|
|
|
11
12
|
viewer_id: number | undefined;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
interface ProposedItem {
|
|
15
|
-
id: string;
|
|
15
|
+
interface ProposedItem extends DataIdentified {
|
|
16
16
|
viewer_id: number | undefined;
|
|
17
17
|
name: string;
|
|
18
|
-
viewer_type:
|
|
19
|
-
geode_object_type:
|
|
18
|
+
viewer_type: ViewerType | undefined;
|
|
19
|
+
geode_object_type: GeodeObjectType | undefined;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
interface ViewerIdResult {
|
|
@@ -63,7 +63,7 @@ export function useOverlappingPicker(): UseOverlappingPickerReturn {
|
|
|
63
63
|
try {
|
|
64
64
|
const item = await dataStore.item(pick.id);
|
|
65
65
|
return {
|
|
66
|
-
|
|
66
|
+
data_id: pick.id,
|
|
67
67
|
viewer_id: pick.viewer_id,
|
|
68
68
|
name: item.name || "Unnamed Object",
|
|
69
69
|
viewer_type: item.viewer_type,
|
|
@@ -71,7 +71,7 @@ export function useOverlappingPicker(): UseOverlappingPickerReturn {
|
|
|
71
71
|
};
|
|
72
72
|
} catch {
|
|
73
73
|
return {
|
|
74
|
-
|
|
74
|
+
data_id: pick.id,
|
|
75
75
|
viewer_id: pick.viewer_id,
|
|
76
76
|
name: "Unnamed Object",
|
|
77
77
|
viewer_type: undefined,
|
|
@@ -106,7 +106,7 @@ export function useOverlappingPicker(): UseOverlappingPickerReturn {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
async function getViewableIds(): Promise<string[]> {
|
|
109
|
-
const activeIds = new Set(dataItems.value.map((i: DataItem) => i.
|
|
109
|
+
const activeIds = new Set(dataItems.value.map((i: DataItem) => i.data_id));
|
|
110
110
|
const visibleStyleIds = Object.keys(dataStyleStore.styles).filter(
|
|
111
111
|
(styleId) => activeIds.has(styleId) && dataStyleStore.objectVisibility(styleId) === true,
|
|
112
112
|
);
|
|
@@ -161,7 +161,7 @@ export function useOverlappingPicker(): UseOverlappingPickerReturn {
|
|
|
161
161
|
resolveIntermediate = (chosenResult: ProposedItem | undefined): void => {
|
|
162
162
|
displayIntermediate.value = false;
|
|
163
163
|
if (chosenResult) {
|
|
164
|
-
resolve({ id: chosenResult.
|
|
164
|
+
resolve({ id: chosenResult.data_id, viewer_id: chosenResult.viewer_id });
|
|
165
165
|
} else {
|
|
166
166
|
resolve({ id: undefined, viewer_id: undefined, dismissed: true });
|
|
167
167
|
}
|
|
@@ -181,4 +181,4 @@ export function useOverlappingPicker(): UseOverlappingPickerReturn {
|
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
export type { ViewerIdResult };
|
|
184
|
+
export type { ProposedItem, ViewerIdResult };
|
|
@@ -22,7 +22,7 @@ function useGeoreferenced(): Georeferenced {
|
|
|
22
22
|
function georeferencedIds(): string[] {
|
|
23
23
|
return crsStore.crsItems
|
|
24
24
|
.filter((item) => sameCrs(item.crs, crsStore.projectCrs))
|
|
25
|
-
.map((item) => item.
|
|
25
|
+
.map((item) => item.data_id);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const available = computed(
|