@geode/opengeodeweb-front 10.25.0-rc.7 → 10.25.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.
Files changed (54) hide show
  1. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +13 -17
  2. package/app/components/Viewer/Generic/Model/CornersOptions.vue +13 -17
  3. package/app/components/Viewer/Generic/Model/LinesOptions.vue +13 -17
  4. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +29 -43
  5. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +13 -17
  6. package/app/components/Viewer/Options/AttributeSelector.vue +6 -1
  7. package/app/components/Viewer/Options/ColoringTypeSelector.vue +37 -15
  8. package/app/utils/default_styles/constants.js +15 -0
  9. package/app/utils/default_styles/index.js +6 -1
  10. package/app/utils/default_styles/meshes.js +19 -15
  11. package/app/utils/default_styles/models.js +74 -36
  12. package/internal/stores/data_style/mesh/cells/color.js +2 -2
  13. package/internal/stores/data_style/mesh/cells/index.js +1 -10
  14. package/internal/stores/data_style/mesh/edges/color.js +2 -2
  15. package/internal/stores/data_style/mesh/edges/index.js +1 -7
  16. package/internal/stores/data_style/mesh/points/color.js +2 -2
  17. package/internal/stores/data_style/mesh/points/index.js +1 -4
  18. package/internal/stores/data_style/mesh/polygons/color.js +2 -2
  19. package/internal/stores/data_style/mesh/polygons/index.js +1 -10
  20. package/internal/stores/data_style/mesh/polyhedra/color.js +2 -2
  21. package/internal/stores/data_style/mesh/polyhedra/index.js +1 -7
  22. package/internal/stores/data_style/model/blocks/color.js +86 -7
  23. package/internal/stores/data_style/model/blocks/common.js +15 -6
  24. package/internal/stores/data_style/model/blocks/index.js +28 -26
  25. package/internal/stores/data_style/model/blocks/polyhedron.js +7 -20
  26. package/internal/stores/data_style/model/blocks/vertex.js +7 -20
  27. package/internal/stores/data_style/model/color.js +58 -32
  28. package/internal/stores/data_style/model/common.js +19 -10
  29. package/internal/stores/data_style/model/corners/color.js +59 -7
  30. package/internal/stores/data_style/model/corners/common.js +15 -6
  31. package/internal/stores/data_style/model/corners/index.js +26 -24
  32. package/internal/stores/data_style/model/corners/vertex.js +7 -20
  33. package/internal/stores/data_style/model/lines/color.js +71 -7
  34. package/internal/stores/data_style/model/lines/common.js +15 -6
  35. package/internal/stores/data_style/model/lines/edge.js +7 -20
  36. package/internal/stores/data_style/model/lines/index.js +28 -26
  37. package/internal/stores/data_style/model/lines/vertex.js +7 -20
  38. package/internal/stores/data_style/model/surfaces/color.js +86 -8
  39. package/internal/stores/data_style/model/surfaces/common.js +15 -6
  40. package/internal/stores/data_style/model/surfaces/index.js +28 -26
  41. package/internal/stores/data_style/model/surfaces/polygon.js +7 -20
  42. package/internal/stores/data_style/model/surfaces/vertex.js +7 -20
  43. package/internal/stores/data_style/state.js +2 -2
  44. package/package.json +3 -3
  45. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +1 -1
  46. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +1 -1
  47. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +1 -1
  48. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +1 -1
  49. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +1 -1
  50. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +7 -7
  51. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +5 -5
  52. package/tests/integration/stores/data_style/model/index.nuxt.test.js +31 -0
  53. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +7 -7
  54. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +7 -7
@@ -44,28 +44,24 @@ const blocksColor = computed({
44
44
  const blockColor = computed({
45
45
  get: () => dataStyleStore.modelBlockColor(modelId, blockId),
46
46
  set: async (color) => {
47
- if (blockId) {
48
- await dataStyleStore.setModelBlocksColor(modelId, [blockId], color);
49
- hybridViewerStore.remoteRender();
50
- }
47
+ await dataStyleStore.setModelBlocksColor(modelId, [blockId], color);
48
+ hybridViewerStore.remoteRender();
51
49
  },
52
50
  });
53
51
 
54
- const blocksColorMode = computed({
55
- get: () => dataStyleStore.getModelComponentTypeColorMode(modelId, "Block"),
56
- set: async (colorMode) => {
57
- await dataStyleStore.setModelComponentTypeColorMode(modelId, "Block", colorMode);
52
+ const blocksActiveColoring = computed({
53
+ get: () => dataStyleStore.getModelComponentTypeActiveColoring(modelId, "Block"),
54
+ set: async (coloringType) => {
55
+ await dataStyleStore.setModelComponentTypeActiveColoring(modelId, "Block", coloringType);
58
56
  hybridViewerStore.remoteRender();
59
57
  },
60
58
  });
61
59
 
62
- const blockColorMode = computed({
63
- get: () => dataStyleStore.modelBlockColorMode(modelId, blockId),
64
- set: async (colorMode) => {
65
- if (blockId) {
66
- await dataStyleStore.setModelComponentColorMode(modelId, blockId, colorMode);
67
- hybridViewerStore.remoteRender();
68
- }
60
+ const blockActiveColoring = computed({
61
+ get: () => dataStyleStore.modelBlockActiveColoring(modelId, blockId),
62
+ set: async (coloringType) => {
63
+ await dataStyleStore.setModelBlocksActiveColoring(modelId, [blockId], coloringType);
64
+ hybridViewerStore.remoteRender();
69
65
  },
70
66
  });
71
67
 
@@ -211,7 +207,7 @@ const polyhedronSchema = back_schemas.opengeodeweb_back.model_component_polyhedr
211
207
  <ViewerOptionsColoringTypeSelector
212
208
  :id="modelId"
213
209
  :componentId="targetBlockIds[0]"
214
- v-model:coloring_style_key="blocksColorMode"
210
+ v-model:coloring_style_key="blocksActiveColoring"
215
211
  v-model:color="blocksColor"
216
212
  v-model:vertex_attribute_name="blocksVertexAttributeName"
217
213
  v-model:vertex_attribute_range="blocksVertexAttributeRange"
@@ -230,7 +226,7 @@ const polyhedronSchema = back_schemas.opengeodeweb_back.model_component_polyhedr
230
226
  <ViewerOptionsColoringTypeSelector
231
227
  :id="modelId"
232
228
  :componentId="blockId"
233
- v-model:coloring_style_key="blockColorMode"
229
+ v-model:coloring_style_key="blockActiveColoring"
234
230
  v-model:color="blockColor"
235
231
  v-model:vertex_attribute_name="vertexAttributeName"
236
232
  v-model:vertex_attribute_range="vertexAttributeRange"
@@ -44,28 +44,24 @@ const cornersColor = computed({
44
44
  const cornerColor = computed({
45
45
  get: () => dataStyleStore.modelCornerColor(modelId, cornerId),
46
46
  set: async (color) => {
47
- if (cornerId) {
48
- await dataStyleStore.setModelCornersColor(modelId, [cornerId], color);
49
- hybridViewerStore.remoteRender();
50
- }
47
+ await dataStyleStore.setModelCornersColor(modelId, [cornerId], color);
48
+ hybridViewerStore.remoteRender();
51
49
  },
52
50
  });
53
51
 
54
- const cornersColorMode = computed({
55
- get: () => dataStyleStore.getModelComponentTypeColorMode(modelId, "Corner"),
56
- set: async (colorMode) => {
57
- await dataStyleStore.setModelComponentTypeColorMode(modelId, "Corner", colorMode);
52
+ const cornersActiveColoring = computed({
53
+ get: () => dataStyleStore.getModelComponentTypeActiveColoring(modelId, "Corner"),
54
+ set: async (coloringType) => {
55
+ await dataStyleStore.setModelComponentTypeActiveColoring(modelId, "Corner", coloringType);
58
56
  hybridViewerStore.remoteRender();
59
57
  },
60
58
  });
61
59
 
62
- const cornerColorMode = computed({
63
- get: () => dataStyleStore.modelCornerColorMode(modelId, cornerId),
64
- set: async (colorMode) => {
65
- if (cornerId) {
66
- await dataStyleStore.setModelComponentColorMode(modelId, cornerId, colorMode);
67
- hybridViewerStore.remoteRender();
68
- }
60
+ const cornerActiveColoring = computed({
61
+ get: () => dataStyleStore.modelCornerActiveColoring(modelId, cornerId),
62
+ set: async (coloringType) => {
63
+ await dataStyleStore.setModelCornersActiveColoring(modelId, [cornerId], coloringType);
64
+ hybridViewerStore.remoteRender();
69
65
  },
70
66
  });
71
67
 
@@ -148,7 +144,7 @@ const vertexSchema = back_schemas.opengeodeweb_back.model_component_vertex_attri
148
144
  <ViewerOptionsColoringTypeSelector
149
145
  :id="modelId"
150
146
  :componentId="targetCornerIds[0]"
151
- v-model:coloring_style_key="cornersColorMode"
147
+ v-model:coloring_style_key="cornersActiveColoring"
152
148
  v-model:color="cornersColor"
153
149
  v-model:vertex_attribute_name="cornersVertexAttributeName"
154
150
  v-model:vertex_attribute_range="cornersVertexAttributeRange"
@@ -164,7 +160,7 @@ const vertexSchema = back_schemas.opengeodeweb_back.model_component_vertex_attri
164
160
  <ViewerOptionsColoringTypeSelector
165
161
  :id="modelId"
166
162
  :componentId="cornerId"
167
- v-model:coloring_style_key="cornerColorMode"
163
+ v-model:coloring_style_key="cornerActiveColoring"
168
164
  v-model:color="cornerColor"
169
165
  v-model:vertex_attribute_name="vertexAttributeName"
170
166
  v-model:vertex_attribute_range="vertexAttributeRange"
@@ -44,28 +44,24 @@ const linesColor = computed({
44
44
  const lineColor = computed({
45
45
  get: () => dataStyleStore.modelLineColor(modelId, lineId),
46
46
  set: async (color) => {
47
- if (lineId) {
48
- await dataStyleStore.setModelLinesColor(modelId, [lineId], color);
49
- hybridViewerStore.remoteRender();
50
- }
47
+ await dataStyleStore.setModelLinesColor(modelId, [lineId], color);
48
+ hybridViewerStore.remoteRender();
51
49
  },
52
50
  });
53
51
 
54
- const linesColorMode = computed({
55
- get: () => dataStyleStore.getModelComponentTypeColorMode(modelId, "Line"),
56
- set: async (colorMode) => {
57
- await dataStyleStore.setModelComponentTypeColorMode(modelId, "Line", colorMode);
52
+ const linesActiveColoring = computed({
53
+ get: () => dataStyleStore.getModelComponentTypeActiveColoring(modelId, "Line"),
54
+ set: async (coloringType) => {
55
+ await dataStyleStore.setModelComponentTypeActiveColoring(modelId, "Line", coloringType);
58
56
  hybridViewerStore.remoteRender();
59
57
  },
60
58
  });
61
59
 
62
- const lineColorMode = computed({
63
- get: () => dataStyleStore.modelLineColorMode(modelId, lineId),
64
- set: async (colorMode) => {
65
- if (lineId) {
66
- await dataStyleStore.setModelComponentColorMode(modelId, lineId, colorMode);
67
- hybridViewerStore.remoteRender();
68
- }
60
+ const lineActiveColoring = computed({
61
+ get: () => dataStyleStore.modelLineActiveColoring(modelId, lineId),
62
+ set: async (coloringType) => {
63
+ await dataStyleStore.setModelLinesActiveColoring(modelId, [lineId], coloringType);
64
+ hybridViewerStore.remoteRender();
69
65
  },
70
66
  });
71
67
 
@@ -207,7 +203,7 @@ const edgeSchema = back_schemas.opengeodeweb_back.model_component_edge_attribute
207
203
  <ViewerOptionsColoringTypeSelector
208
204
  :id="modelId"
209
205
  :componentId="targetLineIds[0]"
210
- v-model:coloring_style_key="linesColorMode"
206
+ v-model:coloring_style_key="linesActiveColoring"
211
207
  v-model:color="linesColor"
212
208
  v-model:vertex_attribute_name="linesVertexAttributeName"
213
209
  v-model:vertex_attribute_range="linesVertexAttributeRange"
@@ -226,7 +222,7 @@ const edgeSchema = back_schemas.opengeodeweb_back.model_component_edge_attribute
226
222
  <ViewerOptionsColoringTypeSelector
227
223
  :id="modelId"
228
224
  :componentId="lineId"
229
- v-model:coloring_style_key="lineColorMode"
225
+ v-model:coloring_style_key="lineActiveColoring"
230
226
  v-model:color="lineColor"
231
227
  v-model:vertex_attribute_name="vertexAttributeName"
232
228
  v-model:vertex_attribute_range="vertexAttributeRange"
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.vue";
3
- import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
3
+ import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
4
4
  import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
5
5
  import { useDataStore } from "@ogw_front/stores/data";
6
6
  import { useDataStyleStore } from "@ogw_front/stores/data_style";
@@ -86,43 +86,36 @@ const modelVisibility = computed({
86
86
  },
87
87
  });
88
88
 
89
- const colorModes = [
90
- { title: "Constant", value: "constant" },
91
- { title: "Random", value: "random" },
92
- ];
93
-
94
- const modelComponentsColorMode = ref("constant");
95
-
96
- const modelComponentsColor = computed({
97
- get: () => {
98
- if (selection.value.length > 0) {
99
- return dataStyleStore.getModelComponentColor(modelId.value, selection.value[0]);
100
- }
101
- return { red: 255, green: 255, blue: 255 };
102
- },
103
- set: async (color) => {
104
- if (selection.value.length > 0) {
105
- await dataStyleStore.setModelComponentsColor(
106
- modelId.value,
107
- selection.value,
108
- color,
109
- modelComponentsColorMode.value,
110
- );
111
- hybridViewerStore.remoteRender();
112
- }
89
+ const modelComponentsActiveColoring = computed({
90
+ get: () => dataStyleStore.getModelActiveColoring(modelId.value),
91
+ set: async (coloringType) => {
92
+ await dataStyleStore.mutateStyle(modelId.value, {
93
+ coloring: { active: coloringType },
94
+ });
95
+ await dataStyleStore.setModelComponentsColor(
96
+ modelId.value,
97
+ selection.value,
98
+ modelComponentsColor.value,
99
+ coloringType,
100
+ );
101
+ hybridViewerStore.remoteRender();
113
102
  },
114
103
  });
115
104
 
116
- watch(modelComponentsColorMode, async (colorMode) => {
117
- if (colorMode === "random" && selection.value.length > 0) {
105
+ const modelComponentsColor = computed({
106
+ get: () => dataStyleStore.getModelColor(modelId.value),
107
+ set: async (color) => {
108
+ await dataStyleStore.mutateStyle(modelId.value, {
109
+ coloring: { constant: color },
110
+ });
118
111
  await dataStyleStore.setModelComponentsColor(
119
112
  modelId.value,
120
113
  selection.value,
121
- undefined,
122
- colorMode,
114
+ color,
115
+ modelComponentsActiveColoring.value,
123
116
  );
124
117
  hybridViewerStore.remoteRender();
125
- }
118
+ },
126
119
  });
127
120
  </script>
128
121
 
@@ -133,20 +126,13 @@ watch(modelComponentsColorMode, async (colorMode) => {
133
126
  </OptionsSection>
134
127
 
135
128
  <OptionsSection v-if="!componentType && !componentId" title="Components Options" class="mt-4">
136
- <v-label class="text-caption mb-1 mt-2">Color Mode</v-label>
137
- <v-select
138
- v-model="modelComponentsColorMode"
139
- :items="colorModes"
140
- density="compact"
141
- hide-details
142
- class="mb-3"
143
- variant="outlined"
129
+ <ViewerOptionsColoringTypeSelector
130
+ :id="modelId"
131
+ v-model:coloring_style_key="modelComponentsActiveColoring"
132
+ v-model:color="modelComponentsColor"
133
+ :capabilities="{ color: { available: true } }"
134
+ :allowRandom="true"
144
135
  />
145
-
146
- <template v-if="modelComponentsColorMode === 'constant'">
147
- <v-label class="text-caption mb-1">Color</v-label>
148
- <ViewerOptionsColorPicker v-model="modelComponentsColor" />
149
- </template>
150
136
  </OptionsSection>
151
137
 
152
138
  <BlocksOptions
@@ -44,28 +44,24 @@ const surfacesColor = computed({
44
44
  const surfaceColor = computed({
45
45
  get: () => dataStyleStore.modelSurfaceColor(modelId, surfaceId),
46
46
  set: async (color) => {
47
- if (surfaceId) {
48
- await dataStyleStore.setModelSurfacesColor(modelId, [surfaceId], color);
49
- hybridViewerStore.remoteRender();
50
- }
47
+ await dataStyleStore.setModelSurfacesColor(modelId, [surfaceId], color);
48
+ hybridViewerStore.remoteRender();
51
49
  },
52
50
  });
53
51
 
54
- const surfacesColorMode = computed({
55
- get: () => dataStyleStore.getModelComponentTypeColorMode(modelId, "Surface"),
56
- set: async (colorMode) => {
57
- await dataStyleStore.setModelComponentTypeColorMode(modelId, "Surface", colorMode);
52
+ const surfacesActiveColoring = computed({
53
+ get: () => dataStyleStore.getModelComponentTypeActiveColoring(modelId, "Surface"),
54
+ set: async (coloringType) => {
55
+ await dataStyleStore.setModelComponentTypeActiveColoring(modelId, "Surface", coloringType);
58
56
  hybridViewerStore.remoteRender();
59
57
  },
60
58
  });
61
59
 
62
- const surfaceColorMode = computed({
63
- get: () => dataStyleStore.modelSurfaceColorMode(modelId, surfaceId),
64
- set: async (colorMode) => {
65
- if (surfaceId) {
66
- await dataStyleStore.setModelComponentColorMode(modelId, surfaceId, colorMode);
67
- hybridViewerStore.remoteRender();
68
- }
60
+ const surfaceActiveColoring = computed({
61
+ get: () => dataStyleStore.modelSurfaceActiveColoring(modelId, surfaceId),
62
+ set: async (coloringType) => {
63
+ await dataStyleStore.setModelSurfacesActiveColoring(modelId, [surfaceId], coloringType);
64
+ hybridViewerStore.remoteRender();
69
65
  },
70
66
  });
71
67
 
@@ -215,7 +211,7 @@ const polygonSchema = back_schemas.opengeodeweb_back.model_component_polygon_att
215
211
  <ViewerOptionsColoringTypeSelector
216
212
  :id="modelId"
217
213
  :componentId="targetSurfaceIds[0]"
218
- v-model:coloring_style_key="surfacesColorMode"
214
+ v-model:coloring_style_key="surfacesActiveColoring"
219
215
  v-model:color="surfacesColor"
220
216
  v-model:vertex_attribute_name="surfacesVertexAttributeName"
221
217
  v-model:vertex_attribute_range="surfacesVertexAttributeRange"
@@ -234,7 +230,7 @@ const polygonSchema = back_schemas.opengeodeweb_back.model_component_polygon_att
234
230
  <ViewerOptionsColoringTypeSelector
235
231
  :id="modelId"
236
232
  :componentId="surfaceId"
237
- v-model:coloring_style_key="surfaceColorMode"
233
+ v-model:coloring_style_key="surfaceActiveColoring"
238
234
  v-model:color="surfaceColor"
239
235
  v-model:vertex_attribute_name="vertexAttributeName"
240
236
  v-model:vertex_attribute_range="vertexAttributeRange"
@@ -4,7 +4,12 @@ import { useBackStore } from "@ogw_front/stores/back";
4
4
 
5
5
  const backStore = useBackStore();
6
6
 
7
- const name = defineModel("name", { type: String });
7
+ const name = defineModel("name", {
8
+ type: String,
9
+ default: undefined,
10
+ set: (value) => value ?? name.value,
11
+ });
12
+
8
13
  const range = defineModel("range", { type: Array });
9
14
  const colorMap = defineModel("colorMap", { type: String });
10
15
 
@@ -98,8 +98,8 @@ const has_polyhedra = computed(
98
98
  hasColorMap("polyhedron"),
99
99
  );
100
100
 
101
- const color_dict = { name: "Color", value: "color" };
102
- const random_dict = { name: "Random color", value: "random" };
101
+ const color_dict = { name: "Constant", value: "constant" };
102
+ const random_dict = { name: "Random", value: "random" };
103
103
  const textures_dict = { name: "Textures", value: "textures" };
104
104
  const vertex_dict = { name: "Vertex attribute", value: "vertex" };
105
105
  const edge_dict = { name: "Edge attribute", value: "edge" };
@@ -144,13 +144,35 @@ const coloring_styles = computed(() => {
144
144
 
145
145
  const coloring_style_label = ref("");
146
146
 
147
- watch(coloring_style_label, (value) => {
148
- const index = coloring_styles.value.labels.indexOf(value);
149
- if (index !== -1) {
150
- coloring_style_key.value = coloring_styles.value.values[index];
151
- }
147
+ const active_key = computed(() => {
148
+ const index = coloring_styles.value.labels.indexOf(coloring_style_label.value);
149
+ return index === -1 ? coloring_style_key.value : coloring_styles.value.values[index];
152
150
  });
153
151
 
152
+ watch(
153
+ [
154
+ coloring_style_label,
155
+ vertex_attribute_name,
156
+ edge_attribute_name,
157
+ cell_attribute_name,
158
+ polygon_attribute_name,
159
+ polyhedron_attribute_name,
160
+ ],
161
+ () => {
162
+ const key = active_key.value;
163
+ const names = {
164
+ vertex: vertex_attribute_name.value,
165
+ edge: edge_attribute_name.value,
166
+ cell: cell_attribute_name.value,
167
+ polygon: polygon_attribute_name.value,
168
+ polyhedron: polyhedron_attribute_name.value,
169
+ };
170
+ if (!(key in names) || names[key]) {
171
+ coloring_style_key.value = key;
172
+ }
173
+ },
174
+ );
175
+
154
176
  watch(
155
177
  coloring_style_key,
156
178
  (value) => {
@@ -173,7 +195,7 @@ watch(
173
195
  data-testid="coloringStyleSelector"
174
196
  v-model="coloring_style_label"
175
197
  :items="coloring_styles.labels"
176
- label="Select a coloring style"
198
+ label="Select coloring style"
177
199
  density="compact"
178
200
  hide-details
179
201
  />
@@ -181,13 +203,13 @@ watch(
181
203
  </v-row>
182
204
  <v-row class="mt-3 px-2" no-gutters>
183
205
  <v-col cols="12" class="ps-7 pe-1">
184
- <template v-if="coloring_style_key === color_dict['value']">
206
+ <template v-if="active_key === color_dict['value']">
185
207
  <ViewerOptionsColorPicker v-model="color" />
186
208
  </template>
187
- <template v-if="coloring_style_key === textures_dict['value']">
209
+ <template v-if="active_key === textures_dict['value']">
188
210
  <ViewerOptionsTexturesSelector v-model="textures" :id="id" />
189
211
  </template>
190
- <template v-if="coloring_style_key === vertex_dict['value'] && hasColorMap('vertex')">
212
+ <template v-if="active_key === vertex_dict['value'] && hasColorMap('vertex')">
191
213
  <ViewerOptionsAttributeSelector
192
214
  v-model:name="vertex_attribute_name"
193
215
  v-model:range="vertex_attribute_range"
@@ -197,7 +219,7 @@ watch(
197
219
  :schema="vertexSchema"
198
220
  />
199
221
  </template>
200
- <template v-if="coloring_style_key === edge_dict['value'] && hasColorMap('edge')">
222
+ <template v-if="active_key === edge_dict['value'] && hasColorMap('edge')">
201
223
  <ViewerOptionsAttributeSelector
202
224
  v-model:name="edge_attribute_name"
203
225
  v-model:range="edge_attribute_range"
@@ -207,7 +229,7 @@ watch(
207
229
  :schema="edgeSchema"
208
230
  />
209
231
  </template>
210
- <template v-if="coloring_style_key === cell_dict['value'] && hasColorMap('cell')">
232
+ <template v-if="active_key === cell_dict['value'] && hasColorMap('cell')">
211
233
  <ViewerOptionsAttributeSelector
212
234
  v-model:name="cell_attribute_name"
213
235
  v-model:range="cell_attribute_range"
@@ -217,7 +239,7 @@ watch(
217
239
  :schema="cellSchema"
218
240
  />
219
241
  </template>
220
- <template v-if="coloring_style_key === polygon_dict['value'] && hasColorMap('polygon')">
242
+ <template v-if="active_key === polygon_dict['value'] && hasColorMap('polygon')">
221
243
  <ViewerOptionsAttributeSelector
222
244
  v-model:name="polygon_attribute_name"
223
245
  v-model:range="polygon_attribute_range"
@@ -227,7 +249,7 @@ watch(
227
249
  :schema="polygonSchema"
228
250
  />
229
251
  </template>
230
- <template v-if="coloring_style_key === polyhedron_dict['value'] && hasColorMap('polyhedron')">
252
+ <template v-if="active_key === polyhedron_dict['value'] && hasColorMap('polyhedron')">
231
253
  <ViewerOptionsAttributeSelector
232
254
  v-model:name="polyhedron_attribute_name"
233
255
  v-model:range="polyhedron_attribute_range"
@@ -1,4 +1,5 @@
1
1
  // Mesh
2
+ const MESH_DEFAULT_ACTIVE_COLORING = "constant";
2
3
  const POINTS_DEFAULT_VISIBILITY = true;
3
4
  const POINTS_DEFAULT_SIZE = 10;
4
5
  const POINTS_DEFAULT_COLOR = { red: 20, green: 20, blue: 20, alpha: 1 };
@@ -13,14 +14,21 @@ const POLYHEDRA_DEFAULT_VISIBILITY = true;
13
14
  const POLYHEDRA_DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1 };
14
15
 
15
16
  // Model
17
+ const MODEL_DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1 };
18
+ const MODEL_DEFAULT_ACTIVE_COLORING = "constant";
19
+
16
20
  const CORNERS_DEFAULT_VISIBILITY = true;
17
21
  const CORNERS_DEFAULT_COLOR = { red: 20, green: 20, blue: 20, alpha: 1 };
22
+ const CORNERS_DEFAULT_ACTIVE_COLORING = "constant";
18
23
  const LINES_DEFAULT_VISIBILITY = true;
19
24
  const LINES_DEFAULT_COLOR = { red: 20, green: 20, blue: 20, alpha: 1 };
25
+ const LINES_DEFAULT_ACTIVE_COLORING = "constant";
20
26
  const SURFACES_DEFAULT_VISIBILITY = true;
21
27
  const SURFACES_DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1 };
28
+ const SURFACES_DEFAULT_ACTIVE_COLORING = "constant";
22
29
  const BLOCKS_DEFAULT_VISIBILITY = true;
23
30
  const BLOCKS_DEFAULT_COLOR = { red: 255, green: 255, blue: 255, alpha: 1 };
31
+ const BLOCKS_DEFAULT_ACTIVE_COLORING = "constant";
24
32
 
25
33
  const MESH_COMPONENT_TYPES = ["Corner", "Line", "Surface", "Block"];
26
34
 
@@ -46,12 +54,19 @@ export {
46
54
  POLYHEDRA_DEFAULT_COLOR,
47
55
  CORNERS_DEFAULT_VISIBILITY,
48
56
  CORNERS_DEFAULT_COLOR,
57
+ CORNERS_DEFAULT_ACTIVE_COLORING,
49
58
  LINES_DEFAULT_VISIBILITY,
50
59
  LINES_DEFAULT_COLOR,
60
+ LINES_DEFAULT_ACTIVE_COLORING,
51
61
  SURFACES_DEFAULT_VISIBILITY,
52
62
  SURFACES_DEFAULT_COLOR,
63
+ SURFACES_DEFAULT_ACTIVE_COLORING,
53
64
  BLOCKS_DEFAULT_VISIBILITY,
54
65
  BLOCKS_DEFAULT_COLOR,
66
+ BLOCKS_DEFAULT_ACTIVE_COLORING,
55
67
  MESH_COMPONENT_TYPES,
56
68
  DEFAULT_MODEL_COMPONENT_TYPE_COLORS,
69
+ MODEL_DEFAULT_COLOR,
70
+ MESH_DEFAULT_ACTIVE_COLORING,
71
+ MODEL_DEFAULT_ACTIVE_COLORING,
57
72
  };
@@ -50,5 +50,10 @@ function getDefaultStyle(type) {
50
50
  }
51
51
 
52
52
  export { DEFAULT_MODEL_COMPONENT_TYPE_STYLES } from "./models";
53
- export { MESH_COMPONENT_TYPES, DEFAULT_MODEL_COMPONENT_TYPE_COLORS } from "./constants";
53
+ export {
54
+ MESH_COMPONENT_TYPES,
55
+ DEFAULT_MODEL_COMPONENT_TYPE_COLORS,
56
+ MODEL_DEFAULT_COLOR,
57
+ MODEL_DEFAULT_ACTIVE_COLORING,
58
+ } from "./constants";
54
59
  export { getDefaultStyle };
@@ -4,6 +4,7 @@ import {
4
4
  EDGES_DEFAULT_COLOR,
5
5
  EDGES_DEFAULT_VISIBILITY,
6
6
  EDGES_DEFAULT_WIDTH,
7
+ MESH_DEFAULT_ACTIVE_COLORING,
7
8
  POINTS_DEFAULT_COLOR,
8
9
  POINTS_DEFAULT_SIZE,
9
10
  POINTS_DEFAULT_VISIBILITY,
@@ -16,13 +17,13 @@ import {
16
17
  function meshPointsDefaultStyle(
17
18
  visibility = POINTS_DEFAULT_VISIBILITY,
18
19
  size = POINTS_DEFAULT_SIZE,
19
- color = POINTS_DEFAULT_COLOR,
20
+ constant = POINTS_DEFAULT_COLOR,
20
21
  ) {
21
22
  return {
22
23
  visibility,
23
24
  coloring: {
24
- active: "color",
25
- color,
25
+ active: MESH_DEFAULT_ACTIVE_COLORING,
26
+ constant,
26
27
  vertex: {
27
28
  name: undefined,
28
29
  storedConfigs: {},
@@ -35,13 +36,13 @@ function meshPointsDefaultStyle(
35
36
  function meshEdgesDefaultStyle(
36
37
  visibility = EDGES_DEFAULT_VISIBILITY,
37
38
  width = EDGES_DEFAULT_WIDTH,
38
- color = EDGES_DEFAULT_COLOR,
39
+ constant = EDGES_DEFAULT_COLOR,
39
40
  ) {
40
41
  return {
41
42
  visibility,
42
43
  coloring: {
43
- active: "color",
44
- color,
44
+ active: MESH_DEFAULT_ACTIVE_COLORING,
45
+ constant,
45
46
  edge: {
46
47
  name: undefined,
47
48
  storedConfigs: {},
@@ -55,16 +56,19 @@ function meshEdgesDefaultStyle(
55
56
  };
56
57
  }
57
58
 
58
- function meshCellsDefaultStyle(visibility = CELLS_DEFAULT_VISIBILITY, color = CELLS_DEFAULT_COLOR) {
59
+ function meshCellsDefaultStyle(
60
+ visibility = CELLS_DEFAULT_VISIBILITY,
61
+ constant = CELLS_DEFAULT_COLOR,
62
+ ) {
59
63
  return {
60
64
  visibility,
61
65
  coloring: {
62
- active: "color",
66
+ active: MESH_DEFAULT_ACTIVE_COLORING,
63
67
  cell: {
64
68
  name: undefined,
65
69
  storedConfigs: {},
66
70
  },
67
- color,
71
+ constant,
68
72
  textures: undefined,
69
73
  vertex: {
70
74
  name: undefined,
@@ -76,13 +80,13 @@ function meshCellsDefaultStyle(visibility = CELLS_DEFAULT_VISIBILITY, color = CE
76
80
 
77
81
  function meshPolygonsDefaultStyle(
78
82
  visibility = POLYGONS_DEFAULT_VISIBILITY,
79
- color = POLYGONS_DEFAULT_COLOR,
83
+ constant = POLYGONS_DEFAULT_COLOR,
80
84
  ) {
81
85
  return {
82
86
  visibility,
83
87
  coloring: {
84
- active: "color",
85
- color,
88
+ active: MESH_DEFAULT_ACTIVE_COLORING,
89
+ constant,
86
90
  textures: undefined,
87
91
  polygon: {
88
92
  name: undefined,
@@ -98,13 +102,13 @@ function meshPolygonsDefaultStyle(
98
102
 
99
103
  function meshPolyhedraDefaultStyle(
100
104
  visibility = POLYHEDRA_DEFAULT_VISIBILITY,
101
- color = POLYHEDRA_DEFAULT_COLOR,
105
+ constant = POLYHEDRA_DEFAULT_COLOR,
102
106
  ) {
103
107
  return {
104
108
  visibility,
105
109
  coloring: {
106
- active: "color",
107
- color,
110
+ active: MESH_DEFAULT_ACTIVE_COLORING,
111
+ constant,
108
112
  polyhedron: {
109
113
  name: undefined,
110
114
  storedConfigs: {},