Skip to content

Commit c115a7d

Browse files
Copilotlstein
andcommitted
Increase unclustered point opacity to match clustered points in curation mode
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
1 parent 1a23214 commit c115a7d

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • photomap/frontend/static/javascript

photomap/frontend/static/javascript/umap.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,20 +1617,27 @@ function updateUmapColors() {
16171617
);
16181618
if (allPointsTraceIndex === -1) return;
16191619

1620-
// Set colors based on curation mode
1620+
// Set colors and opacity based on curation mode
16211621
let markerColors;
1622+
let markerOpacity;
1623+
16221624
if (isCurationModeActive) {
16231625
// Grey out all points when in curation mode
16241626
markerColors = points.map(() => "#888888");
1627+
// Increase opacity of unclustered points to match clustered ones
1628+
markerOpacity = points.map(() => 0.75);
16251629
} else {
16261630
// Use cluster colors
16271631
markerColors = points.map((p) => getClusterColor(p.cluster));
1632+
// Default opacity: unclustered = 0.08, clustered = 0.75
1633+
markerOpacity = points.map((p) => (p.cluster === -1 ? 0.08 : 0.75));
16281634
}
16291635

16301636
Plotly.restyle(
16311637
"umapPlot",
16321638
{
1633-
"marker.color": [markerColors]
1639+
"marker.color": [markerColors],
1640+
"marker.opacity": [markerOpacity]
16341641
},
16351642
allPointsTraceIndex
16361643
);

0 commit comments

Comments
 (0)