Example #1
0
def gen_layout(active=None):
    # yapf: disable
    return dbc.Navbar(
        [
            dbc.Nav(dbc.NavbarBrand("COVID-19 Latvia", href="/"), navbar=True),
            dbc.Nav([
                _gen_nav_time("Overview", "/overview", active),
                _gen_nav_time("Daily", "/daily", active),
                _gen_nav_time("14-day period", "/14day", active),
            ], horizontal="end", navbar=True),
        ],
    )
Example #2
0
def navbar():
    return dbc.Nav(
        [
            dbc.NavItem(dbc.NavLink("Status", active=True, href="#")),
            dbc.NavItem(dbc.NavLink("Stats", href="#")),
        ], pills=True
    )
Example #3
0
def router_dash(router_id):
    return html.Div([
        dcc.Interval(id="update", n_intervals=0, interval=60000),
        dbc.Nav(
            [
                dbc.NavItem(
                    dbc.NavLink(id='dash' + router_id,
                                children="Dashboard",
                                active=True,
                                href="#")),
                dbc.NavItem(
                    dbc.NavLink(id='nw' + router_id,
                                children="Network Health",
                                href="#")),
                dbc.NavItem(
                    dbc.NavLink(id='hw' + router_id,
                                children="Hardware Health",
                                href="#")),
                dbc.NavItem(
                    dbc.NavLink(id='sw' + router_id,
                                children="Software Health",
                                href="#"))
            ],
            pills=True,
            style={
                'paddingLeft': '5px',
                'paddingRight': '5px'
            },
            fill=True,
            justified=True,
        ),
        html.Div(id='dash_contents' + router_id,
                 children=router_dash_layout(router_id))
    ],
                    style={'paddingTop': '20px'})
Example #4
0
def sidebar() -> html.Div:
    """Example sidebar from:
    https://dash-bootstrap-components.opensource.faculty.ai/examples/simple-sidebar/page-2""" # noqa

    # the style arguments for the sidebar. We use position:fixed and a fixed width
    SIDEBAR_STYLE = {
        "position": "fixed",
        "top": 0,
        "left": 0,
        "bottom": 0,
        "width": "16rem",
        "padding": "2rem 1rem",
        "background-color": "#f8f9fa",
    }

    sidebar = html.Div(
        [
            html.H2("Sidebar", className="display-4"),
            html.Hr(),
            html.P("A simple sidebar layout with navigation links",
                   className="lead"),
            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,
            ),
        ],
        style=SIDEBAR_STYLE,
    )

    return sidebar
Example #5
0
def render_navbar():
    """Render the site navbar"""
    return dbc.Navbar(
        dbc.Container(children=[
            # Use row and col to control vertical alignment of logo / brand
            dbc.NavbarBrand(
                children=[
                    html.I(className="fas fa-carrot mr-1"), settings.HOME_BRAND
                ],
                id="page-brand",
            ),
            dbc.Nav(
                dbc.NavItem(
                    dbc.NavLink(
                        dcc.Upload(
                            id="upload-data",
                            children=[
                                html.I(
                                    className="fas fa-cloud-upload-alt mr-1"),
                                "upload files",
                            ],
                            multiple=True,
                        ),
                        className="btn btn-outline-secondary",
                        active=True,
                    ))),
        ]),
        color="primary",
        dark=True,
        id="page-navbar",
    )
Example #6
0
def get_sidebar():
    # the style arguments for the sidebar. We use position:fixed and a fixed width
    SIDEBAR_STYLE = {
        "position": "fixed",
        "top": 0,
        "left": 0,
        "bottom": 0,
        "width": "20rem",
        "padding": "3rem 2rem",
        "background-color": "#f8f9fa",
    }
    sidebar = html.Div(
        [
            html.Div(html.Img(src=app.get_asset_url('ptw_web4.png'), style={'height': '7vh'})),
            html.Hr(),
            dbc.Nav(
                [
                    dbc.NavLink('Station Anmeldung   ', href='/', id="page-1-link", style={'font-size': 15}),
                    dbc.NavLink('Station Spanen   ', href='/spanen', id="page-2-link", style={'font-size': 15}),
                    dbc.NavLink('Station Lackieren    ', href='/lackieren', id="page-3-link", style={'font-size': 15}),
                    dbc.NavLink('Station Montage   ', href='/montage', id="page-4-link", style={'font-size': 15}),
                ],
                vertical=True,
                pills=True,
            ),
        ],
        style=SIDEBAR_STYLE,
    )
    return sidebar
Example #7
0
def Header(username=None):
    return dbc.Nav([
        ConPlotBrand(),
        dbc.NavbarToggler(id="navbar-toggler"),
        UserAccountDropdownMenu(username),
    ],
                   justified=True)
Example #8
0
def make_header():
    return dbc.Nav(
        html.A("Dashboard",
               href="/",
               className="navbar-brand col-sm-3 col-md-2 mr-0"),
        className=
        "navbar navbar-dark fixed-top bg-dark flex-md-nowrap p-0 shadow")
Example #9
0
def NavBar(active):
    page1, page2, page3 = False, False, False,
    if active == "page1":
        page1 = True
    elif active == "page2":
        page2 = True
    elif active == "page3":
        page3 = True


    nav = dbc.Nav(
        [
            dbc.NavItem(dbc.Button("ALcool",outline=True,active=page1, href="page1",external_link=True,),className="p-2 bd-highlight"),
            dbc.NavItem(dbc.Button("Accident et legislation",outline=True, active=page2, href="page2",external_link=True,),className="p-2 bd-highlight"),
            dbc.NavItem(dbc.Button("Téléchargement",outline=True, active=page3, href="page3",external_link=True,),className="p-2 bd-highlight"),

            dbc.Row([
                dbc.NavItem(dbc.Input(type="search",placeholder="Recherche")),
                dbc.NavItem(dbc.Button("Recherche",color="primary"))
                ],
                no_gutters=True,
                className="ml-auto flex-nowrap mt-3 mt-md-0",
                align="center",
                )


        ],style={"background":"#212121"},

        pills=True,className="fixed-top"
    )
    return nav
Example #10
0
def dropdown_handler(pathname):
    if pathname is None:
        return ''
    page_type = url_parser(pathname)
    all_projects = session.query(Project).all()

    return dbc.Container([
        dbc.Row(
            className='w-100 align-items-center',
            children=[
                dbc.Col(width=2,
                        children=[
                            dbc.NavbarBrand(children=html.Img(
                                src="/assets/sanger_logo.png", height='50rem'),
                                            href="https://sanger.ac.uk"),
                        ]),
                dbc.Col(width=2,
                        children=[
                            dbc.NavbarBrand(children=html.Img(
                                src="/assets/logo_white.svg", height='40rem'),
                                            href="/"),
                        ]),
                dbc.Col(
                    width=8,
                    className="d-flex align-items-center justify-content-end",
                    children=[
                        dbc.Nav([
                            generate_navitem("Home", "/", "home", page_type),
                            dbc.DropdownMenu(
                                children=[
                                    dbc.DropdownMenuItem(
                                        f"{p.name}", href=f"/project/{p.slug}")
                                    for p in all_projects
                                ],
                                nav=True,
                                in_navbar=True,
                                label="Projects",
                            ),
                            dbc.DropdownMenu(children=[
                                dbc.DropdownMenuItem(
                                    f"{c.lib1.name} + {c.lib2.name} ({p.name})",
                                    href=
                                    f"/project/{p.slug}/combination/{c.lib1_id}+{c.lib2_id}"
                                ) for p in all_projects
                                for c in sorted(p.combinations,
                                                key=lambda x:
                                                f"{x.lib1.name}_{x.lib2.name}")
                            ],
                                             nav=True,
                                             in_navbar=True,
                                             label="Combinations",
                                             className="dropdown-combinations"
                                             ),
                            generate_default_navitem("Documentation",
                                                     page_type),
                            generate_default_navitem("Downloads", page_type)
                        ])
                    ])
            ])
    ])
Example #11
0
 def make_sidebar(self):
     sidebar_links = [
         dbc.NavLink(o.display_name, href=o.route, active="exact")
         for o in Config.SIDEBAR_OPTIONS
     ]
     return html.Div(
         [
             html.H3(id=ids.user_name_placeholder,
                     children=[],
                     className="display-5"),
             html.Hr(),
             dbc.Nav(sidebar_links, vertical=True, pills=True),
             # html.Button(
             #     # use the Bootstrap navbar-toggler classes to style
             #     html.Span(className="navbar-toggler-icon"),
             #     className="navbar-toggler",
             #     # the navbar-toggler classes don't set color
             #     style={
             #         "color": "rgba(0,0,0,.5)",
             #         "border-color": "rgba(0,0,0,.1)",
             #     },
             #     id="sidebar-toggle",
             # ),
         ],
         style=Config.SIDEBAR_STYLE)
Example #12
0
def nav_bar():

    navbar = html.Div(
        [
            html.Img(src=app.get_asset_url('citibike_logo.png'),
                     style={
                         'width': '100%',
                         'align': 'center'
                     }),
            html.H4("System Performance Dashboard",
                    className="display-10",
                    style={'textAlign': 'center'}),
            html.Hr(),
            dbc.Nav([
                dbc.NavLink("About", href="/about", active="exact"),
                dbc.NavLink("System", href="/system", active="exact"),
                dbc.NavLink("Station", href="/station", active="exact"),
            ],
                    pills=True,
                    vertical=True),
        ],
        style=NAVBAR_STYLE,
    )

    return navbar
def VCF_processing(contents, filename):
    if filename == None:
        layout = html.Div(children=[html.H5('Drag and Drop .vcf ')])
        return layout
    else:
        if '.vcf' not in filename:
            layout = html.Div(children=[
                html.H5('Incorrect file loaded'),
                dbc.Nav(
                    [dbc.NavItem(dbc.NavLink("Reset", href="/MainWindow"))],
                    fill=True)
            ])
            return layout
        format_Content = contents.split(',')
        file_information = format_Content[1]
        base64_bytes = file_information.encode('ascii')
        message_bytes = base64.b64decode(base64_bytes)
        file_Content = message_bytes.decode('ascii')
        file_Content = VCF_FileParse(file_Content, filename)
        if file_Content[0] == 'Error':
            return file_Content[1]
        File_details.append(file_Content)
        storeOptions.append(filename)
        PharmacoInformation[2] = filename
        layout = html.Div([html.H6(filename)])
    return layout
def Sidebar():

    # the style arguments for the sidebar. We use position:fixed and a fixed width
    SIDEBAR_STYLE = {
        "position": "fixed",
        "top": 60,
        "left": 0,
        "bottom": 0,
        "width": "16rem",
        "padding": "1rem 1rem",
        "background-color": "#f8f9fa",
    }

    sidebar = html.Div([
        html.H4("Sidebar", className="display-4"),
        html.Hr(),
        html.P("A simple sidebar layout with navigation links",
               className="lead"),
        dbc.Nav(
            [
                dbc.NavLink("Page 1", href="/page-1", id="page-1-link"),
                dbc.NavLink("Page 2", href="/page-2", id="page-2-link"),
                dbc.NavLink("Page 3", href="/page-3", id="page-3-link"),
            ],
            vertical=True,
            pills=True,
        ),
    ],
                       style=SIDEBAR_STYLE)

    return sidebar
Example #15
0
def footer():
    from app import home_route, nav_routes

    return [
        dbc.Row(
            dbc.Col(html.Hr(style={"margin-top": "64px"}), lg=12),
        ),
        dbc.Row(
            [
                dbc.Col(
                    [
                        dbc.Nav(
                            [
                                dbc.NavItem(
                                    dbc.NavLink(
                                        x[1], href=x[2], external_link=True
                                    )
                                )
                                for x in [home_route] + nav_routes
                            ],
                            vertical="md",
                        )
                    ],
                    lg=7,
                    style={"margin-bottom": "16px"},
                ),
                component_git_version(),
            ],
            style={"margin-bottom": "64px"},
        ),
    ]
Example #16
0
 def get_app_layout(self):
     return html.Div([
         dbc.Nav([
             html.H1("Image Head Classifier", style={"display": "block"}),
         ], className="navbar navbar-expand-lg navbar-dark bg-dark", style={"height": "100px", "display": "block"}),
         html.Img(src=self.app.get_asset_url('img/figure.png'),
                  style={"margin": "25px auto", "display": "block"}, alt=""),
         html.Div([
             dcc.Upload(
                 id='upload-image',
                 style={
                     'width': '90%', "display": "block", 'height': '75px', 'background': '#b5e4ff',
                     'lineHeight': '60px', 'borderWidth': '1px', 'borderStyle': 'dashed', 'borderRadius': '20px',
                     'textAlign': 'center', 'margin': '0 auto'
                 }, multiple=True,
                 children=html.Div([
                     'Drag and Drop or ',
                     html.A('Select Files')
                 ]),
             ),
             html.Div(id='output-predict', style={"display": "block", "margin": "3em auto 0 auto", "width": "90%"}),
         ], id="predictions", style={"width": "49%", "display": "inline-block", "vertical-align": 'top'}),
         html.Div([
             dcc.Input(id="input", type="text", className="form-control",
                       placeholder="Enter a name from the aboves ones",
                       style={"width": "80%", "type": "submit", "display": "inline-block"}),
             html.Button('Search', className="btn btn-primary", id='sub',
                         style={"width": "20%", "vertical-align": "top", "display": "inline-block"}),
             dcc.Loading(id="loading-1", type="default", style={"margin-top": "3em"}, children=html.Div(id="loading-output-1")),
             html.Div(id='output-search', style={"margin-top": "4.5em"}),
         ], id="search", style={"display": "inline-block", "margin-top": "1em", "width": "49%"}),
     ], )
Example #17
0
def get_sidebar():
    return html.Div(
        [
            dbc.Nav(
                [
                    html.Br(),
                    dbc.NavItem(
                        dbc.NavLink("Dashboard", disabled=True, href="#")),
                    dbc.NavItem(
                        dbc.NavLink("Sleep Time",
                                    href="/sleep-time",
                                    id="sleep-time")),
                    dbc.NavItem(
                        dbc.NavLink(
                            "Daily Routine", href="/routine", id="routine")),
                    dbc.NavItem(dbc.NavLink("Mess", href="/mess", id="mess")),
                    dbc.NavItem(
                        dbc.NavLink("Major Events",
                                    href="/major_events",
                                    id="major_events")),
                    dbc.NavItem(
                        dbc.NavLink("Sleep Pattern",
                                    href="/sleep_pattern",
                                    id="sleep_pattern")),
                ],
                vertical=True,
                pills=True,
            ),
        ],
        className="col col-2",
        style=SIDEBAR_STYLE,
    )
Example #18
0
def nav_menu():
    nav = dbc.Nav(
        [
            dbc.NavLink("Cluster", href='/page-1', id='page-1-link', style=STYLE_1),
        ],
        pills=True
        )
    return(nav)
Example #19
0
def get_navbar():
    PLOTLY_LOGO = "/assets/cepel-logo.png"

    #nav_item_home = dbc.NavItem(dbc.NavLink("Home", href="#"))
    #nav_item_about = dbc.NavItem(dbc.NavLink("About", href="#"))
    nav_item_github = dbc.NavItem([
        dbc.NavLink([
            html.A(
                [
                    html.Img(src="/assets/GitHub-Mark-Light-64px.png",
                             className="github-logo"),
                    html.P("GitHub",
                           style={
                               'display': 'inline',
                               'color': '#EBEBEB'
                           })
                ],
                href="https://github.com/tolgahancepel/telco-customer-churn")
        ])

        # dbc.NavLink("GitHub", href="https://github.com/tolgahancepel/telco-customer-churn", style={'display':'inline'})
    ])

    logo = dbc.Navbar(
        dbc.Container([
            html.A(
                dbc.Row(
                    [
                        dbc.Col(
                            html.Img(src=PLOTLY_LOGO,
                                     height="30px",
                                     style={'margin': '8px 0px'})),
                    ],
                    align="center",
                    no_gutters=True,
                ),
                href="https://plot.ly",
            ),
            dbc.NavbarToggler(id="navbar-toggler"),
            dbc.Collapse(
                dbc.Nav(
                    [
                        #nav_item_home,
                        #nav_item_about,
                        nav_item_github
                    ],
                    className="ml-auto",
                    navbar=True),
                id="navbar-collapse",
                navbar=True,
            ),
        ]),
        color="primary",
        dark=True,
        className="mb-5",
    )

    return logo
            def set_sidebar_items(path, data, ts):

                data = self.atualiza_data_perm(data, ts)
                sidebar_children = dbc.Nav(
                    self._auto_generate_sidebar_items(data),
                    vertical=True,
                    pills=True,
                )
                return sidebar_children
Example #21
0
def navigationbar():
    nav = dbc.Nav([
        dbc.NavItem(dbc.NavLink("Home", href="/home")),
        dbc.NavItem(dbc.NavLink("Players", href="/players")),
        dbc.NavItem(dbc.NavLink("Games", href="/games")),
    ],
                  fill=True,
                  pills=True)
    return nav
Example #22
0
def get_nav_bar():
    navigation_links = []
    for link in links:
        navigation_links.append(
            dbc.NavItem(
                dbc.NavLink(link['name'],
                            active=True,
                            href=link['link'],
                            className=link['class'])))
    return dbc.Nav(navigation_links, vertical="md", className="sidenav")
def produce_sidebar():
    return html.Div(
    [
        html.A("Blunck's Lab", href="http://www.biophys.umontreal.ca/bluncklab/", className="navbar-brand",
               style={"color": "#000061", 'font-size': '37px', 'margin-top': '-20px'}
               ),
        html.Hr(),
        html.P(
            "A Simple UI to Integrate Kinetics Data for Research on Ion Channels (&mutants)",
            className="lead",
            style={'font-size': '1.1rem'}
        ),
        html.Hr(),
        dbc.Nav(
            [
                dbc.NavLink("Ion Channels Kinetics", href="/page-1", id="page-1-link"),
                dbc.NavLink("About", href="/page-2", id="page-2-link"),
                dbc.NavLink("Contact", href="/page-3", id="page-3-link"),
            ],
            vertical=True,
            pills=True,
        ),
        html.Hr(),
        html.Div(
            html.A(
                html.Img(
                    src='data:image/png;base64,{}'.format(ENCODED_IMG_GEPROM.decode()),
                    style={
                        "width": "75%",
                        "text-align": "center",
                        "margin-top": "10px"
                        }
                ),
                href="http://www.biophys.umontreal.ca/geprom/"
            ),
            style={
                "padding": "10px",
                "text-align": "center"
            }
        ),
        html.Div(
            html.A(
                html.Img(src='data:image/png;base64,{}'.format(ENCODED_IMG_UDEM.decode()),
                         style={"width": "75%", 'text-align': 'center'}),
                href="https://www.umontreal.ca/"
            ),
            style={
                "padding": "10px",
                "text-align": "center",
                "margin-top": "0px"
            }
        ),
    ],
        style=SIDEBAR_STYLE,
    )
def sideNavBar(subject: str, topics: List[str], selected: str):
    #TODO revisar si como agregar dinamicamente la ruta al index o como escaparla
    navItems = [
        dbc.NavItem(dbc.NavLink(topic, active=True, href=subject + '/' +
                                topic))
        if topic == selected else dbc.NavItem(
            dbc.NavLink(topic, active=False, href=subject + '/' + topic))
        for topic in topics
    ]
    nav = dbc.Nav(navItems, vertical="md", navbar=True)
    return nav
Example #25
0
def Sidebar(sidebar_entries, active_item):
    header = html.H1("Components", className="h5")
    items = [
        SidebarItem(
            entry.heading,
            f"/l/components/{entry.slug}",
            active_item == entry.slug,
        ) for entry in sidebar_entries
    ]
    nav = dbc.Nav(items, className="flex-column")
    return [header, nav]
Example #26
0
    def __init__(self):
        global app
        self.url = dcc.Location(id="url")
        self.icons = [
            'fa fa-home fa-1x',
            'fa fa-cog fa-1x',
            'fa fa-tachometer-alt fa-1x',
            'fa fa-file fa-1x',
        ]
        self.icon_text = ['Home', 'Settings', 'Score', 'Info']
        self.formated_icons = self.format_icons()
        self.nav1 = dbc.ButtonGroup(self.formated_icons[:-1], vertical=True)
        self.nav2 = dbc.ButtonGroup(self.formated_icons[-1], vertical=True)
        self.layout = dbc.Nav(className="navbar bg-dark",
                              style={
                                  'width': '4rem',
                                  'height': '98vh',
                                  'padding': "0"
                              },
                              vertical=True,
                              pills=True,
                              children=[self.nav1, self.nav2])

        self.layout_insitu = html.Div(
            className="",
            style={'height': '100vh'},
            children=[
                self.url,
                dbc.Col([
                    dbc.Row(
                        dbc.Nav(className="navbar bg-dark",
                                style={
                                    'width': '100%',
                                    'height': '2vh'
                                })),
                    dbc.Row([
                        self.layout,
                        dbc.Col(id='page-content', style={'padding': '0'})
                    ])
                ])
            ])
Example #27
0
def get_header():
    logo_img_url = 'http://neomorph.salk.edu/omb_static/dissection_region_img/navbar_icon.gif'
    nav = dbc.Row(
        [
            dbc.Nav([
                dbc.NavItem(dbc.NavLink('Home', href=f"/{APP_ROOT_NAME}home")),
                dbc.NavItem(
                    dbc.NavLink('Gene',
                                href=f"/{APP_ROOT_NAME}gene?gene=Cux2")),
                dbc.DropdownMenu([
                    dbc.DropdownMenuItem('Region Table',
                                         href=f"/{APP_ROOT_NAME}br_table"),
                    dbc.DropdownMenuItem(
                        'Region Viewer',
                        href=f"/{APP_ROOT_NAME}brain_region?br=MOp")
                ],
                                 label='Brain Region',
                                 nav=True,
                                 in_navbar=True),
                dbc.DropdownMenu([
                    dbc.DropdownMenuItem('Cell Type Table',
                                         href=f'/{APP_ROOT_NAME}ct_table'),
                    dbc.DropdownMenuItem(
                        'Cell Type Viewer',
                        href=f'/{APP_ROOT_NAME}cell_type?ct=Exc')
                ],
                                 label='Cell Type',
                                 nav=True,
                                 in_navbar=True),
                dbc.NavItem(
                    dbc.NavLink('Paired Scatter',
                                href=f"/{APP_ROOT_NAME}scatter")),
            ],
                    className='mr-5',
                    navbar=True,
                    style={'font-size': '1.4em'})
        ],
        className="ml-2 flex-nowrap mt-3 mt-md-0",
        align="center",
    )

    navbar = dbc.Navbar([
        html.A(dbc.Row([dbc.Col(html.Img(src=logo_img_url, height='50px'))],
                       align='left',
                       no_gutters=True),
               href=f"/{APP_ROOT_NAME}",
               className='mx-3'),
        dbc.NavbarToggler(id="navbar-toggler"),
        dbc.Collapse(nav, id="navbar-collapse", navbar=True),
    ],
                        color='light',
                        className='fixed-top mb-2 p-2')
    return navbar
def Nav():
    nav = dbc.Nav(
        [
            dbc.Row(
                [
                dbc.NavItem(dbc.NavLink("Hate Speech Automatic Detector", active=True, href="/user",style={'color': colors['text']})),
                dbc.NavItem(dbc.NavLink("How the algorithm is built", href="/algorithm", style={'color': colors['text']})),
                ],
                style={"marginTop": 10, "marginBottom":20}
            )
        ]
    )
    return nav
Example #29
0
def CollapseBar(active):

    Vnav = dbc.Collapse(
                dbc.Nav(
                    [
                        dbc.NavLink("Graphe jeune"),

                    ],
                    vertical = True,

                ),
                id = "collapse",
    )
Example #30
0
def sidebar_filters(attr_prop, disable=False):
    div_filters = []
    for k, v in attr_prop.items():
        if len(k) > 1:
            div_filters.append(div_dropdown(v['label'], k, disable))
            div_filters.append(html.Br())

    return html.Div([
        dbc.Nav(
            div_filters,
            vertical=True,
            pills=True)],
        style=SIDEBAR_STYLE)