I’m looking to pass some values I have from a callback into a page in python. Unfortunately in my case “feds” is not defined from the callback. Do I need to make a class in order for this to work properly? I’ve pasted the two snippets of that portion of code. Below is the page itself, that should use feds to make a table.
updatesDats = html.Div([
html.Div([
get_logo(),
get_header(),
html.Br([]),
get_menu(),
html.H6('Update News/HSR here',
className = 'gs-header gs-text-header padded'),
html.Div([
html.Div(dcc.Input(id='input-box', type='text')),
html.Button('Submit', id='button'),
html.Div(id='output-container-button',
children='Enter a value and press submit'),
html.Table(make_dash_table(feds), style={'width':800, 'overflowX': 'wordwrap', 'height': 600, 'overflowY': 'scroll', 'display':'inline-block'}),
], className ="twelve columns")
], className ="row")
], className ="page")
This is the def, that has a callback which returns values from a button. (IE user inputs “NXPI” and then on button press the input is stored as value, which I pass in here.
def bloomberg_values(value):
sid = value
events = ['TRADE', 'AT_TRADE']
dte = pd.tseries.offsets.BDay(-1).apply(pd.datetime.now())
start = pd.datetime.combine(dte, datetime.time(13, 30))
end = pd.datetime.combine(dte, datetime.time(13, 35))
feds = LocalTerminal.get_intraday_tick(sid, events, start, end, include_condition_codes=True).as_frame()
return feds