refactor: replace month dropdown with week dropdown and update related components

feat: add feedback functionality and modal for category feedback
style: add feedback button styles in CSS
docs: add explanation tab for dashboard usage instructions
This commit is contained in:
2025-09-07 20:16:56 +02:00
parent 2d73ae8d63
commit e1b817252c
14 changed files with 281 additions and 90 deletions

View File

@ -1,31 +1,48 @@
import pandas as pd
from dash import Dash, html
from dash import Dash, dcc, html
from src.components import (
bar_chart,
data_table,
pie_chart,
year_dropdown,
month_dropdown,
week_dropdown,
category_dropdown,
feedback_tab,
explanation_tab,
)
def create_layout(app: Dash, data: pd.DataFrame) -> html.Div:
tab_content_style = {'height': 'calc(100vh - 220px)', 'overflowY': 'auto', 'padding': '15px'}
return html.Div(
className="app-div",
children=[
html.H1(app.title),
html.Hr(),
html.Div(
className="dropdown-container",
children=[
year_dropdown.render(app, data),
month_dropdown.render(app, data),
category_dropdown.render(app, data),
],
),
bar_chart.render(app, data),
pie_chart.render(app, data),
data_table.render(app, data),
dcc.Tabs(id="tabs", value='tab-dashboard', children=[
dcc.Tab(label='Dashboard', value='tab-dashboard', children=[
html.Div(style=tab_content_style, children=[
html.Div(
className="dropdown-container",
children=[
year_dropdown.render(app, data),
week_dropdown.render(app, data),
category_dropdown.render(app, data),
],
),
bar_chart.render(app, data),
data_table.render(app, data),
])
]),
dcc.Tab(label='Feedback', value='tab-feedback', children=[
html.Div(style=tab_content_style, children=[
feedback_tab.render(app)
])
]),
dcc.Tab(label='Explanation', value='tab-explanation', children=[
html.Div(style=tab_content_style, children=[
explanation_tab.render(app)
])
]),
]),
],
)
)