Пример #1
0
# Lotties: Emil at https://github.com/thedirtyfew/dash-extensions
url = "https://assets1.lottiefiles.com/private_files/lf30_WdTEui.json"
url2 = "https://assets9.lottiefiles.com/packages/lf20_CYBIbn.json"
options = dict(loop=True, autoplay=True, rendererSettings=dict(preserveAspectRatio='xMidYMid slice'))


df = px.data.gapminder()

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

card_main = dbc.Card(
    [

        dbc.CardBody(
            [
                html.Div(de.Lottie(options=options, width="50%", height="50%", url=url)),
                html.H4("Learn Dash with Charming Data", className="card-title"),
                html.H6("Lesson 1:", className="card-subtitle"),
                html.P(
                    "Choose the year you would like to see on the bubble chart.",
                    className="card-text",
                ),
                dcc.Dropdown(id='user_choice', options=[{'label': yr, "value": yr} for yr in df.year.unique()],
                             value=2007, clearable=False, style={"color": "#000000"}),
                # dbc.Button("Press me", color="primary"),
                # dbc.CardLink("GirlsWhoCode", href="https://girlswhocode.com/", target="_blank"),
            ]
        ),
    ],
    color="success",   # https://bootswatch.com/default/ for more card colors
    inverse=True,   # change color of text (black or white)
Пример #2
0
    # print(df)
    df["company"] = company_df.loc[company_df["회사"] == company,
                                   ["종목코드"]].values[0][0]
    stock_list.append(df)
#
df_multi_stock = pd.concat(stock_list)

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

## DASH APP LAYOUT
app = dash.Dash(__name__)
# server = app.server

app.layout = html.Div([
    ## Lottie
    html.Div(de.Lottie(options=options, width="20%", height="20%", url=url)),

    ## properties
    html.Div([
        dcc.Dropdown(
            id='first-dropdown',
            options=[
                {
                    'label': '삼성전자',
                    'value': '005930'
                },
                {
                    'label': '현대차',
                    'value': '005380'
                },
                {
Пример #3
0
import dash
import dash_html_components as html
import dash_extensions as de

# Setup options.
url = "https://assets9.lottiefiles.com/packages/lf20_YXD37q.json"
options = dict(loop=True,
               autoplay=True,
               rendererSettings=dict(preserveAspectRatio='xMidYMid slice'))
# Create example app.
app = dash.Dash(__name__)
app.layout = html.Div(
    de.Lottie(options=options, width="25%", height="25%", url=url))

if __name__ == '__main__':
    app.run_server()
Пример #4
0
                meta_tags=[{
                    'name': 'viewport',
                    'content': 'width=device-width, initial-scale=1.0'
                }])

data_dict = {
    "Case by state": us_state_current,
    "Case by AL county": al_county_current
}

lottie = html.Div(
    de.Lottie(
        options=dict(
            loop=True,
            autoplay=True,
            rendererSettings=dict(preserveAspectRatio='xMidYMid slice')),
        width='35%',
        height='10%',
        url='https://assets8.lottiefiles.com/private_files/lf30_5P4pCA.json',
    ))

# =============================================================================
# image = html.Img(
#         src = 'https://www.cbp.gov/sites/default/files/covidimage2.png',
#         style = {
#                 'height': '28%',
#                 'width' : '45%',
#                 'float' : 'right',
#                 'position' : 'relative',
#                 'margin-top' : 20 },
#         )
Пример #5
0
import dash_extensions as de
import dash_core_components as dcc

from dash.dependencies import Input, Output

# Setup options.
url = "https://assets9.lottiefiles.com/packages/lf20_YXD37q.json"
options = dict(loop=True,
               autoplay=True,
               rendererSettings=dict(preserveAspectRatio='xMidYMid slice'))
# Create example app.
app = dash.Dash(__name__)
app.layout = html.Div([
    de.Lottie(options=options,
              width="25%",
              height="25%",
              url=url,
              id="lottie",
              speed=2),
    dcc.Slider(id="slider", value=20, min=0, max=100, step=1)
])


@app.callback(Output('lottie', 'speed'), [Input('slider', 'value')],
              prevent_initial_call=True)
def set_speed(value):
    if not value:
        return dash.no_update
    return value / 10


if __name__ == '__main__':