Skip to content

Commit c9edb7b

Browse files
committed
also move lin log to radio buttons
1 parent 01e118d commit c9edb7b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

assets/callbacks.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ window.dash_clientside.clientside = {
7979
* indices of selected countries
8080
* cases_type: str
8181
* active or death
82+
* log_or_lin: str
83+
* log or linear axis
8284
* store: list
8385
* store[0]: plotly-figure-dict, containing all the traces (all
8486
* countries, data and prediction, for active cases and deaths)
@@ -115,6 +117,15 @@ window.dash_clientside.clientside = {
115117
}
116118
}
117119
}
120+
new_fig['layout']['yaxis']['type'] = log_or_lin;
121+
if (log_or_lin === 'log'){
122+
new_fig['layout']['legend']['x'] = .65;
123+
new_fig['layout']['legend']['y'] = .1;
124+
}
125+
else{
126+
new_fig['layout']['legend']['x'] = .05;
127+
new_fig['layout']['legend']['y'] = .8;
128+
}
118129
return new_fig;
119130
}
120131
};

make_figures.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def make_timeplot(df_measure, df_prediction, countries=None):
226226
drag_handle_annotation],
227227
xaxis_tickfont_size=LABEL_FONT_SIZE - 4,
228228
yaxis_tickfont_size=LABEL_FONT_SIZE - 4,
229+
yaxis_type='linear',
229230
height=FIRST_LINE_HEIGHT,
230231
margin=dict(t=0, b=0.02),
231232
# The legend position + font size

0 commit comments

Comments
 (0)