i want to update the value of userlist after few intervals. i am unable to provide multiple callback in single output at a time . so if i am writing
@app.callback(dash.dependencies.Output('hateUser', 'children'),
[dash.dependencies.Input('url1', 'pathname'),Input('interval-component', 'n_intervals')])
def display_page(pathname,n):
.....
such type of code than no update is shown on the screen…
it is getting stuck in updating…
app = dash.Dash(
__name__,
meta_tags=[{"name": "viewport", "content": "width=device-width, initial-scale=1"}],
)
server = app.server
app.config["suppress_callback_exceptions"] = True
@app.callback(Output('container-button-timestamp', 'children'),
[Input('interval-component', 'n_intervals')])
def update_graph_live(n):
for trend in trends[0]["trends"]:
if(count < 5):
if(count==0):
topTrend1 = trend["name"]
count=count+1
return [html.Table(className='table table-hover',children=[
html.Tbody(id='live-update-text',children=[
dcc.Location(id='url1', refresh=False),
html.Tr(children=[
html.Td('1'),
dcc.Link(html.Td(topTrend1),id='topic1',href='model1'),
FetchTopUser()
]),
html.Tr(children=[
html.Td('2'),
dcc.Link(html.Td(topTrend2),id='topic2',href='model2'),
#chart()
FetchTopUser()
]),
]),
html.Br(),
])]
@app.callback(dash.dependencies.Output('hateUser', 'children'),
[dash.dependencies.Input('url1', 'pathname')])
def display_page(pathname):
if pathname == '/model1':
track = topTrend1
return [
html.Table(className='table table-hover',children=[
html.Tbody(children=[
html.Tr(children=[
html.Td('1'),
html.Td(user_list[0])
]),
html.Tr(children=[
html.Td('2'),
html.Td(user_list[1])
]),
]),
])]
def forRefresh():
return html.Div( className="wrapper", children=[
]),
html.Div(id='page-content2'),
])
........
app.layout = forRefresh
if __name__ == "__main__":
app.run_server(debug=True, port=8050)
any other way to do this…
thanks in advance