From e3ec43216af7998a604f675ccfd9c0e4420bd740 Mon Sep 17 00:00:00 2001 From: Pete Blois Date: Tue, 26 Dec 2023 12:46:26 -0800 Subject: [PATCH] No public description PiperOrigin-RevId: 593840886 --- google/colab/output/__init__.py | 2 +- google/colab/output/_area.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/google/colab/output/__init__.py b/google/colab/output/__init__.py index dd57e9d5..7ca3d45a 100644 --- a/google/colab/output/__init__.py +++ b/google/colab/output/__init__.py @@ -13,7 +13,7 @@ # limitations under the License. """Colabs output package.""" # pylint: disable=g-multiple-import -from google.colab.output._area import redirect_to_element, to_default_area, to_footer_area, to_header_area +from google.colab.output._area import no_vertical_scroll, redirect_to_element, to_default_area, to_footer_area, to_header_area from google.colab.output._js import eval_js, register_callback, unregister_callback from google.colab.output._tags import clear, temporary, use_tags from google.colab.output._util import serve_kernel_port_as_iframe, serve_kernel_port_as_window diff --git a/google/colab/output/_area.py b/google/colab/output/_area.py index a113d13b..b83023c1 100644 --- a/google/colab/output/_area.py +++ b/google/colab/output/_area.py @@ -65,3 +65,13 @@ def to_default_area(): """Restores output to output into default area.""" with redirect_to_element(_jsapi.output.getDefaultOutputArea()) as s: yield s + + +def no_vertical_scroll(): + """Never show a vertical scrollbar for the output. + + The output cell will be as large as necessary to show all the output. + """ + _jsapi.output.setIframeHeight( + -1, True, {'interactive': True, 'maxHeight': 99999} + )