almost there
This commit is contained in:
+10
-4
@@ -1,21 +1,27 @@
|
||||
'''Module to create a Dash app that displays visualizations of YNAB data.'''
|
||||
import dash
|
||||
from dash import dcc, html
|
||||
from dash.dependencies import Input, Output
|
||||
from dash.dependencies import Input, Output, State
|
||||
import dash_bootstrap_components as dbc
|
||||
from visuals.layout import create_layout
|
||||
from visuals.components import update_data, update_dates
|
||||
from datetime import date
|
||||
from datetime import date, timedelta
|
||||
|
||||
today = date.today()
|
||||
one_year_ago = today - timedelta(days=365)
|
||||
|
||||
master_data = update_dates(start_date=date(2024, 1, 1), end_date=date(2026, 1, 1))
|
||||
master_data = update_dates(start_date=one_year_ago, end_date=today)
|
||||
data = update_data(master_data)
|
||||
|
||||
|
||||
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.DARKLY])
|
||||
|
||||
@app.callback(
|
||||
Output("layout-container", "children"),
|
||||
Output("spend_per_day","figure"),
|
||||
Output("spend_per_category","figure"),
|
||||
Output("spend_per_payee","figure"),
|
||||
Output("total_spend","children"),
|
||||
|
||||
[Input('date-picker-range', 'start_date'),
|
||||
Input('date-picker-range', 'end_date')]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user