Skip to content

Commit 41709aa

Browse files
Update figure size
1 parent c111584 commit 41709aa

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/app.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@
2727
"left": 0,
2828
"bottom": 0,
2929
"width": "20rem",
30-
"padding": "2rem 1rem",
3130
"z-index": 4000000,
3231
'background-color': 'rgba(255,255,255,.25)'
3332

3433
}
3534

3635
CONTENT_STYLE = {
3736
"margin-left": "20rem",
38-
"margin-right": "2rem",
3937
"z-index": -1,
4038
}
4139
# Structure of app, including selection criteria components
@@ -49,7 +47,7 @@
4947
dbc.Row(
5048
[
5149
# dbc.Col(html.Img(src=PLOTLY_LOGO, height="30px")),
52-
dbc.Col(dbc.NavbarBrand("Tsunami Events Dashboard", className="ms-2")),
50+
dbc.Col(dbc.NavbarBrand("Tsunami Events Dashboard")),
5351
],
5452
align="center",
5553
className="g-0",
@@ -66,8 +64,9 @@
6664
),
6765
],
6866
style = {
69-
'margin-left': '15px',
70-
'font-weight': "600"}
67+
'margin-left': '1.2rem',
68+
'font-weight': "600"
69+
}
7170
),
7271
color="dark",
7372
dark=True,
@@ -79,7 +78,7 @@
7978
style = {'margin-bottom': '0px'}),
8079
html.Iframe(
8180
id='map_plot',
82-
style={'border-width': '0', 'height': '380px', 'width': '100%'},
81+
style={'border-width': '0', 'height': '390px', 'width': '100%'},
8382
srcDoc=create_map_plot(year_start=1800, year_end=2022, countries=[]))
8483
], style = {'padding': '15px', 'padding-bottom': '0px'}
8584
),
@@ -92,11 +91,11 @@
9291
style = {'margin-bottom': '0px'}),
9392
html.Iframe(
9493
id = 'scatter_plot',
95-
style={'border-width': '0', 'height': '220px','width': '100%'},
94+
style={'border-width': '0', 'height': '250px','width': '100%'},
9695
srcDoc=create_scatter_plot(year_start=1800, year_end=2022, countries=[])
9796
)], style = {'padding': '15px', 'padding-bottom': '0px'}
9897
),
99-
style = {'padding':0}
98+
style = {'padding': 0}
10099
)
101100

102101
bar_chart_card = dbc.Card(
@@ -105,11 +104,11 @@
105104
style = {'margin-bottom': '0px'}),
106105
html.Iframe(
107106
id = 'bar_plot',
108-
style={'border-width': '0', 'height': '220px','width': '100%'},
107+
style={'border-width': '0', 'height': '250px','width': '100%'},
109108
srcDoc=create_bar_plot(year_start=1800, year_end=2022)
110109
)], style = {'padding': '15px', 'padding-bottom': '0px'}
111110
),
112-
style = {'padding':0}
111+
style = {'padding': 0}
113112
)
114113

115114
app.layout = dbc.Container([
@@ -149,7 +148,7 @@
149148
dbc.Col([
150149
dbc.Row([
151150
world_plot_card
152-
], style = {'margin': 'auto', 'width': '800px', 'padding':'0px'}),
151+
], style = {'margin': 'auto', 'width': '820px', 'padding':'0px'}),
153152
html.Br(),
154153
dbc.Row([
155154
dbc.Col([
@@ -166,7 +165,8 @@
166165
style = {
167166
'backgroundColor': 'black',
168167
'padding': '0px',
169-
'height': '100vh'
168+
'height': '100vh',
169+
"overflow": "hidden"
170170
})
171171

172172
# App callback for map_plot

src/components/dropdown.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def create_bar_plot(year_start, year_end):
2323
y=alt.Y('tsunami_instance:N', sort = '-x', title = 'Country', axis = alt.Axis(labelExpr="datum.country")),
2424
color=alt.Color('country:O'),
2525
tooltip=("country:O", "location_name:O", "tsunami_intensity:Q", "earthquake_magnitude:Q", "year:Q", "month:O")
26-
).properties(width=240, height=160)
26+
).properties(width=250, height=180)
2727

2828
text = chart.mark_text(align="left", baseline="middle", dx = 3).encode(
2929
text= 'combine:O')

src/components/map_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def create_map_plot(year_start, year_end, countries):
3030
tooltip=[alt.Tooltip("name:N", title="Country"),
3131
alt.Tooltip("count:Q", title="Total Tsunami Hits")])
3232
.project("naturalEarth1")
33-
.properties(width=700, height=350)
33+
.properties(width=730, height=350)
3434
)
3535

3636
tsunami_events["legend"] = "Tsunami Origin"

src/components/scatter_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def create_scatter_plot(year_start=1900, year_end=2022, countries=[]):
1515
color='country',
1616
tooltip=['year', 'mercalli_intensity', 'country', 'total_deaths']
1717
).interactive(
18-
).properties(width=180, height=150)
18+
).properties(width=180, height=175)
1919
return chart.to_html()
2020

2121

0 commit comments

Comments
 (0)