|
a |
|
b/app.py |
|
|
1 |
from dash import Dash, html, dcc |
|
|
2 |
import plotly.express as px |
|
|
3 |
import pandas as pd |
|
|
4 |
|
|
|
5 |
from data_visualization import (fig_patient_gender, fig_patient_race, fig_allergy, fig_allergy_type, |
|
|
6 |
fig_top_conditions, fig_cond_gender, fig_covid_21_22) |
|
|
7 |
|
|
|
8 |
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] |
|
|
9 |
|
|
|
10 |
app = Dash(__name__, external_stylesheets=external_stylesheets) |
|
|
11 |
|
|
|
12 |
|
|
|
13 |
app.layout = html.Div(children=[ |
|
|
14 |
html.H1(children='Medical Data Visualization'), |
|
|
15 |
|
|
|
16 |
html.Div(children=''' |
|
|
17 |
Some visualizations of medical data. |
|
|
18 |
'''), |
|
|
19 |
|
|
|
20 |
html.Hr(), |
|
|
21 |
|
|
|
22 |
html.H2(children='Patient Informations'), |
|
|
23 |
|
|
|
24 |
html.Div([ |
|
|
25 |
html.Div([ |
|
|
26 |
html.H4(children='Distribution of Gender'), |
|
|
27 |
|
|
|
28 |
|
|
|
29 |
dcc.Graph( |
|
|
30 |
id='graph1', |
|
|
31 |
figure=fig_patient_gender, |
|
|
32 |
), |
|
|
33 |
], className='six columns'), |
|
|
34 |
html.Div([ |
|
|
35 |
html.H4(children='Distribution of Race'), |
|
|
36 |
|
|
|
37 |
dcc.Graph( |
|
|
38 |
id='graph2', |
|
|
39 |
figure=fig_patient_race, |
|
|
40 |
), |
|
|
41 |
], className='six columns'), |
|
|
42 |
], className='row'), |
|
|
43 |
|
|
|
44 |
html.Hr(), |
|
|
45 |
|
|
|
46 |
html.H2(children='Allergies'), |
|
|
47 |
|
|
|
48 |
html.Div([ |
|
|
49 |
html.Div([ |
|
|
50 |
dcc.Graph( |
|
|
51 |
id='graph3', |
|
|
52 |
figure=fig_allergy, |
|
|
53 |
), |
|
|
54 |
], className='six columns'), |
|
|
55 |
html.Div([ |
|
|
56 |
dcc.Graph( |
|
|
57 |
id='graph4', |
|
|
58 |
figure=fig_allergy_type, |
|
|
59 |
), |
|
|
60 |
], className='six columns'), |
|
|
61 |
], className='row'), |
|
|
62 |
|
|
|
63 |
html.Hr(), |
|
|
64 |
|
|
|
65 |
html.H2(children='Conditions'), |
|
|
66 |
|
|
|
67 |
html.Div([ |
|
|
68 |
html.Div([ |
|
|
69 |
dcc.Graph( |
|
|
70 |
id='graph5', |
|
|
71 |
figure=fig_top_conditions, |
|
|
72 |
), |
|
|
73 |
], className='six columns'), |
|
|
74 |
html.Div([ |
|
|
75 |
dcc.Graph( |
|
|
76 |
id='graph6', |
|
|
77 |
figure=fig_cond_gender, |
|
|
78 |
), |
|
|
79 |
], className='six columns'), |
|
|
80 |
], className='row'), |
|
|
81 |
|
|
|
82 |
html.Hr(), |
|
|
83 |
|
|
|
84 |
html.H2(children='Immunizations'), |
|
|
85 |
|
|
|
86 |
dcc.Graph( |
|
|
87 |
id='graph7', |
|
|
88 |
figure=fig_covid_21_22 |
|
|
89 |
) |
|
|
90 |
]) |
|
|
91 |
|
|
|
92 |
if __name__ == '__main__': |
|
|
93 |
app.run_server(debug=True) |