Exemplo n.º 1
0
def create_hyperparameter_fields():
    if hasattr(project, 'model'):
        children = []
        hyperparameter_list = project.model.get_params()
        for k, v in hyperparameter_list.items():
            target_id = "{}_tooltip".format(k)
            tooltip_message = "{}".format(v['tooltip_message'])
            tooltip = html.Div(
                [
                    html.A(href=v['link'], target="_blank",
                           className="fas fa-question-circle fa-lg", id=target_id),
                    dbc.Tooltip(tooltip_message, target=target_id),
                ],
            )

            children.append(html.Div(
                dbc.Row([dbc.Col(html.Label(k)), dbc.Col(tooltip)], style={'width': '100%', 'padding': '10px'})))
            if 'string' in v['param_values'] and len(v['param_values']['string']) > 0:
                options = [html.Option(i) for i in v['param_values']['string']]
                children.append(
                    dcc.Input(type="text", id={'type': 'hyperparameter', 'name': k}, list=k + '_datalist',
                              value=v['default'], style={'padding': '10px'}),
                )
                children.append(html.Datalist(options, id=k + '_datalist', style={'width': '100%', 'padding': '10px'}))
                children.append(html.Br())
            else:
                children.append(
                    dcc.Input(type="text", id={'type': 'hyperparameter', 'name': k}, value=v['default'],
                              style={'padding': '10px'}),
                )
                children.append(html.Br())

        return children
    else:
        return html.Div("Please Select the algorithm and dataset attributes.")
Exemplo n.º 2
0
def upload_data_layout():
    """Function for generating layout section for uploading data from web or file

    :return: Generated layout
    :rtype: dash.development.base_component.ComponentMeta
    """
    return html.Div([
        dcc.Input(
            id='url',
            placeholder='URL to data csv',
            list='url_history',
            style={
                "textAlign": "center",
            },
        ),
        html.Datalist(id='url_history',
                      children=[html.Option(value=DEFAULT_WEB_DATA)]),
        html.Button(id='url-button',
                    n_clicks=0,
                    children='Load',
                    style={
                        'margin': style.PADDING,
                        'backgroundColor': style.BUTTON_COLOR
                    }),
        html.H4(children='or', ),
        dcc.Upload(
            id='upload-data',
            children=html.Div(
                ["Drap and drop or click to select a file to upload"]),
            style={
                "width": "40%",
                "height": "60px",
                "lineHeight": "60px",
                "borderWidth": "1px",
                "borderStyle": "dashed",
                "borderRadius": "5px",
                "textAlign": "center",
                "margin": "10px",
                "margin-left": "30%",
            },
            multiple=False,
        ),
    ])
Exemplo n.º 3
0
def header():
    search_options = []
    data_lists = read_yaml(search_services_file)
    for data in data_lists:
        search_options.append({'label':data['name'],'value':data['id']})
    
    
    return html.Div(className='ui vertical masthead center aligned segment', children=[
            html.Div(className='ui container', children=[
                html.Div(className='ui secondary  menu', children=[
                        html.A('首页', className="item active", href="/"),     
                        html.A('行业分类', className="item", href="/industry"), 
                        html.A('股东关联', className="item", href="/shareholders"),                                                                                                                                                                                                                                      
                        html.A('财务报表', className="item", href="/indicators"),
                        html.A('投资组合', className="item", href="/portfolio"),
                        html.A('风险价值', className="item", href="/var"),                      
                        html.A('技术分析', className="item", href="/tick"),            
                        html.Div(className='right menu',children=[
                                html.A('GitHub', className="ui item", href="https://github.com/fundviz",target="_blank" ),
                                        ])
                                ]),                               
                    ]),
                                                  
                                                                                                  
             html.Div(className='ui text container', children=[
                    html.H1('查企.Net',className='ui header'),
                    html.H2('Do whatever you want when you want to.'),
                    html.Form(id='submit-form',target='_blank',method='post',className='ui input focus',children=[
                                dcc.Input(id='searchInput',
                                          list='autoSuggestion',
                                          type='text',
                                          style={'padding': '0px'}
                                            ),
                                html.Div(children=[dcc.Dropdown(id='search-engine',
                                             options = search_options,
                                             value='wechat',
                                             searchable=False,
                                             clearable=False,
                                             )],style={'width': '20%',}),
                    html.Datalist(id="autoSuggestion")
                                                                                                                                                                          
            ],style={'width': '90%',})]       )])
Exemplo n.º 4
0
 def add_filter(n_clicks, children):
     new_dropdown = html.Div(children=[
         dcc.Dropdown(id={
             'type': 'filter-dropdown',
             'index': n_clicks
         },
                      options=options),
         dcc.Input(id={
             'type': 'filter-lb',
             'index': n_clicks
         }),
         dcc.Input(id={
             'type': 'filter-ub',
             'index': n_clicks
         }),
         html.Datalist(id={
             'type': 'filter-discrete-list',
             'index': n_clicks
         }),
         html.Button('Update',
                     id={
                         'type': 'filter-update',
                         'index': n_clicks
                     }),
         html.Button('Delete',
                     id={
                         'type': 'filter-delete',
                         'index': n_clicks
                     }),
         html.P('', id={
             'type': 'filter-description',
             'index': n_clicks
         })
     ],
                             id={
                                 'type': 'filter-container',
                                 'index': n_clicks
                             })
     children.append(new_dropdown)
     return children
Exemplo n.º 5
0
app.explanation = '''
                    En la siguiente aplicación en la primera parte se puede obtener todos los temas relevantes 
                    de los que se han mencionado durante la captura de información, solamente de debe hacer CLICK
                    en el botón.
                    En la segunda gráfica es posible obtener los modelos de similitud entre documentos
                    recolectados a través de tweets y RSS, esto se puede realizar eligiendo la persona de interés
                    en la caja de personas, además es posible ajustar el nivel de similitud del modelo
                    arrastrando el slider entre más a la izquierda menos nivel de similitud por lo tanto más
                    redes, entre más a la derecha la similitud es mayor, por lo tanto se tienen menos redes. 
                    Pasando el mouse encima del nodo se puede ver el documento, al hacer click podrás ver todas las 
                    relaciones que tiene este documento
                    '''

app.layout = html.Div([
    html.Datalist(id='model-vector'),
    html.Div([
        html.H3('Distribución de temas'),
        dcc.Graph(id='model-pietemas'),
        html.Button(id='model-buttemas', children="Calibrar Temas")
    ]),
    # html.Div([
    #     html.H3('Distribución de lugares'),
    #     dcc.Graph(
    #         id='model-pieciudades'
    #     ),
    #     html.Button(id='model-butciudades',children="Calibrar Lugares")
    # ],className='drop-izq'),
    html.H5("Seleccione la sensibilidad de la similitud"),
    dcc.Slider(id='model-slider', min=0.25, max=0.50, step=0.01, value=0.35),
    dcc.Tabs(children=[
Exemplo n.º 6
0
              searchable=False,
              multi=True),
 html.H6("New Stock", id='new-stock-name'),
 html.Div([
     dcc.Input(value='Stock Name/ID',
               id='new-stock-input',
               style={'float': 'left'},
               list='list-suggested-inputs'),
     html.Button(id='submit-new-stock',
                 n_clicks=0,
                 children='Create Stock',
                 style={'float': 'right'},
                 disabled=True)
 ],
          style={'height': '32px'}),
 html.Datalist(id='list-suggested-inputs'),
 html.H6("Delete Stock", id='del-stock-name'),
 html.Div([
     dcc.Dropdown(options=[],
                  style={
                      'float': 'left',
                      'width': '200px'
                  },
                  id='del-stock-input',
                  placeholder="Select a set",
                  searchable=False),
     html.Button(id='submit-del-stock',
                 n_clicks=0,
                 children='Delete Stock',
                 style={'float': 'right'},
                 disabled=True)
Exemplo n.º 7
0
Arquivo: app.py Projeto: schlich/mpap2
race_counts = data['Race of Complainant'].value_counts()
officers = data['Officer Name'].unique()
display_data = data[[
    'Officer Name', 'DSN #', 'Rank', 'Assignment', 'Date of Incident',
    'Location of Incident', 'Nature of Complaint', "Complainant's Statement",
    'Age', "Race of Complainant", "Complainant Gender"
]]
column_names = [
    'Date of Incident', 'Nature of Complaint', 'Age', 'Race of Complainant',
    'Complainant Gender'
]

app.layout = html.Div([
    html.H2('St Louis Police Complaints'),
    html.H5('Search for/select an officer'),
    html.Datalist(id='officers',
                  children=[html.Option(value=i) for i in officers]),
    dcc.Input(id='officer_input', list='officers'),
    html.Button('Search', id='submit'),
    html.Div(
        [
            html.Div([
                html.H3('Officer Name', id='officer_name'),
                html.H5('DSN: ', id='dsn'),
                html.P('Rank: ', id='rank'),
                html.P('Assignment: ', id='assignment'),
            ]),
            html.Div([
                dash_table.DataTable(
                    id='complaints',
                    columns=[{
                        "name": i,
Exemplo n.º 8
0
                containerProps=dict(style=dict(display='inline-block'))
            ),
            dcc.Input(
                id="years-input",
                type='number',
                min=1,
                max=50,
                list='input-list',
                style=dict(width="100vw",maxWidth="200px",fontSize=25,display='inline-block')
            ),
            html.Datalist(
                id="input-list",
                children=[
                    html.Option(value=5),
                    html.Option(value=10),
                    html.Option(value=15),
                    html.Option(value=20),
                    html.Option(value=25),
                    html.Option(value=30),
                ],
            ),            
        ],style=styledict_slider),
    ],style=dict(margin='auto',paddingTop="0px")),

    # contains the output
    html.Div([
        html.Button(
            "Tell me if I should pay off my mortgage early! 💰",
            id='submit-button',
            style=dict(fontSize=20,backgroundColor="skyBlue",color="black",width="100vw",maxWidth="300px",whiteSpace='normal',lineHeight='normal',height="100%"),
            n_clicks=0
Exemplo n.º 9
0
def wrap_runde_anlegen_layout():
    current = pathlib.Path(__file__).name.split('.')[0]
    namen = get_runden(
        dataframe=True).sort_values("name")["name"].unique().tolist()
    orte = get_runden(
        dataframe=True).sort_values("ort")["ort"].unique().tolist()
    return html.Div([
        dcc.Store(id='create_runde_modal_open_n_clicks', data={'n_clicks': 0}),
        dcc.Store(id='create_runde_modal_close_n_clicks', data={'n_clicks':
                                                                0}),
        dbc.Modal([
            dbc.ModalHeader(id='create_runde_modal_header'),
            dbc.ModalBody(html.Div(id='create_runde_modal_body')),
            dbc.ModalFooter([
                dbc.Button('Schließen',
                           id='create_runde_modal_close',
                           color='primary',
                           block=True),
                dbc.Button('Schließen',
                           id='create_runde_modal_close_reload',
                           color='primary',
                           block=True,
                           href=f'/{current}',
                           external_link=True)
            ]),
        ],
                  id='create_runde_modal',
                  size='xl',
                  scrollable=True),
        dbc.Container([
            wrap_empty_dbc_row(),
            dbc.Row([dbc.Col([html.Div(html.H5('Runde anlegen'))])],
                    justify='start'),
            html.Datalist(id='name_list',
                          children=[html.Option(value=name)
                                    for name in namen]),
            dbc.Row([
                dbc.Col([
                    dbc.FormGroup([
                        dbc.FormText('Name der neuen Runde'),
                        dbc.Input(id='runde_new_name',
                                  placeholder='',
                                  maxLength=40,
                                  list='name_list'),
                    ])
                ],
                        xl=6,
                        xs=12),
            ]),
            html.Datalist(id='ort_list',
                          children=[html.Option(value=ort) for ort in orte]),
            dbc.Row([
                dbc.Col([
                    dbc.FormGroup([
                        dbc.FormText('Ort der neuen Runde'),
                        dbc.Input(id='runde_new_ort',
                                  placeholder='',
                                  maxLength=20,
                                  list='ort_list'),
                    ])
                ],
                        xl=6,
                        xs=12),
            ]),
            dbc.Row([
                dbc.Col([
                    dbc.FormGroup([
                        dbc.FormText('Datum der neuen Runde'),
                        dbc.Input(id='runde_new_date',
                                  type='Date',
                                  value=dt.date.today()),
                    ])
                ],
                        xl=6,
                        xs=12),
            ]),
            dbc.Row([
                dbc.Col([
                    dbc.FormGroup([
                        dbc.Button('Neue Runde erstellen',
                                   id='create_runde_modal_open',
                                   color='primary',
                                   block=True),
                    ])
                ],
                        xl=6,
                        xs=12)
            ]),
            wrap_footer_row()
        ]),
    ])
Exemplo n.º 10
0
        ]
    )
]

# Put the layout together
app.layout = dbc.Container(
    [
        navbar,
        # html.P(),
        *sale_input,
        sale_output,
        dbc.Row(dbc.Col(html.Hr())),
        dbc.Row(dbc.Col(tab_grp)),
        # Data storage below here
        html.Div(
            html.Datalist([html.Option(value=usr) for usr in example_users],
                          id='existing-users'),
            style={'display': 'none'}
        )
    ],
)


@app.callback(
    [Output('username-input', 'value'),
     Output('num-tickets-input', 'value'),
     Output('prize-addition-input', 'checked'),
     Output('edit-sale-id-input', 'invalid')],
    [Input('edit-sale-id-input', 'n_submit'),
     State('edit-sale-id-input', 'value')
     ],
)
Exemplo n.º 11
0
         'browser',  # identifies a list of pre-defined options to suggest to the user
         n_submit=
         0,  # number of times the Enter key was pressed while the input had focus
         n_submit_timestamp=-1,  # last time that Enter was pressed
         autoFocus=
         True,  # the element should be automatically focused after the page loaded
         n_blur=0,  # number of times the input lost focus
         n_blur_timestamp=-1,  # last time the input lost focus.
         # selectionDirection='', # the direction in which selection occurred
         # selectionStart='',     # the offset into the element's text content of the first selected character
         # selectionEnd='',       # the offset into the element's text content of the last selected character
     ),
 ]),
 html.Datalist(id='browser',
               children=[
                   html.Option(value="blue"),
                   html.Option(value="yellow"),
                   html.Option(value="green")
               ]),
 html.Br(),
 html.Br(),
 html.Div(id='div_output'),
 html.P(['------------------------']),
 html.P(['Enter clicked:']),
 html.Div(id='div_enter_clicked'),
 html.P(['Enter clicked timestamp:']),
 html.Div(id='div_sub_tmstp'),
 html.P(['------------------------']),
 html.P(['Input lost focus:']),
 html.Div(id='div_lost_foc'),
 html.P(['Lost focus timestamp:']),
 html.Div(id='div_lst_foc_tmstp'),
Exemplo n.º 12
0
                # dbc.Col(html.Div(card_4), className='cards'),
            ],
            className='cards_inside_row'),
        className='cards_col'),
    className='cards_row')

############################################
# tab items
dropdown_country = dbc.Card(dbc.CardBody(dbc.Row([
    dbc.Col(
        dbc.Input(placeholder="Search country...",
                  type="text",
                  list='list-data',
                  id='_cntry_name',
                  value='India')),
    html.Datalist(id='list-data',
                  children=[html.Option(value=c) for c in countries])
]),
                                         className='tab_global'),
                            className='tab_global')

dropdown_global = dbc.Card(dbc.CardBody(dbc.Row(
    dbc.Col(
        dbc.InputGroup([
            dbc.InputGroupAddon(
                "Show top", addon_type="prepend", className='addon_text'),
            dbc.Input(placeholder="10",
                      type="number",
                      min=1,
                      max=180,
                      step=1,
                      id='_no_of_cntry',
Exemplo n.º 13
0
						dcc.Markdown('''
							Available Neighbourhood Groups to Select
							* Brooklyn
							* Queens
							* Staten Island
							* Manhattan
							* Bronx
						''',
						style={'backgroundColor': colors['background'], 'color': colors['text']}
						),
						html.Datalist(
							id='n_list', 
							children=[
								html.Option(value='Manhattan'),
								html.Option(value='Brooklyn'),
								html.Option(value='Queens'),
								html.Option(value='Bronx'),
								html.Option(value='Staten Island')
								],
							style={'backgroundColor': colors['background'], 'color': colors['text']}
						),
						# Our main Input that will control all of our visuals.
						dcc.Input(
							id='Neighbourhoods',
							type= 'text',
							required='required',
							autoComplete='on',
							value='Bronx',
							# placeholder='',
							debounce=True,
							list='n_list',
Exemplo n.º 14
0
def layout_table(tags, substructure, message=""):
    tags_coll = db_connect('tags')

    return html.Div(children=[
        html.H3('Auto-QChem DB'),
        html.Datalist(id='conf_options',
                      children=[
                          html.Option(label=desc, value=tag)
                          for desc, tag in zip(conf_options_long, conf_options)
                      ]),
        html.Form(
            id='query-form',
            style={'display': 'inline-block'},
            children=[
                dcc.Dropdown(
                    id='tags_dropdown',
                    options=[
                        dict(
                            label=
                            f"{tag} ({len(tags_coll.distinct('molecule_id', {'tag': tag}))} molecules)",
                            value=tag)
                        for tag in list(tags_coll.distinct('tag'))
                    ],
                    multi=True,
                    style={
                        "width": "300px",
                        'display': 'inline-block',
                        'verticalAlign': 'top'
                    },
                    placeholder="Select tags...",
                    persistence=True,
                ),
                dcc.Input(name="tags", id="tags", style={'display': 'none'}),
                dcc.Input(name="substructure",
                          id="substructure",
                          placeholder="Filter on SMARTS substructure...",
                          style={
                              "width": "300px",
                              'verticalAlign': 'top',
                              'display': 'inline-block'
                          },
                          persistence=False,
                          value=substructure),
                html.Button('Query',
                            id='submit_query-form',
                            style={
                                "width": "150px",
                                'display': 'inline-block',
                                "background": "#F0F8FF"
                            }),
            ],
        ),
        html.Form(id='export-summary-form',
                  style={'display': 'inline-block'},
                  method='post',
                  children=[
                      dcc.Input(name="export",
                                id='export',
                                style={'display': 'none'}),
                      html.Button('Export',
                                  id='submit_export-summary-form',
                                  style={
                                      "width": "150px",
                                      "background": "#F0F8FF"
                                  })
                  ]),
        html.P(message) if message else html.Div(),
        html.Div(children=[
            html.Details(children=[
                html.Summary("Download descriptors"),
                html.Form(
                    id='export-form',
                    children=[
                        dcc.Dropdown(
                            id='dropdownPresetOptions',
                            options=[
                                dict(label=lab, value=val) for lab, val in zip(
                                    desc_presets_long, desc_presets)
                            ],
                            multi=True,
                            style={
                                "width": "300px",
                                'verticalAlign': 'top',
                            },
                            placeholder="Select descriptor presets...",
                        ),
                        dcc.Input(name="PresetOptions",
                                  id="inputPresetOptions",
                                  style={'display': 'none'}),
                        dcc.Input(name="ConformerOptions",
                                  id="conformerOptions",
                                  list='conf_options',
                                  style={
                                      "width": "300px",
                                      'verticalAlign': 'top'
                                  },
                                  placeholder="Select conformer option..."),
                        html.Br(),
                        html.Button('Download',
                                    id='submit_export-form',
                                    style={
                                        "width": "150px",
                                        "background": "#F0F8FF"
                                    })
                    ],
                    method='post',
                )
            ]),
            dt.DataTable(
                id='table',
                data=get_table(tags, substructure).to_dict('records'),
                columns=[
                    dict(name=c,
                         id=c,
                         hideable=False,
                         presentation="markdown" if c in
                         ['image', 'descriptors'] else "input")
                    for c in [
                        'image', 'can', 'name', 'tags', 'theory',
                        'light_basis_set', 'heavy_basis_set',
                        'generic_basis_set', 'max_light_atomic_number',
                        'num_conformers', 'max_num_conformers', 'descriptors'
                    ]
                ],
                editable=False,
                page_size=20,
                page_action="native",
                sort_action="native",
                sort_mode="multi",
                filter_action="native",
            ),
        ]) if tags is not None else html.Div(),
    ])
Exemplo n.º 15
0
app.titulo = "Entrenamiento del modelo"

app.explanation = '''
                    En la siguiente aplicación podrás darnos tus opiniones y ayudar a entrenar el modelo de inteligencia artificial
                    con el cual se puede predecir la percepción de las personas respecto a los tweets más sonados en estos momentos.
                    En la primera pestaña de la página (TWEET - RESPUESTA) encuentras los tweets que personas influyentes de
                    Colombia y Argentina escriben y las respuestas que tienen de sus seguidores en tweeter.
                    En la segunda (TWEET) encontrarás los tweets de las personas influyentes de cada país, para así,
                    poder dar tu opinión acerca de la percepción emocional que tienes respecto a lo que se escribe.
                    Selecciona en los menús desplegables tu percepción acerca de los tweets y dale click al botón para obtener
                    mas tweets. ¡GRACIAS POR TU APOYO!
                    '''

app.layout = html.Div([
    html.Datalist(id='model-idtweet', children=[_id]),
    html.Div([
        dcc.RadioItems(id='model-seleccion',
                       options=[{
                           'label': 'Colombia',
                           'value': 'COL'
                       }, {
                           'label': 'Argentina',
                           'value': 'ARG'
                       }],
                       value='COL',
                       labelStyle={'display': 'inline-block'})
    ]),
    dcc.Tabs([
        dcc.Tab(label='Tweet - Respuesta',
                children=[
Exemplo n.º 16
0
def input_suggestion():
    return html.Datalist(id='suggestion', children=name_list)
Exemplo n.º 17
0
def layout_menu():
    return [
        dbc.Container([
            dbc.Row(
                [
                    dbc.Col(
                        dbc.Input(value='',
                                  type='text',
                                  id='path',
                                  list='list-suggested-inputs'),
                        xs=8,
                        md=9,
                    ),
                    dbc.Col([
                        dbc.Button('Open', id='open'),
                        dcc.Input(value='', type='hidden', id='hidden_path'),
                    ],
                            xs=3),
                ],
                justify='end',
                no_gutters=True,
            ),
            dbc.Row([
                dbc.Col(
                    DataTable(
                        id='reads',
                        columns=[{
                            "name": 'Read',
                            "id": 'name'
                        }],
                        data=[],
                        style_header={
                            'backgroundColor': 'rgb(30, 30, 30)',
                            'color': 'white',
                            'textAlign': 'center'
                        },
                        style_table={
                            'overflowY': 'scroll',
                            'width': '100%'
                        },
                        fixed_rows={
                            'headers': True,
                        },
                        style_cell={
                            'overflow': 'hidden',
                            'textOverflow': 'ellipsis',
                            'maxWidth': 0,
                            'backgroundColor': 'grey',
                        },
                        filter_action="native",
                    ),
                    id='read_col',
                )
            ], ),
            dbc.Row([
                dbc.Col(
                    dbc.Select(
                        options=[{
                            'label': '000',
                            'value': '000'
                        }],
                        id='basecalls',
                        value='000',
                    )),
            ], ),
            dbc.Row(
                [
                    dbc.Col(html.I(className='fas fa-question-circle',
                                   style={
                                       'color': 'green',
                                       'fontSize': 'x-large'
                                   },
                                   id="help"),
                            width="auto",
                            align='end'),
                    dbc.Col(dbc.Button(
                        "Search Sequence",
                        id="open_search",
                    ),
                            width='auto',
                            align='end')
                ],
                justify='between',
            ),
        ]),
        dcc.Input(value='', type='hidden', id='javascript'),
        dcc.Input(value='', type='hidden', id='javascript_out'),
        html.Datalist([], id='list-suggested-inputs'),
        create_search_modal(), *[create_popover(**d) for d in popovers]
    ]
Exemplo n.º 18
0
def layout_table(cls, subcls, type, subtype, tags, substructure, message=""):
    tags_coll = db_connect('tags')
    mols_coll = db_connect('molecules')
    '''
    filter = {}
    if cls is not None:
        filter['metadata.class'] = cls
    if subcls is not None:
        filter['metadata.subclass'] = subcls
    if type is not None:
        filter['metadata.type'] = type
    if subtype is not None:
        filter['metadata.subtype'] = subtype

    if filter:
        mols_ids = mols_coll.distinct('_id', filter)
        available_tags = tags_coll.distinct('tag', {'molecule_id': {"$in": mols_ids}})
    else:
        available_tags = tags_coll.distinct('tag')
    '''

    return html.Div(children=[
        dcc.Link(html.H3('Auto-QChem DB'), href="/"),
        html.Datalist(id='conf_options',
                      children=[
                          html.Option(label=desc, value=tag)
                          for desc, tag in zip(conf_options_long, conf_options)
                      ]),
        html.Form(
            id='query-form',
            children=[
                dcc.Dropdown(id="cls_dropdown",
                             options=[
                                 dict(label=cls, value=cls) for cls in list(
                                     mols_coll.distinct('metadata.class'))
                             ],
                             placeholder="Select Class",
                             persistence=False),
                dcc.Dropdown(id="subcls_dropdown",
                             options=[
                                 dict(label=subcls, value=subcls)
                                 for subcls in list(
                                     mols_coll.distinct('metadata.subclass'))
                             ],
                             placeholder="Select SubClass",
                             persistence=False),
                dcc.Dropdown(id="type_dropdown",
                             options=[
                                 dict(label=type, value=type) for type in list(
                                     mols_coll.distinct('metadata.type'))
                             ],
                             placeholder="Select Type",
                             persistence=False),
                dcc.Dropdown(id="subtype_dropdown",
                             options=[
                                 dict(label=subtype, value=subtype)
                                 for subtype in list(
                                     mols_coll.distinct('metadata.subtype'))
                             ],
                             placeholder="Select SubType",
                             persistence=False),
                dcc.Dropdown(
                    id='tags_dropdown',
                    options=[
                        dict(
                            label=
                            f'''{tag} ({len(tags_coll.distinct("molecule_id", {"tag": tag}))} molecules)''',
                            value=tag) for tag in tags_coll.distinct('tag')
                    ],
                    multi=True,
                    placeholder="Select Tags",
                    persistence=False,
                ),
                dcc.Input(name="cls", id="cls", style={'display': 'none'}),
                dcc.Input(
                    name="subcls", id="subcls", style={'display': 'none'}),
                dcc.Input(name="type", id="type", style={'display': 'none'}),
                dcc.Input(
                    name="subtype", id="subtype", style={'display': 'none'}),
                dcc.Input(name="tags", id="tags", style={'display': 'none'}),
                dcc.Input(name="substructure",
                          id="substructure",
                          placeholder="Filter w/ SMARTS Substructure",
                          style={"width": "100%"},
                          persistence=False,
                          value=substructure),
                html.Button('Query',
                            id='submit_query-form',
                            style={
                                "width": "50%",
                                "background": "#F0F8FF"
                            }),
            ],
        ),
        html.P(message) if message else html.Div(),
        html.Div(children=[
            html.Details(children=[
                html.Summary("Export Molecule List"),
                html.Form(id='export-summary-form',
                          method='post',
                          children=[
                              dcc.Input(name="export",
                                        id='export',
                                        style={'display': 'none'}),
                              html.Button('Export List',
                                          id='submit_export-summary-form',
                                          style={
                                              "width": "50%",
                                              "background": "#F0F8FF"
                                          })
                          ]),
            ]),
            html.Details(children=[
                html.Summary("Download descriptors"),
                html.Form(
                    id='export-form',
                    children=[
                        dcc.Dropdown(
                            id='dropdownPresetOptions',
                            options=[
                                dict(label=lab, value=val) for lab, val in zip(
                                    desc_presets_long, desc_presets)
                            ],
                            multi=True,
                            placeholder="Select descriptor presets...",
                        ),
                        dcc.Input(name="PresetOptions",
                                  id="inputPresetOptions",
                                  style={'display': 'none'}),
                        dcc.Input(name="ConformerOptions",
                                  id="conformerOptions",
                                  list='conf_options',
                                  style={"width": "100%"},
                                  placeholder="Select conformer option..."),
                        html.Br(),
                        html.Button('Download',
                                    id='submit_export-form',
                                    style={
                                        "width": "50%",
                                        "background": "#F0F8FF"
                                    })
                    ],
                    method='post',
                )
            ]),
            dt.DataTable(
                id='table',
                data=get_table(cls, subcls, type, subtype, tags, substructure).
                to_dict('records'),
                columns=[
                    dict(name=c,
                         id=c,
                         hideable=False,
                         presentation="markdown" if c in
                         ['image', 'descriptors'] else "input")
                    for c in [
                        'image', 'can', 'name', 'class', 'subclass', 'type',
                        'subtype', 'tags', 'theory', 'light_basis_set',
                        'heavy_basis_set', 'generic_basis_set',
                        'max_light_atomic_number', 'num_conformers',
                        'max_num_conformers', 'descriptors'
                    ]
                ],
                editable=False,
                page_size=20,
                page_action="native",
                sort_action="native",
                sort_mode="multi",
                filter_action="native",
            ),
        ]) if any(filter is not None for filter in (cls, subcls, type, subtype,
                                                    tags)) else html.Div(),
    ])
Exemplo n.º 19
0
def gui_layout():
    """Create main layout for teleserver

    :return: GUI layout as dash component
    :rtype: dash.development.base_component.ComponentMeta
    """
    layout = html.Div([
        html.Div(
            [
                html.H1(children='teleserver',
                        style={
                            'font-family': 'helvetica',
                            'color': '#3B5DBC',
                            'font-size': '50',
                            'text-align': 'center',
                            'vertical-align': 'text-top'
                        }),
                # URL section
                html.Div([
                    dcc.Input(id='url',
                              placeholder="Type your URL here",
                              list='url_history'),
                    html.Datalist(id='url_history', children=[])
                ]),
                html.Div([
                    html.Button(id='url-button',
                                n_clicks=0,
                                children='Cast',
                                style={
                                    'margin': style.PADDING,
                                    'backgroundColor': style.BUTTON_COLOR
                                }),
                    html.Button(id='url-close-button',
                                n_clicks=0,
                                children='Close',
                                style={
                                    'margin': style.PADDING,
                                    'backgroundColor': style.BUTTON_COLOR
                                })
                ]),

                # Tabs
                html.Div([
                    dcc.Tabs(
                        id="tabs",
                        value='system-options-tab',
                        children=[
                            dcc.Tab(label='System Options',
                                    value='system-options-tab'),
                            dcc.Tab(label='Files', value='upload-tab'),
                            dcc.Tab(label='Shortcuts', value='shortcuts-tab'),
                            dcc.Tab(label='Keyboard', value='keyboard-tab'),
                            dcc.Tab(label='Screen', value='screen-tab'),
                            dcc.Tab(label='Calendar', value='calendar-tab')
                        ]),
                    html.Div(id='tabs-content')
                ]),

                # Dummy outputs section
                html.Div([html.Div(id='open-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='close-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='screenshot-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='reboot-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='poweroff-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='mute-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='download-files-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='delete-files-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='open-files-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='custom-shortcut-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='native-shortcut-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='shortcut-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='keyboard-output-message')],
                         style={'display': 'none'}),
                html.Div([html.Div(id='calendar-output-message')],
                         style={'display': 'none'})
            ],
            style={
                'text-align': 'center',
                'font-family': 'helvetica',
                'position': 'absolute',
                'top': '0',
                'left': '0',
                'width': '100%',
                'height': '100%',
                'backgroundColor': '#FFFFFF'
            }),
        html.A([
            html.Img(src='https://raw.githubusercontent.com/Dysproz'
                     '/teleserver/master/images/info.png',
                     style={
                         'height': '1.2%',
                         'width': '1.2%',
                         'float': 'right',
                         'position': 'relative',
                         'padding-top': 0,
                         'padding-right': 0
                     })
        ],
               href='https://github.com/Dysproz/teleserver')
    ])
    return layout
Exemplo n.º 20
0
Arquivo: app.py Projeto: schlich/gram
             "margin-left": "auto",
             "margin-right": "auto",
         },
     ),
     href="https://jointhegram.org",
 ),
 html.Br(),
 html.H2("Saint Louis Metropolitan Police Department (SLMPD)"),
 html.H3("Employee Misconduct Report (EMR) - Allegations"),
 html.P(
     "EMRs obtained via Missouri Open Records Requests from 2010-2019"),
 html.H5("Select an officer to see misconduct reports:"),
 html.Datalist(
     id="officers",
     children=[
         html.Option(value=i)
         for i in officers["Officer Name"].to_list()
     ],
 ),
 dcc.Input(id="officer_input", list="officers"),
 dbc.Button("Search", id="submit"),
 html.Div(
     [
         html.Br(),
         html.Br(),
         html.H3("Officer Name", id="officer_name"),
         html.Div(id="officer-info", ),
         html.Div([
             html.Br(),
             html.H4("EMR Complaint Summary"),
             html.
Exemplo n.º 21
0
        # pretty sure this could be done easily without dbc - maybe look into it
        dbc.Modal([
            html.Button('Exit',
                        id='modal_close',
                        className='close-button',
                        style={
                            'display': 'inlline',
                            'text-align': 'right'
                        }),
            html.H3(id='modal_title'),
            html.Div(id='modal_text'),
            html.Img(id='modal_img', style={'maxWidth': '100%'}),
        ],
                  id='modal',
                  className='modal'),  # END of Modal component
        html.Datalist(id='datalist', children=['Ace of Spades']),

        ### HEADER & RANDOM CHAT
        html.H2('Mnemonica Trainer',
                style={
                    'margin-bottom': '5px',
                    'text-align': 'center'
                }),

        ### Master Tabs
        dcc.Tabs(
            id='tabs_master',
            parent_className='custom-tabs',
            className='custom-tabs-container',
            children=[
)
# ----------------------------------------- -------------------- ------------------------------------------


# --------------------------- layout the webpage ------------------------
app.layout = html.Div(children = 
                        [html.Div("Comorbidity Explorer", style={
                                                "color":"black",
                                                "text-align":"center",
                                                "font-family":"IntroCondBlackFree",
                                                "fontSize":"44px",
                                                "marginTop":"10px"
                                                }),
                        html.Img(id = "past-present-timeline", src = app.get_asset_url('./images/past-present-bar.png'), alt = 'past to present timeline', style={'width':'85%', 'marginTop':'20px', 'marginLeft':'100px', 'marginRight':'50px'}),
                        html.Span(["PAST", html.Div(style={"width":"80%", "height":"18px", "backgroundColor":"#fff5bf'", "display":"inline-block"}), "PRESENT"], style={"fontSize":"18px", "font-family":"IntroCondLightFree", "marginBottom":"20px", "marginLeft":"80px", "clear":"both"}),
                        html.Datalist(id='list-suggested-inputs', children=[html.Option(value=word) for word in suggestions]),
                        html.Div(dcc.Input(id='input-1',type='text',list='list-suggested-inputs',value='Viral sinusitis (disorder)', placeholder='Condition 1', debounce=True, style={'fontSize':'18px', 'width': '100%'}), style={'width': '15%', 'height':'30px', 'display': 'inline-block', 'marginTop': '-20px', 'marginLeft': '30px', 'fontSize':'18px'}),
                        html.Img(id = "time-arrow-1", src = app.get_asset_url('./images/time-arrow-1.png'), alt = 'timeline indicator 1', style={'vertical-align':'middle', 'marginLeft':'10px', 'marginRight':'10px'}),
                        html.Div(dcc.Input(id='input-2',type='text',list='list-suggested-inputs',value='', placeholder='Condition 2', debounce=True, style={'fontSize':'18px', 'width': '100%'}), style={'width': '15%', 'height':'30px', 'display': 'inline-block', 'marginTop': '-20px', 'marginLeft': '0px', 'fontSize':'18px'}),
                        html.Img(id = "time-arrow-2", src = app.get_asset_url('./images/time-arrow-2.png'), alt = 'timeline indicator 2', style={'vertical-align':'middle', 'marginLeft':'10px', 'marginRight':'10px'}),
                        html.Div(dcc.Input(id='input-3',type='text',list='list-suggested-inputs',value='', placeholder='Condition 3', debounce=True, style={'fontSize':'18px', 'width': '100%'}), style={'width': '15%', 'height':'30px', 'display': 'inline-block', 'marginTop': '-20px', 'marginLeft': '0px', 'fontSize':'18px'}),
                        html.Img(id = "time-arrow-3", src = app.get_asset_url('./images/time-arrow-3.png'), alt = 'timeline indicator 3', style={'vertical-align':'middle', 'marginLeft':'10px', 'marginRight':'10px'}),
                        html.Div(dcc.Input(id='input-4',type='text',list='list-suggested-inputs',value='', placeholder='Condition 4', debounce=True, style={'fontSize':'18px', 'width': '100%'}), style={'width': '15%', 'height':'30px', 'display': 'inline-block', 'marginTop': '-20px', 'marginLeft': '0px', 'fontSize':'18px'}),
                        html.Img(id = "time-arrow-4", src = app.get_asset_url('./images/time-arrow-4.png'), alt = 'timeline indicator 4', style={'vertical-align':'middle', 'marginLeft':'10px', 'marginRight':'10px'}),
                        html.Div(dcc.Input(id='input-5',type='text',list='list-suggested-inputs',value='', placeholder='Condition 5', debounce=True, style={'fontSize':'18px', 'width': '100%'}), style={'width': '15%', 'height':'30px', 'display': 'inline-block', 'marginTop': '-20px', 'marginLeft': '0px', 'fontSize':'18px'}),
                        html.Div(html.Button("Search", id = "searchButton")),
                        html.Div(id='predictedText', children = pageLoadingText, style={"font-family":"Arial Black",
                                                                            "fontSize":"22px",
                                                                            "width":"auto",
                                                                            "max-width":"500px",
                                                                            "float": "left",
Exemplo n.º 23
0
# "https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css",
# "https://unpkg.com/spectre.css/dist/spectre.min.css",
# "https://unpkg.com/spectre.css/dist/spectre-exp.min.css",
# "https://unpkg.com/spectre.css/dist/spectre-icons.min.css",
# ]
# print(dbc.themes)
app = dash.Dash(__name__,
                external_stylesheets=external_stylesheets,
                url_base_pathname='/dashtest/')
app.config.suppress_callback_exceptions = True

df_data = pd.read_pickle("data/df_data.pkl")
df_mc = pd.read_pickle("data/df_mc.pkl")

datalist_columns = html.Datalist(
    id='datalist-columns',
    children=[html.Option(value=word) for word in df_data.columns],
)

dropdown_columns = dcc.Dropdown(
    id='dropdown-columns',
    multi=True,
    placeholder="Variable list",
    # value="",
    options=[dict(label=name, value=name) for name in df_data.columns],
    style={"margin": "10px"},
)

app.layout = html.Div([
    datalist_columns,
    dcc.Location(id='url', refresh=False),
    html.Div(id='page-layout', style={"padding": "10px"})
Exemplo n.º 24
0
    print("on heroku")

prefix = "/"  #on heroku
#prefix="/tcell/"
server = flask.Flask(__name__)
app = dash.Dash(__name__, server=server, routes_pathname_prefix=prefix)
app.title = "T cell data visualizer"

#Decides the layout of web app with titles and labels
app.layout = html.Div(children=[
    html.H1(children='T cell data visualizer'),
    html.Div(children='''
        Per-gene data: Search for example the gene Gata3
    '''),
    html.Datalist(
        id='list-suggested-genes',
        children=[html.Option(value=word) for word in gene_suggestions]),
    html.Datalist(
        id='list-suggested-motifs',
        children=[html.Option(value=word) for word in motif_suggestions]),
    #############################
    dcc.Input(id='input-gene-name',
              type='text',
              list='list-suggested-genes',
              value='',
              debounce=True),
    #############################
    html.Div(children=[
        html.Div(id="tc-human-out",
                 style={
                     'width': '49%',
Exemplo n.º 25
0
INVISIBLE = {'display': 'none'}

# TODO: find out if people get mad about this parens style

app.layout = html.Div([
    dbc.Col(
        dcc.Markdown("""
        # WheelWay
        ### Directions for everybody
        """)),
    dbc.Col(html.Div([
        dcc.Markdown(
            "#### Enter any street address in Brighton -- no need to add the city or state!"
        ),
        dbc.Row([
            html.Datalist(id='addresses', children=ADDRESS_LIST),
            dbc.Col([
                dbc.Input(id='origin',
                          placeholder="Type your origin here",
                          value='',
                          type='text',
                          debounce=True,
                          bs_size="lg",
                          list='addresses')
            ],
                    width=6),
            dbc.Col([
                html.Div([
                    dbc.Button(children="Find me a route with no obstructions",
                               color="success",
                               id='obs_button',
Exemplo n.º 26
0
            html.H3(
                    children='Comparison of players stats during their careers',
                    style={
                    'textAlign': 'center'
                     },
            ),

            dcc.Markdown(children= explain_player_choice
            ),

            html.Br(),
            html.Br(),

            html.Datalist(id='list-data',
                 children=[
                     html.Option(value=name) for name in set(df["LOWER_NAME"])
                            ]),

            dcc.Input(id="input1", type="text", placeholder="Write Name", list='list-data'),
            dcc.Input(id="input2", type="text", placeholder="Write Name", list='list-data'),
            dcc.Input(id="input3", type="text", placeholder="Write Name", list='list-data'),
            dcc.Input(id="input4", type="text", placeholder="Write Name", list='list-data'),
            dcc.Input(id="input5", type="text", placeholder="Write Name", list='list-data'),

        html.Div([
            html.Div(children=[

                html.Br(),
                html.Br(),

                html.H5(
Exemplo n.º 27
0
input_group = [dbc.FormGroup(
                [
                    dbc.Label(html.H3("COVID Relevance")),
                    #dbc.Input(placeholder='Enter a number between 1-5', type='number', autoFocus=True, autoComplete=True, id='quality-score')
                    dbc.RadioItems(
                        options=[
                            {"label": "Very relevant", "value": 2},
                            {"label": "Somewhat relevant", "value": 1},
                            {"label": "Not relevant", "value": 0},

                        ],
                        labelStyle={"transform": "translateX(10px)", "margin-left": "20px", "color": "rgba(125, 139, 153, 1)", "transition": "all 0.2 ease-in", "font-weight": "200", "line-height": "1.61rem", "margin-bottom": "0.5rem", "font-size": "1.61rem"},
                        #inputStyle={"background-color": "tomato", "border": "10px solid blue", "color": "chartreuse"},
                        labelCheckedStyle={"font-weight": 900, "transform": "translate(0px 5px);", "color": "#fcfcfc"},
                        id='quality-score')
                ],

            ),
            dbc.FormGroup(
                [
                    dbc.Label(html.H3("Content Quality")),
                    #dbc.Input(placeholder='Enter a number between 1-5', type='number', autoFocus=True, autoComplete=True, id='quality-score')

                    dbc.RadioItems(
                        options=[
                            {"label": "High", "value": 2},
                            {"label": "Average", "value": 1},
                            {"label": "Low", "value": 0},
                        ],
                        value=1,
                        id="time-sensitivity",
                        labelStyle={"transform": "translateX(10px)", "margin-left": "20px",
                                    "color": "rgba(125, 139, 153, 1)", "transition": "all 0.2 ease-in",
                                    "font-weight": "200", "line-height": "1.61rem", "margin-bottom": "0.5rem",
                                    "font-size": "1.61rem"},
                        # inputStyle={"background-color": "tomato", "border": "10px solid blue", "color": "chartreuse"},
                        # inputStyle={"background-color": "tomato", "border": "10px solid blue", "color": "chartreuse"},
                        labelCheckedStyle={"font-weight": 900, "transform": "translate(0px 5px);", "color": "#fcfcfc"},
                    )], id='time-sensitivity-container', className='hidden'),

            dbc.FormGroup(
                [
                    dbc.Label(html.H3("Audience")),
                    dbc.RadioItems(
                        options=[
                            {"label": "Local", "value": "local"},
                            {"label": "Regional", "value": "regional"},
                            {"label": "State", "value": "state"},
                            {"label": "National", "value": "national"},
                            {"label": "International", "value": "international"},
                            {"label": "Unbound", "value": "unbound"}
                        ],
                        value=1,
                        id="audience-label",
                        labelStyle={"transform": "translateX(10px)", "margin-left": "20px", "color": "rgba(125, 139, 153, 1)", "transition": "all 0.2 ease-in", "font-weight": "200", "line-height": "1.61rem", "margin-bottom": "0.5rem", "font-size": "1.61rem"},
                        #inputStyle={"background-color": "tomato", "border": "10px solid blue", "color": "chartreuse"},
                        #inputStyle={"background-color": "tomato", "border": "10px solid blue", "color": "chartreuse"},
                        labelCheckedStyle={"font-weight": 900, "transform": "translate(0px 5px);", "color": "#fcfcfc"},
                    )]),
            dbc.FormGroup(
                [
                    dbc.Label(html.H3("Is this article... ?")),
                    dbc.Checklist(
                        options=[
                            {"label": "Feature-worthy", "value": "feature_worthy"},
                            {"label": "Sports related", "value": "sports_related"},
                            {"label": "Opinion/op-ed", "value": "opinion"},
                            {"label": "Syndicated (e.g., Reuters, AP)", "value": "syndicated"},
                            {"label": "Problematic", "value": "problematic"}
                        ],
                        switch=True,
                        value=[],
                        id="article-tags",
                        labelStyle={"transform": "translateX(10px)", "margin-left": "20px", "color": "rgba(125, 139, 153, 1)", "transition": "all 0.2 ease-in", "font-weight": "200", "line-height": "1.61rem", "margin-bottom": "0.5rem", "font-size": "1.61rem"},
                        #inputStyle={"background-color": "tomato", "border": "10px solid blue", "color": "chartreuse"},
                        #inputStyle={"background-color": "tomato", "border": "10px solid blue", "color": "chartreuse"},
                        labelCheckedStyle={"font-weight": 900, "transform": "translate(0px 5px);", "color": "#fcfcfc"},
                    )]),
    dbc.FormGroup([

html.Datalist(
    id='list-suggested-inputs',
    children=[html.Option(value=word) for word in suggestions]
),
dbc.Label(html.H3("Primary location")),
dbc.Input(id='input-1',
    type='text',
    list='list-suggested-inputs',
    value=''
)]),
    dbc.FormGroup([
        dbc.Button("Submit", color="success", id="submit", n_clicks=0, className='ml-3 center', disabled=True),
        dbc.Button("Skip", color='warning', id='skip', n_clicks=0, className='ml-3 center'),
        dbc.Button("Undo", color='danger', id='undo', n_clicks=0, className='ml-3 center')
    ], style={"text-align": "center"}),

]
Exemplo n.º 28
0
def player_suggestions():
    return html.Datalist(
        id="player-list",
        children=[html.Option(value=word) for word in playerlist]
    )
Exemplo n.º 29
0
    zones = yaml.load(file, Loader=yaml.FullLoader)

with open(r'configs/class_settings.yaml') as file:
    classes = yaml.load(file, Loader=yaml.FullLoader)

with open(r'configs/servers.yaml') as file:
    servers = yaml.load(file, Loader=yaml.FullLoader)

serverRegion_div = html.Div(
    className='row',
    children=[
        html.Div(
            className='largeleftblock',
            children=[
                html.Datalist(
                    id='serverlist',
                    children=[html.Option(value=server) for server in servers]
                ),
                dcc.Input(
                    type='text',
                    placeholder='Server',
                    id='serverinput',
                    list='serverlist',
                    required = True
                )
            ]
        ),
        html.Div(
            className='smallrightblock',
            children=[
                dcc.Dropdown(
                    id='regionselect',