Skip to content

Feat/color bar#296

Open
SpliiT wants to merge 62 commits intonextfrom
feat/color-bar
Open

Feat/color bar#296
SpliiT wants to merge 62 commits intonextfrom
feat/color-bar

Conversation

@SpliiT
Copy link
Member

@SpliiT SpliiT commented Jan 28, 2026

No description provided.

SpliiT and others added 7 commits February 5, 2026 12:06
- 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") {
Copy link
Member

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...

@@ -106,43 +147,219 @@ export function useMeshEdgesStyle() {
return meshEdgesStyle(id).coloring.vertex
}
function setMeshEdgesVertexAttribute(id, vertex_attribute) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Toujours utile cette fonction ?

response_function: () => {
console.log(setMeshEdgesEdgeAttributeColorMap.name, {
id,
colorMapName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meshEdgesEdgeAttributeColorMap(id)

Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setMeshPointsVertexAttributeName ?

function setMeshCellsVertexAttributeRange(id, minimum, maximum) {
const coloring_style = meshCellsStyle(id).coloring
const name = coloring_style.vertex.name
if (!coloring_style.vertex.attributes[name]) {
Copy link
Member

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

saved_preset.colorMap = colorMapName
let points = colorMapName
if (typeof colorMapName === "string") {
points = getRGBPointsFromPreset(colorMapName)
Copy link
Member

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 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return saved_preset ? [saved_preset.minimum, saved_preset.maximum] : [0, 1]
return [saved_preset.minimum, saved_preset.maximum]

const minimum = attributes[name]?.minimum
const maximum = attributes[name]?.maximum
const colorMap = attributes[name]?.colorMap
return setMeshCellsVertexAttributeName(id, name).then(() => {
Copy link
Member

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants