Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): add production source legends to data source accordion for carbon and emission chart #6728

Conversation

silkeholmebonnen
Copy link
Contributor

@silkeholmebonnen silkeholmebonnen commented May 6, 2024

Issue

AVO-84

Description

The goal of this PR is to add the relevant production source legends to the data sources for emission factors, so you are able to see which sources are used for which production sources.

Preview

image

Double check

  • I have tested my parser changes locally with poetry run test_parser "zone_key"
  • I have run pnpx prettier@2 --write . and poetry run format in the top level directory to format my changes.

@tonypls
Copy link
Collaborator

tonypls commented May 6, 2024

Should this also show under the production breakdown in the sources there too?

@silkeholmebonnen
Copy link
Contributor Author

Should this also show under the production breakdown in the sources there too?

Yes! I totally forgot about that. I'll take a look at it now

@silkeholmebonnen
Copy link
Contributor Author

It should be in the bar-breakdown chart as well now:)

@tonypls
Copy link
Collaborator

tonypls commented May 7, 2024

Would it make sense that the power generation and emission factor data sources are including under all three charts?

Also is it correct that multiple emission factors have coal and gas for example in an hourly view? I would assume there is only one emission factor used for each production mode at hourly granularity

@VIKTORVAV99
Copy link
Member

VIKTORVAV99 commented May 13, 2024

Would it make sense that the power generation and emission factor data sources are including under all three charts?

Also is it correct that multiple emission factors have coal and gas for example in an hourly view? I would assume there is only one emission factor used for each production mode at hourly granularity

In my opinion not really.
The carbon intensity graph for example is dictated by the exchanges to a large amount, especially in Europe. And it'd rather show no sources for that particular graph than incomplete sources if that makes sense?

@silkeholmebonnen
Copy link
Contributor Author

Would it make sense that the power generation and emission factor data sources are including under all three charts?
Also is it correct that multiple emission factors have coal and gas for example in an hourly view? I would assume there is only one emission factor used for each production mode at hourly granularity

In my opinion not really. The carbon intensity graph for example is dictated by the exchanges to a large amount, especially in Europe. And it'd rather show no sources for that particular graph than incomplete sources if that makes sense?

So which graphs would you show sources for? And which sources would you show?

@VIKTORVAV99
Copy link
Member

Would it make sense that the power generation and emission factor data sources are including under all three charts?

Also is it correct that multiple emission factors have coal and gas for example in an hourly view? I would assume there is only one emission factor used for each production mode at hourly granularity

In my opinion not really. The carbon intensity graph for example is dictated by the exchanges to a large amount, especially in Europe. And it'd rather show no sources for that particular graph than incomplete sources if that makes sense?

So which graphs would you show sources for? And which sources would you show?

Preferably we should only show the sources that are relevant for each graph without causing additional cognitive load. So if a source is not directly relevant we should not show it. Therefore I don't think it makes sense to show say the emission factors on the emission chart as it only aggregated values. Where the data comes from makes sense but then it should not be listed as production sources in my opinion.

@silkeholmebonnen
Copy link
Contributor Author

silkeholmebonnen commented May 13, 2024

Would it make sense that the power generation and emission factor data sources are including under all three charts?
Also is it correct that multiple emission factors have coal and gas for example in an hourly view? I would assume there is only one emission factor used for each production mode at hourly granularity

In my opinion not really. The carbon intensity graph for example is dictated by the exchanges to a large amount, especially in Europe. And it'd rather show no sources for that particular graph than incomplete sources if that makes sense?

So which graphs would you show sources for? And which sources would you show?

Preferably we should only show the sources that are relevant for each graph without causing additional cognitive load. So if a source is not directly relevant we should not show it. Therefore I don't think it makes sense to show say the emission factors on the emission chart as it only aggregated values. Where the data comes from makes sense but then it should not be listed as production sources in my opinion.

What do you think @madsnedergaard @tonypls @Alportan ?

@tonypls
Copy link
Collaborator

tonypls commented May 13, 2024

Make sense to not show in the cases where it's aggregated from imports. It's usually better to over communicate rather than under communicate, I would suggest showing both the emission factors and

Would this make sense?

Sources: EF = Emission Factor, P = Power, C = Capacity

Electricity charts consumption toggle on:

  • Consumption by source: EF, P, C
  • Carbon intensity: P
  • Origin of electricity: EF, P

Electricity charts production toggle on:

  • Consumption by source: EF, P, C
  • Carbon intensity: EF, P
  • Origin of electricity: EF, P

Emissions charts consumption toggle on:

  • Consumption by source: EF, P, C
  • Carbon emissions: P
  • Origin of electricity: EF, P

Emissions charts production toggle on:

  • Consumption by source: EF, P, C
  • Carbon emissions: EF, P
  • Origin of electricity: EF, P

@silkeholmebonnen
Copy link
Contributor Author

We discussed it in the office and decided that we will get this out as a v1 and then optimize it later. We can discuss v2 it in the next team sync when you're there @VIKTORVAV99

@silkeholmebonnen
Copy link
Contributor Author

silkeholmebonnen commented May 13, 2024

@tonypls I have removed the data sources when the graph is disabled. It only happens in the 'Daily carbon emission origin' graph (BreakdownChart.tsx with consumption and emissions toggle) when its hourly, daily or yearly, right?

@@ -56,12 +57,15 @@ export default function useBarBreakdownChartData() {
);
const height = isConsumption ? exchangeY + exchangeHeight : exchangeY;

const emissionSourceToProductionSource = getEmissionData(zoneData);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure on the naming here, is this a function that converts an emission source to a production source? If it's a variable then the word "to" implies it converts and could be rephrased

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have named it sourceProductionSourceMapping now. I searched a bit on naming conventions for Maps and a lot of suggestions have "to" in it. I think that sourceToProductionSourceMapping might be better, what do you think?

Copy link
Collaborator

@tonypls tonypls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, I think we're almost there! Thanks for iterating many times 🙌

I think the sources here might look better left aligned:
image

@VIKTORVAV99
Copy link
Member

Looks great, I think we're almost there! Thanks for iterating many times 🙌

I think the sources here might look better left aligned: image

What do you mean by left aligned? No indentation?
If so that was discussed here: #6584 (comment)

@tonypls
Copy link
Collaborator

tonypls commented Jun 3, 2024

Looks great, I think we're almost there! Thanks for iterating many times 🙌
I think the sources here might look better left aligned: image

What do you mean by left aligned? No indentation? If so that was discussed here: #6584 (comment)

Ah I didn't see that comment but the indentation here seems to have crept even more to the right, to the point where the final source takes 3 lines.

@VIKTORVAV99
Copy link
Member

Looks great, I think we're almost there! Thanks for iterating many times 🙌
I think the sources here might look better left aligned: image

What do you mean by left aligned? No indentation? If so that was discussed here: #6584 (comment)

Ah I didn't see that comment but the indentation here seems to have crept even more to the right, to the point where the final source takes 3 lines.

I see what you mean now, it looks like the indentation has almost doubled. That we should fix directly but we should hold of on the full left.

Copy link
Member

@madsnedergaard madsnedergaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

Copy link
Collaborator

@tonypls tonypls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too 🎉

@silkeholmebonnen silkeholmebonnen merged commit 64f2912 into master Jun 4, 2024
21 checks passed
@silkeholmebonnen silkeholmebonnen deleted the silkebonnen/avo-84-add-the-production-source-legend-under-data-sources-for branch June 4, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants