@geode/opengeodeweb-front 10.14.0-rc.4 → 10.14.0-rc.5
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/Viewer/Options/AttributeColorBar.vue +1 -1
- package/app/components/Viewer/Options/ColorMapList.vue +11 -2
- package/app/components/Viewer/Options/ColorMapPicker.vue +11 -18
- package/app/utils/colormap.js +1 -1
- package/internal/stores/data_style/mesh/cells/cell.js +21 -7
- package/internal/stores/data_style/mesh/cells/vertex.js +21 -7
- package/internal/stores/data_style/mesh/edges/edge.js +21 -7
- package/internal/stores/data_style/mesh/edges/vertex.js +21 -7
- package/internal/stores/data_style/mesh/points/vertex.js +22 -8
- package/internal/stores/data_style/mesh/polygons/polygon.js +22 -10
- package/internal/stores/data_style/mesh/polygons/vertex.js +22 -7
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +22 -8
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +22 -8
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
129
|
+
<ColorMapList
|
|
130
|
+
:presets="presets"
|
|
131
|
+
:selected-preset-name="selectedPresetName"
|
|
132
|
+
@select="onSelectPreset"
|
|
133
|
+
/>
|
|
141
134
|
</v-menu>
|
|
142
135
|
</template>
|
|
143
136
|
|
package/app/utils/colormap.js
CHANGED
|
@@ -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)
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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