You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to replace a certain index of a cell output. My use case is that I want to be able to have a progress bar at output index 0, and occasionally update a plot at output index 1. If I clear the output to show the new plot, I lose the progress bar.
I would be happy to submit a PR if there's an API for this that you like.
Suggested solution
I've been using this, which seems to work okay (modified from the functions in _output.py):
Another approach that would be a little bit more work is to make mo.output behave more like a list with a __getitem__ method, and maybe an insert method:
@seantur I think a mo.output.replace_at_index. I do like the list-api on it, but mo.output[0] = 2 looks like a mutation and marimo tries to push for more more immutable practices, so that could be confusing. if we want to later, we can make it a list-like api.
Description
I would like to be able to replace a certain index of a cell output. My use case is that I want to be able to have a progress bar at output index 0, and occasionally update a plot at output index 1. If I clear the output to show the new plot, I lose the progress bar.
I would be happy to submit a PR if there's an API for this that you like.
Suggested solution
I've been using this, which seems to work okay (modified from the functions in _output.py):
Alternative
Another approach that would be a little bit more work is to make
mo.output
behave more like a list with a__getitem__
method, and maybe aninsert
method:Additional context
No response
The text was updated successfully, but these errors were encountered: