Esempio n. 1
0
 [
     html.Div(
         [
             # width: 3rem ensures the logo is the exact width of the
             # collapsed sidebar (accounting for padding)
             html.Img(src=PLOTLY_LOGO, style={"width": "3rem"}),
             html.H2("Sidebar"),
         ],
         className="sidebar-header",
     ),
     html.Hr(),
     dbc.Nav(
         [
             dbc.NavLink(
                 [html.I(className="fas fa-home me-2"),
                  html.Span("Home")],
                 href="/",
                 active="exact",
             ),
             dbc.NavLink(
                 [
                     html.I(className="fas fa-calendar-alt me-2"),
                     html.Span("Calendar"),
                 ],
                 href="/calendar",
                 active="exact",
             ),
             dbc.NavLink(
                 [
                     html.I(className="fas fa-envelope-open-text me-2"),
                     html.Span("Messages"),
                 ],
Esempio n. 2
0
def navBar(input1):
    if current_user.is_authenticated:
        if current_user.admin == 1:
            navBarContents = html.Div([
                dbc.NavItem(dbc.NavLink('Page 1', href='/page1')),
                dbc.NavItem(dbc.NavLink('Page 2', href='/page2')),
                dbc.NavItem(dbc.NavLink('Page 3', href='/page3')),
                dbc.NavItem(dbc.NavLink('Page 4', href='/page4')),
                dbc.NavItem(dbc.NavLink('Page 5', href='/page5')),
                dbc.NavItem(dbc.NavLink('Page 6', href='/page6')),
                dbc.NavItem(dbc.NavLink('Page 7', href='/page7')),
                dbc.NavItem(dbc.NavLink('Page 8', href='/page8')),
                dbc.DropdownMenu(
                    nav=True,
                    in_navbar=True,
                    label=current_user.username,
                    children=[
                        dbc.DropdownMenuItem('Profile', href='/profile'),
                        dbc.DropdownMenuItem('Admin', href='/admin'),
                        dbc.DropdownMenuItem(divider=True),
                        dbc.DropdownMenuItem('Logout', href='/logout'),
                    ],
                ),
            ],
                                      horizontal="center",
                                      pills=True)
            return navBarContents

        else:
            navBarContents = [
                dbc.NavItem(dbc.NavLink('Page 1', href='/page1')),
                dbc.NavItem(dbc.NavLink('Page 2', href='/page2')),
                dbc.NavItem(dbc.NavLink('Page 3', href='/page3')),
                dbc.NavItem(dbc.NavLink('Page 4', href='/page4')),
                dbc.NavItem(dbc.NavLink('Page 5', href='/page5')),
                dbc.NavItem(dbc.NavLink('Page 6', href='/page6')),
                dbc.NavItem(dbc.NavLink('Page 7', href='/page7')),
                dbc.NavItem(dbc.NavLink('Page 8', href='/page8')),
                dbc.DropdownMenu(
                    nav=True,
                    in_navbar=True,
                    label=current_user.username,
                    children=[
                        dbc.DropdownMenuItem('Profile', href='/profile'),
                        dbc.DropdownMenuItem(divider=True),
                        dbc.DropdownMenuItem('Logout', href='/logout'),
                    ],
                ),
            ]
            return navBarContents

    else:
        return ''
Esempio n. 3
0
from app.style import colors, SIDEBAR_STYLE, CONTENT_MAP_STYLE, CONTENT_STYLE,CONTENT_STYLE_PART1, CONTENT_STYLE_PART2
from app.helper_functions import filter_data, build_hierarchical_dataframe
from app.app import app


sidebar_page_1 = html.Div(
    [
        html.H2("Executions", className="sidebar-design"),
        dbc.Nav(
            [
                dbc.NavLink(
                    html.Span(
                        [html.Img(src='data:image/png;base64,{}'.format(encoded_image.decode()),
                            style={'height': '20px', 'margin-top': '-3px'}
                        ),
                        html.P("Overview", style={'margin-left': '8px', 'margin-top': '1px', 'margin-bottom': '-25px'})
                    ],
                    style={'display': '-webkit-inline-box'}
                    ),
                    active=True,
                    href="/overview"
                ),
                dbc.NavLink(
                    html.Span(
                        [html.Img(src='data:image/png;base64,{}'.format(encoded_image.decode()),
                            style={'height': '20px', 'margin-top': '-3px'}
                        ),
                        html.P("Timeline", style={'margin-left': '8px', 'margin-top': '0px', 'margin-bottom': '-25px'})
                    ],
                    style={'display': '-webkit-inline-box', 'opacity': '0.6'}
                    ),
                    active=True,
                        'font-weight': 'bold',
                    }),
        ]),
    ],
    width=True,
    align='center',
)

navbar_views = dbc.Col(
    id='navbar-views-col',
    children=dbc.Navbar(
        id='navbar-views',
        children=[
            dbc.Row([
                dbc.Col([
                    dbc.NavLink(
                        id='view1-link', children='View 1', href='/view1'),
                    dbc.Tooltip(
                        children=
                        'Detailed view of any individual (Search by human ID)',
                        target='view1-link',
                        placement='auto-start',
                        style={'font-size': '150%'},
                    ),
                ],
                        width='auto'),
                dbc.Col([
                    dbc.NavLink(
                        id='view2-link', children='View 2', href='/view2'),
                    dbc.Tooltip(
                        children=
                        'General view of all individual/identities (Search by channel and/or timestamp)',
Esempio n. 5
0
    "margin-left": "18rem",
    "margin-right": "2rem",
    "padding": "2rem 1rem",
}

sidebar = html.Div(
    [
        html.Img(src="data:image/png;base64,{}".format(encode_image.decode()),
                 style={
                     'height': '20%',
                     'width': '100%'
                 }),
        html.Hr(),
        dbc.Nav(
            [
                dbc.NavLink("Home", href="/", active="exact"),
                dbc.NavLink("Eastern Conference",
                            href="/eastern-conference",
                            active="exact"),
                dbc.NavLink("Western Conference",
                            href="/western-conference",
                            active="exact"),
                dbc.NavLink("Team View",
                            href="http://localhost:3000/team_view",
                            active="exact"),
                dbc.NavLink("Profile",
                            href="http://localhost:3000/profile",
                            active="exact"),
            ],
            vertical=True,
            pills=True,
Esempio n. 6
0
     html.Div(
         [
             html.Hr(),
             html.P(
                 "Consumer Customer Experience Data Deep Dive",
                 className="lead",
                 style={'text-align': 'center'},
             ),
         ],
         id="blurb",
     ),
     # use the Collapse component to animate hiding / revealing links
     dbc.Collapse(
         dbc.Nav(
             [
                 dbc.NavLink("Overview", href="/page-1", id="page-1-link"),
                 dbc.NavLink(
                     "Order Aggregate", href="/page-4", id="page-4-link"),
                 dbc.NavLink("Customer Aggregate",
                             href="/page-2",
                             id="page-2-link"),
                 dbc.NavLink(
                     "Single Journey", href="/page-3", id="page-3-link"),
                 dbc.NavLink("Model", href="/page-5", id="page-5-link"),
             ],
             vertical=True,
             pills=True,
         ),
         id="collapse",
     ),
 ],
Esempio n. 7
0
    "padding": "2rem 1rem",
    "background-color": "#f8f9fa",
}

# the styles for the main content position it to the right of the sidebar and
# add some padding.
CONTENT_STYLE = {
    "margin-left": "18rem",
    "margin-right": "2rem",
    "padding": "2rem 1rem",
}


navbar = dbc.NavbarSimple(
    children=[
        dbc.NavItem(dbc.NavLink("Page 1", href="#")),
        dbc.DropdownMenu(
            children=[
                dbc.DropdownMenuItem("More pages", header=True),
                dbc.DropdownMenuItem("Page 2", href="#"),
                dbc.DropdownMenuItem("Page 3", href="#"),
            ],
            nav=True,
            in_navbar=True,
            label="More",
        ),
    ],
    brand="NavbarSimple",
    brand_href="#",
    color="primary",
    dark=True,
Esempio n. 8
0
# -*- coding: utf-8 -*-
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State
from app import app, server
from pages import home, page1, page2, page3, page4
import flask


nav_item1 = dbc.NavItem(dbc.NavLink("Browse", href="/pages/page1", external_link=True))
nav_item2 = dbc.NavItem(dbc.NavLink("Visualize", href="/pages/page2", external_link=True))
nav_item3 = dbc.NavItem(dbc.NavLink("Submit", href="/pages/page3", external_link=True))
nav_item4 = dbc.NavItem(dbc.NavLink("About", href="/pages/page4", external_link=True))

nav_bar_and_content_div = html.Div(children=[
    dcc.Location(id='url', refresh=False),
    dbc.Navbar(
        dbc.Container(
            [
                html.A(
                    # Use row and col to control vertical alignment of logo / brand
                    dbc.Row(
                        [
                            dbc.Col(html.Img(id='logo', src='assets/logo_jsheunis_3.jpeg', height="32px", className="avatar")),
                            dbc.Col(dbc.NavbarBrand("rtfMRI Methods", className="ml-2")),
                        ],
                        align="center",
                        no_gutters=True,
                    ),
                    href="/",
navbar = dbc.NavbarSimple(
    children=[
        dbc.Col(html.Img(src=IBM_LOGO, height="50px")),
        dbc.DropdownMenu(
            nav=True,
            in_navbar=True,
            label="Menu",
            children=[
                dbc.DropdownMenuItem("Case Worker Dashboard"),
                dbc.DropdownMenuItem("Executive Dashboard"),
                dbc.DropdownMenuItem(divider=True),
                dbc.DropdownMenuItem("Data Sources")
            ],
        ),
        dbc.NavItem(dbc.NavLink("Logout", href="#")),
        dbc.Collapse(search_bar, id="navbar-collapse", navbar=True),
    ],
    brand="CHILD WELFARE ANALYTICS PLATFORM",
    className='navbar navbar-expand-lg navbar-dark bg-dark',
    brand_href="#",
    sticky="top",
)

exec_tbl = html.Div([
    dash_table.DataTable(
        id='datatable',
        columns=[{
            "name": i,
            "id": i
        } for i in df_exec_smmry.columns],
Esempio n. 10
0
#Todo: Create ddl with departments and callback to change map from here
btnBack = html.Button('Back to Colombia', id='backButt', n_clicks=0)

filters = dbc.Card(
    [
        dbc.FormGroup([dbc.Label("Data to show"), ddlDataToShow]),
        dbc.FormGroup([dbc.Label("Year"), slrAge]),
        dbc.FormGroup([btnBack], className="mt-5"),
    ],
    body=True,
)

#######################################################################################################################################

upperContent = dbc.Col([filters], width='auto')

# dbc.Container([filters,html.Hr()],className="h-50"),
#               style={'width':'320px'})

menu = dbc.Nav(
    [
        dbc.NavLink("Overview", href="/page-1", id="page-1-link"),
        dbc.NavLink("Analytics", href="/page-2", id="page-2-link"),
        dbc.NavLink("Recomendations", href="/page-3", id="page-3-link"),
    ],
    vertical=True,
    pills=True,
)

sidebar = upperContent
Esempio n. 11
0
def dataframe_to_date(usa_only, scale, date):
    return query_to_date(usa_only=usa_only, scale=scale, date=date)


# Master Data
# q = Queue(connection=conn)
#
# worker_to_date = q.enqueue(dataframe_to_date(date='2020-03-24', usa_only=False, scale=500), redis_url)
#
"""Navbar"""
# dropdown Items

# make a reuseable navitem for the different examples
nav_item = dbc.NavItem(
    dbc.NavLink("Instagram", href="https://www.instagram.com/amelgikha/"))

# make a reuseable dropdown for the different examples
dropdown = dbc.DropdownMenu(
    children=[
        dbc.DropdownMenuItem("Project Github",
                             href='https://github.com/amelgikha/dash_covid19'),
        dbc.DropdownMenuItem("Plotly / Dash", href='https://dash.plot.ly/'),
        dbc.DropdownMenuItem(
            "Dash Bootstrap",
            href='https://dash-bootstrap-components.opensource.faculty.ai/'),
    ],
    nav=True,
    in_navbar=True,
    label="Important Links",
)
def Batter_Base_layout(app):

    app.title = "KBO analysis"
    team_name = []
    year = count_year()
    batter_name = []

    app.layout = html.Div([
        baselayout,
        # 그래프
        dbc.Container(
            [
                dbc.Row(
                    dbc.Col(children=[html.H2("선수를 선택해 주세요")],
                            style={
                                'margin-top': 80,
                                'margin-right': 10,
                                'margin-left': 10
                            },
                            id="title")),
                dbc.Row(
                    dbc.Col(
                        dbc.Alert(
                            "해당 분석은 한국프로야구단 공식 홈페이지인 KBO에서 스크래핑한 데이터를 바탕으로 진행되었습니다.",
                            color="secondary",
                            style={
                                'margin-top': 10,
                                'margin-right': 10,
                                'margin-left': 10
                            }))),
                dbc.Row([
                    dbc.Col(children=[
                        dbc.Card(
                            [
                                dbc.CardHeader("최근 선수 스탯"),
                                dbc.CardBody(dcc.Graph(id='graph1')),
                            ],
                            style={
                                'width': "auto",
                                'margin-top': 20,
                                'margin-left': 10,
                                'margin-right': 10,
                                'margin-bottom': 20
                            }),
                        dbc.Card(
                            [
                                dbc.CardHeader("월별 타율 추세"),
                                dbc.CardBody(dcc.Graph(id='graph3')),
                            ],
                            style={
                                'width': "auto",
                                'margin-top': 20,
                                'margin-left': 10,
                                'margin-right': 10,
                                'margin-bottom': 20
                            })
                    ],
                            xs=12,
                            sm=12,
                            md=6,
                            lg=6),
                    dbc.Col(dbc.Card(
                        [
                            dbc.CardHeader("연도별 스탯 변화 추이"),
                            dbc.CardBody(dcc.Graph(id='graph2'))
                        ],
                        style={
                            'width': "auto",
                            'margin-top': 20,
                            'margin-left': 10,
                            'margin-right': 10,
                            'margin-bottom': 20
                        }),
                            xs=12,
                            sm=12,
                            md=6,
                            lg=6),
                ],
                        no_gutters=True,
                        justify="around"),
            ],
            id="graphs",
            style={
                "width": "auto",
                'margin-left': 210,
                'color': None,
                "transition": "all .2s",
                "z-index": -1
            },
            fluid=True),
        # 사이드바
        html.Div(
            [
                html.Div(
                    [
                        dbc.Nav([
                            html.P("Main",
                                   style={
                                       'color': '#7E8083',
                                       'font-size': '80%'
                                   }),
                            html.Li(
                                dbc.Row([
                                    dbc.Col(html.I(
                                        className="fas fa-chart-bar fa-2x",
                                        style={
                                            'color': '#FFFFFF',
                                            'margin-top': 11,
                                            'font-size': 20
                                        }),
                                            width="auto"),
                                    dbc.Col(
                                        dbc.NavItem(
                                            dbc.NavLink(
                                                "Batters",
                                                href=
                                                "http://127.0.0.1:5000/batters/",
                                                id="batters",
                                                style={
                                                    "color": "#FFFFFF",
                                                    'margin-left': -30
                                                }))),
                                    dbc.Col(dbc.NavItem(
                                        dbc.NavLink(
                                            html.I(
                                                className=
                                                "fas fa-chevron-right fa-xs",
                                                style={
                                                    'color': '#FFFFFF',
                                                    'margin-top': 8
                                                }),
                                            href=
                                            "http://127.0.0.1:5000/batters/")),
                                            width=3)
                                ])),
                            html.Div(
                                [
                                    dbc.Row([
                                        dbc.Col(
                                            dcc.Dropdown(
                                                id='year_select',
                                                options=[{
                                                    'label': i,
                                                    'value': i
                                                } for i in year],
                                                value='year_select',
                                                placeholder="year",
                                            )),
                                        dbc.Col(
                                            dcc.Dropdown(
                                                id='team_name_select',
                                                options=[{
                                                    'label': i,
                                                    'value': i
                                                } for i in team_name],
                                                value='team_select',
                                                placeholder="team",
                                            ))
                                    ],
                                            no_gutters=True,
                                            align="center",
                                            justify="center"),
                                    html.Br(),
                                    dcc.Dropdown(id='batter_name_select',
                                                 options=[{
                                                     'label': i,
                                                     'value': i
                                                 } for i in batter_name],
                                                 value='batter_select',
                                                 placeholder="Choose a batter")
                                ],
                                style={
                                    'width': '100%',
                                    'display': 'inline-block',
                                    'font-size': '80%',
                                    'margin-bottom': 80,
                                    'margin-top': 5
                                }),
                            html.P("Others",
                                   style={
                                       'color': '#7E8083',
                                       'font-size': '80%'
                                   }),
                            html.Li(
                                dbc.Row([
                                    dbc.Col(html.I(
                                        className="fas fa-project-diagram",
                                        style={
                                            'color': '#7E8083',
                                            'margin-top': 12
                                        }),
                                            width="auto"),
                                    dbc.Col(
                                        dbc.NavItem(
                                            dbc.NavLink(
                                                "Teams",
                                                href=
                                                "http://127.0.0.1:5000/teams/",
                                                id="teams",
                                                style={
                                                    "color": "#7E8083",
                                                    'margin-left': -30
                                                }))),
                                    dbc.Col(dbc.NavItem(
                                        dbc.NavLink(
                                            html.I(
                                                className=
                                                "fas fa-chevron-right fa-xs",
                                                style={
                                                    'color': '#7E8083',
                                                    'margin-top': 8
                                                }),
                                            href="http://127.0.0.1:5000/teams/"
                                        )),
                                            width=3)
                                ])),
                            html.Li(
                                dbc.Row([
                                    dbc.Col(html.I(
                                        className="fas fa-table fa-2x",
                                        style={
                                            'color': '#7E8083',
                                            'margin-top': 10,
                                            'font-size': 18
                                        }),
                                            width="auto"),
                                    dbc.Col(
                                        dbc.NavItem(
                                            dbc.NavLink(
                                                "Pitchers",
                                                href=
                                                "http://127.0.0.1:5000/pitchers/",
                                                id="pitchers",
                                                style={
                                                    "color": "#7E8083",
                                                    'margin-left': -28
                                                }))),
                                    dbc.Col(dbc.NavItem(
                                        dbc.NavLink(
                                            html.I(
                                                className=
                                                "fas fa-chevron-right fa-xs",
                                                style={
                                                    'color': '#7E8083',
                                                    'margin-top': 8
                                                }),
                                            href=
                                            "http://127.0.0.1:5000/pitchers/")
                                    ),
                                            width=3)
                                ])),
                            html.Li(
                                dbc.Row([
                                    dbc.Col(html.I(
                                        className="fas fa-balance-scale fa-2x",
                                        style={
                                            'color': '#7E8083',
                                            'margin-top': 10,
                                            'font-size': 17,
                                            'margin-left': -1.5
                                        }),
                                            width="auto"),
                                    dbc.Col(
                                        dbc.NavItem(
                                            dbc.NavLink(
                                                "Comparer",
                                                href=
                                                "http://127.0.0.1:5000/comparer/",
                                                id="comparer",
                                                style={
                                                    "color": "#7E8083",
                                                    'margin-left': -30
                                                }))),
                                    dbc.Col(dbc.NavItem(
                                        dbc.NavLink(
                                            html.I(
                                                className=
                                                "fas fa-chevron-right fa-xs",
                                                style={
                                                    'color': '#7E8083',
                                                    'margin-top': 8
                                                }),
                                            href=
                                            "http://127.0.0.1:5000/comparer/")
                                    ),
                                            width=3)
                                ]))
                        ],
                                vertical="md",
                                horizontal='start',
                                className="ml-auto"),
                    ],
                    id="sidebar",
                    style={
                        "position": "fixed",
                        "top": 55,
                        "left": "0",
                        "bottom": 0,
                        "width": "13rem",
                        "padding": "2rem 1rem",
                        "background-color": "#353A3F",
                        "transition": "left .2s"
                    })
            ],
            id="side",
            style={
                "position": "fixed",
                "top": 55,
                "left": "0",
                "bottom": 0,
                "width": "100%",
                "background-color": "rgba(0, 0, 0, 0.5)",
                "transition": "left .2s",
            })
    ])

    @app.callback(Output('team_name_select', "options"),
                  Input('year_select', "value"))
    def team_name_list(value):
        team_name = get_team_name(value)
        return [{'label': i, 'value': i} for i in team_name]

    @app.callback(
        Output('batter_name_select', "options"),
        [Input('year_select', "value"),
         Input('team_name_select', "value")])
    def batter_name_list(value1, value2):
        batter_name = batter_list(value1, value2)
        return [{'label': i, 'value': i} for i in batter_name]

    @app.callback(Output('title', 'children'),
                  Input('batter_name_select', "value"))
    def batter_select_name(value):
        if value != 'batter_select' and value != None:
            children = [html.H2(f"{value} 선수의 분석결과 입니다.")]
        else:
            children = [html.H2("선수를 선택해 주세요")]
        return children

    @app.callback(
        Output('batter_name_select', "value"),
        [Input('year_select', "value"),
         Input('team_name_select', "value")])
    def test_one(value1, value2):
        if value1 == None or value2 == None:
            return None

    @app.callback(Output('graph1', 'figure'), Output('graph2', 'figure'), [
        Input('team_name_select', "value"),
        Input('batter_name_select', 'value')
    ])
    def batter_recent(value1, value2):
        scores = batter_yearly_base(value1, value2)
        df = pd.DataFrame(scores[1:],
                          columns=['YEAR', 'AVG', 'OBP', 'SLG', 'ISO', 'EOBP'])
        fig1 = go.Figure(
            go.Scatterpolar(r=list(scores[-1][1:]),
                            theta=[
                                '평균타율(AVG)', '출루율(OBP)', '장타율(SGL)',
                                '순장타율(ISO)', '순출루율(EOBP)'
                            ],
                            fill='toself'))
        fig1.update_layout(margin=dict(l=30, r=30, t=35, b=35),
                           height=300,
                           template=None,
                           polar=dict(radialaxis=dict(visible=True,
                                                      range=[0.0, 1.0],
                                                      showticklabels=False,
                                                      ticks=''),
                                      angularaxis=dict(showticklabels=True,
                                                       ticks='',
                                                       tickfont_size=13)))
        fig2 = make_subplots(rows=2,
                             cols=1,
                             shared_xaxes=True,
                             vertical_spacing=0.1,
                             specs=[[{
                                 "type": "scatter"
                             }], [{
                                 "type": "table"
                             }]])
        fig2.add_trace(
            go.Scatter(x=df['YEAR'],
                       y=df['AVG'],
                       name='평균타율(AVG)',
                       marker_color='#243858'))
        fig2.add_trace(
            go.Scatter(x=df['YEAR'],
                       y=df['OBP'],
                       name='출루율(OBP)',
                       marker_color='#749A46'))
        fig2.add_trace(
            go.Scatter(x=df['YEAR'],
                       y=df['SLG'],
                       name='장타율(SGL)',
                       marker_color='#6BB6DA'))
        fig2.add_trace(
            go.Scatter(x=df['YEAR'],
                       y=df['ISO'],
                       name='순장타율(ISO)',
                       marker_color='#EC7D7A'))
        fig2.add_trace(
            go.Scatter(x=df['YEAR'],
                       y=df['EOBP'],
                       name='순출루율(EOBP)',
                       marker_color='#F5CA6F'))
        fig2.add_trace(
            go.Table(
                columnorder=[1, 2, 3, 4, 5, 6],
                columnwidth=[7.5, 10, 10, 10, 10, 10],
                header=dict(values=df.columns,
                            height=32,
                            fill_color='#6E757C',
                            line_color='#6E757C',
                            align='center',
                            font=dict(color='white')),
                cells=dict(
                    values=[df.YEAR, df.AVG, df.OBP, df.SLG, df.ISO, df.EOBP],
                    fill_color='white',
                    line_color='#6E757C',
                    font=dict(color='black'),
                    align='center',
                    height=32),
            ), 2, 1)
        fig2.update_layout(height=695,
                           margin=dict(l=0, r=0, t=0, b=0),
                           template='plotly_white',
                           yaxis=dict(anchor="free",
                                      side="left",
                                      position=0.015),
                           xaxis=dict(tickmode='linear', dtick=1),
                           legend=dict(orientation="h",
                                       yanchor="bottom",
                                       y=1.02,
                                       xanchor="left",
                                       x=0))

        return fig1, fig2

    @app.callback(Output('graph3', 'figure'), [
        Input('team_name_select', "value"),
        Input('batter_name_select', 'value')
    ])
    def batter_monthly(value1, value2):
        df = daily_hit_prob(value1, value2)
        fig = go.Figure(
            go.Scatter(x=df['date'],
                       y=df['value'],
                       mode='markers',
                       marker=dict(size=10,
                                   color=df['value'].astype('float'),
                                   colorscale="viridis",
                                   showscale=True)))
        fig.update_layout(template='plotly_white',
                          height=300,
                          margin=dict(l=0, r=0, t=0, b=0))
        return fig

    @app.callback(Output("sidebar", "style"), Output("graphs", "style"),
                  Output("side", "style"), [Input("sidebtn", "n_clicks")], [
                      State("sidebar", "style"),
                      State("graphs", "style"),
                      State("side", "style")
                  ])
    def toggle(n, style1, style2, style3):
        if n and style1['left'] == "0" and style2['margin-left'] == 210:
            style1['left'] = "-13rem"
            style2['margin-left'] = 0
            style3['width'] = 0
            return style1, style2, style3
        else:
            style1['left'] = "0"
            style2['margin-left'] = 210
            style3['width'] = "100%"
            return style1, style2, style3

    return app
Esempio n. 13
0
 html.Div(
     [
         html.Hr(),
         html.P(
             "A dashboard for gaining insight into Windstream chat bot data.",
             className="lead",
         ),
     ],
     id="blurb",
 ),
 # use the Collapse component to animate hiding / revealing links
 dbc.Collapse(
     dbc.Nav(
         [
             dbc.NavLink("Overall Metrics",
                         href=f"{requests_prefix}metrics",
                         id="metrics-link"),
             dbc.NavLink("Daily User Trends",
                         href=f"{requests_prefix}user-trends",
                         id="user-trends-link"),
             dbc.NavLink("Detailed Reports",
                         href=f"{requests_prefix}reports",
                         id="reports-link")
         ],
         vertical=True,
         pills=True,
     ),
     id="collapse",
 ),
 html.Div(
     [
Esempio n. 14
0
                    "color": "rgba(0,0,0,.5)",
                    "border-color": "rgba(0,0,0,.1)",
                },
                id="sidebar-toggle",
            ),
        ],
        # the column containing the toggle will be only as wide as the
        # toggle, resulting in the toggle being right aligned
        width="auto",
        # vertically align the toggle in the center
        align="center",
    ),
])

pages = [
    dbc.NavLink("Upload Structure", href="/page-1", id="page-1-link"),
    dbc.NavLink("Convert Structure", href="/page-2", id="page-2-link"),
    dbc.NavLink("Symmetry Analysis", href="/page-3", id="page-3-link"),
    dbc.NavLink("Kpath", href="/page-4", id="page-4-link"),
    dbc.NavLink("Build GS Input", href="/page-5", id="page-5-link"),
    #dbc.NavLink("Build Ebands Input",href="/page-5", id="page-5-link"),
    #dbc.NavLink("Build DFPT Input",href="/page-5", id="page-5-link"),
    #dbc.NavLink("Build G0W0 Input",href="/page-5", id="page-5-link"),
    dbc.NavLink("About", href="/page-6", id="page-6-link"),
]
num_pages = len(pages)

sidebar = html.Div(
    [
        sidebar_header,
        # we wrap the horizontal rule and short blurb in a div that can be hidden on a small screen
Esempio n. 15
0
    "background-color": "#f8f9fa",
}

CONTENT_STYLE = {
    "margin-left": "18rem",
    "margin-right": "2rem",
    "padding": "2rem 1rem",
}

sidebar = html.Div(
    [
        html.H2("Sidebar", className="display-4"),
        html.Hr(),
        dbc.Nav(
            [
                dbc.NavLink("Home\n\n", href="/", active="exact"),
                html.Br(),
                html.Br(),
                dbc.NavLink("Timeline Exploration,\n\n",
                            href="/page-1",
                            active="exact"),
                html.Br(),
                html.Br(),
                dbc.NavLink(
                    "Data Analysis,\n\n", href="/page-2", active="exact"),
            ],
            vertical='md',
            pills=True,
        ),
    ],
    style=SIDEBAR_STYLE,
Esempio n. 16
0
     'height': 25,
     'alt': 'CoreUI Logo'
 },
                    minimized={
                        'src': '/assets/images/sygnet.svg',
                        'width': 30,
                        'height': 30,
                        'alt': 'CoreUI Logo'
                    }),
 duc.appsidebartoggler(id='appsidebartogglermd',
                       className='d-md-down-none',
                       display='lg'),
 dbc.Nav([
     dbc.NavItem(dbc.NavLink([
         html.I(className='cui-bell icons font-xl d-block'),
         dbc.Badge('5', pill=True, color='danger')
     ],
                             href='#'),
                 className='d-md-down-none'),
     dbc.NavItem(dbc.NavLink(
         html.I(className='cui-list icons font-xl d-block'),
         href='#'),
                 className='d-md-down-none'),
     dbc.NavItem(dbc.NavLink(
         html.I(className='cui-location-pin icons font-xl d-block'),
         href='#'),
                 className='d-md-down-none'),
     duc.appheaderdropdown([
         dbc.DropdownMenu([
             dbc.DropdownMenuItem('User Info'),
             dbc.DropdownMenuItem('Logout Max Mustermann')
Esempio n. 17
0
import dash
import dash_table
import numpy as np
from dash.dependencies import Output, Input, State
import dash_bootstrap_components as dbc
import plotly.express as px

# Connect to main app.py file
from app import app
from app import server

# Connect to your app pages
from apps import home, data_table, stocks, home2, client

nav = dbc.Nav([
    dbc.NavItem(dbc.NavLink("Home", active=True, href='/apps/home')),
    dbc.NavItem(dbc.NavLink("Home2", href='/apps/home2')),
    dbc.NavItem(dbc.NavLink("Client Page", href='/apps/client')),
    dbc.NavItem(dbc.NavLink("Stocks Page", href='/apps/stocks')),
    dbc.NavItem(dbc.NavLink("Data Table", href='/apps/datatable')),
],
              className="breadcrumb")

app.layout = html.Div([
    dcc.Store(id='coy_session', storage_type='session'),
    dcc.Store(id='client_session', storage_type='session'),
    dcc.Location(id='url', refresh=False),
    nav,
    # html.Div([
    #     dcc.Link('Home | ', href='/apps/home'),
    #     dcc.Link('Home2 | ', href='/apps/home2'),
Esempio n. 18
0
import dash_bootstrap_components as dbc

nav = dbc.Nav(
    [
        dbc.NavLink("Active", active=True, href="#"),
        dbc.NavLink("A link", href="#"),
        dbc.NavLink("Another link", href="#"),
        dbc.NavLink("Disabled", disabled=True, href="#"),
    ]
)
Esempio n. 19
0
        html.Div(
            [
                html.Hr(),
                html.P(
                    "A responsive sidebar layout with collapsible navigation "
                    "links.",
                    className="lead",
                ),
            ],
            id="blurb",
        ),
        # use the Collapse component to animate hiding / revealing links
        dbc.Collapse(
            dbc.Nav(
                [
                    dbc.NavLink("Home", href="/", active="exact"),
                    dbc.NavLink("Page 1", href="/page-1", active="exact"),
                    dbc.NavLink("Page 2", href="/page-2", active="exact"),
                ],
                vertical=True,
                pills=True,
            ),
            id="collapse",
        ),
    ],
    id="sidebar",
)

content = html.Div(id="page-content")

app.layout = html.Div([dcc.Location(id="url"), sidebar, content])
Esempio n. 20
0
    "top": 0,
    "left": 0,
    "background-color": "#161a28",
    "overflow-x": "hidden",
    "transition": "0.3s",
    "padding-top": "1rem",
}

# sidebar object
sidebar = html.Div([
    html.H2("Moodle Analytics", className="display-4"),
    html.Hr(),
    html.P("Iranian Education Dataset"),
    dbc.Nav(
        [
            dbc.NavLink("Kindergarten", href="/", active="exact"),
            dbc.NavLink("Grade School", href="/page-1", active="exact"),
            dbc.NavLink("High School", href="/page-2", active="exact"),
        ],
        vertical=True,
        pills=True,
    ),
    html.Hr()
],
                   id="sidebar",
                   style=SIDEBAR_STYLE)

# button object
button = html.Div(
    [dbc.Button("☰", outline=True, id="show_hide", color="light")],
    id="button",
Esempio n. 21
0
def render_page_content(pathname):
    
    return html.Div([
        dbc.NavbarSimple(
    children=[
        dbc.NavItem(dbc.NavLink("Page 1", href="#")),
        dbc.DropdownMenu(
            children=[
                dbc.DropdownMenuItem("More pages", header=True),
                dbc.DropdownMenuItem("Page 2", href="#"),
                dbc.DropdownMenuItem("Page 3", href="#"),
            ],
            nav=True,
            in_navbar=True,
            label="More",
        ),
    ],9
    brand="NavbarSimple",
    brand_href="#",
    color="primary",
    dark=True,
),card,html.br()
    dcc.Tabs([
        dcc.Tab(label='Tab one', children=[
            dcc.Graph(
                figure={
                    'data': [
                        {'x': [1, 2, 3], 'y': [4, 1, 2],
                            'type': 'bar', 'name': 'SF'},
                        {'x': [1, 2, 3], 'y': [2, 4, 5],
                         'type': 'bar', 'name': u'Montréal'},
                    ]
                }
            )
        ]),
        dcc.Tab(label='Tab two', children=[
            dcc.Graph(
                figure={
                    'data': [
                        {'x': [1, 2, 3], 'y': [1, 4, 1],
                            'type': 'bar', 'name': 'SF'},
                        {'x': [1, 2, 3], 'y': [1, 2, 3],
                         'type': 'bar', 'name': u'Montréal'},
                    ]
                }
            )
        ]),
        dcc.Tab(label='Tab three', children=[
            dcc.Graph(
                figure={
                    'data': [
                        {'x': [1, 2, 3], 'y': [2, 4, 3],
                            'type': 'bar', 'name': 'SF'},
                        {'x': [1, 2, 3], 'y': [5, 4, 3],
                         'type': 'bar', 'name': u'Montréal'},
                    ]
                }
            )
        ]),
    ])
])
Esempio n. 22
0
            vertical=True,
            pills=True,
        ),
        html.Hr(),
        html.H5("🍜 Ramen ratings", className="fs-5 sideBarDatasetTitles"),
        dbc.Nav(
            sidebar_tabs(sidebar_tabs_ram, tag='ram'),
            vertical=True,
            pills=True,
        ),
        html.Hr(),
        dbc.Nav(
            html.H5(children=[
                dbc.NavLink('⭐ Instructions',
                            id='instructionsName',
                            href='/instructions',
                            active='exact',
                            external_link=True,
                            className="instructions")
            ]),
            vertical=True,
            pills=True,
        ),
    ],
    style=SIDEBAR_STYLE,
)

# MAIN CONTENT
content = html.Div(id="page-content", style=CONTENT_STYLE)

# APP LAYOUT CALL
app.layout = html.Div([
Esempio n. 23
0
# from index import DISPLAY_HISTORY
PLOTLY_LOGO = 'assets/favicon.png'

# DISPLAY_OFFLINE = ''
DISPLAY_HISTORY = ''
search_bar = dbc.Row(
    [
        #dbc.Col(dbc.Input(type="search", placeholder="Search")),
        dbc.Col(
            dbc.NavLink(html.A('HOME',
                               href=URL + '/index',
                               target='',
                               style={
                                   'text-decoration': 'none',
                                   'color': 'white'
                               }),
                        active=True,
                        className='testHover',
                        style={
                            'text-decoration': 'none',
                            'color': 'white',
                            'font-size': '1.5rem'
                        })),
        # dbc.Col(dbc.NavLink(
        #     html.A('PERSONAL_DATA_MANAGEMENT', href=URL + '/genome-dictionary-management', target='',
        #            style={'text-decoration': 'none', 'color': 'white'}),
        #     active=True,
        #     className='testHover', style={'text-decoration': 'none', 'color': 'white', 'font-size': '1.5rem', 'display': DISPLAY_OFFLINE})),
        dbc.Col(
            dbc.NavLink(html.A('MANUAL',
                               href=URL + '/user-guide',
                               target='',
Esempio n. 24
0
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    IPDD is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with IPDD. If not, see <https://www.gnu.org/licenses/>.
"""
import dash_bootstrap_components as dbc
from dash import html

# configuring a navbar
navbar = dbc.NavbarSimple(
    children=[
        dbc.NavItem(dbc.NavLink("Start IPDD", href="/apps/app_manage_files")),
    ],
    brand="IPDD Framework - Interactive Process Drift Detection Framework",
    color="primary",
    dark=True,
)

info_ipdd = [
    dbc.CardBody([
        html.H5(
            "The Interactive Process Drift Detection (IPDD) Framework is a tool for process drift visual "
            "analysis.",
            className="card-text"),
        html.H5(dbc.CardLink(children='Start IPDD here',
                             href="/apps/app_manage_files"),
                className="card-text mt-3"),
Esempio n. 25
0
def render_page_content(pathname):
    if pathname == "/":
        return html.Img(src="https://i.ibb.co/ZdZdGzY/Presentation1.gif")
    elif pathname == "/eastern-conference":

        response = requests.get("http://gateway:9999/retrieve/east")

        standings_json = response.json()
        standings = pd.json_normalize(standings_json,
                                      record_path=['0', 'Standings'])
        df_cleaned_standings = standings[[
            'TeamCity', 'TeamName', 'Conference', 'ConferenceRecord',
            'PlayoffRank', 'Division', 'DivisionRecord', 'DivisionRank',
            'WINS', 'LOSSES', 'WinPCT'
        ]]
        df_east_standings = df_cleaned_standings[
            df_cleaned_standings['Conference'] == 'East']

        return html.Div(children=[
            dash_table.DataTable(
                id='east-standings-table',
                columns=[{
                    'name': i,
                    'id': i
                } for i in df_east_standings.columns],
                data=df_east_standings.to_dict('records'),
            ),
            html.Div(id='standing-table-container')
        ])
    elif pathname == "/western-conference":

        response = requests.get("http://gateway:9999/retrieve/west")

        standings_json = response.json()
        standings = pd.json_normalize(standings_json,
                                      record_path=['0', 'Standings'])
        df_cleaned_standings = standings[[
            'TeamCity', 'TeamName', 'Conference', 'ConferenceRecord',
            'PlayoffRank', 'Division', 'DivisionRecord', 'DivisionRank',
            'WINS', 'LOSSES', 'WinPCT'
        ]]
        df_west_standings = df_cleaned_standings[
            df_cleaned_standings['Conference'] == 'West']

        return html.Div(children=[
            dash_table.DataTable(
                id='west_standings-table',
                columns=[{
                    'name': i,
                    'id': i
                } for i in df_west_standings.columns],
                data=df_west_standings.to_dict('records'),
            ),
            html.Div(id='standing-table-container')
        ])
    elif pathname == "/team-view":

        if requests.get("http://auth0:3000/authorized").status_code == 301:
            response = requests.get("http://gateway:9999/results")

            results_json = response.json()
            results = pd.DataFrame.from_dict(results_json)

            results_df = results.transpose()
            print(results_df)
            results_df_cleaned = results_df[['TeamName', 'playoff_pct']]

            return dcc.Graph(id='premium',
                             config={'displayModeBar': False},
                             animate=True,
                             figure=px.line(results_df_cleaned,
                                            x='TeamName',
                                            y='playoff_pct'))

        return html.Div([
            dbc.NavLink(
                html.Img(src="https://i.ibb.co/K5y4f6N/vip-button.png"),
                href="http://localhost:3000",
                active="exact")
        ])

    # If the user tries to reach a different page, return a 404 message
    return dbc.Jumbotron([
        html.H1("404: Not found", className="text-danger"),
        html.Hr(),
        html.P(f"The pathname {pathname} was not recognised..."),
    ])
Esempio n. 26
0
import dash_html_components as html


header = dbc.Row(
    dbc.Col(
        html.H1(
            "My personal investments tracker", className="text-center text-dark mb-4"
        ),
        width=12,
    )
)

navbar = dbc.Navbar(
    [
        dbc.NavLink("Home", href="/", active="exact"),
        dbc.NavLink("FII", href="/fii", active="exact"),
        dbc.NavLink("Funds", href="/funds", active="exact"),
        dbc.NavLink("Stocks", href="/stocks", active="exact"),
    ],
    color="dark",
    className="justify-content-center nav-pills",
)

content = html.Div(id="page-content", children=[])

app.layout = html.Div(
    [
        dcc.Location(id="url"),
        header,
        navbar,
Esempio n. 27
0
# the styles for the main content position it to the right of the sidebar and
# add some padding.
CONTENT_STYLE = {
    "margin-left": "9rem",
    "margin-right": "2rem",
    "padding": "2rem 1rem",
}

sidebar = html.Div(
    [
        html.P("local DB", className="lead"),
        html.Hr(),
        dbc.Nav(
            [
                dbc.NavLink("TOP", href="/page-1", id="page-1-link"),
                dbc.NavLink("回収率分析", href="/page-2", id="page-2-link"),
                dbc.NavLink("KPI分析", href="/page-3", id="page-3-link"),
                dbc.NavLink("レース傾向", href="/page-4", id="page-4-link"),
                dbc.NavLink("レース情報", href="/page-5", id="page-5-link"),
                dbc.NavLink("レース結果", href="/page-8", id="page-8-link"),
                dbc.NavLink("グラフ例", href="/page-6", id="page-6-link"),
                dbc.NavLink("グラフ例2", href="/page-7", id="page-7-link"),
            ],
            vertical=True,
            pills=True,
        ),
    ],
    style=SIDEBAR_STYLE,
)
Esempio n. 28
0
data = Data()
graph = Graphs()

data.fetch_data()
preprocessed_df = data.preprocess_cases_data(data.df_us_cases)

app = dash.Dash(__name__, external_stylesheets=[dbc.themes.LUX])
server = app.server

navbar = dbc.Nav(
    className="nav nav-pills",
    children=[
        dbc.NavItem(
            dbc.NavLink([html.I(className="fa fa-github"), "  GitHub"],
                        href="https://github.com/sheelshah9",
                        active=True,
                        target="_blank")),
        dbc.NavItem(
            dbc.NavLink([html.I(className="fa fa-linkedin"), "  LinkedIn"],
                        href="https://www.linkedin.com/in/sheelshah09/",
                        active=True,
                        target="_blank"))
    ])

dropdown_state = dbc.FormGroup([
    html.H4("Select State"),
    dcc.Dropdown(id="state",
                 options=[{
                     'label': x,
                     'value': x
                 } for x in preprocessed_df.columns.tolist()],
Esempio n. 29
0
}

# padding for the page content
CONTENT_STYLE = {
    "margin-left": "18rem",
    "margin-right": "2rem",
    "padding": "2rem 1rem",
}

sidebar = html.Div(
    [
        html.H4("Active Learning", className="display-6"),
        html.Hr(),
        dbc.Nav(
            [
                dbc.NavLink("Home", href="/home", active="exact"),
                dbc.NavLink("Annotate", href="/annotate_info", active="exact"),
                dbc.NavLink("Annotation Statistics",
                            href="/annotate-stat",
                            active="exact"),
                dbc.NavLink("Project Report", href="/report", active="exact")
            ],
            vertical=True,
            pills=True,
        ),
    ],
    style=SIDEBAR_STYLE,
)

sidebar_content = html.Div(id="page-content", children=[], style=CONTENT_STYLE)
Esempio n. 30
0
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output

from app import app, server
from views import home, national, regional, local, maps
import data_handler as dh



app.layout = dbc.Container(
	[
		dcc.Location(id='url', refresh=False),

		dbc.NavbarSimple(
			children=[
				dbc.NavItem(dbc.NavLink("Início", href="/")),
				dbc.DropdownMenu(
					children=[
						# dbc.DropdownMenuItem("Evolução", header=True),
						dbc.DropdownMenuItem("Nacional", href="/national"),
						dbc.DropdownMenuItem("Regiões", href="/regional"),
						dbc.DropdownMenuItem("Concelhos", href="/local"),
					],
					nav=True,
					in_navbar=True,
					label="Evolução",
				),
				dbc.NavItem(dbc.NavLink("Mapas", href="/maps")),
			],
			dark=True,
			color="primary",