Feat: return empty fig

This commit is contained in:
Bertrand Benjamin 2021-02-27 10:03:24 +01:00
parent 581b0f4f2f
commit d9e95f2186

View File

@ -240,7 +240,7 @@ def update_final_scores_hist(data):
assessment_scores = pd.DataFrame.from_records(data) assessment_scores = pd.DataFrame.from_records(data)
if assessment_scores.empty: if assessment_scores.empty:
return [{"data": [], "layout": []}] return [go.Figure(data=[go.Scatter(x=[], y=[])])]
ranges = np.linspace( ranges = np.linspace(
-0.5, -0.5,
@ -287,7 +287,7 @@ def update_competence_fig(data):
scores = flat_df_students(scores).dropna(subset=["Score"]) scores = flat_df_students(scores).dropna(subset=["Score"])
if scores.empty: if scores.empty:
return [{"data": [], "layout": []}] return [go.Figure(data=[go.Scatter(x=[], y=[])])]
scores = pp_q_scores(scores) scores = pp_q_scores(scores)
pt = pd.pivot_table( pt = pd.pivot_table(