@geode/opengeodeweb-front 10.14.0-rc.4 → 10.14.0-rc.6

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.
@@ -10,7 +10,7 @@ const colorMap = defineModel("colorMap", { type: String });
10
10
 
11
11
  <template>
12
12
  <div class="attribute-colorbar mt-3">
13
- <ColorMapPicker v-model="colorMap" :min="minimum" :max="maximum" />
13
+ <ColorMapPicker v-model:selected-preset-name="colorMap" :min="minimum" :max="maximum" />
14
14
  <v-row dense align="center" class="mt-2">
15
15
  <v-col cols="5">
16
16
  <v-text-field
@@ -6,8 +6,9 @@ const LAST_POINT_OFFSET = 4;
6
6
  const THREE = 3;
7
7
  const CHUNK_SIZE = 5;
8
8
 
9
- const { presets } = defineProps({
9
+ const { presets, selectedPresetName } = defineProps({
10
10
  presets: { type: Array, required: true },
11
+ selectedPresetName: { type: String, default: "" },
11
12
  });
12
13
 
13
14
  const emit = defineEmits(["select"]);
@@ -162,6 +163,7 @@ watch(filteredPresets, drawAllCanvases);
162
163
  <v-list-item
163
164
  v-for="(child, cIdx) in item.Children"
164
165
  :key="cIdx"
166
+ :active="child.Name === selectedPresetName"
165
167
  @click="emit('select', child)"
166
168
  class="px-2 mb-1"
167
169
  rounded="md"
@@ -178,7 +180,14 @@ watch(filteredPresets, drawAllCanvases);
178
180
  </v-list-item>
179
181
  </v-list-group>
180
182
 
181
- <v-list-item v-else @click="emit('select', item)" class="px-2 mb-1" rounded="md">
183
+ <v-list-item
184
+ v-else
185
+ :active="item.Name === selectedPresetName"
186
+ color="primary"
187
+ @click="emit('select', item)"
188
+ class="px-2 mb-1"
189
+ rounded="md"
190
+ >
182
191
  <div class="d-flex flex-column py-1">
183
192
  <span class="text-caption text-grey-lighten-1 mb-1">{{ item.Name }}</span>
184
193
  <canvas
@@ -6,23 +6,19 @@ import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/C
6
6
  const LAST_POINT_OFFSET = 4;
7
7
  const THREE = 3;
8
8
 
9
- const { max, min, modelValue } = defineProps({
10
- modelValue: { type: String, default: "Cool to Warm" },
9
+ const { max, min } = defineProps({
11
10
  min: { type: Number, required: true },
12
11
  max: { type: Number, required: true },
13
12
  });
14
13
 
15
- const emit = defineEmits(["update:modelValue"]);
14
+ const selectedPresetName = defineModel("selectedPresetName", { default: "Cool to Warm" });
16
15
 
17
16
  const menuOpen = ref(false);
18
17
  const lutCanvas = ref();
19
- const selectedPresetName = ref(modelValue);
20
18
 
21
19
  const presets = computed(() => {
22
20
  const allPresets = vtkColorMaps.rgbPresetNames.map((name) => vtkColorMaps.getPresetByName(name));
23
21
 
24
- const defaultPreset = vtkColorMaps.getPresetByName("Cool to Warm");
25
-
26
22
  const paraviewNames = [
27
23
  "Cool to Warm",
28
24
  "Warm to Cool",
@@ -49,12 +45,14 @@ const presets = computed(() => {
49
45
  (preset) => !paraviewNames.includes(preset.Name) && !matplotlibNames.includes(preset.Name),
50
46
  );
51
47
 
48
+ const currentPreset = vtkColorMaps.getPresetByName(selectedPresetName.value);
49
+
52
50
  return [
53
- defaultPreset,
51
+ currentPreset,
54
52
  { Name: "ParaView", Children: paraviewPresets },
55
53
  { Name: "Matplotlib", Children: matplotlibPresets },
56
54
  { Name: "Others", Children: otherPresets },
57
- ];
55
+ ].filter(Boolean);
58
56
  });
59
57
 
60
58
  function drawLutCanvas() {
@@ -103,20 +101,11 @@ function drawLutCanvas() {
103
101
 
104
102
  function onSelectPreset(preset) {
105
103
  selectedPresetName.value = preset.Name;
106
- emit("update:modelValue", preset.Name);
107
104
  menuOpen.value = false;
108
105
  }
109
106
 
110
107
  onMounted(() => nextTick(drawLutCanvas));
111
108
  watch([lutCanvas, selectedPresetName, () => min, () => max], drawLutCanvas);
112
- watch(
113
- () => modelValue,
114
- (newValue) => {
115
- if (newValue !== selectedPresetName.value) {
116
- selectedPresetName.value = newValue;
117
- }
118
- },
119
- );
120
109
  </script>
121
110
 
122
111
  <template>
@@ -137,7 +126,11 @@ watch(
137
126
  </v-card>
138
127
  </template>
139
128
 
140
- <ColorMapList :presets="presets" @select="onSelectPreset" />
129
+ <ColorMapList
130
+ :presets="presets"
131
+ :selected-preset-name="selectedPresetName"
132
+ @select="onSelectPreset"
133
+ />
141
134
  </v-menu>
142
135
  </template>
143
136
 
@@ -1,6 +1,7 @@
1
1
  import { defineStore } from "pinia";
2
2
 
3
3
  import { ref, toRaw, watch } from "vue";
4
+ import { compareSelections } from "@ogw_front/utils/treeview";
4
5
  import { database } from "@ogw_internal/database/database";
5
6
  const PANEL_WIDTH = 300;
6
7
 
@@ -55,9 +56,21 @@ export const useTreeviewStore = defineStore("treeview", () => {
55
56
  { deep: true },
56
57
  );
57
58
 
59
+ watch(selection, (current, previous) => {
60
+ const { removed } = compareSelections(current, previous);
61
+ for (const id of removed) {
62
+ const index = opened_views.value.findIndex(
63
+ (view) => view.type === "component" && view.id === id,
64
+ );
65
+ if (index !== -1) {
66
+ closeView(index);
67
+ }
68
+ }
69
+ });
70
+
58
71
  function closeView(index) {
59
72
  if (index > 0) {
60
- opened_views.value.splice(index, 1);
73
+ opened_views.value = opened_views.value.filter((view, view_index) => view_index !== index);
61
74
  }
62
75
  }
63
76
 
@@ -67,9 +80,9 @@ export const useTreeviewStore = defineStore("treeview", () => {
67
80
  for (const item of items.value) {
68
81
  if (item.title === geodeObjectType) {
69
82
  item.children.push(child);
70
- const opt = { numeric: true, sensitivity: "base" };
83
+ const options = { numeric: true, sensitivity: "base" };
71
84
  item.children.sort((childA, childB) =>
72
- childA.title.localeCompare(childB.title, undefined, opt),
85
+ childA.title.localeCompare(childB.title, undefined, options),
73
86
  );
74
87
  found = true;
75
88
  break;
@@ -77,12 +90,12 @@ export const useTreeviewStore = defineStore("treeview", () => {
77
90
  }
78
91
  if (!found) {
79
92
  items.value.push({ id: geodeObjectType, title: geodeObjectType, children: [child] });
80
- const sortOpt = { numeric: true, sensitivity: "base" };
93
+ const sort_options = { numeric: true, sensitivity: "base" };
81
94
  items.value.sort((groupA, groupB) =>
82
- groupA.title.localeCompare(groupB.title, undefined, sortOpt),
95
+ groupA.title.localeCompare(groupB.title, undefined, sort_options),
83
96
  );
84
97
  }
85
- selection.value.push(id);
98
+ selection.value = [...selection.value, id];
86
99
  }
87
100
 
88
101
  function removeItem(id) {
@@ -94,10 +107,7 @@ export const useTreeviewStore = defineStore("treeview", () => {
94
107
  if (group.children.length === 0) {
95
108
  items.value.splice(index, 1);
96
109
  }
97
- const selectionIndex = selection.value.indexOf(id);
98
- if (selectionIndex !== -1) {
99
- selection.value.splice(selectionIndex, 1);
100
- }
110
+ selection.value = selection.value.filter((selection_id) => selection_id !== id);
101
111
  return;
102
112
  }
103
113
  }
@@ -119,10 +129,10 @@ export const useTreeviewStore = defineStore("treeview", () => {
119
129
  });
120
130
  }
121
131
 
122
- function moveView(fromIdx, toIdx) {
123
- if (fromIdx !== 0 && toIdx !== 0) {
124
- const [element] = opened_views.value.splice(fromIdx, 1);
125
- opened_views.value.splice(toIdx, 0, element);
132
+ function moveView(from_index, to_index) {
133
+ if (from_index !== 0 && to_index !== 0) {
134
+ const [element] = opened_views.value.splice(from_index, 1);
135
+ opened_views.value.splice(to_index, 0, element);
126
136
  }
127
137
  }
128
138
 
@@ -1,7 +1,7 @@
1
1
  import vtkColorMaps from "@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps";
2
2
 
3
3
  function getRGBPointsFromPreset(presetName) {
4
- return vtkColorMaps.getPresetByName(presetName).RGBPoints;
4
+ return vtkColorMaps.getPresetByName(presetName)?.RGBPoints ?? [];
5
5
  }
6
6
 
7
7
  export { getRGBPointsFromPreset };
@@ -60,6 +60,17 @@ export function useMeshCellsCellAttributeStyle() {
60
60
 
61
61
  function setMeshCellsCellAttributeRange(id, minimum, maximum) {
62
62
  const name = meshCellsCellAttributeName(id);
63
+ const points = getRGBPointsFromPreset(meshCellsCellAttributeColorMap(id));
64
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
65
+ return viewerStore.request(
66
+ meshCellsCellAttributeSchemas.color_map,
67
+ { id, points, minimum, maximum },
68
+ {
69
+ response_function: () =>
70
+ setMeshCellsCellAttributeStoredConfig(id, name, { minimum, maximum }),
71
+ },
72
+ );
73
+ }
63
74
  return setMeshCellsCellAttributeStoredConfig(id, name, { minimum, maximum });
64
75
  }
65
76
 
@@ -75,13 +86,16 @@ export function useMeshCellsCellAttributeStyle() {
75
86
  const storedConfig = meshCellsCellAttributeStoredConfig(id, name);
76
87
  const points = getRGBPointsFromPreset(colorMap);
77
88
  const { minimum, maximum } = storedConfig;
78
- return viewerStore.request(
79
- meshCellsCellAttributeSchemas.color_map,
80
- { id, points, minimum, maximum },
81
- {
82
- response_function: () => setMeshCellsCellAttributeStoredConfig(id, name, { colorMap }),
83
- },
84
- );
89
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
90
+ return viewerStore.request(
91
+ meshCellsCellAttributeSchemas.color_map,
92
+ { id, points, minimum, maximum },
93
+ {
94
+ response_function: () => setMeshCellsCellAttributeStoredConfig(id, name, { colorMap }),
95
+ },
96
+ );
97
+ }
98
+ return setMeshCellsCellAttributeStoredConfig(id, name, { colorMap });
85
99
  }
86
100
 
87
101
  return {
@@ -82,6 +82,17 @@ export function useMeshCellsVertexAttributeStyle() {
82
82
 
83
83
  function setMeshCellsVertexAttributeRange(id, minimum, maximum) {
84
84
  const name = meshCellsVertexAttributeName(id);
85
+ const points = getRGBPointsFromPreset(meshCellsVertexAttributeColorMap(id));
86
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
87
+ return viewerStore.request(
88
+ meshCellsVertexAttributeSchemas.color_map,
89
+ { id, points, minimum, maximum },
90
+ {
91
+ response_function: () =>
92
+ setMeshCellsVertexAttributeStoredConfig(id, name, { minimum, maximum }),
93
+ },
94
+ );
95
+ }
85
96
  return setMeshCellsVertexAttributeStoredConfig(id, name, {
86
97
  minimum,
87
98
  maximum,
@@ -100,13 +111,16 @@ export function useMeshCellsVertexAttributeStyle() {
100
111
  const storedConfig = meshCellsVertexAttributeStoredConfig(id, name);
101
112
  const points = getRGBPointsFromPreset(colorMap);
102
113
  const { minimum, maximum } = storedConfig;
103
- return viewerStore.request(
104
- meshCellsVertexAttributeSchemas.color_map,
105
- { id, points, minimum, maximum },
106
- {
107
- response_function: () => setMeshCellsVertexAttributeStoredConfig(id, name, { colorMap }),
108
- },
109
- );
114
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
115
+ return viewerStore.request(
116
+ meshCellsVertexAttributeSchemas.color_map,
117
+ { id, points, minimum, maximum },
118
+ {
119
+ response_function: () => setMeshCellsVertexAttributeStoredConfig(id, name, { colorMap }),
120
+ },
121
+ );
122
+ }
123
+ return setMeshCellsVertexAttributeStoredConfig(id, name, { colorMap });
110
124
  }
111
125
 
112
126
  return {
@@ -85,6 +85,17 @@ export function useMeshEdgesEdgeAttributeStyle() {
85
85
 
86
86
  function setMeshEdgesEdgeAttributeRange(id, minimum, maximum) {
87
87
  const name = meshEdgesEdgeAttributeName(id);
88
+ const points = getRGBPointsFromPreset(meshEdgesEdgeAttributeColorMap(id));
89
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
90
+ return viewerStore.request(
91
+ meshEdgesEdgeAttributeSchemas.color_map,
92
+ { id, points, minimum, maximum },
93
+ {
94
+ response_function: () =>
95
+ setMeshEdgesEdgeAttributeStoredConfig(id, name, { minimum, maximum }),
96
+ },
97
+ );
98
+ }
88
99
  return setMeshEdgesEdgeAttributeStoredConfig(id, name, {
89
100
  minimum,
90
101
  maximum,
@@ -103,13 +114,16 @@ export function useMeshEdgesEdgeAttributeStyle() {
103
114
  const storedConfig = meshEdgesEdgeAttributeStoredConfig(id, name);
104
115
  const points = getRGBPointsFromPreset(colorMap);
105
116
  const { minimum, maximum } = storedConfig;
106
- return viewerStore.request(
107
- meshEdgesEdgeAttributeSchemas.color_map,
108
- { id, points, minimum, maximum },
109
- {
110
- response_function: () => setMeshEdgesEdgeAttributeStoredConfig(id, name, { colorMap }),
111
- },
112
- );
117
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
118
+ return viewerStore.request(
119
+ meshEdgesEdgeAttributeSchemas.color_map,
120
+ { id, points, minimum, maximum },
121
+ {
122
+ response_function: () => setMeshEdgesEdgeAttributeStoredConfig(id, name, { colorMap }),
123
+ },
124
+ );
125
+ }
126
+ return setMeshEdgesEdgeAttributeStoredConfig(id, name, { colorMap });
113
127
  }
114
128
 
115
129
  return {
@@ -83,6 +83,17 @@ export function useMeshEdgesVertexAttributeStyle() {
83
83
  }
84
84
  function setMeshEdgesVertexAttributeRange(id, minimum, maximum) {
85
85
  const name = meshEdgesVertexAttributeName(id);
86
+ const points = getRGBPointsFromPreset(meshEdgesVertexAttributeColorMap(id));
87
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
88
+ return viewerStore.request(
89
+ meshEdgesVertexAttributeSchemas.color_map,
90
+ { id, points, minimum, maximum },
91
+ {
92
+ response_function: () =>
93
+ setMeshEdgesVertexAttributeStoredConfig(id, name, { minimum, maximum }),
94
+ },
95
+ );
96
+ }
86
97
  return setMeshEdgesVertexAttributeStoredConfig(id, name, {
87
98
  minimum,
88
99
  maximum,
@@ -100,13 +111,16 @@ export function useMeshEdgesVertexAttributeStyle() {
100
111
  const storedConfig = meshEdgesVertexAttributeStoredConfig(id, name);
101
112
  const points = getRGBPointsFromPreset(colorMap);
102
113
  const { minimum, maximum } = storedConfig;
103
- return viewerStore.request(
104
- meshEdgesVertexAttributeSchemas.color_map,
105
- { id, points, minimum, maximum },
106
- {
107
- response_function: () => setMeshEdgesVertexAttributeStoredConfig(id, name, { colorMap }),
108
- },
109
- );
114
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
115
+ return viewerStore.request(
116
+ meshEdgesVertexAttributeSchemas.color_map,
117
+ { id, points, minimum, maximum },
118
+ {
119
+ response_function: () => setMeshEdgesVertexAttributeStoredConfig(id, name, { colorMap }),
120
+ },
121
+ );
122
+ }
123
+ return setMeshEdgesVertexAttributeStoredConfig(id, name, { colorMap });
110
124
  }
111
125
 
112
126
  return {
@@ -87,6 +87,17 @@ function useMeshPointsVertexAttributeActions() {
87
87
 
88
88
  function setMeshPointsVertexAttributeRange(id, minimum, maximum) {
89
89
  const name = config.meshPointsVertexAttributeName(id);
90
+ const points = getRGBPointsFromPreset(config.meshPointsVertexAttributeColorMap(id));
91
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
92
+ return viewerStore.request(
93
+ meshPointsVertexAttributeSchemas.color_map,
94
+ { id, points, minimum, maximum },
95
+ {
96
+ response_function: () =>
97
+ config.setMeshPointsVertexAttributeStoredConfig(id, name, { minimum, maximum }),
98
+ },
99
+ );
100
+ }
90
101
  return config.setMeshPointsVertexAttributeStoredConfig(id, name, {
91
102
  minimum,
92
103
  maximum,
@@ -98,14 +109,17 @@ function useMeshPointsVertexAttributeActions() {
98
109
  const storedConfig = config.meshPointsVertexAttributeStoredConfig(id, name);
99
110
  const points = getRGBPointsFromPreset(colorMap);
100
111
  const { minimum, maximum } = storedConfig;
101
- return viewerStore.request(
102
- meshPointsVertexAttributeSchemas.color_map,
103
- { id, points, minimum, maximum },
104
- {
105
- response_function: () =>
106
- config.setMeshPointsVertexAttributeStoredConfig(id, name, { colorMap }),
107
- },
108
- );
112
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
113
+ return viewerStore.request(
114
+ meshPointsVertexAttributeSchemas.color_map,
115
+ { id, points, minimum, maximum },
116
+ {
117
+ response_function: () =>
118
+ config.setMeshPointsVertexAttributeStoredConfig(id, name, { colorMap }),
119
+ },
120
+ );
121
+ }
122
+ return config.setMeshPointsVertexAttributeStoredConfig(id, name, { colorMap });
109
123
  }
110
124
 
111
125
  return {
@@ -83,6 +83,17 @@ export function useMeshPolygonsPolygonAttributeStyle() {
83
83
 
84
84
  function setMeshPolygonsPolygonAttributeRange(id, minimum, maximum) {
85
85
  const name = meshPolygonsPolygonAttributeName(id);
86
+ const points = getRGBPointsFromPreset(meshPolygonsPolygonAttributeColorMap(id));
87
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
88
+ return viewerStore.request(
89
+ meshPolygonsPolygonAttributeSchemas.color_map,
90
+ { id, points, minimum, maximum },
91
+ {
92
+ response_function: () =>
93
+ setMeshPolygonsPolygonAttributeStoredConfig(id, name, { minimum, maximum }),
94
+ },
95
+ );
96
+ }
86
97
  return setMeshPolygonsPolygonAttributeStoredConfig(id, name, {
87
98
  minimum,
88
99
  maximum,
@@ -101,16 +112,17 @@ export function useMeshPolygonsPolygonAttributeStyle() {
101
112
  const storedConfig = meshPolygonsPolygonAttributeStoredConfig(id, name);
102
113
  const points = getRGBPointsFromPreset(colorMap);
103
114
  const { minimum, maximum } = storedConfig;
104
- return viewerStore.request(
105
- meshPolygonsPolygonAttributeSchemas.color_map,
106
- { id, points, minimum, maximum },
107
- {
108
- response_function: () =>
109
- setMeshPolygonsPolygonAttributeStoredConfig(id, name, {
110
- colorMap,
111
- }),
112
- },
113
- );
115
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
116
+ return viewerStore.request(
117
+ meshPolygonsPolygonAttributeSchemas.color_map,
118
+ { id, points, minimum, maximum },
119
+ {
120
+ response_function: () =>
121
+ setMeshPolygonsPolygonAttributeStoredConfig(id, name, { colorMap }),
122
+ },
123
+ );
124
+ }
125
+ return setMeshPolygonsPolygonAttributeStoredConfig(id, name, { colorMap });
114
126
  }
115
127
 
116
128
  return {
@@ -82,6 +82,17 @@ export function useMeshPolygonsVertexAttributeStyle() {
82
82
 
83
83
  function setMeshPolygonsVertexAttributeRange(id, minimum, maximum) {
84
84
  const name = meshPolygonsVertexAttributeName(id);
85
+ const points = getRGBPointsFromPreset(meshPolygonsVertexAttributeColorMap(id));
86
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
87
+ return viewerStore.request(
88
+ meshPolygonsVertexAttributeSchemas.color_map,
89
+ { id, points, minimum, maximum },
90
+ {
91
+ response_function: () =>
92
+ setMeshPolygonsVertexAttributeStoredConfig(id, name, { minimum, maximum }),
93
+ },
94
+ );
95
+ }
85
96
  return setMeshPolygonsVertexAttributeStoredConfig(id, name, {
86
97
  minimum,
87
98
  maximum,
@@ -100,13 +111,17 @@ export function useMeshPolygonsVertexAttributeStyle() {
100
111
  const storedConfig = meshPolygonsVertexAttributeStoredConfig(id, name);
101
112
  const points = getRGBPointsFromPreset(colorMap);
102
113
  const { minimum, maximum } = storedConfig;
103
- return viewerStore.request(
104
- meshPolygonsVertexAttributeSchemas.color_map,
105
- { id, points, minimum, maximum },
106
- {
107
- response_function: () => setMeshPolygonsVertexAttributeStoredConfig(id, name, { colorMap }),
108
- },
109
- );
114
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
115
+ return viewerStore.request(
116
+ meshPolygonsVertexAttributeSchemas.color_map,
117
+ { id, points, minimum, maximum },
118
+ {
119
+ response_function: () =>
120
+ setMeshPolygonsVertexAttributeStoredConfig(id, name, { colorMap }),
121
+ },
122
+ );
123
+ }
124
+ return setMeshPolygonsVertexAttributeStoredConfig(id, name, { colorMap });
110
125
  }
111
126
 
112
127
  return {
@@ -87,6 +87,17 @@ function useMeshPolyhedraPolyhedronAttributeActions() {
87
87
 
88
88
  function setMeshPolyhedraPolyhedronAttributeRange(id, minimum, maximum) {
89
89
  const name = config.meshPolyhedraPolyhedronAttributeName(id);
90
+ const points = getRGBPointsFromPreset(config.meshPolyhedraPolyhedronAttributeColorMap(id));
91
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
92
+ return viewerStore.request(
93
+ meshPolyhedraPolyhedronAttributeSchemas.color_map,
94
+ { id, points, minimum, maximum },
95
+ {
96
+ response_function: () =>
97
+ config.setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, { minimum, maximum }),
98
+ },
99
+ );
100
+ }
90
101
  return config.setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, {
91
102
  minimum,
92
103
  maximum,
@@ -98,14 +109,17 @@ function useMeshPolyhedraPolyhedronAttributeActions() {
98
109
  const storedConfig = config.meshPolyhedraPolyhedronAttributeStoredConfig(id, name);
99
110
  const points = getRGBPointsFromPreset(colorMap);
100
111
  const { minimum, maximum } = storedConfig;
101
- return viewerStore.request(
102
- meshPolyhedraPolyhedronAttributeSchemas.color_map,
103
- { id, points, minimum, maximum },
104
- {
105
- response_function: () =>
106
- config.setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, { colorMap }),
107
- },
108
- );
112
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
113
+ return viewerStore.request(
114
+ meshPolyhedraPolyhedronAttributeSchemas.color_map,
115
+ { id, points, minimum, maximum },
116
+ {
117
+ response_function: () =>
118
+ config.setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, { colorMap }),
119
+ },
120
+ );
121
+ }
122
+ return config.setMeshPolyhedraPolyhedronAttributeStoredConfig(id, name, { colorMap });
109
123
  }
110
124
 
111
125
  return {
@@ -87,6 +87,17 @@ function useMeshPolyhedraVertexAttributeActions() {
87
87
 
88
88
  function setMeshPolyhedraVertexAttributeRange(id, minimum, maximum) {
89
89
  const name = config.meshPolyhedraVertexAttributeName(id);
90
+ const points = getRGBPointsFromPreset(config.meshPolyhedraVertexAttributeColorMap(id));
91
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
92
+ return viewerStore.request(
93
+ meshPolyhedraVertexAttributeSchemas.color_map,
94
+ { id, points, minimum, maximum },
95
+ {
96
+ response_function: () =>
97
+ config.setMeshPolyhedraVertexAttributeStoredConfig(id, name, { minimum, maximum }),
98
+ },
99
+ );
100
+ }
90
101
  return config.setMeshPolyhedraVertexAttributeStoredConfig(id, name, {
91
102
  minimum,
92
103
  maximum,
@@ -98,14 +109,17 @@ function useMeshPolyhedraVertexAttributeActions() {
98
109
  const storedConfig = config.meshPolyhedraVertexAttributeStoredConfig(id, name);
99
110
  const points = getRGBPointsFromPreset(colorMap);
100
111
  const { minimum, maximum } = storedConfig;
101
- return viewerStore.request(
102
- meshPolyhedraVertexAttributeSchemas.color_map,
103
- { id, points, minimum, maximum },
104
- {
105
- response_function: () =>
106
- config.setMeshPolyhedraVertexAttributeStoredConfig(id, name, { colorMap }),
107
- },
108
- );
112
+ if (points.length > 0 && minimum !== undefined && maximum !== undefined) {
113
+ return viewerStore.request(
114
+ meshPolyhedraVertexAttributeSchemas.color_map,
115
+ { id, points, minimum, maximum },
116
+ {
117
+ response_function: () =>
118
+ config.setMeshPolyhedraVertexAttributeStoredConfig(id, name, { colorMap }),
119
+ },
120
+ );
121
+ }
122
+ return config.setMeshPolyhedraVertexAttributeStoredConfig(id, name, { colorMap });
109
123
  }
110
124
 
111
125
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.14.0-rc.4",
3
+ "version": "10.14.0-rc.6",
4
4
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
5
5
  "homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
6
6
  "bugs": {