prop/assets/js
Graham McIntire a4cd7632eb
feat(skewt): hover crosshair + DB fallback for missing on-disk profiles
Two follow-ups to the earlier /skewt work:

1. Interactive crosshair (matches the SPC-viewer feel from the
   reference screenshot). Mousing over the diagram now drops a
   horizontal pressure cursor with a top-left readout box showing the
   pressure at the cursor's altitude (mb), the height in m and ft,
   and the linearly interpolated temperature and dewpoint at that
   level. Two coloured dots track the T and Td traces along the
   cursor so the user can read the spread visually.

   Mechanics: SkewtSvg.geometry/0 exposes the plot geometry (left,
   right, top, bottom, p_bottom, p_top, t_min, t_max, skew) as JSON;
   SkewtSvg emits an initially-hidden <g class="skewt-cursor"> layer.
   A new Skewt hook in assets/js/app.ts inverts pressure_y to recover
   pressure from the cursor's viewBox-Y, walks the (descending-pres-
   sorted) profile to interp T/Td/height, and updates the elements.
   The hook also handles mouseleave to hide the cursor and uses the
   SVG's screen-CTM so the math stays correct under any container
   aspect-ratio resize.

2. DB fallback for `available_valid_times`/`load_profile`. When the
   on-disk `ProfilesFile` has nothing for the location-and-window
   (true on dev, transient on prod between chain runs), SkewtLive
   now falls back to `HrrrProfileLookup.{list_valid_times_near,
   read_point_near}/3` against the `hrrr_profiles` Postgres table.
   The lookup uses the same ±0.07° spatial tolerance and the
   `(lat, lon, valid_time)` unique index that `Weather.find_nearest_
   hrrr/3` already relies on, so the queries are index-only.

   Returned shape matches `ProfilesFile.read_point/3` so SkewtLive
   reads from either source transparently. NaiveDateTime → UTC
   normalisation is centralised in `ensure_utc/1` so the LiveView
   sees `%DateTime{time_zone: "Etc/UTC"}` regardless of which side
   produced the value.

Tests: 6/6 new HrrrProfileLookupTest cases (list/limit/tolerance,
read nearest cell, nil for far cells, picks closest among matches),
3/3 SkewtLiveTest still green, 2,894 total Elixir tests + 221
properties green via mix test (one pre-existing flaky test in
admin/contact_edit_live re-runs clean). mix credo --strict clean.
mix assets.build clean.
2026-04-25 13:17:58 -05:00
..
types feat(eme): 3D WebGL Earth-Moon globe with lazy-loaded Three.js 2026-04-23 17:00:53 -05:00
app.ts feat(skewt): hover crosshair + DB fallback for missing on-disk profiles 2026-04-25 13:17:58 -05:00
beacon_map_hook.ts feat(format): miles-primary distance formatting sitewide 2026-04-18 15:53:40 -05:00
beacons_list_map_hook.ts Beacon list map, profile page polish, nav ordering fix 2026-04-12 16:23:09 -05:00
contact_map_hook.ts refactor: normalize pos1/pos2 JSONB key to 'lon' everywhere 2026-04-17 09:10:32 -05:00
contacts_map_hook.ts feat(format): miles-primary distance formatting sitewide 2026-04-18 15:53:40 -05:00
elevation_profile_hook.ts feat(contact): loading spinners, callsign-aware summaries, axis callsigns 2026-04-18 13:43:35 -05:00
eme_globe_hook.ts feat(eme): 3D WebGL Earth-Moon globe with lazy-loaded Three.js 2026-04-23 17:00:53 -05:00
format.ts feat(format): miles-primary distance formatting sitewide 2026-04-18 15:53:40 -05:00
locate_me_hook.ts Convert all JavaScript to TypeScript with type annotations 2026-04-11 16:59:28 -05:00
maidenhead_grid.ts Add 6-char subsquare grid overlay and fix map edge rendering 2026-04-11 18:08:18 -05:00
propagation_map_hook.ts perf(wire)+ts: pack scores as flat tuples, bump ProfilesFile gzip, tighten TS types 2026-04-21 17:45:06 -05:00
rover_map_hook.ts fix(maps): same reconnect/visibility fix for rover and weather hooks 2026-04-18 13:25:38 -05:00
weather_map_hook.ts feat(weather): add 700 mb T/Td and mid-layer lapse rate for cap diagnostics 2026-04-24 19:27:23 -05:00