planner: generalise the data layers for one layer at a time - #2347
Merged
Merged
Conversation
The layer menu offers Off or one data layer from a short registry. A layer shows only when the region has its archive. The archive URLs are one map keyed by archive name (snow, climate). The DataLayer interface now covers the decided Weather and Wind designs: an optional profile strip, an optional variable switch in the date bar, year slider rows with labels, point charts with several grids and an extra view, swatch or scale legends, and the profile heights as an input. The left-panel stats block is gone for all layers. Snow keeps its look. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change prepares the website planner for the Weather and Wind layers (#2329). Snow is the only layer that it implements. A later layer is one registry line, one implementation file and its tests.
layers/registry.tslists the data layers in menu order. Each entry names its archive and a factory. A layer shows only when the region has its archive URL.DATA_URLSinmap-data.tsmaps each archive name (snow,climate) to its URL. The names agree with planner: bake the climate data layer from ERA5-Land #2345 (VITE_PLANNER_CLIMATE_URL).DataLayernow has:strip?: an optional profile strip (legend,fills,values).variable?: an optional switch in the date bar (for example Temperature | Rain). The layer owns its value.year(samples | null): the year slider as aGridwith labelled rows, also empty rows before a route exists.chart(): aChartwith labelled grids, an optionalextracomponent (for example a wind rose) and an optional note.legend(): swatches or a continuous scale (LayerLegend.svelte, solid colours).sample(line): gets the line coordinates and the profile heights, so a layer can compute the bearing and correct temperature without new requests.PlannerMapinto the snow layer.LayerSpotmerged intoLayerInspect(compact).Not in this change: the night-low labels at overnight stops (Weather). They need the trip day ends as an input. A later change can add them.
Checks
npx vitest run src/lib/planner src/components/planner: 163 passednpx svelte-check --fail-on-warnings: no new errors. The 15 that remain are missing wasmpkg/build outputs.npm run test:planner: the request budget passes, with no changeobc suites check,obc prose --check: OKPublic docs changed: no
Requirements: none
🤖 Generated with Claude Code