Пример #1
0
    def labeled_button_cards(self):
        rows = dbc.Container(children=[],
                             fluid=False,
                             className='bool-switch-container')
        for nodelist in grouper(
            [self.nodes[id] for id in self._bool_switch_ids], 5):
            nodelist = [
                node for node in nodelist
                if isinstance(node, daq.BooleanSwitch)
            ]
            nodecount = len(nodelist)
            width = int(12 / nodecount if nodecount else 12)
            row = dbc.CardGroup([
                dbc.Card(dbc.CardBody(
                    [html.H4(node._label, className='param-label'), node]),
                         enabled="1" if node.on else "0",
                         className='param-card') for node in nodelist
            ],
                                className='bool-switch-cardgroup')

            for node in nodelist:
                node.value = node.on
                if hasattr(node, 'popover_text'):
                    row.append(self.render_popover(node.id, node.popover_text))
            rows.children.append(row)
        return rows
Пример #2
0
def make_article_card(symbol, date=dt.datetime.today(), days_ago=3):
    week_ago = (date - dt.timedelta(days=days_ago)).strftime("%Y-%m-%d")
    articles = finnhub_client.company_news(symbol,
                                           _from=week_ago,
                                           to=date.strftime("%Y-%m-%d"))
    if len(articles) == 0:
        week_ago = (dt.datetime.today() -
                    dt.timedelta(days=days_ago)).strftime("%Y-%m-%d")
        articles = finnhub_client.company_news(
            symbol,
            _from=week_ago,
            to=dt.datetime.today().strftime("%Y-%m-%d"))
    news_articles_cols = [
        dbc.CardGroup([
            dbc.Card([
                dbc.CardImg(src=article["image"], top=True),
                dbc.CardBody([
                    html.H4(article["headline"], className="card-title"),
                    html.H6(
                        dt.datetime.fromtimestamp(
                            article["datetime"]).strftime("%m/%d/%Y"),
                        className="card-subtitle",
                    ),
                    html.P(
                        article["summary"],
                        className="card-text",
                    ),
                    dbc.CardLink("Read More", href=article["url"]),
                ]),
            ], ) for article in articles[i:i + 4]
        ]) for i in range(0, len(articles), 4)
    ]

    return news_articles_cols
Пример #3
0
 def _make_card_table(self, formatted_cal: list[dict]) -> html.Div:
     cards = []
     for week in formatted_cal:
         week_cards = []
         for day, val in week.items():
             week_cards.append(self._make_card(day, val))
         cards.append(dbc.CardGroup(week_cards))
     return html.Div(cards)
Пример #4
0
def get_app_layout():
    return dbc.Container([
        dcc.Store(id='selected-data-left'),
        dcc.Store(id='selected-data-right'),
        dcc.Store(id='session-id', data=str(uuid.uuid4())),
        dcc.Store(id='filter-trigger', data=0),
        dcc.Store(id='left-hide-trigger', data=0),
        dcc.Store(id='file-loaded-trigger', data=0),
        dcc.Store(id='dummy-export-scatter2d-left'),
        dcc.Store(id='dummy-export-scatter2d-right'),
        dcc.Store(id='dummy-export-histogram'),
        dcc.Store(id='dummy-export-violin'),
        dcc.Store(id='dummy-export-parallel'),
        dcc.Store(id='dummy-export-heatmap'),
        dcc.Store(id='dummy-export-data'),

        html.Div(
            [
                html.Div(html.Img(
                    src=app.get_asset_url('sensorview_logo.svg'),
                    id='sensorview-image',
                    style={
                        'height': '100px',
                        'width': 'auto',
                    },
                ), className="text-center"),
                html.H1(app.title, className="text-center"),
                html.Hr(className="my-2"),
                html.P(
                    'Sensor Data Visualization', className="text-center"
                ),
            ],
            className="bg-light rounded-3 my-2 p-3",
        ),

        dbc.Row([
            dbc.Col(
                dbc.CardGroup([
                    testcase_card,
                    datafile_card
                ])
            )], className='mb-3'),

        tabs,

        dcc.Markdown(
            'Designed and developed by **Zhengyu Peng** \
                | Powered by [Dash](https://plotly.com/dash/),\
                [Redis](https://redis.io/),\
                [Celery](https://docs.celeryproject.org/en/stable/),\
                [Docker](https://www.docker.com/)'),
    ], fluid=True, className="dbc_light")
def search_box():
    search_box_layout = dbc.Card([
        html.H3(f'Current Jam'),
        html.Div(show_tracks(spt.current_track)),
        html.H6("Search for Songs", style={'textAlign': 'left'}),
        dbc.Input(id='search-box-input', placeholder='Enter Text Here'),
        html.Div(id='search-box-output')
    ])
    layout = html.Div(
        [
            dbc.CardGroup([search_box_layout]),
        ],
        className="w-25",
    )
    return layout
Пример #6
0
def get_wins(wins):
    wld = f"{wins['WLD'][0]}-{wins['WLD'][1]}-{wins['WLD'][2]}"
    ko = f"{wins['KO'][0]}-{wins['KO'][1]}"
    sub = f"{wins['SUB'][0]}-{wins['SUB'][1]}"
    return dbc.CardGroup(
        className='win-holder',
        children=[
            dbc.Card(className='win-card',
                     children=[
                         dbc.CardHeader(className='win-head',
                                        children=[
                                            html.H5("W-L-D",
                                                    className='win-head-text')
                                        ]),
                         dbc.CardBody(className='win-body',
                                      children=[
                                          html.H4(f"{wld}",
                                                  className='win-body-text')
                                      ])
                     ]),
            dbc.Card(className='win-card',
                     children=[
                         dbc.CardHeader(className='win-head',
                                        children=[
                                            html.H5("(T)KO",
                                                    className='win-head-text')
                                        ]),
                         dbc.CardBody(className='win-body',
                                      children=[
                                          html.H4(f"{ko}",
                                                  className='win-body-text')
                                      ])
                     ]),
            dbc.Card(className='win-card',
                     children=[
                         dbc.CardHeader(className='win-head',
                                        children=[
                                            html.H5("Sub",
                                                    className='win-head-text')
                                        ]),
                         dbc.CardBody(className='win-body',
                                      children=[
                                          html.H4(f"{sub}",
                                                  className='win-body-text')
                                      ])
                     ])
        ])
Пример #7
0
def create_summary(algorithm_name):
    return dbc.Card(
        id=f"summary-section-{algorithm_name}",
        children=[
            dbc.CardBody([
                dbc.CardGroup(
                    [],
                    id=f"summary-cards-{algorithm_name}",
                    className="col-sm-12 col-md-12 col-lg-12 col-xl-12 d-flex",
                    style={"margin-top": "15px"}),
                dbc.Row([
                    dbc.Col(daq.ToggleSwitch(
                        id=f"table-toggle-{algorithm_name}", value=False),
                            width=1),
                    dbc.Col(html.Div("Show Anomaly Table"), width=3)
                ],
                        style={'margin-bottom': '15px'})
            ]),
        ],
    )
Пример #8
0
            dbc.Col(html.P(f"SINDROME GRIPAIS: 1103",
                           className="card-text",
                           style={"font-weight": "bold"}),
                    lg=7)
        ], )
    ],
                   style={
                       "padding-top": 5,
                       "padding-bottom": 5,
                       "background-color": "#DBDBDB"
                   })
]

cards = dbc.CardGroup([
    dbc.Card(card_confirmados, color="light", inverse=False, outline=False),
    dbc.Card(card_obitos, color="light", inverse=False, outline=False),
    dbc.Card(card_3, color="light", inverse=False, outline=False)
])

#Modal - Inside Column
left = dbc.Col(
    html.Div([
        "UERJ",
        html.Br(), "- Dr. Vahid Nikoofard",
        html.Br(), "- Dr. Bruno Fernando Inchausp Teixeira",
        html.Br(), "- Dra. Luciana Ghussn",
        html.Br(), "- Dr. Vinicius Seabra",
        html.Br(), "- Prof. Phillipe Valente Cardoso",
        html.Br(), "- Isabella Escobar dos Santos",
        html.Br(), "- Kenneth John Vasquez",
        html.Br(), "- Matheus Galhano Vieira Galvão",
Пример #9
0
recommended_articles = \
dbc.Row(
    [
        dbc.Col(
            dbc.CardGroup(
                [
                    html.A(
                        dbc.Card(
                            [
                                dbc.CardBody(
                                    [
                                        html.H5('Article 1',className='card-title'),
                                        html.H6('A sampling of the content of article 1.',className='card-subtitle'),
                                    ],
                                ),
                                dbc.CardImg(
                                    src='https://picsum.photos/200/200',
                                    bottom=True,
                                    #style=dict(height='100px',width='100px')
                                )
                            ],
                            style=dict(maxWidth='200px')
                        ),
                        href='/article-1'
                    )
                    for i in range(4)
                ],
            )
        )
    ],
)
Пример #10
0
def select_model(model_name) -> list:
    """Populate the input data fields depending on the selected model.

    First triggered when a model is selected from the dropdown in the navbar.
    Loads an example MUSE model and populates the cards to edit input values.
    Does not run on startup.

    Args:
        model_name (str): The name of the selected model. From the dropdown.

    Returns:
        children (list): The children of the `input-values` Column. Contains:
            - A CardGroup for input values (technologies)
            - A CardGroup for agent values (objectives)
            - A Button to run the model using values within the CardGroup fields.
    """
    # Do not run on startup
    if model_name is None:
        raise PreventUpdate

    model.select(model_name)

    return [
        dbc.CardGroup([
            dbc.Card(
                body=True,
                children=[
                    dbc.Label(sector.name.title(), size="lg"),
                    dbc.Label(
                        model.technodata[sector.name]["ProcessName"].iloc[-1],
                        size="sm",
                    ),
                ] + [
                    dbc.FormGroup(
                        row=True,
                        children=[
                            dbc.Label(technology, width=6),
                            dbc.Col(
                                dbc.Input(
                                    value=model.technodata[sector.name]
                                    [technology].iloc[-1],
                                    type="number",
                                    min=min(value_range),
                                    max=max(value_range),
                                    step=0.00000001,
                                    id={
                                        "type": "input_value",
                                        "index": f"{sector.name}-{technology}",
                                    },
                                ), ),
                        ],
                    ) for technology, value_range in TECHNOLOGIES.items()
                ],
            ) for sector in model.sectors
        ], ),
        dbc.CardGroup([
            dbc.Card(
                body=True,
                children=[
                    dbc.Label(agent["AgentShare"], size="lg"),
                    dcc.Dropdown(
                        options=[{
                            "label": objective,
                            "value": objective
                        } for objective in OBJECTIVES["Objective1"]],
                        value=agent["Objective1"],
                        id={
                            "type": "agent_value",
                            "index": agent["AgentShare"],
                        },
                    ),
                ],
            ) for index, agent in model.agents.iterrows()
        ], ),
        html.Br(),
        dbc.Button("Run Model", color="primary", id="run-button"),
    ]
Пример #11
0
                  fluid=True)
],
                       style={'height': '100%'})

CONTENT = html.Div([
    dbc.CardGroup([
        dbc.Card([html.H5('PV Power (MW)'),
                  html.P(id='pv-power-value')],
                 body=True),
        dbc.Card(
            [html.H5('Storage Power (MW)'),
             html.P(id='storage-power-value')],
            body=True),
        dbc.Card([
            html.H5('Storage Energy (MWH)'),
            html.P(id='storage-energy-value')
        ],
                 body=True),
        dbc.Card([html.H5('Efficiency'),
                  html.P(id='efficiency-value')],
                 body=True),
        dbc.Card([html.H5('Duration (Hours)'),
                  html.P(id='duration-value')],
                 body=True),
    ],
                  style={'text-align': 'Center'}),
    dbc.Row([
        dbc.Col([
            html.H3('Timeseries Graph',
                    style={
                        'marginTop': 25,
Пример #12
0
cards = dbc.CardGroup([
    dbc.Card(
        dbc.CardBody([
            html.H5("Card 1", className="card-title"),
            html.P(
                "This card has some text content, which is a little "
                "bit longer than the second card.",
                className="card-text",
            ),
            dbc.Button("Click here", color="success", className="mt-auto"),
        ])),
    dbc.Card(
        dbc.CardBody([
            html.H5("Card 2", className="card-title"),
            html.P(
                "This card has some text content.",
                className="card-text",
            ),
            dbc.Button("Click here", color="warning", className="mt-auto"),
        ])),
    dbc.Card(
        dbc.CardBody([
            html.H5("Card 3", className="card-title"),
            html.P(
                "This card has some text content, which is longer "
                "than both of the other two cards, in order to "
                "demonstrate the equal height property of cards in a "
                "card group.",
                className="card-text",
            ),
            dbc.Button("Click here", color="danger", className="mt-auto"),
        ])),
])
Пример #13
0
        dbc.CardGroup([
            dbc.Card(
                [
                    dbc.CardImg(src="/assets/images/dashboard.jpeg", top=True),
                    dbc.CardBody([
                        html.H3("Dashboard", style={"color": "#66666"}),
                        html.P(
                            '''Un espacio para obtener estadísticas básicas de usuarios, negocios, reseñas e interacciones, junto a algunos insights sobre sus calificaciones.
                                    
                                    ''',
                            className="card-text",
                            style={"font-size": "15px"},
                        ),
                        dbc.Button(
                            "Dashboard", color="primary", href="/page-5"),
                    ],
                                 className="text-center"),
                ],
                style={
                    "width": "18rem",
                    "margin": "0 1rem 0 0"
                },
            ),
            dbc.Card(
                [
                    dbc.CardImg(src="/assets/images/spatial_model.jpeg",
                                top=True),
                    dbc.CardBody([
                        html.H3("Recomendación", style={"color": "#66666"}),
                        html.P(
                            '''Acá puedes encontrar el sistema de recomendación híbrido basado en la combinación de modelos colaborativos, de contenido, con factorización,...''',
                            className="card-text",
                            style={"font-size": "15px"},
                        ),
                        dbc.Button("Sistema de recomendación",
                                   color="primary",
                                   href="/page-2"),
                    ],
                                 className="text-center"),
                ],
                style={"width": "18rem"},
            ),

            # dbc.Card(
            #     [
            #         dbc.CardImg(
            #             src="/assets/images/map.png", top=True),
            #         dbc.CardBody(

            #             [  html.H3("Exploración por usuarios", style = {"color": "#66666"}),

            #                 html.P(
            #                     '''
            #                     Finalmente, un apartado con las predicciones y el sistema diseñado para obtener recomendaciones de cualquier usuario en el sistema.
            #                     ''',
            #                     className="card-text", style = {"font-size": "15px"},
            #                 ),

            #                 dbc.Button("Exploration", color="primary",
            #                            href="/page-3", style={"align": "center"}),
            #             ],
            #             className="text-center"
            #         ),
            #     ],
            #     style={"width": "18rem", "margin": "0 0 0 1rem"},
            #     )
        ]),
body = dbc.Container(
    [
        dbc.Row([
            dbc.Col(dbc.CardGroup([
                dbc.Card([
                    dbc.CardHeader("Twitter", style={'text-align': 'center'}),
                    dbc.CardImg(src="/static/twitter.png", top=True),
                    dbc.CardFooter([
                        daq.BooleanSwitch(
                            id='switch_twitter', on=True, color="#D0E49F")
                    ])
                ]),
                dbc.Card([
                    dbc.CardHeader("Facebook", style={'text-align': 'center'}),
                    dbc.CardImg(src="/static/facebook.png", top=True),
                    dbc.CardFooter([
                        daq.BooleanSwitch(
                            id='switch_facebook', on=False, color="#D0E49F")
                    ])
                ]),
                dbc.Card([
                    dbc.CardHeader("YouTube", style={'text-align': 'center'}),
                    dbc.CardImg(src="/static/youtube.png", top=True),
                    dbc.CardFooter([
                        daq.BooleanSwitch(
                            id='switch_youtube', on=True, color="#D0E49F")
                    ])
                ])
            ]),
                    width=4),
            dbc.Col(dbc.Card([
                dbc.CardHeader("Pick a period", style={'text-align': 'center'
Пример #15
0
              style={'marginTop': 25}),
     html.Div(dbc.Row(dbc.Col(id='tabs-content', align='right'),
                      justify='center'),
              style={'marginBottom': 25}),
     dbc.Row(dbc.CardGroup([
         dbc.Card(
             dbc.CardBody(
                 html.Center([
                     html.H4(reported_countries,
                             className="card-title"),
                     html.P("Countries/Regions", className="card-text"),
                 ])), ),
         dbc.Card(
             dbc.CardBody(
                 html.Center([
                     html.H4([round(death_rate * 100, 2), '%'],
                             className="card-title"),
                     html.P("Death Rate", className="card-text"),
                 ])), ),
         dbc.Card(
             dbc.CardBody(
                 html.Center([
                     html.H4([round(recovered_rate * 100, 2), '%'],
                             className="card-title"),
                     html.P("Recovered Rate", className="card-text"),
                 ])), ),
     ]),
             justify='center'),
 ]),
         width=3),
 dbc.Col([
Пример #16
0
#     dark=True,
#     color='dark'
# )])

#%%
###############################################################################
#### TABS
###############################################################################



cart_tab = dbc.Col([
    dbc.Row([
        dbc.Col([
            html.H5("Overall Cart Totals"),
            dbc.CardGroup(id='cart-totals-card', style={'text-align':'center'}),
            dcc.Graph(id='cart-no-total-graph')
        ])
    ]),
    dbc.Button("Click to View Cart Numbers by Program",
                id="cart-no-button",color='primary',outline=True),
    dbc.Collapse(
        [
            dbc.Row([
                # html.H4("View Cart Numbers by Program"),
                dbc.Col([
                            dcc.Dropdown(
                                options=[{'label': i, 'value': i} \
                                        for i in cart_no['program'].unique()],
                                placeholder='Select Program',
                                value='cash_pay_program',
Пример #17
0
    inverse=True,  # change color of text (black or white)
    outline=
    False,  # True = remove the block colors from the background and header,
)

app.layout = html.Div([
    html.H2("Linear Regression",
            style={
                'text-align': 'center',
                'marginBottom': 25,
                'border': '2px white solid',
                'borderRadius': 3,
                'marginTop': 25
            }),
    html.Div([
        dbc.CardGroup(dbc.Col(card_upload, width=3)),
        dbc.CardGroup((dbc.Col(card_data, width=3), dbc.Col(card_train,
                                                            width=3),
                       dbc.Col(card_display, width=6)))
    ])
])


@app.callback(dash.dependencies.Output('slider-output-noise', 'children'),
              [dash.dependencies.Input('noise-slider', 'value')])
def update_output(value):
    return 'You have selected "{}"'.format(value)


@app.callback(dash.dependencies.Output('train-number-output', 'children'),
              [dash.dependencies.Input('train-number-input', 'value')])
Пример #18
0
image_related_cards = dbc.CardGroup(
    [
        dbc.Card(
            [
                dbc.CardImg(top=True, id="eye-image",
                            title="Image by Kevin Dinkel", alt='Learn Dash Bootstrap Card Component',
                            style={"height": "25rem"}),
                dbc.CardBody(
                    [
                        html.H5(id='name-image', className="card-title"),
                        dbc.Progress(id='progress', color="success")
                    ]
                )],
            outline=False,
            style={"height": "30rem"}
        ),
        dbc.Card(
            dbc.CardBody(
                [
                    html.H4("Click on the diagnosis buttons below to label the show image and display the next one:",
                            className="card-title"),
                    dbc.ListGroup(
                        [
                            dbc.Button("Healthy", color="primary", id='Healthy', n_clicks=0),
                            dbc.Button("Mild", color="secondary", id='Mild', n_clicks=0),
                            dbc.Button("Moderate", color="warning", id='Moderate', n_clicks=0),
                            dbc.Button("Severe", color="danger", id='Severe', n_clicks=0),
                            dbc.Button("Proliferative", color="info", id='Proliferative', n_clicks=0),
                        ]
                    ),
                    # for notification when no more images available
                    html.Div(id='noImages_placeholder', children=[]),
                ]
            ),
            outline=False,
            style={"height": "30rem"}
        )
    ]
)
Пример #19
0
work_equipe = dbc.CardGroup([
    dbc.Card(
        [
            dbc.CardImg(src="/assets/images/ingeniero_sistemas.jpg", top=True),
            dbc.CardBody([
                html.H4("Jimmy Pulido", className="card-title"),
                html.P(
                    "System Engineer of University National of Colombia "
                    "I like idioms and programming.",
                    className="card-text",
                ),
                dbc.Button("Profile", color="primary"),
            ]),
        ],
        style={"width": "18rem"},
    ),
    dbc.Card(
        [
            dbc.CardImg(src="/assets/images/administrador.jpg", top=True),
            dbc.CardBody([
                html.H4("Jhon Parra", className="card-title"),
                html.P(
                    "Business Administrator of University National of Colombia "
                    "I like series and animes.",
                    className="card-text",
                ),
                dbc.Button("Profile", color="primary"),
            ]),
        ],
        style={"width": "18rem"},
    ),
    dbc.Card(
        [
            dbc.CardImg(src="/assets/images/matematico.jpg", top=True),
            dbc.CardBody([
                html.H4("Fabian Pallares", className="card-title"),
                html.P(
                    "Mathematician of University National of Colombia "
                    "I like to be teacher.",
                    className="card-text",
                ),
                dbc.Button("Profile", color="primary"),
            ]),
        ],
        style={"width": "18rem"},
    ),
])
Пример #20
0
                     'fontSize': 20,
                     "vertical-align": "middle",
                     "text-align": "center"
                 }),
    ])
])

row4_cards = dbc.CardGroup([
    dbc.Card([dbc.CardHeader("Social"),
              dcc.Graph(id="s_score", figure={})]),
    dbc.Card(
        [dbc.CardHeader("Collaboration"),
         dcc.Graph(id="c_score", figure={})]),
    dbc.Card(
        [dbc.CardHeader("Opportunities"),
         dcc.Graph(id="o_score", figure={})]),
    dbc.Card([dbc.CardHeader("Risks"),
              dcc.Graph(id="r_score", figure={})]),
    dbc.Card(
        [dbc.CardHeader("Engagement"),
         dcc.Graph(id="e_score", figure={})]),
    dbc.Card(
        [dbc.CardHeader("Emissions"),
         dcc.Graph(id="em_score", figure={})])
])

# ------------------------------------------------------------------------------
# App layout

layout = html.Div([
    navbar.navbar(),
    html.Br(),
Пример #21
0
df = pd.read_csv("C:/Users/Raph/Desktop/Dashtest/data/Twitter_Renault.csv")

body = dbc.Container(
    [
        dbc.Row([
            dbc.Col(dbc.CardGroup([
                dbc.Card([
                    dbc.CardHeader("Twitter", style={'text-align': 'center'}),
                    dbc.CardImg(src="/static/twitter.png", top=True),
                    dbc.CardFooter(
                        [daq.BooleanSwitch(on=True, color="#D0E49F")])
                ]),
                dbc.Card([
                    dbc.CardHeader("Facebook", style={'text-align': 'center'}),
                    dbc.CardImg(src="/static/facebook.png", top=True),
                    dbc.CardFooter(
                        [daq.BooleanSwitch(on=False, color="#D0E49F")])
                ]),
                dbc.Card([
                    dbc.CardHeader("YouTube", style={'text-align': 'center'}),
                    dbc.CardImg(src="/static/youtube.png", top=True),
                    dbc.CardFooter(
                        [daq.BooleanSwitch(on=True, color="#D0E49F")])
                ])
            ]),
                    width=4),
            dbc.Col(dbc.Card([
                dbc.CardHeader("Pick a period", style={'text-align': 'center'
                                                       }),
                html.Div([
                    dcc.DatePickerRange(id='period',
Пример #22
0
import dash_bootstrap_components as dbc

cards = dbc.CardGroup([
    dbc.Card([
        dbc.CardHeader("These cards are in a card group"),
        dbc.CardBody([
            dbc.CardTitle("This is a title"),
            dbc.CardText("And some text"),
        ]),
    ]),
    dbc.Card(
        [
            dbc.CardHeader("Another card"),
            dbc.CardBody([
                dbc.CardTitle("This is a title"),
                dbc.CardText("And some text"),
            ]),
        ],
        color="dark",
        inverse=True,
    ),
])
Пример #23
0
        dbc.Button(
            "Listen Now",
            className="mr-1",
            color="info",
            href="https://open.spotify.com/playlist/65XgqkWUTIdLZm9rXqTp3x"),
    ]),
]

recsCenter = dbc.Col(
    [
        html.Center(children=[
            html.Span(' ', className='mr-1'),
            dbc.CardGroup(
                dbc.Card(
                    dbc.CardBody(
                        dbc.CardColumns([
                            dbc.Card(pod1, color="light"),
                            dbc.Card(trisacard, color="light"),
                            dbc.Card(pod2, color="light"),
                        ]))))
        ])
    ],
    md=10,
)
singleColumn = dbc.Col([], md=1)
doubleColumn = dbc.Col([], md=2)
tripleColumn = dbc.Col([], md=3)

footer = dbc.Col(
    [
        html.Div([
            dbc.Alert(html.Center([
Пример #24
0
cards_group_ctrl = dbc.CardGroup([
    dbc.Card([
        dbc.CardHeader('Orders to Cart Ratio'),
        dbc.CardBody([
            dbc.CardTitle(id='ctrl-o_to_c'),
            #dbc.CardText('Orders to Cart')
        ])
    ]),
    dbc.Card([
        dbc.CardHeader('Average Kits Requested'),
        dbc.CardBody([
            dbc.CardTitle(id='ctrl-avg_kits_requested', ),
            #dbc.CardText('Program Breakdown')
        ])
    ]),
    dbc.Card([
        dbc.CardHeader('Count of Kits Returned'),
        dbc.CardBody([
            dbc.CardTitle(id='ctrl-total_kits_requested'),
            #dbc.CardText('Program Breakdown')
        ])
    ]),
    dbc.Card([
        dbc.CardHeader('Average Kit Return Time'),
        dbc.CardBody([dbc.CardTitle(id='ctrl-average_days_to_return')])
    ]),
    dbc.Card([
        dbc.CardHeader('Sample Received:Kits Shipped Ratio'),
        dbc.CardBody([
            dbc.CardTitle(id='ctrl-sample_to_shipped_ratio'),
            #dbc.CardText('Average Kits requested')
        ])
    ])
])
Пример #25
0
 dbc.CardGroup([
     dbc.Card([
         dbc.CardImg(id='player1-img'),
         dbc.CardBody([
             html.H4(id='player1-name'),
             dbc.Table(
                 html.Tbody([
                     html.Tr([
                         html.Td(
                             html.Img(id='player1-level',
                                      style={
                                          'width': '50px',
                                          'height': '50px'
                                      })),
                         html.Td(id='player1-elo')
                     ]),
                     html.Tr([
                         html.Td(id='player1-label'),
                         html.Td(id='player1-average')
                     ]),
                 ])),
             dbc.Button("Go to Steam Profile", id='player1-steam')
         ])
     ],
              id='card-player1',
              color="dark",
              inverse=True),
     dbc.Card([
         dbc.CardBody([
             html.H1("VS",
                     style={
                         "text-align": "center",
                         "font-size": "80px"
                     }),
         ])
     ],
              id='card-vs',
              color="dark",
              inverse=True),
     dbc.Card([
         dbc.CardImg(id='player2-img'),
         dbc.CardBody([
             html.H4(id='player2-name'),
             dbc.Table(
                 html.Tbody([
                     html.Tr([
                         html.Td(
                             html.Img(id='player2-level',
                                      style={
                                          'width': '50px',
                                          'height': '50px'
                                      })),
                         html.Td(id='player2-elo')
                     ]),
                     html.Tr([
                         html.Td(id='player2-label'),
                         html.Td(id='player2-average')
                     ]),
                 ])),
             dbc.Button("Go to Steam Profile", id='player2-steam')
         ])
     ],
              id='card-player2',
              color="dark",
              inverse=True)
 ]),
Пример #26
0
 dbc.CardGroup([
     dbc.Card(dbc.CardBody([
         html.H2(id='case-count',
                 className="card-title",
                 style={
                     'font-weight': 'bold',
                     'text-align': 'center'
                 }),
         html.H5("cases",
                 className="card-title",
                 style={
                     'font-weight': 'bold',
                     'text-align': 'center',
                     'margin-bottom': 0
                 }),
         html.H5("today",
                 className="card-title",
                 style={
                     'font-weight': 'bold',
                     'text-align': 'center'
                 }),
         html.Br(),
         html.P(id='total-cases-region', className="card-text")
     ]),
              color='warning',
              inverse=True),
     dbc.Card(dbc.CardBody([
         html.H2(id='death-count',
                 className="card-title",
                 style={
                     'font-weight': 'bold',
                     'text-align': 'center'
                 }),
         html.H5("deaths ",
                 className="card-title",
                 style={
                     'font-weight': 'bold',
                     'text-align': 'center',
                     'margin-bottom': 0
                 }),
         html.H5("today",
                 className="card-title",
                 style={
                     'font-weight': 'bold',
                     'text-align': 'center'
                 }),
         html.Br(),
         html.P(id='total-deaths-region', className="card-text")
     ]),
              color='danger',
              inverse=True),
     dbc.Card(dbc.CardBody([
         html.H2(id='test-count',
                 className="card-title",
                 style={
                     'font-weight': 'bold',
                     'text-align': 'center'
                 }),
         html.H5("individuals tested today",
                 className="card-title",
                 style={
                     'font-weight': 'bold',
                     'text-align': 'center'
                 }),
         html.Br(),
         html.P(id='total-tests-region', className="card-text")
     ]),
              color='info',
              inverse=True),
     dbc.Card(dbc.CardBody([
         html.H2(id='recover-count',
                 className="card-title",
                 style={
                     'font-weight': 'bold',
                     'text-align': 'center'
                 }),
         html.H5("total recoveries today",
                 className="card-title",
                 style={
                     'font-weight': 'bold',
                     'text-align': 'center'
                 }),
         html.Br(),
         html.P(id='total-recoveries-region', className="card-text")
     ]),
              color='success',
              inverse=True)
 ])
Пример #27
0
import dash_core_components as dcc
import dash_html_components as html

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

card = dbc.Card(
    [dbc.CardHeader("Header"),
     dbc.CardBody("Body", style={"height": 250})],
    className="h-100 mt-4",
)

graph_card = dbc.Card(dbc.CardBody([dcc.Graph(style={"height": 200})] * 2))

app.layout = dbc.Container(
    dbc.Row([
        dbc.Col(card, width=2),
        dbc.Col(
            [
                dbc.CardDeck([card] * 3, ),
                dbc.CardGroup([graph_card] * 2, className="mt-4"),
            ],
            width=8,
        ),
        dbc.Col(card, width=2),
    ], ),
    fluid=True,
)

if __name__ == "__main__":
    app.run_server(debug=True)
Пример #28
0
ClINICAL_TRIALS_METRICS = [
    dbc.CardHeader(html.H5("Study Characteristics")),
    dbc.CardBody([
        dcc.Loading(
            id="loading-clin-data",
            children=[
                dbc.Alert(
                    "Not enough data to render this plot, please adjust the filters",
                    id="nont-enough-data",
                    color="warning",
                    style={"display": "none"},
                ),
                dbc.CardGroup([
                    dbc.Card(dcc.Graph(id='phase-bars')),
                    dbc.Card(dcc.Graph(id='company-pie')),
                    dbc.Card(dcc.Graph(id='sponsor-graph')),
                    dbc.Card(dcc.Graph(id='indication-bar')),
                ]),
                dbc.CardHeader(html.H5("Trial Averages")),
                dbc.CardGroup([
                    dbc.Card(dcc.Graph(id='study-size')),
                    dbc.Card(dcc.Graph(id='study-duration'))
                ])
            ],
            style={
                "marginTop": 1,
                "marginBottom": 1,
                "width": 1
            },
        ),
    ])
Пример #29
0
card_question = dbc.CardGroup([
    dbc.Card(
        [
            dbc.CardBody([
                html.H4("Sentiment Analysis", className="card-title"),
                html.
                P("5 Basics steps that needs to be followed for any machine learning project",
                  className="card-text"),
                dbc.ListGroup([
                    dbc.ListGroupItem("Step-1 Gather data "),
                    dbc.ListGroupItem("Step-2 preprocess your data"),
                    dbc.ListGroupItem(
                        "Step-3 Train your machine learning model"),
                    dbc.ListGroupItem("Step-4 Test your model"),
                    dbc.ListGroupItem("Step-5 Improve"),
                ],
                              flush=True)
            ]),
        ],
        color="warning",
    ),
    dbc.Card([
        html.H4("Composition of positive reviews and negative reviews",
                className="card-title",
                style={'color': 'lumen'}),
        html.Hr(),
        dcc.Graph(figure=pie_c()),
        dbc.ListGroupItem(
            "the data was gathered from scraping the website and following is the pie-chart of the positive and negative reviews"
        ),
        html.
        P("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------",
          className="card-text")
    ],
             outline=False)
])
Пример #30
0
def make_social_media_share(location):
    # got these buttons from simplesharebuttons.com, Yolandi Vi$$er
    return [
        dbc.CardGroup([
            dbc.Card([  # Facebook
                html.A(href=f'http://www.facebook.com/sharer.php?u={location}',
                       target='_blank',
                       children=dbc.CardImg(src='/assets/images/MiniFB.png',
                                            alt='Share with Facebook',
                                            title='Share with Facebook',
                                            style={
                                                'width': 50,
                                                'height': 50
                                            })),
            ]),
            dbc.Card([  # LinkedIn
                html.
                A(href=
                  f'http://www.linkedin.com/shareArticle?mini=true&url={location}',
                  target='_blank',
                  children=dbc.CardImg(src='/assets/images/MiniLinkedIn.png',
                                       alt='Share with LinkedIn',
                                       title='Share with LinkedIn',
                                       style={
                                           'width': 50,
                                           'height': 50
                                       })),
            ]),
            dbc.Card([  # Twitter
                html.
                A(href=
                  f'http://twitter.com/share?url={location}&text=Stock_Analysis&hashtags=StockAnalysis',
                  target='_blank',
                  children=dbc.CardImg(src='/assets/images/MiniTwitter.png',
                                       alt='Tweet this!',
                                       title='Tweet this!',
                                       style={
                                           'width': 50,
                                           'height': 50
                                       })),
            ]),  # , style={"width": "5rem"}
            dbc.Card([  # Pinterest
                html.
                A(href=
                  f'https://pinterest.com/pin/create/button/?url={location}&media=StockAnalysis&description=StockAnalysis',
                  target='_blank',
                  children=dbc.CardImg(src='/assets/images/MiniPinterest.png',
                                       alt='Pin It!',
                                       title='Pin It!',
                                       style={
                                           'width': 50,
                                           'height': 50
                                       })),
            ]),
            dbc.Card([  # Email
                html.
                A(href=
                  f'mailto:?Subject=Stock Analysis Web App&Body=I saw this and wanted to share it with you: {location}',
                  target='_blank',
                  children=dbc.CardImg(src='/assets/images/MiniEmail.png',
                                       alt='Email link!',
                                       title='Email link!',
                                       style={
                                           'width': 50,
                                           'height': 50
                                       })),
            ]),
            #dbc.Card([])    # empty card at end as spacer
        ])
    ]