Skip to content

Commit

Permalink
init code to join all counts
Browse files Browse the repository at this point in the history
  • Loading branch information
luutuankiet committed Feb 25, 2024
1 parent ed6a2f7 commit 2e68a52
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/charts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,22 @@ def highlight_row(row):
completed_count_grouped = completed_count_grouped.reset_index()
completed_count_grouped['group'] = 'completed'


st.write(filtered_created_count)
st.write(created_count_grouped)
st.write(filtered_completed_count)


# for detailed tabular data
completed_df = filtered_completed_count[['fld_folder_name','l_list_name','tasks_completed','max_day_completed_timestamp','day_of_year']]
created_df = filtered_created_count[['fld_folder_name','l_list_name','tasks_created','max_day_created_timestamp','day_of_year']]
active_df = filtered_active_count[['fld_folder_name','l_list_name','tasks_active','max_day_active_timestamp','day_of_year']]

merged_df_1 = pd.merge(completed_df,created_df,on=['fld_folder_name','l_list_name'],how='outer')
merged_df = pd.merge(merged_df_1,active_df,on=['fld_folder_name','l_list_name'],how='outer')

st.write(merged_df)



# for graph


# TODO : refactor using 3 queries to one cause they use same base except for the datestamp field.
Expand All @@ -330,8 +337,6 @@ def highlight_row(row):
melted_completed_count = completed_count_grouped.melt(id_vars=['group','day_of_year'], value_vars=['tasks_completed'], var_name='task_type', value_name='count')
activities = pd.concat([melted_active_count, melted_created_count, melted_completed_count], ignore_index=True)

st.write(melted_created_count)

# base color "#6281c3",
# Define a color dictionary
color_dict = {
Expand Down

0 comments on commit 2e68a52

Please sign in to comment.