Hello; How do you update an html.H1 with a callback? I want to update UTC time every 5 seconds at the top of the web app.
I am updating a dcc.Graph with callback successfully. So I have a working example but it’s not translating to html.H1. It seems it wants it to be done differently.
Thank you. I tried this but I’m unclear about the syntax. I think I get the callback output…seems the same as the dcc.Graph example but swap out figure for children and change the id.
But what does the html.H1(‘How to Make this text change via update’) convert to?
html.H1(id=myh1 (‘How to Make this text change via update’) ) doesn’t work. Where does the id go? I tried wrapping it in its’ own div.
If I put the variable utc_current in the html.H1 it complains that it’s not defined, no global exists. If I also add it to the function associated with the callback it fails.
I think we’re missing some kind of variable in the htm…H1 piece…using return utc_current at the end of the function and ‘children’ in the html.H1 statement isn’t working.
If I want html.H1 to be UTC time and be updated by dcc.Interval, callback and a function how would I do that?
Glad it works.
Yes, you forgot to assign a name to the input received, it happens because in this case the input value is not necessary to build the output.
How do you convert unix time to make the x axis human readable? Ploty seems to think it’s not time and just numbers so the x axis shows up as 1.5B instead of a human readable date.
I’ve tried converting the unix time, which I can do and print out to terminal correctly. But plotly/dash seem to disagree.
Is there a standard way or built in way to deal with this?