Add detailed energy mix breakdown to live generation data#1
Open
akgularda wants to merge 1 commit into
Open
Conversation
Surface more of the generation mix already fetched from each grid source. Each fetcher (UK/ESO, US/EIA, EU/ENTSO-E) now derives live wind, solar, nuclear, and fossil shares alongside the renewable figure — no new API calls or tokens. Extends LivePoint and renders the breakdown under the LIVE banner in the country panel. https://claude.ai/code/session_011gEdBijWzWNvAechVynNQ1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extended the live generation data to include detailed breakdowns of wind, solar, nuclear, and fossil fuel generation percentages alongside the existing renewable percentage. This provides users with more granular visibility into the current energy mix across all three data sources (ENTSO-E, ESO, and EIA).
Key Changes
Type definitions: Added
wind,solar,nuclear, andfossilfields to theLivePointinterface insrc/types.ts, all nullable to accommodate sources with varying data availability.Data source constants: Expanded
scripts/live-sources.mjswith new PSR (Power Source Ranking) and fuel-type categorizations:ENTSOE_FOSSIL_PSR,ENTSOE_NUCLEAR_PSR,ENTSOE_WIND_PSR, andENTSOE_SOLAR_PSRsets for ENTSO-EESO_FOSSILset for UK ESO dataEIA_FOSSILset for US EIA dataENTSO-E parser: Modified
parseEntsoe()to track and return all four fuel categories as percentages, returning an object instead of a single number.ESO fetcher: Enhanced
fetchEso()to calculate and return wind, solar, nuclear, and fossil percentages alongside renewable percentage.EIA fetcher: Enhanced
fetchEia()to track individual fuel types (wind, solar, nuclear, fossil) and return them as percentages of total generation.UI display: Updated
CountryPanel.tsxto render the new breakdown fields when available, displaying them as a compact list of labeled percentages below the renewable/carbon metrics.Implementation Details
number | null) to gracefully handle sources that don't provide certain data categoriesperc()andpct())https://claude.ai/code/session_011gEdBijWzWNvAechVynNQ1