def update_plots(avg_month): """ Updates the plots Args: avg_month: month to use in time average """ return ( plt_ev.plot_timeserie(DFS[c.dfs.TRANS], avg_month=avg_month, height=self.plot_height), plt_inv.total_worth_plot(DFS[c.dfs.LIQUID], DFS[c.dfs.WORTH], avg_month, height=self.plot_height), plt_li.plot_expenses_vs_liquid(DFS[c.dfs.LIQUID], DFS[c.dfs.TRANS], avg_month, False, height=self.plot_height), plt_li.plot_months(DFS[c.dfs.LIQUID], DFS[c.dfs.TRANS], avg_month, False, height=self.plot_height), )
def get_body(self): return [ plt_db.get_summary(DFS), lay.two_columns([ lay.card( dcc.Graph( id="plot_dash_evol", config=c.dash.PLOT_CONFIG, figure=plt_ev.plot_timeserie( DFS[c.dfs.TRANS], avg_month=c.dash.DEFAULT_SMOOTHING, height=self.plot_height, ), )), lay.card( dcc.Graph( id="plot_dash_total_worth", config=c.dash.PLOT_CONFIG, figure=plt_inv.total_worth_plot( DFS[c.dfs.LIQUID], DFS[c.dfs.WORTH], c.dash.DEFAULT_SMOOTHING, height=self.plot_height, ), )), ]), lay.two_columns([ lay.card( dcc.Graph( id="plot_dash_l_vs_e", config=c.dash.PLOT_CONFIG, figure=plt_li.plot_expenses_vs_liquid( DFS[c.dfs.LIQUID], DFS[c.dfs.TRANS], c.dash.DEFAULT_SMOOTHING, False, height=self.plot_height, ), )), lay.card( dcc.Graph( id="plot_dash_liq_months", config=c.dash.PLOT_CONFIG, figure=plt_li.plot_months( DFS[c.dfs.LIQUID], DFS[c.dfs.TRANS], c.dash.DEFAULT_SMOOTHING, False, height=self.plot_height, ), )), ]), ]
def update_plots(df_in, categories, timewindow, type_trans, aux): """ Updates the plots Args: df_in: transactions dataframe categories: categories to use timewindow: timewindow to use for grouping type_trans: type of transacions [Expenses/Inc] """ df = u.dfs.filter_data(u.uos.b64_to_df(df_in), categories) return ( plots.plot_timeserie(df, timewindow), plots.plot_timeserie_by_categories(df, type_trans, timewindow), )
def update_plots(categories, type_trans, timewindow, avg_month): """ Updates evolution plots Args: categories: categories to use type_trans: type of transacions [Expenses/Inc] timewindow: timewindow to use for grouping avg_month: month to use in time average """ df = u.filter_data(DFS[c.dfs.TRANS], categories) return ( plots.plot_timeserie(df, avg_month, timewindow), plots.plot_timeserie_by_categories(df, DFS[c.dfs.CATEG], avg_month, type_trans, timewindow), plots.plot_savings_ratio(df, avg_month, timewindow), )
def get_body(self): return [ lay.card( dcc.Graph( id="plot_evol", config=c.dash.PLOT_CONFIG, figure=plots.plot_timeserie(DFS[c.dfs.TRANS], c.dash.DEFAULT_SMOOTHING, self.def_tw), )), lay.card([ dcc.Graph( id="plot_evo_detail", config=c.dash.PLOT_CONFIG, figure=plots.plot_timeserie_by_categories( DFS[c.dfs.TRANS], DFS[c.dfs.CATEG], c.dash.DEFAULT_SMOOTHING, self.def_type, self.def_tw, ), ), dbc.RadioItems( id="radio_evol_type", options=lay.get_options( [c.names.EXPENSES, c.names.INCOMES]), value=self.def_type, inline=True, ), ]), lay.card( dcc.Graph( id="plot_evo_savings", config=c.dash.PLOT_CONFIG, figure=plots.plot_savings_ratio(DFS[c.dfs.TRANS], c.dash.DEFAULT_SMOOTHING, self.def_tw), )), ]