claude/vigorous-stonebraker-41cc2d
safeviewing older commit37ce28a · incrementalpre-PRreviewed 2026-07-10 17:22 UTC0H · 2M · 3L · 6I- Purpose
- Static browser-only solar energy atlas for Mexico (Sistema Eléctrico Nacional). Visualizes generation plants, transmission lines, CENACE control regions, and distributed generation (DG) evolution data.
- Goal
- Add interactive tooltips to DG evolution charts and a CENACE region click popup with live demand/generation data.
- Sub-goals
- Add floating #etip tooltip element with CSS + JS event delegation on echart
- Add data-tip attributes to chart bars (stacked bars in size/region charts) and circle dots
- Add CENACE region click handler aggregating plant count, capacity, and tech breakdown
- Update atlas.json and dg_by_size.json with 2025 distributed-generation data
- What
- All 7 commits on this branch are atlas-only. The full branch adds a DG evolution panel with metrics, cumulative/annual toggle, size focus, region evolution, tooltips, and 2025 data.
- Why
- Atlas needs richer interactivity — hovering chart elements to see exact values is a baseline UX expectation for data visualizations.
- Areas
- apps/web/public/atlas/index.html+137−39apps/web/public/atlas/data/atlas.json+1−1apps/web/public/atlas/data/dg_by_size.json+1−1
- Blast
- 3 files total, +139/-41 across the whole branch. Static atlas only — no backend, no API, no TypeScript build.
Findings · 13
correctness4
Tooltip viewport clipping when cursor near top edge
apps/web/public/atlas/index.html
position:fixed + transform:translate(-50%,-100%) + top=clientY-10 causes tooltip to disappear above viewport when mouse is within ~40px of top edge.
cursor:default on SVG dots is intentional — no issue
apps/web/public/atlas/index.html
dots show tooltips but don't handle clicks; cursor:default is correct.
D.REG[p[6]] region index access follows existing convention — safe
apps/web/public/atlas/index.html
p[6] is the established regionKey field, mirroring dgRegionVal.
DEM optional chaining is safe
apps/web/public/atlas/index.html
DEM&&DEM.regions&&DEM.regions[nm]&&DEM.regions[nm].latest chains safely.
security2
Region name interpolated into pop() innerHTML — controlled data source, pre-existing pattern
apps/web/public/atlas/index.html
nm from atlas.json feature properties; data from controlled GitHub. Same pattern used for other layers. Theoretical XSS only.
etip tooltip uses textContent — XSS-safe
apps/web/public/atlas/index.html
Data-tip values are Math.round()/toFixed() numerics + static strings. Clean.
conventions3
scope.md describes feat/multi-gran (metrics pipeline), not atlas work
.branch/scope.md
All 7 branch commits are atlas-only. scope.md should be updated or removed if branch was repurposed.
dgDots optional 5th param is backwards-compatible
apps/web/public/atlas/index.html
All call sites pass tips; undefined path handled gracefully.
CSS and JS patterns consistent with existing file conventions
apps/web/public/atlas/index.html
tests1
No tests — appropriate for static HTML visualization
apps/web/public/atlas/index.html
No build pipeline. Manual browser test is adequate.
improvement3
Tooltip top-edge guard — one-liner fix available
apps/web/public/atlas/index.html
etip.style.top=(e.clientY>60?e.clientY-10:e.clientY+18)+'px' flips tooltip below cursor near top edge.
Dot radius bump (1.7→2.4) improves usability
apps/web/public/atlas/index.html
CENACE region aggregation is O(n) plants — fast enough
apps/web/public/atlas/index.html
History · 10 commits
- a081002safeincremental0H · 0M · 0L2026-07-14 01:23
- 64dc83dneeds attentionincremental0H · 1M · 7L2026-07-13 20:03
- ec4eea3needs attentionincremental1H · 3M · 7L2026-07-13 18:42
- f4b4129safeincremental0H · 0M · 3L2026-07-13 04:34
- 8ea0c8asafeincremental0H · 0M · 3L2026-07-13 04:21
- 37ce28asafeincremental0H · 2M · 3L2026-07-10 17:22current
- d28c6daneeds attentionincremental0H · 3M · 10L2026-07-10 16:59
- 754a65dneeds attentionincremental0H · 3M · 4L2026-07-10 16:39
- a9190b2safeincremental0H · 0M · 5L2026-07-10 16:14
- 0bf12a0blockedfull1H · 2M · 4L2026-07-10 16:06