diehl
diehl2mo 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?
8 Replies
Hall
Hall2mo ago
Someone will reply to you shortly. In the meantime, this might help:
Akshay
Akshay2mo ago
No, that is not possible today. What is the use case for this?
diehl
diehlOP2mo ago
@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> """ )
Myles Scolnick
Myles Scolnick2mo ago
you could remove the margin, or set a max-height: e.g. 500px
diehl
diehlOP2mo ago
Neither brings the map into full view unfortunately. Actually the max-height property doesn't seem to have any impact on the resulting height
Myles Scolnick
Myles Scolnick2mo ago
Can you change the height on the library you are using?
diehl
diehlOP2mo ago
@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!
Myles Scolnick
Myles Scolnick2mo ago
awesome!

Did you find this page helpful?