-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/color bar #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Feat/color bar #296
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meshEdgesEdgeAttributeColorMap(id)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi faire un let points = colorMapName ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi faire un return et faire un .then() après ?
No description provided.