26 lines
739 B
Python
26 lines
739 B
Python
'''Module to create a Dash app that displays visualizations of YNAB data.'''
|
|
import dash
|
|
import dash_bootstrap_components as dbc
|
|
from dash.dependencies import Input, Output
|
|
|
|
import visuals.layout as layout
|
|
import visuals.components as charts
|
|
|
|
def update_visuals(start_date, end_date):
|
|
# Update the data based on the selected date range
|
|
master = charts.update_dates(start_date, end_date)
|
|
data = charts.update_data(master)
|
|
return layout.create_layout(data)
|
|
|
|
# Initialize the app with a dark theme
|
|
app = dash.Dash(external_stylesheets=[dbc.themes.DARKLY])
|
|
|
|
# App layout
|
|
app.layout = update_visuals()
|
|
|
|
@app.callback(
|
|
[
|
|
Input('date-picker-range', 'start_date'),
|
|
Input('date-picker-range', 'end_date')
|
|
]
|
|
) |