Beispiel #1
0
            id=DARK_THEME_COMPONENTS,
            children=[
                daq.DarkThemeProvider(theme=theme, children=root_layout)
            ],
        ),
        html.Br(),
        html.Footer(
            className="footer",
            children=[
                html.Div(
                    html.A(
                        href="https://sahaab.io",
                        children=[
                            html.Img(
                                className=HOVER_BOB,
                                src=app.get_asset_url("sahaab-logo.png"),
                                alt="Sahaab Logo",
                                style={"max-width": "50px"},
                            )
                        ],
                    )),
                "made with 💙 at ",
                html.A("sahaab.io", href="https://sahaab.io"),
            ],
        ),
    ],
)


@app.callback(Output(PAGE_CONTENT, CHILDREN), [Input(URL, "pathname")])
def display_page(pathname):
Beispiel #2
0
            'width': '600px'
        })
    ])
    div2 = html.Div(id='div2',
                    style={
                        'border': '2px solid black',
                        'float': 'right'
                    },
                    children=[option2, option3, p,
                              fig2])  # weekly case bar chart
    br = html.Br()

    f_div = html.Div(id='footer_div',
                     children=[html.P(children=["This is footer"])],
                     style={''})
    footer = html.Footer(children=[f_div])

    app.layout = html.Div(style={
        'height': '700px',
        'width': '1300px'
    },
                          children=[div1, div2, br, footer])

    @app.callback(Output('graph1', 'figure'), [Input('options1', 'value')])
    def update_page(county_name):
        print(county_name)
        dates = list(county_data[county_name]['Test Date'])[::-1]
        #print(dates, min_date, max_date)

        return {
            'data': [{
Beispiel #3
0
                   'margin-top': 10,
                   'margin-left': 'auto',
                   'margin-right': 'auto',
                   'margin-bottom': 40,
                   'width': 1100
               }),
    html.Footer(children=[
        html.Div(children=[
            'Made by Joules CH -  ',
            html.A('GitHub', href='https://github.com/JoulesCH')
        ],
                 style={
                     'textAlign': 'center',
                     'margin': 10,
                     'margin-left': 'auto',
                     'margin-right': 'auto'
                 })
    ],
                style={
                    'width': 777,
                    'border-top-style': 'double',
                    'border-top-color': '#1866B9',
                    'margin-left': 'auto',
                    'margin-right': 'auto',
                    'margin-top': 15
                })
])


@app.callback(Output('Semestre', 'options'), [Input('Carrera', 'value')])
def set_dict(carrera):
    global group_dict
Beispiel #4
0
 html.Div([
     html.Footer(
         [
             html.Label([
                 "Data Visualization | June 2020 | Carlos Pereira, M20190426 |"
                 " Cátia Duro, M20190394 | João Miguel Lopes, M20190465 | Marta Faria, M20190178"
             ]),
             html.Label([
                 " | Data available at: ",
                 html.
                 A("OECD",
                   href=
                   "https://www.oecd.org/migration/mig/oecdmigrationdatabases.htm",
                   target="_blank"),
                 " and ",
                 html.A("Our World in Data",
                        href="https://ourworldindata.org/charts",
                        target="_blank"),
             ])
         ],
         style={
             'width': '100%',
             'display': 'inline-block',
             'color': '#111',
             'font-family': 'sans-serif',
             'font-size': '12px',
             'text-align': 'center',
             'vertical-align': 'middle',
             'font-weight': 'bold',
             'padding': '5px'
         })
 ])
    # html.Br(),
    html.Div(style={"background-color":"lavender", "padding-bottom":"100px"},children=[
    html.Div(style={ "background-color":"lightgrey"},children=[
    html.Img(src='data:image/png;base64,{}'.format(ENCODED_IMAGE), style={'width': '100%',
                                                                          'height':'800px' 
                                                                          })]),      
    dcc.Link('Input audio file', href='/page-1', style={'marginBottom': "20px", 'marginTop': "30px", 'color': 'green'}),
    html.Br(),
    dcc.Link('FTP status', href='/page-3', style={'marginBottom': 20, 'marginTop': 45, 'color':'green'}),
    html.Br(),
    dcc.Link('Sound Library', href='/page-4', style={'marginBottom':20, 'marginTop':45, 'color': 'green', 'fontSize':20})]),
    html.Footer('\xc2\xa9'+ ' Copyright WildlyTech Inc. 2019 ' ,style={"position":"fixed",
      "left":"0",
      "bottom":"0",
      "height":"4%",
      "width":"100%",
      "background-color":"black",
      "color":"white",
      "padding":"20px",
      "textAlign":"center"
      })   
    ])

################################################################################
                         #page one Layout#
################################################################################


PAGE_1_LAYOUT = html.Div(id='out-upload-data', children=[
    html.Div(style={"background-color":"green", "padding":"2px"},children=[
    html.H1('Upload audio Files', style={'color': 'white', 'fontSize': 30, 'textAlign': 'center'})]),
    html.Div(id='display-play_1'),
Beispiel #6
0
                               'label': i,
                               'value': i
                           } for i in ['Linear', 'Logarithmic']],
                           value='Linear')
        ],
                 style={
                     'box-shadow': '#8fc5f9 5px 5px 5px',
                     'width': '210px'
                 })
    ],
             style={
                 'columnCount': 2,
                 'margin-bottom': '40px'
             }),
    dcc.Graph(id='graph'),
    html.Footer(["2020 Giannis Tolios"], style={'float': 'right'})
],
                      style={
                          'width': '880px',
                          'margin': '30px'
                      })


@app.callback(Output('graph', 'figure'), [
    Input('select-country', 'value'),
    Input('scale', 'value'),
    Input('confirmed', 'value'),
    Input('deaths', 'value'),
    Input('recovered', 'value'),
    Input('govt_measures', 'value')
])
Beispiel #7
0
content = html.Div(id="page-content", style=CONTENT_STYLE)

footer = html.Footer(
    className='page-footer',
    style=FOOTER_STYLE,
    children=html.Div(
        id='footer',
        className='container-fluid text-center',
        children=[
            html.Span(
                className='text-muted align-middle',
                style={'float': 'right', 'margin-bottom': 10},
                children=[
                    html.Span(
                        'Made by',
                        className='text-muted',
                        style={
                            'margin-right': 10,
                            'font-size':'12px',
                        }
                    ),
                    html.Img(src='https://i.stack.imgur.com/wSpIb.png', style=IMAGE_FOOTER_STYLE1),
                    html.Img(src='https://www.datopian.com/img/datopian-logo.png', style=IMAGE_FOOTER_STYLE2),
                ],
            ),
            html.H5()
        ]
    )
)

def generate_layout():
Beispiel #8
0
        dbc.Col(dbc.Input(id="ticker", debounce=True, placeholder="Enter a Stock Ticker...", type="text"), width=5, align='center'),
        dbc.Col(dbc.RadioItems(options = [
            {"label": "1Y", "value": "1Y"},
            {"label": "6M", "value": "6M"},
            {"label": "3M", "value": "3M"},
            {"label": "1M", "value": "1M"},
        ], value="1Y", inline=True, id="time_period"))
    ], style={'margin-top': '30px'}, justify='center'),

    # Graph 
    dbc.Row([
        dbc.Col(dbc.Spinner(color="primary", children = dcc.Graph(id="graph")))

    ]),

    dbc.Row([dbc.Col(html.Footer("Data Source - Yahoo Finance(yfinance). Do not consider this site for your investment decisions. Please do your due deligience."))], justify='center')
], style={'margin-top': '100px'})


@app.callback(
    Output(component_id="graph", component_property="figure"),
    [Input(component_id="ticker", component_property="value"),
    Input(component_id="time_period", component_property="value")]
)
def plot_graph(ticker_symbol, time_period):

    # Default Stock Data to Display
    if(ticker_symbol is None):
        ticker_symbol = "^NSEI"

Beispiel #9
0
                html.H6("Základní statistiky (průměr zvoleného období)",
                        style={"text-align": "center", "vertical-align": "middle"}),
                html.Div(dash_t)]
                     ),

        ])
    ]),
    html.Div(className="row", children=[
        html.Footer(children=[
            html.Div(className="row",
                     style={"padding-top": "25px"},
                     children=[
                         html.A("Statistiky nezaměstnanosti získány z mpsv",
                                href="https://portal.mpsv.cz/sz/stat/nz/qrt", className="six columns",
                                style={"vertical-align": "right", "text-align": "right"}),
                         html.A("Statistiky počtu obyvatel získány z czso",
                                href="https://www.czso.cz/csu/czso/databaze-demografickych-udaju-za-obce-cr",
                                className="six columns", style={"vertical-align": "left", "text-align": "left"}),
                     ]),
            html.Div(children=[
                dcc.Markdown("[Made] (https://github.com/LavinaVRovine/cz_employment) for fun in Brno, Czechia 2019"),
                html.A("Pavel Klammert", href="http://www.klammert.cz/")
            ], style={"vertical-align": "center", "text-align": "center"})
        ])
    ])
])

app.layout = layout
app.title = "Statistiky nezaměstnanosti v ČR"


@app.callback(
Beispiel #10
0
                 'width': '49%',
                 'display': 'inline-block'
             })

    # html.Div(id='display-selected-values')
])

app.layout = html.Div(children=[
    html.H1(children='Covid-19 Trends', style={'textAlign': 'center'}),
    html.Br(), dropdown_layout,
    html.H3(id='display-selected-values', style={'textAlign': 'center'}),
    dcc.Graph(id='confirmed-trend'),
    dcc.Graph(id='recovered-trend'),
    dcc.Graph(id='death-trend'),
    html.Hr(),
    html.Footer(footer_text_md)
])


@app.callback(Output('states-dd', 'options'), [Input('countries-dd', 'value')])
def set_state_options(selected_country):
    return [{'label': i, 'value': i} for i in regions[selected_country]]


@app.callback(Output('states-dd', 'value'), [Input('states-dd', 'options')])
def set_state_value(available_options):
    return available_options[0]['value']


@app.callback(Output('display-selected-values', 'children'),
              [Input('countries-dd', 'value'),
Beispiel #11
0
import dash_html_components as html
from dash.dependencies import Input, Output
from app import app
from apps.header import header
from apps.navbar import navbar
from apps.footer import footer
from apps.graph_examples import graph_examples
from apps.table_examples import table_examples
from apps.rows_columns import rows_columns
from apps.callback_example import callback_example

app.layout = html.Div([
    html.Header(header.layout()),
    html.Nav(navbar.layout()),
    html.Main(id='page-content'),
    html.Footer(footer.layout())
], className='container')

# input from sidebar.py
@app.callback(Output('page-content', 'children'), [Input('url', 'pathname')])
def display_page(pathname):
    if pathname == '/':
        return graph_examples.layout()
    elif pathname == '/graph_examples':
        return graph_examples.layout()
    elif pathname == '/table_examples':
        return table_examples.layout()
    elif pathname == '/rows_columns':
        return rows_columns.layout()
    elif pathname == '/callback_example':
        return callback_example.layout()
Beispiel #12
0
        html.H1("US Accidents"),
        dbc.Tabs(
            [
                dbc.Tab(label="Main", tab_id="main"),
                dbc.Tab(label="Predictive", tab_id="predictive"),
            ],
            id="tabs",
            active_tab="main",
        ),
        html.Div(id="tab-content", className="p-4"),
        html.Footer([
            dbc.Badge("Project repo",
                      href="https://github.com/bahtman/socialdata",
                      color="primary",
                      className="mr-1"),
            dbc.Badge(
                "Explainer notebook",
                href=
                "https://github.com/bahtman/socialdata/blob/master/explainer_notebook.ipynb",
                color="success",
                className="mr-1"),
        ])
    ],
    fluid=True,
)
main = (html.H3("Filter the weather conditions:"), control(0),
        dbc.Row([
            dbc.Col(dcc.Graph(id='sev'), md=6),
            dbc.Col(dcc.Graph(id='states'), md=6)
        ]), kpis, USmap)

tour = html.Div([
Beispiel #13
0
def render_footer():
    """Render page footer"""
    return html.Footer(
        html.Div(
            children=[
                html.Div(
                    children=[
                        html.Div(
                            children=[
                                html.Span("SCelVis v%s by BIH CUBI" %
                                          __version__,
                                          className="text-muted")
                            ],
                            className="col-5",
                        ),
                        html.Div(
                            children=[
                                html.A(
                                    children=[
                                        html.I(
                                            className="fas fa-book-open mr-1"),
                                        "Publication",
                                    ],
                                    href="https://peerj.com/articles/8607/",
                                    className="text-muted mr-3",
                                ),
                                html.A(
                                    children=[
                                        html.I(className="fas fa-book mr-1"),
                                        "Manual & Tutorial",
                                    ],
                                    href="https://scelvis.readthedocs.io",
                                    className="text-muted mr-3",
                                ),
                                html.A(
                                    children=[
                                        html.
                                        I(className="fas fa-globe-europe mr-1"
                                          ),
                                        "CUBI Homepage",
                                    ],
                                    href="https://www.cubi.bihealth.org",
                                    className="text-muted mr-3",
                                ),
                                html.A(
                                    children=[
                                        html.I(className="fab fa-github mr-1"),
                                        "GitHub Project",
                                    ],
                                    href="https://github.com/bihealth/scelvis",
                                    className="text-muted",
                                ),
                            ],
                            className="col-7 text-right",
                        ),
                    ],
                    className="row",
                )
            ],
            className="container",
        ),
        className="footer",
    )
    html.Div([dcc.Markdown(description_text)],
             style={
                 'padding-left': '10px',
                 'padding-right': '10px',
                 'padding-bottom': '40px'
             }),

    # Footer
    html.Footer(
        [
            'Created and maintained by ',
            html.A(
                'Thomas Bury',
                href='http://thomas-bury.research.mcgill.ca/',
                target="_blank",
            ),
        ],
        style={
            'fontSize': '15px',
            'width': '100%',
            # 'horizontal-align':'middle',
            'textAlign': 'center',
        },
    ),
])

#–-------------------
# Callback functions
#–--------------------


# Update text for sliders
Beispiel #15
0
                ], style={'width': '50%', 'display': 'inline-block'}),
                # Pickup Hour Selection
                html.Div("Pickup Hour"),
                html.Div([
                    dcc.Dropdown(
                        id="PickupHour",
                        options=[{'label': val, 'value': key} for key, val in config.hour_group.items()],
                        value=0
                    )
                ], style={'width': '50%', 'display': 'inline-block'}),
                html.Div([
                    dbc.Button('Submit', id='submit-val', n_clicks=0, color="info", className="mr-1"),
                ]),
            ], width=3),
        ], justify="center"),
    html.Footer("CSE6424 - Spring 21 - Team 128")
])


# green = [359, 23, 236, 182, 291, 27, 364, 620, 46, 176, 118, 331, 365, 48, 140, 172, 301, 180, 1436495096608724634,
#           289, 126, 268, 60, 20, 28, 141, 224, 31, 337, 106, 85, 111
#           ]
# orange = [145, 25, 173, 161, 110, 53, 627, 181, 212, 672, 636, 100, 133, 74, 56, 84, 54, 92, 186, 54, 635, 211, 199, 86, 29, 666, 93, 288,
#           94, 143, 144, 255, 113, 225, 1436495105198659242, 673, 177, 34, 313, 327, 223, 315, 333, 210, 30, 350, 277, 217,
#           71, 1436495105198659246, 1436495109493626546, 96, 66, 164, 51, 38, 47, 125, 196, 24, 26, 142, 99, 35
#           ]

@app.callback(
    Output('divvy-bike-station', 'figure'),
    [Input('submit-val', 'n_clicks')],
    [State('Station', 'value'),
Beispiel #16
0
        dcc.RadioItems(
            id='data-type',
            options=[
                {'label': 'Cases', 'value': 'cases'},
                {'label': 'Deaths', 'value': 'deaths'}
            ],
            value='cases'
        ),
    ], style={'width': '10%', 'display': 'inline-block'}),

    html.Div(id='chart'),

    html.Footer(children=[
        "Data from the ",
        dcc.Link(children="New York Times", 
            href="https://github.com/nytimes/covid-19-data",
            refresh=True
        ),
        ".  Visualization by Andrew D'Aoust."
    ]),
])


def build_data_dicts(pt, dt, groups):
    pre = ''
    if pt == 'daily':
        pre = 'new_'
    elif pt == '7 day average':
        pre = 'seven_day_'
    elif pt == '14 day average':
        pre = 'fourteen_day_'
    data = []
Beispiel #17
0
def create_app_ui():
    main_layout = html.Div([
        html.Br(),

        # Heading
        html.H1('Terrorism Analysis with Insights',
                id='Main_title',
                style={"text-align": "center"}),
        html.Br(),

        # Tabs
        dcc.Tabs(
            id="Tabs",
            value="Map",
            style={
                'width': '95%',
                'fontFamily': 'Sans-Serif',
                'margin-left': 'auto',
                'margin-right': 'auto'
            },
            children=[

                # Map Tool tab
                dcc.Tab(
                    label="Map tool",
                    id="Map tool",
                    value="Map",
                    children=[
                        dcc.Tabs(
                            id="subtabs",
                            value="WorldMap",
                            style={
                                'width': '95%',
                                'fontFamily': 'Sans-Serif',
                                'margin-left': 'auto',
                                'margin-right': 'auto'
                            },
                            children=[
                                # Map Tool Subtabs
                                dcc.Tab(label="World Map tool",
                                        id="World",
                                        value="WorldMap"),
                                dcc.Tab(label="India Map tool",
                                        id="India",
                                        value="IndiaMap")
                            ]),
                        html.Br(),

                        # Dropdowns
                        html.Div(
                            [
                                dcc.Dropdown(id='month',
                                             options=month_list,
                                             placeholder='Select Month',
                                             multi=True,
                                             style={
                                                 'padding': '3px',
                                                 'width': '80%',
                                                 'margin': 'auto',
                                                 'textAlign': 'center'
                                             }),
                                dcc.Dropdown(id='date',
                                             placeholder='Select Day',
                                             options=date_list,
                                             multi=True,
                                             style={
                                                 'padding': '3px',
                                                 'width': '80%',
                                                 'margin': 'auto',
                                                 'textAlign': 'center'
                                             }),
                                dcc.Dropdown(id='region-dropdown',
                                             options=region_list,
                                             placeholder='Select Region',
                                             multi=True,
                                             style={
                                                 'padding': '3px',
                                                 'width': '80%',
                                                 'margin': 'auto',
                                                 'textAlign': 'center'
                                             }),
                                dcc.Dropdown(id='country-dropdown',
                                             options=[{
                                                 'label': 'All',
                                                 'value': 'All'
                                             }],
                                             placeholder='Select Country',
                                             multi=True,
                                             style={
                                                 'padding': '3px',
                                                 'width': '80%',
                                                 'margin': 'auto',
                                                 'textAlign': 'center'
                                             }),
                                dcc.Dropdown(
                                    id='state-dropdown',
                                    options=[{
                                        'label':
                                        'All',
                                        'value':
                                        'All'
                                    }],
                                    placeholder='Select State or Province',
                                    multi=True,
                                    style={
                                        'padding': '3px',
                                        'width': '80%',
                                        'margin': 'auto',
                                        'textAlign': 'center'
                                    }),
                                dcc.Dropdown(id='city-dropdown',
                                             options=[{
                                                 'label': 'All',
                                                 'value': 'All'
                                             }],
                                             placeholder='Select City',
                                             multi=True,
                                             style={
                                                 'padding': '3px',
                                                 'width': '80%',
                                                 'margin': 'auto',
                                                 'textAlign': 'center'
                                             }),
                                dcc.Dropdown(id='attacktype-dropdown',
                                             options=attack_type_list,
                                             placeholder='Select Attack Type',
                                             multi=True,
                                             style={
                                                 'padding': '3px',
                                                 'width': '80%',
                                                 'margin': 'auto',
                                                 'textAlign': 'center'
                                             }),
                                html.Br(),
                            ],
                            style={
                                "width": "70%",
                                'margin-left': 'auto',
                                'margin-right': 'auto',
                                "cursor": "pointer"
                            }),

                        # Year Slider
                        html.Div(
                            [
                                html.H5('Select the Year', id='year_title'),
                                html.Div([
                                    dcc.RangeSlider(
                                        id='year-slider',
                                        min=min(year_list),
                                        max=max(year_list),
                                        value=[min(year_list),
                                               max(year_list)],
                                        marks=year_dict,
                                        step=None)
                                ]),
                            ],
                            style={
                                "width": "95%",
                                'margin-left': 'auto',
                                'margin-right': 'auto',
                                "cursor": "pointer"
                            }),
                        html.Br()
                    ]),

                # Chart Tool Tab
                dcc.Tab(
                    label="Chart Tool",
                    id="chart tool",
                    value="Chart",
                    children=[

                        # Chart Tool -> World Chart Tool Subtab
                        dcc.Tabs(
                            id="subtabs2",
                            value="WorldChart",
                            style={
                                'width': '95%',
                                'fontFamily': 'Sans-Serif',
                                'margin-left': 'auto',
                                'margin-right': 'auto'
                            },
                            children=[
                                dcc.Tab(
                                    label="World Chart tool",
                                    id="WorldC",
                                    value="WorldChart",
                                    children=[
                                        html.Br(),
                                        html.Div(
                                            [

                                                # Dropdown
                                                dcc.Dropdown(
                                                    id="Chart_Dropdown",
                                                    options=
                                                    chart_dropdown_values,
                                                    placeholder="Select option",
                                                    value="region_txt",
                                                    style={
                                                        'padding': '3px',
                                                        'width': '80%',
                                                        'margin': 'auto',
                                                        'textAlign': 'center'
                                                    }),
                                                html.Br(),
                                                html.Hr(),

                                                # Search Input
                                                dcc.Input(
                                                    id="search",
                                                    placeholder="Search Filter",
                                                    style={
                                                        'padding': '3px',
                                                        'width': '64%',
                                                        'margin-left': '18%',
                                                        'textAlign': 'center'
                                                    }),
                                                html.Hr(),
                                                html.Br()
                                            ],
                                            style={
                                                "width": "70%",
                                                'margin-left': 'auto',
                                                'margin-right': 'auto',
                                                "cursor": "pointer"
                                            }),
                                    ]),

                                # Chart Tool -> India Chart Tool Subtab
                                dcc.Tab(
                                    label="India Chart tool",
                                    id="IndiaC",
                                    value="IndiaChart",
                                    children=[
                                        html.Br(),
                                        html.Div(
                                            [

                                                # Dropdown
                                                dcc.Dropdown(
                                                    id="Chart_Dropdownn",
                                                    options=
                                                    chart_dropdown_values,
                                                    placeholder="Select option",
                                                    value="region_txt",
                                                    style={
                                                        'padding': '3px',
                                                        'width': '80%',
                                                        'margin': 'auto',
                                                        'textAlign': 'center'
                                                    }),
                                                html.Br(),
                                                html.Hr(),

                                                # Search Input
                                                dcc.Input(
                                                    id="searchh",
                                                    placeholder="Search Filter",
                                                    style={
                                                        'padding': '3px',
                                                        'width': '64%',
                                                        'margin-left': '18%',
                                                        'textAlign': 'center'
                                                    }),
                                                html.Hr(),
                                                html.Br()
                                            ],
                                            style={
                                                "width": "70%",
                                                'margin-left': 'auto',
                                                'margin-right': 'auto',
                                                "cursor": "pointer"
                                            }),
                                    ])
                            ]),
                    ])
            ]),
        html.Div(
            [

                # Loading Circle and Declaring Graph
                dcc.Loading(children=[
                    html.Div(id="graph-object",
                             children="Graph will be shown here")
                ],
                            type='circle',
                            style={
                                "backgroundColor": "transparent",
                                "z-index": "1",
                                "position": "absolute"
                            }),
            ],
            style={
                'width': '95%',
                'margin-left': 'auto',
                'margin-right': 'auto'
            }),
        html.Br(),
        html.Br(),

        # Footer
        html.Footer(
            id="footer",
            style={"padding-bottom": "1px"},
            children=[

                # Name of the creator
                html.H3(style={"text-align": "center"},
                        children=[
                            html.H3(children="Made by Sahil Rahman ",
                                    style={"display": "inline"}),
                        ]),

                # Email of the creator
                html.H6(style={"text-align": "center"},
                        children=[
                            html.H6(children="Email: [email protected]",
                                    style={"display": "inline"}),
                        ]),

                # Linkedin profile of the creator
                html.
                H6(style={"text-align": "center"},
                   children=[
                       html.
                       H6(children=
                          "Linkedin: https://www.linkedin.com/in/sahilrahman/",
                          style={"display": "inline"}),
                       html.Br(),
                       modal,
                   ]),
                html.Br(),
            ]),
        html.Br(),
    ])

    # Returning Main Layout
    return main_layout
Beispiel #18
0
                        html.Button('Submit', id = 'end', style = {'font-size': '100%'})
                        ], style = {'padding-top':10})

                    ], style = {'padding-right': 420, 'padding-left': 300})    
                ])  
            ])      
        ])

        ], colors={"primary": '#6c1420'}),

        html.H1(' ', style = {'height': 50}), 

    ], style={'textAlign':'center',"display": "block","margin-left":"auto","margin-right":"auto"}),

    # https://stackoverflow.com/questions/6127621/keeping-footer-at-the-bottom-of-window-on-site-that-scrolls-horizontal
    html.Footer(style = {'display':'block', 'background-color': '#6c1420', 'height': '3vh', 'margin-top': '10vh'}) 

    ], style = {'height': '100vh', 'width': '100vw'}
)

def prepare_data(bond):
    bond['datetime'] = pd.to_datetime(bond['datetime'])
    bond['rptd_pr'] = bond['rptd_pr'].astype(float)
    bond['entrd_vol_qt'] = bond['entrd_vol_qt'].astype(float)
    bond['index'] = bond['index'].astype(int)

def order_type_handler(ot):
    # ['b','s']
    

    nams = [] ; cols = []
Beispiel #19
0
            html.H6(id="post-prediction", style={'whiteSpace': 'pre-line'}),
            html.Div(
                children=dcc.Graph(
                    id="prediction-chart",
                    config={"displayModeBar": False},
                ),
                id="display-prediction-chart",
                style={"visibility": "hidden"},
                className="card",
            ),
        ],
        className="wrapper",
    ),
    html.Div(
        children=[
            html.Footer("https://github.com/dominikmn/one-million-posts/"),
        ],
        className="footer",
    )
])


@app.callback([
    Output(component_id="post-prediction", component_property="children"),
    Output(component_id="post-prediction", component_property="style"),
    Output(component_id="display-prediction-chart",
           component_property="style"),
    Output(component_id="prediction-chart", component_property="figure"),
], [Input(component_id="submit-state", component_property="n_clicks")],
              [State(component_id="post-input", component_property="value")])
def update_prediction(n_clicks, input_value):
Beispiel #20
0
def create_footer():
    p = html.P(children=[
        html.Span('Built with '),
        html.A('Plotly Dash',
               href='https://github.com/plotly/dash',
               target='_blank'),
        html.Span(' and:'),
    ], )

    span_style = {'vertical-align': 'top', 'padding-left': '1rem'}

    usgs = html.A(
        children=[
            html.I([], className='fa fa-list fa-2x'),
            html.Span('USGS GeoJSON feed', style=span_style)
        ],
        style={'text-decoration': 'none'},
        href='https://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php',
        target='_blank')
    mapbox = html.A(children=[
        html.I([], className='fa fa-map-o fa-2x'),
        html.Span('mapbox', style=span_style)
    ],
                    style={'text-decoration': 'none'},
                    href='https://www.mapbox.com/',
                    target='_blank')

    font_awesome = html.A(children=[
        html.I([], className='fa fa-font-awesome fa-2x'),
        html.Span('Font Awesome', style=span_style)
    ],
                          style={'text-decoration': 'none'},
                          href='http://fontawesome.io/',
                          target='_blank')
    datatables = html.A(children=[
        html.I([], className='fa fa-table fa-2x'),
        html.Span('jQuery Datatables', style=span_style)
    ],
                        style={'text-decoration': 'none'},
                        href='https://datatables.net/',
                        target='_blank')

    ul1 = html.Ul(
        children=[
            html.Li(mapbox),
            html.Li(font_awesome),
            html.Li(datatables),
            html.Li(usgs),
        ],
        style={'list-style-type': 'none'},
    )

    hashtags = 'plotly,dash,usgs'
    tweet = 'Dash Earthquake, a cool dashboard with Plotly Dash!'
    twitter_href = 'https://twitter.com/intent/tweet?hashtags={}&text={}'\
        .format(hashtags, tweet)
    twitter = html.A(children=html.I(children=[],
                                     className='fa fa-twitter fa-3x'),
                     title='Tweet me!',
                     href=twitter_href,
                     target='_blank')

    github = html.A(children=html.I(children=[],
                                    className='fa fa-github fa-3x'),
                    title='Repo on GitHub',
                    href='https://github.com/jackdbd/dash-earthquakes',
                    target='_blank')

    li_right_first = {'line-style-type': 'none', 'display': 'inline-block'}
    li_right_others = {k: v for k, v in li_right_first.items()}
    li_right_others.update({'margin-left': '10px'})
    ul2 = html.Ul(children=[
        html.Li(twitter, style=li_right_first),
        html.Li(github, style=li_right_others),
    ],
                  style={
                      'position': 'absolute',
                      'right': '1.5rem',
                      'bottom': '1.5rem',
                  })

    div = html.Div([p, ul1, ul2])
    footer_style = {
        'font-size': '2.2rem',
        'background-color': theme['background-color'],
        'padding': '2.5rem',
        'margin-top': '3rem',
    }
    footer = html.Footer(div, style=footer_style)
    return footer
    ]),
    dcc.Tabs(
        id = "navigation_tabs",
        value = "Figures",
        children = [
            dcc.Tab(label = "Figures", value = "Figures"),
            dcc.Tab(label = "Statistics", value = "Statistics"),
            dcc.Tab(label = "Report", value = "Report"),
        ],
    ),
    html.Div(id = "tab_body"),
    html.Footer(children = [
        html.Div(f"user: {user}"),
        html.Div(f"project: {project}"),
        html.Div(
            id = "last-update-text",
            children = f"last update: {model.last_update}"
        ),
        ], 
        id = "global_footer",
    ),
    dcc.Interval(id = "interval-component", interval = 60*1000,),
    ],
)

@app.callback(
    Output("tab_body", "children"),
    [Input("navigation_tabs", "value")],
)
def render_tab(tab_label):
    if tab_label == "Figures":
        tab_body = html.Div(children = [
Beispiel #22
0
import assets.callbacks

footer = html.Footer([
    dbc.Alert(id='alert_toast',
              is_open=False,
              dismissable=True,
              duration=4000,
              style={
                  'position': 'fixed',
                  'bottom': 10,
                  'right': 10,
                  'width': 350,
                  'z-index': 999,
                  'text-align': 'center',
                  'vertical-align': 'middle'
              }),
    dbc.Alert(id='admin_save_toast',
              is_open=False,
              dismissable=True,
              duration=4000,
              style={
                  'position': 'fixed',
                  'bottom': 10,
                  'right': 10,
                  'width': 350,
                  'z-index': 999,
                  'text-align': 'center',
                  'vertical-align': 'middle'
              })
])

app.layout = html.Div([
Beispiel #23
0
        id="main"),
    # End Main

    # Footer
    html.Footer(
        [
            html.Div(
                [
                    html.Div([
                        u"\u00A9", " Copyright ",
                        html.Strong("TheEvent"), ". All Rights Reserved"
                    ],
                             className="copyright"),
                    html.Div(
                        [
                            # All the links in the footer should remain intact.
                            # You can delete the links only if you purchased the pro version.
                            # Licensing information: https://bootstrapmade.com/license/
                            # Purchase the pro version with working PHP/AJAX contact form: https://bootstrapmade.com/buy/?theme=TheEvent
                            "Designed by ",
                            html.A("BootstrapMade",
                                   href="https://bootstrapmade.com/")
                        ],
                        className="credits")
                ],
                className="container")
        ],
        id="footer"),
    # End Footer
])

                            figure=dict(
                                data=[dict(x=0, y=0)],
                                layout=dict(
                                    paper_bgcolor="#F4F4F8",
                                    plot_bgcolor="#F4F4F8",
                                    autofill=True,
                                    margin=dict(t=75, r=50, b=100, l=50),
                                ),
                            ),
                        ),
                    ],
                ),
                html.Div(
            id="footer",
            children=[
                html.Footer(children="By Aditya Narayanan, reference credits to Python Dash"),
            ],
        ),
     ],
   ),
 ],
)


@app.callback(
    Output("county-choropleth", "figure"),
    [Input("years-slider", "value")],
    [State("county-choropleth", "figure")],
)
def display_map(year, figure):
    cm = dict(zip(BINS, DEFAULT_COLORSCALE))
Beispiel #25
0
def serve_layout():
    return html.Div(children=[
        html.Div(
            children=[
                html.H1(children=['YULArchivesSpace Toolkit'],
                        className='header-label'),
                html.Div(
                    children=[
                        dcc.Tabs(
                            id='all-tabs',
                            className='tab_container',
                            value='report_tab',
                            children=[
                                dcc.Tab(
                                    label='Reports',
                                    value='report_tab',
                                    className='custom-tab',
                                    selected_className='custom-tab--selected',
                                    children=[
                                        html.Div(children=[
                                            html.Div(children=html.P(
                                                'View and download reports on various ArchivesSpace data points.',
                                                className='directions')),
                                            html.Div(children=[
                                                html.Div(children=[
                                                    dcc.Dropdown(
                                                        id=
                                                        "query_type_dropdown",
                                                        multi=False,
                                                        placeholder=
                                                        'Select a report category',
                                                        options=[
                                                            {
                                                                "label": i,
                                                                "value": i
                                                            } for i in
                                                            dv.query_categories
                                                        ],
                                                        className='drop')
                                                ],
                                                         className='dropdown'),
                                                html.Div(children=[
                                                    dcc.Dropdown(
                                                        id=
                                                        "selected_query_dropdown",
                                                        multi=False,
                                                        placeholder=
                                                        'Select a query to run',
                                                        className='drop')
                                                ],
                                                         className='dropdown'),
                                                html.Div(
                                                    children=html.Div(
                                                        id='input_div',
                                                        className='dropdown'),
                                                    className='parent_input')
                                            ],
                                                     className=
                                                     'dropdown_container'),
                                            html.Div(children=[
                                                html.Button(
                                                    'Go',
                                                    id='go_time_query',
                                                    n_clicks=0,
                                                    className='api-button')
                                            ],
                                                     className='button-div'),
                                            html.Div(id='test_div',
                                                     style={'display': 'none'
                                                            }),
                                            dcc.Store(id='input_options',
                                                      storage_type="memory"),
                                            dcc.Store(id='bulk_csv_file',
                                                      storage_type="memory"),
                                            dcc.Store(id='query_result',
                                                      storage_type="memory"),
                                            dcc.Store(id='unzipped_datastore',
                                                      storage_type='memory'),
                                            html.Div(children=html.H5(
                                                id='query_description'),
                                                     className='query-desc'),
                                            html.Div(children=[
                                                html.Div(
                                                    id='number-of-results',
                                                    className='result-total'),
                                                html.Div(
                                                    id='download-link',
                                                    className='download-button'
                                                )
                                            ]),
                                            html.Div(className='divider'),
                                            html.Div(id="stat_graph_div"),
                                            html.Div(
                                                id='query_table',
                                                className='query_table_div')
                                        ],
                                                 className='body_div')
                                    ]),
                                dcc.Tab(
                                    label='Templates',
                                    value='template_tab',
                                    className='custom-tab',
                                    selected_className='custom-tab--selected',
                                    children=[
                                        html.Div(children=[
                                            html.Div(children=html.P(
                                                'View and download schema templates for all ArchivesSpace record types.',
                                                className='directions')),
                                            html.Div(children=[
                                                html.Div(children=[
                                                    dcc.Dropdown(
                                                        id="schema_dropdown",
                                                        multi=False,
                                                        placeholder=
                                                        'Select a schema',
                                                        className='drop')
                                                ],
                                                         className='dropdown')
                                            ],
                                                     className=
                                                     'dropdown_container'),
                                            dcc.Store(id='as_templates_store',
                                                      storage_type='memory'),
                                            html.Div(children=dcc.RadioItems(
                                                id="template_options_radio",
                                                options=dv.template_options,
                                                value='added_value',
                                                labelStyle={
                                                    'display': 'inline-block',
                                                    'padding-left': '5px',
                                                    'padding-right': '20px'
                                                }),
                                                     className='api_checklist'
                                                     ),
                                            html.Div(children=[
                                                html.Div(className='divider'),
                                                html.Button(
                                                    'Go',
                                                    id='go_time_schema',
                                                    n_clicks=0,
                                                    className='api-button')
                                            ],
                                                     className='button-div'),
                                            html.Div(
                                                id='download_links',
                                                className='download-button'),
                                            html.Div(children=[
                                                html.Div(className='divider'),
                                                html.Table(
                                                    id='json_table',
                                                    className='query-table')
                                            ]),
                                            html.Pre(
                                                id='template_table',
                                                className='template-display')
                                        ],
                                                 className='body_div')
                                    ]),
                                dcc.Tab(
                                    label='Bulk Operations',
                                    value='bulk_tab',
                                    className='custom-tab',
                                    selected_className='custom-tab--selected',
                                    children=[
                                        html.Div(
                                            children=[
                                                html.Div(children=[
                                                    html.
                                                    P('Create, read, update, and delete ArchivesSpace records in bulk.'
                                                      )
                                                ],
                                                         className='directions'
                                                         ),
                                                html.
                                                Div(children=dcc.RadioItems(
                                                    id="api_instance_checklist",
                                                    options=dv.
                                                    archivesspace_instances,
                                                    labelStyle={
                                                        'display':
                                                        'inline-block',
                                                        'padding-left': '5px',
                                                        'padding-right': '20px'
                                                    }),
                                                    className='api_checklist'),
                                                html.Div([
                                                    dcc.Input(
                                                        placeholder='username',
                                                        id='username_input',
                                                        type='text',
                                                        className='login_input'
                                                    ),
                                                    html.Div(
                                                        className='divider'),
                                                    dcc.Input(
                                                        placeholder='password',
                                                        id='password_input',
                                                        type='password',
                                                        className='login_input'
                                                    ),
                                                    html.Div(
                                                        className='divider'),
                                                    html.Button(
                                                        'Submit',
                                                        id='login_button',
                                                        type='submit',
                                                        className='api-button')
                                                ],
                                                         className='dropdown'),
                                                html.Div(
                                                    children=[
                                                        html.Div(children=[
                                                            dcc.Dropdown(
                                                                id=
                                                                "bulk_operation_category_dropdown",
                                                                multi=False,
                                                                placeholder=
                                                                'Select a category',
                                                                options=[{
                                                                    "label":
                                                                    i.replace(
                                                                        '_',
                                                                        ' ').
                                                                    capitalize(
                                                                    ),
                                                                    "value":
                                                                    i
                                                                } for i in dv.
                                                                         bulk_operation_categories
                                                                         ],
                                                                className='drop'
                                                            )
                                                        ],
                                                                 className=
                                                                 'dropdown'),
                                                        # html.Div(children=[dcc.Dropdown(id='function_subcategory_dropdown',
                                                        #                                 multi=False,
                                                        #                                 placeholder='Select a subcategory',
                                                        #                                 options=[{"label": i.replace('_', ' ').capitalize(), "value": i} for i in rend.get_function_subcategories()]
                                                        #                                 )], className='dropdown'),
                                                        html.Div(children=[
                                                            dcc.Dropdown(
                                                                id=
                                                                "function_dropdown",
                                                                multi=False,
                                                                placeholder=
                                                                'Select an operation',
                                                                className='drop'
                                                            )
                                                        ],
                                                                 className=
                                                                 'dropdown'),
                                                        html.Div(children=[
                                                            dcc.Dropdown(
                                                                id=
                                                                "input_file_dropdown",
                                                                multi=False,
                                                                placeholder=
                                                                'Select an input file',
                                                                options=[
                                                                    {
                                                                        "label":
                                                                        i,
                                                                        "value":
                                                                        'data/api_inputs/'
                                                                        + i
                                                                    } for i in
                                                                    os.listdir(
                                                                        'data/api_inputs'
                                                                    )
                                                                ],
                                                                className='drop'
                                                            )
                                                        ],
                                                                 className=
                                                                 'dropdown'),
                                                        html.Div(children=[
                                                            dcc.Dropdown(
                                                                id=
                                                                "backup_folder_dropdown",
                                                                multi=False,
                                                                placeholder=
                                                                'Select a backup directory',
                                                                options=[{
                                                                    "label":
                                                                    i,
                                                                    "value":
                                                                    'data/json_backups/'
                                                                    + i
                                                                } for i in next(
                                                                    os.walk(
                                                                        'data/json_backups'
                                                                    ))[1]],
                                                                className='drop'
                                                            )
                                                        ],
                                                                 className=
                                                                 'dropdown')
                                                    ],
                                                    className=
                                                    'dropdown_container'),
                                                html.Div(
                                                    children=[
                                                        dcc.
                                                        ConfirmDialogProvider(
                                                            children=html.
                                                            Button(
                                                                'Go',
                                                                id='go_time',
                                                                n_clicks=0,
                                                                className=
                                                                'api-button'),
                                                            id='are_you_surrre',
                                                            message=
                                                            'With great power comes great responsibility! Are you sure you want to do this?'
                                                        ),
                                                        #html.Div(className='divider'),
                                                        html.Button(
                                                            'Stop',
                                                            id='stop_time',
                                                            n_clicks=0,
                                                            className=
                                                            'api-button')
                                                    ],
                                                    className='button-div'),
                                                html.Div(children=[
                                                    html.
                                                    H5(id='operation-docs',
                                                       className='query-desc'),
                                                    html.Pre(
                                                        id='api_table',
                                                        className='doc-table')
                                                ]),
                                                dcc.Store(
                                                    id='selected_0',
                                                    storage_type="memory"),
                                                dcc.Store(
                                                    id='selected_1',
                                                    storage_type="memory"),
                                                dcc.Store(
                                                    id='selected_2',
                                                    storage_type="memory"),
                                                dcc.Store(
                                                    id='output-storage',
                                                    storage_type="memory"),
                                                dcc.Store(
                                                    id='session_store',
                                                    storage_type='session'),
                                                dcc.Store(
                                                    id='object_store',
                                                    storage_type='session'),
                                                html.Div(
                                                    id='display_log',
                                                    className='display-log'),
                                                dcc.Interval(id='log-update',
                                                             interval=20000000,
                                                             n_intervals=0)
                                            ],
                                            className='body_div')
                                    ])
                            ])
                    ],
                    className='tab_div_container'),
                html.Footer(children=[
                    html.Div(children=[
                        html.A('Yale',
                               href='https://archives.yale.edu',
                               target='_blank',
                               className='yale_footer'),
                        html.A('Contact',
                               href='mailto:[email protected]',
                               target='_blank',
                               className='footer_links'),
                        html.
                        A('Help',
                          href='https://aspace-tools.readthedocs.io/en/latest/',
                          target='_blank',
                          className='footer_links')
                    ],
                             className='footer_div_style')
                ],
                            className='footer_style')
            ],
            className='app_container')
    ])
Beispiel #26
0
    html.Td("zebras"),
    html.Td("zebras attached"),
    html.Td("1.45"),
    html.Td("1.12"),
    html.Td("1.78"),
    html.Td("14.46"),
    html.Td("0.001")
])
hsd_table_body = [html.Tbody([hsd_row1, hsd_row2, hsd_row3])]
zebra_burrow_table2 = dbc.Table(hsd_table_header + hsd_table_body,
                                bordered=True,
                                size="sm")
#footer
footer = html.Div([
    html.Footer(html.P('Copyright © 2021 BAH - All Rights Reserved.'),
                id="footer",
                className='footer-style'),
])

#footer
footer = html.Div([
    html.Footer(html.P('Copyright © 2021 BAH - All Rights Reserved.'),
                id="footer",
                className='footer-style'),
])


def Dashboard():
    layout = html.Div([dcc.Location(id="url"), sidebar, content, footer])
    return layout
Beispiel #27
0
        ],
                 className="container-fluid")
    ],
             className="navbar navbar-expand-lg shadow p-4 mb-4"),
    html.Div([
        html.Button("Add a new player", id="add", n_clicks=0),
        html.Div(id='container', children=[])
    ],
             className="shadow p-4 mb-4"),
    html.Div(id='dropdown-container-output'),
    html.Br(),
    html.Div(id="matrix-container", className="card shadow "),
    html.Div(id="final-result"),
    html.Br(),
    html.Footer([
        html.Div(['© USTHB, MIV 2019/2020'], className="copyright text-center")
    ],
                className="footer")
],
                      className="wrapper")


@app.callback(
    Output("modal", "is_open"),
    [Input("open", "n_clicks"),
     Input("close", "n_clicks")],
    [State("modal", "is_open")],
)
def toggle_modal(n1, n2, is_open):
    if n1 or n2:
        return not is_open
    return is_open
Beispiel #28
0
from matscholar_web.nav import get_nav
from matscholar_web.search.util import get_search_field_callback_args
import matscholar_web.search.callbacks as scb
import matscholar_web.search.view as sv
import matscholar_web.analysis.callbacks as acb
import matscholar_web.analysis.view as av
import matscholar_web.about.view as bv
import matscholar_web.journals.view as jv
"""
Declarations for the core dash app.
"""

footer_interior = get_footer()
nav = get_nav()
footer_section = html.Div(footer_interior, className="section")
footer = html.Footer(footer_section, className="footer has-margin-top-50")

app_container = html.Div("",
                         id="app_container",
                         className="container is-fluid")
app_expander = html.Div(app_container, className="msweb-is-tall")
app_expander_container = html.Div(
    app_expander,
    className="msweb-is-tall-container msweb-fade-in has-margin-top-50")

external_stylesheets = \
    html.Link(
        href="https://fonts.googleapis.com/css?family=Ubuntu&display=swap",
        rel="stylesheet",
        className="is-hidden"
    )
                                'value': c
                            } for c in sorted(us_counties.df[(
                                us_counties.df.state == 'New Jersey'
                            )].county.unique())],
                                         value=['Somerset', ' Middlesex'],
                                         multi=True,
                                         id='state-dropdown'),
                            dcc.Loading(
                                dcc.Graph(figure=fig_nj_line, id='line-state'))
                        ])
                    ])
                ])
            ]),
            html.Footer([
                dcc.Markdown(
                    '© 2020 [Github](https://github.com/tlzhu19/covid19-dashboard) | [US Data](https://github.com/nytimes/covid-19-data/) | [NYC Data] (https://github.com/nychealth/coronavirus-data/)'
                ),
            ])
        ],
        style={'margin': '50px'}),
])


@app.callback([
    dash.dependencies.Output('table-new-cases-state', 'children'),
    dash.dependencies.Output('table-cases-state', 'children'),
    dash.dependencies.Output('table-deaths-state', 'children')
], [dash.dependencies.Input('date-state-total', 'date')])
def update_state_tables(input_date):
    results = []
    for name in ['new_cases', 'cases', 'deaths']:
Beispiel #30
0
                                              className='icono'),
                                     textos.texto_08,
                                     html.Br(), textos.descripcion_08
                                 ],
                                 className='col-md-3 tarjetas color_08')
                         ],
                         className='row')
                 ],
                 className='wrapper')
             ###################################################################
             # pie de pagina
             ###################################################################
             ,
             html.Footer([
                 html.Div([
                     html.P([
                         'Copyright 2020',
                         html.Strong(' CNC '),
                         'Todos los derechos reservados'
                     ]),
                     html.A([html.I([], className='fa fa-angle-up')],
                            href='index.py#',
                            className='go-top')
                 ],
                          className='text-center')
             ],
                         className='site-footer')
         ],
         id='main-content')
 ],
 id='container')