I have a DataFrame in pandas called interesttable, which is getting updated with time (seconds). I am using Dash plotly to display the dataframe. Although i successfully display the dataframe in Dash, I cannot update the Dash with the new rows added in the dataframe. I try the following but it doesn't work. Thank you for your feedback!
def generate_table():
return html.Table(
# Header
[html.Tr([html.Th(col) for col in interesttable.columns])] +
# Body
[html.Tr([html.Td(interesttable.iloc[i][col]) for col in interesttable.columns])
for i in range(min(len(interesttable), 50))]
)
app = dash.Dash()
app.layout = html.Div(children=[
html.H1(children='Interest Table'),
dcc.Interval(id='generate_table()',interval=1*1000),
generate_table()
])
app.callback(Output('generate_table()','children'), [Input('interesttable', 'n_intervals')])
if __name__ == '__main__':
app.run_server(debug=True)
Unfortunatelly the error I receive is:
Here is a list of the available properties in "generate_table()":
['id','interval','disabled','n_intervals','max_intervals']