@geode/opengeodeweb-front 10.33.4-rc.2 → 10.34.0-rc.2

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 (64) hide show
  1. package/app/assets/css/main.css +24 -0
  2. package/app/components/ClippingPlanes.vue +1 -1
  3. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +20 -0
  4. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +20 -0
  5. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +20 -0
  6. package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +10 -0
  7. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +20 -0
  8. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +20 -0
  9. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +44 -0
  10. package/app/components/Viewer/Generic/Model/CornersOptions.vue +22 -0
  11. package/app/components/Viewer/Generic/Model/LinesOptions.vue +36 -0
  12. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +12 -12
  13. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +48 -0
  14. package/app/components/Viewer/ObjectTree/Base/CommonTreeView.vue +3 -1
  15. package/app/components/Viewer/ObjectTree/Box.vue +2 -0
  16. package/app/components/Viewer/Options/AttributeSelector.vue +53 -0
  17. package/app/components/Viewer/Options/ColorPicker.vue +9 -1
  18. package/app/components/Viewer/Options/ColoringTypeSelector.vue +16 -0
  19. package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +10 -0
  20. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +20 -0
  21. package/app/components/Viewer/Surface/PolygonsOptions.vue +20 -0
  22. package/app/composables/clipping_planes_widget.js +4 -8
  23. package/app/composables/tree_keyboard_nav.js +2 -1
  24. package/app/stores/data.js +5 -0
  25. package/app/utils/default_styles/constants.js +3 -0
  26. package/app/utils/default_styles/index.js +1 -0
  27. package/app/utils/extension.js +21 -14
  28. package/app/utils/import_workflow.js +4 -3
  29. package/internal/database/database.js +1 -0
  30. package/internal/stores/data_style/mesh/cells/cell.js +31 -1
  31. package/internal/stores/data_style/mesh/cells/vertex.js +27 -1
  32. package/internal/stores/data_style/mesh/edges/edge.js +27 -1
  33. package/internal/stores/data_style/mesh/edges/vertex.js +27 -1
  34. package/internal/stores/data_style/mesh/points/vertex.js +27 -1
  35. package/internal/stores/data_style/mesh/polygons/polygon.js +27 -1
  36. package/internal/stores/data_style/mesh/polygons/vertex.js +27 -1
  37. package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +27 -1
  38. package/internal/stores/data_style/mesh/polyhedra/vertex.js +27 -1
  39. package/internal/stores/data_style/model/blocks/polyhedron.js +29 -1
  40. package/internal/stores/data_style/model/blocks/vertex.js +24 -1
  41. package/internal/stores/data_style/model/corners/vertex.js +24 -1
  42. package/internal/stores/data_style/model/lines/edge.js +24 -1
  43. package/internal/stores/data_style/model/lines/vertex.js +24 -1
  44. package/internal/stores/data_style/model/surfaces/polygon.js +29 -1
  45. package/internal/stores/data_style/model/surfaces/vertex.js +29 -1
  46. package/internal/stores/hybrid_viewer/camera.js +5 -4
  47. package/internal/stores/hybrid_viewer/highlight.js +5 -0
  48. package/internal/stores/hybrid_viewer/viewport.js +2 -0
  49. package/nuxt.config.js +10 -2
  50. package/package.json +3 -3
  51. package/server/utils/app_config.js +3 -0
  52. package/server/utils/cleanup.js +2 -0
  53. package/server/utils/microservices.js +4 -0
  54. package/server/utils/path.js +9 -6
  55. package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +2 -0
  56. package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +3 -0
  57. package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +2 -0
  58. package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +3 -0
  59. package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +3 -0
  60. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +3 -0
  61. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +2 -0
  62. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +3 -0
  63. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +3 -0
  64. package/tests/unit/components/Step.nuxt.test.js +14 -5
@@ -177,5 +177,7 @@ watch(
177
177
  background-color: rgba(255, 255, 255, 0.05);
178
178
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
179
179
  flex-shrink: 0;
180
+ font-size: 0.875rem !important;
181
+ line-height: 1.25rem !important;
180
182
  }
181
183
  </style>
@@ -1,5 +1,7 @@
1
1
  <script setup>
2
+ import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
2
3
  import ViewerOptionsAttributeColorBar from "@ogw_front/components/Viewer/Options/AttributeColorBar.vue";
4
+ import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
3
5
  import { getAttributeRange } from "@ogw_front/utils/attributes";
4
6
  import { useBackStore } from "@ogw_front/stores/back";
5
7
 
@@ -9,6 +11,7 @@ const attributeName = defineModel("attributeName", { type: String });
9
11
  const attributeItem = defineModel("attributeItem", { type: Number });
10
12
  const attributeRange = defineModel("attributeRange", { type: Array });
11
13
  const attributeColorMap = defineModel("attributeColorMap", { type: String });
14
+ const attributeNoDataColor = defineModel("attributeNoDataColor", { type: Object });
12
15
 
13
16
  const { id, componentIds, schema } = defineProps({
14
17
  id: { type: String, required: true },
@@ -21,6 +24,10 @@ const attributes = ref([]);
21
24
  const currentAttribute = computed(() =>
22
25
  attributes.value.find((attr) => attr.attribute_name === attributeName.value),
23
26
  );
27
+ const cssNoDataColor = computed(() => {
28
+ const { red, green, blue, alpha } = attributeNoDataColor.value ?? DEFAULT_NO_DATA_COLOR;
29
+ return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
30
+ });
24
31
  const rangeMin = computed({
25
32
  get: () => (attributeRange.value ? attributeRange.value[0] : undefined),
26
33
  set: (val) => {
@@ -102,6 +109,9 @@ watch([attributeName, attributeItem, currentAttribute], () => {
102
109
  if (attributeColorMap.value === undefined) {
103
110
  attributeColorMap.value = "batlow";
104
111
  }
112
+ if (attributeNoDataColor.value === undefined) {
113
+ attributeNoDataColor.value = DEFAULT_NO_DATA_COLOR;
114
+ }
105
115
  if (!attributeRange.value || attributeRange.value[0] === undefined) {
106
116
  resetRange();
107
117
  }
@@ -131,6 +141,29 @@ watch([attributeName, attributeItem, currentAttribute], () => {
131
141
  class="mt-3"
132
142
  hide-details
133
143
  />
144
+ <div
145
+ v-if="currentAttribute && currentAttribute.no_data"
146
+ class="text-caption text-high-emphasis mt-1 d-flex align-center ga-1"
147
+ data-testid="noDataInfo"
148
+ >
149
+ <v-icon icon="mdi-information-outline" size="14" color="info" />
150
+ <span>Contains unmapped elements</span>
151
+ <v-menu :close-on-content-click="false">
152
+ <template #activator="{ props }">
153
+ <button
154
+ v-bind="props"
155
+ type="button"
156
+ class="color-picker-rect-btn ml-1"
157
+ :style="{ backgroundColor: cssNoDataColor }"
158
+ v-tooltip="'Change unmapped elements color'"
159
+ data-testid="noDataColorBtn"
160
+ />
161
+ </template>
162
+ <v-card class="pa-2">
163
+ <ViewerOptionsColorPicker v-model="attributeNoDataColor" disabled-alpha />
164
+ </v-card>
165
+ </v-menu>
166
+ </div>
134
167
  <ViewerOptionsAttributeColorBar
135
168
  v-if="attributeName"
136
169
  v-model:minimum="rangeMin"
@@ -139,3 +172,23 @@ watch([attributeName, attributeItem, currentAttribute], () => {
139
172
  @reset="resetRange"
140
173
  />
141
174
  </template>
175
+
176
+ <style scoped>
177
+ .color-picker-rect-btn {
178
+ width: 26px;
179
+ height: 15px;
180
+ border-radius: 3px;
181
+ border: 2px solid rgba(255, 255, 255, 0.912);
182
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
183
+ cursor: pointer;
184
+ outline: none;
185
+ transition:
186
+ border-color 0.15s ease,
187
+ transform 0.15s ease;
188
+ }
189
+
190
+ .color-picker-rect-btn:hover {
191
+ border-color: rgba(255, 255, 255, 0.9);
192
+ transform: scale(1.1);
193
+ }
194
+ </style>
@@ -1,5 +1,12 @@
1
1
  <script setup>
2
2
  // oxlint-disable id-length
3
+ defineProps({
4
+ disabledAlpha: {
5
+ type: Boolean,
6
+ default: false,
7
+ },
8
+ });
9
+
3
10
  const colorPickerRef = useTemplateRef("colorPickerRef");
4
11
  const model = defineModel({ type: Object });
5
12
  const { pressed } = useMousePressed({ target: colorPickerRef });
@@ -53,8 +60,9 @@ watch(pressed, (value) => {
53
60
  canvas-height="75"
54
61
  hide-inputs
55
62
  hide-eye-dropper
63
+ :disabled-alpha="disabledAlpha"
56
64
  width="220"
57
- mode="rgba"
65
+ :mode="disabledAlpha ? 'rgb' : 'rgba'"
58
66
  class="mx-auto"
59
67
  />
60
68
  </template>
@@ -13,21 +13,29 @@ const vertex_attribute_name = defineModel("vertex_attribute_name", { type: Strin
13
13
  const vertex_attribute_item = defineModel("vertex_attribute_item", { type: Number });
14
14
  const vertex_attribute_range = defineModel("vertex_attribute_range", { type: Array });
15
15
  const vertex_attribute_color_map = defineModel("vertex_attribute_color_map", { type: String });
16
+ const vertex_attribute_no_data_color = defineModel("vertex_attribute_no_data_color", {
17
+ type: Object,
18
+ });
16
19
 
17
20
  const edge_attribute_name = defineModel("edge_attribute_name", { type: String });
18
21
  const edge_attribute_item = defineModel("edge_attribute_item", { type: Number });
19
22
  const edge_attribute_range = defineModel("edge_attribute_range", { type: Array });
20
23
  const edge_attribute_color_map = defineModel("edge_attribute_color_map", { type: String });
24
+ const edge_attribute_no_data_color = defineModel("edge_attribute_no_data_color", { type: Object });
21
25
 
22
26
  const cell_attribute_name = defineModel("cell_attribute_name", { type: String });
23
27
  const cell_attribute_item = defineModel("cell_attribute_item", { type: Number });
24
28
  const cell_attribute_range = defineModel("cell_attribute_range", { type: Array });
25
29
  const cell_attribute_color_map = defineModel("cell_attribute_color_map", { type: String });
30
+ const cell_attribute_no_data_color = defineModel("cell_attribute_no_data_color", { type: Object });
26
31
 
27
32
  const polygon_attribute_name = defineModel("polygon_attribute_name", { type: String });
28
33
  const polygon_attribute_item = defineModel("polygon_attribute_item", { type: Number });
29
34
  const polygon_attribute_range = defineModel("polygon_attribute_range", { type: Array });
30
35
  const polygon_attribute_color_map = defineModel("polygon_attribute_color_map", { type: String });
36
+ const polygon_attribute_no_data_color = defineModel("polygon_attribute_no_data_color", {
37
+ type: Object,
38
+ });
31
39
 
32
40
  const polyhedron_attribute_name = defineModel("polyhedron_attribute_name", { type: String });
33
41
  const polyhedron_attribute_item = defineModel("polyhedron_attribute_item", { type: Number });
@@ -35,6 +43,9 @@ const polyhedron_attribute_range = defineModel("polyhedron_attribute_range", { t
35
43
  const polyhedron_attribute_color_map = defineModel("polyhedron_attribute_color_map", {
36
44
  type: String,
37
45
  });
46
+ const polyhedron_attribute_no_data_color = defineModel("polyhedron_attribute_no_data_color", {
47
+ type: Object,
48
+ });
38
49
 
39
50
  const { id, componentIds, capabilities, schemas, allowRandom } = defineProps({
40
51
  id: { type: String, required: true },
@@ -214,6 +225,7 @@ watch(
214
225
  v-model:attributeItem="vertex_attribute_item"
215
226
  v-model:attributeRange="vertex_attribute_range"
216
227
  v-model:attributeColorMap="vertex_attribute_color_map"
228
+ v-model:attributeNoDataColor="vertex_attribute_no_data_color"
217
229
  :id="id"
218
230
  :componentIds="componentIds"
219
231
  :schema="vertexSchema"
@@ -225,6 +237,7 @@ watch(
225
237
  v-model:attributeItem="edge_attribute_item"
226
238
  v-model:attributeRange="edge_attribute_range"
227
239
  v-model:attributeColorMap="edge_attribute_color_map"
240
+ v-model:attributeNoDataColor="edge_attribute_no_data_color"
228
241
  :id="id"
229
242
  :componentIds="componentIds"
230
243
  :schema="edgeSchema"
@@ -236,6 +249,7 @@ watch(
236
249
  v-model:attributeItem="cell_attribute_item"
237
250
  v-model:attributeRange="cell_attribute_range"
238
251
  v-model:attributeColorMap="cell_attribute_color_map"
252
+ v-model:attributeNoDataColor="cell_attribute_no_data_color"
239
253
  :id="id"
240
254
  :componentIds="componentIds"
241
255
  :schema="cellSchema"
@@ -247,6 +261,7 @@ watch(
247
261
  v-model:attributeItem="polygon_attribute_item"
248
262
  v-model:attributeRange="polygon_attribute_range"
249
263
  v-model:attributeColorMap="polygon_attribute_color_map"
264
+ v-model:attributeNoDataColor="polygon_attribute_no_data_color"
250
265
  :id="id"
251
266
  :componentIds="componentIds"
252
267
  :schema="polygonSchema"
@@ -258,6 +273,7 @@ watch(
258
273
  v-model:attributeItem="polyhedron_attribute_item"
259
274
  v-model:attributeRange="polyhedron_attribute_range"
260
275
  v-model:attributeColorMap="polyhedron_attribute_color_map"
276
+ v-model:attributeNoDataColor="polyhedron_attribute_no_data_color"
261
277
  :id="id"
262
278
  :componentIds="componentIds"
263
279
  :schema="polyhedronSchema"
@@ -91,6 +91,15 @@ const vertex_attribute_color_map = computed({
91
91
  hybridViewerStore.remoteRender();
92
92
  },
93
93
  });
94
+ const vertex_attribute_no_data_color = computed({
95
+ get: () => dataStyleStore.meshPointsVertexAttributeNoDataColor(id.value),
96
+ set: async (newValue) => {
97
+ await applyBatchStyle(id.value, (targetId) =>
98
+ dataStyleStore.setMeshPointsVertexAttributeNoDataColor(targetId, newValue),
99
+ );
100
+ hybridViewerStore.remoteRender();
101
+ },
102
+ });
94
103
  </script>
95
104
  <template>
96
105
  <ViewerContextMenuItem
@@ -115,6 +124,7 @@ const vertex_attribute_color_map = computed({
115
124
  v-model:vertex_attribute_item="vertex_attribute_item"
116
125
  v-model:vertex_attribute_range="vertex_attribute_range"
117
126
  v-model:vertex_attribute_color_map="vertex_attribute_color_map"
127
+ v-model:vertex_attribute_no_data_color="vertex_attribute_no_data_color"
118
128
  :vertex_has_colormap="true"
119
129
  />
120
130
  </template>
@@ -82,6 +82,15 @@ const vertex_attribute_color_map = computed({
82
82
  hybridViewerStore.remoteRender();
83
83
  },
84
84
  });
85
+ const vertex_attribute_no_data_color = computed({
86
+ get: () => dataStyleStore.meshPolyhedraVertexAttributeNoDataColor(id.value),
87
+ set: async (newValue) => {
88
+ await applyBatchStyle(id.value, (targetId) =>
89
+ dataStyleStore.setMeshPolyhedraVertexAttributeNoDataColor(targetId, newValue),
90
+ );
91
+ hybridViewerStore.remoteRender();
92
+ },
93
+ });
85
94
  const polyhedron_attribute_name = computed({
86
95
  get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeName(id.value),
87
96
  set: async (newValue) => {
@@ -120,6 +129,15 @@ const polyhedron_attribute_color_map = computed({
120
129
  hybridViewerStore.remoteRender();
121
130
  },
122
131
  });
132
+ const polyhedron_attribute_no_data_color = computed({
133
+ get: () => dataStyleStore.meshPolyhedraPolyhedronAttributeNoDataColor(id.value),
134
+ set: async (newValue) => {
135
+ await applyBatchStyle(id.value, (targetId) =>
136
+ dataStyleStore.setMeshPolyhedraPolyhedronAttributeNoDataColor(targetId, newValue),
137
+ );
138
+ hybridViewerStore.remoteRender();
139
+ },
140
+ });
123
141
  </script>
124
142
  <template>
125
143
  <ViewerContextMenuItem
@@ -142,10 +160,12 @@ const polyhedron_attribute_color_map = computed({
142
160
  v-model:vertex_attribute_item="vertex_attribute_item"
143
161
  v-model:vertex_attribute_range="vertex_attribute_range"
144
162
  v-model:vertex_attribute_color_map="vertex_attribute_color_map"
163
+ v-model:vertex_attribute_no_data_color="vertex_attribute_no_data_color"
145
164
  v-model:polyhedron_attribute_name="polyhedron_attribute_name"
146
165
  v-model:polyhedron_attribute_item="polyhedron_attribute_item"
147
166
  v-model:polyhedron_attribute_range="polyhedron_attribute_range"
148
167
  v-model:polyhedron_attribute_color_map="polyhedron_attribute_color_map"
168
+ v-model:polyhedron_attribute_no_data_color="polyhedron_attribute_no_data_color"
149
169
  />
150
170
  </template>
151
171
  </template>
@@ -91,6 +91,15 @@ const vertex_attribute_color_map = computed({
91
91
  hybridViewerStore.remoteRender();
92
92
  },
93
93
  });
94
+ const vertex_attribute_no_data_color = computed({
95
+ get: () => dataStyleStore.meshPolygonsVertexAttributeNoDataColor(id.value),
96
+ set: async (newValue) => {
97
+ await applyBatchStyle(id.value, (targetId) =>
98
+ dataStyleStore.setMeshPolygonsVertexAttributeNoDataColor(targetId, newValue),
99
+ );
100
+ hybridViewerStore.remoteRender();
101
+ },
102
+ });
94
103
  const polygon_attribute_name = computed({
95
104
  get: () => dataStyleStore.meshPolygonsPolygonAttributeName(id.value),
96
105
  set: async (newValue) => {
@@ -127,6 +136,15 @@ const polygon_attribute_color_map = computed({
127
136
  hybridViewerStore.remoteRender();
128
137
  },
129
138
  });
139
+ const polygon_attribute_no_data_color = computed({
140
+ get: () => dataStyleStore.meshPolygonsPolygonAttributeNoDataColor(id.value),
141
+ set: async (newValue) => {
142
+ await applyBatchStyle(id.value, (targetId) =>
143
+ dataStyleStore.setMeshPolygonsPolygonAttributeNoDataColor(targetId, newValue),
144
+ );
145
+ hybridViewerStore.remoteRender();
146
+ },
147
+ });
130
148
  </script>
131
149
 
132
150
  <template>
@@ -151,10 +169,12 @@ const polygon_attribute_color_map = computed({
151
169
  v-model:vertex_attribute_item="vertex_attribute_item"
152
170
  v-model:vertex_attribute_range="vertex_attribute_range"
153
171
  v-model:vertex_attribute_color_map="vertex_attribute_color_map"
172
+ v-model:vertex_attribute_no_data_color="vertex_attribute_no_data_color"
154
173
  v-model:polygon_attribute_name="polygon_attribute_name"
155
174
  v-model:polygon_attribute_item="polygon_attribute_item"
156
175
  v-model:polygon_attribute_range="polygon_attribute_range"
157
176
  v-model:polygon_attribute_color_map="polygon_attribute_color_map"
177
+ v-model:polygon_attribute_no_data_color="polygon_attribute_no_data_color"
158
178
  />
159
179
  </template>
160
180
  </template>
@@ -210,11 +210,10 @@ function useClippingPlanesWidget({
210
210
  maxDistance = localRenderWindow.getRenderer().getActiveCamera().getDistance();
211
211
  }
212
212
  }
213
+
213
214
  function initLocalWidget(container) {
214
215
  cleanupLocalWidget();
215
- container.addEventListener("wheel", (event) => event.stopPropagation(), {
216
- passive: true,
217
- });
216
+ container.addEventListener("wheel", (event) => event.stopPropagation(), { passive: true });
218
217
  localRenderWindow = vtkGenericRenderWindow({
219
218
  background: [0, 0, 0, 0],
220
219
  listenWindowResize: false,
@@ -223,16 +222,13 @@ function useClippingPlanesWidget({
223
222
  const camera = localRenderWindow.getRenderer().getActiveCamera();
224
223
  camera.onModified(() => limitCameraZoomOut(camera));
225
224
  const canvas = localRenderWindow.getApiSpecificRenderWindow().getCanvas();
226
- Object.assign(canvas.style, {
227
- width: "100%",
228
- height: "100%",
229
- background: "transparent",
230
- });
225
+ Object.assign(canvas.style, { width: "100%", height: "100%", background: "transparent" });
231
226
  localRenderWindow.resize();
232
227
  widgetManager = vtkWidgetManager();
233
228
  widgetManager.setRenderer(localRenderWindow.getRenderer());
234
229
  updateWidgetPlacement();
235
230
  }
231
+
236
232
  function isFromWidget() {
237
233
  return fromWidget;
238
234
  }
@@ -23,8 +23,9 @@ export function useTreeKeyboardNav(
23
23
  toggleOpen,
24
24
  handleItemClick,
25
25
  getScrollInfo,
26
+ externalFocusedIndex,
26
27
  ) {
27
- const focusedIndex = ref(-1);
28
+ const focusedIndex = externalFocusedIndex || ref(-1);
28
29
 
29
30
  function findParentIndex(item, currentIndex) {
30
31
  for (let index = currentIndex - 1; index >= 0; index -= 1) {
@@ -196,13 +196,16 @@ export const useDataStore = defineStore("data", () => {
196
196
  await model_components_db.where("id").equals(modelId).delete();
197
197
  await database.model_components_relation.where("id").equals(modelId).delete();
198
198
  }
199
+
199
200
  async function deleteItem(id) {
200
201
  await data_db.delete(id);
201
202
  await deleteModelComponents(id);
202
203
  }
204
+
203
205
  async function updateItem(id, changes) {
204
206
  await data_db.update(id, changes);
205
207
  }
208
+
206
209
  async function getAllModelComponentsViewerIds(modelId) {
207
210
  const components = await model_components_db.where("id").equals(modelId).toArray();
208
211
  return components.map((component) => Math.trunc(Number(component.viewer_id)));
@@ -224,11 +227,13 @@ export const useDataStore = defineStore("data", () => {
224
227
  modelComponentsRelations,
225
228
  };
226
229
  }
230
+
227
231
  async function clear() {
228
232
  await data_db.clear();
229
233
  await model_components_db.clear();
230
234
  await model_components_relation_db.clear();
231
235
  }
236
+
232
237
  async function importStores(snapshot) {
233
238
  await clear();
234
239
  await model_components_db.bulkPut(snapshot.modelComponents);
@@ -39,6 +39,8 @@ const DEFAULT_MODEL_COMPONENT_TYPE_COLORS = {
39
39
  Block: BLOCKS_DEFAULT_COLOR,
40
40
  };
41
41
 
42
+ const DEFAULT_NO_DATA_COLOR = { red: 128, green: 128, blue: 128, alpha: 1 };
43
+
42
44
  export {
43
45
  POINTS_DEFAULT_VISIBILITY,
44
46
  POINTS_DEFAULT_SIZE,
@@ -69,4 +71,5 @@ export {
69
71
  MODEL_DEFAULT_COLOR,
70
72
  MESH_DEFAULT_ACTIVE_COLORING,
71
73
  MODEL_DEFAULT_ACTIVE_COLORING,
74
+ DEFAULT_NO_DATA_COLOR,
72
75
  };
@@ -55,5 +55,6 @@ export {
55
55
  DEFAULT_MODEL_COMPONENT_TYPE_COLORS,
56
56
  MODEL_DEFAULT_COLOR,
57
57
  MODEL_DEFAULT_ACTIVE_COLORING,
58
+ DEFAULT_NO_DATA_COLOR,
58
59
  } from "./constants";
59
60
  export { getDefaultStyle };
@@ -13,6 +13,7 @@ async function uploadExtension(file) {
13
13
  const appStore = useAppStore();
14
14
  await appStore.upload(file);
15
15
  }
16
+
16
17
  function runExtensions() {
17
18
  const appStore = useAppStore();
18
19
  const { projectFolderPath } = appStore;
@@ -29,6 +30,22 @@ function runExtensions() {
29
30
  params,
30
31
  });
31
32
  }
33
+
34
+ function downloadExtension({ url, extensionFileName }) {
35
+ const appStore = useAppStore();
36
+ const { PROJECT: projectName } = useRuntimeConfig().public;
37
+ const schema = opengeodeweb_front_schemas.api.microservice.extensions.download;
38
+ const params = {
39
+ projectName,
40
+ url,
41
+ extensionFileName,
42
+ };
43
+ return appStore.request({
44
+ schema,
45
+ params,
46
+ });
47
+ }
48
+
32
49
  async function registerRunningExtensions() {
33
50
  const appStore = useAppStore();
34
51
  const infraStore = useInfraStore();
@@ -55,28 +72,17 @@ async function registerRunningExtensions() {
55
72
  }),
56
73
  );
57
74
  }
75
+
58
76
  async function importExtensionFile(file) {
59
77
  await uploadExtension(file);
60
78
  return registerRunningExtensions();
61
79
  }
62
- function downloadExtension({ url, extensionFileName }) {
63
- const appStore = useAppStore();
64
- const { PROJECT: projectName } = useRuntimeConfig().public;
65
- const schema = opengeodeweb_front_schemas.api.microservice.extensions.download;
66
- const params = {
67
- projectName,
68
- url,
69
- extensionFileName,
70
- };
71
- return appStore.request({
72
- schema,
73
- params,
74
- });
75
- }
80
+
76
81
  async function importExtensionURL(url) {
77
82
  await downloadExtension(url);
78
83
  return registerRunningExtensions();
79
84
  }
85
+
80
86
  async function unloadExtension(extensionId) {
81
87
  const appStore = useAppStore();
82
88
  console.log("[ExtensionManager] Unloading extension:", extensionId);
@@ -101,6 +107,7 @@ async function unloadExtension(extensionId) {
101
107
  console.log("[ExtensionManager] Extension unloaded:", extensionId);
102
108
  return true;
103
109
  }
110
+
104
111
  function killExtension(extensionId) {
105
112
  const appStore = useAppStore();
106
113
  const { projectFolderPath } = appStore;
@@ -69,12 +69,14 @@ async function importFile(filename, geode_object_type) {
69
69
  });
70
70
  return importItem(response);
71
71
  }
72
+
72
73
  async function importWorkflow(files) {
73
74
  const chunk_size = 5;
74
75
  const chunks = [];
75
76
  for (let i = 0; i < files.length; i += chunk_size) {
76
77
  chunks.push(files.slice(i, i + chunk_size));
77
78
  }
79
+
78
80
  const results = [];
79
81
  async function processChunk(chunkIndex) {
80
82
  if (chunkIndex >= chunks.length) {
@@ -92,10 +94,9 @@ async function importWorkflow(files) {
92
94
  hybridViewerStore.remoteRender();
93
95
  return results;
94
96
  }
97
+
95
98
  async function importWorkflowFromSnapshot(items) {
96
- console.log("[importWorkflowFromSnapshot] start", {
97
- count: items?.length,
98
- });
99
+ console.log("[importWorkflowFromSnapshot] start", { count: items?.length });
99
100
  const hybridViewerStore = useHybridViewerStore();
100
101
  const chunk_size = 5;
101
102
  const chunks = [];
@@ -58,6 +58,7 @@ class Database extends BaseDatabase {
58
58
  }
59
59
  }
60
60
  }
61
+
61
62
  // oxlint-disable-next-line no-top-level-await
62
63
  await Dexie.delete("Database");
63
64
  databaseContainer.instance = new Database();
@@ -1,3 +1,4 @@
1
+ import { DEFAULT_NO_DATA_COLOR } from "@ogw_front/utils/default_styles/constants";
1
2
  // Third party imports
2
3
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
3
4
 
@@ -34,6 +35,7 @@ function useMeshCellsCellAttributeStyle() {
34
35
  minimum: undefined,
35
36
  maximum: undefined,
36
37
  colorMap: undefined,
38
+ no_data_color: DEFAULT_NO_DATA_COLOR,
37
39
  };
38
40
  }
39
41
  function mutateMeshCellsCellStyle(id, values) {
@@ -67,7 +69,10 @@ function useMeshCellsCellAttributeStyle() {
67
69
  const { item, name } = meshCellsCellAttribute(id);
68
70
  return item ?? meshCellsCellAttributeLastItem(id, name);
69
71
  }
70
- function setMeshCellsCellAttribute(id, { name, item, minimum, maximum, colorMap }) {
72
+ function setMeshCellsCellAttribute(
73
+ id,
74
+ { name, item, minimum, maximum, colorMap, no_data_color = DEFAULT_NO_DATA_COLOR },
75
+ ) {
71
76
  mutateMeshCellsCellStyle(id, {
72
77
  name,
73
78
  item,
@@ -76,6 +81,7 @@ function useMeshCellsCellAttributeStyle() {
76
81
  minimum,
77
82
  maximum,
78
83
  colorMap,
84
+ no_data_color,
79
85
  });
80
86
  const points = getRGBPointsFromPreset(colorMap);
81
87
  const schema = meshCellsCellAttributeSchemas.attribute;
@@ -86,6 +92,7 @@ function useMeshCellsCellAttributeStyle() {
86
92
  points,
87
93
  minimum,
88
94
  maximum,
95
+ no_data_color,
89
96
  };
90
97
  return viewerStore.request({
91
98
  schema,
@@ -102,6 +109,7 @@ function useMeshCellsCellAttributeStyle() {
102
109
  minimum: storedConfig.minimum,
103
110
  maximum: storedConfig.maximum,
104
111
  colorMap: storedConfig.colorMap,
112
+ no_data_color: storedConfig.no_data_color,
105
113
  };
106
114
  if (isMeshCellsCellAttributeValid(attribute)) {
107
115
  return setMeshCellsCellAttribute(id, attribute);
@@ -130,7 +138,9 @@ function useMeshCellsCellAttributeStyle() {
130
138
  async function setMeshCellsCellAttributeRange(id, minimum, maximum) {
131
139
  const name = meshCellsCellAttributeName(id);
132
140
  const item = meshCellsCellAttributeItem(id);
141
+ const storedConfig = meshCellsCellAttributeStoredConfig(id, name, item);
133
142
  await setMeshCellsCellAttributeStoredConfig(id, name, item, {
143
+ ...storedConfig,
134
144
  minimum,
135
145
  maximum,
136
146
  });
@@ -145,11 +155,29 @@ function useMeshCellsCellAttributeStyle() {
145
155
  async function setMeshCellsCellAttributeColorMap(id, colorMap) {
146
156
  const name = meshCellsCellAttributeName(id);
147
157
  const item = meshCellsCellAttributeItem(id);
158
+ const storedConfig = meshCellsCellAttributeStoredConfig(id, name, item);
148
159
  await setMeshCellsCellAttributeStoredConfig(id, name, item, {
160
+ ...storedConfig,
149
161
  colorMap,
150
162
  });
151
163
  return applyCellAttribute(id);
152
164
  }
165
+ function meshCellsCellAttributeNoDataColor(id) {
166
+ const name = meshCellsCellAttributeName(id);
167
+ const item = meshCellsCellAttributeItem(id);
168
+ const storedConfig = meshCellsCellAttributeStoredConfig(id, name, item);
169
+ return storedConfig.no_data_color;
170
+ }
171
+ async function setMeshCellsCellAttributeNoDataColor(id, no_data_color) {
172
+ const name = meshCellsCellAttributeName(id);
173
+ const item = meshCellsCellAttributeItem(id);
174
+ const storedConfig = meshCellsCellAttributeStoredConfig(id, name, item);
175
+ await setMeshCellsCellAttributeStoredConfig(id, name, item, {
176
+ ...storedConfig,
177
+ no_data_color,
178
+ });
179
+ return applyCellAttribute(id);
180
+ }
153
181
  return {
154
182
  meshCellsCellAttributeName,
155
183
  meshCellsCellAttributeItem,
@@ -161,6 +189,8 @@ function useMeshCellsCellAttributeStyle() {
161
189
  setMeshCellsCellAttributeItem,
162
190
  setMeshCellsCellAttributeRange,
163
191
  setMeshCellsCellAttributeColorMap,
192
+ meshCellsCellAttributeNoDataColor,
193
+ setMeshCellsCellAttributeNoDataColor,
164
194
  };
165
195
  }
166
196
  export { isMeshCellsCellAttributeValid, useMeshCellsCellAttributeStyle };