You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Data (totalExport and totalImport) is available for an electric net exchange chart with 30d+ views, but it's only presented for the 24h and 72h views.
There isn't data about totalCo2Export or totalCo2Import, so this issue is down-scoped to getting the electric net exchange chart to avoid addressing separate underlying problems. I've opened #7596 to address that.
Click to expand electric net exchange chart screenshots
72h view
all view (with bug fixed)
Analysis
The reason for 30d+ views not presenting the net exchange chart stems from a detail in a low-level helper function called getNetExchange. Specifically its the conditional Object.keys(zoneData.exchange).length === 0 from this code block:
The function's name, getNetExchange, is a low-level helper function for getting a net exchange value from totalImport and totalExport (and CO2 equivalent values). Thus, it is surprising that it requires data about individual exchanges not used in its calculation.
The function getNetExchange is only used by the net exchange graph UI, which only affects that. The only outcome of the if statement is that the 30d+ views won't present the electric net exchange chart.
Click to expand a screenshot from a repo search for the function name
The text was updated successfully, but these errors were encountered:
consideRatio
changed the title
Net exchange chart is only presented for 24h and 72h - not for 30d, 12mo, all
Electric net exchange chart is only presented for 24h and 72h - not for 30d, 12mo, all
Dec 20, 2024
Bug description
Data (
totalExport
andtotalImport
) is available for an electric net exchange chart with 30d+ views, but it's only presented for the 24h and 72h views.There isn't data about
totalCo2Export
ortotalCo2Import
, so this issue is down-scoped to getting the electric net exchange chart to avoid addressing separate underlying problems. I've opened #7596 to address that.Click to expand electric net exchange chart screenshots
Analysis
The reason for 30d+ views not presenting the net exchange chart stems from a detail in a low-level helper function called
getNetExchange
. Specifically its the conditionalObject.keys(zoneData.exchange).length === 0
from this code block:electricitymaps-contrib/web/src/utils/helpers.ts
Lines 190 to 201 in c9a3a8f
By removing it, the bug resolves.
Why it's a bug
I consider it a bug currently because...
The function's name,
getNetExchange
, is a low-level helper function for getting a net exchange value fromtotalImport
andtotalExport
(and CO2 equivalent values). Thus, it is surprising that it requires data about individual exchanges not used in its calculation.The function
getNetExchange
is only used by the net exchange graph UI, which only affects that. The only outcome of the if statement is that the 30d+ views won't present the electric net exchange chart.Click to expand a screenshot from a repo search for the function name
The text was updated successfully, but these errors were encountered: