Beispiel #1
0
                 width=3),
     ],
                   row=True,
                   style=NONE,
                   id='update'),
 ]),
 dbc.Form(children=[
     dbc.FormGroup([
         dbc.Label([
             'Please enter your Plate Recognizer ',
             html.A('API Token', href=PLAN_LINK, target='_blank'), ':'
         ],
                   html_for='input-token',
                   width=6),
         dbc.Col(
             dbc.Input(type='text', id='input-token', placeholder='Token'),
             width=3,
         ),
     ],
                   row=True),
     dbc.FormGroup([
         dbc.Label([
             'Please enter your ',
             html.A('Stream License Key', href=PLAN_LINK, target='_blank'),
             ':'
         ],
                   html_for='input-key',
                   width=6),
         dbc.Col(
             dbc.Input(
                 type='text', id='input-key', placeholder='License Key'),
Beispiel #2
0
from utils.organization_chart import OrganizationChart

from apps.back_office_home import get_vertical_backoffice_navbar

MODAL_ID_PREFIX = "back-office-entity-modal"

entity_modal_body = html.Div(children=[
    html.Div(id=MODAL_ID_PREFIX + "-entity-id", style={"display": "none"}),
    html.Div(id=MODAL_ID_PREFIX + "-mode", style={"display": "none"}),
    dbc.Form([
        dbc.FormGroup([
            dbc.Label("Entité parente"),
            dcc.Dropdown(id=MODAL_ID_PREFIX + "-parent", clearable=False),
            dbc.Label("Libellé"),
            dbc.Input(id=MODAL_ID_PREFIX + "-label",
                      placeholder="Entrer libellé"),
            dbc.Label("Code Chorus dt"),
            dbc.Input(id=MODAL_ID_PREFIX + "-code-chorus",
                      placeholder="Entrer code chorus dt"),
            dbc.Label("Code Odrive"),
            dbc.Input(id=MODAL_ID_PREFIX + "-code-odrive",
                      placeholder="Entrer code odrive"),
            dbc.Label("Code Osfi"),
            dbc.Input(id=MODAL_ID_PREFIX + "-code-osfi",
                      placeholder="Entrer code osfi"),
        ])
    ]),
])

help_modal = dbc.Modal(
    [
Beispiel #3
0
app = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])

LOREM = '''
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
'''

app.layout = dbc.Container([
    html.Div([
        dbc.Button('Open modal', id='open'),
        dbc.Modal([
            dbc.ModalHeader('Header'),
            dbc.ModalBody([
                dbc.InputGroup([
                    dbc.InputGroupAddon('Username', addon_type='prepend'),
                    dbc.Input(id='username', placeholder='Enter username'),
                ]),
                html.P(id='user-text'),
            ]),
            dbc.ModalFooter(
                dbc.Button('Close', id='close', className='ml-auto')
            ),
        ], id='modal')
    ]),

    html.Br(),
    html.Div(
        [
            dbc.Button("Small modal", id="open-sm", className="mr-1"),
            dbc.Button("Large modal", id="open-lg", className="mr-1"),
            dbc.Button("Extra large modal", id="open-xl"),
Beispiel #4
0
        dbc.FormGroup(
            [
                dbc.Label("Y variable"),
                dcc.Dropdown(
                    id="y-variable",
                    options=[
                        {"label": col, "value": col} for col in iris.columns
                    ],
                    value="sepal width (cm)",
                ),
            ]
        ),
        dbc.FormGroup(
            [
                dbc.Label("Cluster count"),
                dbc.Input(id="cluster-count", type="number", value=3),
            ]
        ),
    ],
    body=True,
)

app.layout = dbc.Container(
    [
        html.H1("Iris k-means clustering"),
        html.Hr(),
        dbc.Row(
            [
                dbc.Col(controls, md=4),
                dbc.Col(dcc.Graph(id="cluster-graph"), md=8),
            ],
Beispiel #5
0
def yline_layout(uuid: str, surface_geometry: Dict) -> html.Div:
    return html.Div(
        style={
            "display": "none",
        },
        id={
            "id": uuid,
            "element": "yline-wrapper"
        },
        children=[
            html.Label("Y-Line:"),
            wcc.FlexBox(
                style={"fontSize": "0.8em"},
                children=[
                    dbc.Input(
                        id={
                            "id": uuid,
                            "cross-section": "yline",
                            "element": "value"
                        },
                        style={
                            "flex": 3,
                            "minWidth": "100px"
                        },
                        type="number",
                        value=round(surface_geometry["ymin"]),
                        min=round(surface_geometry["ymin"]),
                        max=round(surface_geometry["ymax"]),
                        step=50,
                        persistence=True,
                        persistence_type="session",
                    ),
                    dbc.Label(
                        style={
                            "flex": 1,
                            "marginLeft": "10px",
                            "minWidth": "20px"
                        },
                        children="Step:",
                    ),
                    dbc.Input(
                        id={
                            "id": uuid,
                            "cross-section": "yline",
                            "element": "step"
                        },
                        style={
                            "flex": 2,
                            "minWidth": "20px"
                        },
                        value=50,
                        type="number",
                        min=1,
                        max=round(surface_geometry["ymax"]) -
                        round(surface_geometry["ymin"]),
                        persistence=True,
                        persistence_type="session",
                    ),
                ],
            ),
        ],
    )
Beispiel #6
0
from ukbcc import query, utils, stats

from dash.exceptions import PreventUpdate

cohort_ids_out = dbc.Form([
    dbc.FormGroup(
        [
            dbc.Label("Cohort IDs File (path)",
                      html_for={
                          "type": "config_input",
                          "name": "cohort_ids_outfile"
                      }),
            dbc.Input(
                placeholder="Name and path of the file to write cohort IDs to",
                type="text",
                id="cohort_ids_outfile",
                persistence=False,
                style={"margin": "5px"}),
            dbc.FormText(
                "Specify the name of the file to write cohort IDs to e.g cohort_ids.txt",
                color="secondary")
        ],
        className='mr-3',
    ),
    dbc.Button(children="Save",
               color="success",
               id="save_cohort_ids_button",
               className="ml-auto",
               style={
                   "margin": "5px",
                   "display": "block"
Beispiel #7
0
def render_connection(tab):
    """
    Callback of the tab for the connection. If server tab is active, you can access the network list for the time graphs
    and also to see if the connection is active
    :param tab:
    :return:
    """
    if tab == 'server':
        return [
            html.Div(dbc.Input(id='input-on-submit', placeholder='URL:port', type="text", className="mb-1"),
                     style={'display': 'inline-block', 'width': '69%', 'textarea:color': 'black'}),
            html.Div(children=' ', style={'display': 'inline-block', 'width': '2%'}),
            html.Div(dbc.Button("Connect", id="connect-server-button", className="mr-1"),
                     style={'display': 'inline-block', 'width': '29%'}),
            html.Br(),
            dcc.Interval(
                id='interval-time-graph',
                interval=UPDATE_TIME_GRAPH,  # in milliseconds
                n_intervals=0,
                disabled=True),
            dcc.Interval(
                id='interval-data',
                interval=UPDATE_DATA,  # in milliseconds
                n_intervals=0,
                disabled=True),
            dcc.Interval(
                id='interval-states',
                interval=UPDATE_TIME_STATES,  # in milliseconds
                n_intervals=0),
            dcc.Interval(
                id='interval-alarms',
                interval=UPDATE_TIME_ALARMS,  # in milliseconds
                n_intervals=0),
            html.Br(),
            html.H4('Time graphs stations'),
            html.Div(id='container-button-basic',
                     children=[
                             dcc.Dropdown(id='network-list-active',
                                             placeholder='Select stations for time graphs',
                                             options=network_list, multi=True),
                             html.P('Connection not active', style={'color': 'red'})
                             ]
                     ),
            dbc.RadioItems(
                id='realtime-radiobox',
                options=[
                    {'label': 'Real-Time', 'value': 'realtime'},
                    {'label': 'Data Retrieval', 'value': 'retrieval', 'disabled': True}
                ],
                value='realtime',
                inline=True
            ),
            html.Div(id='date-picker', children=[]),
            html.Br()
            ]
    elif tab == 'folder':
        return [
            html.Div(dbc.Input(id='input-on-submit', placeholder='/path/to/SDS', type="text", className="mb-1"),
                     style={'display': 'inline-block', 'width': '69%', 'textarea:color': 'white'}),
            html.Div(children=' ', style={'display': 'inline-block', 'width': '2%'}),
            html.Div(dbc.Button("Connect", id="connect-server-button", className="mr-1"),
                     style={'display': 'inline-block', 'width': '29%'}),
            html.Br(),
            dcc.Interval(
                id='interval-time-graph',
                interval=UPDATE_TIME_GRAPH,  # in milliseconds
                n_intervals=0,
                disabled=True),
            dcc.Interval(
                id='interval-data',
                interval=UPDATE_DATA,  # in milliseconds
                n_intervals=0,
                disabled=True),
            dcc.Interval(
                id='interval-states',
                interval=UPDATE_TIME_STATES,  # in milliseconds
                n_intervals=0),
            dcc.Interval(
                id='interval-alarms',
                interval=UPDATE_TIME_ALARMS,  # in milliseconds
                n_intervals=0),
            html.Br(),

            html.H4('Time graphs stations'),
            html.Div(id='container-button-basic',
                     children=[
                             dcc.Dropdown(id='network-list-active',
                                             placeholder='Select stations for time graphs',
                                             options=network_list, multi=True, style={'color': 'black'}),
                             html.P('Folder not active', style={'color': 'red'})
                             ]
                     ),
            dbc.RadioItems(
                id='realtime-radiobox',
                options=[
                    {'label': 'Real-Time', 'value': 'realtime'},
                    {'label': 'Data Retrieval', 'value': 'retrieval', 'disabled': True}
                ],
                value='realtime',
                inline=True
            ),
            html.Div(id='date-picker', children=[]),
            html.Br()
            ]
Beispiel #8
0
    unit = variable.unit

    if unit is None and variable.declaredType is not None:
        unit = variable.declaredType.unit

    names.append(variable.name)

    id = f'variable-{i}'

    row = dbc.FormGroup(
        [
            dbc.Label(variable.name, html_for=id, width=6),
            dbc.Col(
                dbc.InputGroup(
                    [
                        dbc.Input(id=id, value=variable.start, style={'text-align': 'right'}),
                        dbc.InputGroupAddon(unit if unit else ' ', addon_type='append'),
                    ], size="sm"
                ),
                width=6,
            ),
            #html.Small(variable.description, className='form-text text-muted ml-3')
        ],
        row=True,
        className='mb-2'
    )

    rows.append(row)

    states.append(State(id, 'value'))
Beispiel #9
0
 render_datatable("table-data"),
 html.Hr(),
 html.H4("2. Enrichir les données"),
 dbc.Row([
     dbc.Button("Avec les données OA d'Unpaywall",
                color="primary",
                block=True,
                id="unpaywall_button",
                className="mb-3",
                n_clicks=0),
 ]),
 dbc.Row([html.P("OU")], align="center", justify="center",
         className="h-50"),
 dbc.Row([
     dbc.Col(dbc.Input(id="email",
                       placeholder="Entrer une adresse mail valide...",
                       type="email"),
             width=6),
     dbc.Col(dbc.Button("Avec les libellés éditeurs de Crossref",
                        color="primary",
                        block=True,
                        id="crossref_button",
                        className="mb-3"),
             width=6),
 ]),
 #html.Div(id='intermediate-source-value', style={'display': 'none'}),
 dcc.Store(id="intermediate-source-value"),
 html.Hr(),
 html.H4("3. Sauvegarder les résultats"),
 dbc.Spinner(
     html.Div(
Beispiel #10
0
def render_content(tab, contents, filename):
    if contents:
        contents = contents[0]
        filename = filename[0]
        df = parse_data(contents, filename)

        if tab == 'tab-1':
            return html.Div([
                html.Br(),
                dash_table.DataTable(
                    id="data-preview",
                    data=df.to_dict('records'),
                    columns=[{'name': i, 'id': i} for i in df.columns],
                    filter_action='native',
                    page_action='native',
                    page_size=15,
                    virtualization=True,
                    sort_action='custom',
                    sort_mode='single',
                    sort_by=[],
                    style_cell={  # ensure adequate header width when text is shorter than cell's text
                        'minWidth': 95, 'maxWidth': 95, 'width': 95
                    },
                    style_data={
                        'whiteSpace': 'normal',
                        'height': 'auto'
                    }
                ),

                html.Br(),
                html.Br(),
                # html.P(
                #    "Please click the button below if you want to fill all missing data",
                #    className='font-weight-bolder', style={"padding-top": '20px', "font-size": '20px', "color": 'blue', 'font-weight': 'bold', 'font-style': 'italic'}
                # ),
                # dbc.Button(children="fix me",  color="primary",
                #           outline=True, id="fix-button", className="mr-1", block=True),''',
                html.Br()
            ]), df.to_dict('records')
        elif tab == 'tab-2':
            return html.Div([
                html.P(
                    "Error Summary",
                    className='font-weight-bolder', style={"padding-top": '20px', "font-size": '30px', 'text-align': 'center', 'font-weight': 'bold'}
                ),
                html.Br(),
                dash_table.DataTable(
                    id="error-summary",
                    page_action='native',
                    sort_action='custom',
                    sort_mode='single',
                    sort_by=[],
                    style_cell={  # ensure adequate header width when text is shorter than cell's text
                        'minWidth': 95, 'maxWidth': 95, 'width': 95
                    }
                ),
                html.P(
                    "Note: The ' Number of errors ' contains both wrong value and missing value.",
                    className="font-weight-lighter", style={"padding-top": '20px', "font-size": '20px', 'font-style': 'italic'}
                ),
                html.P(
                    "Please click the button below if you want to fill all missing data",
                    className='font-weight-bolder', style={"padding-top": '20px', "font-size": '20px', "color": 'blue', 'font-weight': 'bold', 'font-style': 'italic'}
                ),
                dbc.Button(children="fix me",  color="primary",
                           outline=True, id="fix-button", className="mr-1", block=True),

            ]), df.to_dict('records')
        elif tab == 'tab-3':
            return html.Div([
                dbc.Row(
                    dbc.Col(
                        dcc.Graph(id="error-structure-graph"),
                        width={"size": 10, "offset": 1},
                    )
                ),
                dbc.Row(
                    dbc.Col(
                        dcc.Graph(id="missing-structure-graph"),
                        width={"size": 10, "offset": 1},
                    )
                ),
                html.Br(),
                html.P(
                    "Please click the button below if you want to fill all missing data",
                    className='font-weight-bolder', style={"padding-top": '20px', "font-size": '20px', "color": 'blue', 'font-weight': 'bold', 'font-style': 'italic'}
                ),
                dbc.Button(children="fix me",  color="primary",
                           outline=True, id="fix-button", className="mr-1", block=True),

            ]), df.to_dict('records')
        elif tab == 'tab-4':
            return html.Div([
                html.P(
                    "Similarity between Two Similar Column Names(in %)",
                    className='font-weight-bolder', style={"padding-top": '20px', "font-size": '30px', 'text-align': 'center', 'font-weight': 'bold'}
                ),

                dbc.Card(
                    dbc.CardBody(
                        [
                            dbc.Row(
                                [dbc.Col(
                                    dbc.FormGroup(
                                        [
                                            dbc.Label(
                                                "Columns(in Summer and Winter)"),
                                            dcc.Dropdown(
                                                id="similar_columns",
                                                options=[
                                                    {"label": col, "value": col} for col in ["VARIETY", "S_G"]
                                                ],
                                                value="VARIETY",
                                                placeholder="Select a Column",),

                                        ]), ),
                                 dbc.Col(
                                    dbc.FormGroup(
                                        [
                                            dbc.Label("Text"),
                                            dbc.Input(
                                                id="suscipious-input", placeholder="Type something...", type="text"),
                                        ]), ),
                                 dbc.Col(
                                    dbc.FormGroup(
                                        [
                                            dbc.Label("Frequency"),
                                            dbc.Input(
                                                id="suscipious-frequency", type="number"),
                                        ]), ),
                                 ]
                            ),
                            html.Br(),
                            dbc.Row(
                                dbc.Col(

                                    dash_table.DataTable(
                                        id='similar_string_table',
                                        editable=True,
                                        virtualization=True,
                                        page_action='native',
                                        page_size=15,
                                        style_cell={  # ensure adequate header width when text is shorter than cell's text
                                            'minWidth': 95, 'maxWidth': 95, 'width': 95
                                        },
                                        # style_data_conditional=[{
                                        #     'if': {'column_editable': False},
                                        #     'backgroundColor': 'rgb(30, 30, 30)',
                                        #     'color': 'white'
                                        # }],
                                        style_header_conditional=[{
                                            'if': {'column_editable': False},
                                            'backgroundColor': 'rgb(30, 30, 30)',
                                            'color': 'white'
                                        }],
                                    ),
                                )
                            ),
                            html.P(
                                "If you want to replace the error message with the correct one, please type the error message in the first box and the correct one in the second box",
                                className="font-weight-lighter", style={"padding-top": '20px', "font-size": '20px'}
                            ),
                            html.Br(),
                            dbc.Row(
                                [
                                    dbc.Col(
                                        dbc.FormGroup(
                                            [
                                                dbc.Label("Error message"),
                                                dbc.Input(
                                                    id="error_input", placeholder="Type the value that should be replaced", type="text"),
                                            ]), ),
                                    dbc.Col(
                                        dbc.FormGroup(
                                            [
                                                dbc.Label("Correct message"),
                                                dbc.Input(
                                                    id="correct_input", placeholder="Type the correct one", type="text"),
                                            ]), ),
                                    dbc.Button(children="comfirm",  color="primary",
                                               outline=True, id="fixerror-button", className="mr-1", block=True),
                                ]
                            ),
                            html.Br(), ]
                    ),
                ),
                html.Br(),
                html.Br(),

                html.Hr(),
                dbc.Row([
                    dbc.Col(
                        dbc.Card(
                            dbc.CardBody(
                                [
                                    html.P(
                                        "Details of the Errors",
                                        className='font-weight-bolder', style={"padding-top": '20px', "font-size": '30px', 'text-align': 'center', 'font-weight': 'bold'}
                                    ),
                                    html.Div(dcc.Dropdown(
                                        id="target_column",
                                        options=[
                                            {"label": col, "value": col} for col in summer_columns
                                        ] + [
                                            {"label": col, "value": col} for col in rejection_column
                                        ],
                                        value="SNAME"
                                    ), style={"width": "30%"}, ),
                                    html.Br(),

                                    dash_table.DataTable(
                                        id='problematic_table',
                                        virtualization=True,
                                        page_action='native',
                                        page_size=15,
                                        sort_action='custom',
                                        sort_mode='single',
                                        sort_by=[],
                                        style_cell={  # ensure adequate header width when text is shorter than cell's text
                                            'minWidth': 95, 'maxWidth': 95, 'width': 95
                                        },
                                        style_data_conditional=[{
                                            'if': {'column_editable': False},
                                            'backgroundColor': 'rgb(30, 30, 30)',
                                            'color': 'white'
                                        }],
                                        style_header_conditional=[{
                                            'if': {'column_editable': False},
                                            'backgroundColor': 'rgb(30, 30, 30)',
                                            'color': 'white'
                                        }],
                                    ),
                                    html.Br(),
                                    dbc.Button([
                                        html.A(id='download-link',
                                               children='Download File'),
                                    ],
                                        outline=True, color="warning", className="mr-1")
                                ]
                            ),
                        ),
                        width=12,
                    ),
                ]),
                html.Br(),
                html.P(
                    "Please click the button below if you want to fill all missing data",
                    className='font-weight-bolder', style={"padding-top": '20px', "font-size": '20px', "color": 'blue', 'font-weight': 'bold', 'font-style': 'italic'}
                ),
                dbc.Button(children="fix me",  color="primary",
                           outline=True, id="fix-button", className="mr-1", block=True),


            ]), df.to_dict('records')

    else:
        return None, None
Beispiel #11
0
        ],
                navbar=True)
    ],
    color="light",
    dark=False,
    sticky="top",
)

DATASELECTION_CARD = [
    dbc.CardHeader(html.H5("Data Selection")),
    dbc.CardBody([
        html.H5(children='GNPS Data Selection'),
        dbc.InputGroup(
            [
                dbc.InputGroupText("Spectrum USI"),
                dbc.Input(id='usi1', placeholder="Enter GNPS USI", value=""),
            ],
            className="mb-3",
        ),
        dbc.InputGroup(
            [
                dbc.InputGroupText("Analog Search"),
                dbc.Select(id="analog_search",
                           options=[
                               {
                                   "label": "Yes",
                                   "value": "Yes"
                               },
                               {
                                   "label": "No",
                                   "value": "No"
Beispiel #12
0
from server import app, server, db
from flask import request, redirect
from app.models import User
from flask_login import login_user

email_re = re.compile(
    r'^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$')

prefix = 'Login'

hidden_div = html.Div(id="hidden_div_for_redirect_callback")

email_input = dbc.FormGroup([
    dbc.Label('Email', html_for='example-email'),
    dbc.Input(name='email',
              type='email',
              id=f'{prefix}_email',
              placeholder='Email'),
    dbc.FormText(
        'Are you on email? You simply have to be these days',
        color='secondary',
    ),
])

password_input = dbc.FormGroup([
    dbc.Label('Password', html_for='example-password'),
    dbc.Input(
        name='password',
        type='password',
        id=f'{prefix}_password',
        placeholder='Password',
    ),
Beispiel #13
0
                                style={
                                    "color": "white",
                                    "font-size": "1.5rem"
                                })),
        ],
        align="center",
        no_gutters=True,
    ),
    href="https://plot.ly",
),
                    color="primary",
                    sticky="top",
                    expand="xs")

QUERY_INPUT = dbc.InputGroup([
    dbc.Input(id="query-text", placeholder="Query ..."),
    dbc.InputGroupAddon(
        dbc.Button(html.Span([html.I(className="fas fa-search")]),
                   color="success",
                   id="query-button"),
        addon_type="append",
    ),
],
                             style={
                                 "padding-top": "25px",
                                 "padding-bottom": "25px"
                             })

LAYOUT = html.Div([
    NAVBAR,
    dbc.Container([
Beispiel #14
0
def textfield(textfield_id, label, placeholder, value):
    text_field = dbc.FormGroup([
        dbc.Label(label),
        dbc.Input(id=textfield_id, placeholder=placeholder, type="text", bs_size="sm", value=value),
    ])
    return text_field
Beispiel #15
0
                                "label": 'GBP',
                                'value': 'GBP'
                            },
                            {
                                "label": 'SEK',
                                'value': 'SEK'
                            },
                        ],
                        value='CHF')

# Start Date,  End Date & Number of Mixtures
input_groups = dbc.Row(
    dbc.Col(
        html.Div([
            dbc.InputGroup(
                [dbc.Input(value="2020-01-01")],
                className="mb-3",
            ),
            dbc.InputGroup(
                [dbc.Input(value="2021-01-01")],
                className="mb-3",
            ),
            dbc.InputGroup([dbc.Input(value=3, type='number')],
                           className="mb-3"), dropdown
        ])))

app.layout = dbc.Container(
    [
        html.Div(children=[
            html.H1(children='Gaussian Mixtures'),
            html.H2(children='Data Source: ECB')
                             - The optimum number of moves is shown in "Min Moves" which depends on the number of disks.
                             '''),
         ], )
     ],
                   fluid=True),
 ]),
 html.Div([
     html.Div(
         [
             html.Div(
                 [
                     # The Div with start button
                     html.H2('Starting game :', style=header1_styles),
                     dbc.Label("Enter the number of Disks(3-10) to start"),
                     dbc.FormGroup([
                         dbc.Input(id='Num_disks', type='number', value=3),
                         dbc.Button("Start game",
                                    id="reset",
                                    color="primary",
                                    active=False)
                     ]),
                 ],
                 style={
                     'display': 'inline-block',
                     'width': '50%',
                     'padding-right': '20px'
                 }),
             html.Div(
                 [
                     # The Div with Moves button
                     html.H2('Making Moves :', style=header1_styles),
Beispiel #17
0
import dash_html_components as html
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_table
import pandas as pd

name_input = dbc.FormGroup([
    dbc.Label("Name of the game you want", html_for="exchange_game_name"),
    dbc.Input(
        id="exchange_game_name",
        type="text",
        placeholder="Enter the name of the game you want",
    ),
])

name2_input = dbc.FormGroup([
    dbc.Label("Name of the game you offer", html_for="exchange_game_name2"),
    dbc.Input(
        id="exchange_game_name2",
        type="text",
        placeholder="Enter the name of the game you offer",
    ),
])

image_input = dbc.FormGroup([
    dbc.Label("Image", html_for="exchange_game_image"),
    dbc.Input(
        type="file",
        id="exchange_game_image",
        placeholder="Select an image",
    ),
Beispiel #18
0
 dbc.Row([
     dbc.Col([
         dcc.Loading(id="loading-3", children=[
             html.Div(id="building-info-placeholder")
         ], type="default"),
     ]),
 ]),
 html.H4('Aurinkopaneelit'),
 dbc.Row([
     dbc.Col([
         dbc.FormGroup([
             dbc.Label('Alkukustannus', html_for='price-of-initial-installation'),
             dbc.InputGroup([
                 dbc.Input(
                     type='number',
                     id='price-of-initial-installation',
                     value=INITIAL_INSTALL_PRICE,
                 ),
                 dbc.InputGroupAddon("€", addon_type="append"),
             ]),
         ]),
     ], md=3),
     dbc.Col([
         dbc.FormGroup([
             dbc.Label('Piikkitehon marginaalikustannus', html_for='marginal-price-of-peak-power'),
             dbc.InputGroup([
                 dbc.Input(
                     type='number',
                     id='marginal-price-of-peak-power',
                     value=PRICE_PER_PEAK_KW,
                 ),
        id="collapse-button",
        className="mb-3",
        color="primary",
    ),
    dbc.Collapse(
        dbc.Card(dbc.CardBody([conditions, html.Br(), check])),
        id="collapse",
    ),
])

layout = dbc.Container([
    dcc.Location(id="url_conditions", refresh=True),
    html.Br(),
    html.H3("Création du compte utilisateur"),
    html.Br(),
    dbc.Input(placeholder="Email", id="mail", n_submit=0),
    html.Br(),
    dbc.Input(placeholder="Nom d'utilisateur", id="id", n_submit=0),
    html.Br(),
    dbc.Input(
        placeholder="Mot de passe",
        id="mdp",
        n_submit=0,
        type="password",
    ),
    html.Br(),
    dbc.Input(
        placeholder="Saisir à nouveau mot de passe",
        id="mdp2",
        n_submit=0,
        type="password",
Beispiel #20
0
tab2_content = html.Div([
    dbc.Button('Refresh', id='refresh_test', color="primary",
               className="mr-1"),
    dbc.Button('Save Result',
               id='save_result',
               color="secondary",
               className="mr-1"),
    dbc.Label('123', id='msg_bar', className='mr-1'),
    html.Div(id='test_table',
             children=[html.Table([html.Tbody(id='practice_body')])])
])

tab3_content = html.Div(dbc.Form([
    dbc.FormGroup([
        dbc.Label("字/Word", className="mr-2"),
        dbc.Input(id='input-word', type="text", placeholder=""),
    ], ),
    dbc.FormGroup([
        dbc.Label("词/Phrase", className="mr-2"),
        dbc.Input(id='input-phrase', type="text", placeholder=""),
    ], ),
    dbc.FormGroup([
        dbc.Label("句/Sentence", className="mr-2"),
        dbc.Input(id='input-sentence', type="text", placeholder=""),
    ], ),
    dbc.Button(id='submit-add', children="Submit", color="primary"),
    html.Div(id='submit-status'),
], ),
                        id='edit-form',
                        className="col-4")
import dash_bootstrap_components as dbc
import dash_html_components as html

number_input = html.Div(
    [
        html.P("Type a number outside the range 0-10"),
        dbc.Input(type="number", min=0, max=10, step=1),
    ],
    id="styled-numeric-input",
)
Beispiel #22
0
 dbc.CardHeader([
     dbc.InputGroup(
         size="sm",
         children=[
             dbc.Button(
                 id="button-boids-reset",
                 children="Reset",
                 n_clicks=0,
                 color="primary",
                 disabled=False,
             ),
             dbc.InputGroupText("Seperation:"),
             dbc.Input(
                 id="input-boids-seperation",
                 min=0,
                 placeholder="<Non-negative number>",
                 value=1,
                 disabled=False,
             ),
         ],
     ),
 ]),
 dbc.CardBody([
     dcc.Graph(
         id="graph-boids-sim",
         config={
             "displayModeBar": False,
             "displaylogo": False
         },
         figure=empty_boids_figure,
         style={"height": "80vh"},
Beispiel #23
0
                }, {
                    "label": "用水安全",
                    "value": 4
                }, {
                    "label": "其他",
                    "value": 5
                }],
                              inline=True), )
        ]),
        html.Br(),
        html.Br(),
        html.Br(),
        html.Br(),
        dbc.Row([
            dbc.Col(dbc.FormGroup([
                dbc.Input(type="text"),
                dbc.FormText("输入你的电话号码"),
            ]),
                    width=5),
            dbc.Col(dbc.FormGroup([
                dbc.Input(type="text"),
                dbc.FormText("输入你的邮箱地址"),
            ]),
                    width=5),
            dbc.Col(dbc.Button('提交'), width=2)
        ])
    ])
])

if __name__ == '__main__':
    app.run_server()
Beispiel #24
0
 dbc.Col(dbc.Navbar(
     [
         html.A(
             dbc.Row(
                 [
                     dbc.Col(dbc.NavbarBrand("IMDb Explorer")),
                 ],
                 align="center",
                 no_gutters=True,
             ), ),
         dbc.NavbarToggler(id="navbar-toggler"),
         dbc.Collapse(dbc.Row(
             [
                 dbc.Col(
                     dbc.Input(id="search_input",
                               type="search",
                               placeholder="Search a movie")),
                 dbc.Col(
                     dbc.Button(
                         "Search", color="info", id="search_button"),
                     width="auto",
                 ),
             ],
             no_gutters=True,
             className="ml-auto flex-nowrap mt-3 mt-md-0",
             align="center",
         ),
                      id="navbar-collapse",
                      navbar=True),
     ],
     color="dark",
Beispiel #25
0
def options_layout(
    uuid: str,
    depth_truncations: Dict,
    resolution: float,
    extension: int,
    initial_layout: Dict,
) -> html.Div:

    return html.Div(children=[
        html.Div(children=[
            wcc.Label("Resolution (m) ", ),
            dcc.Input(
                className="webviz-structunc-range-input",
                id={
                    "id": uuid,
                    "element": "resolution"
                },
                type="number",
                required=True,
                value=resolution,
                persistence=True,
                persistence_type="session",
            ),
        ], ),
        html.Div(children=[
            wcc.Label("Extension (m) ", ),
            dcc.Input(
                className="webviz-structunc-range-input",
                id={
                    "id": uuid,
                    "element": "extension"
                },
                type="number",
                step=25,
                required=True,
                value=extension,
                persistence=True,
                persistence_type="session",
            ),
        ], ),
        html.Div(
            style={"margin-top": "10px"},
            children=[
                wcc.Label("Depth range settings:"),
                wcc.FlexBox(
                    style={"display": "flex"},
                    children=[
                        dbc.Input(
                            id={
                                "id": uuid,
                                "settings": "zrange_min",
                            },
                            style={
                                "flex": 1,
                                "minWidth": "70px"
                            },
                            type="number",
                            value=depth_truncations.get("min", None),
                            debounce=True,
                            placeholder="Min",
                            persistence=True,
                            persistence_type="session",
                        ),
                        dbc.Input(
                            id={
                                "id": uuid,
                                "settings": "zrange_max",
                            },
                            style={
                                "flex": 1,
                                "minWidth": "70px"
                            },
                            type="number",
                            value=depth_truncations.get("max", None),
                            debounce=True,
                            placeholder="Max",
                            persistence=True,
                            persistence_type="session",
                        ),
                    ],
                ),
                wcc.RadioItems(
                    id={
                        "id": uuid,
                        "settings": "zrange_locks",
                    },
                    options=[
                        {
                            "label": "Truncate range",
                            "value": "truncate",
                        },
                        {
                            "label": "Lock range",
                            "value": "lock",
                        },
                    ],
                    value="truncate",
                ),
                wcc.Checklist(
                    id={
                        "id": uuid,
                        "settings": "ui_options",
                    },
                    options=[
                        {
                            "label": "Keep zoom state",
                            "value": "uirevision"
                        },
                    ],
                    value=["uirevision"]
                    if "uirevision" in initial_layout else [],
                ),
            ],
        ),
    ], )
Beispiel #26
0
# this_page_header = html.Div([
#
#     dbc.NavbarSimple([
#     # website header
#     html.Img(src='/logo.png',
#     alt='quant views logo',
#     style={'height': '90px'}),
#     ])
#
# ])

PLOTLY_LOGO = "https://images.plot.ly/logo/new-branding/plotly-logomark.png"

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

# this_page_header = dbc.Navbar(
#     [

#         html.Div(
#             # Use row and col to control vertical alignment of logo / brand
Beispiel #27
0
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
server = app.server

app.layout = dbc.Container(
    [
        Header("Classification with Data-efficient image Transformers (DeiT)", app),
        html.Hr(),
        dbc.Row(
            [
                dbc.Col(
                    md=7,
                    children=[
                        dcc.Graph(id="stats-display"),
                        html.P("Input Image URL:"),
                        dbc.Input(
                            id="input-url",
                            placeholder='Insert URL and click on "Run"...',
                        ),
                    ],
                ),
                dbc.Col(
                    md=5,
                    children=[
                        dcc.Graph(id="image-display"),
                        html.P("Controls:"),
                        dbc.ButtonGroup(
                            [
                                dbc.Button(
                                    "Run", id="btn-run", color="primary", n_clicks=0
                                ),
                                dbc.Button(
                                    "Random",
Beispiel #28
0
datepicker_input = dbc.FormGroup([
    dbc.Label("DateRange  ", html_for="datepickerinp", width=3),
    dbc.Col(dcc.DatePickerRange(
        end_date=dt(2017, 6, 21, 23, 59, 59, 999999),
        display_format='MMM Do, YY',
        start_date_placeholder_text='MMM Do, YY',
        id='datepickerinp',
    ),
            width=8)
],
                                 row=True,
                                 className='datepickker-input')

stock_name_inp = dbc.FormGroup([
    dbc.Label("Ticker ", width=3),
    dbc.Col(dbc.Input(placeholder="TickerName...", type="text"), width=8)
],
                               row=True)

fileupload_input = dbc.FormGroup([
    dcc.Upload(id='upload-data',
               children=html.Div(['Drag and Drop or ',
                                  html.A('Select Files')]),
               style={
                   'height': '60px',
                   'lineHeight': '60px',
                   'borderWidth': '1px',
                   'borderStyle': 'dashed',
                   'borderRadius': '5px',
                   'textAlign': 'center'
               }),
 def layout(self):
     return html.Div([
         dbc.Row([
             make_hideable(html.Div([
                 html.H3(self.title, id='reg-vs-col-title-' + self.name),
                 dbc.Tooltip(self.description,
                             target='reg-vs-col-title-' + self.name),
             ]),
                           hide=self.hide_title),
         ]),
         dbc.Row([
             make_hideable(dbc.Col([
                 dbc.Label("Feature:",
                           id='reg-vs-col-col-label-' + self.name),
                 dbc.Tooltip("Select the feature to display on the x-axis.",
                             target='reg-vs-col-col-label-' + self.name),
                 dcc.Dropdown(id='reg-vs-col-col-' + self.name,
                              options=[{
                                  'label': col,
                                  'value': col
                              } for col in self.explainer.
                                       columns_ranked_by_shap(self.cats)],
                              value=self.col),
             ],
                                   md=4),
                           hide=self.hide_col),
             make_hideable(dbc.Col([
                 html.Label(
                     'Display:',
                     id='reg-vs-col-display-type-label-' + self.name),
                 dbc.Tooltip(
                     f"Select what to display on the y axis: observed {self.explainer.target}, "
                     f"predicted {self.explainer.target} or residuals. Residuals can either "
                     "be calculated by takind the difference (y-preds), "
                     "ratio (y/preds) or log ratio log(y/preds). The latter makes it easier to "
                     "see relative differences.",
                     target='reg-vs-col-display-type-label-' + self.name),
                 dcc.Dropdown(id='reg-vs-col-display-type-' + self.name,
                              options=[{
                                  'label': 'Observed',
                                  'value': 'observed'
                              }, {
                                  'label': 'Predicted',
                                  'value': 'predicted'
                              }, {
                                  'label': 'Residuals: Difference',
                                  'value': 'difference'
                              }, {
                                  'label': 'Residuals: Ratio',
                                  'value': 'ratio'
                              }, {
                                  'label': 'Residuals: Log ratio',
                                  'value': 'log-ratio'
                              }],
                              value=self.display),
             ],
                                   md=4),
                           hide=self.hide_ratio),
             make_hideable(
                 dbc.Col([
                     dbc.Label(
                         "Grouping:",
                         id='reg-vs-col-group-cats-label-' + self.name),
                     dbc.Tooltip(
                         "group onehot encoded features together.",
                         target='reg-vs-col-group-cats-label-' + self.name),
                     dbc.FormGroup([
                         dbc.RadioButton(
                             id='reg-vs-col-group-cats-' + self.name,
                             className="form-check-input",
                             checked=self.cats),
                         dbc.Label(
                             "Group Cats",
                             html_for='reg-vs-col-group-cats-' + self.name,
                             className="form-check-label"),
                     ],
                                   check=True),
                 ],
                         md=2), self.hide_cats),
         ]),
         dbc.Row([
             dcc.Graph(id='reg-vs-col-graph-' + self.name,
                       config=dict(modeBarButtons=[['toImage']],
                                   displaylogo=False)),
         ]),
         dbc.Row([
             make_hideable(dbc.Col([
                 dbc.Label("Winsor:",
                           id='reg-vs-col-winsor-label-' + self.name),
                 dbc.Tooltip(
                     "Excluded the highest and lowest y values from the plot. "
                     "When you have some real outliers it can help to remove them"
                     " from the plot so it is easier to see the overall pattern.",
                     target='reg-vs-col-winsor-label-' + self.name),
                 dbc.Input(id='reg-vs-col-winsor-' + self.name,
                           value=self.winsor,
                           type="number",
                           min=0,
                           max=49,
                           step=1),
             ],
                                   md=2),
                           hide=self.hide_winsor),
             make_hideable(
                 dbc.Col([
                     dbc.Label(
                         "Points:",
                         id='reg-vs-col-show-points-label-' + self.name),
                     dbc.Tooltip(
                         "For categorical features, display a point cloud next to the violin plot.",
                         target='reg-vs-col-show-points-label-' +
                         self.name),
                     dbc.FormGroup([
                         dbc.RadioButton(
                             id='reg-vs-col-show-points-' + self.name,
                             className="form-check-input",
                             checked=self.points),
                         dbc.Label(
                             "Show points",
                             html_for='reg-vs-col-show-points-' + self.name,
                             className="form-check-label"),
                     ],
                                   check=True),
                 ],
                         md=3), self.hide_points),
         ]),
     ])
Beispiel #30
0
     dcc.Dropdown(
         id='homepage-city-selector',
         options=[{
             'value': _,
             'label': _
         } for _ in base_data.get_cities()],
         value=None,
         multi=True,
         clearable=True,
     ),
 ]),
 html.Hr(),
 dbc.FormGroup([
     dbc.Label('Category Search', html_for='homepage-cat-search'),
     dbc.Input(id='homepage-cat-search',
               placeholder='Try Poutine...',
               type='text')
 ]),
 html.Hr(),
 dbc.FormGroup([
     dbc.Label('Restaurant Search',
               html_for='homepage-rest-search'),
     dbc.Input(id='homepage-rest-search',
               placeholder='Subway?',
               type='text')
 ]),
 html.Hr(),
 dbc.FormGroup([
     dbc.Label('Minimum Rating', html_for='homepage-star-min'),
     dcc.Dropdown(
         id='homepage-star-minimum',