{ "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": false }, "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": false }, "outputs": [], "source": [ "%matplotlib inline\n", "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "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 raw JSON as a string\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 \"$\"." ] }, { "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": false }, "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": { "collapsed": false }, "outputs": [ { "data": { "image/png": [ "iVBORw0KGgoAAAANSUhEUgAAAXIAAAENCAYAAAASUO4dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n", "AAALEgAACxIB0t1+/AAAElNJREFUeJzt3X+wXGV9x/H3JpefITfhCr1JSyCIRH5UJbQgrVhXChas\n", "DXE6onbaBoownRG0tVUSOg63vxQY+8tRoVOQuTIOSq3QQGtNiGyr1SK0IfxqTBNNB2zuhUJoLogk\n", "kO0fz9ncvZu9956z9+yefXbfr5mdPefZs7tPbnY/++z3POcsSJIkSZIkSZIkSZIkSZIkSZIkSZJ6\n", "1olFd6DNlgJHFt0JKYt5RXdAXe8sYAtwEyHEzym2O233DPCxojshZVEqug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ian at 0x106e7ae10>" ] }, "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": { "collapsed": false }, "outputs": [ { "data": { "image/png": [ "iVBORw0KGgoAAAANSUhEUgAAAXIAAAENCAYAAAASUO4dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n", "AAALEgAACxIB0t1+/AAAElNJREFUeJzt3X+wXGV9x/H3JpefITfhCr1JSyCIRH5UJbQgrVhXChas\n", "DXE6onbaBoownRG0tVUSOg63vxQY+8tRoVOQuTIOSq3QQGtNiGyr1SK0IfxqTBNNB2zuhUJoLogk\n", "kO0fz9ncvZu9956z9+yefXbfr5mdPefZs7tPbnY/++z3POcsSJIkSZIkSZIkSZIkSZIkSZIkSZJ6\n", "1olFd6DNlgJHFt0JKYt5RXdAXe8sYAtwEyHEzym2O233DPCxojshZVEqugPqGjcD/wrc3tB+E/BV\n", "4EFgHXBNm57/1wij4bOBu4Avtel5Gp0B/Drw+3VtZwGnAl/oUB+m06xvq4HTgP3AD5n8/8raLqkH\n", "fQf424a204GLkuU3AVe36blfV/fYxwC76UwJ5yOED6nbmtyWJcTfTPjweQoYSNqGCR9G9wI/n1Pf\n", "FgH/Xrf+HeA1GduPaaEv6nKWVgQwH7gPOA84vK69DHwjWX5X3XLeTmeynPG/wHbgZ9r0XPX+HPj7\n", "aW57hvABk8YDwD8B24BfTdrGCSH+HuDbOfXtF4An6ta3EP7PsrS/vYW+qMsNzL6J+sDpwCbCV/mL\n", "CKNLgCOAl5Pls4BPZHzc1wJXzHD7vxHC6h+ZHPmXCCWW7RmfK+tz1kxXXtxC+DBJ0495wD7g08BH\n", "gS8n7QuAl3Ls23HA83XrzwMnA89lbFePMcgFoS59O6EU8H5CkB8G7K3b5kigWrc+H/hn4Nxk/Vbg\n", "k0wNvu8T6u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\n", "klAWqPEAotZcDWwBbqWgr1yR80C2/FWB+4CHgCsK7ksvGCaUW0iuh2e7Q6unsd0ILGnSfi1wT4bH\n", "8aCig033t/0D4Cbgj5L1Pwb+DLi8Q/3qFb7m8vcWYBdwLOH1u5Uw0tTcVUnxmm01yC9o4T4/BOp/\n", "0uW4pE1Tpf3b3kK2D00Fja/DZUz9pqjsdiXXzwB3EcpXBnnrxgmDuTFgKfD0bHdod2mlvm62Hngf\n", "4eChE4GTcQ93Vkvrlt/N1B0kSuchwmtvOeG1+F7Ca1OtORJYmCwvIMxG83U5N+uBNcnyGuDuIjrx\n", "bkIN8iXCJ8rX6m67lrCjaSvwS53vWvS+QJjmtYXwnztr7UxNeSBbfk4kzPx5GHgM/55Z3QH8D7CX\n", "kJuXEWYA3UfB0w8lSZIkSZIkSZIkSZIkSZIkSZIktcn/A4eK9UXawRDUAAAAAElFTkSuQmCC\n" ], "text/latex": [ "$\\mathcal{N}(\\mu=2, \\sigma=1),\\ N=1000$" ], "text/plain": [ "<__main__.Gaussian at 0x106e7ae10>" ] }, "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": { "collapsed": false }, "outputs": [ { "data": { "image/png": [ "iVBORw0KGgoAAAANSUhEUgAAAXIAAAENCAYAAAASUO4dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n", "AAALEgAACxIB0t1+/AAAElNJREFUeJzt3X+wXGV9x/H3JpefITfhCr1JSyCIRH5UJbQgrVhXChas\n", "DXE6onbaBoownRG0tVUSOg63vxQY+8tRoVOQuTIOSq3QQGtNiGyr1SK0IfxqTBNNB2zuhUJoLogk\n", "kO0fz9ncvZu9956z9+yefXbfr5mdPefZs7tPbnY/++z3POcsSJIkSZIkSZIkSZIkSZIkSZIkSZJ6\n", "1olFd6DNlgJHFt0JKYt5RXdAXe8sYAtwEyHEzym2O233D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l3R5KU1VyCfD7wGUKYnwa8Hzg1j07pYJVKpeguRGRqnVd5\n", "mvrTeLX9Es3arKd3zlyC/GxgO7AT2Ad8Cbg4hz6pCYM8i1qddx8edp+32k/j7QYm90vAdQe11dbV\n", "fnMJ8p8CnqxbfyppkyR10FyC3KGOClBlcPBXePnlZ5g3z331EoQ5Ra06Bxgh1MgB1gH7gRvqttkO\n", "nDSH55CkfrQDeF0nnmggebLlwKHAw7izU5KicxHwPcLIe13BfZEkSZIE8B7gceBV4MyG29YRDh7a\n", "Cryjw/3qBSOE2UGbk8uFM26t6XggW752Ao8QXpPfLbYr0fk8MA48Wtc2BGwEtgEbgMUF9ItTgBXA\n", "/UwN8tMIdfRDCHX17XiKgKyuAz5SdCciN5/w2ltOeC26b2fufkAIH2X3VmAlU4P8RuBjyfI1wPWz\n", "PUg7gnQr4ZOk0cXAHYSjNHYS3kxnt+H5e52HKs6NB7K1h6/L1nwTaDxyahUwmiyPAqtne5BOjoh/\n", "klAWqPEAotZcDWwBbqWgr1yR80C2/FWB+4CHgCsK7ksvGCaUW0iuh2e7Q6unsd0ILGnSfi1wT4bH\n", "8aCig033t/0D4Cbgj5L1Pwb+DLi8Q/3qFb7m8vcWYBdwLOH1u5Uw0tTcVUnxmm01yC9o4T4/BOp/\n", "0uW4pE1Tpf3b3kK2D00Fja/DZUz9pqjsdiXXzwB3EcpXBnnrxgmDuTFgKfD0bHdod2mlvm62Hngf\n", "4eChE4GTcQ93Vkvrlt/N1B0kSuchwmtvOeG1+F7Ca1OtORJYmCwvIMxG83U5N+uBNcnyGuDuIjrx\n", "bkIN8iXCJ8rX6m67lrCjaSvwS53vWvS+QJjmtYXwnztr7UxNeSBbfk4kzPx5GHgM/55Z3QH8D7CX\n", "kJuXEWYA3UfB0w8lSZIkSZIkSZIkSZIkSZIkSZIktcn/A4eK9UXawRDUAAAAAElFTkSuQmCC\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",
"