Ejemplo n.º 1
0
                     marks={
                         0: '0',
                         1: '1',
                         2: '2',
                         3: '3',
                         4: '4',
                         5: '5'
                     },
                     value=[0, 6])
 ]),
 html.H3('Neighborhood'),
 dcc.Dropdown(
     id='dropdown1',
     options=[{
         'label': i,
         'value': i
     } for i in df.Neighborhood.unique()],
     multi=True,
     # value = [i for i in df.Neighborhood.unique()]
 ),
 html.P('\n'),
 html.H3('Borough'),
 dcc.Dropdown(
     id='dropdown2',
     options=[{
         'label': i,
         'value': i
     } for i in df.Borough.unique()],
     multi=True,
     # value = [i for i in df.Neighborhood.unique()]
 )
app = dash.Dash()

df = pd.read_csv('https://gist.githubusercontent.com/chriddyp/'
                 'cb5392c35661370d95f300086accea51/raw/'
                 '8e0768211f6b747c0db42a9ce9a0937dafcbd8b2/'
                 'indicators.csv')

available_indicators = df['Indicator Name'].unique()

app.layout = html.Div([
    html.Div(
        [
            html.Div([
                dcc.Dropdown(id='crossfilter-xaxis-column',
                             options=[{
                                 'label': i,
                                 'value': i
                             } for i in available_indicators],
                             value='Fertility rate, total (births per woman)'),
                dcc.RadioItems(id='crossfilter-xaxis-type',
                               options=[{
                                   'label': i,
                                   'value': i
                               } for i in ['Linear', 'Log']],
                               value='Linear',
                               labelStyle={'display': 'inline-block'})
            ],
                     style={
                         'width': '49%',
                         'display': 'inline-block'
                     }),
            html.Div([
def _make_layout(embeddings_list: List[WordEmbeddings]) -> object:
    """Create the layout for the embedding projector app."""
    return dbc.Container(fluid=True, children=[
        html.H1(children='Embedding Projector'),
        # We use a hidden div to faciliate callbacks.
        # This 'signal' can be used both ways: to trigger a callback, or to have a callback
        # return nothing.
        #
        # For example, when we want to do some data processing (such as computing the PCA)
        # but may not necessarily want to render anything new.
        html.Div(id='update-embeddings-signal', style={'display': 'none'}),
        html.Div(id='hidden-div', style={'display': 'none'}),
        dcc.Loading(id='loading-spinner', fullscreen=True, loading_state={'is_loading': True}),
        dbc.Row([
            dbc.Col(html.Div([
                html.Div([
                    html.H3('DATA', style={'font-weight': 'bold'}),
                    html.Label('Embeddings'),
                    dcc.Dropdown(id='embeddings-dropdown',
                                 options=[
                                     {'label': str(embeddings), 'value': i}
                                     for i, embeddings in enumerate(embeddings_list)
                                 ],
                                 clearable=False,
                                 value=0),
                    html.Div(id='metadata-div'),
                    dbc.Checklist(id='spherize-data',
                                  options=[{'label': 'Spherize data', 'value': 'yes'}],
                                  value=['yes'],
                                  inline=True,
                                  switch=True)
                ]),
                html.Div([
                    html.H3('PCA', style={'font-weight': 'bold'}),
                    dbc.Label('X-axis'),
                    dcc.Dropdown(id='x-component-dropdown', value=0, clearable=False),
                    dbc.Label('Y-axis'),
                    dcc.Dropdown(id='y-component-dropdown', value=1, clearable=False),
                    dbc.Checklist(id='use-z-component',
                                  options=[{'label': 'Z-Axis', 'value': 'yes'}],
                                  value=['yes'],
                                  inline=True,
                                  switch=True,
                                  className='py-1'),
                    dcc.Dropdown(id='z-component-dropdown', value=2, clearable=False),
                    html.Br(),
                    html.Label(id='pca-variance-label')
                ])
            ]), width=2),
            dbc.Col(html.Div([
                dcc.Loading(id='embedding-graph-loading',
                            children=[
                                dcc.Graph(
                                    # Make a defualt empty graph
                                    figure=_make_embedding_scatter([], [], [], []),
                                    id='embedding-graph',
                                    style={'height': '100vh'}
                                )
                            ],
                            type='default')
            ]), width=8),
            dbc.Col(html.Div([
                html.Div([
                    html.H3('ANALYSIS', style={'font-weight': 'bold'}),
                    dbc.Row([
                        dbc.Col([dbc.Button('Show All Data',
                                            id='show-all-data-button',
                                            outline=True,
                                            color='dark',
                                            className='mr-2 my-4',
                                            disabled=True)]),
                        dbc.Col([dbc.Button('Isolate Points',
                                            id='isolate-points-button',
                                            outline=True,
                                            color='dark',
                                            className='mr-2 my-4',
                                            disabled=True)]),
                        dbc.Col([dbc.Button('Clear Selection',
                                            id='clear-selection-button',
                                            outline=True,
                                            color='dark',
                                            className='my-4',
                                            disabled=True)])
                    ], no_gutters=True),
                    html.Div(id='selected-word-state', style={'display': 'none'}),
                    dbc.Tabs([
                        dbc.Tab(tab_id='search-tab', children=[
                            html.Div([
                                dbc.Input(id='word-search-input',
                                          type='text',
                                          placeholder='Search'),
                                dbc.FormText(id='word-search-matches', color='secondary'),
                                html.Div([
                                    dbc.ListGroup(id='word-search-results', className='pt-3')
                                ], className='overflow-auto', style={
                                    'max-height': '50vh',
                                    'height': '100%'
                                })
                            ], className='mt-3')
                        ], label='Search'),
                        dbc.Tab(
                            id='selected-word-tab',
                            tab_id='selected-word-tab',
                            label='Selection',
                            disabled=True
                        ),
                    ], id='analysis-tabs', active_tab='search-tab')
                ]),
            ]), width=2)
        ])
    ])
Ejemplo n.º 4
0
def get_cote_layout():
    return html.Div(className='main', children=[
        dcc.Location(id='url-cotes', refresh=False),  # Pour intercepter un appel à la page
        html.P(children=html.A(href="/", children=lang['back_to_main'])),
        html.H1(children=lang['title_cotes']),
        dcc.Tabs(
            id='main-tabs',
            value='tab-viz6',
            className='main-tabs',
            parent_className='parent-main-tabs',
            colors={
                'border': 'brown',  # Couleur des bordures des onglets
                'primary': 'brown',  # Couleur de ligne au-dessus de l'onglet sélectionné
                'background': '#EFE0E0'  # Couleur de fond des onglets non sélectionnés
            },
            children = [
                dcc.Tab(
                    id='tab-viz0',
                    value='tab-viz0',
                    label=lang['viz0'],
                    className='tab',
                    selected_className='selected-tab',
                    children=[html.Div(
                        id='div_tab_viz0',
                        className='div-tab',
                        children=[dcc.Markdown(lang['info']), html.Br()]
                    )]
                ),
                dcc.Tab(
                    id='tab-viz4',
                    value='tab-viz4',
                    label=lang['viz4'],
                    className='tab',
                    selected_className='selected-tab',
                    children=[html.Div(
                        id='div_tab_viz4',
                        className='div-tab',
                        children=[
                            html.H3(lang['title_viz4']),
                            html.Table(className='table-center', children=[html.Tbody([
                                html.Tr(children=[
                                    html.Td(children=html.H6(lang['choose_action'])),
                                    html.Td(children=[dcc.Dropdown(
                                        id='viz4_choice_action',
                                        className='viz-dropdown-large',
                                        multi=False,
                                        options=[
                                            {'label': lang['title_viz1'], 'value': 'viz1'},
                                            {'label': lang['title_viz2'], 'value': 'viz2'},
                                            {'label': lang['title_viz3'], 'value': 'viz3'},
                                            {'label': lang['title_viz3a'], 'value': 'viz3a'}
                                        ],
                                        value='viz1'
                                    )])
                                ]),
                                html.Tr(id='tr_viz1', children=[
                                    html.Td(children=html.H6(lang['choose_wine_alea'])),
                                    html.Td(children=[dcc.Dropdown(
                                        id='viz1_choice',
                                        className='viz-dropdown-large',
                                        multi=False,
                                    )])
                                ]),
                                html.Tr(id='tr_viz2', children=[
                                    html.Td(children=html.H6(lang['choose_appellation'])),
                                    html.Td(children=[dcc.Dropdown(
                                        id='viz2_choice',
                                        className='viz-dropdown-large',
                                        multi=False,
                                        options=(options := [{'label': app, 'value': app} for app in DF_viz2_choice['appellation'].tolist()]),
                                        value=options[0]['value']
                                    )])
                                ]),
                                html.Tr(id='tr_viz3', children=[
                                    html.Td(children=html.H6(lang['choose_appellation'])),
                                    html.Td(children=[dcc.Dropdown(
                                        id='viz3_choice',
                                        className='viz-dropdown-large',
                                        multi=False,
                                        options=(options := [{'label': app, 'value': app} for app in DF_viz3_choice['appellation'].tolist()]),
                                        value=options[0]['value']
                                    )])
                                ]),
                                html.Tr(id='tr_viz3a', children=[
                                    html.Td(children=html.H6(lang['choose_wine'])),
                                    html.Td(children=[dcc.Dropdown(
                                        id='viz3a_choice',
                                        className='viz-dropdown-large',
                                        multi=False,
                                        options = (options := [{'label': label, 'value': value} for (value, label) in zip(
                                            DF_viz3a_choice['index'],
                                            DF_viz3a_choice.apply(lambda S:
                                                S['domaine'] + " : " + S['nom_du_vin'] + " " + str(int(S['millesime'])) + " (" \
                                                    + S['appellation'] + ", " + S['couleur'] + ")",
                                                axis=1
                                            )
                                        )]),
                                        value = options[0]['value']
                                    )])
                                ])
                            ])]),
                            html.Div(id='viz4_result', className='viz-result')
                        ]
                    )]
                ),
                get_prediction_tab('viz5'),
                get_prediction_tab('viz6', with_tf=True)
            ]
        )
    ])
Ejemplo n.º 5
0
 html.Div(
     [
         html.H4('Select Company Stock',
                 style={
                     'textAlign': 'left',
                     'color': colors['text']
                 }),
         dcc.Dropdown(
             id='my-tickers',
             options=[{
                 'label': 'MSFT',
                 'value': 'MSFT'
             }, {
                 'label': 'BABA',
                 'value': 'BABA'
             }, {
                 'label': 'SPY',
                 'value': 'SPY'
             }, {
                 'label': 'Coke',
                 'value': 'COKE'
             }],
             value='MSFT',
         )
     ],
     style={
         'width': '100%',
         'display': 'flex',
         'align-items': 'center',
         'justify-content': 'center'
     }),
Ejemplo n.º 6
0
}

app.layout = html.Div([
    html.H1(children='Release Deployment History',
            style={
                'textAlign': 'center',
                'color': colors['text']
            }),
    #html.H1(children='Release Deployment History', style={'textAlign': 'center','color': colors['text'],'backgroundColor':colors['background']}),
    html.Div([
        html.Div('Application Name', className='app_name'),
        html.Div(
            dcc.Dropdown(
                id='application-dropdown',
                options=[{
                    'label': k,
                    'value': k
                } for k in all_options.keys()],
            ))
    ]),
    html.Br(),
    html.Div([
        html.Div('Environment', className='app_name'),
        html.Div(dcc.Dropdown(id='environments-dropdown'))
    ]),
    #html.Br(),
    #html.Label('CRQ Number'),
    #dcc.Input(id='crq-number', value='', type='text'),
    html.Br(),
    html.Br(),
    html.Div(id='display-selected-values')
Ejemplo n.º 7
0
    ],
             id="imgdiv")
],
                  id="titlediv")

datadiv = html.Div(
    [
        # Links
        html.Div(
            [
                ### Kanal 1
                dcc.Dropdown(id='channel1',
                             options=[{
                                 'label': i,
                                 'value': i
                             } for i in sorted(CHANNELS)],
                             multi=True,
                             value=default_shop,
                             placeholder="Kanal auswählen",
                             clearable=True,
                             className='dropdown'),
                ### KPI 1
                dcc.Dropdown(
                    id='metric1',
                    options=[{
                        'label': i,
                        'value': i
                    } for i in sorted(METRICS)],
                    multi=False,
                    value=default_metric,
                    placeholder="KPI 1 auswählen (Default: Nettoumsatz)",
                    className='dropdown',
Ejemplo n.º 8
0
                     'float': 'right',
                     'display': 'inline-block'
                 }),

        # Space between text and dropdown
        html.H1(id='space', children=' '),

        # Dropdown
        html.Div([
            dcc.Dropdown(options=[{
                'label': 'El Pais English',
                'value': 'EPE'
            }, {
                'label': 'The Guardian',
                'value': 'THG'
            }, {
                'label': 'The Mirror',
                'value': 'TMI'
            }],
                         value=['EPE', 'THG'],
                         multi=True,
                         id='checklist')
        ],
                 style={
                     'width': '40%',
                     'display': 'inline-block',
                     'float': 'left'
                 }),

        # Button
        html.Div([html.Button('Submit', id='submit', type='submit')],
 html.Div([
     dcc.Markdown('###### Wind Speed'),
     dcc.Slider(id='wind_speed',
                min=0,
                max=30,
                step=5,
                value=10,
                marks={n: str(n)
                       for n in range(0, 31, 5)}),
 ],
          style=style),
 html.Div([
     dcc.Markdown('###### Batter'),
     dcc.Dropdown(id='batter',
                  options=[{
                      'label': batter,
                      'value': batter
                  } for batter in batters],
                  value=batters[0]),
 ],
          style=style),
 html.Div([
     dcc.Markdown('###### Pitcher'),
     dcc.Dropdown(id='pitcher',
                  options=[{
                      'label': pitcher,
                      'value': pitcher
                  } for pitcher in pitchers],
                  value=pitchers[0]),
 ],
          style=style),
 html.Div([
 def layout(self):
     return html.Div([
         html.Div(
             [
                 dcc.Dropdown(
                     id=self.dropwdown_vector_id,
                     clearable=False,
                     options=[{
                         "label": i,
                         "value": i
                     } for i in self.vctr_cols_no_hist],
                     value=self.vctr_cols_no_hist[0],
                 ),
                 html.Div([
                     dcc.Checklist(
                         id=self.chlst,
                         options=[{
                             "label": "Delta time series",
                             "value": "show_delta_series",
                         }],
                         labelStyle={"display": "inline-block"},
                         value=[],
                     ),
                     html.Div(
                         id=self.show_ens_selectors,
                         children=[
                             dcc.Dropdown(
                                 id=self.dropdown_iorens_id,
                                 placeholder="Base case",
                                 options=[{
                                     "label": i,
                                     "value": i
                                 } for i in self.base_ensembles],
                             ),
                             dcc.Dropdown(
                                 id=self.dropdown_refens_id,
                                 placeholder="Select ensembles",
                                 options=[{
                                     "label": i,
                                     "value": i
                                 } for i in self.delta_ensembles],
                                 multi=True,
                             ),
                         ],
                         style={"display": "none"},
                     ),
                 ]),
             ],
             style={
                 "width": "20%",
                 "float": "left"
             },
         ),
         html.Div(
             [
                 dcc.Tabs(
                     id=self.tab_id,
                     value="summary_data",
                     children=[
                         dcc.Tab(label="Realizations",
                                 value="summary_data"),
                         dcc.Tab(label="Statistics", value="summary_stats"),
                     ],
                 ),
                 html.Div(id="tabs-content"),
                 html.Div(id=self.chart_id),
             ],
             style={
                 "width": "80%",
                 "float": "right"
             },
         ),
     ])
Ejemplo n.º 11
0
                        'width': '5%'
                       }
                ),
    
        ## dropdown lists for selecting projections
        html.Div([
            html.Div('Select projections:',
                     style={'display': 'block'
                            }
                     ),
            
            dcc.Dropdown(
                id='species_dropdown',
                placeholder='select species',
                multi=True,
                style={'display': 'block',
                       'height': '34px',
                       'width': '100%',
                       'marginBottom': '5px',
                       'borderWidth': '1px'}
                        ),

            dcc.Dropdown(
                id='orb_dropdown',
                placeholder='select orbital',
                multi=True,
                style={'display': 'block',
                       'height': '34px',
                       'width': '100%',
                       'marginBottom': '5px',
                       'borderWidth': '1px'}
                        ),
Ejemplo n.º 12
0
respaldo = pd.read_csv('respaldo.csv')
df = lista_g.copy()

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

available_indicators = lista_g['dependencia_clean']

app.layout = html.Div([
    html.Div(
        [
            html.Div([
                dcc.Dropdown(id='dep',
                             options=[{
                                 'label': i,
                                 'value': i
                             } for i in available_indicators],
                             value='cfe'),
                dcc.Checklist(id='activaciones',
                              options=[{
                                  'label': 'Usar Dependencia',
                                  'value': 'uso_dep'
                              }, {
                                  'label': 'Usar Top',
                                  'value': 'uso_top'
                              }],
                              value=[]),
                html.Div(dcc.Slider(
                    id='year--slider',
                    min=df['año_dependencia'].min(),
                    max=df['año_dependencia'].max(),

    html.H1('SIR Model (Susceptible, Infectious, and Recovered)', style={'text-align': 'center',
                                                                        'padding': 10,
                                                                        'background-color': '#f0f0f5',}),
    
    dcc.Markdown(''' The below graphs shows the future trend of the spread of COVID-19(dotted line) using the SIR model.''', style={'text-align': 'center',
                                                                        'padding': 10,
                                                                        'background-color': '#f0f0f5',}),
    
     dcc.Markdown('''__Select Country for visualization__ '''),


    dcc.Dropdown(
        id = 'country_drop_down',
        options=[ {'label': each,'value':each} for each in df_analyse['country'].unique()],
        value= 'India', # which are pre-selected
        multi=False),

    dcc.Graph(figure = fig, id = 'SIR_graph')
    ])

@app.callback(
    Output('SIR_graph', 'figure'),
    [Input('country_drop_down', 'value')])

def update_SIR_figure(country_drop_down):

    traces = []

    df_plot = df_analyse[df_analyse['country'] == country_drop_down]
Ejemplo n.º 14
0
 html.Div([
     html.H1('SPYN-Starter'),
     dcc.Markdown(
         children='## `EDDP Web Application Demo using PYNQ`')
 ],
          style={
              'text-align': 'left',
              'padding': '10px 0px 0px 0px'
          }),
 html.Div([
     dcc.Markdown(children='### `Set Mode`'),
     dcc.Dropdown(id='modes-dropdown',
                  options=[{
                      'label': 'Speed',
                      'value': 'Speed'
                  }, {
                      'label': 'Current',
                      'value': 'Current'
                  }],
                  value='Speed'),
     dcc.Markdown(children='### `Set Decimation`'),
     dcc.Dropdown(id='decimate-dropdown',
                  options=[
                      {
                          'label': 'no decimation',
                          'value': '0'
                      },
                      {
                          'label': '1',
                          'value': '1'
                      },
Ejemplo n.º 15
0
stock_header_dict = {}
start = (date.today() - relativedelta(months=6))
end = date.today()

#### CSS Styling that we can change to have better white space etc
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.config.supress_callback_exceptions = True

#### Layout which holds everything

app.layout = html.Div([
    html.H1('Stock Search'),
    dcc.Dropdown(id='stock-dropdown',
                 placeholder='Pick Stocks From Here...',
                 searchable=True,
                 options=search_dict),
    html.Div(id='stock-search-results'),
    html.Br(),
    html.H4(id='header-1', style={'color': '#0189aa'}),
    html.H6(id='header-2'),
    html.H6(id='header-3'),
    html.H6(id='header-4'),
    html.H6(id='header-5'),
    html.H6(id='header-6'),
    html.H6(id='header-7'),
    dcc.Graph(id='candlestick-main')
],
                      style={'height': '100vh'})

Ejemplo n.º 16
0
 dcc.Tabs(id="tabs-styled-with-inline",
          value='scraper',
          children=[
              dcc.Tab(label='Scraper',
                      value='scraper',
                      style=tab_style,
                      selected_style=tab_selected_style,
                      children=[
                          html.Div([
                              dcc.Dropdown(
                                  id='platform-input',
                                  options=[{
                                      'label': 'Amazon',
                                      'value': 'amazon'
                                  }, {
                                      'label': 'Facebook',
                                      'value': 'facebook'
                                  }, {
                                      'label': 'Twitter',
                                      'value': 'twitter'
                                  }],
                                  value='amazon',
                                  style={'color': colors['text']}),
                              html.Button('Submit', id='button'),
                              html.Div(id='platform-output',
                                       style={'color': colors['text']})
                          ])
                      ]),
              dcc.Tab(label='Preprocessing',
                      value='preprocessing',
                      style=tab_style,
                      selected_style=tab_selected_style),
Ejemplo n.º 17
0
 # Div containing everything matrix
 html.Div(
     [
         # Details on matrix goes here
         html.Div([
             html.P([
                 'Generate a ',
                 html.A(['matrix'],
                        href='https://en.wikipedia.org/wiki/Matrix'),
             ]),
         ]),
         html.Div([
             html.Div([
                 html.Label('Row: '),
                 dcc.Dropdown(
                     options=dropdown_options,
                     id='row_dropdown',
                 ),
                 html.Label('Column: '),
                 dcc.Dropdown(
                     options=dropdown_options,
                     id='column_dropdown',
                 ),
                 # When dealing with matrices of different sizes will need something like this
                 # dcc.RadioItems(
                 #     options=[
                 #         {'label': 'Two matrices of same size', 'value': 'two_matrices'},
                 #     ],
                 #     value='two_matrices',
                 #     id="two_matrices_checklist"
                 # ),
                 html.Button(id='generate_matrix_submit_button',
Ejemplo n.º 18
0
 dcc.Dropdown(id='select-industry',
              options=[
                  {
                      'label': 'All',
                      'value': 'all'
                  },
                  {
                      'label': 'Farms',
                      'value': 'farms'
                  },
                  {
                      'label': 'Oil and Gas',
                      'value': 'oil_and_gas'
                  },
                  {
                      'label': 'Utilities',
                      'value': 'utilities'
                  },
                  {
                      'label': 'Construction',
                      'value': 'construction'
                  },
                  {
                      'label': 'Manufacturing',
                      'value': 'manufacturing'
                  },
                  {
                      'label': 'Wholesale Trade',
                      'value': 'wholesale_trade'
                  },
                  {
                      'label': 'Retail Trade',
                      'value': 'retail_trade'
                  },
                  {
                      'label': 'Air Transportation',
                      'value': 'air_transportation'
                  },
                  {
                      'label': 'Real Estate',
                      'value': 'real_estate'
                  },
              ],
              value='all'),
Ejemplo n.º 19
0
     'layout': {
         'title':
         'Comparing 2020 Season Average Rebounds, Points & Assist Between Player 1 and Player 2 ',
         'xlabel': 'Date',
         'ylabel': ' Average Rebounds'
     }
 },
           id="graph1"),
 html.H5("Introduction : "),
 html.
 P("The National Collegiate Athletic Association (NCAA) Women Division 1 Basketball Tournament has 64 teams. This dashboard is comparing players within a team. The graph is comparing three scores of two players. The table summarizes the scores for these two players.",
   style={'width': '50%'}),
 html.Div([
     html.H5("Select Player 1: "),
     dcc.Dropdown(options=name_dict,
                  id='my-dropdown1',
                  value='Helene Haegerstrand',
                  style={'width': '64%'})
 ]),
 html.Div([
     html.H5("Select Player 2: "),
     dcc.Dropdown(options=name_dict,
                  id='my-dropdown2',
                  value='Lucia Decortes',
                  style={'width': '64%'})
 ]),
 html.Div(id="table_div", style={'width': '70%'}),
 html.H5("Reference: "),
 html.P('https://sports.yahoo.com/ncaaw/teams/albany/roster',
        style={'width': '45%'}),
 html.H5("Submitted by: "),
 html.P('Adwoa Osei-Yeboah', style={'width': '45%'})
Ejemplo n.º 20
0
 dbc.Row([
     dbc.Col(html.P("Set Color-Scheme"), width=6),
     dbc.Col(html.P(""), width=6)
 ]),
 dbc.Row([
     dbc.Col(
         dcc.Dropdown(options=[{
             'label': 'RdBu',
             'value': 'RdBu'
         }, {
             'label': 'Picnic',
             'value': 'Picnic'
         }, {
             'label': 'Rainbow',
             'value': 'Rainbow'
         }, {
             'label': 'Hot',
             'value': 'Hot'
         }, {
             'label': 'Earth',
             'value': 'Earth'
         }],
                      value='Earth',
                      id='style-dropdown',
                      style={"width": "120px"})),
     dbc.Col(dbc.Button("Submit",
                        id="submit-button",
                        color="primary",
                        className="mr-1"),
             width=6)
 ])
Ejemplo n.º 21
0
                        - Dictations are analyzed by IBM Watson Natural Language Understanding. 
                        - Output variables: keywords, entities, concepts and categories.
                        - Variable sets are clustered, using NMF Non-zero Matrix Factorization
                        - Dictations and variables are mapped onto the clusters
                        ''',
                    className = 'nine columns')
        ], className = "row"),

        html.Div(
            [
                html.Div(
                    [
                        html.Label('#Archetypes', style={'font-weight' : 'bold'}),
                        dcc.Dropdown(
                            id = 'NoA',
                            options=[{'label':k,'value':k} for k in range(2,12)],
                            value = 6,
                            multi = False
                        ) 
                    ],
                    className = 'one columns offset-by-one',
                    style={'margin-top': '30'}
                ),
                html.Div(
                    [
                        html.Label('Variables', style={'font-weight' : 'bold'}),
                        dcc.RadioItems(
                            id = 'Var',
                            options=[
                                {'label': 'Keywords'  ,'value': 'keywords'},
                                {'label': 'Entities'  ,'value': 'entities'},
                                {'label': 'Concepts'  ,'value': 'concepts'},
Ejemplo n.º 22
0
        center={"lat": 4.655115, "lon": -74.055404}, #Center

        color_continuous_scale="matter",         #Color Scheme
        opacity=0.5,
        title='Total crimes in Colombia by Department'
        )

Map_fig.update_layout(title='Total de Crímenes por Departamento',paper_bgcolor="#F8F9F9")

values={'Robbery and theft':'robbery','Domestic violence':'dom_viol','Sex offenses':'sex_off'}

#Now we create the dropdown for crimes
dropdown=dcc.Dropdown(
        id="crime_dropdown",
        options=[{"label":key, "value":values[key]} for key in values.keys()],
        value=["sex_off",'robbery'],
        placeholder="Select a crime",
        multi=True
        )
#Now the dropdown for years
ys = [year for year in dff.year.unique()]
dropdown2=dcc.Dropdown(
        id="year_dropdown",
        options=[{"label":year, "value":year} for year in ys],
        value=2018,
        placeholder="Select a year",
        multi=False
        )


Ejemplo n.º 23
0
def get_prediction_tab(vizname, with_tf=True):
    options = [{'label': lang['xgboost'], 'value': 'xg'}]
    if with_tf:
        options = options + [{'label': lang['tensorflow'], 'value': 'tf'}]

    return dcc.Tab(
        id='tab-' + vizname,
        value='tab-' + vizname,
        label=lang[vizname],
        className='tab',
        selected_className='selected-tab',
        children=[
            html.Div(
                id='div_tab_' + vizname,
                className='div-tab',
                children=[
                    html.H3(lang['title_' + vizname]),
                    html.P(lang[vizname + '_desc']),
                    html.Table(
                        className='table-center',
                        children=[
                            html.Tbody([
                                html.Tr(children=[
                                    html.Td(children=html.H6(
                                        lang['choose_model'])),
                                    html.Td(children=[
                                        dcc.Dropdown(
                                            id=vizname +
                                            '_choice_model',
                                            className='viz-dropdown-large',
                                            multi=False,
                                            options=options,
                                            value='xg')
                                    ])
                                ]),
                                html.Tr(children=[
                                    html.Td(children=html.H6(
                                        lang['choose_action'])),
                                    html.Td(children=[
                                        dcc.Dropdown(
                                            id=vizname +
                                            '_choice_action',
                                            className='viz-dropdown-large',
                                            multi=False,
                                            options=[{
                                                'label': lang['see_pred'],
                                                'value': 'viz'
                                            }, {
                                                'label':
                                                lang['get_reco_test'],
                                                'value':
                                                'reco'
                                            }],
                                            value='reco')
                                    ])
                                ]),
                                html.Tr(
                                    id=vizname + '_tr_choose_number',
                                    children=[
                                        html.Td(children=html.H6(
                                            lang['choose_number'])),
                                        html.Td(children=[
                                            dcc.Dropdown(
                                                id=vizname +
                                                '_choice_nbwines',
                                                className='viz-dropdown-small',
                                                multi=False,
                                                options=[{
                                                    'label': n,
                                                    'value': n
                                                }
                                                         for n in np.arange(
                                                             5, 55, 5)],
                                                value=20)
                                        ])
                                    ]),
                                html.Tr(
                                    id=vizname + '_tr_choose_wine',
                                    children=[
                                        html.Td(children=html.H6(
                                            lang['choose_wine_alea'])),
                                        html.Td(children=[
                                            dcc.Dropdown(
                                                id=vizname +
                                                '_choice_wine',
                                                className='viz-dropdown-large',
                                                multi=False)
                                        ])
                                    ])
                            ])
                        ]),
                    html.Div(id=vizname + '_result', className='viz-result')
                ])
        ])
Ejemplo n.º 24
0
    'value': 'panPan2',
    'label': 'Bonobo (MPI-EVA panpan1.1/panPan2)'
}, {
    'value': 'canFam3',
    'label': 'Dog (Broad CanFam3.1/canFam3)'
}, {
    'value': 'ce11',
    'label': 'C. elegans (ce11)'
}]

app.layout = html.Div([
    dcc.Loading(id='igv-container'),
    html.Hr(),
    html.P('Select the genome to display below.'),
    dcc.Dropdown(id='igv-genome-select',
                 options=HOSTED_GENOME_DICT,
                 value='ce11')
])


# Return the IGV component with the selected genome.
@app.callback(Output('igv-container', 'children'),
              Input('igv-genome-select', 'value'))
def return_igv(genome):
    return (html.Div(
        [dashbio.Igv(
            id='default-igv',
            genome=genome,
            minimumBases=100,
        )]))
Ejemplo n.º 25
0
with urlopen('https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json') as response:
    counties = json.load(response)


########### Initiate the app
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
server = app.server
app.title='VA 2016'

####### Layout of the app ########
app.layout = html.Div([
    html.H3('2016 Presidential Election: Vote Totals by Jurisdiction'),
    dcc.Dropdown(
        id='dropdown',
        options=[{'label': i, 'value': i} for i in options_list],
        value=options_list[10]
    ),
    html.Br(),
    dcc.Graph(id='display-map'),
    dcc.Graph(id='display-value'),
    html.Br(),
    html.A('Code on Github', href='https://github.com/austinlasseter/virginia_election_2016'),
    html.Br(),
    html.A('Data Source', href='https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/LYWX3D')
])


######### Callback #1 #########
@app.callback(dash.dependencies.Output('display-value', 'figure'),
              [dash.dependencies.Input('dropdown', 'value')])
app = dash.Dash()

nsdq = pd.read_csv('../data/NASDAQcompanylist.csv')
nsdq.set_index('Symbol', inplace=True)
options = []
for tic in nsdq.index:
    options.append({
        'label': '{} {}'.format(tic, nsdq.loc[tic]['Name']),
        'value': tic
    })

app.layout = html.Div([
    html.H1('Stock Ticker Dashboard'),
    html.Div([
        html.H3('Select stock symbols:', style={'paddingRight': '30px'}),
        dcc.Dropdown(
            id='my_ticker_symbol', options=options, value=['TSLA'], multi=True)
    ],
             style={
                 'display': 'inline-block',
                 'verticalAlign': 'top',
                 'width': '30%'
             }),
    html.Div([
        html.H3('Select start and end dates:'),
        dcc.DatePickerRange(id='my_date_picker',
                            min_date_allowed=datetime(2015, 1, 1),
                            max_date_allowed=datetime.today(),
                            start_date=datetime(2018, 1, 1),
                            end_date=datetime.today())
    ],
             style={'display': 'inline-block'}),
Ejemplo n.º 27
0
                        start_date=dash_visits['dt'].min(),
                        end_date=dash_visits['dt'].max(),
                        display_format='YYYY-MM-DD',
                        id='dt_selector',
                    ),
                    html.Br(),
                    html.Br(),

                    # фильтр возраста
                    html.Label('Выбор возрастной категории'),

                    # составляем список
                    dcc.Dropdown(options=[{
                        'label': x,
                        'value': x
                    } for x in dash_visits['age_segment'].unique()],
                                 value=dash_visits['age_segment'].unique(),
                                 multi=True,
                                 id='age-dropdown'),
                ],
                className='six columns'),  # конец левого блока

            # блок с пикером тем (правый блок)
            html.Div(
                [

                    # фильтр тем
                    html.Label('Выбор темы карточек'),

                    # составляем список
                    dcc.Dropdown(options=[{
Ejemplo n.º 28
0
     }),
 html.H2(children='Graph 1',
         style={
             'font-family': 'Arial, Helvetica, sans-serif',
             'text-align': 'center'
         }),
 html.Div([
     html.P(children='Select the first indicator:',
            style={
                'font-size': 15,
                'font-family': 'Arial, Helvetica, sans-serif'
            }),
     dcc.Dropdown(
         id='xaxis-column',
         options=[{
             'label': i,
             'value': i
         } for i in available_indicators],
         value=available_indicators[0],
     )
 ],
          style={
              'width': '48%',
              'display': 'inline-block',
              'height': '130px'
          }),
 html.Div([
     html.P(children='Select the second indicator:',
            style={
                'font-size': 15,
                'font-family': 'Arial, Helvetica, sans-serif'
            }),
Ejemplo n.º 29
0
FILTERS = {
    c.dash.INPUT_SMOOTHING: (
        "Smoothing:",
        dbc.Input(id="input_smoothing",
                  type="number",
                  value=c.dash.DEFAULT_SMOOTHING),
    ),
    c.dash.INPUT_TIMEWINDOW: (
        "Grouping:",
        dcc.Dropdown(
            id="input_timewindow",
            value="M",
            options=[{
                "label": "Month ",
                "value": "M"
            }, {
                "label": "Year ",
                "value": "Y"
            }],
        ),
    ),
    c.dash.INPUT_CATEGORIES: (
        "Categories:",
        dcc.Dropdown(id="input_categories",
                     multi=True,
                     options=get_options(DF[c.cols.CATEGORY].unique())),
    ),
}

Ejemplo n.º 30
0
import dash_core_components as dcc
import dash_html_components as html

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div([
    html.Div([
        html.Label('Dropdown'),
        dcc.Dropdown(options=[{
            'label': 'New York City',
            'value': 'NYC'
        }, {
            'label': u'Montréal',
            'value': 'MTL'
        }, {
            'label': 'San Francisco',
            'value': 'SF'
        }],
                     value='SF'),
        html.Label('Multi-Select Dropdown'),
        dcc.Dropdown(options=[{
            'label': 'New York City',
            'value': 'NYC'
        }, {
            'label': u'Montréal',
            'value': 'MTL'
        }, {
            'label': 'San Francisco',
            'value': 'SF'