Open lmeyerov opened 5 years ago
@lmeyerov how about using a custom template and add a bit of logic that will trigger the refresh?
setTimeout(() => {
window.location.reload();
}, 30000); // refresh every 30s
Refreshing the page will catch the latest changes indeed (if they were saved).
Another way would be to use a browser extension for automatically refreshing a tab.
I realized, even easier, we can just
display(HTML("<script>... </script>"))
This particular issue, in the end, seems to be more about:
(a) --autoreload
docs are unclear to what it actually does -- not refreshing a dashboard on change ;-) -- so maybe the fix is revising the docs
(b) dashboards that refresh are a somewhat common use case. Not hard for web people, so maybe more of a docs thing as well
(a)
--autoreload
docs are unclear to what it actually does -- not refreshing a dashboard on change ;-) -- so maybe the fix is revising the docs
Right, this option is a bit misleading. It is meant to be used for development, not for end users.
(b) dashboards that refresh are a somewhat common use case. Not hard for web people, so maybe more of a docs thing as well
That's a common use case indeed and can be added to the docs. Would you like to open a PR? :)
I thought about production autoreload more, and it's a bit of an iceberg. E.g., need to autoheal when server goes down/up.
More on my mind is making a dashboard template more than a POC -- we ended up doing HTML(HTML(HTML(...
and custom <style>
. Only so many hours in a day!
@lmeyerov did you experiment a bit more with auto refresh of dashboards?
I expected, if I ran
voila --autoreload=True my.ipynb
, that saved edits tomy.ipynb
would cause, within 30s, the opened browser page to reload. Instead, the old page and cell values still appear.I'm really trying to just get some sort of dashboard reload in general to reflect new DB values, so happy to achieve in another way as well. Manually refreshing appears to catch the latest ipynb, so maybe docs update to reflect this is autoreload-on-refresh and we insert some JS polling :)
Repro:
Install on OS X
Bash
Notebook
Steps to repro: