Skip to content

Emissions lineplots - #660

Merged
jacobvjk merged 14 commits into
mainfrom
emissions-lineplots
Aug 18, 2026
Merged

Emissions lineplots#660
jacobvjk merged 14 commits into
mainfrom
emissions-lineplots

Conversation

@cjyetman

@cjyetman cjyetman commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Dec 4, 2025

Copy link
Copy Markdown

Expected version change and release notes

🚨 WARNING: This PR is not expected to trigger a new version

To trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/

@github-actions

github-actions Bot commented Dec 4, 2025

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

@github-actions

github-actions Bot commented Dec 4, 2025

Copy link
Copy Markdown

Expected version change and release notes

🚨 WARNING: This PR is not expected to trigger a new version

To trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/

@github-actions

github-actions Bot commented Dec 4, 2025

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

@jacobvjk

jacobvjk commented Dec 5, 2025

Copy link
Copy Markdown
Collaborator

I think the plots would have to have a fixed lower bound of the y-axis at zero, at least for absolute emissions

@github-actions

github-actions Bot commented Dec 6, 2025

Copy link
Copy Markdown

Expected version change and release notes

🚨 WARNING: This PR is not expected to trigger a new version

To trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/

@github-actions

github-actions Bot commented Dec 6, 2025

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

@github-actions

github-actions Bot commented Dec 8, 2025

Copy link
Copy Markdown

Expected version change and release notes

🚨 WARNING: This PR is not expected to trigger a new version

To trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/

@github-actions

github-actions Bot commented Dec 8, 2025

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

@github-actions

Copy link
Copy Markdown

Expected version change and release notes

🚨 WARNING: This PR is not expected to trigger a new version

To trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

Copilot AI lite review requested due to automatic review settings July 27, 2026 09:00
@github-actions

Copy link
Copy Markdown

Expected version change and release notes

🚨 WARNING: This PR is not expected to trigger a new version

To trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the emissions visualizations to use line plots by routing emissions-related plot types through the existing MultiLineChart component and adapting MultiLineChart’s series grouping for emissions metrics.

Changes:

  • Switch absoluteEmissions and emissionsIntensity plots in PlotSelector from VerticalBarChart to MultiLineChart.
  • Adjust MultiLineChart data preprocessing to support emissions metrics by remapping the series key via technology.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/components/PlotSelector.tsx Routes emissions plot types to MultiLineChart and removes the unused VerticalBarChart import.
src/components/MultiLineChart.tsx Updates memoized filtering/grouping preparation to support emissions metrics in a line chart.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/MultiLineChart.tsx Outdated
Comment on lines +63 to +67
if (metric == "emissionsIntensity" || metric == "absoluteEmissions") {
filtered = filtered.map((d) => ({ ...d, technology: d.metric }));
}
return filtered;
}, [data.data, sector, metric]);
@AlexAxthelm

Copy link
Copy Markdown
Collaborator

@jacobvjk is this something we can either wrap up or close out?

Copilot AI review requested due to automatic review settings August 17, 2026 13:03
@github-actions

Copy link
Copy Markdown

Expected version change and release notes

🚨 WARNING: This PR is not expected to trigger a new version

To trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

Copilot AI review requested due to automatic review settings August 18, 2026 09:35
@github-actions

Copy link
Copy Markdown

Expected version change and release notes

🚨 WARNING: This PR is not expected to trigger a new version

To trigger a version bump, use at least one conventional commit message in this branch. See: https://www.conventionalcommits.org/en/v1.0.0/

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

src/components/MultiLineChart.tsx:65

  • d3data rewrites technology for absoluteEmissions/emissionsIntensity to collapse into a single series, but selectRef is initialized later from the original data.data technology values. That can leave the initial highlighted series unmatched (nothing selected until the user clicks). Initialize selectRef from d3data instead so it always matches the grouped keys.
      (d) => d.sector === sector && d.metric === metric,
    );
    if (metric == "emissionsIntensity" || metric == "absoluteEmissions") {
      filtered = filtered.map((d) => ({ ...d, technology: d.metric }));
    }

src/components/MultiLineChart.tsx:63

  • Use strict equality checks for metric comparisons to avoid unintended type coercion and to match the rest of the codebase’s === usage.
    if (metric == "emissionsIntensity" || metric == "absoluteEmissions") {

Comment thread src/components/PlotSelector.tsx
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

Expected version change and release notes:

1.16.0-dev.13 (v1.16.0-dev.12...emissions-lineplots ) (2026-08-18T14:40 UTC)

Features

  • use line plots instead of bar charts (00d0980)

Other

  • generate files (c3350b7)
  • improved visibility of info button on comparison page (af796f6)

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

Copilot AI review requested due to automatic review settings August 18, 2026 09:51
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/components/ComparisonPlots.test.tsx:151

  • Same issue as above: without a VerticalBarChart mock that injects data-testid="vertical-bar-chart", this assertion is effectively a no-op and won’t prevent a regression back to bar charts.
    expect(screen.queryByTestId("vertical-bar-chart")).not.toBeInTheDocument();

src/components/ComparisonPlots.test.tsx:147

  • This assertion is no longer meaningful because VerticalBarChart is not mocked (and is no longer imported/rendered by ComparisonPlots). If VerticalBarChart were reintroduced, the real component is unlikely to render data-testid="vertical-bar-chart", so this check would still pass and wouldn’t catch regressions. Either re-add a vi.mock("./VerticalBarChart") that renders a sentinel test id, or remove this assertion.

This issue also appears on line 151 of the same file.

    expect(screen.queryByTestId("vertical-bar-chart")).not.toBeInTheDocument();

Copilot AI review requested due to automatic review settings August 18, 2026 12:40
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/components/ComparisonPlots.tsx:258

  • hoveredSeries is shared across plot types, but it isn't cleared when the user switches plot/geography. Since emissions charts now use externalHoveredSeries too, switching from a technology-based plot (e.g. capacity) can leave a stale hover value (e.g. "Solar") that matches no series in emissions, causing the single emissions line to render dimmed (#ddd) until hover state resets.
      selectedPlot === "emissionsIntensity" ? 0 : Math.min(...allValues);
    return { yMin, yMax };
  }, [entries, selectedPlot, selectedGeography]);

  const [hoveredSeries, setHoveredSeries] = useState<string | null>(null);

AlexAxthelm
AlexAxthelm previously approved these changes Aug 18, 2026
Copilot AI review requested due to automatic review settings August 18, 2026 14:39
@jacobvjk
jacobvjk requested a review from AlexAxthelm August 18, 2026 14:40
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-660.westus2.2.azurestaticapps.net

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@jacobvjk
jacobvjk merged commit 16fdf56 into main Aug 18, 2026
13 checks passed
@jacobvjk
jacobvjk deleted the emissions-lineplots branch August 18, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants