From 66ecf7cd6e69f3330222375ed02a721cc9f5ddef Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Fri, 29 May 2026 07:58:22 -0700 Subject: [PATCH] explorer: show individual sample points over the heatmap in point mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #242 made the heatmap mutually exclusive with both marker layers. That's right for cluster dots (aggregated — they contradict the density view), but individual sample points are exact per-sample locations that COMPLEMENT the heatmap (density = where it's busy, dots = the actual samples there). So at sample resolution (point mode) show the sample dots on top of the heatmap instead of hiding them; cluster dots stay hidden under the heatmap as before. One-line change in applyLayerVisibility() (the single marker-visibility control point). loadViewportSamples() already runs under heatmap in point mode, so the dots stay loaded and pan-fresh — this just unhides them. The heatmap is a Cesium imagery layer (globe surface), so sample primitives render on top of it. Co-Authored-By: Claude Opus 4.8 (1M context) --- explorer.qmd | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/explorer.qmd b/explorer.qmd index c0b5c9e4..7006e08a 100644 --- a/explorer.qmd +++ b/explorer.qmd @@ -2570,14 +2570,25 @@ zoomWatcher = { // Single source of truth for marker-layer visibility (#233 phase 3). // - // Cluster dots (h3Points) and individual sample points (samplePoints) - // are mutually exclusive with the heatmap overlay. When the heatmap is - // on it IS the density view, so painting the cluster dots on top of it - // produces the dots-vs-hotspots disagreement RY flagged 2026-05-27 — - // two layers telling contradictory spatial stories at once. Rule: - // heatmap on ⇒ both marker collections hidden (heatmap stands alone) - // heatmap off ⇒ show whichever collection the altitude-driven mode - // calls for (cluster→h3Points, point→samplePoints) + // The heatmap interacts differently with the two marker layers: + // + // * Cluster dots (h3Points) DO contradict the heatmap. Both are + // aggregate/density views, so painting cluster dots over the heatmap + // produces the dots-vs-hotspots disagreement RY flagged 2026-05-27 — + // two layers telling contradictory spatial stories at once. So cluster + // dots stay hidden whenever the heatmap is on. + // + // * Individual sample points (samplePoints) do NOT contradict it: they + // are exact per-sample locations, which COMPLEMENT the density overlay + // (heatmap = where it's dense, dots = the actual samples there). So at + // sample resolution (point mode) we show the sample dots on top of the + // heatmap rather than hiding them. (loadViewportSamples() already runs + // under heatmap in point mode, so they stay loaded and pan-fresh — this + // just unhides them.) + // + // Rule: + // cluster mode → h3Points shown only when heatmap OFF + // point mode → samplePoints shown always (heatmap on or off) // Aside from the one-time initializer (samplePoints starts hidden at // creation), this is the ONLY place that writes `.show` on the two // collections. Call it from every site that flips the mode or the @@ -2586,7 +2597,7 @@ zoomWatcher = { const heat = heatmapEnabled(); const mode = getMode(); viewer.h3Points.show = !heat && mode === 'cluster'; - viewer.samplePoints.show = !heat && mode === 'point'; + viewer.samplePoints.show = mode === 'point'; } // --- Mode transitions ---