Created
April 30, 2018 18:19
-
-
Save dcbark01/718ad7a3d7d4bca990ca08441385cae1 to your computer and use it in GitHub Desktop.
heroku_test_app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import dash | |
import dash_core_components as dcc | |
import dash_html_components as html | |
app = dash.Dash(__name__) | |
server = app.server | |
app.layout = html.Div([ | |
html.H2('Hello World'), | |
dcc.Dropdown( | |
id='dropdown', | |
options=[{'label': i, 'value': i} for i in ['LA', 'NYC', 'MTL']], | |
value='LA' | |
), | |
html.Div(id='display-value') | |
]) | |
app.css.append_css({"external_url": "https://codepen.io/chriddyp/pen/bWLwgP.css"}) | |
@app.callback(dash.dependencies.Output('display-value', 'children'), [dash.dependencies.Input('dropdown', 'value')]) | |
def display_value(value): | |
return 'You have selected "{}"'.format(value) | |
if __name__ == '__main__': | |
app.run_server(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment