Skip to content

Instantly share code, notes, and snippets.

@prrao87
Created September 23, 2020 19:49
Show Gist options
  • Save prrao87/702afe030dbadff4efab7b2383e4c584 to your computer and use it in GitHub Desktop.
Save prrao87/702afe030dbadff4efab7b2383e4c584 to your computer and use it in GitHub Desktop.
# ========== Callbacks ================
@app.callback(Output('line-chart-1', 'figure'),
[Input('dropdown-1', 'value')])
def update_graph(selected_dropdown_value):
dff = filter_df(selected_dropdown_value)
return {
'data': [{
'x': dff.Date,
'y': dff.QuoteCount,
'line': {
'width': 3,
}
}],
}
}
# ========== Functions ================
def filter_df(df, names):
dff = df[df['Date'] == selected_dropdown_value]
# Perform more complex actions here
# .
# .
return dff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment