Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import dash
- import dash_core_components as dcc
- import dash_bootstrap_components as dbc
- import dash_html_components as html
- from dash.dependencies import Input, Output
- from win32api import GetSystemMetrics
- app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
- server = app.server
- app.config.suppress_callback_exceptions = True
- var1 = 3
- var2 = 4
- var3 = 5
- height_screen = GetSystemMetrics(1)
- print("efgefe", height_screen)
- app.layout = html.Div([
- dcc.Tabs(
- id="tabs-with-classes",
- value='tab-1',
- parent_className='custom-tabs',
- className='custom-tabs-container',
- children=[
- dcc.Tab(
- label='World',
- value='tab-1',
- className='custom-tab',
- selected_className='custom-tab--selected'
- ),
- dcc.Tab(
- label= "Europe",
- value='tab-2',
- className='custom-tab',
- selected_className='custom-tab--selected'
- ),
- dcc.Tab(
- label='Graphs - TOP 10',
- value='tab-3', className='custom-tab',
- selected_className='custom-tab--selected'
- ),
- dcc.Tab(
- label='Graphs - TOP 10',
- value='tab-4',
- className='custom-tab',
- selected_className='custom-tab--selected'
- ),
- dcc.Tab(
- label='Statistics',
- value='tab-5',
- className='custom-tab',
- selected_className='custom-tab--selected'
- ),
- ]),
- html.Div(id='tabs-content-classes')
- ])
- @app.callback(Output('tabs-content-classes', 'children'),
- [Input('tabs-with-classes', 'value')])
- def render_content(tab):
- if tab == 'tab-1':
- col = html.Div([
- dbc.Row([
- dbc.Col([
- dbc.Row(
- dbc.Col(
- dbc.Alert([
- html.H6("Last Updated at (M/D/YYYY)", style={"font-size": "13px","color":"#FFF","text-align": "center","margin-block-end":"1%"}),
- html.P("3/31/2020 11:24:28 a.m.", style={"font-family": "Avenir Next W01" "Avenir Next W00" "Avenir Next" "Avenir" "Helvetica Neue" "sans-serif","font-weight":"bold","color":"#FFF","text-align": "center"}),
- ], color="#FFF", style={"background-color":"#232323","border": "2px solid gray","border-style": "groove","margin-block-start":"2%"})
- ),
- ),
- html.Div([
- dbc.Row(
- dbc.Col([
- html.H4("Total Confirmed", className="text-center",style={"font-size":"23px","color":"#FFF"}),
- html.P("867,868", style={"font-size":"40px","color":"#FF0000","font-weight":"bold"})
- ]
- , className="d-flex align-items-center justify-content-around ", style={"font-family": "Avenir Next W01" "Avenir Next W00" "Avenir Next" "Avenir" "Helvetica Neue" "sans-serif","background-color": "#232323","border": "1px solid gray","margin": "auto", "flex-direction": "column"}
- ), className="px-2"
- ),
- dbc.Row(
- dbc.Col([
- html.H4("Total Recovered", className="text-center",style={"font-size":"23px","color":"#FFF"}),
- html.P("167,776", className="text-center", style={"color":"#15EB7D","font-size":"40px","font-weight":"bold"})
- ]
- , className="d-flex align-items-center justify-content-around", style={"font-family": "Avenir Next W01" "Avenir Next W00" "Avenir Next" "Avenir" "Helvetica Neue" "sans-serif","background-color": "#232323", "border": "1px solid gray","margin": "auto", "flex-direction": "column"}
- ),className="px-2"
- ),
- dbc.Row(
- dbc.Col([
- html.H4("Total Deaths", className="text-center"),
- html.P("45,676", className="text-center", style={"font-size":"40px","font-weight":"bold"})]
- , className="d-flex align-items-center justify-content-around", style={"font-family": "Avenir Next W01" "Avenir Next W00" "Avenir Next" "Avenir" "Helvetica Neue" "sans-serif","background-color": "#232323", "border": "1px solid gray","margin": "auto", "color": "#FFFFFF",
- "flex-direction": "column"}
- ), className="px-2"
- ),
- dbc.Row(
- dbc.Col([
- html.H4("Active Days", className="text-center",style={"font-size":"23px","color":"#FFF"}),
- html.P("124",className="text-center",style={"color":"#BDBDBD","font-size":"40px","font-weight":"bold"})
- ]
- , className="d-flex align-items-center justify-content-around", style={"font-family": "Avenir Next W01" "Avenir Next W00" "Avenir Next" "Avenir" "Helvetica Neue" "sans-serif","background-color": "#232323", "border": "1px solid gray","margin": "auto","color":"#FF00FF","flex-direction": "column" }
- ),className="px-2"
- ),
- ], className="d-flex justify-content-around", style={"flex-direction" : "column", "height": "80%"}),
- ],width=2.5),
- dbc.Col([
- dbc.Row(html.Iframe(src="https://flo.uri.sh/visualisation/1746162/embed", width="90%", height="681px"), className="px-3"),
- dbc.Row(
- dbc.Col([
- html.H4("Total texto", className="text-center"),
- html.P("tecefefetr rtertretretret ertretertertgr rtgregrggeger rgegegergegergergergrgegfefef efefefe ere rererrer", className="text-center")]
- , className="d-flex align-items-center justify-content-around",
- style={"font-family": "Avenir Next W01" "Avenir Next W00" "Avenir Next" "Avenir" "Helvetica Neue" "sans-serif",
- "background-color": "#232323", "border": "1px solid gray", "margin": "auto",
- "color": "#FF00FF",
- "flex-direction": "column"}
- ), className="px-2"
- )
- ],style={"height":"100vh"}),
- dbc.Col([
- dbc.Row(html.Iframe(src="https://flo.uri.sh/visualisation/1746162/embed", width="100%", height="400")),
- dbc.Row(html.Iframe(src="https://flo.uri.sh/visualisation/1746162/embed", width="100%", height="400"))
- ], width=3)
- ],id="myDiv"),
- ], className="flex-fluid flex-horizontal position-relative overflow-hidden",style={"display":"flex","height":"100vh","width":"100vw","background-color": "#000"})
- return col
- elif tab == 'tab-2':
- row = html.Div([
- html.Br(),
- dbc.Row(
- [
- dbc.Col(html.Div(
- html.Iframe(src="https://flo.uri.sh/visualisation/1746162/embed",
- width="100%", height="400")
- )),
- dbc.Col(html.Div(
- html.Iframe(src="https://flo.uri.sh/visualisation/1746162/embed",
- width="100%", height="400")
- )),
- dbc.Col(html.Div(
- html.Iframe(src="https://flo.uri.sh/visualisation/1746162/embed",
- width="100%", height="400")
- )),
- ]
- ),
- dbc.Row(
- [
- dbc.Col(html.Div(
- html.Iframe(src="https://flo.uri.sh/visualisation/1746162/embed",
- width="100%", height="400")
- )),
- dbc.Col(html.Div(
- html.Iframe(src="https://flo.uri.sh/visualisation/1746162/embed",
- width="100%", height="400")
- )),
- dbc.Col(html.Div(
- html.Iframe(src="https://flo.uri.sh/visualisation/1746162/embed",
- width="100%", height="400")
- )),
- ]
- ),
- ],className="container-fluid" )
- return row
- elif tab == 'tab-3':
- return html.Div([
- html.H3('Tab content 3')
- ])
- elif tab == 'tab-4':
- return html.Div([
- html.H3('Tab content 4')
- ])
- elif tab == 'tab-5':
- return html.Div([
- html.H3('Tab content 5')
- ])
- if __name__ == "__main__":
- app.run_server(debug=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement