-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.py
52 lines (37 loc) · 1.13 KB
/
index.py
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
# -*- coding: utf-8 -*-
import os
import sys
sys.path.remove(os.path.abspath(os.path.dirname(__file__)))
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
from zvdata.app import app
from github.domain import init_schema
init_schema()
from zvdata.apps import data_app
def serve_layout():
layout = html.Div([
dcc.Tabs(
id="tabs-with-classes",
value='tab-2',
parent_className='custom-tabs',
className='custom-tabs-container',
children=[
dcc.Tab(
label='data',
value='data',
className='custom-tab',
selected_className='custom-tab--selected'
)
]),
html.Div(id='tabs-content-classes')
])
return layout
app.layout = serve_layout
@app.callback(Output('tabs-content-classes', 'children'),
[Input('tabs-with-classes', 'value')])
def render_content(tab):
if tab == 'data':
return data_app.layout
if __name__ == '__main__':
app.run_server(debug=True)