@geode/opengeodeweb-front 10.34.0-rc.8 → 10.34.0
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/{server → .build/server}/utils/app_config.js +10 -9
- package/{server → .build/server}/utils/cleanup.js +31 -17
- package/{server → .build/server}/utils/cloud.js +1 -4
- package/{server → .build/server}/utils/microservices.js +21 -9
- package/{server → .build/server}/utils/path.js +4 -4
- package/{server → .build/server}/utils/scripts.js +9 -9
- package/.build/server/utils/server_config.js +51 -0
- package/.build/server/utils/stream.js +6 -0
- package/{server → .build/server}/utils/ws_client.js +18 -3
- package/{shared → .build/shared}/scripts.js +10 -10
- package/.build/shared/utils/call_raw.js +31 -0
- package/{shared → .build/shared}/utils/call_schema.js +2 -2
- package/.build/shared/utils/fetch_raw.js +52 -0
- package/{shared → .build/shared}/utils/fetch_schema.js +2 -2
- package/{shared → .build/shared}/utils/file.js +3 -1
- package/{shared → .build/shared}/utils/response_handlers/load.js +10 -7
- package/{shared → .build/shared}/utils/validate_schema.js +1 -1
- package/app/components/ActionButton.vue +6 -6
- package/app/components/CameraManager/List.vue +5 -5
- package/app/components/CameraManager/Saver.vue +3 -5
- package/app/components/CameraManager.vue +6 -4
- package/app/components/CameraOrientation.vue +12 -12
- package/app/components/ClippingPlaneCard.vue +4 -2
- package/app/components/ClippingPlanes.vue +8 -8
- package/app/components/CrsSelector.vue +9 -10
- package/app/components/DeleteDialog.vue +4 -2
- package/app/components/DragAndDrop.vue +10 -12
- package/app/components/DragAndDropInternal/DragAndDropInline.vue +4 -2
- package/app/components/ExtensionSelector.vue +4 -4
- package/app/components/FeedBack/ErrorBanner.vue +3 -1
- package/app/components/FeedBack/Snackers.vue +4 -3
- package/app/components/FileSelector.vue +10 -8
- package/app/components/FileUploader.vue +11 -11
- package/app/components/GlassCard.vue +1 -1
- package/app/components/HybridRenderingView.vue +7 -5
- package/app/components/HybridViewerTooltip.vue +7 -7
- package/app/components/Launcher.vue +1 -1
- package/app/components/Loading/EcoMessages.vue +9 -3
- package/app/components/Loading.vue +2 -2
- package/app/components/MissingFilesSelector.vue +12 -10
- package/app/components/ObjectSelector.vue +10 -9
- package/app/components/PackagesVersions.vue +6 -5
- package/app/components/Recaptcha.vue +3 -3
- package/app/components/RemoteRenderingView.vue +6 -7
- package/app/components/Ruler.vue +3 -3
- package/app/components/Screenshot.vue +6 -6
- package/app/components/SearchBar.vue +4 -2
- package/app/components/ShrinkFilter.vue +7 -7
- package/app/components/Step.vue +6 -5
- package/app/components/Stepper.vue +4 -3
- package/app/components/ToolPanel.vue +6 -3
- package/app/components/ViewToolbar.vue +25 -28
- package/app/components/Viewer/ContextMenu/CenterButton.vue +7 -5
- package/app/components/Viewer/ContextMenu/CircularItems.vue +3 -3
- package/app/components/Viewer/ContextMenu/ContextMenu.vue +22 -19
- package/app/components/Viewer/ContextMenu/ContextMenuItem.vue +10 -8
- package/app/components/Viewer/ContextMenu/InfoCard.vue +11 -12
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +13 -17
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +11 -15
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +12 -16
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +8 -12
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +11 -15
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +11 -15
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +67 -38
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +53 -23
- package/app/components/Viewer/Generic/Model/EdgesOptions.vue +1 -3
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +67 -38
- package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +31 -15
- package/app/components/Viewer/Generic/Model/ModelStyleOptions.vue +2 -3
- package/app/components/Viewer/Generic/Model/PointsOptions.vue +6 -6
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +69 -38
- package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +64 -46
- package/app/components/Viewer/ObjectTree/Base/Controls.vue +5 -5
- package/app/components/Viewer/ObjectTree/Base/ItemLabel.vue +13 -9
- package/app/components/Viewer/ObjectTree/Base/StickyHeader.vue +5 -5
- package/app/components/Viewer/ObjectTree/Base/TreeRow.vue +10 -10
- package/app/components/Viewer/ObjectTree/Box.vue +6 -4
- package/app/components/Viewer/ObjectTree/Layout.vue +23 -21
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +14 -14
- package/app/components/Viewer/ObjectTree/Views/{ModelCollections.vue → ModelTree.vue} +59 -24
- package/app/components/Viewer/Options/AttributeColorBar.vue +4 -2
- package/app/components/Viewer/Options/AttributeRangeSelector.vue +4 -2
- package/app/components/Viewer/Options/AttributeSelector.vue +7 -9
- package/app/components/Viewer/Options/ColorMapList.vue +15 -13
- package/app/components/Viewer/Options/ColorMapPicker.vue +4 -4
- package/app/components/Viewer/Options/ColorPicker.vue +223 -41
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +16 -16
- package/app/components/Viewer/Options/ColormapQuickPicker.vue +7 -5
- package/app/components/Viewer/Options/OptionsSection.vue +1 -1
- package/app/components/Viewer/Options/TextureItem.vue +8 -6
- package/app/components/Viewer/Options/TexturesSelector.vue +1 -1
- package/app/components/Viewer/OverlappingObjectsPicker.vue +8 -9
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +2 -6
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +12 -16
- package/app/components/Viewer/Surface/PolygonsOptions.vue +12 -16
- package/app/components/Viewer/Ui.vue +2 -2
- package/app/components/Wrapper.vue +1 -4
- package/app/components/ZScaling.vue +5 -3
- package/app/components/csv-preview/CsvPreviewer.vue +38 -37
- package/app/components/csv-preview/CsvSettings.vue +6 -4
- package/app/components/csv-preview/CsvTable.vue +1 -1
- package/app/composables/batch_style.ts +5 -6
- package/app/composables/clipping_planes_widget.ts +73 -181
- package/app/composables/clipping_planes_widget_entries.ts +189 -0
- package/app/composables/copy_to_clipboard.ts +7 -0
- package/app/composables/global_attribute_style.ts +163 -83
- package/app/composables/hover_highlight.ts +46 -14
- package/app/composables/model_collections.ts +26 -13
- package/app/composables/model_components.ts +26 -13
- package/app/composables/project_manager.ts +76 -19
- package/app/composables/responsive_middle_truncate.ts +13 -13
- package/app/composables/stepper_tree.ts +34 -11
- package/app/composables/tree_filter.ts +66 -44
- package/app/composables/tree_keyboard_nav.ts +25 -11
- package/app/composables/tree_scroll.ts +44 -14
- package/app/composables/use_adaptive_styles.ts +66 -23
- package/app/composables/use_overlapping_picker.ts +66 -16
- package/app/composables/use_quick_colormap.ts +16 -5
- package/app/composables/virtual_tree.ts +75 -43
- package/app/composables/vtk_implicit_plane_widget.d.ts +2 -0
- package/app/plugins/auto_store_register.ts +2 -7
- package/app/plugins/click_outside_ignore_snackbars.client.ts +39 -0
- package/app/stores/app.ts +57 -192
- package/app/stores/app_helpers/extension.ts +179 -0
- package/app/stores/back.ts +37 -21
- package/app/stores/camera_manager.ts +22 -20
- package/app/stores/cloud.ts +17 -13
- package/app/stores/data.ts +88 -47
- package/app/stores/data_helpers/collections.ts +36 -38
- package/app/stores/data_helpers/mesh.ts +45 -36
- package/app/stores/data_style.ts +50 -28
- package/app/stores/feedback.ts +6 -6
- package/app/stores/hybrid_viewer.ts +41 -52
- package/app/stores/infra.ts +39 -37
- package/app/stores/menu.ts +23 -14
- package/app/stores/treeview.ts +72 -42
- package/app/stores/viewer.ts +39 -27
- package/app/utils/attributes.ts +3 -3
- package/app/utils/clipping_planes.ts +111 -14
- package/app/utils/color_picker.ts +57 -0
- package/app/utils/colormap.ts +58 -35
- package/app/utils/default_styles/index.ts +2 -2
- package/app/utils/default_styles/meshes.ts +107 -13
- package/app/utils/default_styles/models.ts +83 -14
- package/app/utils/extension.ts +47 -20
- package/app/utils/import_workflow.ts +21 -13
- package/app/utils/name_cleaner.ts +1 -1
- package/app/utils/string.ts +1 -1
- package/app/utils/treeview.ts +2 -2
- package/internal/database/base_database.ts +7 -3
- package/internal/database/database.ts +36 -26
- package/internal/database/extended_database.ts +1 -1
- package/internal/stores/data_style/mesh/cells/cell.ts +70 -34
- package/internal/stores/data_style/mesh/cells/color.ts +12 -6
- package/internal/stores/data_style/mesh/cells/common.ts +18 -8
- package/internal/stores/data_style/mesh/cells/index.ts +122 -42
- package/internal/stores/data_style/mesh/cells/textures.ts +12 -6
- package/internal/stores/data_style/mesh/cells/vertex.ts +75 -34
- package/internal/stores/data_style/mesh/cells/visibility.ts +15 -4
- package/internal/stores/data_style/mesh/edges/color.ts +12 -6
- package/internal/stores/data_style/mesh/edges/common.ts +14 -6
- package/internal/stores/data_style/mesh/edges/edge.ts +71 -39
- package/internal/stores/data_style/mesh/edges/index.ts +117 -42
- package/internal/stores/data_style/mesh/edges/vertex.ts +76 -39
- package/internal/stores/data_style/mesh/edges/visibility.ts +15 -4
- package/internal/stores/data_style/mesh/edges/width.ts +12 -4
- package/internal/stores/data_style/mesh/index.ts +30 -11
- package/internal/stores/data_style/mesh/points/color.ts +12 -6
- package/internal/stores/data_style/mesh/points/common.ts +21 -8
- package/internal/stores/data_style/mesh/points/index.ts +101 -50
- package/internal/stores/data_style/mesh/points/size.ts +12 -4
- package/internal/stores/data_style/mesh/points/vertex.ts +75 -34
- package/internal/stores/data_style/mesh/points/visibility.ts +17 -7
- package/internal/stores/data_style/mesh/polygons/color.ts +12 -6
- package/internal/stores/data_style/mesh/polygons/common.ts +23 -6
- package/internal/stores/data_style/mesh/polygons/index.ts +130 -70
- package/internal/stores/data_style/mesh/polygons/polygon.ts +77 -43
- package/internal/stores/data_style/mesh/polygons/textures.ts +12 -6
- package/internal/stores/data_style/mesh/polygons/vertex.ts +79 -39
- package/internal/stores/data_style/mesh/polygons/visibility.ts +16 -6
- package/internal/stores/data_style/mesh/polyhedra/color.ts +12 -6
- package/internal/stores/data_style/mesh/polyhedra/common.ts +14 -6
- package/internal/stores/data_style/mesh/polyhedra/index.ts +115 -56
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +80 -39
- package/internal/stores/data_style/mesh/polyhedra/vertex.ts +79 -39
- package/internal/stores/data_style/mesh/polyhedra/visibility.ts +16 -6
- package/internal/stores/data_style/model/blocks/color.ts +43 -13
- package/internal/stores/data_style/model/blocks/common.ts +21 -6
- package/internal/stores/data_style/model/blocks/index.ts +89 -59
- package/internal/stores/data_style/model/blocks/polyhedron.ts +101 -44
- package/internal/stores/data_style/model/blocks/vertex.ts +107 -42
- package/internal/stores/data_style/model/blocks/visibility.ts +17 -4
- package/internal/stores/data_style/model/color.ts +171 -83
- package/internal/stores/data_style/model/common.ts +70 -21
- package/internal/stores/data_style/model/corners/color.ts +43 -11
- package/internal/stores/data_style/model/corners/common.ts +25 -6
- package/internal/stores/data_style/model/corners/index.ts +66 -41
- package/internal/stores/data_style/model/corners/vertex.ts +105 -74
- package/internal/stores/data_style/model/corners/visibility.ts +19 -4
- package/internal/stores/data_style/model/edges/common.ts +12 -4
- package/internal/stores/data_style/model/edges/index.ts +2 -1
- package/internal/stores/data_style/model/edges/visibility.ts +24 -7
- package/internal/stores/data_style/model/index.ts +24 -11
- package/internal/stores/data_style/model/lines/color.ts +41 -11
- package/internal/stores/data_style/model/lines/common.ts +17 -6
- package/internal/stores/data_style/model/lines/edge.ts +105 -42
- package/internal/stores/data_style/model/lines/index.ts +86 -59
- package/internal/stores/data_style/model/lines/vertex.ts +105 -42
- package/internal/stores/data_style/model/lines/visibility.ts +17 -4
- package/internal/stores/data_style/model/points/common.ts +8 -4
- package/internal/stores/data_style/model/points/index.ts +10 -3
- package/internal/stores/data_style/model/points/size.ts +12 -4
- package/internal/stores/data_style/model/points/visibility.ts +16 -6
- package/internal/stores/data_style/model/selection.ts +80 -58
- package/internal/stores/data_style/model/surfaces/color.ts +41 -11
- package/internal/stores/data_style/model/surfaces/common.ts +23 -6
- package/internal/stores/data_style/model/surfaces/index.ts +89 -59
- package/internal/stores/data_style/model/surfaces/polygon.ts +107 -67
- package/internal/stores/data_style/model/surfaces/vertex.ts +111 -67
- package/internal/stores/data_style/model/surfaces/visibility.ts +18 -5
- package/internal/stores/data_style/model/visibility.ts +82 -20
- package/internal/stores/data_style/state.ts +77 -65
- package/internal/stores/hybrid_viewer/brightness.ts +49 -31
- package/internal/stores/hybrid_viewer/camera.ts +191 -177
- package/internal/stores/hybrid_viewer/camera_animation.ts +11 -10
- package/internal/stores/hybrid_viewer/core.ts +64 -0
- package/internal/stores/hybrid_viewer/filters.ts +10 -16
- package/internal/stores/hybrid_viewer/highlight.ts +91 -130
- package/internal/stores/hybrid_viewer/ruler.ts +24 -15
- package/internal/stores/hybrid_viewer/scene.ts +96 -117
- package/internal/stores/hybrid_viewer/viewport.ts +74 -65
- package/internal/stores/hybrid_viewer/vtk_types.ts +13 -29
- package/internal/utils/api_fetch.ts +54 -23
- package/internal/utils/upload_file.ts +74 -53
- package/internal/utils/viewer_call.ts +22 -13
- package/internal/utils/ws_client.ts +24 -13
- package/nuxt.config.ts +58 -1
- package/package.json +20 -8
- package/server/api/cloud/extensions/run.post.ts +6 -10
- package/server/api/local/app/project_folder_path.post.ts +4 -4
- package/server/api/local/app/run_back.post.ts +5 -7
- package/server/api/local/app/run_viewer.post.ts +5 -7
- package/server/api/local/extensions/kill.post.ts +4 -3
- package/server/api/local/extensions/run.post.ts +7 -10
- package/server/api/local/extensions/upload.put.ts +44 -54
- package/server/api/microservice/app/get_is_app_ready.get.ts +4 -5
- package/server/api/microservice/app/set_app_base_url.post.ts +5 -6
- package/server/api/microservice/app/set_back_base_url.post.ts +5 -6
- package/server/api/microservice/app/set_is_app_ready.post.ts +5 -6
- package/server/api/microservice/app/set_viewer_base_url.post.ts +5 -6
- package/server/api/microservice/extensions/download.post.ts +5 -4
- package/server/api/serverless/run_cloud.post.ts +53 -11
- package/server/utils/app_config.ts +29 -22
- package/server/utils/cleanup.ts +60 -30
- package/server/utils/cloud.ts +9 -8
- package/server/utils/extension.ts +23 -9
- package/server/utils/microservices.ts +33 -24
- package/server/utils/path.ts +4 -4
- package/server/utils/scripts.ts +26 -23
- package/server/utils/server.ts +2 -2
- package/server/utils/server_config.ts +41 -27
- package/server/utils/stream.ts +6 -0
- package/server/utils/ws_client.ts +42 -8
- package/shared/scripts.ts +15 -10
- package/shared/utils/call_raw.ts +23 -16
- package/shared/utils/call_schema.ts +5 -8
- package/shared/utils/fetch_raw.ts +87 -47
- package/shared/utils/fetch_schema.ts +6 -9
- package/shared/utils/file.ts +8 -2
- package/shared/utils/response_handlers/load.ts +26 -11
- package/shared/utils/types.ts +9 -9
- package/shared/utils/validate_schema.ts +1 -1
- package/app/components/Viewer/ObjectTree/Views/ModelComponents.vue +0 -276
- package/server/types/vendor.d.ts +0 -64
- package/server/utils/server_config.js +0 -43
- package/shared/utils/call_raw.js +0 -30
- package/shared/utils/fetch_raw.js +0 -40
- /package/{opengeodeweb_front_schemas.js → .build/opengeodeweb_front_schemas.js} +0 -0
- /package/{server → .build/server}/utils/server.js +0 -0
- /package/{shared → .build/shared}/app_mode.js +0 -0
- /package/{shared → .build/shared}/utils/parse_boolean.js +0 -0
- /package/{shared → .build/shared}/utils/types.js +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// oxlint-disable id-length
|
|
2
|
+
// oxlint-disable id-length since vuetify require { r,g,b} format to work
|
|
3
|
+
import { formatColorString, parseColorString } from "@ogw_front/utils/color_picker";
|
|
3
4
|
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
5
|
+
import { useCopyToClipboard } from "@ogw_front/composables/copy_to_clipboard";
|
|
4
6
|
|
|
5
7
|
interface Props {
|
|
6
8
|
disabledAlpha?: boolean;
|
|
@@ -8,12 +10,15 @@ interface Props {
|
|
|
8
10
|
|
|
9
11
|
const { disabledAlpha = false } = defineProps<Props>();
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
+
const colorPickerWrapperRef = useTemplateRef<HTMLElement>("colorPickerWrapperRef");
|
|
14
|
+
const { pressed } = useMousePressed({ target: colorPickerWrapperRef });
|
|
15
|
+
|
|
13
16
|
const model = defineModel<RGBAColor>();
|
|
14
|
-
const {
|
|
17
|
+
const { copy, copied } = useCopyToClipboard();
|
|
18
|
+
|
|
19
|
+
const currentMode = ref(disabledAlpha ? "rgb" : "rgba");
|
|
20
|
+
const colorInputText = ref("");
|
|
15
21
|
|
|
16
|
-
// The model is always bound by every current caller (ColoringTypeSelector.vue, AttributeSelector.vue); defineModel can't express that as a required prop without breaking its optional v-model contract, so this reads it as defined here.
|
|
17
22
|
const initialColor = model.value as RGBAColor;
|
|
18
23
|
const vuetifyColor = ref({
|
|
19
24
|
r: initialColor.red,
|
|
@@ -22,69 +27,246 @@ const vuetifyColor = ref({
|
|
|
22
27
|
a: initialColor.alpha,
|
|
23
28
|
});
|
|
24
29
|
|
|
30
|
+
function updateInputTextFromColor(red: number, green: number, blue: number, alpha: number): void {
|
|
31
|
+
colorInputText.value =
|
|
32
|
+
disabledAlpha || currentMode.value === "rgb"
|
|
33
|
+
? `${red}, ${green}, ${blue}`
|
|
34
|
+
: `${red}, ${green}, ${blue}, ${alpha}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface VuetifyColor {
|
|
38
|
+
r: number;
|
|
39
|
+
g: number;
|
|
40
|
+
b: number;
|
|
41
|
+
a: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function commitColorToModel(): void {
|
|
45
|
+
const { r: red, g: green, b: blue, a: alpha } = vuetifyColor.value;
|
|
46
|
+
model.value = { red, green, blue, alpha };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function onPickerUpdate(color: VuetifyColor): void {
|
|
50
|
+
const red = Math.round(color.r);
|
|
51
|
+
const green = Math.round(color.g);
|
|
52
|
+
const blue = Math.round(color.b);
|
|
53
|
+
const alpha = disabledAlpha ? 1 : Number(color.a.toFixed(2));
|
|
54
|
+
|
|
55
|
+
vuetifyColor.value = { r: red, g: green, b: blue, a: alpha };
|
|
56
|
+
updateInputTextFromColor(red, green, blue, alpha);
|
|
57
|
+
if (!pressed.value) {
|
|
58
|
+
commitColorToModel();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function toggleMode(): void {
|
|
63
|
+
if (disabledAlpha) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
currentMode.value = currentMode.value === "rgba" ? "rgb" : "rgba";
|
|
67
|
+
const { r: red, g: green, b: blue, a: alpha } = vuetifyColor.value;
|
|
68
|
+
updateInputTextFromColor(red, green, blue, alpha);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function copyToClipboard(): Promise<void> {
|
|
72
|
+
const { r: red, g: green, b: blue, a: alpha } = vuetifyColor.value;
|
|
73
|
+
await copy(formatColorString({ red, green, blue, alpha }, currentMode.value));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function parseAndApplyText(text: string): boolean {
|
|
77
|
+
const parsed = parseColorString(text);
|
|
78
|
+
if (!parsed) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const { red, green, blue, alpha: rawAlpha } = parsed;
|
|
83
|
+
const alpha = disabledAlpha ? 1 : rawAlpha;
|
|
84
|
+
|
|
85
|
+
if (!disabledAlpha && alpha < 1) {
|
|
86
|
+
currentMode.value = "rgba";
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
vuetifyColor.value = { r: red, g: green, b: blue, a: alpha };
|
|
90
|
+
model.value = { red, green, blue, alpha };
|
|
91
|
+
updateInputTextFromColor(red, green, blue, alpha);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function onInputPaste(event: ClipboardEvent): void {
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
const text = event.clipboardData?.getData("text/plain") ?? "";
|
|
98
|
+
parseAndApplyText(text);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function onInputCommit(): void {
|
|
102
|
+
if (!parseAndApplyText(colorInputText.value)) {
|
|
103
|
+
const { r: red, g: green, b: blue, a: alpha } = vuetifyColor.value;
|
|
104
|
+
updateInputTextFromColor(red, green, blue, alpha);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
25
108
|
watch(
|
|
26
109
|
model,
|
|
27
110
|
(newValue) => {
|
|
28
111
|
if (!newValue) {
|
|
29
112
|
return;
|
|
30
113
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
114
|
+
const { red, green, blue, alpha } = newValue;
|
|
115
|
+
if (
|
|
116
|
+
vuetifyColor.value.r !== red ||
|
|
117
|
+
vuetifyColor.value.g !== green ||
|
|
118
|
+
vuetifyColor.value.b !== blue ||
|
|
119
|
+
vuetifyColor.value.a !== alpha
|
|
120
|
+
) {
|
|
121
|
+
vuetifyColor.value = { r: red, g: green, b: blue, a: alpha };
|
|
38
122
|
}
|
|
39
|
-
|
|
40
|
-
r: newValue.red,
|
|
41
|
-
g: newValue.green,
|
|
42
|
-
b: newValue.blue,
|
|
43
|
-
a: newValue.alpha,
|
|
44
|
-
};
|
|
123
|
+
updateInputTextFromColor(red, green, blue, alpha);
|
|
45
124
|
},
|
|
46
|
-
{ deep: true },
|
|
125
|
+
{ deep: true, immediate: true },
|
|
47
126
|
);
|
|
48
127
|
|
|
49
|
-
watch(pressed, (
|
|
50
|
-
if (!
|
|
51
|
-
|
|
52
|
-
red: vuetifyColor.value.r,
|
|
53
|
-
green: vuetifyColor.value.g,
|
|
54
|
-
blue: vuetifyColor.value.b,
|
|
55
|
-
alpha: vuetifyColor.value.a,
|
|
56
|
-
};
|
|
128
|
+
watch(pressed, (isPressed) => {
|
|
129
|
+
if (!isPressed) {
|
|
130
|
+
commitColorToModel();
|
|
57
131
|
}
|
|
58
132
|
});
|
|
133
|
+
|
|
134
|
+
watch(
|
|
135
|
+
() => disabledAlpha,
|
|
136
|
+
(disabled) => {
|
|
137
|
+
if (disabled) {
|
|
138
|
+
currentMode.value = "rgb";
|
|
139
|
+
if (model.value) {
|
|
140
|
+
model.value = { ...model.value, alpha: 1 };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
);
|
|
59
145
|
</script>
|
|
60
146
|
|
|
61
147
|
<template>
|
|
62
|
-
<
|
|
63
|
-
ref="
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
148
|
+
<div
|
|
149
|
+
ref="colorPickerWrapperRef"
|
|
150
|
+
class="color-picker-wrapper mx-auto rounded-lg overflow-hidden border"
|
|
151
|
+
>
|
|
152
|
+
<v-color-picker
|
|
153
|
+
data-testid="colorPicker"
|
|
154
|
+
:model-value="vuetifyColor"
|
|
155
|
+
@update:model-value="onPickerUpdate"
|
|
156
|
+
mode="rgba"
|
|
157
|
+
flat
|
|
158
|
+
canvas-height="75"
|
|
159
|
+
hide-eye-dropper
|
|
160
|
+
hide-inputs
|
|
161
|
+
:disabled-alpha="disabledAlpha"
|
|
162
|
+
width="220"
|
|
163
|
+
class="mx-auto bg-transparent"
|
|
164
|
+
/>
|
|
165
|
+
|
|
166
|
+
<div class="color-picker-controls pa-2 pt-0">
|
|
167
|
+
<div class="d-flex align-center justify-space-between px-1 mb-1">
|
|
168
|
+
<div class="d-flex align-center ga-1">
|
|
169
|
+
<span
|
|
170
|
+
class="text-caption font-weight-medium text-uppercase text-medium-emphasis"
|
|
171
|
+
style="font-size: 0.68rem"
|
|
172
|
+
>
|
|
173
|
+
{{ currentMode }}
|
|
174
|
+
</span>
|
|
175
|
+
<v-btn
|
|
176
|
+
v-if="!disabledAlpha"
|
|
177
|
+
icon
|
|
178
|
+
density="compact"
|
|
179
|
+
variant="text"
|
|
180
|
+
size="small"
|
|
181
|
+
@click="toggleMode"
|
|
182
|
+
v-tooltip="'Swap mode (RGB / RGBA)'"
|
|
183
|
+
>
|
|
184
|
+
<v-icon icon="mdi-swap-horizontal" size="16" />
|
|
185
|
+
</v-btn>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
<v-btn
|
|
189
|
+
data-testid="copyColorBtn"
|
|
190
|
+
icon
|
|
191
|
+
density="compact"
|
|
192
|
+
variant="text"
|
|
193
|
+
size="small"
|
|
194
|
+
@click="copyToClipboard"
|
|
195
|
+
v-tooltip="'Copy to clipboard'"
|
|
196
|
+
>
|
|
197
|
+
<v-icon
|
|
198
|
+
:icon="copied ? 'mdi-check' : 'mdi-content-copy'"
|
|
199
|
+
size="14"
|
|
200
|
+
:color="copied ? 'success' : undefined"
|
|
201
|
+
/>
|
|
202
|
+
</v-btn>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
<input
|
|
206
|
+
data-testid="colorInput"
|
|
207
|
+
v-model="colorInputText"
|
|
208
|
+
class="color-input-field"
|
|
209
|
+
type="text"
|
|
210
|
+
spellcheck="false"
|
|
211
|
+
autocomplete="off"
|
|
212
|
+
@paste="onInputPaste"
|
|
213
|
+
@change="onInputCommit"
|
|
214
|
+
@keydown.enter.prevent="onInputCommit"
|
|
215
|
+
/>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
75
218
|
</template>
|
|
76
219
|
|
|
77
220
|
<style scoped>
|
|
221
|
+
.color-picker-wrapper {
|
|
222
|
+
width: 220px;
|
|
223
|
+
background-color: rgba(33, 33, 33, 0.95);
|
|
224
|
+
border: 1px solid rgba(255, 255, 255, 0.12) !important;
|
|
225
|
+
outline: none;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
:deep(.v-color-picker) {
|
|
229
|
+
background-color: transparent !important;
|
|
230
|
+
box-shadow: none !important;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
:deep(.v-color-picker-canvas),
|
|
234
|
+
:deep(.v-color-picker__preview),
|
|
235
|
+
:deep(.v-color-picker__controls) {
|
|
236
|
+
box-shadow: none !important;
|
|
237
|
+
}
|
|
238
|
+
|
|
78
239
|
:deep(.v-color-picker__controls) {
|
|
79
|
-
padding: 8px !important;
|
|
240
|
+
padding: 4px 8px 0 !important;
|
|
80
241
|
}
|
|
81
242
|
|
|
82
243
|
:deep(.v-color-picker__dot) {
|
|
83
244
|
width: 18px !important;
|
|
84
245
|
height: 18px !important;
|
|
246
|
+
box-shadow: none !important;
|
|
85
247
|
}
|
|
86
248
|
|
|
87
249
|
:deep(.v-color-picker__preview) {
|
|
88
250
|
margin-bottom: 0 !important;
|
|
89
251
|
}
|
|
252
|
+
|
|
253
|
+
.color-input-field {
|
|
254
|
+
width: 100%;
|
|
255
|
+
box-sizing: border-box;
|
|
256
|
+
padding: 6px 10px;
|
|
257
|
+
background-color: rgba(255, 255, 255, 0.08);
|
|
258
|
+
border: 1px solid transparent;
|
|
259
|
+
border-radius: 6px;
|
|
260
|
+
outline: none;
|
|
261
|
+
color: inherit;
|
|
262
|
+
font-size: 0.82rem;
|
|
263
|
+
font-family: monospace;
|
|
264
|
+
letter-spacing: 0.5px;
|
|
265
|
+
text-align: center;
|
|
266
|
+
transition: border-color 0.15s ease;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.color-input-field:focus {
|
|
270
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
271
|
+
}
|
|
90
272
|
</style>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { JsonRpcSchema } from "@ogw_shared/utils/types.js";
|
|
3
|
+
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
4
4
|
import ViewerOptionsAttributeSelector from "@ogw_front/components/Viewer/Options/AttributeSelector.vue";
|
|
5
5
|
import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
|
|
6
6
|
import ViewerOptionsTexturesSelector from "@ogw_front/components/Viewer/Options/TexturesSelector.vue";
|
|
7
7
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
8
|
-
import type { JsonRpcSchema } from "@ogw_shared/utils/types.js";
|
|
9
|
-
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
10
8
|
|
|
11
9
|
interface Texture {
|
|
12
10
|
id: string;
|
|
@@ -88,37 +86,39 @@ const polygonSchema = schemas.polygon || back_schemas.opengeodeweb_back.polygon_
|
|
|
88
86
|
const polyhedronSchema =
|
|
89
87
|
schemas.polyhedron || back_schemas.opengeodeweb_back.polyhedron_attribute_names;
|
|
90
88
|
|
|
91
|
-
function isAvailable(key: string) {
|
|
89
|
+
function isAvailable(key: string): boolean {
|
|
92
90
|
if (capabilities[key] && capabilities[key].available === false) {
|
|
93
91
|
return false;
|
|
94
92
|
}
|
|
95
93
|
return true;
|
|
96
94
|
}
|
|
97
95
|
|
|
98
|
-
function hasColorMap(key: string) {
|
|
96
|
+
function hasColorMap(key: string): boolean {
|
|
99
97
|
if (capabilities[key] && capabilities[key].hasColorMap === false) {
|
|
100
98
|
return false;
|
|
101
99
|
}
|
|
102
100
|
return true;
|
|
103
101
|
}
|
|
104
102
|
|
|
105
|
-
const has_color = computed(() => color.value !== undefined && isAvailable("color"));
|
|
106
|
-
const has_textures = computed(
|
|
107
|
-
|
|
103
|
+
const has_color = computed<boolean>(() => color.value !== undefined && isAvailable("color"));
|
|
104
|
+
const has_textures = computed<boolean>(
|
|
105
|
+
() => textures.value !== undefined && isAvailable("textures"),
|
|
106
|
+
);
|
|
107
|
+
const has_vertex = computed<boolean>(
|
|
108
108
|
() =>
|
|
109
109
|
vertex_attribute_range.value !== undefined && isAvailable("vertex") && hasColorMap("vertex"),
|
|
110
110
|
);
|
|
111
|
-
const has_edge = computed(
|
|
111
|
+
const has_edge = computed<boolean>(
|
|
112
112
|
() => edge_attribute_range.value !== undefined && isAvailable("edge") && hasColorMap("edge"),
|
|
113
113
|
);
|
|
114
|
-
const has_cells = computed(
|
|
114
|
+
const has_cells = computed<boolean>(
|
|
115
115
|
() => cell_attribute_range.value !== undefined && isAvailable("cell") && hasColorMap("cell"),
|
|
116
116
|
);
|
|
117
|
-
const has_polygons = computed(
|
|
117
|
+
const has_polygons = computed<boolean>(
|
|
118
118
|
() =>
|
|
119
119
|
polygon_attribute_range.value !== undefined && isAvailable("polygon") && hasColorMap("polygon"),
|
|
120
120
|
);
|
|
121
|
-
const has_polyhedra = computed(
|
|
121
|
+
const has_polyhedra = computed<boolean>(
|
|
122
122
|
() =>
|
|
123
123
|
polyhedron_attribute_range.value !== undefined &&
|
|
124
124
|
isAvailable("polyhedron") &&
|
|
@@ -136,7 +136,7 @@ const polyhedron_dict = {
|
|
|
136
136
|
name: "Polyhedron attribute",
|
|
137
137
|
value: "polyhedron",
|
|
138
138
|
};
|
|
139
|
-
const coloring_styles = computed(() => {
|
|
139
|
+
const coloring_styles = computed<{ labels: string[]; values: string[] }>(() => {
|
|
140
140
|
const array = [];
|
|
141
141
|
if (has_color.value) {
|
|
142
142
|
array.push(color_dict);
|
|
@@ -169,9 +169,9 @@ const coloring_styles = computed(() => {
|
|
|
169
169
|
return { labels, values };
|
|
170
170
|
});
|
|
171
171
|
|
|
172
|
-
const coloring_style_label = ref("");
|
|
172
|
+
const coloring_style_label = ref<string>("");
|
|
173
173
|
|
|
174
|
-
const active_key = computed(() => {
|
|
174
|
+
const active_key = computed<string | undefined>(() => {
|
|
175
175
|
const index = coloring_styles.value.labels.indexOf(coloring_style_label.value);
|
|
176
176
|
return index === -1 ? coloring_style_key.value : coloring_styles.value.values[index];
|
|
177
177
|
});
|
|
@@ -15,27 +15,29 @@ const { dataId = undefined, x, y } = defineProps<Props>();
|
|
|
15
15
|
|
|
16
16
|
const show = defineModel<boolean>("show", { default: false });
|
|
17
17
|
|
|
18
|
-
const dataIdRef = computed(() => dataId);
|
|
18
|
+
const dataIdRef = computed<string>(() => dataId);
|
|
19
19
|
const { currentColormap, currentRange, applyGlobalColormap, resetGlobalRange } =
|
|
20
20
|
useGlobalAttributeStyle(dataIdRef);
|
|
21
21
|
|
|
22
|
-
const minimum = computed({
|
|
22
|
+
const minimum = computed<number>({
|
|
23
23
|
get: () => currentRange.value[0],
|
|
24
24
|
set: (val) => {
|
|
25
25
|
currentRange.value = [val, currentRange.value[1]];
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
const maximum = computed({
|
|
29
|
+
const maximum = computed<number>({
|
|
30
30
|
get: () => currentRange.value[1],
|
|
31
31
|
set: (val) => {
|
|
32
32
|
currentRange.value = [currentRange.value[0], val];
|
|
33
33
|
},
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
const quickColormapPresets = computed(() =>
|
|
36
|
+
const quickColormapPresets = computed<{ Name: string }[]>(() =>
|
|
37
|
+
getPresetsWithCurrentAtTop(currentColormap.value),
|
|
38
|
+
);
|
|
37
39
|
|
|
38
|
-
async function onQuickColormapSelect(preset: { Name: string }) {
|
|
40
|
+
async function onQuickColormapSelect(preset: { Name: string }): Promise<void> {
|
|
39
41
|
await applyGlobalColormap(preset.Name);
|
|
40
42
|
}
|
|
41
43
|
</script>
|
|
@@ -6,9 +6,11 @@ import { useBackStore } from "@ogw_front/stores/back";
|
|
|
6
6
|
// Mirrors FileUploader's own (unexported) UploadFile type.
|
|
7
7
|
type UploadFile = File & { isConfigured?: boolean; displayName?: string };
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
interface Emits {
|
|
10
10
|
update_value: [payload: { key: "texture_name" | "id"; value: string }];
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const emit = defineEmits<Emits>();
|
|
12
14
|
|
|
13
15
|
interface Props {
|
|
14
16
|
id: string;
|
|
@@ -18,8 +20,8 @@ interface Props {
|
|
|
18
20
|
|
|
19
21
|
const { id, textureId: propTextureId, textureName: propTextureName } = defineProps<Props>();
|
|
20
22
|
|
|
21
|
-
const textureName = ref(propTextureName);
|
|
22
|
-
const textureId = ref(propTextureId);
|
|
23
|
+
const textureName = ref<string>(propTextureName);
|
|
24
|
+
const textureId = ref<string>(propTextureId);
|
|
23
25
|
|
|
24
26
|
watch(
|
|
25
27
|
() => propTextureName,
|
|
@@ -38,7 +40,7 @@ watch(
|
|
|
38
40
|
const textureCoordinates = ref<string[]>([]);
|
|
39
41
|
const backStore = useBackStore();
|
|
40
42
|
|
|
41
|
-
function getTextureCoordinates() {
|
|
43
|
+
function getTextureCoordinates(): void {
|
|
42
44
|
const schema = back_schemas.opengeodeweb_back.texture_coordinates;
|
|
43
45
|
const params = { id };
|
|
44
46
|
backStore.request(
|
|
@@ -57,7 +59,7 @@ onMounted(() => {
|
|
|
57
59
|
getTextureCoordinates();
|
|
58
60
|
});
|
|
59
61
|
|
|
60
|
-
async function files_uploaded_event(value: UploadFile[]) {
|
|
62
|
+
async function files_uploaded_event(value: UploadFile[]): Promise<void> {
|
|
61
63
|
if (value.length > 0 && value[0]) {
|
|
62
64
|
const schema = back_schemas.opengeodeweb_back.save_viewable_file;
|
|
63
65
|
const params = {
|
|
@@ -24,7 +24,7 @@ onMounted(() => {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
function update_value_event($event: { key: keyof Texture; value: string }, index: number) {
|
|
27
|
+
function update_value_event($event: { key: keyof Texture; value: string }, index: number): void {
|
|
28
28
|
const texture = internal_textures.value[index];
|
|
29
29
|
if (!texture) {
|
|
30
30
|
return;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// Not auto-fixable (eslint's sort-imports core rule has no autofixer) and this file's import order doesn't match its syntax-kind-then-alphabetical requirement - left as-is rather than manually reordered across the codebase for a purely cosmetic rule.
|
|
3
|
-
// oxlint-disable eslint/sort-imports
|
|
4
2
|
import GlassCard from "@ogw_front/components/GlassCard.vue";
|
|
5
3
|
import { formatListId } from "@ogw_front/utils/name_cleaner";
|
|
6
4
|
import { geode_objects } from "@ogw_front/assets/geode_objects";
|
|
7
5
|
|
|
8
|
-
// Mirrors the use_overlapping_picker composable's (unexported) ProposedItem type.
|
|
9
6
|
interface IntermediateItem {
|
|
10
7
|
id: string;
|
|
11
|
-
viewer_id: number;
|
|
8
|
+
viewer_id: number | undefined;
|
|
12
9
|
name: string;
|
|
13
10
|
viewer_type: string | undefined;
|
|
14
11
|
geode_object_type: string | undefined;
|
|
@@ -17,21 +14,23 @@ interface IntermediateItem {
|
|
|
17
14
|
interface Props {
|
|
18
15
|
displayIntermediate: boolean;
|
|
19
16
|
intermediateItems: IntermediateItem[];
|
|
20
|
-
menuStyle: Record<string,
|
|
17
|
+
menuStyle: Record<string, unknown>;
|
|
21
18
|
}
|
|
22
19
|
|
|
23
20
|
const { displayIntermediate, intermediateItems, menuStyle } = defineProps<Props>();
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
interface Emits {
|
|
26
23
|
select: [item: IntermediateItem];
|
|
27
24
|
"update:displayIntermediate": [val: boolean];
|
|
28
|
-
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const emit = defineEmits<Emits>();
|
|
29
28
|
|
|
30
|
-
function selectItem(item: IntermediateItem) {
|
|
29
|
+
function selectItem(item: IntermediateItem): void {
|
|
31
30
|
emit("select", item);
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
function handleUpdate(val: boolean) {
|
|
33
|
+
function handleUpdate(val: boolean): void {
|
|
35
34
|
emit("update:displayIntermediate", val);
|
|
36
35
|
}
|
|
37
36
|
</script>
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// Not auto-fixable (eslint's sort-imports core rule has no autofixer) and this file's import order doesn't match its syntax-kind-then-alphabetical requirement - left as-is rather than manually reordered across the codebase for a purely cosmetic rule.
|
|
3
|
-
// oxlint-disable eslint/sort-imports
|
|
4
|
-
import PointSetPoints from "@ogw_front/assets/viewer_svgs/point_set_points.svg";
|
|
5
|
-
// oxlint-disable import/consistent-type-specifier-style -- combining the default import with the type import avoids a duplicate-imports violation on this same module; using disable-next-line here is fragile because a formatter can re-wrap the import onto multiple lines and shift the flagged line
|
|
6
2
|
import ViewerContextMenuItem, {
|
|
7
3
|
type ItemProps,
|
|
8
4
|
} from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
|
|
5
|
+
import PointSetPoints from "@ogw_front/assets/viewer_svgs/point_set_points.svg";
|
|
6
|
+
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
9
7
|
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
|
|
10
8
|
import ViewerOptionsSizeSlider from "@ogw_front/components/Viewer/Options/Sliders/Size.vue";
|
|
11
9
|
import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
|
|
12
|
-
|
|
13
10
|
import { useBatchStyle } from "@ogw_front/composables/batch_style";
|
|
14
11
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
15
12
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
16
|
-
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
17
13
|
|
|
18
14
|
const dataStyleStore = useDataStyleStore();
|
|
19
15
|
const hybridViewerStore = useHybridViewerStore();
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// Not auto-fixable (eslint's sort-imports core rule has no autofixer) and this file's import order doesn't match its syntax-kind-then-alphabetical requirement - left as-is rather than manually reordered across the codebase for a purely cosmetic rule.
|
|
3
|
-
// oxlint-disable eslint/sort-imports
|
|
4
|
-
import SolidPolyhedra from "@ogw_front/assets/viewer_svgs/solid_polyhedra.svg";
|
|
5
|
-
// oxlint-disable import/consistent-type-specifier-style -- combining the default import with the type import avoids a duplicate-imports violation on this same module; using disable-next-line here is fragile because a formatter can re-wrap the import onto multiple lines and shift the flagged line
|
|
6
2
|
import ViewerContextMenuItem, {
|
|
7
3
|
type ItemProps,
|
|
8
4
|
} from "@ogw_front/components/Viewer/ContextMenu/ContextMenuItem.vue";
|
|
5
|
+
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
6
|
+
import SolidPolyhedra from "@ogw_front/assets/viewer_svgs/solid_polyhedra.svg";
|
|
9
7
|
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
|
|
10
8
|
import ViewerOptionsVisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
|
|
11
|
-
|
|
12
9
|
import { useBatchStyle } from "@ogw_front/composables/batch_style";
|
|
13
10
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
14
11
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
15
|
-
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
16
12
|
|
|
17
13
|
const dataStyleStore = useDataStyleStore();
|
|
18
14
|
const hybridViewerStore = useHybridViewerStore();
|
|
@@ -27,7 +23,7 @@ const { itemProps, tooltip = "Polyhedra options" } = defineProps<Props>();
|
|
|
27
23
|
|
|
28
24
|
const id = toRef(() => itemProps.id);
|
|
29
25
|
|
|
30
|
-
const visibility = computed({
|
|
26
|
+
const visibility = computed<boolean>({
|
|
31
27
|
get: () => dataStyleStore.meshPolyhedraVisibility(id.value),
|
|
32
28
|
set: async (newValue) => {
|
|
33
29
|
await applyBatchStyle(id.value, (targetId: string) =>
|
|
@@ -36,7 +32,7 @@ const visibility = computed({
|
|
|
36
32
|
hybridViewerStore.remoteRender();
|
|
37
33
|
},
|
|
38
34
|
});
|
|
39
|
-
const coloring_style_key = computed({
|
|
35
|
+
const coloring_style_key = computed<string>({
|
|
40
36
|
get: () => dataStyleStore.meshPolyhedraActiveColoring(id.value),
|
|
41
37
|
set: async (newValue) => {
|
|
42
38
|
await applyBatchStyle(id.value, (targetId: string) =>
|
|
@@ -54,7 +50,7 @@ const color = computed<RGBAColor | undefined>({
|
|
|
54
50
|
hybridViewerStore.remoteRender();
|
|
55
51
|
},
|
|
56
52
|
});
|
|
57
|
-
const vertex_attribute_name = computed({
|
|
53
|
+
const vertex_attribute_name = computed<string | undefined>({
|
|
58
54
|
get: () => dataStyleStore.meshPolyhedraVertexAttributeName(id.value),
|
|
59
55
|
set: async (newValue) => {
|
|
60
56
|
if (newValue === undefined) {
|
|
@@ -66,7 +62,7 @@ const vertex_attribute_name = computed({
|
|
|
66
62
|
hybridViewerStore.remoteRender();
|
|
67
63
|
},
|
|
68
64
|
});
|
|
69
|
-
const vertex_attribute_item = computed({
|
|
65
|
+
const vertex_attribute_item = computed<string | undefined>({
|
|
70
66
|
get: () => dataStyleStore.meshPolyhedraVertexAttributeItem(id.value),
|
|
71
67
|
set: async (newValue) => {
|
|
72
68
|
await applyBatchStyle(id.value, (targetId: string) =>
|
|
@@ -75,7 +71,7 @@ const vertex_attribute_item = computed({
|
|
|
75
71
|
hybridViewerStore.remoteRender();
|
|
76
72
|
},
|
|
77
73
|
});
|
|
78
|
-
const vertex_attribute_range = computed({
|
|
74
|
+
const vertex_attribute_range = computed<[number, number] | undefined>({
|
|
79
75
|
get: () => dataStyleStore.meshPolyhedraVertexAttributeRange(id.value),
|
|
80
76
|
set: async (newValue) => {
|
|
81
77
|
const [minimum, maximum] = newValue;
|
|
@@ -90,7 +86,7 @@ const vertex_attribute_range = computed({
|
|
|
90
86
|
hybridViewerStore.remoteRender();
|
|
91
87
|
},
|
|
92
88
|
});
|
|
93
|
-
const vertex_attribute_color_map = computed({
|
|
89
|
+
const vertex_attribute_color_map = computed<Map<string, RGBAColor> | undefined>({
|
|
94
90
|
get: () => dataStyleStore.meshPolyhedraVertexAttributeColorMap(id.value),
|
|
95
91
|
set: async (newValue) => {
|
|
96
92
|
await applyBatchStyle(id.value, (targetId: string) =>
|
|
@@ -109,7 +105,7 @@ const vertex_attribute_no_data_color = computed<RGBAColor | undefined>({
|
|
|
109
105
|
hybridViewerStore.remoteRender();
|
|
110
106
|
},
|
|
111
107
|
});
|
|
112
|
-
const polyhedron_attribute_name = computed({
|
|
108
|
+
const polyhedron_attribute_name = computed<string | undefined>({
|
|
113
109
|
get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeName(id.value),
|
|
114
110
|
set: async (newValue) => {
|
|
115
111
|
if (newValue === undefined) {
|
|
@@ -121,7 +117,7 @@ const polyhedron_attribute_name = computed({
|
|
|
121
117
|
hybridViewerStore.remoteRender();
|
|
122
118
|
},
|
|
123
119
|
});
|
|
124
|
-
const polyhedron_attribute_item = computed({
|
|
120
|
+
const polyhedron_attribute_item = computed<string | undefined>({
|
|
125
121
|
get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeItem(id.value),
|
|
126
122
|
set: async (newValue) => {
|
|
127
123
|
await applyBatchStyle(id.value, (targetId: string) =>
|
|
@@ -130,7 +126,7 @@ const polyhedron_attribute_item = computed({
|
|
|
130
126
|
hybridViewerStore.remoteRender();
|
|
131
127
|
},
|
|
132
128
|
});
|
|
133
|
-
const polyhedron_attribute_range = computed({
|
|
129
|
+
const polyhedron_attribute_range = computed<[number, number] | undefined>({
|
|
134
130
|
get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeRange(id.value),
|
|
135
131
|
set: async (newValue) => {
|
|
136
132
|
const [minimum, maximum] = newValue;
|
|
@@ -145,7 +141,7 @@ const polyhedron_attribute_range = computed({
|
|
|
145
141
|
hybridViewerStore.remoteRender();
|
|
146
142
|
},
|
|
147
143
|
});
|
|
148
|
-
const polyhedron_attribute_color_map = computed({
|
|
144
|
+
const polyhedron_attribute_color_map = computed<Map<string, RGBAColor> | undefined>({
|
|
149
145
|
get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeColorMap(id.value),
|
|
150
146
|
set: async (newValue) => {
|
|
151
147
|
await applyBatchStyle(id.value, (targetId: string) =>
|