Vibe Coding #4 — Data Analytics Dashboard with Svelte & Python | ENTSO-E API Energy Data

Building an interactive dashboard to explore European energy data from ENTSO-E — generation mix, electricity loads, and day-ahead prices with synchronized chart zooming and draggable layouts.

February 23, 2026 16:30 CET 1:28:00
svelteentsoeenergydashboardfrontendpythonechartsinteractive

Get weekly updates

Live coding sessions, Python libraries for energy data, and hands-on tutorials. One email per week, zero fluff.

Result

An interactive dashboard that queries ENTSO-E energy data for any European country — generation mix, electricity loads, and day-ahead prices displayed in synchronized ECharts with draggable layouts, all built in a single live session.

The problem

  • In Vibe Coding #3 we built python-entsoe to query European energy data, but every analysis still required writing Python code
  • The official ENTSO-E Transparency Platform has limited interactivity — no cross-chart synchronization, no custom layouts
  • Business users need a point-and-click interface to explore generation, loads, and prices without touching code
  • Comparing multiple data dimensions (generation vs. loads vs. prices) side by side requires manual effort every time

ENTSO-E Transparency Platform — the dashboard we're emulating

The solution

We started from the python-entsoe library built in Vibe Coding #3 and set out to wrap it in an interactive web dashboard — no more writing code to see charts.

Planning and architecture

First step: write a CLAUDE.md plan specifying the goal (a dashboard web application serving ENTSO-E Python data), the tech stack, and the repo structure before implementing anything.

Claude Code researched charting libraries. We compared D3.js, LayerCake (native Svelte), and Apache ECharts by checking GitHub stars, npm downloads, and interactive demos.

Comparing charting libraries — Apache ECharts interactive examples

ECharts won — more reactive interactions out of the box, especially for hover tooltips and zoom controls. Claude Code then proposed a monorepo structure with backend/ (FastAPI) and frontend/ (SvelteKit):

Claude Code planning the repository structure

Building the backend

The FastAPI backend uses python-entsoe to query generation, loads, and prices. The key preprocessing step: pivot tables to restructure the raw DataFrames into the format ECharts expects — generation types as columns, timestamps as rows, with NaN values filled to zero for JSON serialization.

Backend ENTSO-E client with pivot table data preprocessing

We also reused the country metadata from the python-entsoe library (area codes, country names) instead of hardcoding duplicates — a detail Claude Code would have missed without guidance.

Frontend setup

For the frontend, we installed SvelteKit with Shadcn UI components using Bun. Shadcn provides pre-built components like sidebars, combo boxes, and buttons — speeding up dashboard development significantly.

Installing Shadcn UI components for the dashboard sidebar

First working dashboard

After connecting backend to frontend, we queried Germany’s energy generation. The first attempt hit a JSON serialization error — the pivot table produced NaN values. After filling missing values with zeros, the charts rendered:

First working dashboard — querying Germany energy generation data

Caching and data persistence

The ENTSO-E API is slow for large date ranges. We implemented a two-layer caching system: in-memory TTL cache for fast repeated queries, plus disk persistence (Parquet files keyed by country and date range) so data survives server restarts.

UX improvements

The country selector was a basic dropdown — scrolling through 40+ countries to find Spain. We replaced it with a Shadcn combo box with type-ahead filtering:

Combo box for country filtering — UX improvement

Synchronized chart zooming

The breakthrough feature: zoom into any chart and all others update simultaneously. A checkbox in the sidebar toggles synchronization — when enabled, selecting a time range on the generation chart automatically zooms the loads and prices charts to the same window.

All charts synchronized — zoom in one updates all others

Draggable layout

The final feature: a configurable grid layout where charts can be dragged and resized. We researched Svelte-compatible drag libraries and integrated one to allow custom dashboard arrangements — put generation and loads side by side, enlarge the prices chart, or stack them vertically.

Draggable chart layout — configurable dashboard grid

Final result

The finished dashboard querying Spain data — three charts (generation mix, electricity loads, day-ahead prices) arranged side by side with synchronized zoom controls:

Final dashboard with Spain data — side by side charts with synchronized zoom

We also previewed the Datons social platform for sharing data visualizations — where these dashboard concepts will evolve into a collaborative tool with comments, full-page views, and advanced chart types like heatmaps:

Datons social media platform for sharing data visualizations

Reference

Dashboard features

FeatureDetailsDescription
Country selectorCombo box with searchType-ahead filtering across 40+ ENTSO-E countries
Date rangeStart/end date pickersCustom date range for all queries
Generation mixECharts stacked areaSolar, wind, nuclear, gas, hydro, biomass, etc.
Electricity loadsECharts line chartActual demand over time
Day-ahead pricesECharts line chartHourly prices in EUR/MWh
Synchronized zoomToggle checkboxZoom in one chart updates all others
Draggable layoutGrid with drag/resizeConfigurable dashboard arrangement
CachingMemory + disk (Parquet)Fast repeated queries, survives restarts

Project structure

entsoe-dashboard
.claude
plan.md# Development plan
.envrc# direnv — loads ENTSO-E API key
Makefile# make dev — starts both services
backend
pyproject.toml# UV + python-entsoe dependency
app
main.py# FastAPI app + CORS
routes# /generation, /loads, /prices, /metadata
services
entsoe_client.py# python-entsoe wrapper + pivot tables
data
raw# Parquet cache (by country + date range)
frontend
package.json# Bun + SvelteKit + ECharts
src
routes
+page.svelte# Dashboard page
lib
components# ECharts wrappers, sidebar, combo box
api.ts# Backend API client
app.css# Shadcn theme
components.json# Shadcn configuration

Architecture

Browser
Interactive energy dashboard
SvelteKit Frontend
ECharts (generation, loads, prices)
Shadcn UI (sidebar, combo box)
Draggable grid layout
REST API
FastAPI Backend
/generation/{country}
/loads/{country}
/prices/{country}
/metadata/countries
Cache Layer
In-memory TTL cache
Disk persistence (Parquet)
python-entsoe
github.com/datons/python-entsoe
ENTSO-E Transparency Platform
40+ countries, energy data

Stack

  • SvelteKit 5 · Apache ECharts · Shadcn UI · Bun
  • FastAPI · python-entsoe · Parquet caching

Resources

Table of Contents
Search sections

Subscribe to our newsletter

Get weekly insights on data, automation, and AI.

© 2026 Datons. All rights reserved.