aboutsummaryrefslogtreecommitdiff
path: root/project_management/dash/app.py
blob: ea530a60f382bc24e198978229bdf6cb1a5c79a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
Extensible dashboard for project status.
"""

# Import packages
from dash import Dash, html, dcc
import pandas as pd
import plotly.express as px

# Incorporate data
df = pd.read_excel("project_data.xlsx")

# Initialize the app
app = Dash()

# App layout
app.layout = [
    html.H1(children="Project Dashboard", style={"textAlign": "center"}),
    html.Div(
        children=[
            dcc.Graph(
                figure=px.histogram(
                    df,
                    x="Preparer",
                    color="High Priority?",
                    title="Control Count by Preparer",
                ),
                style={"flex-grow": "1"},
            ),
            dcc.Graph(
                figure=px.histogram(
                    df,
                    x="Preparer",
                    y="Projected Hours ",
                    color="Status ",
                    title="Project Hours by Preparer",
                ),
                style={"flex-grow": "1"},
            ),
        ],
        style={
            "display": "flex",
            "flex-wrap": "wrap",
            "justify-content": "space-between",
            "align-items": "center",
        },
    ),
    dcc.Graph(
        figure=px.pie(
            df,
            values=df["Preparer"].value_counts().values,
            names=df["Reviewer"].value_counts().index,
            title="Reviewer Breakdown",
            hole=0.5,
        )
    ),
]

# Run the app
if __name__ == "__main__":
    app.run(debug=True)