Created
September 23, 2020 19:49
-
-
Save prrao87/702afe030dbadff4efab7b2383e4c584 to your computer and use it in GitHub Desktop.
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
| # ========== 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