@geode/opengeodeweb-front 10.44.0-rc.2 → 10.44.0-rc.3

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 (65) hide show
  1. package/.build/server/utils/cleanup.js +7 -2
  2. package/.build/server/utils/microservices.js +5 -1
  3. package/.build/server/utils/typed_handler.js +5 -1
  4. package/.build/server/utils/ws_client.js +7 -2
  5. package/.build/shared/utils/fetch_raw.js +2 -2
  6. package/.build/shared/utils/parse_boolean.js +2 -1
  7. package/app/components/ClippingPlanes.vue +14 -4
  8. package/app/components/DragAndDrop.vue +18 -8
  9. package/app/components/FileSelector.vue +9 -6
  10. package/app/components/HybridViewerTooltip.vue +8 -2
  11. package/app/components/MissingFilesSelector.vue +10 -6
  12. package/app/components/ObjectSelector.vue +6 -3
  13. package/app/components/Screenshot.vue +9 -2
  14. package/app/components/ThresholdFilter.vue +5 -1
  15. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +7 -5
  16. package/app/components/Viewer/Generic/Model/CornersOptions.vue +7 -5
  17. package/app/components/Viewer/Generic/Model/LinesOptions.vue +8 -8
  18. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +12 -10
  19. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +12 -10
  20. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +9 -5
  21. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +4 -1
  22. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +6 -1
  23. package/app/components/Viewer/Options/AttributeRangeSelector.vue +11 -4
  24. package/app/components/Viewer/Options/AttributeSelector.vue +24 -13
  25. package/app/components/Viewer/Options/ColorPicker.vue +4 -1
  26. package/app/components/Viewer/Options/ColormapQuickPicker.vue +13 -7
  27. package/app/components/csv-preview/CsvPreviewer.vue +4 -1
  28. package/app/composables/attribute_coloring_style.ts +8 -2
  29. package/app/composables/global_attribute_style.ts +4 -3
  30. package/app/composables/hover_highlight.ts +6 -5
  31. package/app/composables/project_manager.ts +5 -5
  32. package/app/composables/stepper_tree.ts +10 -2
  33. package/app/composables/tree_filter.ts +11 -2
  34. package/app/composables/tree_keyboard_nav.ts +4 -2
  35. package/app/composables/use_overlapping_picker.ts +5 -5
  36. package/app/composables/virtual_tree.ts +14 -7
  37. package/app/stores/app_helpers/extension.ts +1 -1
  38. package/app/stores/feedback.ts +2 -2
  39. package/app/stores/hybrid_viewer.ts +1 -1
  40. package/app/stores/treeview.ts +17 -10
  41. package/app/utils/clipping_planes.ts +4 -3
  42. package/app/utils/extension.ts +1 -1
  43. package/app/utils/import_workflow.ts +6 -4
  44. package/app/utils/upload_path.ts +15 -9
  45. package/internal/database/database.ts +4 -1
  46. package/internal/stores/data_style/model/blocks/polyhedron.ts +14 -10
  47. package/internal/stores/data_style/model/blocks/vertex.ts +14 -10
  48. package/internal/stores/data_style/model/corners/vertex.ts +14 -10
  49. package/internal/stores/data_style/model/lines/edge.ts +14 -10
  50. package/internal/stores/data_style/model/lines/vertex.ts +14 -10
  51. package/internal/stores/data_style/model/surfaces/polygon.ts +14 -10
  52. package/internal/stores/data_style/model/surfaces/vertex.ts +14 -10
  53. package/internal/stores/hybrid_viewer/brightness.ts +8 -2
  54. package/internal/stores/hybrid_viewer/camera_animation.ts +4 -3
  55. package/internal/stores/hybrid_viewer/highlight.ts +10 -9
  56. package/internal/stores/hybrid_viewer/ruler.ts +4 -3
  57. package/internal/utils/ws_client.ts +8 -1
  58. package/package.json +2 -2
  59. package/server/api/local/extensions/run.post.ts +6 -4
  60. package/server/utils/cleanup.ts +12 -2
  61. package/server/utils/microservices.ts +11 -4
  62. package/server/utils/typed_handler.ts +8 -1
  63. package/server/utils/ws_client.ts +15 -2
  64. package/shared/utils/fetch_raw.ts +2 -2
  65. package/shared/utils/parse_boolean.ts +4 -1
@@ -19,6 +19,18 @@ const { dataId = undefined, blockIds = undefined, x, y } = defineProps<Props>();
19
19
  const show = defineModel<boolean>("show", { default: false });
20
20
 
21
21
  const dataIdRef = computed<string>(() => dataId);
22
+ function useAttributeStyle():
23
+ | ReturnType<typeof useGlobalAttributeStyle>
24
+ | ReturnType<typeof useModelAttributeStyle> {
25
+ if (blockIds === undefined) {
26
+ return useGlobalAttributeStyle(dataIdRef);
27
+ }
28
+ return useModelAttributeStyle(
29
+ dataIdRef,
30
+ computed<number[]>(() => blockIds),
31
+ );
32
+ }
33
+
22
34
  // The parent keys this picker on the picked data: a mesh or a model, so the style is chosen once here
23
35
  const {
24
36
  currentColormap,
@@ -28,13 +40,7 @@ const {
28
40
  currentTimeSteps,
29
41
  currentTimeStep,
30
42
  loadTimeSteps,
31
- } =
32
- blockIds === undefined
33
- ? useGlobalAttributeStyle(dataIdRef)
34
- : useModelAttributeStyle(
35
- dataIdRef,
36
- computed<number[]>(() => blockIds),
37
- );
43
+ } = useAttributeStyle();
38
44
 
39
45
  watch(show, async (isShown) => {
40
46
  if (isShown) {
@@ -105,7 +105,10 @@ function parseContent(): string[] {
105
105
 
106
106
  const allLines = rawContent.value.split(/\r?\n/u).filter((line) => line.trim() !== "");
107
107
  const headerLine = allLines[headerRow.value];
108
- const rawHeaders = headerLine ? splitLine(headerLine) : [];
108
+ let rawHeaders: string[] = [];
109
+ if (headerLine) {
110
+ rawHeaders = splitLine(headerLine);
111
+ }
109
112
 
110
113
  previewHeaders.value = rawHeaders.map((header, index) => ({
111
114
  title: header || `Column ${index + 1}`,
@@ -78,7 +78,10 @@ function useAttributeColoringStyle(colorings: Ref<AttributeColoring[]>): Attribu
78
78
 
79
79
  const currentColormap = computed((): string => {
80
80
  const [coloring] = colorings.value;
81
- return coloring ? String(coloring.read("ColorMap")) : "batlow";
81
+ if (!coloring) {
82
+ return "batlow";
83
+ }
84
+ return String(coloring.read("ColorMap"));
82
85
  });
83
86
 
84
87
  async function applyGlobalColormap(colorMap: string): Promise<void> {
@@ -152,7 +155,10 @@ function useAttributeColoringStyle(colorings: Ref<AttributeColoring[]>): Attribu
152
155
  const currentTimeStep = computed<number>({
153
156
  get(): number {
154
157
  const coloring = temporalColoring.value;
155
- return coloring ? Number(coloring.read("TimeStep") ?? 0) : 0;
158
+ if (!coloring) {
159
+ return 0;
160
+ }
161
+ return Number(coloring.read("TimeStep") ?? 0);
156
162
  },
157
163
  // Setter cannot be async (see `currentRange`), so the write is delegated.
158
164
  set: (step: number): void => {
@@ -61,9 +61,10 @@ export function useGlobalAttributeStyle(
61
61
  return MESH_ELEMENTS.flatMap((element) => {
62
62
  const coloring: unknown = style[element.styleKey]?.coloring;
63
63
  const activeColoring = isColoring(coloring) ? coloring.active : undefined;
64
- return activeColoring !== undefined && ATTRIBUTE_COLORINGS.has(activeColoring)
65
- ? [meshColoring(dataId, element, activeColoring)]
66
- : [];
64
+ if (activeColoring !== undefined && ATTRIBUTE_COLORINGS.has(activeColoring)) {
65
+ return [meshColoring(dataId, element, activeColoring)];
66
+ }
67
+ return [];
67
68
  });
68
69
  });
69
70
 
@@ -40,11 +40,12 @@ export function useHoverhighlight(): {
40
40
  return;
41
41
  }
42
42
 
43
- let block_ids: number[] = [
44
- ...(typeof block_ids_provider === "function"
45
- ? await block_ids_provider()
46
- : block_ids_provider),
47
- ];
43
+ let block_ids: number[] = [];
44
+ if (typeof block_ids_provider === "function") {
45
+ block_ids = [...(await block_ids_provider())];
46
+ } else {
47
+ block_ids = [...block_ids_provider];
48
+ }
48
49
 
49
50
  block_ids = (Array.isArray(block_ids) ? block_ids : [])
50
51
  .map((blockId) => Math.trunc(blockId))
@@ -118,11 +118,11 @@ async function importProject(file: File): Promise<void> {
118
118
  // After every data item is added: on partial data the project CRS would follow them.
119
119
  // A project saved without a project CRS takes the one of its oldest data, read in the
120
120
  // Snapshot: the stored items carry the import time as creation date
121
- crsStore.importStores(
122
- snapshot.crs?.projectCrs === undefined
123
- ? { projectCrs: oldestCrs(snapshot.data?.items ?? []) }
124
- : snapshot.crs,
125
- );
121
+ if (snapshot.crs?.projectCrs === undefined) {
122
+ crsStore.importStores({ projectCrs: oldestCrs(snapshot.data?.items ?? []) });
123
+ } else {
124
+ crsStore.importStores(snapshot.crs);
125
+ }
126
126
  await hybridViewerStore.importStores(snapshot.hybridViewer);
127
127
  if (snapshot.dataStyle !== undefined) {
128
128
  await dataStyleStore.importStores(snapshot.dataStyle);
@@ -21,7 +21,11 @@ function build_initial_state_unref(
21
21
  const initial_state_unref: Record<string, unknown> = {};
22
22
  for (const [key, value] of Object.entries(initial_state)) {
23
23
  const unref_val: unknown = unref(value);
24
- initial_state_unref[key] = isUnknownArray(unref_val) ? [...unref_val] : unref_val;
24
+ if (isUnknownArray(unref_val)) {
25
+ initial_state_unref[key] = [...unref_val];
26
+ } else {
27
+ initial_state_unref[key] = unref_val;
28
+ }
25
29
  }
26
30
  return initial_state_unref;
27
31
  }
@@ -65,7 +69,11 @@ export function useStepperTree(
65
69
  state.current_step_index = 0;
66
70
  state.navigating_back = false;
67
71
  for (const [key, initial_val] of Object.entries(initial_state_unref)) {
68
- state[key] = isUnknownArray(initial_val) ? [...initial_val] : initial_val;
72
+ if (isUnknownArray(initial_val)) {
73
+ state[key] = [...initial_val];
74
+ } else {
75
+ state[key] = initial_val;
76
+ }
69
77
  }
70
78
  }
71
79
 
@@ -1,4 +1,4 @@
1
- import type { Ref } from "vue";
1
+ import type { ComputedRef, Ref } from "vue";
2
2
 
3
3
  // Same shape as Vue's MaybeRefOrGetter<T>, kept as a local alias for readability at call sites.
4
4
  type ReadonlyMaybeRefOrGetter<Value> = Value | Ref<Value> | (() => Value);
@@ -98,11 +98,20 @@ function sortAndFormatItems(
98
98
  return sorted;
99
99
  }
100
100
 
101
+ function toItemsRef(
102
+ itemsIn: ReadonlyMaybeRefOrGetter<readonly FilterableItem[]>,
103
+ ): ComputedRef<readonly FilterableItem[]> | Ref<readonly FilterableItem[]> {
104
+ if (typeof itemsIn === "function") {
105
+ return computed(itemsIn);
106
+ }
107
+ return toRef(itemsIn);
108
+ }
109
+
101
110
  function useTreeFilter(
102
111
  itemsIn: ReadonlyMaybeRefOrGetter<readonly FilterableItem[]>,
103
112
  options: TreeFilterOptions = {},
104
113
  ): UseTreeFilterReturn {
105
- const rawItems = typeof itemsIn === "function" ? computed(itemsIn) : toRef(itemsIn);
114
+ const rawItems = toItemsRef(itemsIn);
106
115
  const search = ref("");
107
116
  const sortType = ref(options.defaultSort ?? "name");
108
117
  const filterOptions = ref<Record<string, boolean>>({ ...options.defaultFilters });
@@ -82,8 +82,10 @@ export function useTreeKeyboardNav(
82
82
  return undefined;
83
83
  }
84
84
  const firstVisible = Math.max(0, Math.floor(info.scrollTop / info.itemHeight));
85
- const visibleCount =
86
- info.containerHeight > 0 ? Math.floor(info.containerHeight / info.itemHeight) : 1;
85
+ let visibleCount = 1;
86
+ if (info.containerHeight > 0) {
87
+ visibleCount = Math.floor(info.containerHeight / info.itemHeight);
88
+ }
87
89
  const lastVisible = Math.max(firstVisible, firstVisible + visibleCount - 1);
88
90
  return { firstVisible, lastVisible };
89
91
  }
@@ -172,11 +172,11 @@ export function useOverlappingPicker(): UseOverlappingPickerReturn {
172
172
  return new Promise<ViewerIdResult>((resolve) => {
173
173
  resolveIntermediate = (chosenResult: ProposedItem | undefined): void => {
174
174
  displayIntermediate.value = false;
175
- resolve(
176
- chosenResult
177
- ? { id: chosenResult.id, viewer_id: chosenResult.viewer_id }
178
- : { id: undefined, viewer_id: undefined },
179
- );
175
+ if (chosenResult) {
176
+ resolve({ id: chosenResult.id, viewer_id: chosenResult.viewer_id });
177
+ } else {
178
+ resolve({ id: undefined, viewer_id: undefined });
179
+ }
180
180
  };
181
181
  });
182
182
  }
@@ -171,8 +171,20 @@ function useVirtualTree(
171
171
  emit("update:selected", [...newSelected]);
172
172
  }
173
173
 
174
+ function matchesSearch(item: TreeItem, id: unknown, search: string): boolean {
175
+ const { customFilter } = props.value;
176
+ if (customFilter) {
177
+ return customFilter(id, search, { raw: item });
178
+ }
179
+ const lowerSearch = search.toLowerCase();
180
+ return (
181
+ toDisplayString(item[actualItemProps.value.title]).toLowerCase().includes(lowerSearch) ||
182
+ toDisplayString(id).toLowerCase().includes(lowerSearch)
183
+ );
184
+ }
185
+
174
186
  function flattenTree(itemsList: readonly TreeItem[], depth = 0): DisplayItem[] {
175
- const { search, customFilter } = props.value;
187
+ const { search } = props.value;
176
188
  const result: DisplayItem[] = [];
177
189
 
178
190
  for (const item of itemsList) {
@@ -184,12 +196,7 @@ function useVirtualTree(
184
196
  const isActive = activeSet.value.has(id);
185
197
 
186
198
  if (search !== undefined && search !== "") {
187
- const lowerSearch = search.toLowerCase();
188
- const matches = customFilter
189
- ? customFilter(id, search, { raw: item })
190
- : toDisplayString(item[actualItemProps.value.title])
191
- .toLowerCase()
192
- .includes(lowerSearch) || toDisplayString(id).toLowerCase().includes(lowerSearch);
199
+ const matches = matchesSearch(item, id, search);
193
200
 
194
201
  if (hasChildren) {
195
202
  const subtree = flattenTree(children ?? [], depth + 1);
@@ -80,7 +80,7 @@ export function useAppExtensions(): {
80
80
  const store = extensionModule.metadata.store();
81
81
  store.$patch?.({
82
82
  default_local_port: extensionPort,
83
- ...(serverPort === undefined ? {} : { nitro_port: serverPort }),
83
+ ...(serverPort !== undefined && { nitro_port: serverPort }),
84
84
  });
85
85
 
86
86
  if (finalURL !== path && finalURL.startsWith("blob:")) {
@@ -47,7 +47,7 @@ export const useFeedbackStore = defineStore("feedback", {
47
47
  id: feedbackId,
48
48
  type: "success",
49
49
  description,
50
- ...(action === undefined ? {} : { action }),
50
+ ...(action !== undefined && { action }),
51
51
  });
52
52
  setTimeout(() => {
53
53
  this.delete_feedback(feedbackId);
@@ -59,7 +59,7 @@ export const useFeedbackStore = defineStore("feedback", {
59
59
  id: feedbackId,
60
60
  type: "warning",
61
61
  description,
62
- ...(action === undefined ? {} : { action }),
62
+ ...(action !== undefined && { action }),
63
63
  });
64
64
  setTimeout(() => {
65
65
  this.delete_feedback(feedbackId);
@@ -111,7 +111,7 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
111
111
  const camera = renderer?.getActiveCamera();
112
112
  return {
113
113
  zScale: sceneStore.zScale.value,
114
- camera_options: (camera ? getCameraOptions(camera) : undefined) ?? cameraStore.camera_options,
114
+ camera_options: (camera && getCameraOptions(camera)) ?? cameraStore.camera_options,
115
115
  };
116
116
  }
117
117
 
@@ -70,6 +70,15 @@ interface ReadonlyTreeviewSnapshot {
70
70
  selection?: readonly (string | { id: string })[];
71
71
  }
72
72
 
73
+ function snapshotSelectionIds(snapshot: ReadonlyTreeviewSnapshot | undefined): string[] {
74
+ if (snapshot?.selectionIds) {
75
+ return [...snapshot.selectionIds];
76
+ }
77
+ return (snapshot?.selection ?? []).map((selectionItem: string | { id: string }) =>
78
+ typeof selectionItem === "string" ? selectionItem : selectionItem.id,
79
+ );
80
+ }
81
+
73
82
  // oxlint-disable-next-line max-lines-per-function, max-statements
74
83
  export const useTreeviewStore = defineStore("treeview", () => {
75
84
  const items = ref<TreeviewGroup[]>([]);
@@ -241,18 +250,16 @@ export const useTreeviewStore = defineStore("treeview", () => {
241
250
  }
242
251
 
243
252
  function importStores(snapshot: ReadonlyTreeviewSnapshot | undefined): void {
244
- opened_views.value = snapshot?.opened_views
245
- ? // oxlint-disable-next-line no-unsafe-type-assertion -- narrowing the readonly parameter view back to the mutable working type; these objects aren't actually frozen at runtime.
246
- ([...snapshot.opened_views] as OpenedView[])
247
- : defaultOpenedViews();
253
+ if (snapshot?.opened_views) {
254
+ // oxlint-disable-next-line no-unsafe-type-assertion -- narrowing the readonly parameter view back to the mutable working type; these objects aren't actually frozen at runtime.
255
+ opened_views.value = [...snapshot.opened_views] as OpenedView[];
256
+ } else {
257
+ opened_views.value = defaultOpenedViews();
258
+ }
248
259
  panelWidth.value = snapshot?.panelWidth ?? PANEL_WIDTH;
249
260
  additionalPanelWidth.value = snapshot?.additionalPanelWidth ?? PANEL_WIDTH;
250
- rowHeights.value = snapshot?.rowHeights ? [...snapshot.rowHeights] : [];
251
- pendingSelectionIds.value = snapshot?.selectionIds
252
- ? [...snapshot.selectionIds]
253
- : (snapshot?.selection ?? []).map((selectionItem: string | { id: string }) =>
254
- typeof selectionItem === "string" ? selectionItem : selectionItem.id,
255
- );
261
+ rowHeights.value = [...(snapshot?.rowHeights ?? [])];
262
+ pendingSelectionIds.value = snapshotSelectionIds(snapshot);
256
263
  }
257
264
 
258
265
  function finalizeImportSelection(): void {
@@ -146,9 +146,10 @@ function resolveActiveActors(
146
146
  selectedDatasetIds: readonly string[],
147
147
  hybridDb: Record<string, ActorEntry | undefined>,
148
148
  ): vtkActor[] {
149
- const targetIds = targetAllVisible
150
- ? allItems.map((item: { id: string }) => item.id)
151
- : selectedDatasetIds;
149
+ let targetIds: readonly string[] = selectedDatasetIds;
150
+ if (targetAllVisible) {
151
+ targetIds = allItems.map((item: { id: string }) => item.id);
152
+ }
152
153
  const targeted = targetIds
153
154
  .map((id) => hybridDb[id]?.actor)
154
155
  .filter((actor: vtkActor | undefined): actor is vtkActor => actor !== undefined);
@@ -96,7 +96,7 @@ async function registerRunningExtensions(): Promise<RegisteredExtension[]> {
96
96
  const extensionModule = await appStore.loadExtension(
97
97
  blobUrl,
98
98
  String(port),
99
- serverPort === undefined ? undefined : String(serverPort),
99
+ serverPort?.toString(),
100
100
  );
101
101
  consola.info("[ExtensionManager] Extension loaded:", id);
102
102
  const storeFactory = extensionModule.metadata.store;
@@ -34,10 +34,12 @@ async function importItem(item: NewDataItem): Promise<string> {
34
34
  }
35
35
  return dataStore.registerObject(item.id, item.name ?? item.id);
36
36
  });
37
- const addDataComponentsTask =
38
- item.viewer_type === "model" ? dataStore.addComponents(item) : Promise.resolve();
39
- const addDataRelationsTask =
40
- item.viewer_type === "model" ? dataStore.addComponentRelations(item) : Promise.resolve();
37
+ let addDataComponentsTask: Promise<string | undefined> = Promise.resolve(undefined);
38
+ let addDataRelationsTask: Promise<string | undefined> = Promise.resolve(undefined);
39
+ if (item.viewer_type === "model") {
40
+ addDataComponentsTask = dataStore.addComponents(item);
41
+ addDataRelationsTask = dataStore.addComponentRelations(item);
42
+ }
41
43
  treeviewStore.addItem(
42
44
  item.geode_object_type,
43
45
  item.name ?? item.id,
@@ -14,7 +14,10 @@ function uploadPath(file: UploadFile): string {
14
14
  function fileExtension(path: string): string {
15
15
  const name = path.slice(path.lastIndexOf("/") + 1);
16
16
  const index = name.lastIndexOf(".");
17
- return index === -1 ? "" : name.slice(index + 1).toLowerCase();
17
+ if (index === -1) {
18
+ return "";
19
+ }
20
+ return name.slice(index + 1).toLowerCase();
18
21
  }
19
22
 
20
23
  type FileMatch =
@@ -33,11 +36,11 @@ function matchScore(path: string, expected_path: string): number {
33
36
  for (const segment of segments) {
34
37
  const current = [0];
35
38
  for (const [index, expected_segment] of expected_segments.entries()) {
36
- current.push(
37
- segment === expected_segment
38
- ? (previous[index] ?? 0) + 1
39
- : Math.max(previous[index + 1] ?? 0, current[index] ?? 0),
40
- );
39
+ if (segment === expected_segment) {
40
+ current.push((previous[index] ?? 0) + 1);
41
+ } else {
42
+ current.push(Math.max(previous[index + 1] ?? 0, current[index] ?? 0));
43
+ }
41
44
  }
42
45
  previous = current;
43
46
  }
@@ -57,9 +60,12 @@ function matchExpectedFiles(paths: readonly string[], expected: readonly string[
57
60
  const indices: (number | undefined)[] = [];
58
61
  for (const [expected_index, expected_scores] of scores.entries()) {
59
62
  const best = Math.max(0, ...expected_scores);
60
- const candidates = expected_scores.flatMap((score, index) =>
61
- best > 0 && score === best && path_best_scores[index] === best ? [index] : [],
62
- );
63
+ const candidates = expected_scores.flatMap((score, index) => {
64
+ if (best > 0 && score === best && path_best_scores[index] === best) {
65
+ return [index];
66
+ }
67
+ return [];
68
+ });
63
69
  if (candidates.length > 1) {
64
70
  return { status: "ambiguous", path: expected[expected_index] ?? "" };
65
71
  }
@@ -33,7 +33,10 @@ class Database extends BaseDatabase {
33
33
  for (const table of tempDb.tables) {
34
34
  const keyPath = table.schema.primKey.src;
35
35
  const indexes = table.schema.indexes.map((index) => index.src);
36
- const parts = keyPath ? [keyPath, ...indexes] : indexes;
36
+ let parts = indexes;
37
+ if (keyPath) {
38
+ parts = [keyPath, ...indexes];
39
+ }
37
40
  currentStores[table.name] = parts.join(",");
38
41
  }
39
42
 
@@ -343,16 +343,20 @@ function useModelBlocksPolyhedronAttribute(): UseModelBlocksPolyhedronAttributeR
343
343
  reapplySameSeries(
344
344
  await dataStore.getBlocksGeodeIds(modelId),
345
345
  blockIds,
346
- (id) =>
347
- modelBlocksCommonStyle.modelBlockColoring(modelId, id).active === "polyhedron" &&
348
- modelBlocksPolyhedronAttributeName(modelId, id) === name
349
- ? [
350
- modelBlocksPolyhedronAttributeItem(modelId, id),
351
- modelBlocksPolyhedronAttributeRange(modelId, id),
352
- modelBlocksPolyhedronAttributeColorMap(modelId, id),
353
- JSON.stringify(modelBlocksPolyhedronAttributeNoDataColor(modelId, id)),
354
- ].join("|")
355
- : undefined,
346
+ (id) => {
347
+ if (
348
+ modelBlocksCommonStyle.modelBlockColoring(modelId, id).active === "polyhedron" &&
349
+ modelBlocksPolyhedronAttributeName(modelId, id) === name
350
+ ) {
351
+ return [
352
+ modelBlocksPolyhedronAttributeItem(modelId, id),
353
+ modelBlocksPolyhedronAttributeRange(modelId, id),
354
+ modelBlocksPolyhedronAttributeColorMap(modelId, id),
355
+ JSON.stringify(modelBlocksPolyhedronAttributeNoDataColor(modelId, id)),
356
+ ].join("|");
357
+ }
358
+ return undefined;
359
+ },
356
360
  async (ids) => {
357
361
  reapplied = (await applyPolyhedronAttribute(modelId, ids)) || reapplied;
358
362
  },
@@ -330,16 +330,20 @@ function useModelBlocksVertexAttribute(): UseModelBlocksVertexAttributeReturn {
330
330
  reapplySameSeries(
331
331
  await dataStore.getBlocksGeodeIds(modelId),
332
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,
333
+ (id) => {
334
+ if (
335
+ modelBlocksCommonStyle.modelBlockColoring(modelId, id).active === "vertex" &&
336
+ modelBlocksVertexAttributeName(modelId, id) === name
337
+ ) {
338
+ return [
339
+ modelBlocksVertexAttributeItem(modelId, id),
340
+ modelBlocksVertexAttributeRange(modelId, id),
341
+ modelBlocksVertexAttributeColorMap(modelId, id),
342
+ JSON.stringify(modelBlocksVertexAttributeNoDataColor(modelId, id)),
343
+ ].join("|");
344
+ }
345
+ return undefined;
346
+ },
343
347
  async (ids) => {
344
348
  await applyVertexAttribute(modelId, ids);
345
349
  },
@@ -304,16 +304,20 @@ function useModelCornersVertexAttribute(): ModelCornersVertexAttributeApi {
304
304
  reapplySameSeries(
305
305
  await dataStore.getCornersGeodeIds(modelId),
306
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,
307
+ (id) => {
308
+ if (
309
+ modelCornersCommonStyle.modelCornerColoring(modelId, id).active === "vertex" &&
310
+ modelCornersVertexAttributeName(modelId, id) === name
311
+ ) {
312
+ return [
313
+ modelCornersVertexAttributeItem(modelId, id),
314
+ modelCornersVertexAttributeRange(modelId, id),
315
+ modelCornersVertexAttributeColorMap(modelId, id),
316
+ JSON.stringify(modelCornersVertexAttributeNoDataColor(modelId, id)),
317
+ ].join("|");
318
+ }
319
+ return undefined;
320
+ },
317
321
  async (ids) => {
318
322
  await applyVertexAttribute(modelId, ids);
319
323
  },
@@ -321,16 +321,20 @@ function useModelLinesEdgeAttribute(): UseModelLinesEdgeAttributeReturn {
321
321
  reapplySameSeries(
322
322
  await dataStore.getLinesGeodeIds(modelId),
323
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,
324
+ (id) => {
325
+ if (
326
+ modelLinesCommonStyle.modelLineColoring(modelId, id).active === "edge" &&
327
+ modelLinesEdgeAttributeName(modelId, id) === name
328
+ ) {
329
+ return [
330
+ modelLinesEdgeAttributeItem(modelId, id),
331
+ modelLinesEdgeAttributeRange(modelId, id),
332
+ modelLinesEdgeAttributeColorMap(modelId, id),
333
+ JSON.stringify(modelLinesEdgeAttributeNoDataColor(modelId, id)),
334
+ ].join("|");
335
+ }
336
+ return undefined;
337
+ },
334
338
  async (ids) => {
335
339
  await applyEdgeAttribute(modelId, ids);
336
340
  },
@@ -322,16 +322,20 @@ function useModelLinesVertexAttribute(): UseModelLinesVertexAttributeReturn {
322
322
  reapplySameSeries(
323
323
  await dataStore.getLinesGeodeIds(modelId),
324
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,
325
+ (id) => {
326
+ if (
327
+ modelLinesCommonStyle.modelLineColoring(modelId, id).active === "vertex" &&
328
+ modelLinesVertexAttributeName(modelId, id) === name
329
+ ) {
330
+ return [
331
+ modelLinesVertexAttributeItem(modelId, id),
332
+ modelLinesVertexAttributeRange(modelId, id),
333
+ modelLinesVertexAttributeColorMap(modelId, id),
334
+ JSON.stringify(modelLinesVertexAttributeNoDataColor(modelId, id)),
335
+ ].join("|");
336
+ }
337
+ return undefined;
338
+ },
335
339
  async (ids) => {
336
340
  await applyVertexAttribute(modelId, ids);
337
341
  },
@@ -333,16 +333,20 @@ function useModelSurfacesPolygonAttribute(): UseModelSurfacesPolygonAttributeRet
333
333
  reapplySameSeries(
334
334
  await dataStore.getSurfacesGeodeIds(modelId),
335
335
  surfaceIds,
336
- (id) =>
337
- modelSurfacesCommonStyle.modelSurfaceColoring(modelId, id).active === "polygon" &&
338
- modelSurfacesPolygonAttributeName(modelId, id) === name
339
- ? [
340
- modelSurfacesPolygonAttributeItem(modelId, id),
341
- modelSurfacesPolygonAttributeRange(modelId, id),
342
- modelSurfacesPolygonAttributeColorMap(modelId, id),
343
- JSON.stringify(modelSurfacesPolygonAttributeNoDataColor(modelId, id)),
344
- ].join("|")
345
- : undefined,
336
+ (id) => {
337
+ if (
338
+ modelSurfacesCommonStyle.modelSurfaceColoring(modelId, id).active === "polygon" &&
339
+ modelSurfacesPolygonAttributeName(modelId, id) === name
340
+ ) {
341
+ return [
342
+ modelSurfacesPolygonAttributeItem(modelId, id),
343
+ modelSurfacesPolygonAttributeRange(modelId, id),
344
+ modelSurfacesPolygonAttributeColorMap(modelId, id),
345
+ JSON.stringify(modelSurfacesPolygonAttributeNoDataColor(modelId, id)),
346
+ ].join("|");
347
+ }
348
+ return undefined;
349
+ },
346
350
  async (ids) => {
347
351
  await applyPolygonAttribute(modelId, ids);
348
352
  },