Get help from the marimo community

Updated 2 weeks ago

Automatically expanding the output of a cell

Can I add code to a cell that, when executed, is equivalent to clicking the "Expand output" button on the right side of the cell?
A
C
M
13 comments
No, that is not possible today. What is the use case for this?
@Akshay When the notebook cell creating my map evaluates, a small portion of the map is invisible and a scroll bar appears. The only way to see the full extent of the map is to click the expand output button which is unfortunate.
Wonder if the truncation has anything to do with switching to HTML to add a boundary around the cell. This is the code snippet.
mo.Html(
f"""
<div style='border: 1px solid; ; margin: 5px'>
{mo.as_html(m)}
</div>
"""
)
you could remove the margin, or set a max-height: e.g. 500px
Neither brings the map into full view unfortunately.
Actually the max-height property doesn't seem to have any impact on the resulting height
Can you change the height on the library you are using?
@Myles Scolnick good call. I'll look into it. I bet the answer is yes.
@Myles Scolnick interestingly enough, changing the height on the Leafmap side is not changing the height of the resulting map
Actually I take that back. When I adjust the size and rerun the cell, the map size does not change. BUT if I hit the Toggle App View button, it renders correctly. And then when I return to the notebook, it then is displayed at the correct size.
Anyhoo, I got to what I wanted. Looks like at a height of 500 px, it'll still render the entire map without loading a scroll bar. Appreciate your feedback!
Add a reply
Sign up and join the conversation on Discord