stats: Eurostat pre-2007 household energy bands (nrg_pc_204_h/202_h folded into nrg_pc_204/202), stitched on /stats/energy; IMF revenue/spending from Fiscal Monitor codes
All checks were successful
Deploy production / deploy (push) Successful in 1m10s
All checks were successful
Deploy production / deploy (push) Successful in 1m10s
This commit is contained in:
@@ -21,6 +21,8 @@ export const load: PageServerLoad = async () => ({
|
||||
...EU.flatMap((g) => [
|
||||
`eurostat:nrg_pc_204:E7000.KWH2500-4999.KWH.I_TAX.EUR.${g}`,
|
||||
`eurostat:nrg_pc_202:G3000.GJ20-199.KWH.I_TAX.EUR.${g}`,
|
||||
`eurostat:nrg_pc_204:E7000.KWH3500.KWH.I_TAX.EUR.${g}`,
|
||||
`eurostat:nrg_pc_202:G3000.GJ83P70.GJ_GCV.I_TAX.EUR.${g}`,
|
||||
`eurostat:nrg_ind_id:TOTAL.PC.${g}`
|
||||
]),
|
||||
...['X_TAX', 'X_VAT'].flatMap((t) => [
|
||||
|
||||
@@ -39,8 +39,23 @@
|
||||
const evNewShare = $derived(
|
||||
ratio(pts('eurostat:road_eqr_carpda:NR.ELC.NL'), pts('eurostat:road_eqr_carpda:NR.TOTAL.NL'))
|
||||
);
|
||||
const elecPrice = (g: string) => pts(`eurostat:nrg_pc_204:E7000.KWH2500-4999.KWH.I_TAX.EUR.${g}`);
|
||||
const gasPrice = (g: string) => pts(`eurostat:nrg_pc_202:G3000.GJ20-199.KWH.I_TAX.EUR.${g}`);
|
||||
/** Current band, with the pre-2007 band (old methodology) stitched in before it starts. */
|
||||
function stitch(now: StatPoint[], old: StatPoint[]): StatPoint[] {
|
||||
const start = now[0]?.[0] ?? 9999;
|
||||
return [...old.filter(([d]) => d < start), ...now];
|
||||
}
|
||||
const elecPrice = (g: string) =>
|
||||
stitch(
|
||||
pts(`eurostat:nrg_pc_204:E7000.KWH2500-4999.KWH.I_TAX.EUR.${g}`),
|
||||
pts(`eurostat:nrg_pc_204:E7000.KWH3500.KWH.I_TAX.EUR.${g}`)
|
||||
);
|
||||
const gasPrice = (g: string) =>
|
||||
stitch(
|
||||
pts(`eurostat:nrg_pc_202:G3000.GJ20-199.KWH.I_TAX.EUR.${g}`),
|
||||
pts(`eurostat:nrg_pc_202:G3000.GJ83P70.GJ_GCV.I_TAX.EUR.${g}`).map(
|
||||
([d, v]) => [d, Math.round((v / 277.778) * 10000) / 10000] as StatPoint
|
||||
)
|
||||
);
|
||||
const ranking = (f: (g: string) => StatPoint[]) => {
|
||||
const rows = EU.map((g) => ({ g, p: latest(f(g)) })).filter((r) => r.p);
|
||||
const newest = rows.reduce((m, r) => (r.p![0] > m ? r.p![0] : m), '');
|
||||
@@ -295,7 +310,7 @@
|
||||
/>
|
||||
<StatChart
|
||||
title="Electricity: Netherlands, Germany, EU and the US"
|
||||
subtitle="per kWh incl. taxes · Europe in €, US city average in $ (BLS)"
|
||||
subtitle="per kWh incl. taxes · Europe in € (2,500–5,000 kWh; 3,500 kWh band before 2007), US city average in $ (BLS)"
|
||||
sources={['eurostat', 'fred']}
|
||||
attributions={a}
|
||||
height="360px"
|
||||
|
||||
Reference in New Issue
Block a user