NeroCube / bookmark

Place some learning resources
0 stars 0 forks source link

Dash Live Updating Components #338

Open NeroCube opened 2 years ago

NeroCube commented 2 years ago

Code Example

import datetime

import dash
from dash import html

def serve_layout():
    return html.H1('The time is: ' + str(datetime.datetime.now()))

app.layout = serve_layout

if __name__ == '__main__':
    app.run_server(debug=True)

Note : Heads up! You need to write app.layout = serve_layout not app.layout = serve_layout(). That is, define app.layout to the actual function instance.

Reference

https://dash.plotly.com/live-updates