@geode/opengeodeweb-front 10.38.0 → 10.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/ThresholdFilter.vue +33 -5
- package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +28 -0
- package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +28 -0
- package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +28 -0
- package/app/components/Viewer/Generic/Mesh/PointsOptions.vue +14 -0
- package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +28 -0
- package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +30 -0
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +53 -0
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +24 -0
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +48 -0
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +58 -0
- package/app/components/Viewer/Options/AttributeSelector.vue +25 -0
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +10 -0
- package/app/components/Viewer/Options/ColormapQuickPicker.vue +17 -2
- package/app/components/Viewer/Options/TimeStepSlider.vue +120 -0
- package/app/components/Viewer/PointSet/SpecificPointsOptions.vue +14 -0
- package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +30 -0
- package/app/components/Viewer/Surface/PolygonsOptions.vue +28 -0
- package/app/composables/global_attribute_style.ts +94 -0
- package/app/stores/data_style.ts +3 -0
- package/app/utils/attributes.ts +46 -9
- package/internal/stores/data_style/mesh/cells/cell.ts +20 -1
- package/internal/stores/data_style/mesh/cells/index.ts +4 -2
- package/internal/stores/data_style/mesh/cells/vertex.ts +23 -1
- package/internal/stores/data_style/mesh/edges/edge.ts +20 -1
- package/internal/stores/data_style/mesh/edges/index.ts +4 -2
- package/internal/stores/data_style/mesh/edges/vertex.ts +23 -1
- package/internal/stores/data_style/mesh/index.ts +68 -0
- package/internal/stores/data_style/mesh/points/index.ts +2 -1
- package/internal/stores/data_style/mesh/points/vertex.ts +23 -1
- package/internal/stores/data_style/mesh/polygons/index.ts +11 -2
- package/internal/stores/data_style/mesh/polygons/polygon.ts +23 -1
- package/internal/stores/data_style/mesh/polygons/vertex.ts +23 -1
- package/internal/stores/data_style/mesh/polyhedra/index.ts +11 -2
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +27 -1
- package/internal/stores/data_style/mesh/polyhedra/vertex.ts +23 -1
- package/internal/stores/data_style/model/blocks/color.ts +11 -2
- package/internal/stores/data_style/model/blocks/index.ts +36 -6
- package/internal/stores/data_style/model/blocks/polyhedron.ts +61 -7
- package/internal/stores/data_style/model/blocks/vertex.ts +61 -7
- package/internal/stores/data_style/model/corners/color.ts +5 -1
- package/internal/stores/data_style/model/corners/index.ts +18 -3
- package/internal/stores/data_style/model/corners/vertex.ts +68 -8
- package/internal/stores/data_style/model/lines/color.ts +10 -2
- package/internal/stores/data_style/model/lines/edge.ts +58 -7
- package/internal/stores/data_style/model/lines/index.ts +35 -6
- package/internal/stores/data_style/model/lines/vertex.ts +58 -7
- package/internal/stores/data_style/model/surfaces/color.ts +10 -2
- package/internal/stores/data_style/model/surfaces/index.ts +53 -6
- package/internal/stores/data_style/model/surfaces/polygon.ts +76 -15
- package/internal/stores/data_style/model/surfaces/vertex.ts +70 -12
- package/internal/stores/data_style/time_step.ts +75 -0
- package/internal/stores/data_style/types.ts +1 -0
- package/package.json +1 -1
|
@@ -4,6 +4,10 @@ import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_
|
|
|
4
4
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
|
+
import {
|
|
8
|
+
reapplySameSeries,
|
|
9
|
+
useAttributeTimeStepStyle,
|
|
10
|
+
} from "@ogw_internal/stores/data_style/time_step";
|
|
7
11
|
import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
|
|
8
12
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
9
13
|
import { useModelBlocksCommonStyle } from "./common";
|
|
@@ -60,6 +64,12 @@ interface UseModelBlocksVertexAttributeReturn {
|
|
|
60
64
|
modelId: string,
|
|
61
65
|
blockId?: string,
|
|
62
66
|
) => [number | undefined, number | undefined];
|
|
67
|
+
modelBlocksVertexAttributeTimeStep: (modelId: string, blockId?: string) => number | undefined;
|
|
68
|
+
setModelBlocksVertexAttributeTimeStep: (
|
|
69
|
+
modelId: string,
|
|
70
|
+
blockIds: string[],
|
|
71
|
+
timeStep: number,
|
|
72
|
+
) => Promise<void>;
|
|
63
73
|
modelBlocksVertexAttributeColorMap: (modelId: string, blockId?: string) => string | undefined;
|
|
64
74
|
modelBlocksVertexAttributeStoredConfig: (
|
|
65
75
|
modelId: string,
|
|
@@ -103,6 +113,7 @@ interface UseModelBlocksVertexAttributeReturn {
|
|
|
103
113
|
|
|
104
114
|
// oxlint-disable-next-line max-lines-per-function
|
|
105
115
|
function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
|
|
116
|
+
const { attributeTimeStep, setAttributeTimeStep, seriesArrayName } = useAttributeTimeStepStyle();
|
|
106
117
|
const dataStore = useDataStore();
|
|
107
118
|
const modelBlocksCommonStyle = useModelBlocksCommonStyle();
|
|
108
119
|
const viewerStore = useViewerStore();
|
|
@@ -209,6 +220,22 @@ function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
|
|
|
209
220
|
const storedConfig = modelBlocksVertexAttributeStoredConfig(modelId, blockId, name, item);
|
|
210
221
|
return storedConfig.colorMap;
|
|
211
222
|
}
|
|
223
|
+
function modelBlocksVertexAttributeNoDataColor(modelId: string, blockId?: string): RGBAColor {
|
|
224
|
+
const name = modelBlocksVertexAttributeName(modelId, blockId);
|
|
225
|
+
const item = modelBlocksVertexAttributeItem(modelId, blockId);
|
|
226
|
+
const storedConfig = modelBlocksVertexAttributeStoredConfig(modelId, blockId, name, item);
|
|
227
|
+
return storedConfig.no_data_color;
|
|
228
|
+
}
|
|
229
|
+
function modelBlocksVertexAttributeTimeStep(
|
|
230
|
+
modelId: string,
|
|
231
|
+
blockId?: string,
|
|
232
|
+
): number | undefined {
|
|
233
|
+
return attributeTimeStep(
|
|
234
|
+
modelId,
|
|
235
|
+
attributeSchema.$id,
|
|
236
|
+
modelBlocksVertexAttribute(modelId, blockId).name,
|
|
237
|
+
);
|
|
238
|
+
}
|
|
212
239
|
async function setModelBlocksVertexAttribute(
|
|
213
240
|
modelId: string,
|
|
214
241
|
blockIds: string[],
|
|
@@ -236,7 +263,7 @@ function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
|
|
|
236
263
|
const params = {
|
|
237
264
|
id: modelId,
|
|
238
265
|
block_ids: block_viewer_ids,
|
|
239
|
-
name,
|
|
266
|
+
name: seriesArrayName(modelId, attributeSchema.$id, name),
|
|
240
267
|
item,
|
|
241
268
|
points,
|
|
242
269
|
minimum,
|
|
@@ -288,6 +315,37 @@ function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
|
|
|
288
315
|
});
|
|
289
316
|
return applyVertexAttribute(modelId, blockIds);
|
|
290
317
|
}
|
|
318
|
+
async function setModelBlocksVertexAttributeTimeStep(
|
|
319
|
+
modelId: string,
|
|
320
|
+
blockIds: string[],
|
|
321
|
+
timeStep: number,
|
|
322
|
+
): Promise<void> {
|
|
323
|
+
const name = modelBlocksVertexAttributeName(modelId, blockIds[0]);
|
|
324
|
+
if (name === undefined) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
await setAttributeTimeStep(modelId, attributeSchema.$id, name, timeStep);
|
|
328
|
+
await Promise.all([
|
|
329
|
+
applyVertexAttribute(modelId, blockIds),
|
|
330
|
+
reapplySameSeries(
|
|
331
|
+
await dataStore.getBlocksGeodeIds(modelId),
|
|
332
|
+
blockIds,
|
|
333
|
+
(id) =>
|
|
334
|
+
modelBlocksCommonStyle.modelBlockColoring(modelId, id).active === "vertex" &&
|
|
335
|
+
modelBlocksVertexAttributeName(modelId, id) === name
|
|
336
|
+
? [
|
|
337
|
+
modelBlocksVertexAttributeItem(modelId, id),
|
|
338
|
+
modelBlocksVertexAttributeRange(modelId, id),
|
|
339
|
+
modelBlocksVertexAttributeColorMap(modelId, id),
|
|
340
|
+
JSON.stringify(modelBlocksVertexAttributeNoDataColor(modelId, id)),
|
|
341
|
+
].join("|")
|
|
342
|
+
: undefined,
|
|
343
|
+
async (ids) => {
|
|
344
|
+
await applyVertexAttribute(modelId, ids);
|
|
345
|
+
},
|
|
346
|
+
),
|
|
347
|
+
]);
|
|
348
|
+
}
|
|
291
349
|
async function setModelBlocksVertexAttributeRange(
|
|
292
350
|
modelId: string,
|
|
293
351
|
blockIds: string[],
|
|
@@ -314,12 +372,6 @@ function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
|
|
|
314
372
|
});
|
|
315
373
|
return applyVertexAttribute(modelId, blockIds);
|
|
316
374
|
}
|
|
317
|
-
function modelBlocksVertexAttributeNoDataColor(modelId: string, blockId?: string): RGBAColor {
|
|
318
|
-
const name = modelBlocksVertexAttributeName(modelId, blockId);
|
|
319
|
-
const item = modelBlocksVertexAttributeItem(modelId, blockId);
|
|
320
|
-
const storedConfig = modelBlocksVertexAttributeStoredConfig(modelId, blockId, name, item);
|
|
321
|
-
return storedConfig.no_data_color;
|
|
322
|
-
}
|
|
323
375
|
async function setModelBlocksVertexAttributeNoDataColor(
|
|
324
376
|
modelId: string,
|
|
325
377
|
blockIds: string[],
|
|
@@ -336,6 +388,8 @@ function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
|
|
|
336
388
|
}
|
|
337
389
|
return {
|
|
338
390
|
modelBlocksVertexAttributeName,
|
|
391
|
+
modelBlocksVertexAttributeTimeStep,
|
|
392
|
+
setModelBlocksVertexAttributeTimeStep,
|
|
339
393
|
modelBlocksVertexAttributeItem,
|
|
340
394
|
modelBlocksVertexAttributeRange,
|
|
341
395
|
modelBlocksVertexAttributeColorMap,
|
|
@@ -102,7 +102,11 @@ export function useModelCornersColor(): ModelCornersColorApi {
|
|
|
102
102
|
modelId,
|
|
103
103
|
corners_ids[0],
|
|
104
104
|
);
|
|
105
|
-
const
|
|
105
|
+
const no_data_color = modelCornersVertexAttribute.modelCornersVertexAttributeNoDataColor(
|
|
106
|
+
modelId,
|
|
107
|
+
corners_ids[0],
|
|
108
|
+
);
|
|
109
|
+
const attribute = { name, item, minimum, maximum, colorMap, no_data_color };
|
|
106
110
|
if (isModelCornersVertexAttributeValid(attribute)) {
|
|
107
111
|
return modelCornersVertexAttribute.setModelCornersVertexAttribute(
|
|
108
112
|
modelId,
|
|
@@ -16,6 +16,7 @@ interface AttributeGroup {
|
|
|
16
16
|
minimum: number;
|
|
17
17
|
maximum: number;
|
|
18
18
|
colorMap: string;
|
|
19
|
+
no_data_color?: RGBAColor;
|
|
19
20
|
corners_ids: string[];
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -118,17 +119,30 @@ export function useModelCornersStyle(): ModelCornersStyleApi {
|
|
|
118
119
|
modelId,
|
|
119
120
|
corner_id,
|
|
120
121
|
);
|
|
121
|
-
const
|
|
122
|
+
const no_data_color = modelCornersVertexAttribute.modelCornersVertexAttributeNoDataColor(
|
|
123
|
+
modelId,
|
|
124
|
+
corner_id,
|
|
125
|
+
);
|
|
126
|
+
const attribute = {
|
|
127
|
+
name,
|
|
128
|
+
item,
|
|
129
|
+
minimum,
|
|
130
|
+
maximum,
|
|
131
|
+
colorMap,
|
|
132
|
+
no_data_color,
|
|
133
|
+
};
|
|
122
134
|
if (!isModelCornersVertexAttributeValid(attribute)) {
|
|
123
135
|
continue;
|
|
124
136
|
}
|
|
125
|
-
const key =
|
|
137
|
+
const key = [name, item, colorMap, minimum, maximum, JSON.stringify(no_data_color)].join(
|
|
138
|
+
"_",
|
|
139
|
+
);
|
|
126
140
|
vertexGroups[key] ??= { ...attribute, corners_ids: [] };
|
|
127
141
|
vertexGroups[key].corners_ids.push(corner_id);
|
|
128
142
|
}
|
|
129
143
|
coloringPromises.push(
|
|
130
144
|
...Object.values(vertexGroups).map(
|
|
131
|
-
async ({ name, item, minimum, maximum, colorMap, corners_ids: ids }) => {
|
|
145
|
+
async ({ name, item, minimum, maximum, colorMap, no_data_color, corners_ids: ids }) => {
|
|
132
146
|
const result = await modelCornersVertexAttribute.setModelCornersVertexAttribute(
|
|
133
147
|
modelId,
|
|
134
148
|
ids,
|
|
@@ -138,6 +152,7 @@ export function useModelCornersStyle(): ModelCornersStyleApi {
|
|
|
138
152
|
minimum,
|
|
139
153
|
maximum,
|
|
140
154
|
colorMap,
|
|
155
|
+
no_data_color,
|
|
141
156
|
},
|
|
142
157
|
);
|
|
143
158
|
return result;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
// oxlint-disable eslint/max-lines
|
|
1
2
|
import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
2
3
|
// Third party imports
|
|
3
4
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
4
5
|
|
|
5
6
|
// Local imports
|
|
7
|
+
import {
|
|
8
|
+
reapplySameSeries,
|
|
9
|
+
useAttributeTimeStepStyle,
|
|
10
|
+
} from "@ogw_internal/stores/data_style/time_step";
|
|
6
11
|
import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
|
|
7
12
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
8
13
|
import { useModelCornersCommonStyle } from "./common";
|
|
@@ -51,6 +56,12 @@ interface ModelCornersVertexAttributeApi {
|
|
|
51
56
|
modelId: string,
|
|
52
57
|
cornerId?: string,
|
|
53
58
|
) => [number | undefined, number | undefined];
|
|
59
|
+
modelCornersVertexAttributeTimeStep: (modelId: string, cornerId?: string) => number | undefined;
|
|
60
|
+
setModelCornersVertexAttributeTimeStep: (
|
|
61
|
+
modelId: string,
|
|
62
|
+
cornerIds: string[],
|
|
63
|
+
timeStep: number,
|
|
64
|
+
) => Promise<void>;
|
|
54
65
|
modelCornersVertexAttributeColorMap: (modelId: string, cornerId?: string) => string | undefined;
|
|
55
66
|
modelCornersVertexAttributeStoredConfig: (
|
|
56
67
|
modelId: string,
|
|
@@ -88,6 +99,7 @@ function isModelCornersVertexAttributeValid(input: AttributeInput): input is Val
|
|
|
88
99
|
|
|
89
100
|
// oxlint-disable-next-line max-lines-per-function
|
|
90
101
|
function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
102
|
+
const { attributeTimeStep, setAttributeTimeStep, seriesArrayName } = useAttributeTimeStepStyle();
|
|
91
103
|
const dataStore = useDataStore();
|
|
92
104
|
const modelCornersCommonStyle = useModelCornersCommonStyle();
|
|
93
105
|
const viewerStore = useViewerStore();
|
|
@@ -128,7 +140,9 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
128
140
|
const totalCornerIds = await dataStore.getCornersGeodeIds(modelId);
|
|
129
141
|
if (cornerIds.length === totalCornerIds.length) {
|
|
130
142
|
tasks.push(
|
|
131
|
-
modelCornersCommonStyle.mutateModelCornersTypeColoring(modelId, {
|
|
143
|
+
modelCornersCommonStyle.mutateModelCornersTypeColoring(modelId, {
|
|
144
|
+
vertex: values,
|
|
145
|
+
}),
|
|
132
146
|
);
|
|
133
147
|
}
|
|
134
148
|
await Promise.all(tasks);
|
|
@@ -190,6 +204,21 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
190
204
|
const item = modelCornersVertexAttributeItem(modelId, cornerId);
|
|
191
205
|
return modelCornersVertexAttributeStoredConfig(modelId, cornerId, name, item).colorMap;
|
|
192
206
|
}
|
|
207
|
+
function modelCornersVertexAttributeNoDataColor(modelId: string, cornerId?: string): RGBAColor {
|
|
208
|
+
const name = modelCornersVertexAttributeName(modelId, cornerId);
|
|
209
|
+
const item = modelCornersVertexAttributeItem(modelId, cornerId);
|
|
210
|
+
return modelCornersVertexAttributeStoredConfig(modelId, cornerId, name, item).no_data_color;
|
|
211
|
+
}
|
|
212
|
+
function modelCornersVertexAttributeTimeStep(
|
|
213
|
+
modelId: string,
|
|
214
|
+
cornerId?: string,
|
|
215
|
+
): number | undefined {
|
|
216
|
+
return attributeTimeStep(
|
|
217
|
+
modelId,
|
|
218
|
+
attributeSchema.$id,
|
|
219
|
+
modelCornersVertexAttribute(modelId, cornerId).name,
|
|
220
|
+
);
|
|
221
|
+
}
|
|
193
222
|
async function setModelCornersVertexAttribute(
|
|
194
223
|
modelId: string,
|
|
195
224
|
cornerIds: string[],
|
|
@@ -214,14 +243,17 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
214
243
|
const params = {
|
|
215
244
|
id: modelId,
|
|
216
245
|
block_ids: corner_viewer_ids,
|
|
217
|
-
name,
|
|
246
|
+
name: seriesArrayName(modelId, attributeSchema.$id, name),
|
|
218
247
|
item,
|
|
219
248
|
points,
|
|
220
249
|
minimum,
|
|
221
250
|
maximum,
|
|
222
251
|
no_data_color,
|
|
223
252
|
};
|
|
224
|
-
const result = await viewerStore.request({
|
|
253
|
+
const result = await viewerStore.request({
|
|
254
|
+
schema: attributeSchema,
|
|
255
|
+
params,
|
|
256
|
+
});
|
|
225
257
|
return result;
|
|
226
258
|
}
|
|
227
259
|
async function applyVertexAttribute(modelId: string, cornerIds: string[]): Promise<void> {
|
|
@@ -257,6 +289,37 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
257
289
|
await mutateModelCornersVertexStyle(modelId, cornerIds, { item });
|
|
258
290
|
await applyVertexAttribute(modelId, cornerIds);
|
|
259
291
|
}
|
|
292
|
+
async function setModelCornersVertexAttributeTimeStep(
|
|
293
|
+
modelId: string,
|
|
294
|
+
cornerIds: string[],
|
|
295
|
+
timeStep: number,
|
|
296
|
+
): Promise<void> {
|
|
297
|
+
const name = modelCornersVertexAttributeName(modelId, cornerIds[0]);
|
|
298
|
+
if (name === undefined) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
await setAttributeTimeStep(modelId, attributeSchema.$id, name, timeStep);
|
|
302
|
+
await Promise.all([
|
|
303
|
+
applyVertexAttribute(modelId, cornerIds),
|
|
304
|
+
reapplySameSeries(
|
|
305
|
+
await dataStore.getCornersGeodeIds(modelId),
|
|
306
|
+
cornerIds,
|
|
307
|
+
(id) =>
|
|
308
|
+
modelCornersCommonStyle.modelCornerColoring(modelId, id).active === "vertex" &&
|
|
309
|
+
modelCornersVertexAttributeName(modelId, id) === name
|
|
310
|
+
? [
|
|
311
|
+
modelCornersVertexAttributeItem(modelId, id),
|
|
312
|
+
modelCornersVertexAttributeRange(modelId, id),
|
|
313
|
+
modelCornersVertexAttributeColorMap(modelId, id),
|
|
314
|
+
JSON.stringify(modelCornersVertexAttributeNoDataColor(modelId, id)),
|
|
315
|
+
].join("|")
|
|
316
|
+
: undefined,
|
|
317
|
+
async (ids) => {
|
|
318
|
+
await applyVertexAttribute(modelId, ids);
|
|
319
|
+
},
|
|
320
|
+
),
|
|
321
|
+
]);
|
|
322
|
+
}
|
|
260
323
|
async function setModelCornersVertexAttributeRange(
|
|
261
324
|
modelId: string,
|
|
262
325
|
cornerIds: string[],
|
|
@@ -281,11 +344,6 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
281
344
|
await setModelCornersVertexAttributeStoredConfig(modelId, cornerIds, name, item, { colorMap });
|
|
282
345
|
await applyVertexAttribute(modelId, cornerIds);
|
|
283
346
|
}
|
|
284
|
-
function modelCornersVertexAttributeNoDataColor(modelId: string, cornerId?: string): RGBAColor {
|
|
285
|
-
const name = modelCornersVertexAttributeName(modelId, cornerId);
|
|
286
|
-
const item = modelCornersVertexAttributeItem(modelId, cornerId);
|
|
287
|
-
return modelCornersVertexAttributeStoredConfig(modelId, cornerId, name, item).no_data_color;
|
|
288
|
-
}
|
|
289
347
|
async function setModelCornersVertexAttributeNoDataColor(
|
|
290
348
|
modelId: string,
|
|
291
349
|
cornerIds: string[],
|
|
@@ -302,6 +360,8 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
|
|
|
302
360
|
}
|
|
303
361
|
return {
|
|
304
362
|
modelCornersVertexAttributeName,
|
|
363
|
+
modelCornersVertexAttributeTimeStep,
|
|
364
|
+
setModelCornersVertexAttributeTimeStep,
|
|
305
365
|
modelCornersVertexAttributeItem,
|
|
306
366
|
modelCornersVertexAttributeRange,
|
|
307
367
|
modelCornersVertexAttributeColorMap,
|
|
@@ -96,7 +96,11 @@ export function useModelLinesColor(): {
|
|
|
96
96
|
modelId,
|
|
97
97
|
lines_ids[0],
|
|
98
98
|
);
|
|
99
|
-
const
|
|
99
|
+
const no_data_color = modelLinesVertexAttribute.modelLinesVertexAttributeNoDataColor(
|
|
100
|
+
modelId,
|
|
101
|
+
lines_ids[0],
|
|
102
|
+
);
|
|
103
|
+
const attribute = { name, item, minimum, maximum, colorMap, no_data_color };
|
|
100
104
|
if (isModelLinesVertexAttributeValid(attribute)) {
|
|
101
105
|
return modelLinesVertexAttribute.setModelLinesVertexAttribute(
|
|
102
106
|
modelId,
|
|
@@ -115,7 +119,11 @@ export function useModelLinesColor(): {
|
|
|
115
119
|
modelId,
|
|
116
120
|
lines_ids[0],
|
|
117
121
|
);
|
|
118
|
-
const
|
|
122
|
+
const no_data_color = modelLinesEdgeAttribute.modelLinesEdgeAttributeNoDataColor(
|
|
123
|
+
modelId,
|
|
124
|
+
lines_ids[0],
|
|
125
|
+
);
|
|
126
|
+
const attribute = { name, item, minimum, maximum, colorMap, no_data_color };
|
|
119
127
|
if (isModelLinesEdgeAttributeValid(attribute)) {
|
|
120
128
|
return modelLinesEdgeAttribute.setModelLinesEdgeAttribute(modelId, lines_ids, attribute);
|
|
121
129
|
}
|
|
@@ -4,6 +4,10 @@ import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_
|
|
|
4
4
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
|
+
import {
|
|
8
|
+
reapplySameSeries,
|
|
9
|
+
useAttributeTimeStepStyle,
|
|
10
|
+
} from "@ogw_internal/stores/data_style/time_step";
|
|
7
11
|
import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
|
|
8
12
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
9
13
|
import { useModelLinesCommonStyle } from "./common";
|
|
@@ -60,6 +64,12 @@ interface UseModelLinesEdgeAttributeReturn {
|
|
|
60
64
|
modelId: string,
|
|
61
65
|
lineId?: string,
|
|
62
66
|
) => [number | undefined, number | undefined];
|
|
67
|
+
modelLinesEdgeAttributeTimeStep: (modelId: string, lineId?: string) => number | undefined;
|
|
68
|
+
setModelLinesEdgeAttributeTimeStep: (
|
|
69
|
+
modelId: string,
|
|
70
|
+
lineIds: string[],
|
|
71
|
+
timeStep: number,
|
|
72
|
+
) => Promise<void>;
|
|
63
73
|
modelLinesEdgeAttributeColorMap: (modelId: string, lineId?: string) => string | undefined;
|
|
64
74
|
modelLinesEdgeAttributeStoredConfig: (
|
|
65
75
|
modelId: string,
|
|
@@ -103,6 +113,7 @@ interface UseModelLinesEdgeAttributeReturn {
|
|
|
103
113
|
|
|
104
114
|
// oxlint-disable-next-line max-lines-per-function
|
|
105
115
|
function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
116
|
+
const { attributeTimeStep, setAttributeTimeStep, seriesArrayName } = useAttributeTimeStepStyle();
|
|
106
117
|
const dataStore = useDataStore();
|
|
107
118
|
const modelLinesCommonStyle = useModelLinesCommonStyle();
|
|
108
119
|
const viewerStore = useViewerStore();
|
|
@@ -205,6 +216,19 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
205
216
|
const storedConfig = modelLinesEdgeAttributeStoredConfig(modelId, lineId, name, item);
|
|
206
217
|
return storedConfig.colorMap;
|
|
207
218
|
}
|
|
219
|
+
function modelLinesEdgeAttributeNoDataColor(modelId: string, lineId?: string): RGBAColor {
|
|
220
|
+
const name = modelLinesEdgeAttributeName(modelId, lineId);
|
|
221
|
+
const item = modelLinesEdgeAttributeItem(modelId, lineId);
|
|
222
|
+
const storedConfig = modelLinesEdgeAttributeStoredConfig(modelId, lineId, name, item);
|
|
223
|
+
return storedConfig.no_data_color;
|
|
224
|
+
}
|
|
225
|
+
function modelLinesEdgeAttributeTimeStep(modelId: string, lineId?: string): number | undefined {
|
|
226
|
+
return attributeTimeStep(
|
|
227
|
+
modelId,
|
|
228
|
+
attributeSchema.$id,
|
|
229
|
+
modelLinesEdgeAttribute(modelId, lineId).name,
|
|
230
|
+
);
|
|
231
|
+
}
|
|
208
232
|
async function setModelLinesEdgeAttribute(
|
|
209
233
|
modelId: string,
|
|
210
234
|
lineIds: string[],
|
|
@@ -232,7 +256,7 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
232
256
|
const params = {
|
|
233
257
|
id: modelId,
|
|
234
258
|
block_ids: line_viewer_ids,
|
|
235
|
-
name,
|
|
259
|
+
name: seriesArrayName(modelId, attributeSchema.$id, name),
|
|
236
260
|
item,
|
|
237
261
|
points,
|
|
238
262
|
minimum,
|
|
@@ -282,6 +306,37 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
282
306
|
});
|
|
283
307
|
return applyEdgeAttribute(modelId, lineIds);
|
|
284
308
|
}
|
|
309
|
+
async function setModelLinesEdgeAttributeTimeStep(
|
|
310
|
+
modelId: string,
|
|
311
|
+
lineIds: string[],
|
|
312
|
+
timeStep: number,
|
|
313
|
+
): Promise<void> {
|
|
314
|
+
const name = modelLinesEdgeAttributeName(modelId, lineIds[0]);
|
|
315
|
+
if (name === undefined) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
await setAttributeTimeStep(modelId, attributeSchema.$id, name, timeStep);
|
|
319
|
+
await Promise.all([
|
|
320
|
+
applyEdgeAttribute(modelId, lineIds),
|
|
321
|
+
reapplySameSeries(
|
|
322
|
+
await dataStore.getLinesGeodeIds(modelId),
|
|
323
|
+
lineIds,
|
|
324
|
+
(id) =>
|
|
325
|
+
modelLinesCommonStyle.modelLineColoring(modelId, id).active === "edge" &&
|
|
326
|
+
modelLinesEdgeAttributeName(modelId, id) === name
|
|
327
|
+
? [
|
|
328
|
+
modelLinesEdgeAttributeItem(modelId, id),
|
|
329
|
+
modelLinesEdgeAttributeRange(modelId, id),
|
|
330
|
+
modelLinesEdgeAttributeColorMap(modelId, id),
|
|
331
|
+
JSON.stringify(modelLinesEdgeAttributeNoDataColor(modelId, id)),
|
|
332
|
+
].join("|")
|
|
333
|
+
: undefined,
|
|
334
|
+
async (ids) => {
|
|
335
|
+
await applyEdgeAttribute(modelId, ids);
|
|
336
|
+
},
|
|
337
|
+
),
|
|
338
|
+
]);
|
|
339
|
+
}
|
|
285
340
|
async function setModelLinesEdgeAttributeRange(
|
|
286
341
|
modelId: string,
|
|
287
342
|
lineIds: string[],
|
|
@@ -308,12 +363,6 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
308
363
|
});
|
|
309
364
|
return applyEdgeAttribute(modelId, lineIds);
|
|
310
365
|
}
|
|
311
|
-
function modelLinesEdgeAttributeNoDataColor(modelId: string, lineId?: string): RGBAColor {
|
|
312
|
-
const name = modelLinesEdgeAttributeName(modelId, lineId);
|
|
313
|
-
const item = modelLinesEdgeAttributeItem(modelId, lineId);
|
|
314
|
-
const storedConfig = modelLinesEdgeAttributeStoredConfig(modelId, lineId, name, item);
|
|
315
|
-
return storedConfig.no_data_color;
|
|
316
|
-
}
|
|
317
366
|
async function setModelLinesEdgeAttributeNoDataColor(
|
|
318
367
|
modelId: string,
|
|
319
368
|
lineIds: string[],
|
|
@@ -330,6 +379,8 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
|
|
|
330
379
|
}
|
|
331
380
|
return {
|
|
332
381
|
modelLinesEdgeAttributeName,
|
|
382
|
+
modelLinesEdgeAttributeTimeStep,
|
|
383
|
+
setModelLinesEdgeAttributeTimeStep,
|
|
333
384
|
modelLinesEdgeAttributeItem,
|
|
334
385
|
modelLinesEdgeAttributeRange,
|
|
335
386
|
modelLinesEdgeAttributeColorMap,
|
|
@@ -17,6 +17,7 @@ interface AttributeGroup {
|
|
|
17
17
|
minimum: number;
|
|
18
18
|
maximum: number;
|
|
19
19
|
colorMap: string;
|
|
20
|
+
no_data_color?: RGBAColor;
|
|
20
21
|
lines_ids: string[];
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -113,17 +114,30 @@ export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle
|
|
|
113
114
|
modelId,
|
|
114
115
|
line_id,
|
|
115
116
|
);
|
|
116
|
-
const
|
|
117
|
+
const no_data_color = modelLinesVertexAttribute.modelLinesVertexAttributeNoDataColor(
|
|
118
|
+
modelId,
|
|
119
|
+
line_id,
|
|
120
|
+
);
|
|
121
|
+
const attribute = {
|
|
122
|
+
name,
|
|
123
|
+
item,
|
|
124
|
+
minimum,
|
|
125
|
+
maximum,
|
|
126
|
+
colorMap,
|
|
127
|
+
no_data_color,
|
|
128
|
+
};
|
|
117
129
|
if (!isModelLinesVertexAttributeValid(attribute)) {
|
|
118
130
|
continue;
|
|
119
131
|
}
|
|
120
|
-
const key =
|
|
132
|
+
const key = [name, item, colorMap, minimum, maximum, JSON.stringify(no_data_color)].join(
|
|
133
|
+
"_",
|
|
134
|
+
);
|
|
121
135
|
vertexGroups[key] ??= { ...attribute, lines_ids: [] };
|
|
122
136
|
vertexGroups[key].lines_ids.push(line_id);
|
|
123
137
|
}
|
|
124
138
|
coloringPromises.push(
|
|
125
139
|
...Object.values(vertexGroups).map(
|
|
126
|
-
async ({ name, item, minimum, maximum, colorMap, lines_ids: ids }) => {
|
|
140
|
+
async ({ name, item, minimum, maximum, colorMap, no_data_color, lines_ids: ids }) => {
|
|
127
141
|
const result = await modelLinesVertexAttribute.setModelLinesVertexAttribute(
|
|
128
142
|
modelId,
|
|
129
143
|
ids,
|
|
@@ -133,6 +147,7 @@ export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle
|
|
|
133
147
|
minimum,
|
|
134
148
|
maximum,
|
|
135
149
|
colorMap,
|
|
150
|
+
no_data_color,
|
|
136
151
|
},
|
|
137
152
|
);
|
|
138
153
|
return result;
|
|
@@ -152,17 +167,30 @@ export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle
|
|
|
152
167
|
modelId,
|
|
153
168
|
line_id,
|
|
154
169
|
);
|
|
155
|
-
const
|
|
170
|
+
const no_data_color = modelLinesEdgeAttribute.modelLinesEdgeAttributeNoDataColor(
|
|
171
|
+
modelId,
|
|
172
|
+
line_id,
|
|
173
|
+
);
|
|
174
|
+
const attribute = {
|
|
175
|
+
name,
|
|
176
|
+
item,
|
|
177
|
+
minimum,
|
|
178
|
+
maximum,
|
|
179
|
+
colorMap,
|
|
180
|
+
no_data_color,
|
|
181
|
+
};
|
|
156
182
|
if (!isModelLinesEdgeAttributeValid(attribute)) {
|
|
157
183
|
continue;
|
|
158
184
|
}
|
|
159
|
-
const key =
|
|
185
|
+
const key = [name, item, colorMap, minimum, maximum, JSON.stringify(no_data_color)].join(
|
|
186
|
+
"_",
|
|
187
|
+
);
|
|
160
188
|
edgeGroups[key] ??= { ...attribute, lines_ids: [] };
|
|
161
189
|
edgeGroups[key].lines_ids.push(line_id);
|
|
162
190
|
}
|
|
163
191
|
coloringPromises.push(
|
|
164
192
|
...Object.values(edgeGroups).map(
|
|
165
|
-
async ({ name, item, minimum, maximum, colorMap, lines_ids: ids }) => {
|
|
193
|
+
async ({ name, item, minimum, maximum, colorMap, no_data_color, lines_ids: ids }) => {
|
|
166
194
|
const result = await modelLinesEdgeAttribute.setModelLinesEdgeAttribute(
|
|
167
195
|
modelId,
|
|
168
196
|
ids,
|
|
@@ -172,6 +200,7 @@ export function useModelLinesStyle(): ReturnType<typeof useModelLinesCommonStyle
|
|
|
172
200
|
minimum,
|
|
173
201
|
maximum,
|
|
174
202
|
colorMap,
|
|
203
|
+
no_data_color,
|
|
175
204
|
},
|
|
176
205
|
);
|
|
177
206
|
return result;
|
|
@@ -4,6 +4,10 @@ import { DEFAULT_NO_DATA_COLOR, type RGBAColor } from "@ogw_front/utils/default_
|
|
|
4
4
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_typed_schemas.js";
|
|
5
5
|
|
|
6
6
|
// Local imports
|
|
7
|
+
import {
|
|
8
|
+
reapplySameSeries,
|
|
9
|
+
useAttributeTimeStepStyle,
|
|
10
|
+
} from "@ogw_internal/stores/data_style/time_step";
|
|
7
11
|
import { getRGBPointsFromPreset } from "@ogw_front/utils/colormap";
|
|
8
12
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
9
13
|
import { useModelLinesCommonStyle } from "./common";
|
|
@@ -60,6 +64,12 @@ interface UseModelLinesVertexAttributeReturn {
|
|
|
60
64
|
modelId: string,
|
|
61
65
|
lineId?: string,
|
|
62
66
|
) => [number | undefined, number | undefined];
|
|
67
|
+
modelLinesVertexAttributeTimeStep: (modelId: string, lineId?: string) => number | undefined;
|
|
68
|
+
setModelLinesVertexAttributeTimeStep: (
|
|
69
|
+
modelId: string,
|
|
70
|
+
lineIds: string[],
|
|
71
|
+
timeStep: number,
|
|
72
|
+
) => Promise<void>;
|
|
63
73
|
modelLinesVertexAttributeColorMap: (modelId: string, lineId?: string) => string | undefined;
|
|
64
74
|
modelLinesVertexAttributeStoredConfig: (
|
|
65
75
|
modelId: string,
|
|
@@ -103,6 +113,7 @@ interface UseModelLinesVertexAttributeReturn {
|
|
|
103
113
|
|
|
104
114
|
// oxlint-disable-next-line max-lines-per-function
|
|
105
115
|
function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
|
|
116
|
+
const { attributeTimeStep, setAttributeTimeStep, seriesArrayName } = useAttributeTimeStepStyle();
|
|
106
117
|
const dataStore = useDataStore();
|
|
107
118
|
const modelLinesCommonStyle = useModelLinesCommonStyle();
|
|
108
119
|
const viewerStore = useViewerStore();
|
|
@@ -206,6 +217,19 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
|
|
|
206
217
|
const storedConfig = modelLinesVertexAttributeStoredConfig(modelId, lineId, name, item);
|
|
207
218
|
return storedConfig.colorMap;
|
|
208
219
|
}
|
|
220
|
+
function modelLinesVertexAttributeNoDataColor(modelId: string, lineId?: string): RGBAColor {
|
|
221
|
+
const name = modelLinesVertexAttributeName(modelId, lineId);
|
|
222
|
+
const item = modelLinesVertexAttributeItem(modelId, lineId);
|
|
223
|
+
const storedConfig = modelLinesVertexAttributeStoredConfig(modelId, lineId, name, item);
|
|
224
|
+
return storedConfig.no_data_color;
|
|
225
|
+
}
|
|
226
|
+
function modelLinesVertexAttributeTimeStep(modelId: string, lineId?: string): number | undefined {
|
|
227
|
+
return attributeTimeStep(
|
|
228
|
+
modelId,
|
|
229
|
+
attributeSchema.$id,
|
|
230
|
+
modelLinesVertexAttribute(modelId, lineId).name,
|
|
231
|
+
);
|
|
232
|
+
}
|
|
209
233
|
async function setModelLinesVertexAttribute(
|
|
210
234
|
modelId: string,
|
|
211
235
|
lineIds: string[],
|
|
@@ -233,7 +257,7 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
|
|
|
233
257
|
const params = {
|
|
234
258
|
id: modelId,
|
|
235
259
|
block_ids: line_viewer_ids,
|
|
236
|
-
name,
|
|
260
|
+
name: seriesArrayName(modelId, attributeSchema.$id, name),
|
|
237
261
|
item,
|
|
238
262
|
points,
|
|
239
263
|
minimum,
|
|
@@ -283,6 +307,37 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
|
|
|
283
307
|
});
|
|
284
308
|
return applyVertexAttribute(modelId, lineIds);
|
|
285
309
|
}
|
|
310
|
+
async function setModelLinesVertexAttributeTimeStep(
|
|
311
|
+
modelId: string,
|
|
312
|
+
lineIds: string[],
|
|
313
|
+
timeStep: number,
|
|
314
|
+
): Promise<void> {
|
|
315
|
+
const name = modelLinesVertexAttributeName(modelId, lineIds[0]);
|
|
316
|
+
if (name === undefined) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
await setAttributeTimeStep(modelId, attributeSchema.$id, name, timeStep);
|
|
320
|
+
await Promise.all([
|
|
321
|
+
applyVertexAttribute(modelId, lineIds),
|
|
322
|
+
reapplySameSeries(
|
|
323
|
+
await dataStore.getLinesGeodeIds(modelId),
|
|
324
|
+
lineIds,
|
|
325
|
+
(id) =>
|
|
326
|
+
modelLinesCommonStyle.modelLineColoring(modelId, id).active === "vertex" &&
|
|
327
|
+
modelLinesVertexAttributeName(modelId, id) === name
|
|
328
|
+
? [
|
|
329
|
+
modelLinesVertexAttributeItem(modelId, id),
|
|
330
|
+
modelLinesVertexAttributeRange(modelId, id),
|
|
331
|
+
modelLinesVertexAttributeColorMap(modelId, id),
|
|
332
|
+
JSON.stringify(modelLinesVertexAttributeNoDataColor(modelId, id)),
|
|
333
|
+
].join("|")
|
|
334
|
+
: undefined,
|
|
335
|
+
async (ids) => {
|
|
336
|
+
await applyVertexAttribute(modelId, ids);
|
|
337
|
+
},
|
|
338
|
+
),
|
|
339
|
+
]);
|
|
340
|
+
}
|
|
286
341
|
async function setModelLinesVertexAttributeRange(
|
|
287
342
|
modelId: string,
|
|
288
343
|
lineIds: string[],
|
|
@@ -309,12 +364,6 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
|
|
|
309
364
|
});
|
|
310
365
|
return applyVertexAttribute(modelId, lineIds);
|
|
311
366
|
}
|
|
312
|
-
function modelLinesVertexAttributeNoDataColor(modelId: string, lineId?: string): RGBAColor {
|
|
313
|
-
const name = modelLinesVertexAttributeName(modelId, lineId);
|
|
314
|
-
const item = modelLinesVertexAttributeItem(modelId, lineId);
|
|
315
|
-
const storedConfig = modelLinesVertexAttributeStoredConfig(modelId, lineId, name, item);
|
|
316
|
-
return storedConfig.no_data_color;
|
|
317
|
-
}
|
|
318
367
|
async function setModelLinesVertexAttributeNoDataColor(
|
|
319
368
|
modelId: string,
|
|
320
369
|
lineIds: string[],
|
|
@@ -331,6 +380,8 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
|
|
|
331
380
|
}
|
|
332
381
|
return {
|
|
333
382
|
modelLinesVertexAttributeName,
|
|
383
|
+
modelLinesVertexAttributeTimeStep,
|
|
384
|
+
setModelLinesVertexAttributeTimeStep,
|
|
334
385
|
modelLinesVertexAttributeItem,
|
|
335
386
|
modelLinesVertexAttributeRange,
|
|
336
387
|
modelLinesVertexAttributeColorMap,
|