Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] display console messages in shiny app #6

Closed
kevinrue opened this issue Aug 2, 2022 · 2 comments
Closed

[FEATURE] display console messages in shiny app #6

kevinrue opened this issue Aug 2, 2022 · 2 comments

Comments

@kevinrue
Copy link
Member

kevinrue commented Aug 2, 2022

Display console messages in a modal while downloading/loading a data set.

The idea is to give users an idea of what is going on in the R session, especially when data sets are being downloaded for the first time, as this can take some time, during which users may think that the app has frozen.

A progress bar was added in #4 but it is unable to report whether a data set is being downloaded or loaded from cache, as this is all handled within a single call to the ExperimentHub.

Attempt 1

I've used capture.output(..., type = 'message', file = NULL), stored the result to rObjects and used verbatimTextOutput() to display it in a modal. However, file=NULL does not return anything until the command has completed, which is useless in terms of interactivity.

In future attempts, try using file=tempfile(), and invalidateLater() to regularly check whether the file is being updated. If so, the contents of the file could be displayed in the modal as the file is being written/updated.

@kevinrue kevinrue changed the title [FEATURE] Your bug or feature request [FEATURE] display console messages in shiny app Aug 4, 2022
@kevinrue
Copy link
Member Author

kevinrue commented Aug 11, 2022

Attempt 2

See branch kra-capture-output for an implementation that progressively captures console output to a file.

However, the single-threaded nature of R and the priority of reactive events in Shiny also results in the app displaying the final contents of the file after the download has completed.

@kevinrue
Copy link
Member Author

kevinrue commented Sep 2, 2024

the in-app progress bar is just fine

@kevinrue kevinrue closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant