import dash
from dash.dependencies import Input, Output
import dash_html_components as html
import dash_core_components as dcc
import plotly.plotly as py

fig = py.get_figure('https://plot.ly/~chris/1691/trace-0/')
fig['data'][0]['type'] = 'scattergl'

app = dash.Dash(
    __name__,
    filename='my-dash-app',
    sharing='private',
    app_url='http://localhost:9595'
)
app.layout = html.Div([
    dcc.Dropdown(
        id='d',
        options=[{'label': i, 'value': i} for i in ['nyc', 'mtl', 'sf']],
        value='nyc'
    ),
    html.Div('test-div', id='c'),
    dcc.Graph(id='graph', figure=fig)
])


@app.callback(Output('c', 'content'), [Input('d', 'value')])
def display_value(value):
    return 'You have selected {}'.format(value)


app.scripts.config.serve_locally = True

if __name__ == '__main__':
    app.run_server(debug=True, port=9595)
