{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Output Containers and Layout Managers\n", "\n", "Output containers are objects that hold a collection of other objects, and displays all its contents, even when they are complex interactive objects and MIME type.\n", "By default the contents are just stacked up on the page, but you can configure them to get tabs, grid, cycling, or other layout methods.\n", "There is also a class for having no visible output at all: hidden outputs.\n", "\n", "## Hidden Outputs" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "// something we don't want to see\n", "def big(x) {\n", " return (x < 2) ? x : [x, big(x - 1), big(x - 2)]\n", "}\n", "x = big(10)\n", "OutputCell.HIDDEN" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Stacked Output Containers" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def o = new OutputContainer()\n", "o.addItem(\"simplest example\")\n", "o << [2, 3, 5, 7] // shorter syntax\n", "o << HTML(\"