# Project export: CarbonInsight: Guiding Companies to Net-zero

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: TreeHacks 2024
- Tagline: Using supply and demand projections, our software advises companies on the tradeoff between decarbonizing their existing business practices and offsetting emissions through carbon credit purchasing.
- Devpost: https://devpost.com/software/carbon-price-curves
- GitHub: https://github.com/lfun1/carbon-price-curves/
- Result: winner (Stanford Ecopreneurship: Best Incorporation of Broader Stakeholders ($1k Cash))
- Team: 2 GitHub contributor(s) — Elias Chikwanda (19 commits), Lisa Fung (18 commits)

## Devpost submission (written by the team)

### Inspiration

As the imperative to reduce carbon emissions intensifies, businesses are increasingly adopting innovative approaches to shrink their carbon footprint. One such approach, carbon offsetting, has grown into a $5.5 billion industry, garnering support from both fossil fuel companies and environmental advocates alike. Rather than curbing emissions directly at their source, carbon offsets mitigate carbon pollution by either preventing potential emissions or directly extracting carbon dioxide from the atmosphere, often employing technologies such as carbon capture and storage (CCS) or direct air capture (DAC). Presently, numerous critical sectors—such as the aviation industry—face challenges in achieving decarbonization due to financial constraints, material limitations, and a lack of innovative solutions. As such, the combination of decarbonization strategies and carbon offsetting is often the most economical; by reducing easily avoidable emissions and offsetting the rest, companies can achieve net-zero emissions without the financial pressures of complete emissions reductions. However, there are three existing barriers to achieving this diversified net-zero strategy. First, reducing emissions is often a lengthy process, often taking years to decarbonize key components of a company’s business model fully. Second, reducing low-cost emissions is dependent on the equilibrium price of carbon offset—a price that often needs to be calculated far in advance to successfully execute decarbonization. Third, the financial tradeoff between the price of offsets and emissions reductions is blurry, with no clear brightline between offset and reduced emissions. What does our project do? Our product solves these issues by providing key insights about decarbonization strategy through forward pricing curves for carbon offsets. By calculating the expected demand and supply of carbon offsets for a given time in the future, the market equilibrium—the going price of carbon offsets at that time—can be estimated and given to the user in the present. Our results are displayed on a website dashboard. Our project contains two central components: the market price of carbon credits over time, based on calculated demand and supply curves, and a carbon-zero pathway based on these curves (based on user inputs and other external data). The demand and supply curves are generated for each year until the user’s target year, this allows them to see how the market changes year-by-year, allowing them to optimize their offset buying distribution over a certain period. The carbon-zero pathway allows After inputting information about a company’s carbon footprint, emissions targets, and the marginal cost of abatement, financial metrics about the best carbon-zero path are computed. The output of this function relies on market equilibrium outputs only available after computing the forward price curves. The output gives the user valuable information about the percentage breakdown between decarbonized emission reductions and credit offsets, and the financial projections of both strategies. This tool, importantly, allows companies to see how the market price of carbon credits changes over time based on user-given inputs such as the type of carbon removal technology, the year of their net-zero goal, and the scope of emissions they are considering. This tool emphasizes the importance of decarbonization by reorienting the goal of maximizing profits towards environmental advocacy. This is key in assisting companies plan their emissions-reduction strategy in the most economical way—two priorities that have often been at odds with each other. How we built our project We built all of our projection models in Python and used the Reflex framework to display our outputs in a user dashboard. Each of the three system functions—the demand curve, supply curve, and decarbonization-offset tradeoff scheme—are integrated into the user dashboard, with various inputs related to the computation of the base futures curve model and tradeoff model being imputed as fields. Each of the three system functions are described below: The demand curve uses the emissions profiles of the top 2,000 largest companies in the world to project their future carbon emissions based on their emissions reduction goals. Using generated GICS sector data for industry-specific emissions—combined with company revenue—we project yearly emissions—including scope 1, 2, and 3 emissions—depending on carbon reduction goals. Using an exponential Pareto distribution—tuned to represent companies buying offsets closer to their consumption date—we generalize the year-to-year demand for carbon permits on a per-company basis. This data returns the expected demand for carbon credits per year for a theoretical global market. Using this data, combined with decarbonization prices generalized from half-normal, sector-level decarbonization costs, our model produces the expected carbon demand for a given period for each company. As each company faces a different cost of decarbonizing their business, the marginal benefit of each company is unique. We fit a demand curve to these projected quantity and price demands from individual companies using polynomial regressions from this data. This process is done for each year in the model. The supply curve is interpolated from the technology pathway of the carbon credit and price range. Based on our research, most companies pay anywhere from $50/ton CO2 to $700/ton CO2 for a range of carbon credits. This data is combined with the cost of implementing the selected pathway for a single ton of CO2 and the ranking of the industries based on their relative CO2 emissions. A coefficient is calculated on these values that inform the supply curve on the scale of 50$/tCO2 to 700$/tCO2. We create a supply curve for each year until the user-specified target year with the values being adjusted for the following years accordingly. The decarbonization-offset tradeoff graph is produced by mapping another exponential Pareto distribution to the marginal cost of reducing carbon emissions. The resulting intersection of the market price of carbon offsets for a given year with the CDF returns the percentage of total emissions for which it is more economical to reduce the production of emissions over buying offsets, and vice versa. The total cost associated with purchasing carbon offsets, alongside the quantity, can be calculated for a given company’s carbon footprint.

### Challenges we ran into

The biggest challenge we ran into was the lack of data for building the supply curves. One way in which we handled this was by taking data corresponding to the maximum and minimum prices, as well as the range of carbon credits companies were buying in bulk. We used these to generate a pseudo-supply curve that would allow us to reasonably estimate the curve as if we had the data. We expect this problem to be solved as more data becomes available.

### What we learned

and accomplished We learned a lot about time-series analysis, data analysis, and synthesizing, as well as how to use Reflex to implement our website. We made a working model and website on a project that aimed to encapsulate the entire carbon credits market for the next few decades.

### What's next

for CarbonInsights Short Term: The biggest thing we would like to change is to make the website dynamically update. Although the models we wrote are perfectly suited to update dynamically, the Reflex framework we are using has made that difficult. Long Term: Improve the statistical models to create the projection for the supply-demand curves and use ARIMA, ETS, and ML models like Random Forests to validate and provide a more detailed analysis of the trends.

## README (from the GitHub repository)

# CarbonInsight: Guiding Companies to Net-zero
### Using supply and demand projections, our software advises companies on the tradeoff between decarbonizing their existing business practices and offsetting emissions through carbon credit purchasing.

By Lisa Fung, Elias Chikwanda, Rudraksh Mohapatra, Sam Jonker

Devpost: https://devpost.com/software/carbon-price-curves

<img width="868" alt="dashboard" src="https://github.com/lfun1/carbon-price-curves/assets/71937811/b9cbc13e-7b71-43ce-87ec-d87e4b60fbd4">

## Inspiration

As the imperative to reduce carbon emissions intensifies, businesses are increasingly adopting innovative approaches to shrink their carbon footprint. One such approach, carbon offsetting, has grown into a [$5.5 billion industry](https://journals.library.columbia.edu/index.php/cjel/article/view/10442), garnering support from both fossil fuel companies and environmental advocates alike. Rather than curbing emissions directly at their source, carbon offsets mitigate carbon pollution by either preventing potential emissions or directly extracting carbon dioxide from the atmosphere, often employing technologies such as carbon capture and storage (CCS) or direct air capture (DAC). Presently, numerous critical sectors—such as the aviation industry—face challenges in achieving decarbonization due to financial constraints, material limitations, and a lack of innovative solutions. **As such, the combination of decarbonization strategies and carbon offsetting is often the most economical; by reducing easily avoidable emissions and offsetting the rest, companies can achieve net-zero emissions without the financial pressures of complete emissions reductions.**

However, there are three existing barriers to achieving this diversified net-zero strategy. First, reducing emissions is often a lengthy process, often taking years to decarbonize key components of a company’s business model fully. Second, reducing low-cost emissions is dependent on the equilibrium price of carbon offset—a price that often needs to be calculated far in advance to successfully execute decarbonization. Third, the financial tradeoff between the price of offsets and emissions reductions is blurry, with no clear brightline between offset and reduced emissions. 

## What does our project do?
Our product solves these issues by providing key insights about decarbonization strategy through forward pricing curves for carbon offsets. By calculating the expected demand and supply of carbon offsets for a given time in the future, the market equilibrium—the going price of carbon offsets at that time—can be estimated and given to the user in the present. Our results are displayed on a website dashboard. 

Our project contains two central components: the market price of carbon credits over time, based on calculated demand and supply curves, and a carbon-zero pathway based on these curves (based on user inputs and other external data). The demand and supply curves are generated for each year until the user’s target year, this allows them to see how the market changes year-by-year, allowing them to optimize their offset buying distribution over a certain period. The carbon-zero pathway allows 

After inputting information about a company’s carbon footprint, emissions targets, and the marginal cost of abatement, financial metrics about the best carbon-zero path are computed. The output of this function relies on market equilibrium outputs only available after computing the forward price curves. The output gives the user valuable information about the percentage breakdown between decarbonized emission reductions and credit offsets, and the financial projections of both strategies. 

This tool, importantly, allows companies to see how the market price of carbon credits changes over time based on user-given inputs such as the type of carbon removal technology, the year of their net-zero goal, and the scope of emissions they are considering. This tool emphasizes the importance of decarbonization by reorienting the goal of maximizing profits towards environmental advocacy. This is key in assisting companies plan their emissions-reduction strategy in the most economical way—two priorities that have often been at odds with each other. 

## How we built our project 
We built all of our projection models in Python and used the Reflex framework to display our outputs in a user dashboard. Each of the three system functions—the demand curve, supply curve, and decarbonization-offset tradeoff scheme—are integrated into the user dashboard, with various inputs related to the computation of the base futures curve model and tradeoff model being imputed as fields. Each of the three system functions are described below: 

The demand curve uses the emissions profiles of the top 2,000 largest companies in the world to project their future carbon emissions based on their emissions reduction goals. Using generated GICS sector data for industry-specific emissions—combined with company revenue—we project yearly emissions—including scope 1, 2, and 3 emissions—depending on carbon reduction goals. Using an exponential Pareto distribution—tuned to represent companies buying offsets closer to their consumption date—we generalize the year-to-year demand for carbon permits on a per-company basis. This data returns the expected demand for carbon credits per year for a theoretical global market. Using this data, combined with decarbonization prices generalized from half-normal, sector-level decarbonization costs, our model produces the expected carbon demand for a given period for each company. As each company faces a different cost of decarbonizing their business, the marginal benefit of each company is unique. We fit a demand curve to these projected quantity and price demands from individual companies using polynomial regressions from this data. This process is done for each year in the model. 

The supply curve is interpolated from the technology pathway of the carbon credit and price range. Based on our research, most companies pay anywhere from $50/ton CO2 to $700/ton CO2 for a range of carbon credits. This data is combined with the cost of implementing the selected pathway for a single ton of CO2 and the ranking of the industries based on their relative CO2 emissions. A coefficient is calculated on these values that inform the supply curve on the scale of 50$/tCO2 to 700$/tCO2.  We create a supply curve for each year until the user-specified target year with the values being adjusted for the following years accordingly. 

The decarbonization-offset tradeoff graph is produced by mapping another exponential Pareto distribution to the marginal cost of reducing carbon emissions. The resulting intersection of the market price of carbon offsets for a given year with the CDF returns the percentage of total emissions for which it is more economical to reduce the production of emissions over buying offsets, and vice versa. The total cost associated with purchasing carbon offsets, alongside the quantity, can be calculated for a given company’s carbon footprint. 

## Challenges we ran into
The biggest challenge we ran into was the lack of data for building the supply curves. One way in which we handled this was by taking data corresponding to the maximum and minimum prices, as well as the range of carbon credits companies were buying in bulk. We used these to generate a pseudo-supply curve that would allow us to reasonably estimate the curve as if we had the data. We expect this problem to be solved as more data becomes available.



## What we learned and accomplished
We learned a lot about time-series analysis, data analysis, and synthesizing, as well as how to use Reflex to implement our website.  We made a working model and website on a project that aimed to encapsulate the entire carbon credits market for the next few decades. 

## What's next for CarbonInsights

Short Term: The biggest thing we would like to change is t

[README truncated for size]

## Detected evidence (automated analysis)

Indexed codebase: 15 recognized source files, 51 KB.
- Python (language) — detected in the code

## Codebase structure (from repository index)

### Files (23 of 23)

```
.gitignore
carbon_price_curves/.DS_Store
carbon_price_curves/.gitignore
carbon_price_curves/assets/cdr_data_test.csv
carbon_price_curves/assets/default_supply.csv
carbon_price_curves/assets/demand_market_2024_v2.csv
carbon_price_curves/assets/static_market_prices.csv
carbon_price_curves/carbon_price_curves/__init__.py
carbon_price_curves/carbon_price_curves/carbon_price_curves.py
carbon_price_curves/carbon_price_curves/components/__init__.py
carbon_price_curves/carbon_price_curves/components/sidebar.py
carbon_price_curves/carbon_price_curves/pages/__init__.py
carbon_price_curves/carbon_price_curves/pages/dashboard.py
carbon_price_curves/carbon_price_curves/pages/index.py
carbon_price_curves/carbon_price_curves/pages/models.py
carbon_price_curves/carbon_price_curves/pages/settings.py
carbon_price_curves/carbon_price_curves/styles.py
carbon_price_curves/carbon_price_curves/templates/__init__.py
carbon_price_curves/carbon_price_curves/templates/template.py
carbon_price_curves/README.md
carbon_price_curves/requirements.txt
carbon_price_curves/rxconfig.py
README.md
```

### Dependencies

- carbon_price_curves/requirements.txt: matplotlib@==3.8.3, openpyxl@==3.1.2, pip@==23.2.1, plotly@==5.19.0, reflex@==0.4.0, statsmodels@==0.14.1

### Recent commits (newest first)

- Update README.md with photo
- Update README.md
- Last Update
- Completed Tree Hacks Project
- Finals done
- Add comparison
- Add cdf
- Updated files
- Project prototype complete
- Add models
- Models update
- lll
- Add demand ref data
- Styled the page
- Added a final graph
- Add well-formatted market prices
- Merge branch 'main' of https://github.com/lfun1/carbon-price-curves
- Add market prices
- Graph templates created
- Made some changes to the form

## Key source files (fetched from GitHub, selected and truncated for size)

### carbon_price_curves/requirements.txt

```
matplotlib==3.8.3
openpyxl==3.1.2
pip==23.2.1
plotly==5.19.0
reflex==0.4.0
statsmodels==0.14.1

```

### carbon_price_curves/carbon_price_curves/pages/index.py

```python
"""The home page of the app."""
import plotly.graph_objects as go
from carbon_price_curves import styles
from carbon_price_curves.templates import template
from typing import List
import reflex as rx
from functools import partial
from .models import supply_model
from .models import demand_model
from .models import comparison

# Added for graph
import plotly.express as px
import pandas as pd

options_1: List[str] = ["Technology", "Manufacturing", "Retail", "Finance", "Oil/Gas", "Other"]
# options_2: List[str] = ["2_Option 1", "2_Option 2", "2_Option 3"]
# options_3: List[str] = ["3_Option 1", "3_Option 2", "3_Option 3"]
# options_4: List[str] = ["4_Option 1", "4_Option 2", "4_Option 3"]
per_x_data = [1,3,4,5,6,7,8,7,9]
per_y_data = [1,3,4,5,6,7,8,7,9]

# Added for graph
df_test = pd.read_csv('assets/cdr_data_test.csv')
df_supply_2024 = pd.read_csv('assets/default_supply.csv')
df_demand_market = pd.read_csv('assets/demand_market_2024_v2.csv')
df_price_years = pd.read_csv('assets/static_market_prices.csv')



df_supply = supply_model(2050, "tech", "Biochar")

modelInputs = {
    "modelLength": 10, # gives us actual year
    "scope1":1,
    "scope2":1,
    "scope3":1,
}

scenarioInputs = {
    "industry":"Technology",
    "goal_year":"2045", #yes
    "goal_red":"-53", #yes
    "bio_char":"on",
    "mineralization":"on",
    "cur_emission":"434",
    "market_price":"434",
    "company_price":"54", #yes
}

df_demand = demand_model('assets/demand_ref_data.xlsx',2.6,3.7,1.7,modelInputs,scenarioInputs)

# fixed values
totalEmissions = 200000000
maxDecarbonizationPrice = 140
baselineDecarbonizationPrice = 30
eq_price = df_price_years.iloc[2,1]

df_comp, x, y, z = comparison(totalEmissions,maxDecarbonizationPrice,baselineDecarbonizationPrice,eq_price)

def update_graphs() -> rx.Component:
    fig_test = px.line(
        df_test,
        x="CDR Purchases",
        y="Total Sales",
        title="Global total carbon dioxide removal sales 2020-2023",
    )

    fig_supply_2024 = px.line(
        df_supply_2024,
        x="Quantiy",
        y="Price",
        title="Carbon Credits Market 2024",
    )

    fig_demand_market = px.line(
        df_demand_market,
        x="Quantiy",
        y="Price",
    )

    fig_price_years = px.line(
        df_price_years,
        x="Year", # Change back to Year.
        y="Price", # Change back to Price.
    )

    fig_comp1 = go.Figure()
    fig_comp1.add_trace(go.Scatter(x=df_comp["x"], y=df_comp["y"], mode='lines+markers', name='comparison'))
    fig_comp1.add_trace(go.Scatter(x=[0,1], y=[eq_price, eq_price], mode='lines', name='horizontal line'))

    fig_market = go.Figure()
    fig_market.add_trace(go.Scatter(x=df_supply["Quantity"], y=df_supply["Price"], mode='lines+markers', name='Supply'))
    fig_market.add_trace(go.Scatter(x=df_demand["Quantity"], y=df_demand["Price"], mode='lines+markers', name='Demand'))
    fig_market.update_layout(title='Supply and Demand of Carbon Credit Market',
                             xaxis_title='Quantity',
                             yaxis_title='Price',
                             xaxis=dict(range=[0, 3000000000]))

    fig_price_perC02 = go.Figure()
    fig_price_perC02.add_trace(go.Scatter(x=per_x_data, y=per_y_data, mode='lines+markers', name='Data'))
    fig_price_perC02.update_layout(title='Plot from Two Arrays',xaxis_title='Percentage of Carbon',yaxis_title='Price')
    combined_fig = go.Figure()

    # Add traces from fig_supply_2024 to the new figure
    for trace in fig_supply_2024.data:
        combined_fig.add_trace(trace)

    # Add traces from fig_demand_market to the new figure
    for trace in fig_demand_market.data:
        combined_fig.add_trace(trace)

    # Update layout from fig_supply_2024
    combined_fig.update_layout(fig_supply_2024.layout)

    #Custom x-axis limit.
    combined_fig.update_layout(xaxis=dict(range=[0, 3000000000]))

    graph_market_2024 : rx.Component = rx.chakra.vstack(
        rx.chakra.heading("Estimated Carbon Credit Demand per Year (2024-2052)"),
        rx.plotly(data=fig_price_years, height="400px"),
        rx.text(
            "This graph presents the estimated quantity of carbon credits\n"
            "demanded from 2024 to 2032, by aggregating the projected emissions\n"
            "reductions targets of the largest 2,000 global companies. The data\n"
            "provides valuable insights into the evolving landscape of carbon\n"
            "trading, aiding in strategic decision-making and climate mitigation\n"
            "efforts.Projected Supply and Demand Curves (2032). The projected supply\n"
            "and demand curves represent the projected market supply and demand for 2032.\n"
            "The projected demand curve uses a polynomial regression to interpolate the market\n"
            "demand comprised of individual companies’ marginal benefit curves. The projected supply\n"
            "curve generalizes the marginal cost of different carbon dioxide removal pathways\n"
            "projected to the future.\n",
            padding="20px",
        ),
        # rx.plotly(data=combined_fig, height="400px"),
        rx.chakra.heading("Projected Supply and Demand Curves (2032)"),
        rx.plotly(data=fig_market, height="400px"),
        rx.text(
            "The projected supply and demand curves represent the projected market supply and demand for"
            "2032. The projected demand curve uses a polynomial regression to interpolate the market demand "
            "comprised of individual companies’ marginal benefit curves. The projected supply curve generalizes "
            "the marginal cost of different carbon dioxide removal pathways projected to the future.",
            padding="20px",
        ),
        rx.chakra.heading("Decarbonization-Offset Tradeoff (2032)"),
        rx.plotly(data=fig_comp1, height="400px"),
        rx.text(
            "The decarbonization-offset tradeoff graph represents the distribution between reducing net-zero"
       
[truncated — 12632 more characters]
```

### carbon_price_curves/rxconfig.py

```python
import reflex as rx

config = rx.Config(
    app_name="carbon_price_curves",
    telemetry_enabled=False,
)
```

### carbon_price_curves/carbon_price_curves/__init__.py

```python
"""Base template for Reflex."""

```

### carbon_price_curves/carbon_price_curves/carbon_price_curves.py

```python
"""Welcome to Reflex!."""

from carbon_price_curves import styles
import reflex as rx

# Import all the pages.
from carbon_price_curves.pages import *

import reflex as rx


class State(rx.State):
    """Define empty state to allow access to rx.State.router."""

# Create the app.
app = rx.App(style=styles.base_style)

```

### carbon_price_curves/carbon_price_curves/styles.py

```python
"""Styles for the app."""

import reflex as rx

border_radius = "0.375rem"
box_shadow = "0px 0px 0px 1px rgba(84, 82, 95, 0.14)"
border = "1px solid #F4F3F6"
text_color = "black"
accent_text_color = "#1A1060"
accent_color = "#F5EFFE"
hover_accent_color = {"_hover": {"color": accent_color}}
hover_accent_bg = {"_hover": {"bg": accent_color}}
content_width_vw = "90vw"
sidebar_width = "20em"

template_page_style = {"padding_top": "1.5em", "padding_x": ["auto", "2em"], "flex": "1"}

template_content_style = {
    "align_items": "flex-start",
    "box_shadow": box_shadow,
    "border_radius": border_radius,
    "padding": "1em",
    "margin_bottom": "2em",
    "height":"100%",
}

link_style = {
    "color": text_color,
    "text_decoration": "none",
    **hover_accent_color,
}

overlapping_button_style = {
    "background_color": "white",
    "border": border,
    "border_radius": border_radius,
}

base_style = {
    rx.chakra.MenuButton: {
        "width": "3em",
        "height": "3em",
        **overlapping_button_style,
    },
    rx.chakra.MenuItem: hover_accent_bg,
}

markdown_style = {
    "code": lambda text: rx.chakra.code(text, color="#1F1944", bg="#EAE4FD"),
    "a": lambda text, **props: rx.chakra.link(
        text,
        **props,
        font_weight="bold",
        color="#03030B",
        text_decoration="underline",
        text_decoration_color="#AD9BF8",
        _hover={
            "color": "#AD9BF8",
            "text_decoration": "underline",
            "text_decoration_color": "#03030B",
        },
    ),
}

```

### carbon_price_curves/carbon_price_curves/templates/__init__.py

```python
from .template import template

```

### carbon_price_curves/carbon_price_curves/pages/__init__.py

```python
from .dashboard import dashboard
from .index import index
from .settings import settings

```

### carbon_price_curves/carbon_price_curves/pages/settings.py

```python
"""The settings page."""

from carbon_price_curves.templates import template

import reflex as rx


@template(route="/settings", title="Settings")
def settings() -> rx.Component:
    """The settings page.

    Returns:
        The UI for the settings page.
    """
    return rx.chakra.vstack(
        rx.chakra.heading("Settings", font_size="3em"),
        rx.chakra.text("Welcome to Reflex!"),
        rx.chakra.text(
            "You can edit this page in ",
            rx.chakra.code("{your_app}/pages/settings.py"),
        ),
    )

```

### carbon_price_curves/carbon_price_curves/pages/dashboard.py

```python
"""The dashboard page."""
from carbon_price_curves.templates import template

import reflex as rx
import plotly.express as px
import pandas as pd

@template(route="/dashboard", title="Dashboard")
def dashboard() -> rx.Component:
    """The dashboard page.

    Returns:
        The UI for the dashboard page.
    """

    # df = px.data.gapminder().query("country=='Canada'")
    df = pd.read_csv('assets/cdr_data_test.csv')

    fig = px.line(
        df,
        x="CDR Purchases",
        y="Total Sales",
        title="Global total carbon dioxide removal sales 2020-2023",
    )

    graph : rx.Component = rx.chakra.vstack(
        rx.chakra.text("Global total carbon dioxide removal sales 2020-2023"),
        rx.plotly(data=fig, height="400px"),
    )

    year_slider : rx.Component = slider_year_on_change()

    return rx.chakra.vstack(
        rx.chakra.heading("Carbon Credits Forecast", font_size="3em", padding="25px",),
        rx.box(
            year_slider,
            width="100%",
            padding="25px",
        ),
        rx.box(
            graph,
            width="60%",
        ),
        width="100%",
    )

# Year Slider
class SliderYearState(rx.State):
    year: int = 2024

    def set_year(self, yr: int):
        self.year = yr

def slider_year_on_change() -> rx.Component:
    return rx.vstack(
        rx.heading("Year: ", SliderYearState.year, align="center"),
        rx.slider(
            default_value = 2030,
            min=2024,
            max=2050,
            step=1,
            on_change=SliderYearState.set_year,
            width="100%",
        ),
        width="100%",
    )
```

[3 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]