Conversation
Delegate colormap conversion to stores and simplify selectors to use raw API objects
- Implement new defineModel pattern with separate v-models for name, range, and colorMap - Add per-attribute persistence for range and colorMap settings - Apply "Cool to Warm" colormap by default on first attribute selection - Fix immediate colormap update when modifying range min/max - Use local state in AttributeSelectors with event-driven communication - Add remoteRender() call in store after colormap application Affected components: - AttributeSelectors (Vertex, Edge, Cell, Polygon, Polyhedron) - ColoringTypeSelector - SpecificOptions (Polygons, Points, Polyhedra, Cells, Edges) - mesh/polygons.js store
| promise_array.push(meshPolygonsStyleStore.applyMeshPolygonsStyle(id)) | ||
| } else if (key === "polyhedra") { | ||
| promise_array.push(meshPolyhedraStyleStore.applyMeshPolyhedraStyle(id)) | ||
| } else if (key === "attributes") { |
There was a problem hiding this comment.
Ah oui on est obligé de mettre ça du coup...
internal/stores/mesh/edges.js
Outdated
| @@ -106,43 +147,219 @@ export function useMeshEdgesStyle() { | |||
| return meshEdgesStyle(id).coloring.vertex | |||
| } | |||
| function setMeshEdgesVertexAttribute(id, vertex_attribute) { | |||
There was a problem hiding this comment.
Toujours utile cette fonction ?
internal/stores/mesh/edges.js
Outdated
| response_function: () => { | ||
| console.log(setMeshEdgesEdgeAttributeColorMap.name, { | ||
| id, | ||
| colorMapName, |
There was a problem hiding this comment.
meshEdgesEdgeAttributeColorMap(id)
There was a problem hiding this comment.
Là tu logges la veur du param, mais pas ce qui est stocké
| } | ||
| }) | ||
| } else { | ||
| throw new Error("Unknown mesh points coloring type: " + type) |
There was a problem hiding this comment.
Non, "Unknown mesh points active coloring type" à la limite
| const viewerStore = useViewerStore() | ||
|
|
||
| const spy = vi.spyOn(viewerStore, "request") | ||
| await dataStyleStore.setMeshPointsVertexAttribute(id, vertex_attribute) |
There was a problem hiding this comment.
setMeshPointsVertexAttributeName ?
internal/stores/mesh/cells.js
Outdated
| function setMeshCellsVertexAttributeRange(id, minimum, maximum) { | ||
| const coloring_style = meshCellsStyle(id).coloring | ||
| const name = coloring_style.vertex.name | ||
| if (!coloring_style.vertex.attributes[name]) { |
There was a problem hiding this comment.
Y a duplication, faut faire qu'une seule fonction qu'on appelle partout
internal/stores/mesh/cells.js
Outdated
| saved_preset.colorMap = colorMapName | ||
| let points = colorMapName | ||
| if (typeof colorMapName === "string") { | ||
| points = getRGBPointsFromPreset(colorMapName) |
There was a problem hiding this comment.
Pourquoi faire un let points = colorMapName ?
There was a problem hiding this comment.
| points = getRGBPointsFromPreset(colorMapName) | |
| const points = getRGBPointsFromPreset(colorMapName) |
| function meshCellsCellAttributeRange(id) { | ||
| const name = meshCellsCellAttributeName(id) | ||
| const saved_preset = meshCellsStyle(id).coloring.cell.attributes[name] | ||
| return saved_preset ? [saved_preset.minimum, saved_preset.maximum] : [0, 1] |
There was a problem hiding this comment.
| return saved_preset ? [saved_preset.minimum, saved_preset.maximum] : [0, 1] | |
| return [saved_preset.minimum, saved_preset.maximum] |
internal/stores/mesh/cells.js
Outdated
| const minimum = attributes[name]?.minimum | ||
| const maximum = attributes[name]?.maximum | ||
| const colorMap = attributes[name]?.colorMap | ||
| return setMeshCellsVertexAttributeName(id, name).then(() => { |
There was a problem hiding this comment.
Pourquoi faire un return et faire un .then() après ?
No description provided.