-
Notifications
You must be signed in to change notification settings - Fork 1
/
BioEnergy.py
208 lines (201 loc) · 6.23 KB
/
BioEnergy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
from dash import html
from dash import dcc
import dash_bootstrap_components as dbc
import pandas as pd
from dash import dash_table
bioEnergy_df = pd.read_excel("Data/Bioenergy quantification.xlsx")
bio_table = dash_table.DataTable(
data=bioEnergy_df.to_dict("records"),
style_table={
'width': '100%',
'margin': '0 0 0 0px',
'padding': '0 0px',
'overflowX': 'auto',
'overflowY': 'auto',
},
style_header={
"backgroundColor": "rgb(30, 30, 30)",
"fontWeight": "bold",
"marginLeft": 0,
"textAlign": "center",
"font-family": "Calibri",
'whiteSpace': 'normal'
},
style_cell={
"backgroundColor": "rgb(50, 50, 50)",
"color": "white",
"textAlign": "left",
"fontSize": 17,
"font-family": "Calibri",
"height": "auto",
"overflow": "hidden",
"textOverflow": "ellipsis",
},
style_data={
"whiteSpace": "pre-line"
},
css=[
{
"selector": ".dash-cell div.dash-cell-value",
"rule": "display: inline; white-space: inherit; overflow: inherit; text-overflow: inherit;",
}
],
virtualization=False,
page_action="none",
columns=[{"name": i, "id": i} for i in bioEnergy_df.columns],
editable=False,
style_cell_conditional=(
[
{"if": {"column_id": "Country"}, "width": "6%"},
{"if": {"column_id": "Bioenergy potential"}, "width": "11%"},
{"if": {"column_id": "Experience with bioenergy"}, "width": "41.5%"},
{"if": {"column_id": "Bioenergy potential"}, "width": "41.5%"},
]
),
style_data_conditional=[
{
"if": {
"filter_query": "{Potentials} = High",
"column_id": [
"Potentials",
"Observed hot spring temperature",
"Geothermal investigations",
"Known geothermal locations",
"Youngest volcanism",
"Country",
],
},
"backgroundColor": "red",
"fontWeight": "bold",
"color": "black",
},
{
"if": {
"filter_query": "{Potentials} = Moderate-to-High",
"column_id": [
"Potentials",
"Observed hot spring temperature",
"Geothermal investigations",
"Known geothermal locations",
"Youngest volcanism",
"Country",
],
},
# 'textDecoration': 'underline',
"backgroundColor": "#FE4C40",
"color": "black",
},
{
"if": {
"filter_query": "{Potentials} = Moderate",
"column_id": [
"Potentials",
"Observed hot spring temperature",
"Geothermal investigations",
"Known geothermal locations",
"Youngest volcanism",
"Country",
],
},
"backgroundColor": "tomato",
"color": "black",
},
{
"if": {
"filter_query": "{Potentials} = Low-to-Moderate",
"column_id": [
"Potentials",
"Observed hot spring temperature",
"Geothermal investigations",
"Known geothermal locations",
"Youngest volcanism",
"Country",
],
},
"backgroundColor": "#FFAE42",
"color": "black",
},
{
"if": {
"filter_query": "{Potentials} = Low",
"column_id": [
"Potentials",
"Observed hot spring temperature",
"Geothermal investigations",
"Known geothermal locations",
"Youngest volcanism",
"Country",
],
},
"backgroundColor": "#F1E788",
"color": "black",
},
{
"if": {
"filter_query": "{Potentials} = Extremely-Low",
"column_id": [
"Potentials",
"Observed hot spring temperature",
"Geothermal investigations",
"Known geothermal locations",
"Youngest volcanism",
"Country",
],
},
"backgroundColor": "#FFFF9F",
"color": "black",
},
],
)
bio = [
dbc.CardHeader(html.H5("Bioenergy Potential")),
dbc.CardBody(
[
dcc.Loading(
id="loading-sankey",
children=[
dbc.Alert(
"Something's gone wrong! Give us a moment, but try loading this page again if problem persists.",
id="no-data-alert-sankey",
color="warning",
style={"display": "none"},
),
html.Label(
[
html.A(
"Overview of the bioenergy potential in all pacific island countries"
)
]
),
dbc.Row([dbc.Col(bio_table)]),
html.Label(
[
"",
html.A(
"Source: Country Profiles, IRENA",
href="https://www.irena.org/Statistics/Statistical-Profiles",
),
]
),
html.Br(),
],
type="default",
)
],
style={"marginTop": 0, "marginBottom": 0},
),
]
BODY = dbc.Container(
[
dbc.Row(
[
dbc.Col(dbc.Card(bio)),
],
style={
"marginTop": 30,
},
),
],
fluid=True,
)
content = [BODY]