-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebFrontEnd.py
More file actions
45 lines (34 loc) · 1.3 KB
/
WebFrontEnd.py
File metadata and controls
45 lines (34 loc) · 1.3 KB
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
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 8 13:57:11 2020
@author: MS13
"""
import dash
import dash_core_components as dcc
import dash_html_components as html
import familytreemaker as ftm
from dash.dependencies import Input, Output, State
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
colors = {
'background': '#111111',
'text': '#7FDBFF',
'lightGreen': '#90ee90'}
app.layout = html.Div(style={'backgroundColor': colors['background']},children=[
html.H1(children='Family Tree Builder', style={'textAlign': 'center', 'color': colors['lightGreen']}),
html.Div(children='''
Use this application to input your relatives and receive a family tree.
''',
style={'textAlign': 'center', 'color':colors['lightGreen']}),
html.Div(style={'textAlign':'center', 'backgroundColor':'#ffffff'},children=[
dcc.Input(id='Ancestor', type='text', value='GGCharlie'),
html.Button(id='ShowTree', n_clicks=0,children='Show tree'),
html.Div(id='family-tree')])
])
@app.callback(Output('family-tree', 'children'),
[Input('ShowTree', 'n_clicks')],
[State('Ancestor', 'value')])
def update_output(n_clicks, Ancestor):
return Ancestor + "\'s tree"
if __name__ == '__main__':
app.run_server(debug=True)