@geode/opengeodeweb-front 10.44.0-rc.9 → 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/ClippingPlaneCard.vue +18 -1
- package/app/components/ClippingPlanes.vue +21 -10
- 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/Screenshot.vue +8 -57
- 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/CircularItems.vue +1 -2
- package/app/components/Viewer/ContextMenu/ContextMenu.vue +7 -6
- package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +4 -5
- 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/Scene/BackgroundOptions.vue +37 -0
- package/app/components/Viewer/Scene/OrientationWidgetOptions.vue +48 -0
- package/app/components/Viewer/Scene/TextOptions.vue +63 -0
- 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_planes_widget_entries.ts +1 -0
- 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 +12 -10
- package/app/composables/viewer_context_menu.ts +9 -1
- 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 +34 -20
- package/app/stores/menu.ts +24 -11
- package/app/stores/menu_helpers/menus_data.ts +2 -0
- package/app/stores/menu_helpers/scene.ts +10 -0
- 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 +25 -5
- package/app/utils/clipping_planes_scene.ts +4 -3
- package/app/utils/crs.ts +4 -1
- package/app/utils/default_styles/constants.ts +18 -1
- package/app/utils/default_styles/index.ts +17 -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/base_database.ts +2 -0
- 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/database/tables/scene_style.ts +6 -0
- 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/scene.ts +118 -0
- package/internal/stores/data_style/state.ts +11 -6
- package/internal/stores/data_style/state_shared.ts +20 -11
- package/internal/stores/data_style/time_step.ts +21 -15
- package/internal/stores/data_style/types.ts +28 -4
- 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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { getPlaneCssColor } from "@ogw_front/utils/clipping_planes";
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
|
-
plane: { origin?: number[]; normal: number[] };
|
|
5
|
+
plane: { origin?: number[]; normal: number[]; opacity: number };
|
|
6
6
|
index: number;
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -49,6 +49,23 @@ const emit = defineEmits<Emits>();
|
|
|
49
49
|
</v-col>
|
|
50
50
|
</v-row>
|
|
51
51
|
|
|
52
|
+
<v-row align="center" no-gutters class="mb-1">
|
|
53
|
+
<v-col cols="auto" class="text-caption text-medium-emphasis">Opacity</v-col>
|
|
54
|
+
<v-col class="px-2">
|
|
55
|
+
<v-slider
|
|
56
|
+
v-model="plane.opacity"
|
|
57
|
+
data-testid="planeOpacitySlider"
|
|
58
|
+
:min="0"
|
|
59
|
+
:max="1"
|
|
60
|
+
:step="0.05"
|
|
61
|
+
:color="getPlaneCssColor(index)"
|
|
62
|
+
track-color="grey-lighten-2"
|
|
63
|
+
density="compact"
|
|
64
|
+
hide-details
|
|
65
|
+
/>
|
|
66
|
+
</v-col>
|
|
67
|
+
</v-row>
|
|
68
|
+
|
|
52
69
|
<v-row no-gutters class="mb-1">
|
|
53
70
|
<v-col class="text-caption text-medium-emphasis">Origin [X, Y, Z]</v-col>
|
|
54
71
|
</v-row>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
DEBOUNCE_DELAY,
|
|
4
|
+
DEFAULT_NORMALS,
|
|
5
|
+
DEFAULT_PLANE_OPACITY,
|
|
6
|
+
getPlaneRgbaColor,
|
|
7
|
+
} from "@ogw_front/utils/clipping_planes";
|
|
3
8
|
import type { ClippingPlane } from "@ogw_front/composables/clipping_planes_widget_entries";
|
|
4
9
|
import ClippingPlaneCard from "@ogw_front/components/ClippingPlaneCard.vue";
|
|
5
10
|
import SliceCard from "@ogw_front/components/SliceCard.vue";
|
|
@@ -26,18 +31,21 @@ function newItemId(): number {
|
|
|
26
31
|
lastItemId += 1;
|
|
27
32
|
return lastItemId;
|
|
28
33
|
}
|
|
29
|
-
|
|
34
|
+
function createPlane(origin: ClippingPlane["origin"], normal: number[]): ClippingPlane {
|
|
35
|
+
return { id: newItemId(), origin, normal, opacity: DEFAULT_PLANE_OPACITY };
|
|
36
|
+
}
|
|
37
|
+
const planes = ref<ClippingPlane[]>([createPlane(undefined, [1, 0, 0])]);
|
|
30
38
|
const allItems = dataStore.refRegisteredItems();
|
|
31
39
|
const targetIds = computed<string[]>(() => {
|
|
32
40
|
if (targetAllVisible.value) {
|
|
33
|
-
return allItems.value.map((item) => item.
|
|
41
|
+
return allItems.value.map((item) => item.data_id);
|
|
34
42
|
}
|
|
35
43
|
return selectedDatasetIds.value;
|
|
36
44
|
});
|
|
37
45
|
const availableDatasets = computed<{ title: string; value: string }[]>(() =>
|
|
38
46
|
allItems.value.map((item) => ({
|
|
39
|
-
title: item.name || item.
|
|
40
|
-
value: item.
|
|
47
|
+
title: item.name || item.data_id,
|
|
48
|
+
value: item.data_id,
|
|
41
49
|
})),
|
|
42
50
|
);
|
|
43
51
|
const widgetContainer = useTemplateRef("widgetContainer");
|
|
@@ -62,7 +70,9 @@ const {
|
|
|
62
70
|
});
|
|
63
71
|
|
|
64
72
|
function getUntargetedIds(): string[] {
|
|
65
|
-
return allItems.value
|
|
73
|
+
return allItems.value
|
|
74
|
+
.map((item) => item.data_id)
|
|
75
|
+
.filter((dataId) => !targetIds.value.includes(dataId));
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
const {
|
|
@@ -84,9 +94,10 @@ async function applyClippingPlanes(): Promise<void> {
|
|
|
84
94
|
}
|
|
85
95
|
const center = getSceneCenter();
|
|
86
96
|
const untargetedIds = getUntargetedIds();
|
|
87
|
-
const planesData = planes.value.map((plane) => ({
|
|
97
|
+
const planesData = planes.value.map((plane, index) => ({
|
|
88
98
|
origin: (plane.origin || center).map(Number),
|
|
89
99
|
normal: plane.normal.map(Number),
|
|
100
|
+
color: getPlaneRgbaColor(index, plane.opacity),
|
|
90
101
|
}));
|
|
91
102
|
if (targetIds.value.length > 0) {
|
|
92
103
|
await hybridViewerStore.setClippingPlanes(
|
|
@@ -112,7 +123,7 @@ function addPlane(): void {
|
|
|
112
123
|
// Satisfy noUncheckedIndexedAccess and are never hit at runtime.
|
|
113
124
|
const normal = DEFAULT_NORMALS[planes.value.length % DEFAULT_NORMALS.length] ??
|
|
114
125
|
DEFAULT_NORMALS[0] ?? [1, 0, 0];
|
|
115
|
-
planes.value.push(
|
|
126
|
+
planes.value.push(createPlane([...getSceneCenter()], normal));
|
|
116
127
|
}
|
|
117
128
|
|
|
118
129
|
function removePlane(index: number): void {
|
|
@@ -127,7 +138,7 @@ function flipNormal(plane: { normal: number[] }): void {
|
|
|
127
138
|
|
|
128
139
|
async function resetClippingPlanes(): Promise<void> {
|
|
129
140
|
setFromWidget(true);
|
|
130
|
-
planes.value = [
|
|
141
|
+
planes.value = [createPlane(undefined, [1, 0, 0])];
|
|
131
142
|
resetSlices();
|
|
132
143
|
updateWidgetPlacement({ isReset: true });
|
|
133
144
|
setFromWidget(false);
|
|
@@ -135,7 +146,7 @@ async function resetClippingPlanes(): Promise<void> {
|
|
|
135
146
|
}
|
|
136
147
|
|
|
137
148
|
async function removeClippingPlanes(): Promise<void> {
|
|
138
|
-
const allIds = allItems.value.map((item) => item.
|
|
149
|
+
const allIds = allItems.value.map((item) => item.data_id);
|
|
139
150
|
await hybridViewerStore.setClippingPlanes(allIds, []);
|
|
140
151
|
await removeSlices(allIds);
|
|
141
152
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { CRSList } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
3
|
+
import type { GeodeObjectType } from "@ogw_front/types/identifiers";
|
|
3
4
|
import { useCrsStore } from "@ogw_front/stores/crs";
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
6
|
-
geodeObjectType:
|
|
7
|
+
geodeObjectType: GeodeObjectType;
|
|
7
8
|
// Narrow containers: one "AUTHORITY:CODE" column and a truncated name
|
|
8
9
|
compact?: boolean;
|
|
9
10
|
}
|
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
3
3
|
|
|
4
4
|
import FetchingData from "@ogw_front/components/FetchingData.vue";
|
|
5
|
+
import type { GeodeObjectType } from "@ogw_front/types/identifiers";
|
|
5
6
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
6
7
|
|
|
7
8
|
const schema = schemas.opengeodeweb_back.geode_objects_and_output_extensions;
|
|
8
9
|
const emit = defineEmits<{
|
|
9
|
-
update_values: [values: { output_geode_object:
|
|
10
|
+
update_values: [values: { output_geode_object: GeodeObjectType; output_extension: string }];
|
|
10
11
|
increment_step: [];
|
|
11
12
|
decrement_step: [];
|
|
12
13
|
}>();
|
|
13
14
|
|
|
14
15
|
interface Props {
|
|
15
|
-
geodeObjectType:
|
|
16
|
+
geodeObjectType: GeodeObjectType;
|
|
16
17
|
filenames: string[];
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
const { geodeObjectType, filenames } = defineProps<Props>();
|
|
20
21
|
type OutputExtensions = Record<string, { is_saveable: boolean }>;
|
|
21
22
|
|
|
22
|
-
const geode_objects_and_output_extensions = ref<Record<
|
|
23
|
+
const geode_objects_and_output_extensions = ref<Record<GeodeObjectType, OutputExtensions>>({});
|
|
23
24
|
const loading = ref<boolean>(false);
|
|
24
25
|
|
|
25
26
|
const toggle_loading = useToggle(loading);
|
|
@@ -28,8 +29,8 @@ async function get_output_file_extensions(): Promise<void> {
|
|
|
28
29
|
toggle_loading();
|
|
29
30
|
geode_objects_and_output_extensions.value = {};
|
|
30
31
|
const backStore = useBackStore();
|
|
31
|
-
const values: Record<
|
|
32
|
-
filenames.map(async (filename): Promise<Record<
|
|
32
|
+
const values: Record<GeodeObjectType, Record<string, boolean>>[] = await Promise.all(
|
|
33
|
+
filenames.map(async (filename): Promise<Record<GeodeObjectType, Record<string, boolean>>> => {
|
|
33
34
|
const params = { geode_object_type: geodeObjectType, filename };
|
|
34
35
|
const response = await backStore.request({ schema, params });
|
|
35
36
|
return response.geode_objects_and_output_extensions;
|
|
@@ -37,7 +38,7 @@ async function get_output_file_extensions(): Promise<void> {
|
|
|
37
38
|
);
|
|
38
39
|
const all_keys = [...new Set(values.flatMap((value) => Object.keys(value)))];
|
|
39
40
|
const common_keys = all_keys.filter((i) => !values.some((j) => !Object.keys(j).includes(i)));
|
|
40
|
-
const final_object: Record<
|
|
41
|
+
const final_object: Record<GeodeObjectType, OutputExtensions> = {};
|
|
41
42
|
for (const key of common_keys) {
|
|
42
43
|
final_object[key] = {};
|
|
43
44
|
for (const value of values) {
|
|
@@ -54,7 +55,7 @@ async function get_output_file_extensions(): Promise<void> {
|
|
|
54
55
|
toggle_loading();
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
function update_values(output_geode_object:
|
|
58
|
+
function update_values(output_geode_object: GeodeObjectType, output_extension: string): void {
|
|
58
59
|
if (output_geode_object !== "" && output_extension !== "") {
|
|
59
60
|
emit("update_values", {
|
|
60
61
|
output_geode_object,
|
|
@@ -46,8 +46,8 @@ const factor = ref<number>(factorRange.defaultValue);
|
|
|
46
46
|
const allItems = dataStore.refRegisteredItems();
|
|
47
47
|
const availableDatasets = computed<{ title: string; value: string }[]>(() =>
|
|
48
48
|
allItems.value.map((item) => ({
|
|
49
|
-
title: item.name || item.
|
|
50
|
-
value: item.
|
|
49
|
+
title: item.name || item.data_id,
|
|
50
|
+
value: item.data_id,
|
|
51
51
|
})),
|
|
52
52
|
);
|
|
53
53
|
|
|
@@ -55,12 +55,12 @@ let appliedFactor: number | undefined = undefined;
|
|
|
55
55
|
|
|
56
56
|
async function applyFactor(): Promise<void> {
|
|
57
57
|
appliedFactor = factor.value;
|
|
58
|
-
const allIds = allItems.value.map((item) => item.
|
|
58
|
+
const allIds = allItems.value.map((item) => item.data_id);
|
|
59
59
|
if (allIds.length === 0) {
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
const targetIds = targetAllVisible.value ? allIds : selectedDatasetIds.value;
|
|
63
|
-
const untargetedIds = allIds.filter((
|
|
63
|
+
const untargetedIds = allIds.filter((dataId) => !targetIds.includes(dataId));
|
|
64
64
|
|
|
65
65
|
if (targetIds.length > 0) {
|
|
66
66
|
await setFactor(targetIds, Number(factor.value));
|
|
@@ -5,6 +5,7 @@ import { matchExpectedFiles, uploadPath } from "@ogw_front/utils/upload_path";
|
|
|
5
5
|
import DragAndDrop from "@ogw_front/components/DragAndDrop.vue";
|
|
6
6
|
import FetchingData from "@ogw_front/components/FetchingData.vue";
|
|
7
7
|
import FileUploader from "@ogw_front/components/FileUploader.vue";
|
|
8
|
+
import type { GeodeObjectType } from "@ogw_front/types/identifiers";
|
|
8
9
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
9
10
|
import { useFeedbackStore } from "@ogw_front/stores/feedback";
|
|
10
11
|
|
|
@@ -35,7 +36,7 @@ const emit = defineEmits<Emits>();
|
|
|
35
36
|
interface Props {
|
|
36
37
|
multiple: boolean;
|
|
37
38
|
// Filename -> geode object type, each file is checked with its own type (unused for time series)
|
|
38
|
-
geodeObjectTypes?: Record<string,
|
|
39
|
+
geodeObjectTypes?: Record<string, GeodeObjectType>;
|
|
39
40
|
filenames: string[];
|
|
40
41
|
files?: UploadFile[];
|
|
41
42
|
timeSeries?: boolean;
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
resolveAllowedObjectsPerFile,
|
|
6
6
|
} from "@ogw_shared/utils/response_handlers/load.js";
|
|
7
7
|
import FetchingData from "@ogw_front/components/FetchingData.vue";
|
|
8
|
+
import type { GeodeObjectType } from "@ogw_front/types/identifiers";
|
|
8
9
|
import { geode_objects } from "@ogw_front/assets/geode_objects";
|
|
9
10
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
10
11
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
@@ -26,7 +27,7 @@ interface PendingGroup {
|
|
|
26
27
|
|
|
27
28
|
const emit = defineEmits<{
|
|
28
29
|
// Filename -> geode object type, files that cannot be loaded are left out
|
|
29
|
-
update_values: [value: { geode_object_types: Record<string,
|
|
30
|
+
update_values: [value: { geode_object_types: Record<string, GeodeObjectType> }];
|
|
30
31
|
increment_step: [];
|
|
31
32
|
}>();
|
|
32
33
|
|
|
@@ -60,12 +61,12 @@ async function fetchAllowedObjectsList(): Promise<AllowedObjectMap[]> {
|
|
|
60
61
|
return responses.map((response) => response.allowed_objects);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
function emitGeodeObjectTypes(geode_object_types: Record<string,
|
|
64
|
+
function emitGeodeObjectTypes(geode_object_types: Record<string, GeodeObjectType>): void {
|
|
64
65
|
emit("update_values", { geode_object_types });
|
|
65
66
|
emit("increment_step");
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
function setGeodeObject(geode_object_type:
|
|
69
|
+
function setGeodeObject(geode_object_type: GeodeObjectType | undefined): void {
|
|
69
70
|
if (!geode_object_type) {
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
import viewer_schemas, {
|
|
3
3
|
type ViewerTakeScreenshotParams,
|
|
4
4
|
} from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
5
|
-
import { BACKGROUND_GREY_VALUE } from "@ogw_internal/stores/hybrid_viewer/constants";
|
|
6
|
-
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
7
5
|
import ToolPanel from "@ogw_front/components/ToolPanel.vue";
|
|
8
|
-
import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
|
|
9
6
|
import fileDownload from "js-file-download";
|
|
10
7
|
import { useClipboardItems } from "@vueuse/core";
|
|
11
8
|
import { useFeedbackStore } from "@ogw_front/stores/feedback";
|
|
12
|
-
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
13
9
|
import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
14
10
|
|
|
15
11
|
const DEFAULT_PANEL_WIDTH = 260;
|
|
@@ -37,28 +33,9 @@ const output_extension = ref<ViewerTakeScreenshotParams["output_extension"]>("pn
|
|
|
37
33
|
const include_background = ref<boolean>(true);
|
|
38
34
|
const include_ui = ref<boolean>(false);
|
|
39
35
|
const screenshot_type = ref<string>("file");
|
|
40
|
-
const DEFAULT_BACKGROUND_COLOR: RGBAColor = {
|
|
41
|
-
red: BACKGROUND_GREY_VALUE,
|
|
42
|
-
green: BACKGROUND_GREY_VALUE,
|
|
43
|
-
blue: BACKGROUND_GREY_VALUE,
|
|
44
|
-
alpha: 1,
|
|
45
|
-
};
|
|
46
|
-
const background_color = ref<RGBAColor>({ ...DEFAULT_BACKGROUND_COLOR });
|
|
47
|
-
let is_capturing = false;
|
|
48
36
|
|
|
49
37
|
const { copy } = useClipboardItems();
|
|
50
38
|
|
|
51
|
-
function applyBackgroundColor(color: RGBAColor): Promise<void> {
|
|
52
|
-
const hybridViewerStore = useHybridViewerStore();
|
|
53
|
-
// oxlint-disable-next-line id-length -- the viewer schema requires { r, g, b }
|
|
54
|
-
return hybridViewerStore.setBackgroundColor({ r: color.red, g: color.green, b: color.blue });
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async function restoreBackgroundColor(): Promise<void> {
|
|
58
|
-
background_color.value = { ...DEFAULT_BACKGROUND_COLOR };
|
|
59
|
-
await applyBackgroundColor(DEFAULT_BACKGROUND_COLOR);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
39
|
async function deliverScreenshot(blob: Blob | Uint8Array, current_filename: string): Promise<void> {
|
|
63
40
|
const feedbackStore = useFeedbackStore();
|
|
64
41
|
if (screenshot_type.value === "file") {
|
|
@@ -152,35 +129,17 @@ async function takeUiScreenshot(current_filename: string): Promise<void> {
|
|
|
152
129
|
|
|
153
130
|
async function takeScreenshot(): Promise<void> {
|
|
154
131
|
const current_filename = screenshot_type.value === "file" ? filename.value : "screenshot";
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
await takeSceneScreenshot(current_filename);
|
|
164
|
-
show.value = false;
|
|
165
|
-
}
|
|
166
|
-
} finally {
|
|
167
|
-
await restoreBackgroundColor();
|
|
168
|
-
is_capturing = false;
|
|
132
|
+
if (include_ui.value) {
|
|
133
|
+
// Close the panel first so it does not appear on the captured page
|
|
134
|
+
show.value = false;
|
|
135
|
+
await nextTick();
|
|
136
|
+
await takeUiScreenshot(current_filename);
|
|
137
|
+
} else {
|
|
138
|
+
await takeSceneScreenshot(current_filename);
|
|
139
|
+
show.value = false;
|
|
169
140
|
}
|
|
170
141
|
}
|
|
171
142
|
|
|
172
|
-
watch(background_color, async (color) => {
|
|
173
|
-
if (show.value) {
|
|
174
|
-
await applyBackgroundColor(color);
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
watch(show, async (value) => {
|
|
179
|
-
if (!value && !is_capturing) {
|
|
180
|
-
await restoreBackgroundColor();
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
|
|
184
143
|
watch([output_extension, include_ui], ([extension, with_ui]) => {
|
|
185
144
|
if (extension !== "png" || with_ui) {
|
|
186
145
|
include_background.value = true;
|
|
@@ -295,14 +254,6 @@ function handleClose(): void {
|
|
|
295
254
|
class="text-caption"
|
|
296
255
|
></v-switch>
|
|
297
256
|
</v-col>
|
|
298
|
-
<v-col v-if="include_background" cols="12" class="py-1">
|
|
299
|
-
<span class="text-caption">Background color</span>
|
|
300
|
-
<ViewerOptionsColorPicker
|
|
301
|
-
data-testid="screenshotBackgroundColorPicker"
|
|
302
|
-
v-model="background_color"
|
|
303
|
-
disabled-alpha
|
|
304
|
-
/>
|
|
305
|
-
</v-col>
|
|
306
257
|
</v-row>
|
|
307
258
|
</v-container>
|
|
308
259
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import {
|
|
3
3
|
type AttributeInfo,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "@ogw_front/utils/
|
|
4
|
+
attributeArrayName,
|
|
5
|
+
getAttributeRange,
|
|
6
|
+
} from "@ogw_front/utils/attributes";
|
|
7
|
+
import { type AttributeSource, isValidThresholdAttribute } from "@ogw_front/utils/threshold";
|
|
7
8
|
import type { Threshold, ThresholdAttribute } from "@ogw_internal/stores/hybrid_viewer/filters";
|
|
8
|
-
import {
|
|
9
|
+
import type { AttributeTimeStep } from "@ogw_front/types/attribute";
|
|
9
10
|
import ViewerOptionsAttributeRangeSelector from "@ogw_front/components/Viewer/Options/AttributeRangeSelector.vue";
|
|
10
11
|
import { fetchAttributeRange } from "@ogw_front/utils/attribute_range";
|
|
11
12
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
@@ -50,7 +51,7 @@ const currentSource = computed<AttributeSource | undefined>(
|
|
|
50
51
|
const currentAttribute = computed<AttributeInfo | undefined>(() =>
|
|
51
52
|
attributes.value.find((attribute) => attribute.attribute_name === attributeName.value),
|
|
52
53
|
);
|
|
53
|
-
const currentTimeStep = computed<
|
|
54
|
+
const currentTimeStep = computed<AttributeTimeStep | undefined>(() => {
|
|
54
55
|
if (!currentSource.value || !currentAttribute.value?.time_steps?.length) {
|
|
55
56
|
return undefined;
|
|
56
57
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Threshold, ThresholdAttribute } from "@ogw_internal/stores/hybrid_viewer/filters";
|
|
3
3
|
import type { AttributeSource } from "@ogw_front/utils/threshold";
|
|
4
|
+
import type { DataId } from "@ogw_front/types/identifiers";
|
|
4
5
|
import ThresholdCard from "@ogw_front/components/ThresholdCard.vue";
|
|
5
6
|
import ToolPanel from "@ogw_front/components/ToolPanel.vue";
|
|
6
7
|
import { fetchSources } from "@ogw_front/utils/threshold_sources";
|
|
@@ -32,8 +33,8 @@ const cards = useTemplateRef("cards");
|
|
|
32
33
|
const allItems = dataStore.refAllItems();
|
|
33
34
|
const availableDatasets = computed<{ title: string; value: string }[]>(() =>
|
|
34
35
|
allItems.value.map((item) => ({
|
|
35
|
-
title: item.name || item.
|
|
36
|
-
value: item.
|
|
36
|
+
title: item.name || item.data_id,
|
|
37
|
+
value: item.data_id,
|
|
37
38
|
})),
|
|
38
39
|
);
|
|
39
40
|
|
|
@@ -63,9 +64,9 @@ function removeThreshold(index: number): void {
|
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
async function clearThresholds(
|
|
67
|
-
hybridViewerStore.removeThresholds(
|
|
68
|
-
await hybridViewerStore.setThreshold([
|
|
67
|
+
async function clearThresholds(dataId: DataId): Promise<void> {
|
|
68
|
+
hybridViewerStore.removeThresholds(dataId);
|
|
69
|
+
await hybridViewerStore.setThreshold([dataId], []);
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
async function resetRanges(): Promise<void> {
|
|
@@ -79,17 +80,17 @@ async function removeThresholds(): Promise<void> {
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
watch(selectedDatasetId, async (
|
|
83
|
+
watch(selectedDatasetId, async (dataId, previousId) => {
|
|
83
84
|
if (previousId) {
|
|
84
85
|
await clearThresholds(previousId);
|
|
85
86
|
}
|
|
86
|
-
if (
|
|
87
|
-
sources.value = await fetchSources(dataStore,
|
|
87
|
+
if (dataId) {
|
|
88
|
+
sources.value = await fetchSources(dataStore, dataId);
|
|
88
89
|
} else {
|
|
89
90
|
sources.value = [];
|
|
90
91
|
}
|
|
91
|
-
if (
|
|
92
|
-
hybridViewerStore.addThreshold(
|
|
92
|
+
if (dataId && hybridViewerStore.getThresholds(dataId).length === 0) {
|
|
93
|
+
hybridViewerStore.addThreshold(dataId);
|
|
93
94
|
}
|
|
94
95
|
});
|
|
95
96
|
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
3
3
|
|
|
4
|
+
import type {
|
|
5
|
+
DataIdentified,
|
|
6
|
+
GeodeObjectType,
|
|
7
|
+
GeodeObjectTyped,
|
|
8
|
+
} from "@ogw_front/types/identifiers";
|
|
4
9
|
import FetchingData from "@ogw_front/components/FetchingData.vue";
|
|
5
10
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
6
11
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
7
12
|
|
|
8
13
|
const schema = schemas.opengeodeweb_back.time_series_allowed_objects;
|
|
9
14
|
|
|
10
|
-
interface Target {
|
|
11
|
-
id: string;
|
|
15
|
+
interface Target extends DataIdentified, GeodeObjectTyped {
|
|
12
16
|
name: string;
|
|
13
|
-
geode_object_type: string;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
const emit = defineEmits<{
|
|
17
|
-
update_values: [values: { target_id: string; geode_object_type:
|
|
20
|
+
update_values: [values: { target_id: string; geode_object_type: GeodeObjectType }];
|
|
18
21
|
increment_step: [];
|
|
19
22
|
decrement_step: [];
|
|
20
23
|
}>();
|
|
@@ -33,12 +36,12 @@ async function get_targets(): Promise<void> {
|
|
|
33
36
|
]);
|
|
34
37
|
targets.value = items
|
|
35
38
|
.filter((item) => allowed_objects.includes(item.geode_object_type))
|
|
36
|
-
.map(({
|
|
39
|
+
.map(({ data_id, name, geode_object_type }) => ({ data_id, name, geode_object_type }));
|
|
37
40
|
loading.value = false;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
function select(target: Target): void {
|
|
41
|
-
emit("update_values", { target_id: target.
|
|
44
|
+
emit("update_values", { target_id: target.data_id, geode_object_type: target.geode_object_type });
|
|
42
45
|
emit("increment_step");
|
|
43
46
|
}
|
|
44
47
|
|
|
@@ -59,7 +62,7 @@ await get_targets();
|
|
|
59
62
|
<v-list v-else bg-color="transparent">
|
|
60
63
|
<v-list-item
|
|
61
64
|
v-for="target in targets"
|
|
62
|
-
:key="target.
|
|
65
|
+
:key="target.data_id"
|
|
63
66
|
data-testid="timeSeriesTarget"
|
|
64
67
|
:title="target.name"
|
|
65
68
|
:subtitle="target.geode_object_type"
|
|
@@ -11,7 +11,6 @@ interface Props {
|
|
|
11
11
|
|
|
12
12
|
const { menuItems, id, metaData, menuItemCount } = defineProps<Props>();
|
|
13
13
|
|
|
14
|
-
const RADIUS = 80;
|
|
15
14
|
const Z_INDEX_ACTIVE_ITEM = 10;
|
|
16
15
|
const Z_INDEX_BASE_ITEM = 1;
|
|
17
16
|
const FULL_ANGLE = 360;
|
|
@@ -25,7 +24,7 @@ const menuStore = useMenuStore();
|
|
|
25
24
|
function getItemStyle(index: number): Record<string, string> {
|
|
26
25
|
const angle = (index / menuItemCount) * 2 * Math.PI;
|
|
27
26
|
return {
|
|
28
|
-
transform: `translate(${Math.cos(angle) *
|
|
27
|
+
transform: `translate(${Math.cos(angle) * menuStore.menuRadius}px, ${Math.sin(angle) * menuStore.menuRadius}px)`,
|
|
29
28
|
transition: "opacity 0.2s ease, transform 0.2s ease",
|
|
30
29
|
position: "absolute",
|
|
31
30
|
zIndex: menuStore.active_item_index === index ? Z_INDEX_ACTIVE_ITEM : Z_INDEX_BASE_ITEM,
|
|
@@ -18,7 +18,6 @@ interface Props {
|
|
|
18
18
|
|
|
19
19
|
const { id, x, y, containerWidth, containerHeight } = defineProps<Props>();
|
|
20
20
|
|
|
21
|
-
const RADIUS = 80;
|
|
22
21
|
const MARGIN_OFFSET = 40;
|
|
23
22
|
const CLOSE_DELAY = 100;
|
|
24
23
|
const TREEVIEW_MARGIN_LEFT = 10;
|
|
@@ -31,6 +30,7 @@ const menuStore = useMenuStore();
|
|
|
31
30
|
const treeviewStore = useTreeviewStore();
|
|
32
31
|
|
|
33
32
|
const meta_data = computed(() => menuStore.current_meta_data || {});
|
|
33
|
+
const isSceneMenu = computed(() => meta_data.value.viewer_type === "scene");
|
|
34
34
|
provideBatchGroup(() => meta_data.value.targetIds ?? []);
|
|
35
35
|
|
|
36
36
|
const show_menu = ref<boolean>(true);
|
|
@@ -47,7 +47,7 @@ interface Position {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function clampPosition(posX: number, posY: number): Position {
|
|
50
|
-
const margin =
|
|
50
|
+
const margin = menuStore.menuRadius + MARGIN_OFFSET;
|
|
51
51
|
return {
|
|
52
52
|
x: Math.min(Math.max(posX, margin), containerWidth - margin),
|
|
53
53
|
y: Math.min(Math.max(posY, margin), containerHeight - margin),
|
|
@@ -158,8 +158,8 @@ const isOverToolbar = computed<boolean>(() => {
|
|
|
158
158
|
function getMenuStyle(): Record<string, string> {
|
|
159
159
|
return {
|
|
160
160
|
position: "fixed" as const,
|
|
161
|
-
left: `${menuStore.containerLeft + menuX.value -
|
|
162
|
-
top: `${menuStore.containerTop + menuY.value -
|
|
161
|
+
left: `${menuStore.containerLeft + menuX.value - menuStore.menuRadius}px`,
|
|
162
|
+
top: `${menuStore.containerTop + menuY.value - menuStore.menuRadius}px`,
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -180,7 +180,7 @@ function toggleShowName(): void {
|
|
|
180
180
|
<div class="circular-menu-drag-handle" @mousedown.stop="startDrag">
|
|
181
181
|
<div
|
|
182
182
|
class="circular-menu-items"
|
|
183
|
-
:style="{ width: `${
|
|
183
|
+
:style="{ width: `${menuStore.menuRadius * 2}px`, height: `${menuStore.menuRadius * 2}px` }"
|
|
184
184
|
>
|
|
185
185
|
<CircularItems
|
|
186
186
|
:menu-items="menu_items"
|
|
@@ -190,6 +190,7 @@ function toggleShowName(): void {
|
|
|
190
190
|
/>
|
|
191
191
|
|
|
192
192
|
<CenterButton
|
|
193
|
+
v-if="!isSceneMenu"
|
|
193
194
|
:is-over-treeview="isOverTreeview"
|
|
194
195
|
:is-over-toolbar="isOverToolbar"
|
|
195
196
|
@drag="startDrag"
|
|
@@ -197,7 +198,7 @@ function toggleShowName(): void {
|
|
|
197
198
|
/>
|
|
198
199
|
|
|
199
200
|
<InfoCard
|
|
200
|
-
v-if="meta_data.viewer_type !== 'basemap'"
|
|
201
|
+
v-if="!isSceneMenu && meta_data.viewer_type !== 'basemap'"
|
|
201
202
|
v-model:show="showName"
|
|
202
203
|
:meta-data="meta_data"
|
|
203
204
|
/>
|
|
@@ -8,7 +8,6 @@ import { useTreeviewStore } from "@ogw_front/stores/treeview";
|
|
|
8
8
|
const CARD_WIDTH = 300;
|
|
9
9
|
const CARD_HEIGHT = 500;
|
|
10
10
|
const MARGIN = 60;
|
|
11
|
-
const RADIUS = 80;
|
|
12
11
|
const OFFSET = 40;
|
|
13
12
|
|
|
14
13
|
const menuStore = useMenuStore();
|
|
@@ -36,8 +35,8 @@ const { index, itemProps, tooltip, btnImage = "", btnIcon = "" } = defineProps<P
|
|
|
36
35
|
|
|
37
36
|
const buttonCoords = computed(() => {
|
|
38
37
|
const angle = (index / itemProps.totalItems) * 2 * Math.PI;
|
|
39
|
-
const deltaX = Math.cos(angle) *
|
|
40
|
-
const deltaY = Math.sin(angle) *
|
|
38
|
+
const deltaX = Math.cos(angle) * menuStore.menuRadius;
|
|
39
|
+
const deltaY = Math.sin(angle) * menuStore.menuRadius;
|
|
41
40
|
const size = 40;
|
|
42
41
|
return {
|
|
43
42
|
x: menuStore.containerLeft + menuStore.menuX + deltaX - size / 2,
|
|
@@ -110,7 +109,7 @@ const optionsStyle = computed<Record<string, string>>(() => {
|
|
|
110
109
|
return {};
|
|
111
110
|
}
|
|
112
111
|
const angle = (index / itemProps.totalItems) * 2 * Math.PI;
|
|
113
|
-
const radius =
|
|
112
|
+
const radius = menuStore.menuRadius;
|
|
114
113
|
const absoluteButtonY = menuStore.menuY + Math.sin(angle) * radius;
|
|
115
114
|
const height = optionsHeight.value;
|
|
116
115
|
const margin = MARGIN;
|
|
@@ -127,7 +126,7 @@ const optionsStyle = computed<Record<string, string>>(() => {
|
|
|
127
126
|
const optionsClass = computed<string>(() => {
|
|
128
127
|
const loc = itemProps.tooltip_location;
|
|
129
128
|
const margin = MARGIN;
|
|
130
|
-
const radius =
|
|
129
|
+
const radius = menuStore.menuRadius;
|
|
131
130
|
if (loc === "right") {
|
|
132
131
|
return menuStore.menuX + radius + margin + CARD_WIDTH > menuStore.containerWidth
|
|
133
132
|
? "options-left"
|