##// END OF EJS Templates
Merge pull request #8062 from minrk/max-width-again...
Matthias Bussonnier -
r21006:6c367e1e merge
parent child Browse files
Show More
@@ -0,0 +1,307 b''
1 {
2 "cells": [
3 {
4 "cell_type": "markdown",
5 "metadata": {},
6 "source": [
7 "# Test notebook for overflowing content"
8 ]
9 },
10 {
11 "cell_type": "markdown",
12 "metadata": {},
13 "source": [
14 "markdown image:\n",
15 "\n",
16 "<img src=\"http://placehold.it/800x200.png\">\n",
17 "\n",
18 "unconfined markdown image:\n",
19 "\n",
20 "<img src=\"http://placehold.it/800x200.png\" class=\"unconfined\">"
21 ]
22 },
23 {
24 "cell_type": "code",
25 "execution_count": 1,
26 "metadata": {
27 "collapsed": true
28 },
29 "outputs": [],
30 "source": [
31 "from IPython.display import Image, IFrame"
32 ]
33 },
34 {
35 "cell_type": "markdown",
36 "metadata": {},
37 "source": [
38 "Overflow image in HTML (non-embedded)"
39 ]
40 },
41 {
42 "cell_type": "code",
43 "execution_count": 2,
44 "metadata": {
45 "collapsed": false
46 },
47 "outputs": [
48 {
49 "data": {
50 "text/html": [
51 "<img src=\"http://placehold.it/800x200.png\" />"
52 ],
53 "text/plain": [
54 "<IPython.core.display.Image object>"
55 ]
56 },
57 "execution_count": 2,
58 "metadata": {},
59 "output_type": "execute_result"
60 }
61 ],
62 "source": [
63 "Image(url=\"http://placehold.it/800x200.png\", embed=False)"
64 ]
65 },
66 {
67 "cell_type": "markdown",
68 "metadata": {},
69 "source": [
70 "Overflow image:"
71 ]
72 },
73 {
74 "cell_type": "code",
75 "execution_count": 3,
76 "metadata": {
77 "collapsed": false
78 },
79 "outputs": [
80 {
81 "data": {
82 "image/png": "iVBORw0KGgoAAAANSUhEUgAAAyAAAADIBAMAAADioZgpAAAAG1BMVEXMzMyWlpbFxcWxsbGjo6Oc\nnJyqqqq3t7e+vr4PApRfAAAFsUlEQVR4nO3cz28aRxTAcYwhcOzYxskRpLbKka0qtUeTquq1G6Xq\n1VSKejX9EeVo+kPyn13mzXuz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z8G9WeoXFxC+5VDwTw1PD8y7waUMcmWGEx7i7nmBpVPUJ2/\nknuRjBWJTXrdFISDmLjmVt5sULTXITuIjzYI5Wgc6dk6KRW3Xzeh+ynZDbRxp2WUDOlsLpazbXfb\nhi/ZL6/dnmXhJhnS2X4v130+x7d6eUNfHLijNElH76hujdYF4SDiwkBfbFz2PVe56THrxJOtyptY\nLAgHEac9WiEL63CSpxKkr3/8VEIl097OIOLPtwfdB0XhIGKF6DQo/7kdfa69MxBU7cGax4BK2fM6\n3WnQ00+2+U5n012IDNNFyIAH5crZ0ybpqNt69rNy//Ls50J3e+fdcEmPVRAOgT2PZc9n2Yq91ZUt\nB8ma2+za+suJ62xmjTsTr/xwUHUz/ZHOfRWaeOWS7w+83fP9gam0+bpzdNMdq3PDwVSh7S6s69o6\n+4ZNmNEm37BpTVNHcl7VuSGy6g4NueFgfE1cD6a19SnNd9C06/E5Dt9BS+4NDh82knp/9sc/msM+\n8Q9BOJoXDg1ZyV3VcTCeOnMTPrC1cnopjPWA7Fw1i8OJSwzywyGxsgxpE660ePB7zGd6wqRJvRfv\nzzdHs8Ih8ZllSNdpWd/0lwqxh62bCmm+pR6P8sMBpey3F+KO4LqTsH2/hSEVcmsfbh9uVwg/rVFM\nf50kjrHh12LeNB+QB7fslzeCM8vx9qkrJCscWv7yXXzyA0oZv6ckk6fWi3BmUh9xqOfnmYq9/vWr\n+//6/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADg/+AfmZU6iN1i\nLzkAAAAASUVORK5CYII=\n",
83 "text/plain": [
84 "<IPython.core.display.Image object>"
85 ]
86 },
87 "execution_count": 3,
88 "metadata": {},
89 "output_type": "execute_result"
90 }
91 ],
92 "source": [
93 "Image(url=\"http://placehold.it/800x200.png\", embed=True)"
94 ]
95 },
96 {
97 "cell_type": "markdown",
98 "metadata": {},
99 "source": [
100 "Overflow, unconfined"
101 ]
102 },
103 {
104 "cell_type": "code",
105 "execution_count": 4,
106 "metadata": {
107 "collapsed": false
108 },
109 "outputs": [
110 {
111 "data": {
112 "image/png": "iVBORw0KGgoAAAANSUhEUgAAAyAAAADIBAMAAADioZgpAAAAG1BMVEXMzMyWlpbFxcWxsbGjo6Oc\nnJyqqqq3t7e+vr4PApRfAAAFsUlEQVR4nO3cz28aRxTAcYwhcOzYxskRpLbKka0qtUeTquq1G6Xq\n1VSKejX9EeVo+kPyn13mzXuzs2uKZwxSK+33c4iZhX2K3szOr10YDAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJ5p+GX9w89JefLevfsi/cCHevbNPDvch2/du19O\nF65/hmu382MsT2pf/qn5wO++fD3PDCefTk4/MlwPbSWD7sbK61C+t/KLUH6VF+3T8OlZPP24cD00\nCQlyV/NQ1oQ1GdOMNik9ZFjrp18OThGuj/QCiZdIpcXZPJTP7f23OdHG9mlL+HHh+siatLuU4jBm\n9Ca8v7DyVU60dTz94hThekha7Ne/+X+lPPK5+lg1ncxq9/K7PzM7manU7IOvlusThOujcciVz9PS\nl7fSmKexCeurrUuG/cPRdp2T1Mv8+HB9tAk14XuS7315FVJZWRMehd7n3GVNjLY6OPiod8eH66N1\nyNi59vpDHUzOdn9v/fsLvXRiJ3TQSkfvsZ5+ZLg+WoXOxHclfqY60Yrxs9VP/Psb7XzWNsgctNaG\n/0IvuCPD9VEdmupQK2SknfvU+hStMOmM7p+MNl2FC8Eq5MhwfWTz3aRvWe453rxx2PT93P+xK+LY\ncD1knblmapGMxr4p25UT23qekV4hJwrXJ3V7DLE+3nfys0EzCMROKI9N2k4Urk90dLVZVmWDbdUc\nl9E4vghWWnT7W/paZ1W54RBtQ6cy1sRqS45tO7bk2LYDF64o2Zl8nFjZMLkrCIdoFJZytnKzWZBN\ng2JfH+dJgQsr7tH+CpEtxkFBOEQ+M7P7z51mLmZQh+OYwTgcBz7juya/2F8hcS8rNxwalVOyH17b\nCnrRdGW3vryvQu6kJ3pc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AASUVORK5CYII=\n",
113 "text/plain": [
114 "<IPython.core.display.Image object>"
115 ]
116 },
117 "execution_count": 4,
118 "metadata": {
119 "image/png": {
120 "unconfined": true
121 }
122 },
123 "output_type": "execute_result"
124 }
125 ],
126 "source": [
127 "Image(url=\"http://placehold.it/800x200.png\", embed=True, unconfined=True)"
128 ]
129 },
130 {
131 "cell_type": "markdown",
132 "metadata": {},
133 "source": [
134 "Overflow with explicit height, width (retina):"
135 ]
136 },
137 {
138 "cell_type": "code",
139 "execution_count": 5,
140 "metadata": {
141 "collapsed": false
142 },
143 "outputs": [
144 {
145 "data": {
146 "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcg\nSlBFRyB2NjIpLCBkZWZhdWx0IHF1YWxpdHkK/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMP\nFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEc\nITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgA\nyAcIAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMC\nBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYn\nKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeY\nmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5\n+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwAB\nAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpD\nREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ip\nqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMR\nAD8A9MooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK\nKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo\nooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii\ngAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\nCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK\nKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo\nooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii\ngAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\nCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK\nKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo\nooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii\ngAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\nCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK\nKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo\nooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii\ngAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\nCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK\nKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo\nooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii\ngAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\nCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK\nKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo\nooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii\ngAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\nCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK\nKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo\nooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii\ngAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\nCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK\nKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo\nooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii\ngAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA\nCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK\nKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo\nooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiii\ngAooooAKKKjmnit03yuEX3oAkoqC3vILrd5L7tuM8EYz9anoAKKZJKkMZeRgqjqTVA65aBsASEeo\nXigDSoqK3uYbpN8Lhh39RUtABRTJZo4IzJK4VR3NZ/8AblpuxiXHrt4/nQBp0VHBcRXEe+Jwy+3a\npKACimu6xoXdgqjkk1ntrlorYHmMPULx+tAGlRUNvdw3SloXDY6juKmoAKKKKACiiigAooooAKKK\nKACiqtzqFtaHbI+X/uryagj1u0dsHzE92Xj9KANGikVldQykFTyCKWgAoqvc3kFoAZXwT0Uck1Vj\n1u0dsHzE92Xj9KANKikVldQykFTyCO9LQAUVFcXMNqm+Zwo7epqkuuWhbBEgHqV4/nQBpUUyOVJo\nw8bBlPQin0AFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAF\nFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUU\nUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRR\nQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFA\nBRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAF\nFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRR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igA\nooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACi\niigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKK\nKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoooo\nAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigA\nooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACi\niigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKx9\nf/1EP+8f5VsVj6//AKiH/eP8qAGeHv8Al5/4D/WtusTw9/y8/wDAf61t0AYmuXEBIh2Bphzuz932\nrKS0uJITKkLlB3Apru1xclmPzO3P4muwRFjjVFGFUYAoA5vSLiCG6AlQbm4V8/drfvP+PG4/65t/\nKua1GJYdQmRRgZyB9Rn+tdDEzXGkgnlniIPucYoA57Tv+QjB/v11lcjYttvoD/00H8666gDltX/5\nCk3/AAH/ANBFb+m/8g6D/drntTbdqU5/2sfkMV0diuywgH+wD+lAHKRczpn+8P512dca4MVwwPVW\n/ka7IHIyKAOd17/j+T/rmP5mtHRf+Qcv+8azNcbdqGP7qAf1/rWro67dNjPqSf1oAv010WSNkYZV\ngQR7U6igDndW05LXZJCCIzwRnODUEl6X0uK2ycqxz9O38/0rf1ExDT5vN+7t4Hv2/WuUGMjPTvig\nDY0vS454DNcKSGPyDOOPWt2o4DGbeMxf6vaNv0qSgAooooAhurlLWBpZOg6D1PpXKzzSXdwZH5dj\ngAfyFWNUvTd3JCn90nC+/vV/RtP2qLqUfMfuA9h60AXNNshZ2+G5kflj/SoNe/48U/66D+RrUrN1\ntd2n5/uuD/T+tAFLQP8Aj4m/3B/Ot/rXPaC2LyRfWP8AqK35W2ROx7KTQBx0P+vj/wB4fzrptX/5\nBc3/AAH/ANCF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UAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRR\nRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFF\nABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUA\nFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAU\nUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRR\nRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFF\nABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUA\nFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAU\nUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRR\nRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q==\n",
147 "text/plain": [
148 "<IPython.core.display.Image object>"
149 ]
150 },
151 "execution_count": 5,
152 "metadata": {
153 "image/jpeg": {
154 "height": 100,
155 "width": 900
156 }
157 },
158 "output_type": "execute_result"
159 }
160 ],
161 "source": [
162 "Image(url=\"http://placehold.it/1800x200.jpg\", embed=True, retina=True)"
163 ]
164 },
165 {
166 "cell_type": "markdown",
167 "metadata": {},
168 "source": [
169 "Overflowing IFrame:"
170 ]
171 },
172 {
173 "cell_type": "code",
174 "execution_count": null,
175 "metadata": {
176 "collapsed": false
177 },
178 "outputs": [
179 {
180 "data": {
181 "text/html": [
182 "\n",
183 " <iframe\n",
184 " width=\"900\"\n",
185 " height=\"400\"\n",
186 " src=\"http://ipython.org\"\n",
187 " frameborder=\"0\"\n",
188 " allowfullscreen\n",
189 " ></iframe>\n",
190 " "
191 ],
192 "text/plain": [
193 "<IPython.lib.display.IFrame at 0x105239dd8>"
194 ]
195 },
196 "execution_count": 6,
197 "metadata": {},
198 "output_type": "execute_result"
199 }
200 ],
201 "source": [
202 "IFrame(src=\"http://ipython.org\", width=900, height=400)"
203 ]
204 },
205 {
206 "cell_type": "markdown",
207 "metadata": {},
208 "source": [
209 "Overflowing table:"
210 ]
211 },
212 {
213 "cell_type": "code",
214 "execution_count": null,
215 "metadata": {
216 "collapsed": false
217 },
218 "outputs": [
219 {
220 "data": {
221 "text/html": [
222 "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
223 "<table border=\"1\" class=\"dataframe\">\n",
224 " <thead>\n",
225 " <tr style=\"text-align: right;\">\n",
226 " <th></th>\n",
227 " <th>0</th>\n",
228 " <th>1</th>\n",
229 " <th>2</th>\n",
230 " <th>3</th>\n",
231 " <th>4</th>\n",
232 " <th>5</th>\n",
233 " <th>6</th>\n",
234 " <th>7</th>\n",
235 " <th>8</th>\n",
236 " <th>9</th>\n",
237 " <th>10</th>\n",
238 " <th>11</th>\n",
239 " <th>12</th>\n",
240 " <th>13</th>\n",
241 " <th>14</th>\n",
242 " </tr>\n",
243 " </thead>\n",
244 " <tbody>\n",
245 " <tr>\n",
246 " <th>0</th>\n",
247 " <td> column</td>\n",
248 " <td> column</td>\n",
249 " <td> column</td>\n",
250 " <td> column</td>\n",
251 " <td> column</td>\n",
252 " <td> column</td>\n",
253 " <td> column</td>\n",
254 " <td> column</td>\n",
255 " <td> column</td>\n",
256 " <td> column</td>\n",
257 " <td> column</td>\n",
258 " <td> column</td>\n",
259 " <td> column</td>\n",
260 " <td> column</td>\n",
261 " <td> column</td>\n",
262 " </tr>\n",
263 " </tbody>\n",
264 "</table>\n",
265 "</div>"
266 ],
267 "text/plain": [
268 " 0 1 2 3 4 5 6 7 8 \\\n",
269 "0 column column column column column column column column column \n",
270 "\n",
271 " 9 10 11 12 13 14 \n",
272 "0 column column column column column column "
273 ]
274 },
275 "execution_count": 7,
276 "metadata": {},
277 "output_type": "execute_result"
278 }
279 ],
280 "source": [
281 "import pandas as pd\n",
282 "pd.DataFrame([['column'] * 15])"
283 ]
284 }
285 ],
286 "metadata": {
287 "kernelspec": {
288 "display_name": "Python 3",
289 "language": "python",
290 "name": "python3"
291 },
292 "language_info": {
293 "codemirror_mode": {
294 "name": "ipython",
295 "version": 3
296 },
297 "file_extension": ".py",
298 "mimetype": "text/x-python",
299 "name": "python",
300 "nbconvert_exporter": "python",
301 "pygments_lexer": "ipython3",
302 "version": "3.4.3"
303 }
304 },
305 "nbformat": 4,
306 "nbformat_minor": 0
307 }
@@ -637,7 +637,9 b' class Image(DisplayObject):'
637 _FMT_PNG = u'png'
637 _FMT_PNG = u'png'
638 _ACCEPTABLE_EMBEDDINGS = [_FMT_JPEG, _FMT_PNG]
638 _ACCEPTABLE_EMBEDDINGS = [_FMT_JPEG, _FMT_PNG]
639
639
640 def __init__(self, data=None, url=None, filename=None, format=u'png', embed=None, width=None, height=None, retina=False):
640 def __init__(self, data=None, url=None, filename=None, format=u'png',
641 embed=None, width=None, height=None, retina=False,
642 unconfined=False, metadata=None):
641 """Create a PNG/JPEG image object given raw data.
643 """Create a PNG/JPEG image object given raw data.
642
644
643 When this object is returned by an input cell or passed to the
645 When this object is returned by an input cell or passed to the
@@ -678,6 +680,10 b' class Image(DisplayObject):'
678 from image data.
680 from image data.
679 For non-embedded images, you can just set the desired display width
681 For non-embedded images, you can just set the desired display width
680 and height directly.
682 and height directly.
683 unconfined: bool
684 Set unconfined=True to disable max-width confinement of the image.
685 metadata: dict
686 Specify extra metadata to attach to the image.
681
687
682 Examples
688 Examples
683 --------
689 --------
@@ -728,6 +734,8 b' class Image(DisplayObject):'
728 self.width = width
734 self.width = width
729 self.height = height
735 self.height = height
730 self.retina = retina
736 self.retina = retina
737 self.unconfined = unconfined
738 self.metadata = metadata
731 super(Image, self).__init__(data=data, url=url, filename=filename)
739 super(Image, self).__init__(data=data, url=url, filename=filename)
732
740
733 if retina:
741 if retina:
@@ -756,12 +764,19 b' class Image(DisplayObject):'
756
764
757 def _repr_html_(self):
765 def _repr_html_(self):
758 if not self.embed:
766 if not self.embed:
759 width = height = ''
767 width = height = klass = ''
760 if self.width:
768 if self.width:
761 width = ' width="%d"' % self.width
769 width = ' width="%d"' % self.width
762 if self.height:
770 if self.height:
763 height = ' height="%d"' % self.height
771 height = ' height="%d"' % self.height
764 return u'<img src="%s"%s%s/>' % (self.url, width, height)
772 if self.unconfined:
773 klass = ' class="unconfined"'
774 return u'<img src="{url}"{width}{height}{klass}/>'.format(
775 url=self.url,
776 width=width,
777 height=height,
778 klass=klass,
779 )
765
780
766 def _data_and_metadata(self):
781 def _data_and_metadata(self):
767 """shortcut for returning metadata with shape information, if defined"""
782 """shortcut for returning metadata with shape information, if defined"""
@@ -770,6 +785,10 b' class Image(DisplayObject):'
770 md['width'] = self.width
785 md['width'] = self.width
771 if self.height:
786 if self.height:
772 md['height'] = self.height
787 md['height'] = self.height
788 if self.unconfined:
789 md['unconfined'] = self.unconfined
790 if self.metadata:
791 md.update(self.metadata)
773 if md:
792 if md:
774 return self.data, md
793 return self.data, md
775 else:
794 else:
@@ -22,6 +22,8 b' def test_image_size():'
22 nt.assert_equal(u'<img src="%s" width="200"/>' % (thisurl), img._repr_html_())
22 nt.assert_equal(u'<img src="%s" width="200"/>' % (thisurl), img._repr_html_())
23 img = display.Image(url=thisurl)
23 img = display.Image(url=thisurl)
24 nt.assert_equal(u'<img src="%s"/>' % (thisurl), img._repr_html_())
24 nt.assert_equal(u'<img src="%s"/>' % (thisurl), img._repr_html_())
25 img = display.Image(url=thisurl, unconfined=True)
26 nt.assert_equal(u'<img src="%s" class="unconfined"/>' % (thisurl), img._repr_html_())
25
27
26 def test_retina_png():
28 def test_retina_png():
27 here = os.path.dirname(__file__)
29 here = os.path.dirname(__file__)
@@ -588,6 +588,7 b' define(['
588 var toinsert = this.create_output_subarea(md, "output_html rendered_html", type);
588 var toinsert = this.create_output_subarea(md, "output_html rendered_html", type);
589 this.keyboard_manager.register_events(toinsert);
589 this.keyboard_manager.register_events(toinsert);
590 toinsert.append(html);
590 toinsert.append(html);
591 dblclick_to_reset_size(toinsert.find('img'));
591 element.append(toinsert);
592 element.append(toinsert);
592 return toinsert;
593 return toinsert;
593 };
594 };
@@ -603,6 +604,7 b' define(['
603 html = mathjaxutils.replace_math(html, math);
604 html = mathjaxutils.replace_math(html, math);
604 toinsert.append(html);
605 toinsert.append(html);
605 });
606 });
607 dblclick_to_reset_size(toinsert.find('img'));
606 element.append(toinsert);
608 element.append(toinsert);
607 return toinsert;
609 return toinsert;
608 };
610 };
@@ -668,6 +670,23 b' define(['
668 return toinsert;
670 return toinsert;
669 };
671 };
670
672
673 function dblclick_to_reset_size (img) {
674 /**
675 * Double-click on an image toggles confinement to notebook width
676 *
677 * img: jQuery element
678 */
679
680 img.dblclick(function () {
681 // dblclick toggles *raw* size, disabling max-width confinement.
682 if (img.hasClass('unconfined')) {
683 img.removeClass('unconfined');
684 } else {
685 img.addClass('unconfined');
686 }
687 });
688 };
689
671 var set_width_height = function (img, md, mime) {
690 var set_width_height = function (img, md, mime) {
672 /**
691 /**
673 * set width and height of an img element from metadata
692 * set width and height of an img element from metadata
@@ -676,6 +695,9 b' define(['
676 if (height !== undefined) img.attr('height', height);
695 if (height !== undefined) img.attr('height', height);
677 var width = _get_metadata_key(md, 'width', mime);
696 var width = _get_metadata_key(md, 'width', mime);
678 if (width !== undefined) img.attr('width', width);
697 if (width !== undefined) img.attr('width', width);
698 if (_get_metadata_key(md, 'unconfined', mime)) {
699 img.addClass('unconfined');
700 }
679 };
701 };
680
702
681 var append_png = function (png, md, element, handle_inserted) {
703 var append_png = function (png, md, element, handle_inserted) {
@@ -689,6 +711,7 b' define(['
689 }
711 }
690 img[0].src = 'data:image/png;base64,'+ png;
712 img[0].src = 'data:image/png;base64,'+ png;
691 set_width_height(img, md, 'image/png');
713 set_width_height(img, md, 'image/png');
714 dblclick_to_reset_size(img);
692 toinsert.append(img);
715 toinsert.append(img);
693 element.append(toinsert);
716 element.append(toinsert);
694 return toinsert;
717 return toinsert;
@@ -706,6 +729,7 b' define(['
706 }
729 }
707 img[0].src = 'data:image/jpeg;base64,'+ jpeg;
730 img[0].src = 'data:image/jpeg;base64,'+ jpeg;
708 set_width_height(img, md, 'image/jpeg');
731 set_width_height(img, md, 'image/jpeg');
732 dblclick_to_reset_size(img);
709 toinsert.append(img);
733 toinsert.append(img);
710 element.append(toinsert);
734 element.append(toinsert);
711 return toinsert;
735 return toinsert;
@@ -66,6 +66,14 b' div.output_area {'
66 margin-right: 0;
66 margin-right: 0;
67 }
67 }
68 }
68 }
69
70 img, svg {
71 max-width: 100%;
72 height: auto;
73 &.unconfined {
74 max-width: none;
75 }
76 }
69 }
77 }
70
78
71 /* This is needed to protect the pre formating from global settings such
79 /* This is needed to protect the pre formating from global settings such
@@ -98,6 +106,8 b' div.output_subarea {'
98 overflow-x: auto;
106 overflow-x: auto;
99 padding: @code_padding;
107 padding: @code_padding;
100 .box-flex1();
108 .box-flex1();
109 // appears to be needed for max-width in children to mean anything on Firefox:
110 max-width: calc(~"100% - 14ex");
101 }
111 }
102
112
103 /* The rest of the output_* classes are for special styling of the different
113 /* The rest of the output_* classes are for special styling of the different
@@ -83,4 +83,11 b''
83 }
83 }
84 * + img {margin-top: 1em;}
84 * + img {margin-top: 1em;}
85
85
86 img, svg {
87 max-width: 100%;
88 height: auto;
89 &.unconfined {
90 max-width: none;
91 }
92 }
86 }
93 }
@@ -35,6 +35,10 b' h1,h2,h3,h4,h5,h6 {'
35 display: none;
35 display: none;
36 }
36 }
37
37
38 .text_cell.rendered .rendered_html {
39 overflow-x: auto;
40 }
41
38 .text_cell.unrendered .text_cell_render {
42 .text_cell.unrendered .text_cell_render {
39 display:none;
43 display:none;
40 }
44 }
@@ -825,6 +825,15 b' div.output_area .rendered_html img {'
825 margin-left: 0;
825 margin-left: 0;
826 margin-right: 0;
826 margin-right: 0;
827 }
827 }
828 div.output_area img,
829 div.output_area svg {
830 max-width: 100%;
831 height: auto;
832 }
833 div.output_area img.unconfined,
834 div.output_area svg.unconfined {
835 max-width: none;
836 }
828 /* This is needed to protect the pre formating from global settings such
837 /* This is needed to protect the pre formating from global settings such
829 as that of bootstrap */
838 as that of bootstrap */
830 .output {
839 .output {
@@ -881,6 +890,7 b' div.output_subarea {'
881 box-flex: 1;
890 box-flex: 1;
882 /* Modern browsers */
891 /* Modern browsers */
883 flex: 1;
892 flex: 1;
893 max-width: calc(100% - 14ex);
884 }
894 }
885 /* The rest of the output_* classes are for special styling of the different
895 /* The rest of the output_* classes are for special styling of the different
886 output types */
896 output types */
@@ -1116,6 +1126,15 b' div.output_unrecognized a:hover {'
1116 .rendered_html * + img {
1126 .rendered_html * + img {
1117 margin-top: 1em;
1127 margin-top: 1em;
1118 }
1128 }
1129 .rendered_html img,
1130 .rendered_html svg {
1131 max-width: 100%;
1132 height: auto;
1133 }
1134 .rendered_html img.unconfined,
1135 .rendered_html svg.unconfined {
1136 max-width: none;
1137 }
1119 div.text_cell {
1138 div.text_cell {
1120 /* Old browsers */
1139 /* Old browsers */
1121 display: -webkit-box;
1140 display: -webkit-box;
@@ -1165,6 +1184,9 b' h6:hover .anchor-link {'
1165 .text_cell.rendered .input_area {
1184 .text_cell.rendered .input_area {
1166 display: none;
1185 display: none;
1167 }
1186 }
1187 .text_cell.rendered .rendered_html {
1188 overflow-x: auto;
1189 }
1168 .text_cell.unrendered .text_cell_render {
1190 .text_cell.unrendered .text_cell_render {
1169 display: none;
1191 display: none;
1170 }
1192 }
@@ -9617,6 +9617,15 b' div.output_area .rendered_html img {'
9617 margin-left: 0;
9617 margin-left: 0;
9618 margin-right: 0;
9618 margin-right: 0;
9619 }
9619 }
9620 div.output_area img,
9621 div.output_area svg {
9622 max-width: 100%;
9623 height: auto;
9624 }
9625 div.output_area img.unconfined,
9626 div.output_area svg.unconfined {
9627 max-width: none;
9628 }
9620 /* This is needed to protect the pre formating from global settings such
9629 /* This is needed to protect the pre formating from global settings such
9621 as that of bootstrap */
9630 as that of bootstrap */
9622 .output {
9631 .output {
@@ -9673,6 +9682,7 b' div.output_subarea {'
9673 box-flex: 1;
9682 box-flex: 1;
9674 /* Modern browsers */
9683 /* Modern browsers */
9675 flex: 1;
9684 flex: 1;
9685 max-width: calc(100% - 14ex);
9676 }
9686 }
9677 /* The rest of the output_* classes are for special styling of the different
9687 /* The rest of the output_* classes are for special styling of the different
9678 output types */
9688 output types */
@@ -9908,6 +9918,15 b' div.output_unrecognized a:hover {'
9908 .rendered_html * + img {
9918 .rendered_html * + img {
9909 margin-top: 1em;
9919 margin-top: 1em;
9910 }
9920 }
9921 .rendered_html img,
9922 .rendered_html svg {
9923 max-width: 100%;
9924 height: auto;
9925 }
9926 .rendered_html img.unconfined,
9927 .rendered_html svg.unconfined {
9928 max-width: none;
9929 }
9911 div.text_cell {
9930 div.text_cell {
9912 /* Old browsers */
9931 /* Old browsers */
9913 display: -webkit-box;
9932 display: -webkit-box;
@@ -9957,6 +9976,9 b' h6:hover .anchor-link {'
9957 .text_cell.rendered .input_area {
9976 .text_cell.rendered .input_area {
9958 display: none;
9977 display: none;
9959 }
9978 }
9979 .text_cell.rendered .rendered_html {
9980 overflow-x: auto;
9981 }
9960 .text_cell.unrendered .text_cell_render {
9982 .text_cell.unrendered .text_cell_render {
9961 display: none;
9983 display: none;
9962 }
9984 }
@@ -142,6 +142,9 b" width={{output.metadata['image/png']['width']}}"
142 {%- if 'height' in output.metadata.get('image/png', {}) %}
142 {%- if 'height' in output.metadata.get('image/png', {}) %}
143 height={{output.metadata['image/png']['height']}}
143 height={{output.metadata['image/png']['height']}}
144 {%- endif %}
144 {%- endif %}
145 {%- if output.metadata.get('image/png', {}).get('unconfined') %}
146 class="unconfined"
147 {%- endif %}
145 >
148 >
146 </div>
149 </div>
147 {%- endblock data_png %}
150 {%- endblock data_png %}
General Comments 0
You need to be logged in to leave comments. Login now