Exemplo n.º 1
0
import dash
import dash_design_kit as ddk
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output

app = dash.Dash(__name__)
server = app.server  # expose server variable for Procfile

app.layout = ddk.App([
    ddk.Header([
        ddk.Logo(src=app.get_asset_url('logo.png')),
        ddk.Title('Dash Enterprise Sample Application'),
    ]),
    ddk.Row(children=[
        ddk.Card(children=ddk.Graph(figure={
            'data': [{
                'x': [1, 2, 3, 4],
                'y': [4, 1, 6, 9],
                'line': {
                    'shape': 'spline'
                }
            }]
        }, )),
    ]),
    ddk.Row(children=[
        ddk.Card(width=50,
                 children=ddk.Graph(figure={
                     'data': [{
                         'x': [1, 2, 3, 4],
                         'y': [4, 1, 6, 9],
Exemplo n.º 2
0
    columns = list(dataframe)
    for i in columns:
        figure.add_trace(go.Box(x=dataframe[i], name=i,
                                marker_color='#ffad33'))

    return figure


app.layout = ddk.App(
    show_editor=False,  # setting to True allows styling after build
    children=[
        ddk.Header([
            ddk.Logo(
                "assets/6synctLogoBlack.png",
                style={
                    "height": "30px",
                    "margin-right": "0px",
                    "width": "auto",
                },
            ),
            ddk.Title('NRC IRAP - Corporate Funding in Canada from 2018-2020'),
        ]),  # end of ddk.Header
        ddk.Block(  # left-hand column
            width=20,
            children=[
                dcc.Tabs([
                    dcc.Tab(
                        label='Map Filters',
                        children=[
                            ddk.ControlCard(
                                id='map-controls',
                                children=[
import plotly.graph_objects as go
import plotly.express as px

app = dash.Dash(__name__)
server = app.server  # expose server variable for Procfile

graph_height = 300

graph_config = {'modeBarButtonsToRemove': ['hoverCompareCartesian', 'select2d', 'lasso2d'],
                'doubleClick': 'reset+autosize', 'toImageButtonOptions': {'height': None, 'width': None, },
                'displaylogo': False}

app.layout = ddk.App([
    ddk.Header([
        ddk.Logo(src=app.get_asset_url('logo.png'), style={
            'max-height': 100,
            'width': 'auto'
        }),
        ddk.Title('TELONAS2'),
        ddk.SectionTitle('', id='final_date'),
        html.Button('Refresh', style={'float': 'right'}, id='refresh', n_clicks=0),
    ]),
    ddk.Block(
        children=[
            dcc.Tabs(id='selected-tab', value='load',
                     children=[
                         dcc.Tab(label="Load", value='load',
                                 children=[ddk.Card(width=100,
                                                    children=[
                                                        dcc.Loading(id='load_loader', children=[
                                                            ddk.Graph(id="load_plot", config=graph_config)]),
                                                            ]
Exemplo n.º 4
0
server = app.server
app.title = "Daily Standup"

update_redis_flag = os.environ.get('UPDATE_REDIS_FLAG')
if not update_redis_flag:
    update_redis_flag = input("Update Redis: Y/N ? -  ")
if update_redis_flag.upper() in ('YES', 'Y'):
    tasks.update_data()
else:
    print("skipping call to update redis cache")

app.layout = ddk.App(children=[
    ddk.Header(children=[
        dcc.Link(
            href=app.get_relative_path("/"),
            children=[ddk.Logo(src=app.get_relative_path("/assets/hnts.png"))],
        ),
        ddk.Title("Daily Standup"),
        html.Div([
            html.P(
                "Powered by",
                style={
                    "float": "left",
                    'fontSize': 10,
                    "margin-bottom": "0px"
                },
            ),
            html.Img(src=app.get_asset_url("his.png"),
                     style={
                         "width": "130px",
                         "float": "left",
Exemplo n.º 5
0
# df3 = df.groupby(df['Period','Type'], as_index=False)
#df3['LatLongTypeCount']=df3['name_old']
Type_list = list(df["Type"].unique())
totalFossilsFounds = len(df.axes[0])

# fig = px.scatter_geo(df, lat='Latitude', lon='Longitude', color="Country",
#                      hover_name="Country",
#                      projection="mercator",
#                      )


layout = ddk.App(
        [
                ddk.Header(
                        [
                        ddk.Logo(src=app.get_asset_url('trex.png')),
                        ddk.Title("Dino Fossil Data"),
                        ]
                ),
                dbc.Row(
                children=[
                        dbc.Col(
                        dbc.Card(
                                dbc.CardBody(
                                children=[
                                        html.Label('Period', style={'fontSize':30, 'textAlign':'center'}),
                                        dcc.Dropdown(
                                        id='period',
                                        options=[
                                                {"label": i, "value": i} for i in Period_list
                                        ],
Exemplo n.º 6
0
# dash-design-kit==1.4.0

dash_app.layout = html.Div([
    dcc.Location(id='url', refresh=False),
    ddk.App(
        style={'background-color': 'transparent'},
        children=[
            ddk.Header(
                style={
                    'height': '7vh',
                    'background-color': '#163d47',
                    'opacity': '1',
                    'margin': '0'
                },
                children=[
                    ddk.Logo(src='../assets/logo.gif'),
                    ddk.Block(
                        style={'text-align': 'right'},
                        children=[
                            dcc.Link('Главная',
                                     style={
                                         'color': 'azure',
                                         'margin': '10px'
                                     },
                                     href='/'),
                            # dcc.Link('Карточка Матча', style={'color': '#fff', 'margin': '10px'}, href='/match_card'),
                            # dcc.Link('МАТЧИ', style={'color': '#fff', 'margin': '10px'}, href='/all_matches')
                        ])
                ]),
            html.Div(id='page-content'),
            html.Div(id='table-container'),
Exemplo n.º 7
0
    def cards_items():
        serverBD = pd.read_csv(main_path_data + '\\tours.csv')
        cards = []

        for ind in serverBD.index:
            cards_items = dbc.ListGroupItem(
                id={
                    'type': 'dynamic_tour_item',
                    'index': ind
                },
                # href='/tournament/{}'.format(str(ind)),
                style={
                    'line-height': '1',
                    'margin': '0',
                    'margin-right': '0',
                    'height': 'fit-content',
                    'justify-content': 'center',
                    'vertical-align': '-webkit-baseline-middle',
                    'max-height': 'fit-content',
                    'padding': '0px',
                    "width": '100%',
                    'align-items': 'center'
                },
                color="default",
                action=True,
                children=[
                    dbc.Row(
                        style={
                            'max-height': 'fit-content',
                            'height': '100%',
                            'padding': '0px',
                            "width": '100%',
                            'align-items': 'center',
                            # 'justify-content': 'flex-start',
                            'justify-content': 'center',
                            'margin': '0',
                            'vertical-align': '-webkit-baseline-middle',
                            'textAlign': 'center',
                            'margin-left': '0',
                            'margin-right': '0'
                        },
                        children=[
                            dbc.Col(
                                # width=30,
                                style={
                                    "width": '30%',
                                    # 'max-width': '200px',
                                    'max-height': 'fit-content',
                                    'padding': '0px',
                                    'vertical-align':
                                    '-webkit-baseline-middle',
                                    'align-items': 'center',
                                    'justify-content': 'center',
                                    'margin': '0',
                                    'textAlign': 'center',
                                    # 'margin-left': '10px', 'margin-right': '10px'
                                },
                                children=html.H6(
                                    serverBD['TourName'][ind],
                                    style={
                                        'height': '100%',
                                        'color': 'azure',
                                        'max-height': 'fit-content',
                                        # 'max-width': '200px',
                                        'overflow-x': 'hidden',
                                        'margin': '0',
                                        'font-size': '15px',
                                        'text-align': 'center',
                                        'vertical-align':
                                        '-webkit-baseline-middle'
                                    })),
                            dbc.Col(
                                # width=20,
                                style={
                                    "width": '20%',
                                    # 'max-width': 'fit-content',
                                    'max-height': 'fit-content',
                                    'min-width': 'fit-content',
                                    'padding': '0px',
                                    'vertical-align':
                                    '-webkit-baseline-middle',
                                    'align-items': 'center',
                                    'justify-content': 'center',
                                    'margin': '0',
                                    'textAlign': 'left',
                                    # 'margin-left': '10px', 'margin-right': '10px'
                                },
                                children=[
                                    html.H2("{}".format(
                                        serverBD['TourPrize'][ind]),
                                            style={
                                                "width":
                                                '100%',
                                                'text-align':
                                                'center',
                                                'color':
                                                'azure',
                                                'padding':
                                                '0',
                                                'margin':
                                                '0',
                                                'max-height':
                                                'fit-content',
                                                'vertical-align':
                                                '-webkit-baseline-middle'
                                            })
                                ]),
                            dbc.Col(
                                # width=13,
                                style={
                                    "width": '20%',
                                    'max-height': '60px',
                                    # 'height': '60px',
                                    'min-width': 'fit-content',
                                    'padding': '0px',
                                    'vertical-align':
                                    '-webkit-baseline-middle',
                                    'align-items': 'center',
                                    'justify-content': 'center',
                                    'margin': '0',
                                    'textAlign': 'center'
                                },
                                children=[
                                    dbc.Row(children=html.P(
                                        "{}".format(serverBD['TourDateFrom']
                                                    [ind]),
                                        style={
                                            'color':
                                            'azure',
                                            'text-align':
                                            'center',
                                            'width':
                                            '100%',
                                            'font-size':
                                            '12px',
                                            'padding':
                                            '0px',
                                            'margin':
                                            '0',
                                            'max-height':
                                            '-webkit-fill-available',
                                            'vertical-align':
                                            '-webkit-baseline-middle'
                                        })),
                                    dbc.Row(children=html.P(
                                        "{}".format(serverBD['TourDateTo']
                                                    [ind]),
                                        style={
                                            'color':
                                            'azure',
                                            'text-align':
                                            'center',
                                            'width':
                                            '100%',
                                            'font-size':
                                            '12px',
                                            'padding':
                                            '0px',
                                            'margin':
                                            '0',
                                            'max-height':
                                            '-webkit-fill-available',
                                            'vertical-align':
                                            '-webkit-baseline-middle'
                                        })),
                                ]),
                            dbc.Col(
                                # width=8,
                                style={
                                    "width": '15%',
                                    'min-width': 'fit-content',
                                    'padding': '0px',
                                    'vertical-align':
                                    '-webkit-baseline-middle',
                                    'align-items': 'center',
                                    'justify-content': 'center',
                                    'margin': '0',
                                    'textAlign': 'center'
                                },
                                children=[
                                    html.H2("{}".format(
                                        serverBD['TourTeams'][ind]),
                                            style={
                                                'color':
                                                'azure',
                                                'width':
                                                '100%',
                                                'padding':
                                                '0px',
                                                'margin':
                                                '0',
                                                'max-height':
                                                '-webkit-fill-available',
                                                'vertical-align':
                                                '-webkit-baseline-middle'
                                            })
                                ]),
                            dbc.Col(
                                # width=13,
                                style={
                                    "width": '15%',
                                    'max-height': '60px',
                                    'height': '60px',
                                    'padding': '0px',
                                    'vertical-align':
                                    '-webkit-baseline-middle',
                                    'align-items': 'center',
                                    'justify-content': 'center',
                                    'min-width': 'fit-content',
                                    'margin-left': '5px',
                                    'margin': '0',
                                    'textAlign': 'center'
                                },
                                children=ddk.Logo(
                                    src=serverBD['TourFlagLink'][ind],
                                    style={
                                        'text-align': 'center',
                                        "width": '100%',
                                        'max-height': '50px',
                                        'padding': '0px',
                                        'margin': '0',
                                        'vertical-align':
                                        '-webkit-baseline-middle'
                                    })),
                        ])
                ])
            cards.append(cards_items)
        return cards
Exemplo n.º 8
0
    def cards_items():
        serverBD = pd.read_csv(main_path_data + '\\all_cards.csv')
        serverBD = serverBD.drop_duplicates(subset='Mid', keep="last")
        serverBD = serverBD[serverBD["Mstatus"] == 'Finished']
        serverBD = serverBD.sort_values(by='TIME', ascending=False)
        serverBD = serverBD.head(n=10)

        cards = []
        for ind in serverBD.index:
            cards_items = dbc.ListGroupItem(
                id={
                    'type': 'dynamic-cards-item',
                    'index': str(serverBD['Mid'][ind])
                },
                href='/{}'.format(str(serverBD['Mid'][ind])),
                style={
                    'line-height': '0',
                    'margin': '0',
                    'height': 'fit-content',
                    'justify-content': 'center',
                    'vertical-align': '-webkit-baseline-middle',
                    'max-height': 'fit-content',
                    'padding': '0px',
                    'align-items': 'center'
                },
                color="default",
                action=True,
                children=[
                    dbc.Row(
                        style={
                            'max-height': '50px',
                            'overflow-y': 'hidden',
                            'line-height': '1',
                            'height': '50px',
                            'padding': '0px',
                            "width": '100%',
                            'align-items': 'center',
                            # 'justify-content': 'flex-start',
                            'justify-content': 'center',
                            'margin': '0',
                            'vertical-align': '-webkit-baseline-middle',
                            'textAlign': 'center',
                            #     'margin-left': '0',
                            # 'margin-right': '0'
                        },
                        children=[
                            dbc.Col(
                                width=32,
                                style={
                                    'width': '32%',
                                    'padding': '0',
                                    'vertical-align':
                                    '-webkit-baseline-middle',
                                    'align-items': 'center',
                                    'justify-content': 'center',
                                    'margin': '0',
                                    'textAlign': 'center',
                                    # 'width':'fit-content',
                                    'margin-left': '0',
                                    'margin-right': '0'
                                },
                                children=dbc.Row([
                                    dbc.Col(
                                        width=35,
                                        style={
                                            'width': '35%',
                                            'max-height': '40px',
                                            'height': '40px',
                                            'background-image':
                                            'url(/assets/png/fon2.png)',
                                            'background-repeat': 'no-repeat',
                                            'background-position': 'center',
                                            'background-size': 'auto 90%',
                                            # 'background-size': 'cover',
                                            # 'width': 'fit-content',
                                            'padding': '0px',
                                            'vertical-align':
                                            '-webkit-baseline-middle',
                                            'align-items': 'center',
                                            'justify-content': 'center',
                                            'margin': '0',
                                            'textAlign': 'center'
                                        },
                                        children=ddk.Logo(
                                            src=serverBD['T1logo'][ind],
                                            style={
                                                'text-align':
                                                'center',
                                                'max-height':
                                                '-webkit-fill-available',
                                                'padding':
                                                '0px',
                                                'margin':
                                                '0',
                                                'vertical-align':
                                                '-webkit-baseline-middle'
                                            })),
                                    dbc.Col(
                                        width=65,
                                        style={
                                            'width': '65%',
                                            # 'overflowX': 'hidden',
                                            'padding': '0px',
                                            'vertical-align':
                                            '-webkit-baseline-middle',
                                            'align-items': 'center',
                                            'justify-content': 'center',
                                            'margin': '0',
                                            'textAlign': 'center'
                                        },
                                        children=html.H6(
                                            serverBD['T1name'][ind],
                                            style={
                                                'color':
                                                'azure',
                                                # 'width': 'fit-content',
                                                'padding':
                                                '0px',
                                                'margin':
                                                '0',
                                                'max-height':
                                                '-webkit-fill-available',
                                                'vertical-align':
                                                '-webkit-baseline-middle'
                                            }))
                                ])),
                            dbc.Col(width=16,
                                    style={
                                        'min-width': 'fit-content',
                                        'width': '16%',
                                        'max-height': 'fit-content',
                                        'padding': '0px',
                                        'vertical-align':
                                        '-webkit-baseline-middle',
                                        'align-items': 'center',
                                        'justify-content': 'center',
                                        'margin': '0',
                                        'textAlign': 'center',
                                        'margin-left': '10px',
                                        'margin-right': '10px'
                                    },
                                    children=[
                                        html.H1("{} : {}".format(
                                            serverBD['T1score'][ind],
                                            serverBD['T2score'][ind]),
                                                style={
                                                    'height':
                                                    '100%',
                                                    'margin':
                                                    '0',
                                                    'color':
                                                    'azure',
                                                    'padding':
                                                    '0',
                                                    'max-height':
                                                    'fit-content',
                                                    'vertical-align':
                                                    '-webkit-baseline-middle'
                                                })
                                    ]),
                            dbc.Col(
                                width=32,
                                style={
                                    'width': '32%',
                                    'padding': '0',
                                    'vertical-align':
                                    '-webkit-baseline-middle',
                                    'align-items': 'center',
                                    'justify-content': 'center',
                                    'margin': '0',
                                    'textAlign': 'center',
                                    # 'width':'fit-content',
                                    'margin-left': '0',
                                    'margin-right': '0'
                                },
                                children=dbc.Row([
                                    dbc.Col(
                                        width=65,
                                        style={
                                            'width': '65%',
                                            # 'overflowX': 'hidden',
                                            'padding': '0px',
                                            'vertical-align':
                                            '-webkit-baseline-middle',
                                            'align-items': 'center',
                                            'justify-content': 'center',
                                            'margin': '0',
                                            'textAlign': 'center'
                                        },
                                        children=html.H6(
                                            serverBD['T2name'][ind],
                                            style={
                                                'color':
                                                'azure',
                                                # 'width': 'fit-content',
                                                'padding':
                                                '0px',
                                                'margin':
                                                '0',
                                                'max-height':
                                                '-webkit-fill-available',
                                                'vertical-align':
                                                '-webkit-baseline-middle'
                                            })),
                                    dbc.Col(
                                        width=35,
                                        style={
                                            'max-height': '40px',
                                            'height': '40px',
                                            'width': '35%',
                                            'padding': '0px',
                                            'vertical-align':
                                            '-webkit-baseline-middle',
                                            'align-items': 'center',
                                            'justify-content': 'center',
                                            'margin': '0',
                                            'textAlign': 'center'
                                        },
                                        children=ddk.Logo(
                                            src=serverBD['T2logo'][ind],
                                            style={
                                                'text-align':
                                                'center',
                                                'background-image':
                                                'url(/assets/png/fon2.png)',
                                                'background-repeat':
                                                'no-repeat',
                                                'background-position':
                                                'center',
                                                'background-size':
                                                'auto 90%',
                                                'max-height':
                                                '-webkit-fill-available',
                                                'padding':
                                                '0px',
                                                'margin':
                                                '0',
                                                'vertical-align':
                                                '-webkit-baseline-middle'
                                            }))
                                ])),
                            # ddk.Block(
                            #     # width=50,
                            #           style={'max-width': '200px',
                            #              'max-height': 'fit-content',
                            #              'padding': '0px', 'vertical-align': '-webkit-baseline--webkit-baseline-middle',
                            #              'align-items': 'center', 'justify-content': 'center',
                            #              'margin': '0', 'textAlign': 'center',
                            #              # 'margin-left': '10px', 'margin-right': '10px'
                            #                  },
                            #           children=html.H6(serverBD['Mtour'][ind],
                            #                       style={'height': '100%','color':'azure',
                            #                              'max-height': 'fit-content',
                            #                              'max-width': '200px',
                            #                              'overflow-x':'hidden',
                            #                              'margin': '0',
                            #                              'vertical-align': '-webkit-baseline--webkit-baseline-middle'})),
                        ])
                ])
            cards.append(cards_items)
        return cards
Exemplo n.º 9
0
 def cards_items():
     serverBD = pd.read_csv(main_path_data + '\\live.csv')
     cards = []
     for ind in serverBD.index:
         cards_items = dbc.ListGroupItem(
             id={
                 'type': 'live-cards-item',
                 'index': str(serverBD['match_id_live'][ind])
             },
             href='/{}'.format(str(serverBD['match_id_live'][ind])),
             style={
                 'line-height': '1',
                 'margin': '0',
                 'margin-right': '0',
                 'height': 'fit-content',
                 'justify-content': 'center',
                 'vertical-align': '-webkit-baseline-middle',
                 'max-height': '60px',
                 'padding': '0px',
                 'align-items': 'center'
             },
             color="default",
             action=True,
             children=[
                 ddk.Block(
                     style={
                         'max-height': '60px',
                         'overflow-y': 'hidden',
                         'height': '100%',
                         'padding': '0px',
                         "width": '100%',
                         'align-items': 'center',
                         # 'justify-content': 'flex-start',
                         'justify-content': 'center',
                         'margin': '0',
                         'vertical-align': '-webkit-baseline-middle',
                         'textAlign': 'center',
                         'margin-left': '0',
                         'margin-right': '0'
                     },
                     children=[
                         ddk.Block(
                             width=30,
                             style={
                                 'padding': '0',
                                 'vertical-align':
                                 '-webkit-baseline-middle',
                                 'align-items': 'center',
                                 'justify-content': 'center',
                                 'margin': '0',
                                 'textAlign': 'center',
                                 # 'width':'fit-content',
                                 'margin-left': '0',
                                 'margin-right': '0'
                             },
                             children=[
                                 ddk.Block(
                                     width=40,
                                     style={
                                         'max-height': '40px',
                                         'height': '40px',
                                         'background-image':
                                         'url(/assets/png/fon2.png)',
                                         'background-repeat': 'no-repeat',
                                         'background-position': 'center',
                                         'background-size': 'auto 90%',
                                         # 'background-size': 'cover',
                                         # 'width': 'fit-content',
                                         'padding': '0px',
                                         'vertical-align':
                                         '-webkit-baseline-middle',
                                         'align-items': 'center',
                                         'justify-content': 'center',
                                         'margin': '0',
                                         'textAlign': 'center'
                                     },
                                     children=ddk.Logo(
                                         src=serverBD['T1logos_live'][ind],
                                         style={
                                             'text-align':
                                             'center',
                                             'max-height':
                                             '-webkit-fill-available',
                                             'padding':
                                             '0px',
                                             'margin':
                                             '0',
                                             'vertical-align':
                                             '-webkit-baseline-middle'
                                         })),
                                 ddk.Block(
                                     width=60,
                                     style={
                                         # 'overflowX': 'hidden',
                                         'padding': '0px',
                                         'vertical-align':
                                         '-webkit-baseline-middle',
                                         'align-items': 'center',
                                         'justify-content': 'center',
                                         'margin': '0',
                                         'textAlign': 'center'
                                     },
                                     children=html.H6(
                                         serverBD['T1names_live'][ind],
                                         style={
                                             'color':
                                             'azure',
                                             # 'width': 'fit-content',
                                             'padding':
                                             '0px',
                                             'margin':
                                             '0',
                                             'max-height':
                                             '-webkit-fill-available',
                                             'vertical-align':
                                             '-webkit-baseline-middle'
                                         }))
                             ]),
                         ddk.Block(width=20,
                                   style={
                                       'max-width': 'fit-content',
                                       'max-height': 'fit-content',
                                       'padding': '0px',
                                       'vertical-align':
                                       '-webkit-baseline-middle',
                                       'align-items': 'center',
                                       'justify-content': 'center',
                                       'margin': '0',
                                       'textAlign': 'center',
                                       'margin-left': '10px',
                                       'margin-right': '10px'
                                   },
                                   children=[
                                       html.H1("{} : {}".format(
                                           serverBD['T1_live_score1'][ind],
                                           serverBD['T2_live_score1'][ind]),
                                               style={
                                                   'height':
                                                   '100%',
                                                   'color':
                                                   'azure',
                                                   'padding':
                                                   '0',
                                                   'max-height':
                                                   'fit-content',
                                                   'vertical-align':
                                                   '-webkit-baseline-middle'
                                               })
                                   ]),
                         ddk.Block(
                             width=30,
                             style={
                                 'padding': '0',
                                 'vertical-align':
                                 '-webkit-baseline-middle',
                                 'align-items': 'center',
                                 'justify-content': 'center',
                                 'margin': '0',
                                 'textAlign': 'center',
                                 # 'width':'fit-content',
                                 'margin-left': '0',
                                 'margin-right': '0'
                             },
                             children=[
                                 ddk.Block(
                                     width=60,
                                     style={
                                         # 'overflowX': 'hidden',
                                         'padding': '0px',
                                         'vertical-align':
                                         '-webkit-baseline-middle',
                                         'align-items': 'center',
                                         'justify-content': 'center',
                                         'margin': '0',
                                         'textAlign': 'center'
                                     },
                                     children=html.H6(
                                         serverBD['T2names_live'][ind],
                                         style={
                                             'color':
                                             'azure',
                                             # 'width': 'fit-content',
                                             'padding':
                                             '0px',
                                             'margin':
                                             '0',
                                             'max-height':
                                             '-webkit-fill-available',
                                             'vertical-align':
                                             '-webkit-baseline-middle'
                                         })),
                                 ddk.Block(
                                     width=40,
                                     style={
                                         'max-height': '40px',
                                         'height': '40px',
                                         # 'width': 'fit-content',
                                         'padding': '0px',
                                         'vertical-align':
                                         '-webkit-baseline-middle',
                                         'align-items': 'center',
                                         'justify-content': 'center',
                                         'margin': '0',
                                         'textAlign': 'center'
                                     },
                                     children=ddk.Logo(
                                         src=serverBD['T2logos_live'][ind],
                                         style={
                                             'text-align':
                                             'center',
                                             'background-image':
                                             'url(/assets/png/fon2.png)',
                                             'background-repeat':
                                             'no-repeat',
                                             'background-position':
                                             'center',
                                             'background-size':
                                             'auto 90%',
                                             'max-height':
                                             '-webkit-fill-available',
                                             'padding':
                                             '0px',
                                             'margin':
                                             '0',
                                             'vertical-align':
                                             '-webkit-baseline-middle'
                                         }))
                             ]),
                         # ddk.Block(
                         #     # width=50,
                         #           style={'max-width': '200px',
                         #              'max-height': 'fit-content',
                         #              'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                         #              'align-items': 'center', 'justify-content': 'center',
                         #              'margin': '0', 'textAlign': 'center',
                         #              # 'margin-left': '10px', 'margin-right': '10px'
                         #                  },
                         #           children=html.H6(serverBD['Mtour_live'][ind],
                         #                       style={'height': '100%','color':'azure',
                         #                              'max-height': 'fit-content',
                         #                              'max-width': '200px',
                         #                              'overflow-x':'hidden',
                         #                              'margin': '0',
                         #                              'vertical-align': '-webkit-baseline-middle'})),
                     ])
             ])
         cards.append(cards_items)
     return cards
Exemplo n.º 10
0
def live():
    liveBD = pd.read_csv(main_path_data + "\\live.csv")

    live_items = []

    for ind in liveBD.index:

        ##########################    TOP 3 LIVE   ###################################
        top3_live = html.A(
            href='/{}'.format(str(liveBD['match_id_live'][ind])),
            children=[
                ddk.Card(
                    width=50,
                    rounded=10,
                    card_hover=True,
                    style={
                        'max-height': 'fit-content',
                        'height': '70px',
                        'padding': '0px',
                        'display': 'inline-block',
                        # "width": '100%',
                        'background-color': '#163d47',
                        "opacity": "0.8",
                        'align-items': 'center',
                        # 'justify-content': 'flex-start',
                        'justify-content': 'center',
                        'margin': '5px',
                        'vertical-align': '-webkit-baseline-middle',
                        'textAlign': 'center',
                        # 'margin-left': '0',
                        # 'margin-right': '0'
                    },
                    children=ddk.Block(
                        style={
                            'width': '-webkit-fill-available',
                            'max-width': '-webkit-fill-available',
                            'vertical-align': '-webkit-baseline-middle',
                            'margin': '0',
                            'padding': '0px',
                        },
                        children=[
                            ddk.Block(
                                width=40,
                                style={
                                    'height': '-webkit-fill-available',
                                    'padding': '0',
                                    # 'vertical-align': '-webkit-baseline-middle',
                                    'align-items': 'center',
                                    'justify-content': 'center',
                                    'margin': '0',
                                    'textAlign': 'center',
                                    # 'width':'100%',
                                    'margin-left': '0',
                                    'margin-right': '0'
                                },
                                children=[
                                    ddk.Block(
                                        width=40,
                                        style={
                                            'max-height': '80px',
                                            'height': '80px',
                                            # 'background-image': 'url(/assets/png/fon2.png)',
                                            # 'background-repeat': 'no-repeat',
                                            # 'background-position': 'center',
                                            # 'background-size': 'auto',
                                            # 'background-size': 'cover',
                                            # 'width': 'fit-content',
                                            'padding': '0px',
                                            'vertical-align':
                                            '-webkit-baseline-middle',
                                            'align-items': 'center',
                                            'justify-content': 'center',
                                            'margin': '0',
                                            'textAlign': 'center'
                                        },
                                        children=ddk.Logo(
                                            src=liveBD['T1logos_live'][ind],
                                            style={
                                                'text-align':
                                                'left',
                                                # 'width':'100%',
                                                'height':
                                                '80px',
                                                'max-height':
                                                '80px',
                                                'padding':
                                                '0px',
                                                'margin':
                                                '0',
                                                'vertical-align':
                                                '-webkit-baseline-middle'
                                            })),
                                    ddk.Block(
                                        width=60,
                                        style={
                                            # 'overflowX': 'hidden',
                                            'padding': '0px',
                                            # 'vertical-align': '-webkit-baseline-middle',
                                            'align-items': 'center',
                                            'justify-content': 'center',
                                            'margin': '0',
                                            'textAlign': 'center'
                                        },
                                        children=[
                                            html.H6(
                                                liveBD['T1names_live'][ind],
                                                style={
                                                    'color':
                                                    'azure',
                                                    # 'width': 'fit-content',
                                                    'padding':
                                                    '0px',
                                                    'margin':
                                                    '0',
                                                    'width':
                                                    '100%',
                                                    # 'max-height': '-webkit-fill-available',
                                                    'vertical-align':
                                                    '-webkit-baseline-middle'
                                                }),
                                            html.H1(
                                                liveBD['T1_live_score1'][ind],
                                                style={
                                                    'color':
                                                    'azure',
                                                    # 'width': 'fit-content',
                                                    'padding':
                                                    '0px',
                                                    "opacity":
                                                    "1.2",
                                                    "margin-top":
                                                    "10px",
                                                    'width':
                                                    '100%',
                                                    # 'margin': '0',
                                                    'font-weight':
                                                    "900",
                                                    # 'max-height': '-webkit-fill-available',
                                                    'vertical-align':
                                                    '-webkit-baseline-middle'
                                                })
                                        ])
                                ]),
                            ddk.Block(
                                width=6,
                                style={
                                    'max-width': 'fit-content',
                                    'max-height': 'fit-content',
                                    'padding': '0px',
                                    # 'vertical-align': '-webkit-baseline-middle',
                                    'align-items': 'center',
                                    'justify-content': 'center',
                                    'margin': '0',
                                    'textAlign': 'center',
                                    'margin-left': '10px',
                                    'margin-right': '10px'
                                },
                                children=[
                                    html.H2(
                                        "VS",
                                        style={
                                            'height': '100%',
                                            'color': 'azure',
                                            'padding': '0',
                                            'max-height': 'fit-content',
                                            'width': 'fit-content',
                                            "margin-top": "10px"
                                            # 'vertical-align': '-webkit-baseline-middle'
                                        })
                                ]),
                            ddk.Block(
                                width=40,
                                style={
                                    'height': '-webkit-fill-available',
                                    'padding': '0',
                                    'vertical-align':
                                    '-webkit-baseline-middle',
                                    'align-items': 'center',
                                    'justify-content': 'center',
                                    'margin': '0',
                                    'textAlign': 'center',
                                    # 'width':'fit-content',
                                    'margin-left': '0',
                                    'margin-right': '0'
                                },
                                children=[
                                    ddk.Block(
                                        width=60,
                                        style={
                                            # 'overflowX': 'hidden',
                                            'padding': '0px',
                                            # 'vertical-align': '-webkit-baseline-middle',
                                            'align-items': 'center',
                                            'justify-content': 'center',
                                            'margin': '0',
                                            'textAlign': 'center'
                                        },
                                        children=[
                                            html.H6(
                                                liveBD['T2names_live'][ind],
                                                style={
                                                    'color':
                                                    'azure',
                                                    # 'width': 'fit-content',
                                                    'padding':
                                                    '0px',
                                                    'margin':
                                                    '0',
                                                    'width':
                                                    '100%',
                                                    # 'max-height': '-webkit-fill-available',
                                                    'vertical-align':
                                                    '-webkit-baseline-middle'
                                                }),
                                            html.H1(
                                                liveBD['T2_live_score1'][ind],
                                                style={
                                                    'color':
                                                    'azure',
                                                    # 'width': 'fit-content',
                                                    "margin-top":
                                                    "10px",
                                                    "opacity":
                                                    "1.2",
                                                    'padding':
                                                    '0px',
                                                    'width':
                                                    '100%',
                                                    # 'margin': '0',
                                                    'font-weight':
                                                    "900",
                                                    # 'max-height': '-webkit-fill-available',
                                                    'vertical-align':
                                                    '-webkit-baseline-middle'
                                                })
                                        ]),
                                    ddk.Block(
                                        width=40,
                                        style={
                                            'max-height': '80px',
                                            'height': '80px',
                                            # 'background-image': 'url(/assets/png/fon2.png)',
                                            # 'background-repeat': 'no-repeat',
                                            # 'background-position': 'center',
                                            # 'background-size': 'auto',
                                            # 'background-size': 'cover',
                                            # 'width': 'fit-content',
                                            'padding': '0px',
                                            'vertical-align':
                                            '-webkit-baseline-middle',
                                            'align-items': 'center',
                                            'justify-content': 'center',
                                            'margin': '0',
                                            'textAlign': 'center'
                                        },
                                        children=ddk.Logo(
                                            src=liveBD['T2logos_live'][ind],
                                            style={
                                                'text-align':
                                                'center',
                                                # 'background-image': 'url(/assets/png/fon2.png)',
                                                # 'background-repeat': 'no-repeat',
                                                # 'background-position': 'center',
                                                # 'background-size': 'auto 130%',
                                                # 'width':'100%',
                                                'height':
                                                '80px',
                                                'max-height':
                                                '80px',
                                                'padding':
                                                '0px',
                                                'margin':
                                                '0',
                                                'vertical-align':
                                                '-webkit-baseline-middle'
                                            }))
                                ]),
                        ]))
            ])

        live_items.append(top3_live)

    return live_items
Exemplo n.º 11
0
    def cards_items():
        serverBD1 = pd.read_csv(main_path_data + '\\live.csv')
        serverBD = pd.read_csv(main_path_data + '\\server.csv')
        cards = []

        # print('serverBD1', serverBD1)
        for ind in serverBD1.index:

            if serverBD1['T1gold'][ind] == "r" or serverBD1['T1gold'][ind] == 'd':
                T1gold = dbc.Row(style={'margin':'0','justify-content': 'center',
                                        # 'width': 'fit-content',
                                        'padding':'0'},
                                 children=[
                    dbc.Col(width=80,
                       style={'margin': '0', 'padding': '0', 'width': '80%',},
                       children=html.H6("",
                                    style={'color': '#ff0000',
                                            'font-weight': '900',
                                            # 'width': 'fit-content',
                                            'padding': '0px', 'margin': '0',
                                            'max-height': '-webkit-fill-available',
                                            'vertical-align': '-webkit-baseline-middle'})),
                    dbc.Col(width=20,
                                     style={'margin': '0', 'padding': '0','width': '20%',
                                            'max-height': '20px',
                                            'height': '20px'},
                                     children=[])])
            else:
                T1gold = dbc.Row(style={'margin':'0','justify-content': 'center',
                                        # 'width': 'fit-content',
                                        'padding':'0'},
                                 children=[
                    dbc.Col(width=80,
                       style={'margin': '0', 'padding': '0','width': '80%',},
                       children=html.H6(serverBD1['T1gold'][ind], style={'color': '#ff0000',
                                            'font-weight': '900',
                                            # 'width': 'fit-content',
                                            'padding': '0px', 'margin': '0',
                                            'max-height': '-webkit-fill-available',
                                            'vertical-align': '-webkit-baseline-middle'})),
                    dbc.Col(width=20,
                                     style={'margin': '0', 'padding': '0','width': '20%',
                                            'max-height': '20px',
                                            'height': '20px'},
                                     children=ddk.Logo(
                                         src='../assets/png/gold.png',
                                         style={'text-align': 'center',
                                               'max-height': '-webkit-fill-available',
                                               'padding': '0px', 'margin': '0',
                                             'vertical-align': '-webkit-baseline-middle'}))])

            if serverBD1['T2gold'][ind] == "r" or serverBD1['T2gold'][ind] == 'd':
                T2gold = dbc.Row(style={'margin':'0','justify-content': 'center',
                                        # 'width': 'fit-content',
                                        'padding':'0'},
                                 children=[
                                     dbc.Col(width=20,
                                     style={'margin': '0', 'padding': '0',
                                            'max-height': '20px','width': '20%',
                                            'height': '20px'},
                                     children=[]),
                                     dbc.Col(width=80,
                                              style={'margin': '0', 'padding': '0', 'width': '80%',},
                                              children=html.H6("",
                                               style={'color': '#ff0000',
                                                      'font-weight': '900',
                                                      # 'width': 'fit-content',
                                                      'padding': '0px', 'margin': '0',
                                                      'max-height': '-webkit-fill-available',
                                                      'vertical-align': '-webkit-baseline-middle'})),
                       ])
            else:
                T2gold = dbc.Row(style={'margin':'0','justify-content': 'center',
                                        'width': '100%',
                                        'padding':'0'},
                                 children=[
                    dbc.Col(width=20,
                                     style={'margin': '0', 'padding': '0',
                                            'max-height': '20px','width': '20%',
                                            'height': '20px'},
                                     children=ddk.Logo(
                                         src='../assets/png/gold.png',
                                         style={'text-align': 'center',
                                                'max-height': '-webkit-fill-available',
                                                'padding': '0px', 'margin': '0',
                                                'vertical-align': '-webkit-baseline-middle'})),
                    dbc.Col(width=80,
                                    style={'margin': '0', 'padding': '0', 'width': '80%',},
                                    children=html.H6(serverBD1['T2gold'][ind],
                                                     style={'color': '#ff0000',
                                                            'font-weight': '900',
                                                            # 'width': 'fit-content',
                                                            'padding': '0px', 'margin': '0',
                                                            'max-height': '-webkit-fill-available',
                                                            'vertical-align': '-webkit-baseline-middle'})),
                       ])

            T1 = dbc.Col(style={'margin':'0','justify-content': 'center',
                                # 'width': '100%',
                                'padding':'0'},
                                 children=[
                                     dbc.Row(
                                         # width=100,
                                             style={'margin':'0','justify-content': 'center',
                                                    # 'width': '100%',
                                                    'padding':'0'},
                                             children=html.H6(serverBD1['T1names_live'][ind],
                                                              style={'color': 'azure',
                                                            # 'width': 'fit-content',
                                                            'padding': '0px', 'margin': '0',
                                                            'max-height': '-webkit-fill-available',
                                                            'vertical-align': '-webkit-baseline-middle'})),

                                     T1gold
                                     # dbc.Row(
                                     #     # width=100,
                                     #       style={'margin': '0', 'width': '100%','padding': '0'},
                                     #       children=T1gold)
                                           ])

            T2 = dbc.Col(style={'margin':'0','justify-content': 'center',
                                # 'width': 'fit-content',
                                'padding':'0'},
                                 children=[
                                     dbc.Row(
                                         # width=100,
                                             style={'margin': '0',
                                                    'width': '100%','justify-content': 'center',
                                                    'padding': '0'},
                                             children=html.H6(serverBD1['T2names_live'][ind],
                                                              style={'color': 'azure',
                                                  'padding': '0px', 'margin': '0',
                                                  'max-height': '-webkit-fill-available',
                                                  'vertical-align': '-webkit-baseline-middle'})),
                                     T2gold
                                     # dbc.Row(
                                     #     # width=100,
                                     #        style={'margin': '0',
                                     #               'width': '100%',
                                     #               'padding': '0'},
                                     #        children=T2gold),
             ])



            cards_items1=dbc.ListGroupItem(
                id={'type': 'live-cards-item',
                    'index': str(serverBD1['match_id_live'][ind])},
                href='/{}'.format(str(serverBD1['match_id_live'][ind])),
                style={'line-height': '1', 'margin': '0', 'margin-right': '0',
                                     'height': 'fit-content', 'justify-content': 'center',
                                     'vertical-align': '-webkit-baseline-middle',
                                     'max-height': '60px', 'padding': '0px',
                                     'align-items': 'center'},
                color="default",
                className='live_list',
                action=True,
                children=[
                    dbc.Row(style={'max-height': '60px',
                                   "flex-direction": "row",
                                     # 'overflow-y': 'hidden',
                                 'height': '100%',
                                 'padding': '0px',
                                 # "width": 'fit-content',
                                   'align-items': 'center',
                                 # 'justify-content': 'flex-start',
                                   'justify-content': 'center',
                                   # 'margin': '0',
                                 'vertical-align': '-webkit-baseline-middle',
                                 'textAlign': 'center',
                                 #   'margin-left': '0',
                                 # 'margin-right': '0'
                                   },
                            children=[
                                dbc.Col(width=30,
                                          style={'width': '30%',
                                         'padding': '0', 'vertical-align': '-webkit-baseline-middle',
                                         'align-items': 'center', 'justify-content': 'center',
                                         'margin': '0', 'textAlign': 'center',
                                         'margin-left': '0', 'margin-right': '0'},
                                          children=dbc.Row(
                                              [
                                              dbc.Col(width=40,
                                                        style={
                                                        'max-height': '40px',
                                                        'height': '40px',
                                                            # 'background-image': 'url(/assets/png/fon2.png)',
                                                            # 'background-repeat': 'no-repeat',
                                                            # 'background-position': 'center',
                                                            # 'background-size': 'auto 90%',
                                                        'width': '40%',
                                                         'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                         'align-items': 'center', 'justify-content': 'center',
                                                         'margin': '0', 'textAlign': 'center'},
                                                        children=ddk.Logo(
                                                            src=serverBD1['T1logos_live'][ind],
                                                            style={'text-align': 'center',
                                                                   'max-height': '-webkit-fill-available',
                                                                   'padding': '0px', 'margin': '0',
                                                                 'vertical-align': '-webkit-baseline-middle'})),
                                              dbc.Col(width=60,
                                                        style={
                                                            'width': '60%',
                                                 'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                 'align-items': 'center', 'justify-content': 'center',
                                                 'margin': '0', 'textAlign': 'center'},
                                                      children=T1)])),
                                dbc.Col(width=20,
                                          style={'min-width': 'fit-content',
                                                 'width': '20%',
                                             'max-height': 'fit-content',
                                             'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                             'align-items': 'center', 'justify-content': 'center',
                                             'margin': '0', 'textAlign': 'center',
                                             'margin-left': '10px', 'margin-right': '10px'},
                                          children=[html.H1("{} : {}".format(serverBD1['T1_live_score1'][ind],
                                                                              serverBD1['T2_live_score1'][ind]),
                                                                      style={'height': '100%',
                                                                             'margin-top': '10px',
                                                                             # 'margin': '0',
                                                                             'margin-bottom': '0px',
                                                                             'color': '#3dea04', 'padding':'0',
                                                                             'max-height': 'fit-content',
                                                                             'width':'100%',
                                                                             'vertical-align': '-webkit-baseline-middle'}),
                                                    html.P("{} - {}".format(serverBD1['T1_live_score2'][ind],
                                                                             serverBD1['T2_live_score2'][ind]),
                                                            style={'height': '100%',
                                                                   'color': 'gold', 'padding': '0',
                                                                   'max-height': 'fit-content',
                                                                   'margin-bottom': '10px',
                                                                   'margin-top': '0px',
                                                                   'width': '100%','font-size': '10px',
                                                                   'vertical-align': '-webkit-baseline-middle'})
                                                    ]),
                                dbc.Col(width=30,
                                          style={
                                              'width': '30%',
                                         'padding': '0', 'vertical-align': '-webkit-baseline-middle',
                                         'align-items': 'center', 'justify-content': 'center',
                                         'margin': '0', 'textAlign': 'center',
                                              # 'width':'fit-content',
                                         'margin-left': '0', 'margin-right': '0'},
                                          children=dbc.Row(
                                              [
                                            dbc.Col(width=60,
                                                      style={'width': '60%',
                                                            # 'overflowX': 'hidden',
                                                 'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                 'align-items': 'center', 'justify-content': 'center',
                                                 'margin': '0', 'textAlign': 'center'},
                                                      children=T2),
                                            dbc.Col(width=40,
                                                      style={
                                                        'max-height': '40px',
                                                        'height': '40px',
                                                        'width': '40%',
                                                         'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                         'align-items': 'center', 'justify-content': 'center',
                                                         'margin': '0', 'textAlign': 'center'},
                                                      children=ddk.Logo(src=serverBD1['T2logos_live'][ind],
                                                                        style={'text-align': 'center',
                                                            #                    'background-image': 'url(/assets/png/fon2.png)',
                                                            # 'background-repeat': 'no-repeat',
                                                            # 'background-position': 'center',
                                                            # 'background-size': 'auto 90%',
                                                                   'max-height': '-webkit-fill-available',
                                                                   'padding': '0px', 'margin': '0',
                                                                 'vertical-align': '-webkit-baseline-middle'}))])),

                                # ])
                                          ])])
            cards.append(cards_items1)

        for ind in serverBD.index:
            cards_items=dbc.ListGroupItem(
                id={'type': 'dynamic-cards-item',
                    'index': str(serverBD['match_id'][ind])},
                href='/{}'.format(str(serverBD['match_id'][ind])),
                style={'line-height': '1', 'margin': '0', 'margin-right': '0',
                                     'height': 'fit-content', 'justify-content': 'center',
                                     'vertical-align': '-webkit-baseline-middle',
                                     'max-height': 'fit-content', 'padding': '0px',
                                     'align-items': 'center'},
                color="default",
                action=True,
                children=[
                    dbc.Row(style={'max-height': '50px',
                                     'overflow-y':'hidden',
                                 'height': '100%',
                                 'padding': '0px',
                                 # "width": '100%',
                                   'align-items': 'center',
                                 # 'justify-content': 'flex-start',
                                   'justify-content': 'center',
                                   'margin': '0',
                                 'vertical-align': '-webkit-baseline-middle',
                                 'textAlign': 'center', 'margin-left': '0',
                                 'margin-right': '0'},
                            children=[
                                dbc.Col(width=30,
                                          style={
                                         'padding': '0', 'vertical-align': '-webkit-baseline-middle',
                                         'align-items': 'center', 'justify-content': 'center',
                                         'margin': '0', 'textAlign': 'center',
                                              "width": '30%',
                                         'margin-left': '0', 'margin-right': '0'},
                                          children=dbc.Row([
                                              dbc.Col(width=40,
                                                        style={
                                                        'max-height': '40px',
                                                        'height': '40px',
                                                            # 'background-image': 'url(/assets/png/fon2.png)',
                                                            # 'background-repeat': 'no-repeat',
                                                            # 'background-position': 'center',
                                                            # 'background-size': 'auto 90%',
                                                            # 'background-size': 'cover',
                                                        "width": '40%',
                                                         'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                         'align-items': 'center', 'justify-content': 'center',
                                                         'margin': '0', 'textAlign': 'center'},
                                                        children=ddk.Logo(
                                                            src=serverBD['T1logos'][ind],
                                                            style={'text-align': 'center',
                                                                   'max-height': '-webkit-fill-available',
                                                                   'padding': '0px', 'margin': '0',
                                                                 'vertical-align': '-webkit-baseline-middle'})),
                                              dbc.Col(width=60,
                                                        style={"width": '60%',
                                                            # 'overflowX': 'hidden',
                                                 'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                 'align-items': 'center', 'justify-content': 'center',
                                                 'margin': '0', 'textAlign': 'center'},
                                                      children=html.H6(serverBD['T1names'][ind],
                                                                      style={'color':'azure',
                                                                             # 'width': 'fit-content',
                                                                             'padding': '0px', 'margin': '0',
                                                                'max-height': '-webkit-fill-available',
                                                                'vertical-align': '-webkit-baseline-middle'}))])),
                                dbc.Col(width=20,
                                          style={'min-width': 'fit-content',
                                                 "width": '20%',
                                             'max-height': 'fit-content',
                                             'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                             'align-items': 'center', 'justify-content': 'center',
                                             'margin': '0', 'textAlign': 'center',
                                             'margin-left': '10px', 'margin-right': '10px'},
                                          children=[html.H6(serverBD['Mtime'][ind][:-3],
                                                                      style={'height': '100%',
                                                                             'color': 'azure', 'padding':'0',
                                                                             'max-height': 'fit-content',
                                                                             'vertical-align': '-webkit-baseline-middle'})]),
                                dbc.Col(width=30,
                                          style={
                                              "width": '30%',
                                         'padding': '0', 'vertical-align': '-webkit-baseline-middle',
                                         'align-items': 'center', 'justify-content': 'center',
                                         'margin': '0', 'textAlign': 'center',
                                              # 'width':'fit-content',
                                         'margin-left': '0', 'margin-right': '0'},
                                          children=dbc.Row([
                                            dbc.Col(width=60,
                                                      style={"width": '60%',
                                                            # 'overflowX': 'hidden',
                                                 'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                 'align-items': 'center', 'justify-content': 'center',
                                                 'margin': '0', 'textAlign': 'center'},
                                                      children=html.H6(serverBD['T2names'][ind],
                                                                                   style={'color':'azure',
                                                                             # 'width': 'fit-content',
                                                                             'padding': '0px', 'margin': '0',
                                                                'max-height': '-webkit-fill-available',
                                                                'vertical-align': '-webkit-baseline-middle'})),
                                            dbc.Col(width=40,
                                                      style={"width": '40%',
                                                        'max-height': '40px',
                                                        'height': '40px',
                                                        # 'width': 'fit-content',
                                                         'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                         'align-items': 'center', 'justify-content': 'center',
                                                         'margin': '0', 'textAlign': 'center'},
                                                      children=ddk.Logo(src=serverBD['T2logos'][ind],
                                                                        style={'text-align': 'center',
                                                            #                    'background-image': 'url(/assets/png/fon2.png)',
                                                            # 'background-repeat': 'no-repeat',
                                                            # 'background-position': 'center',
                                                            # 'background-size': 'auto 90%',
                                                                   'max-height': '-webkit-fill-available',
                                                                   'padding': '0px', 'margin': '0',
                                                                 'vertical-align': '-webkit-baseline-middle'}))])),
                                # dbc.Col(
                                #     # width=50,
                                #           style={'max-width': '200px',
                                #              'max-height': 'fit-content',
                                #              'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                #              'align-items': 'center', 'justify-content': 'center',
                                #              'margin': '0', 'textAlign': 'center',
                                #              # 'margin-left': '10px', 'margin-right': '10px'
                                #                  },
                                #           children=html.H6(serverBD['Mtour'][ind],
                                #                       style={'height': '100%','color':'azure',
                                #                              'max-height': 'fit-content',
                                #                              'max-width': '200px',
                                #                              'overflow-x':'hidden',
                                #                              'margin': '0',
                                #                              'vertical-align': '-webkit-baseline-middle'})),


                                          ])])
            cards.append(cards_items)
        empty_card=dbc.ListGroupItem(
                style={'line-height': '1', 'margin': '0', 'margin-right': '0',
                                     'height': 'fit-content', 'justify-content': 'center',
                                     'vertical-align': '-webkit-baseline-middle',
                                     'max-height': '50px', 'padding': '0px',
                                     'align-items': 'center'},
                color="default",
                action=True,
                children=[
                    ddk.Block(style={'max-height': '50px',
                                     'overflow-y':'hidden',
                                 'height': '50px',
                                 'padding': '0px',
                                 "width": '100%',
                                   'align-items': 'center',
                                 # 'justify-content': 'flex-start',
                                   'justify-content': 'center',
                                   'margin': '0',
                                 'vertical-align': '-webkit-baseline-middle',
                                 'textAlign': 'center', 'margin-left': '0',
                                 'margin-right': '0'},
                            children=[
                                dbc.Col(width=30,
                                          style={
                                         'padding': '0', 'vertical-align': '-webkit-baseline-middle',
                                         'align-items': 'center', 'justify-content': 'center',
                                         'margin': '0', 'textAlign': 'center',
                                              'height': '40px',
                                              # 'width':'fit-content',
                                         'margin-left': '0', 'margin-right': '0'},
                                          children=[
                                              dbc.Col(width=40,
                                                        style={
                                                        'max-height': '40px',
                                                        'height': '40px',
                                                            # 'background-image': 'url(/assets/png/fon2.png)',
                                                            # 'background-repeat': 'no-repeat',
                                                            # 'background-position': 'center',
                                                            # 'background-size': 'auto 90%',
                                                            # 'background-size': 'cover',
                                                        # 'width': 'fit-content',
                                                         'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                         'align-items': 'center', 'justify-content': 'center',
                                                         'margin': '0', 'textAlign': 'center'},
                                                        children=ddk.Logo(
                                                            src='',
                                                            style={'text-align': 'center',
                                                                   'max-height': '-webkit-fill-available',
                                                                   'padding': '0px', 'margin': '0',
                                                                 'vertical-align': '-webkit-baseline-middle'})),
                                              dbc.Col(width=60,
                                                        style={'height': '40px',
                                                            # 'overflowX': 'hidden',
                                                 'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                 'align-items': 'center', 'justify-content': 'center',
                                                 'margin': '0', 'textAlign': 'center'},
                                                      children=html.H6('',
                                                                       style={'color':'azure',
                                                                             # 'width': 'fit-content',
                                                                             'padding': '0px', 'margin': '0',
                                                                'max-height': '-webkit-fill-available',
                                                                'vertical-align': '-webkit-baseline-middle'}))]),
                                dbc.Col(width=20,
                                          style={'max-width': 'fit-content',
                                             'max-height': '50px', 'height': '50px',
                                             'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                             'align-items': 'center', 'justify-content': 'center',
                                             'margin': '0', 'textAlign': 'center',
                                             'margin-left': '10px', 'margin-right': '10px'},
                                          children=[html.H6('',
                                                                      style={'height': '100%',
                                                                             'color': 'azure', 'padding':'0',
                                                                             'max-height': 'fit-content',
                                                                             'vertical-align': '-webkit-baseline-middle'})]),
                                dbc.Col(width=30,
                                          style={

                                         'padding': '0', 'vertical-align': '-webkit-baseline-middle',
                                         'align-items': 'center', 'justify-content': 'center',
                                         'margin': '0', 'textAlign': 'center',
                                              # 'width':'fit-content',
                                         'margin-left': '0', 'margin-right': '0'},
                                          children=[
                                            dbc.Col(width=60,
                                                      style={
                                                            # 'overflowX': 'hidden',
                                                          'height': '50px',
                                                 'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                 'align-items': 'center', 'justify-content': 'center',
                                                 'margin': '0', 'textAlign': 'center'},
                                                      children=html.H6('',
                                                                                   style={'color':'azure',
                                                                             # 'width': 'fit-content',
                                                                             'padding': '0px', 'margin': '0',
                                                                'max-height': '-webkit-fill-available',
                                                                'vertical-align': '-webkit-baseline-middle'})),
                                            dbc.Col(width=40,
                                                      style={
                                                        'max-height': '50px',
                                                        'height': '50px',
                                                        # 'width': 'fit-content',
                                                         'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                                         'align-items': 'center', 'justify-content': 'center',
                                                         'margin': '0', 'textAlign': 'center'},
                                                      children=ddk.Logo(src='',
                                                                        style={'text-align': 'center',
                                                            #                    'background-image': 'url(/assets/png/fon2.png)',
                                                            # 'background-repeat': 'no-repeat',
                                                            # 'background-position': 'center',
                                                            # 'background-size': 'auto 90%',
                                                                   'max-height': '-webkit-fill-available',
                                                                   'padding': '0px', 'margin': '0',
                                                                 'vertical-align': '-webkit-baseline-middle'}))]),
                                dbc.Col(
                                    # width=50,
                                          style={'max-width': '200px',
                                             'max-height': '50px',
                                             'padding': '0px', 'vertical-align': '-webkit-baseline-middle',
                                             'align-items': 'center', 'justify-content': 'center',
                                             'margin': '0', 'textAlign': 'center',
                                             # 'margin-left': '10px', 'margin-right': '10px'
                                                 },
                                          children=html.H6('',
                                                      style={'height': '50px','color':'azure',
                                                             'max-height': '50px',
                                                             'max-width': '200px',
                                                             'overflow-x':'hidden',
                                                             'margin': '0',
                                                             'vertical-align': '-webkit-baseline-middle'})),


                                          ])])
        cards.append(empty_card)
        return cards
Exemplo n.º 12
0
    def team(TeamBD):

        score_table_item2 = []
        score_table_item2.append(dbc.ListGroupItem(style={'line-height': '1', 'margin': '0', 'margin-right': '0',
                                                                               'height': '40px', 'justify-content': 'center',
                                                                               'vertical-align': '-webkit-baseline-middle',
                                                                               'max-height': 'fit-content', 'padding': '0px',
                                                                               'background-color':'#0e4e70',
                                                                               'list-style': 'none','max-width':'100%',
                       'min-width':'700px',
                       #                                    'min-width':'1000px',
                       # 'overflowX':'scroll',
                                                                               'align-items': 'center'},
                                                   children=[
                                                       dbc.Row(
                                                           # width=100,
                                                                 style={'justify-content': 'center','margin': '0',
                                                                      'vertical-align': '-webkit-baseline-middle',
                                                                      'height': '40px'},
                                                                 children=[dbc.Col(
                                                                     # width=15,
                                                                                                             style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'15%','word-wrap': 'normal',},
                                                                                                             children=html.H2('PLAYER',style={'margin': '0',
                                                                                                                                           'text-align': 'center',
                                                                                                                                           'justify': 'center'})),
                                                                                                   dbc.Col(
                                                                                                       # width=15,
                                                                                                             style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'15%',},
                                                                                                             children=html.H2('HERO',style={'margin': '0',
                                                                                                                                           'text-align': 'center',
                                                                                                                                           'justify': 'center'})),
                                                                                                   dbc.Col(
                                                                                                       # width=10,
                                                                                                             style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%',},
                                                                                                             children=html.H2('KDA',style={'margin': '0',
                                                                                                                                           'text-align': 'center',
                                                                                                                                           'justify': 'center'})),
                                                                                                   dbc.Col(
                                                                                                       # width=20,
                                                                                                             style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'20%',},
                                                                                                             children=html.H2('ITEMS',style={'margin': '0',
                                                                                                                                           'text-align': 'center',
                                                                                                                                           'justify': 'center'})),
                                                                                                   dbc.Col(
                                                                                                       # width=10,
                                                                                                             style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%',},
                                                                                                             children=html.H2('GOLD',style={'margin': '0',
                                                                                                                                           'text-align': 'center',
                                                                                                                                           'justify': 'center'})),
                                                                                                   dbc.Col(
                                                                                                       # width=10,
                                                                                                             style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%',},
                                                                                                             children=html.H2('LH/DN',
                                                                                                                 style={
                                                                                                                     'margin': '0',
                                                                                                                     'text-align': 'center',
                                                                                                                     'justify': 'center'})),
                                                                                                   dbc.Col(
                                                                                                       # width=10,
                                                                                                             style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%',},
                                                                                                             children=html.H2('GPM/XPM',style={'margin': '0',
                                                                                                                                            'text-align': 'center',
                                                                                                                                            'justify': 'center'})),
                                                                                                   dbc.Col(
                                                                                                       # width=10,
                                                                                                             style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%',},
                                                                                                             children=html.H2('NW',style={'margin': '0',
                                                                                                                                           'text-align': 'center',
                                                                                                                                           'justify': 'center'}))])]))

        for ind in TeamBD.index:
            hero_items = []
            data = TeamBD['Hero_items'][ind].replace('"', '').replace("'", "")
            res = data.strip('][').split(', ')
            # print("#########     hero_items    ##############", "\n", hero_items)
            for i in res:
                # print("#########     i  SCORE TEBLE    ##############", "\n", i)
                hitem = dbc.Col(
                    # width=16,
                    style={  'padding': '0',
                            'margin': '0',
                        'max-width': '16%',
                        'max-height': '16px',
                        'height': '16px',
                        'width': 'fit-content'},
                    children=[ddk.Logo(
                        src=i,
                        style={
                            'text-align': 'center',
                            'max-height': '16px',
                            'padding': '0',
                            'margin': '0',
                            'vertical-align': '-webkit-baseline-middle'})])
                hero_items.append(hitem)

        ##############     LIVE SCORE TABLES    ###################################
            score_table_item = dbc.ListGroupItem(
                style={'line-height': '1',
                       'margin': '0',
                       'margin-right': '0',
                       'height': '70px', 'justify-content': 'center',
                       'vertical-align': '-webkit-baseline-middle',
                       'max-height': '30px', 'padding': '0px',
                       'list-style': 'none',
                       'min-width':'700px',
                       'align-items': 'center'},
                children=[
                    dbc.Row(
                        # width=100,
                              style={'justify-content': 'center'},
                              children=[dbc.Col(
                                  # width=15,
                                                 style={'vertical-align': '-webkit-baseline-middle','max-width':'15%','width':'15%', 'word-wrap': 'normal','overflow-x':'hidden'},
                                                 children=html.H6(TeamBD['Players'][ind],style={'margin': '0',

                                                                               'text-align': 'center',
                                                                               'justify': 'center'})),
                                       dbc.Col(
                                           # width=15,
                                                 style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'15%'},
                                                 children=dbc.Col(
                                                     # width=80,
                                                     style={
                                             'max-height': '20px',
                                             'height': '20px',
                                             'width': 'fit-content',
                                                     'max-width': '80%',},
                                                     children=[ddk.Logo(
                                             src=TeamBD['Hero_pic'][ind],
                                             style={
                                                 'text-align': 'center',
                                                 'max-height': '20px',
                                                 'padding': '0',
                                                 'margin': '0',
                                                 'vertical-align': '-webkit-baseline-middle'})])),
                                       dbc.Col(
                                           # width=10,
                                                 style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%'},
                                                 children=html.H6(TeamBD['KDA'][ind],
                                                                  style={'margin': '0',
                                                                       'text-align': 'center',
                                                                       'justify': 'center'})),

                                       dbc.Col(
                                           # width=20,
                                                 style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'20%'},
                                                 children=dbc.Row([i for i in hero_items])
                                                 ),
                                       dbc.Col(
                                        # width=10,
                                                 style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%'},
                                                 children=html.H6(TeamBD['Hero_gold'][ind],
                                                                  style={'margin': '0',
                                                                       'text-align': 'center',
                                                                       'justify': 'center'})),
                                       dbc.Col(
                                           # width=10,
                                                 style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%'},
                                                 children=html.H6(TeamBD['LH_DN'][ind],
                                                     style={
                                                         'margin': '0',
                                                         'text-align': 'center',
                                                         'justify': 'center'})),
                                       dbc.Col(
                                           # width=10,
                                                 style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%'},
                                                 children=html.H6(TeamBD['GPM_XPM'][ind],
                                                                  style={'margin': '0',
                                                                        'text-align': 'center',
                                                                        'justify': 'center'})),
                                       dbc.Col(
                                           # width=10,
                                                 style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%'},
                                                 children=html.H6(TeamBD['NW'][ind],style={'margin': '0',
                                                                               'text-align': 'center',
                                                                               'justify': 'center'}))])])

            score_table_item2.append(score_table_item)


        score_table = ddk.Card(style={'width':'-webkit-fill-available',
                                      'margin':'10px',
                                      # 'min-width':'fit-content',
                                      'overflowX':'scroll',
                                      'padding':'0',
                                      'background-color': '#f9f9f91c',},
                               children=[dbc.ListGroup(flush=True,
                                                       children= [i for i in score_table_item2])])

        return score_table