From 5adc05e1bb5aad56c91e40f8aec3cfb0fb47cf4f Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Sat, 7 Jun 2025 22:44:41 +0200 Subject: [PATCH] Statistics: Implement statistics page with team/driver standings + driver cumsum chart --- src/routes/statistics/+page.svelte | 109 +++++++++++++++++++++++++++++ src/routes/statistics/+page.ts | 23 ++++++ 2 files changed, 132 insertions(+) create mode 100644 src/routes/statistics/+page.ts diff --git a/src/routes/statistics/+page.svelte b/src/routes/statistics/+page.svelte index 1f4e0af..a2fa8ee 100644 --- a/src/routes/statistics/+page.svelte +++ b/src/routes/statistics/+page.svelte @@ -1,3 +1,112 @@ + + Formula 11 - Statistics + +
+ +
+ +
+
+ {#await data.scraped_driverstandings then driverstandings} + + {/await} + + +
+ {#await data.scraped_teamstandings then teamstandings} +
+ {/await} + + diff --git a/src/routes/statistics/+page.ts b/src/routes/statistics/+page.ts new file mode 100644 index 0000000..d6e60e5 --- /dev/null +++ b/src/routes/statistics/+page.ts @@ -0,0 +1,23 @@ +import { + fetch_drivers, + fetch_scraped_driverstandings, + fetch_scraped_raceresults, + fetch_scraped_raceresultsacc, + fetch_scraped_startinggrids, + fetch_scraped_teamstandings, +} from "$lib/fetch"; +import type { PageLoad } from "../$types"; + +export const load: PageLoad = async ({ fetch, depends }) => { + depends("data:drivers", "data:official"); + + return { + drivers: fetch_drivers(fetch), + + scraped_driverstandings: fetch_scraped_driverstandings(fetch), + scraped_teamstandings: fetch_scraped_teamstandings(fetch), + scraped_startinggrids: fetch_scraped_startinggrids(fetch), + scraped_raceresults: fetch_scraped_raceresults(fetch), + scraped_raceresultsacc: fetch_scraped_raceresultsacc(fetch), + }; +};