Update app.py
Browse files
app.py
CHANGED
|
@@ -70,7 +70,7 @@ def get_co2_source_bar_plot(year, yaxis):
|
|
| 70 |
continent_abbr = {'Africa': 'AF', 'Asia': 'AS', 'Europe': 'EU', 'North America': 'NA', 'South America': 'SA', 'Oceania': 'OC', 'Antarctica': 'AN'}
|
| 71 |
bar_pipeline = df[(df.year == year) & (df.country.isin(continents_excl_world))].groupby(['year', 'country'])[yaxis].sum().reset_index()
|
| 72 |
bar_pipeline['country'] = bar_pipeline['country'].map(continent_abbr)
|
| 73 |
-
return bar_pipeline.hvplot(kind='bar', x='country', y=yaxis, title='CO2 source by continent', height=
|
| 74 |
|
| 75 |
template = pn.template.FastListTemplate(
|
| 76 |
title='World CO2 Emission Dashboard',
|
|
@@ -83,14 +83,14 @@ template = pn.template.FastListTemplate(
|
|
| 83 |
],
|
| 84 |
main=[
|
| 85 |
pn.Row(
|
| 86 |
-
pn.Column(yaxis_co2, get_co2_plot, margin=(5,
|
| 87 |
pn.Spacer(width=5),
|
| 88 |
-
pn.Column(yaxis_co2_source, get_co2_source_bar_plot, margin=(5,
|
| 89 |
),
|
| 90 |
pn.Row(
|
| 91 |
-
pn.Column(get_co2_vs_gdp_scatterplot, margin=(5,
|
| 92 |
pn.Spacer(width=5),
|
| 93 |
-
pn.Column(get_co2_table, margin=(5,
|
| 94 |
)
|
| 95 |
],
|
| 96 |
accent_base_color="#88d8b0",
|
|
|
|
| 70 |
continent_abbr = {'Africa': 'AF', 'Asia': 'AS', 'Europe': 'EU', 'North America': 'NA', 'South America': 'SA', 'Oceania': 'OC', 'Antarctica': 'AN'}
|
| 71 |
bar_pipeline = df[(df.year == year) & (df.country.isin(continents_excl_world))].groupby(['year', 'country'])[yaxis].sum().reset_index()
|
| 72 |
bar_pipeline['country'] = bar_pipeline['country'].map(continent_abbr)
|
| 73 |
+
return bar_pipeline.hvplot(kind='bar', x='country', y=yaxis, title='CO2 source by continent', height=300, width=400, xlabel='Continent', fontscale=0.7, margin=(0, 0, 0, 0))
|
| 74 |
|
| 75 |
template = pn.template.FastListTemplate(
|
| 76 |
title='World CO2 Emission Dashboard',
|
|
|
|
| 83 |
],
|
| 84 |
main=[
|
| 85 |
pn.Row(
|
| 86 |
+
pn.Column(yaxis_co2, get_co2_plot, margin=(0, 5, 0, 5)),
|
| 87 |
pn.Spacer(width=5),
|
| 88 |
+
pn.Column(yaxis_co2_source, get_co2_source_bar_plot, margin=(0, 5, 0, 5))
|
| 89 |
),
|
| 90 |
pn.Row(
|
| 91 |
+
pn.Column(get_co2_vs_gdp_scatterplot, margin=(0, 5, 0, 5)),
|
| 92 |
pn.Spacer(width=5),
|
| 93 |
+
pn.Column(get_co2_table, margin=(0, 5, 0, 5))
|
| 94 |
)
|
| 95 |
],
|
| 96 |
accent_base_color="#88d8b0",
|