Added data source
This commit is contained in:
parent
c650c0fb66
commit
d5ed60d1ad
12
README.org
12
README.org
|
@ -2,9 +2,11 @@
|
||||||
|
|
||||||
This repository is described in [[https://mishathings.org/2024-08-12-how-much-co2-has-been-emitted-in-my-lifetime.html][this]] blog post.
|
This repository is described in [[https://mishathings.org/2024-08-12-how-much-co2-has-been-emitted-in-my-lifetime.html][this]] blog post.
|
||||||
|
|
||||||
You can find here:
|
To create the graph I used the data behind [[https://ourworldindata.org/grapher/cumulative-co-emissions][this]] graph, which I downloaded [[https://nyc3.digitaloceanspaces.com/owid-public/data/co2/owid-co2-data.csv][here]].
|
||||||
|
|
||||||
- A Jupyter Notebook that produces the graph I describe in the post.
|
This repo contains:
|
||||||
- A html export of that notebook.
|
|
||||||
- The data that the code works with (although it also allows for the fetching of data online)
|
1. A Jupyter Notebook that produces the graph I describe in the post.
|
||||||
- The code that runs on my VPS, which produces this interactive graph: http://mishathings.org:8050/
|
2. A html export of that notebook.
|
||||||
|
3. The data that the code works with (although the code also allows for the fetching of online data)
|
||||||
|
4. The code that runs on my VPS, which produces this interactive graph: http://mishathings.org:8050/
|
||||||
|
|
|
@ -52,7 +52,7 @@ app = dash.Dash(__name__)
|
||||||
|
|
||||||
|
|
||||||
app.layout = html.Div([
|
app.layout = html.Div([
|
||||||
html.P('1. Works best on Desktop 2. Use the slider to adjust the graph 3. Hoover mouse over graph to see (i.a.) the download button', style={'textAlign': 'left'}),
|
html.P('1. Works best on desktop 2. Use the slider to adjust the graph 3. Hoover mouse over graph to see (i.a.) the download button', style={'textAlign': 'left'}),
|
||||||
dcc.Slider(
|
dcc.Slider(
|
||||||
id='year-slider',
|
id='year-slider',
|
||||||
min=min_year,
|
min=min_year,
|
||||||
|
@ -109,7 +109,7 @@ def update_graph(year_born):
|
||||||
fig.add_trace(fig_vline.data[0])
|
fig.add_trace(fig_vline.data[0])
|
||||||
|
|
||||||
|
|
||||||
fig.update_layout(title_text='Percentage of global CO2 emissions since 1750\n occurring in your lifetime (last updated: %s)<br><sub>%s</sub>' % (df['year'].iloc[-1],subtitle),
|
fig.update_layout(title_text='Percentage of global CO2 emissions since 1750 occurring in your lifetime (last updated: %s)<br><sub>%s</sub>' % (df['year'].iloc[-1],subtitle),
|
||||||
xaxis_title="percentage", yaxis_title="year of birth")
|
xaxis_title="percentage", yaxis_title="year of birth")
|
||||||
|
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ def update_graph(year_born):
|
||||||
fig.add_annotation(
|
fig.add_annotation(
|
||||||
text=explainer,
|
text=explainer,
|
||||||
xref="paper", yref="paper",
|
xref="paper", yref="paper",
|
||||||
x=0.95, y=0.95, showarrow=False,
|
x=0.99, y=0.98, showarrow=False,
|
||||||
align="left",
|
align="left",
|
||||||
font=dict(size=16),
|
font=dict(size=16),
|
||||||
bgcolor="lightcoral",
|
bgcolor="lightcoral",
|
||||||
|
|
Loading…
Reference in a new issue