A web application for the exploration of German weather data provided by the DWD.
- install dependencies:
pnpm install
ornpm install
- run the dev server:
pnpm dev
ornpm run dev
While the dev server is running, you can make changes to the code and the page will dynamically update.
Svelte components are files with the file ending .svelte
and can contain JS/TS code in the <script>
tag, CSS in the <style>
tag as well as standard HTML tags. The src/routes/+page.svelte
is a component for the index page.
- Implement the function
countStationsPerState
insrc/routes/+page.svelte
to count the number of weather stations for each unique state. - Implement the function
computeBarWidth
insrc/lib/components/Barchart.svelte
to compute the width for the bars in the bar chart with respect to the respective value. - Implement the functions
toggleSelection
,selectStationsByState
, andresetSelection
insrc/routes/+page.svelte
to enable selections of the weather stations. - Highlight selected stations in
src/lib/components/Map.svelte
using CSS. - Implement the functions
formatCoordinates
andformatHeight
insrc/lib/components/StationCard.svelte
to format the respective values in a sensible manner. - Implement the function
linePath
insrc/lib/components/TimeSeries.svelte
to draw a line chart of a station's temperature measurements over time. - Add a dot for the minimum and maximum temperature in the time series in
src/lib/components/TimeSeries.svelte
and add a text label to each with the respective temperature value.
Here are some ideas for optional and more advanced improvements to the app:
- Hover and select stations in the map based on proximity of the cursor. Always highlight the station that is closest to the cursor and toggle its selection on a click. Hint: Voronoi diagrams are useful for that.
- Allow zooming to a state in the map by clicking it. Make sure to provide a way to reset the view to the whole of Germany.
- Encode each station's height in the color of the circle in the map. See d3's chromatic scales.
- Improve the performance of data loading and use more data by updating the data loading script
data/load-data.py
. Possible options are either using a better suited binary format for the data or setting up a small data backend that provides interfaces for data access. - Add advanced filtering using a newly implemented component, e.g. by state, height range, name.
- Allow the selection of states also in the map component, for example a circular or rectangular selection.