@geode/opengeodeweb-front 10.13.2 → 10.14.0-rc.1

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 (42) hide show
  1. package/app/components/Viewer/ContextMenuItem.vue +2 -1
  2. package/app/components/Viewer/Generic/Model/EdgesOptions.vue +10 -2
  3. package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +129 -52
  4. package/app/components/Viewer/Generic/Model/PointsOptions.vue +10 -2
  5. package/app/components/Viewer/ObjectTree/Layout.vue +6 -2
  6. package/app/components/Viewer/ObjectTree/Views/ModelComponents.vue +12 -8
  7. package/app/components/Viewer/Options/OptionsSection.vue +74 -0
  8. package/app/stores/data.js +2 -2
  9. package/app/stores/data_style.js +11 -2
  10. package/app/stores/menu.js +3 -0
  11. package/app/utils/default_styles.js +10 -1
  12. package/app/utils/import_workflow.js +3 -3
  13. package/internal/database/base_database.js +2 -0
  14. package/internal/database/database.js +1 -0
  15. package/internal/database/tables/model_component_type_datastyle.js +4 -0
  16. package/internal/stores/data_style/model/blocks/color.js +8 -34
  17. package/internal/stores/data_style/model/blocks/common.js +5 -3
  18. package/internal/stores/data_style/model/blocks/index.js +31 -33
  19. package/internal/stores/data_style/model/blocks/visibility.js +9 -36
  20. package/internal/stores/data_style/model/color.js +97 -0
  21. package/internal/stores/data_style/model/common.js +132 -0
  22. package/internal/stores/data_style/model/corners/color.js +8 -32
  23. package/internal/stores/data_style/model/corners/common.js +5 -3
  24. package/internal/stores/data_style/model/corners/index.js +31 -38
  25. package/internal/stores/data_style/model/corners/visibility.js +8 -32
  26. package/internal/stores/data_style/model/index.js +50 -202
  27. package/internal/stores/data_style/model/lines/color.js +8 -36
  28. package/internal/stores/data_style/model/lines/common.js +5 -3
  29. package/internal/stores/data_style/model/lines/index.js +30 -31
  30. package/internal/stores/data_style/model/lines/visibility.js +9 -36
  31. package/internal/stores/data_style/model/selection.js +83 -0
  32. package/internal/stores/data_style/model/surfaces/color.js +8 -32
  33. package/internal/stores/data_style/model/surfaces/common.js +5 -3
  34. package/internal/stores/data_style/model/surfaces/index.js +30 -33
  35. package/internal/stores/data_style/model/surfaces/visibility.js +9 -34
  36. package/internal/stores/data_style/model/visibility.js +186 -0
  37. package/internal/stores/data_style/state.js +24 -31
  38. package/package.json +3 -3
  39. package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +11 -2
  40. package/tests/integration/stores/data_style/model/corners.nuxt.test.js +11 -2
  41. package/tests/integration/stores/data_style/model/lines.nuxt.test.js +11 -2
  42. package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +11 -2
@@ -1,8 +1,10 @@
1
1
  import merge from "lodash/merge";
2
2
  import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
3
+ import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
3
4
 
4
5
  export function useModelSurfacesCommonStyle() {
5
6
  const dataStyleState = useDataStyleState();
7
+ const modelCommonStyle = useModelCommonStyle();
6
8
 
7
9
  function modelSurfacesStyle(id) {
8
10
  return dataStyleState.getStyle(id).surfaces;
@@ -14,12 +16,12 @@ export function useModelSurfacesCommonStyle() {
14
16
  return merge({}, groupStyle, individualStyle);
15
17
  }
16
18
 
17
- function mutateModelSurfacesStyle(id, surface_ids, values) {
18
- return dataStyleState.mutateComponentStyles(id, surface_ids, values);
19
+ function mutateModelSurfacesStyle(id, surfaces_ids, values) {
20
+ return modelCommonStyle.mutateComponentStyles(id, surfaces_ids, values);
19
21
  }
20
22
 
21
23
  function mutateModelSurfaceStyle(id, surface_id, values) {
22
- return dataStyleState.mutateComponentStyle(id, surface_id, values);
24
+ return modelCommonStyle.mutateComponentStyle(id, surface_id, values);
23
25
  }
24
26
 
25
27
  return {
@@ -1,8 +1,7 @@
1
- // Local imports
2
1
  import { useDataStore } from "@ogw_front/stores/data";
3
- import { useModelSurfacesColorStyle } from "./color";
2
+ import { useModelSurfacesColor } from "./color";
4
3
  import { useModelSurfacesCommonStyle } from "./common";
5
- import { useModelSurfacesVisibilityStyle } from "./visibility";
4
+ import { useModelSurfacesVisibility } from "./visibility";
6
5
 
7
6
  async function setModelSurfacesDefaultStyle(_id) {
8
7
  // Placeholder
@@ -10,46 +9,44 @@ async function setModelSurfacesDefaultStyle(_id) {
10
9
 
11
10
  export function useModelSurfacesStyle() {
12
11
  const dataStore = useDataStore();
13
- const modelSurfacesCommonStyle = useModelSurfacesCommonStyle();
14
- const modelSurfacesVisibilityStyle = useModelSurfacesVisibilityStyle();
15
- const modelSurfacesColorStyle = useModelSurfacesColorStyle();
12
+ const modelCommonStyle = useModelSurfacesCommonStyle();
13
+ const modelVisibilityStyle = useModelSurfacesVisibility();
14
+ const modelColorStyle = useModelSurfacesColor();
16
15
 
17
- async function applyModelSurfacesStyle(id) {
18
- const surface_ids = await dataStore.getSurfacesGeodeIds(id);
19
- if (surface_ids.length === 0) {
16
+ async function applyModelSurfacesStyle(modelId) {
17
+ const surfaces_ids = await dataStore.getSurfacesGeodeIds(modelId);
18
+ if (!surfaces_ids?.length) {
20
19
  return;
21
20
  }
22
21
 
23
22
  const visibilityGroups = {};
24
23
  const colorGroups = {};
25
24
 
26
- for (const surface_id of surface_ids) {
27
- const style = modelSurfacesCommonStyle.modelSurfaceStyle(id, surface_id);
25
+ for (const surfaces_id of surfaces_ids) {
26
+ const style = modelCommonStyle.modelSurfaceStyle(modelId, surfaces_id);
28
27
 
29
- const vKey = String(style.visibility);
30
- if (!visibilityGroups[vKey]) {
31
- visibilityGroups[vKey] = [];
28
+ const visibility = String(style.visibility);
29
+ if (!visibilityGroups[visibility]) {
30
+ visibilityGroups[visibility] = [];
32
31
  }
33
- visibilityGroups[vKey].push(surface_id);
32
+ visibilityGroups[visibility].push(surfaces_id);
34
33
 
35
- const cKey = JSON.stringify(style.color);
36
- if (!colorGroups[cKey]) {
37
- colorGroups[cKey] = [];
34
+ const color_mode = style.color_mode || "constant";
35
+ const color_key = color_mode === "random" ? "random" : JSON.stringify(style.color);
36
+ if (!colorGroups[color_key]) {
37
+ colorGroups[color_key] = { color_mode, color: style.color, surfaces_ids: [] };
38
38
  }
39
- colorGroups[cKey].push(surface_id);
39
+ colorGroups[color_key].surfaces_ids.push(surfaces_id);
40
40
  }
41
41
 
42
- const promises = [];
43
-
44
- for (const [vValue, ids] of Object.entries(visibilityGroups)) {
45
- promises.push(
46
- modelSurfacesVisibilityStyle.setModelSurfacesVisibility(id, ids, vValue === "true"),
47
- );
48
- }
49
-
50
- for (const [cValue, ids] of Object.entries(colorGroups)) {
51
- promises.push(modelSurfacesColorStyle.setModelSurfacesColor(id, ids, JSON.parse(cValue)));
52
- }
42
+ const promises = [
43
+ ...Object.entries(visibilityGroups).map(([visibility, ids]) =>
44
+ modelVisibilityStyle.setModelSurfacesVisibility(modelId, ids, visibility === "true"),
45
+ ),
46
+ ...Object.values(colorGroups).map(({ color_mode, color, surfaces_ids: ids }) =>
47
+ modelColorStyle.setModelSurfacesColor(modelId, ids, color, color_mode),
48
+ ),
49
+ ];
53
50
 
54
51
  return Promise.all(promises);
55
52
  }
@@ -57,8 +54,8 @@ export function useModelSurfacesStyle() {
57
54
  return {
58
55
  applyModelSurfacesStyle,
59
56
  setModelSurfacesDefaultStyle,
60
- ...modelSurfacesCommonStyle,
61
- ...modelSurfacesVisibilityStyle,
62
- ...modelSurfacesColorStyle,
57
+ ...modelCommonStyle,
58
+ ...modelVisibilityStyle,
59
+ ...modelColorStyle,
63
60
  };
64
61
  }
@@ -1,45 +1,20 @@
1
- // Third party imports
2
- import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
3
-
4
- // Local imports
5
- import { useDataStore } from "@ogw_front/stores/data";
1
+ import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
6
2
  import { useModelSurfacesCommonStyle } from "./common";
7
- import { useViewerStore } from "@ogw_front/stores/viewer";
3
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
8
4
 
9
- // Local constants
10
- const model_surfaces_schemas = viewer_schemas.opengeodeweb_viewer.model.surfaces;
5
+ const schema = viewer_schemas.opengeodeweb_viewer.model.surfaces.visibility;
11
6
 
12
- export function useModelSurfacesVisibilityStyle() {
13
- const dataStore = useDataStore();
14
- const viewerStore = useViewerStore();
7
+ export function useModelSurfacesVisibility() {
8
+ const modelCommonStyle = useModelCommonStyle();
15
9
  const modelSurfacesCommonStyle = useModelSurfacesCommonStyle();
10
+
16
11
  function modelSurfaceVisibility(id, surface_id) {
17
12
  return modelSurfacesCommonStyle.modelSurfaceStyle(id, surface_id).visibility;
18
13
  }
19
- function setModelSurfacesVisibility(id, surface_ids, visibility) {
20
- if (!surface_ids || surface_ids.length === 0) {
21
- return Promise.resolve();
22
- }
23
14
 
24
- return dataStore.getMeshComponentsViewerIds(id, surface_ids).then((surface_viewer_ids) => {
25
- if (!surface_viewer_ids || surface_viewer_ids.length === 0) {
26
- return modelSurfacesCommonStyle.mutateModelSurfacesStyle(id, surface_ids, { visibility });
27
- }
28
- return viewerStore.request(
29
- model_surfaces_schemas.visibility,
30
- { id, block_ids: surface_viewer_ids, visibility },
31
- {
32
- response_function: () =>
33
- modelSurfacesCommonStyle.mutateModelSurfacesStyle(id, surface_ids, {
34
- visibility,
35
- }),
36
- },
37
- );
38
- });
15
+ function setModelSurfacesVisibility(modelId, surfaces_ids, visibility) {
16
+ return modelCommonStyle.setModelTypeVisibility(modelId, surfaces_ids, visibility, schema);
39
17
  }
40
18
 
41
- return {
42
- modelSurfaceVisibility,
43
- setModelSurfacesVisibility,
44
- };
19
+ return { setModelSurfacesVisibility, modelSurfaceVisibility };
45
20
  }
@@ -0,0 +1,186 @@
1
+ import { MESH_TYPES } from "@ogw_front/utils/default_styles";
2
+ import { useDataStore } from "@ogw_front/stores/data";
3
+ import { useDataStyleState } from "@ogw_internal/stores/data_style/state";
4
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
5
+ import { useModelCommonStyle } from "@ogw_internal/stores/data_style/model/common";
6
+ import { useViewerStore } from "@ogw_front/stores/viewer";
7
+ import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
8
+
9
+ const model_schemas = viewer_schemas.opengeodeweb_viewer.model;
10
+
11
+ async function getModelComponentsMap(modelId) {
12
+ const dataStore = useDataStore();
13
+ const results = await Promise.all(
14
+ MESH_TYPES.map(async (type) => {
15
+ const geodeIds = await dataStore.getMeshComponentGeodeIds(modelId, type);
16
+ return geodeIds.map((geode_id) => ({ geode_id, type }));
17
+ }),
18
+ );
19
+ const allComponents = results.flat();
20
+ return {
21
+ allComponents,
22
+ componentsMap: Object.fromEntries(
23
+ allComponents.map((component) => [component.geode_id, component]),
24
+ ),
25
+ };
26
+ }
27
+
28
+ async function dispatchToComponentTypes(
29
+ modelId,
30
+ componentIds,
31
+ action,
32
+ { componentStyleFunctions },
33
+ ...args
34
+ ) {
35
+ const { componentsMap } = await getModelComponentsMap(modelId);
36
+
37
+ const idsByComponent = {
38
+ Block: [],
39
+ Surface: [],
40
+ Line: [],
41
+ Corner: [],
42
+ };
43
+
44
+ for (const id of componentIds) {
45
+ const type = componentsMap[id]?.type;
46
+ if (type && idsByComponent[type]) {
47
+ idsByComponent[type].push(id);
48
+ }
49
+ }
50
+
51
+ const promises = [];
52
+ if (action === "Visibility") {
53
+ if (idsByComponent.Block.length > 0) {
54
+ promises.push(
55
+ componentStyleFunctions.Block.setModelBlocksVisibility(
56
+ modelId,
57
+ idsByComponent.Block,
58
+ ...args,
59
+ ),
60
+ );
61
+ }
62
+ if (idsByComponent.Surface.length > 0) {
63
+ promises.push(
64
+ componentStyleFunctions.Surface.setModelSurfacesVisibility(
65
+ modelId,
66
+ idsByComponent.Surface,
67
+ ...args,
68
+ ),
69
+ );
70
+ }
71
+ if (idsByComponent.Line.length > 0) {
72
+ promises.push(
73
+ componentStyleFunctions.Line.setModelLinesVisibility(modelId, idsByComponent.Line, ...args),
74
+ );
75
+ }
76
+ if (idsByComponent.Corner.length > 0) {
77
+ promises.push(
78
+ componentStyleFunctions.Corner.setModelCornersVisibility(
79
+ modelId,
80
+ idsByComponent.Corner,
81
+ ...args,
82
+ ),
83
+ );
84
+ }
85
+ } else if (action === "Color") {
86
+ if (idsByComponent.Block.length > 0) {
87
+ promises.push(
88
+ componentStyleFunctions.Block.setModelBlocksColor(modelId, idsByComponent.Block, ...args),
89
+ );
90
+ }
91
+ if (idsByComponent.Surface.length > 0) {
92
+ promises.push(
93
+ componentStyleFunctions.Surface.setModelSurfacesColor(
94
+ modelId,
95
+ idsByComponent.Surface,
96
+ ...args,
97
+ ),
98
+ );
99
+ }
100
+ if (idsByComponent.Line.length > 0) {
101
+ promises.push(
102
+ componentStyleFunctions.Line.setModelLinesColor(modelId, idsByComponent.Line, ...args),
103
+ );
104
+ }
105
+ if (idsByComponent.Corner.length > 0) {
106
+ promises.push(
107
+ componentStyleFunctions.Corner.setModelCornersColor(
108
+ modelId,
109
+ idsByComponent.Corner,
110
+ ...args,
111
+ ),
112
+ );
113
+ }
114
+ }
115
+
116
+ return Promise.all(promises);
117
+ }
118
+
119
+ function useModelVisibilityStyle(componentStyleFunctions) {
120
+ const dataStore = useDataStore();
121
+ const dataStyleState = useDataStyleState();
122
+ const hybridViewerStore = useHybridViewerStore();
123
+ const viewerStore = useViewerStore();
124
+ const modelCommonStyle = useModelCommonStyle();
125
+
126
+ function modelVisibility(modelId) {
127
+ return dataStyleState.getStyle(modelId).visibility;
128
+ }
129
+
130
+ function setModelVisibility(modelId, visibility) {
131
+ return viewerStore.request(
132
+ model_schemas.visibility,
133
+ { id: modelId, visibility },
134
+ {
135
+ response_function: async () => {
136
+ await hybridViewerStore.setVisibility(modelId, visibility);
137
+ await dataStyleState.mutateStyle(modelId, { visibility });
138
+ return { id: modelId, visibility };
139
+ },
140
+ },
141
+ );
142
+ }
143
+
144
+ async function setModelComponentsVisibility(modelId, componentIds, visibility) {
145
+ const typeIds = componentIds.filter((id) => MESH_TYPES.includes(id));
146
+ const individualIds = componentIds.filter((id) => !MESH_TYPES.includes(id));
147
+
148
+ const promises = [];
149
+ for (const typeId of typeIds) {
150
+ promises.push(setModelComponentTypeVisibility(modelId, typeId, visibility));
151
+ }
152
+
153
+ if (individualIds.length > 0) {
154
+ promises.push(
155
+ dispatchToComponentTypes(
156
+ modelId,
157
+ individualIds,
158
+ "Visibility",
159
+ { componentStyleFunctions },
160
+ visibility,
161
+ ),
162
+ );
163
+ }
164
+ return await Promise.all(promises);
165
+ }
166
+
167
+ async function setModelComponentTypeVisibility(modelId, componentType, visibility) {
168
+ await modelCommonStyle.mutateModelComponentTypeStyle(modelId, componentType, {
169
+ visibility,
170
+ });
171
+ const idsForType = await dataStore.getMeshComponentGeodeIds(modelId, componentType);
172
+ if (idsForType.length === 0) {
173
+ return;
174
+ }
175
+ await setModelComponentsVisibility(modelId, idsForType, visibility);
176
+ }
177
+
178
+ return {
179
+ modelVisibility,
180
+ setModelVisibility,
181
+ setModelComponentsVisibility,
182
+ setModelComponentTypeVisibility,
183
+ };
184
+ }
185
+
186
+ export { getModelComponentsMap, dispatchToComponentTypes, useModelVisibilityStyle };
@@ -33,6 +33,19 @@ export function useDataStyleState() {
33
33
  return selection;
34
34
  });
35
35
 
36
+ const modelComponentTypeStyles = useObservable(
37
+ liveQuery(async () => {
38
+ const all = await database.model_component_type_datastyle.toArray();
39
+ const accumulator = {};
40
+ for (const style of all) {
41
+ const key = `${style.id_model}_${style.type}`;
42
+ accumulator[key] = style;
43
+ }
44
+ return accumulator;
45
+ }),
46
+ { initialValue: {} },
47
+ );
48
+
36
49
  const componentStyles = useObservable(
37
50
  liveQuery(async () => {
38
51
  const all = await database.model_component_datastyle.toArray();
@@ -61,47 +74,27 @@ export function useDataStyleState() {
61
74
  return componentStyles.value[key] || {};
62
75
  }
63
76
 
64
- function mutateComponentStyle(id_model, id_component, values) {
65
- return database.model_component_datastyle.get([id_model, id_component]).then((style) => {
66
- const component_style = style || { id_model, id_component };
67
- merge(component_style, values);
68
- return database.model_component_datastyle.put(structuredClone(toRaw(component_style)));
69
- });
70
- }
71
-
72
- function mutateComponentStyles(id_model, id_components, values) {
73
- return database.model_component_datastyle
74
- .where("id_model")
75
- .equals(id_model)
76
- .toArray()
77
- .then((all_styles) => {
78
- const style_map = {};
79
- for (const style of all_styles) {
80
- style_map[style.id_component] = style;
81
- }
82
-
83
- const updates = id_components.map((id_component) => {
84
- const style = style_map[id_component] || { id_model, id_component };
85
- merge(style, values);
86
- return toRaw(style);
87
- });
88
-
89
- return database.model_component_datastyle.bulkPut(structuredClone(updates));
90
- });
77
+ function getModelComponentTypeStyle(id_model, type) {
78
+ const key = `${id_model}_${type}`;
79
+ return modelComponentTypeStyles.value[key] || {};
91
80
  }
92
81
 
93
82
  function clear() {
94
- return Promise.all([database.data_style.clear(), database.model_component_datastyle.clear()]);
83
+ return Promise.all([
84
+ database.data_style.clear(),
85
+ database.model_component_datastyle.clear(),
86
+ database.model_component_type_datastyle.clear(),
87
+ ]);
95
88
  }
96
89
 
97
90
  return {
98
91
  getStyle,
99
- mutateStyle,
100
92
  getComponentStyle,
101
- mutateComponentStyle,
102
- mutateComponentStyles,
93
+ getModelComponentTypeStyle,
94
+ mutateStyle,
103
95
  styles,
104
96
  componentStyles,
97
+ modelComponentTypeStyles,
105
98
  objectVisibility,
106
99
  selectedObjects,
107
100
  clear,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.13.2",
3
+ "version": "10.14.0-rc.1",
4
4
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
5
5
  "homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
6
6
  "bugs": {
@@ -34,8 +34,8 @@
34
34
  "build": ""
35
35
  },
36
36
  "dependencies": {
37
- "@geode/opengeodeweb-back": "latest",
38
- "@geode/opengeodeweb-viewer": "latest",
37
+ "@geode/opengeodeweb-back": "next",
38
+ "@geode/opengeodeweb-viewer": "next",
39
39
  "@google-cloud/run": "3.2.0",
40
40
  "@kitware/vtk.js": "33.3.0",
41
41
  "@mdi/font": "7.4.47",
@@ -53,7 +53,11 @@ describe("Model blocks", () => {
53
53
  await sleep(SLEEP_MS);
54
54
  expect(spy).toHaveBeenCalledWith(
55
55
  model_blocks_schemas.visibility,
56
- { id, block_ids: block_viewer_ids, visibility },
56
+ {
57
+ id,
58
+ block_ids: block_viewer_ids,
59
+ visibility,
60
+ },
57
61
  {
58
62
  response_function: expect.any(Function),
59
63
  },
@@ -78,7 +82,12 @@ describe("Model blocks", () => {
78
82
  await sleep(SLEEP_MS);
79
83
  expect(spy).toHaveBeenCalledWith(
80
84
  model_blocks_schemas.color,
81
- { id, block_ids: block_viewer_ids, color },
85
+ {
86
+ id,
87
+ block_ids: block_viewer_ids,
88
+ color,
89
+ color_mode: "constant",
90
+ },
82
91
  {
83
92
  response_function: expect.any(Function),
84
93
  },
@@ -53,7 +53,11 @@ describe("Model corners", () => {
53
53
  await sleep(SLEEP_MS);
54
54
  expect(spy).toHaveBeenCalledWith(
55
55
  model_corners_schemas.visibility,
56
- { id, block_ids: corner_viewer_ids, visibility },
56
+ {
57
+ id,
58
+ block_ids: corner_viewer_ids,
59
+ visibility,
60
+ },
57
61
  {
58
62
  response_function: expect.any(Function),
59
63
  },
@@ -81,7 +85,12 @@ describe("Model corners", () => {
81
85
  await sleep(SLEEP_MS);
82
86
  expect(spy).toHaveBeenCalledWith(
83
87
  model_corners_schemas.color,
84
- { id, block_ids: corner_viewer_ids, color },
88
+ {
89
+ id,
90
+ block_ids: corner_viewer_ids,
91
+ color,
92
+ color_mode: "constant",
93
+ },
85
94
  {
86
95
  response_function: expect.any(Function),
87
96
  },
@@ -53,7 +53,11 @@ describe("Model lines", () => {
53
53
  await sleep(SLEEP_MS);
54
54
  expect(spy).toHaveBeenCalledWith(
55
55
  model_lines_schemas.visibility,
56
- { id, block_ids: lines_viewer_ids, visibility },
56
+ {
57
+ id,
58
+ block_ids: lines_viewer_ids,
59
+ visibility,
60
+ },
57
61
  {
58
62
  response_function: expect.any(Function),
59
63
  },
@@ -81,7 +85,12 @@ describe("Model lines", () => {
81
85
  await sleep(SLEEP_MS);
82
86
  expect(spy).toHaveBeenCalledWith(
83
87
  model_lines_schemas.color,
84
- { id, block_ids: lines_viewer_ids, color },
88
+ {
89
+ id,
90
+ block_ids: lines_viewer_ids,
91
+ color,
92
+ color_mode: "constant",
93
+ },
85
94
  {
86
95
  response_function: expect.any(Function),
87
96
  },
@@ -52,7 +52,11 @@ describe("model surfaces", () => {
52
52
  await sleep(SLEEP_MS);
53
53
  expect(spy).toHaveBeenCalledWith(
54
54
  model_surfaces_schemas.visibility,
55
- { id, block_ids: surface_viewer_ids, visibility },
55
+ {
56
+ id,
57
+ block_ids: surface_viewer_ids,
58
+ visibility,
59
+ },
56
60
  {
57
61
  response_function: expect.any(Function),
58
62
  },
@@ -80,7 +84,12 @@ describe("model surfaces", () => {
80
84
  await sleep(SLEEP_MS);
81
85
  expect(spy).toHaveBeenCalledWith(
82
86
  model_surfaces_schemas.color,
83
- { id, block_ids: surface_viewer_ids, color },
87
+ {
88
+ id,
89
+ block_ids: surface_viewer_ids,
90
+ color,
91
+ color_mode: "constant",
92
+ },
84
93
  {
85
94
  response_function: expect.any(Function),
86
95
  },