Skip to content

Commit f468adb

Browse files
committed
Fix font and formatting
1 parent c4ad3e8 commit f468adb

File tree

4 files changed

+53
-20
lines changed

4 files changed

+53
-20
lines changed

requirements1.txt

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ subgrounds<1.7
1111
werkzeug<2.1.0
1212
circlify==0.14.0
1313
matplotlib==3.5.2
14-
plotly==5.7.0
1514
kaleido==0.2.1
1615
dash==2.14.2
1716

requirements2.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
plotly==5.20.0
12
prefect==2.12.0
23
prefect-aws==0.3.7
34
pyarrow==12.0.0

src/apps/treasury/assets/custom.css

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
/* Set the default font to Poppins regular*/
1515
*{
1616
font-family: 'Poppins', sans-serif;
17+
margin:0;
18+
padding:0;
1719
}
1820

1921
.card_topic{
@@ -49,10 +51,6 @@
4951
height:60px;
5052
}
5153

52-
*{
53-
margin:0;
54-
padding:0;
55-
}
5654
body{
5755
font-family: 'Poppins', sans-serif;
5856
line-height:1.2;

src/apps/treasury/pages/hud.py

+50-15
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@
2222
# last_metric_df = sg.query_df([last_metric.marketCap, last_metric.treasuryMarketValue, ...])
2323

2424
# Market Cap indicator
25-
mc_fig = go.Figure(
25+
metric_fig = go.Figure(
2626
go.Indicator(
2727
mode="number",
2828
value=sg.query([last_metric.marketCap]),
2929
number={"prefix": "$", "valueformat": ".2s"},
3030
title={"text": "Market Cap"},
31-
domain={'y': [0, 1], 'x': [0.25, 0.75]}
32-
)
31+
domain={'y': [0, 0.5], 'x': [0.25, 0.75]}
32+
),
3333
)
3434

35-
# Net Asset Value / Total Treasury Value ($) indicator
36-
nav_fig = go.Figure(
35+
metric_fig.add_trace(
36+
# Net Asset Value / Total Treasury Value ($) indicator
3737
go.Indicator(
3838
mode="number",
3939
value=sg.query([last_metric.treasuryMarketValue]),
4040
number={"prefix": "$", "valueformat": ".2s"},
4141
title={"text": "Net Asset Value"},
42-
domain={'y': [0, 1], 'x': [0.25, 0.75]}
42+
domain={'y': [0.5, 1], 'x': [0.25, 0.75]}
4343
)
4444
)
4545

@@ -116,8 +116,12 @@
116116
{"bucket": "Treasury Holdings", "value": treasury_value, "target": 0.48}
117117
]
118118
green_ratio_df = pd.DataFrame.from_records(green_ratio_data)
119+
order = [
120+
'Op Ex', 'Carbon Forwards',
121+
'Carbon Backing', 'Treasury Holdings'
122+
]
123+
119124

120-
# TODO: style colors based on KIP
121125
# TODO: style holdings as $xx.yy[m/k] (i.e. human-formatted like indicators)
122126
# TODO: visualize targets in some way
123127
# TODO: load targets from Google Sheet for ease of maintenance
@@ -129,23 +133,54 @@
129133
'Carbon Forwards': '#6fff93',
130134
'Carbon Backing': '#00cc33',
131135
'Treasury Holdings': '#ddf641'
132-
}
136+
},
137+
category_orders={'bucket': order},
138+
title="Green Ratio: Current",
139+
)
140+
green_ratio_fig.update_layout(
141+
title_x=0.5,
142+
legend=dict(
143+
yanchor='bottom',
144+
y=-.5,
145+
xanchor='auto',
146+
x=.5
147+
)
133148
)
134149

135-
# target_indicators =
150+
green_ratio_target_fig = px.pie(
151+
green_ratio_df, values="target",
152+
names="bucket", hole=.3, color="bucket",
153+
color_discrete_map={
154+
'Op Ex': '#f2ae00',
155+
'Carbon Forwards': '#6fff93',
156+
'Carbon Backing': '#00cc33',
157+
'Treasury Holdings': '#ddf641'
158+
},
159+
category_orders={'bucket': order},
160+
title="Green Ratio: Target",
161+
)
162+
green_ratio_target_fig.update_layout(
163+
title_x=0.5,
164+
legend=dict(
165+
yanchor='bottom',
166+
y=-.5,
167+
xanchor='auto',
168+
x=.5
169+
)
170+
)
136171

137172
layout = dbc.Container([
138173
html.Div([
139174
dbc.Row([
140175
dbc.Col([
141-
dcc.Graph(figure=mc_fig)
142-
], xs=12, sm=12, md=12, lg=3, xl=3),
143-
dbc.Col([
144-
dcc.Graph(figure=nav_fig)
145-
], xs=12, sm=12, md=12, lg=3, xl=3),
176+
dcc.Graph(figure=metric_fig)
177+
], xs=12, sm=12, md=12, lg=4, xl=4),
146178
dbc.Col([
147179
dcc.Graph(figure=green_ratio_fig)
148-
], xs=12, sm=12, md=12, lg=6, xl=6),
180+
], xs=12, sm=6, md=6, lg=4, xl=4),
181+
dbc.Col([
182+
dcc.Graph(figure=green_ratio_target_fig)
183+
], xs=12, sm=6, md=6, lg=4, xl=4)
149184
]),
150185
], className='center'),
151186
], id='page_content_hud', fluid=True)

0 commit comments

Comments
 (0)