{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Custom Display Logic" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Overview" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As described in the [Rich Output](Rich Output.ipynb) tutorial, the IPython display system can display rich representations of objects in the following formats:\n", "\n", "* JavaScript\n", "* HTML\n", "* PNG\n", "* JPEG\n", "* SVG\n", "* LaTeX\n", "* PDF\n", "\n", "This Notebook shows how you can add custom display logic to your own classes, so that they can be displayed using these rich representations. There are two ways of accomplishing this:\n", "\n", "1. Implementing special display methods such as `_repr_html_` when you define your class.\n", "2. Registering a display function for a particular existing class.\n", "\n", "This Notebook describes and illustrates both approaches." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Import the IPython display functions." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from IPython.display import (\n", " display, display_html, display_png, display_svg\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Parts of this notebook need the matplotlib inline backend:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "plt.ion()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Special display methods" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The main idea of the first approach is that you have to implement special display methods when you define your class, one for each representation you want to use. Here is a list of the names of the special methods and the values they must return:\n", "\n", "* `_repr_html_`: return raw HTML as a string\n", "* `_repr_json_`: return a JSONable dict\n", "* `_repr_jpeg_`: return raw JPEG data\n", "* `_repr_png_`: return raw PNG data\n", "* `_repr_svg_`: return raw SVG data as a string\n", "* `_repr_latex_`: return LaTeX commands in a string surrounded by \"$\".\n", "* `_repr_mimebundle_`: return a full mimebundle containing the mapping from all mimetypes to data " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As an illustration, we build a class that holds data generated by sampling a Gaussian distribution with given mean and standard deviation. Here is the definition of the `Gaussian` class, which has a custom PNG and LaTeX representation." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from IPython.core.pylabtools import print_figure\n", "from IPython.display import Image, SVG, Math\n", "\n", "class Gaussian(object):\n", " \"\"\"A simple object holding data sampled from a Gaussian distribution.\n", " \"\"\"\n", " def __init__(self, mean=0.0, std=1, size=1000):\n", " self.data = np.random.normal(mean, std, size)\n", " self.mean = mean\n", " self.std = std\n", " self.size = size\n", " # For caching plots that may be expensive to compute\n", " self._png_data = None\n", " \n", " def _figure_data(self, format):\n", " fig, ax = plt.subplots()\n", " ax.hist(self.data, bins=50)\n", " ax.set_title(self._repr_latex_())\n", " ax.set_xlim(-10.0,10.0)\n", " data = print_figure(fig, format)\n", " # We MUST close the figure, otherwise IPython's display machinery\n", " # will pick it up and send it as output, resulting in a double display\n", " plt.close(fig)\n", " return data\n", " \n", " def _repr_png_(self):\n", " if self._png_data is None:\n", " self._png_data = self._figure_data('png')\n", " return self._png_data\n", " \n", " def _repr_latex_(self):\n", " return r'$\\mathcal{N}(\\mu=%.2g, \\sigma=%.2g),\\ N=%d$' % (self.mean,\n", " self.std, self.size)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create an instance of the Gaussian distribution and return it to display the default representation:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEKCAYAAADzQPVvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFOZJREFUeJzt3X+0ZWV93/H3xxnAVIlAGJCIOpiFFgxhMLMIDUlKxBB+\nuAQbtRiXmRaSadrQ6lrtSsayklJjW0ybaNommolQJ1k0QBWEBRidotaVtRLMID+EAPIjoyKEGRUQ\niDEi3/6x99Xj5dx7z73nnPtjnvdrrbPu2fvZe5/vPGfP5+zz7H33TVUhSdq3PWelC5AkTZ9hL0kN\nMOwlqQGGvSQ1wLCXpAYY9p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eiC/rKqump2+2D4V9UNSX4/yaFVtaw39RrhfVxN\nt1U5A/hsVT0yu2G19GfvkSRHVNXD/ZDXniHLPEh3nmHGkXTnSee0nMM41wLn9lc7HEX3qfmZwQX6\nYPgk8IZ+1hZgrm8Kk/Ya4O6qenBYY5LnJTlw5jndichlvYPnrLHO18/x+it6G4skpwO/Bryuqv52\njmVWqi9H6Ztr6fY76PbDT8z1gTUt/TmCS4C7qup35ljmhTPnEpKcSPd/+avLV+XI7+O1wC/0V+Wc\nBDw+M0SxAub85r4a+nPA4D44VwZ+DDgtycH9cO5p/by5TeHs8uvpPnW+CTwCfGyg7UK6qyHuAc4Y\nmH8D8IP985fRfQjcB/wf4IBJ1zhH3R8EfnnWvB8Ebhio67b+cSfdkMVyn7n/Y+BzwO39DnHE7Dr7\n6TPpruC4f7nr7N+3LwG39o/3z65xJftyWN8A76T7cAJ4br/f3dfvhy9bgff5J+i+kt8+0I9nAr88\ns48CF/R9dxvdifAfX4E6h76Ps+oM3R85ur/fdzcvd519Hf+ALrxfMDBvxfuT7sPnYeBbfW6eT3eO\n6Ebg3v7nIf2ym4EPDKx7Xr+f3gf884Vey9slSFID/A1aSWqAYS9JDTDsJakBhr0kNcCwl6QGGPaS\n1ADDXpIa8P8BEb7Ae9JKdQAAAAAASUVORK5CYII=\n", "text/latex": [ "$\\mathcal{N}(\\mu=2, \\sigma=1),\\ N=1000$" ], "text/plain": [ "<__main__.Gaussian at 0x116fe76d8>" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x = Gaussian(2.0, 1.0)\n", "x" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also pass the object to the `display` function to display the default representation:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEKCAYAAADzQPVvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFOZJREFUeJzt3X+0ZW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Yum2MzU+/LIVZ0H1ysJM8H\nPgy8vaq+Pqv5s3RDEU/2524+Ahy93DWy8Pu4mvpzf+B1wDuGNK+W/hzVovt1SWFfVa9Zwmqj3F7h\nK3Rf89b3R1UTuwXDQjUnWQ/8E+BH59nGQ/3PPUmuphsWmGhAjdq3Sf4QuG5I09RvYzFCX24BXguc\nWv0A45BtTL0vhxilb2aWebDfJ17As79mT12S/eiC/rKqump2+2D4V9UNSX4/yaFVtaw39RrhfVxN\nt1U5A/hsVT0yu2G19GfvkSRHVNXD/ZDXniHLPEh3nmHGkXTnSee0nMM41wLn9lc7HEX3qfmZwQX6\nYPgk8IZ+1hZgrm8Kk/Ya4O6qenBYY5LnJTlw5jndichlvYPnrLHO18/x+it6G4skpwO/Bryuqv52\njmVWqi9H6Ztr6fY76PbDT8z1gTUt/TmCS4C7qup35ljmhTPnEpKcSPd/+avLV+XI7+O1wC/0V+Wc\nBDw+M0SxAub85r4a+nPA4D44VwZ+DDgtycH9cO5p/by5TeHs8uvpPnW+CTwCfGyg7UK6qyHuAc4Y\nmH8D8IP985fRfQjcB/wf4IBJ1zhH3R8EfnnWvB8Ebhio67b+cSfdkMVyn7n/Y+BzwO39DnHE7Dr7\n6TPpruC4f7nr7N+3LwG39o/3z65xJftyWN8A76T7cAJ4br/f3dfvhy9bgff5J+i+kt8+0I9nAr88\ns48CF/R9dxvdifAfX4E6h76Ps+oM3R85ur/fdzcvd519Hf+ALrxfMDBvxfuT7sPnYeBbfW6eT3eO\n6Ebg3v7nIf2ym4EPDKx7Xr+f3gf884Vey9slSFID/A1aSWqAYS9JDTDsJakBhr0kNcCwl6QGGPaS\n1ADDXpIa8P8BEb7Ae9JKdQAAAAAASUVORK5CYII=\n", "text/latex": [ "$\\mathcal{N}(\\mu=2, \\sigma=1),\\ N=1000$" ], "text/plain": [ "<__main__.Gaussian at 0x116fe76d8>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "display(x)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Use `display_png` to view the PNG representation:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAEKCAYAAADzQPVvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFOZJREFUeJzt3X+0ZWV93/H3xxnAVIlAGJCIOpiFFgxhMLMIDUlKxBB+\nuAQbtRiXmRaSadrQ6lrtSsayklJjW0ybaNommolQJ1k0QBWEBRidotaVtRLMID+EAPIjoyKEGRUQ\niDEi3/6x99Xj5dx7z73nnPtjnvdrrbPu2fvZe5/vPGfP5+zz7H33TVUhSdq3PWelC5AkTZ9hL0kN\nMOwlqQGGvSQ1wLCXpAYY9pLUAMNekhpg2EtSAwx7keTMJI8kuTjJf0ny9pWuabVJ8pkkr1zpOqSl\nMuwbkuTHkuw3a95zgFOAXwK+CvwC8AdTruOAJJck+UKSJ5LckuSMab7mCDVdkGRXkm8m+eCQRf4b\n8M4lbvvgJJXkz2fN/4Mk71nKNge2MW/dSQ5JcnWSp/r+/vlR2kZp19pi2LflPODsWfNOBq6qqmv7\n6Ruq6htTrmM98CXgHwMvAH4duDLJxim/7nweAt4FXDpH+7XATyc5Ygnb3gT8DXDsrPU3AbcuYXuD\nFqr794C/Bw4H3gK8b+Abynxto7RrDTHs23ICsHXWvJOAm/rnZwD/b7AxyYVJ3jcwfXCSbyV57lKL\nqKqnquqiqtpdVc9U1XXAXwM/utC6SfZL8p+S7O7rqP5x21Lr6Wu6qqo+QvftZlj73wE3A6ctYfOb\ngF3ATuB1AEnWAccBtyyp4O/WNWfdSZ4H/Bzw61X1ZFX9Gd2H1lvna1to3XHq1cox7BuRZD2wFzg1\nycsHmtbXd++Gdxxwz6xVj+N7jz43Aff04Te4/euSPDbH47oFajsceDlw5wj/lHcBpwI/CRwE3Ahc\nDbx+UvXM4y7g+CWsdwJdH34EOKef9w+Bdf02p1X3y4FvV9XnB+bdBrxygbaF1tUatH6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pIa8P8BEb7Ae9JKdQAAAAAASUVORK5CYII=\n" }, "metadata": {}, "output_type": "display_data" } ], "source": [ "display_png(x)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
display
and display_png
. The former computes all representations of the object, and lets the notebook UI decide which to display. The later only computes the PNG representation.\n",
"