79722923

Date: 2025-08-01 20:21:49
Score: 1.5
Natty:
Report link

For SageMath 'threejs' views of Graphics objects (as of mid-2025), the output cell is enclosed in an <iframe> element which seems to have a hard-coded height attribute. None of the methods previously posted here to increase the height worked for me for such output cells. So here are two workarounds for this fixed height, both of which did work in my case:

  1. Call the .show() method for the Graphics object that is using the 'threejs' viewer with the online=True option. Then in the resulting output cell, click the small circle-i info icon in the bottom right, and select the "Save as HTML" option. Save the resulting HTML to a local file, and then open that directly in a new window/tab in your browser via a file:///... URL. The graphics will re-render in that new window/tab, taking up your full browser window.

  2. Or, if you prefer not to open a separate window/mess with file:///... URLs, you can instead open the Developer Tools for your browser (e.g., in Firefox under the "More Tools" submenu of the main menu), and then select the (DOM) Inspector for your Developer Tools. Navigate to the <iframe> element of the graphics output cell in question (e.g., using the click-to-select button, and/or by moving within the tree until that element is selected). Then add a height: 100vh attribute to the element with the live CSS editor for the element (for example in the Firefox Developer Tools, this is just a text box to the right of the DOM display with the header "element {" that you can type directly into). Note this method only persists until the next time you re-run that cell.

Of course, I'd prefer some way of just setting that threejs viewer iframe height within the Sage Jupyter notebook itself -- if anybody knows of one, please post.

Reasons:
  • Blacklisted phrase (1): anybody know
  • Whitelisted phrase (-1): worked for me
  • RegEx Blacklisted phrase (2.5): please post
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Glen Whitney