What is wrong with my code?
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input,Output
import plotly.graph_objs as go
import pandas as pd
app = dash.Dash()
Keywords = [ “BR” , “Pier”, “Area”, " N61", “Airtran”, “Footing”, “BackFill”, " Span", “N62”, “Deck”, " Pile", “N62”, “N63”, “F/R/P”, “Excavate”, “Cap”]
app.layout = html.Div([
html.H1(‘Project Schedule Dashboard’),
html.H3(‘Enter a Keyword:’),
dcc.Input(id=‘my_stock_ticker’,value=‘Please enter a keyword’ ),
dcc.Graph(id = ‘graph’),
dcc.Dropdown(id = ‘picker’, options = Keywords, value = “Pile”)
])
Keywords = [ “BR” , “Pier”, “Area”, " N61", “Airtran”, “Footing”, “BackFill”, " Span", “N62”, “Deck”, " Pile", “N62”, “N63”, “F/R/P”, “Excavate”, “Cap”]
options = []
for Keyword in Keywords:
options.append({‘label’:str(Keyword),‘value’:Keyword})
app.layout = html.Div([dcc.Dropdown(id=‘my-dropdown’,options=Keyword, value=Keywords),html.Div(id=‘output-container’)])
@app.callback(
dash.dependencies.Output(‘output-container’, ‘children’),
[dash.dependencies.Input(‘my-dropdown’, ‘value’)])
def get_for_activity(select_text):
return df[df[‘Activity Name’].str.contains(select_text)]
df_year = get_for_activity('select_text')
for Activity_Type in df_year['Activity Type'].unique():
df_at= df_year.loc[df_year['Activity Type'] == 'Finish Milestone']
Current_Finish = go.Scatter(x = df_year['Activity Name'],y = df_year['Finish'],mode = 'lines', name = 'Current Finish')
BaseLine_Finish = go.Scatter(x = df_year['Activity Name'],y = df_year['BL1 Finish'],mode = 'lines',name = 'BL1 Finish')
Milestones = go.Scatter(x = df_at['Activity Name'],y = df_at['Primary Constraint Date'],mode = 'markers',name = 'Planned Milestones')
Milestones_CF = go.Scatter(x = df_at['Activity Name'],y = df_at['Finish'],mode = 'markers',name = 'Milestones_CF')
return {'data':[Current_Finish, BaseLine_Finish,Milestones, Milestones_CF],
'layout':go.Layout(title = 'Project Level Analysis')}
if name == ‘main’:
app.run_server()
Graph is blank