Skip to content

kuranez/eu-energy-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

80 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EU Energy Map

Python Pandas Geopandas Holoviz Panel Jupyter Docker

An interactive dashboard that visualizes Eurostat data on renewable energy developments across European countries. Built with Python and Panel, the web app provides an intuitive interface to explore renewable energy trends from 2004 to 2022.

🌐 Web App

Live Demo

Try the app - explore renewable energy data for Europe directly in your browser.

Screenshot

https://raw.githubusercontent.com/kuranez/EU-Energy-Map/refs/heads/main/extra/images/screenshots/app.png


βš™οΈ Features

  • Interactive dashboard powered by Panel and Plotly

  • Time-series visualization of renewable energy shares by country and category

  • Geospatial mapping using GeoJSON and GeoPandas

  • Downloadable datasets and smooth filtering options

Example Charts


➀ Renewable Energy Share Per Year


https://raw.githubusercontent.com/kuranez/EU-Energy-Map/refs/heads/main/extra/images/screenshots/year_chart.png


➀ Renewable Energy Share Per Country


https://raw.githubusercontent.com/kuranez/EU-Energy-Map/refs/heads/main/extra/images/screenshots/country_chart.png


Recent Changes


Bar Charts

  • Unified display of EU Total Average across all charts, with a toggle option to show/hide it.
  • Minor improvements to hover templates and trace labels.

Map

  • Implemented hover templates displaying country flags and data.
  • Recentered map and adjusted zoom.
  • Added layout spacers for improved alignment.

Description

  • Added basic usage instructions to the dashboard.
  • Added emojis and graphics.

Layout & Dashboard

  • Reorganized dashboard components for better clarity and user experience.
  • Minor improvements to scaling.

File Structure

  • Reorganization of file structure to me more modular and easier to expand.

πŸ“¦ Python Dependencies

  • Core: os, json

  • Data Handling: pandas, geopandas

  • Visualization: plotly.express, plotly.graph_objects, plotly.io

  • Dashboard UI: panel


πŸ“Š Datasets

1. Renewable Energy Data (Eurostat)

  • File: nrg_ind_ren_linear.csv

  • Source: Eurostat – Renewable Energy

  • Years: 2004–2022

  • Columns: Country codes, energy type, unit, value (%), flags

  • Categories: Total renewables, electricity, heating/cooling, transport

2. Geographic Boundaries (GISCO - Eurostat)


πŸ“ File Structure

EU-Energy-Map/
β”œβ”€β”€ app.py                   # Main dashboard entry point
β”œβ”€β”€ config.py                # Configurations (tokens, paths, etc)
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ loader.py            # Loads and merges CSV/GeoJSON data
β”‚   β”œβ”€β”€ filters.py           # Preprocessing and filtering logic
β”‚   └── nrg_ind_ren_linear.csv   # Eurostat renewable energy data
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ charts/
β”‚   β”‚   β”œβ”€β”€ bar_chart_by_country.py  # Bar chart: Country vsU
β”‚   β”‚   └── bar_chart_by_year.py     # Bar chart: All countries by year
β”‚   β”œβ”€β”€ map.py                # Interactive choropleth map
β”‚   └── widgets.py            # Dashboard widgets (sliders, selectors)
β”œβ”€β”€ layout/
β”‚   └── dashboard.py          # Layout composition for Panel
β”œβ”€β”€ utils/                    # Helper functions
β”‚   β”œβ”€β”€ colors.py             # Color scales & conversion
β”‚   └── flags.py              # ISO2 code β†’ emoji flag
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ europe-renewables-500px.png  # Dashboard image
β”‚   └─── logo-500px.png               # Logo
└── geo/
    └── europe.geojson        # European country boundaries (GeoJSON)

πŸ“™ Documentation

Code documentation is provided as a Jupyter notebook.
You can view it here: documentation.ipynb

πŸ“• Resources

  • Holoviz Panel – A powerful Python framework for creating interactive web apps and dashboards, used for the UI in this project.
  • Pandas – Essential for data manipulation and analysis, enabling efficient handling of Eurostat datasets.
  • Geopandas – Extends pandas to support geospatial data, making it easy to work with geographic boundaries and mapping.
  • Jupyter - An interactive environment for running Python code in notebooks, ideal for experimentation, documentation, and prototyping scripts.
  • Docker Documentation - Official guides for containerizing, deploying, and running this app consistently across different environments.

πŸ“˜ License

This project is open source and available under the MIT License. You may modify, distribute, and use it freely in your own projects.


πŸ““ Jupyter Notebook Version (Previous Release)

A standalone Jupyter Notebook version of the EU Energy Map dashboard is available from a previous release:

Download Notebook Release v1.1

  • Run the notebook locally to explore and visualize Eurostat renewable energy data without setting up the full web app.
  • Includes interactive charts and geospatial mapping using the same datasets.
  • Ideal for experimentation, prototyping, or educational use.

πŸ”— Related Projects

If you're working with Eurostat TSV datasets and need a tool for quick conversion to CSV, check out my companion project:

➑️ TSV-CSV Converter – A lightweight utility to convert Eurostat-style .tsv files into clean .csv format.