Show More
@@ -17,6 +17,7 b' mime = {' | |||||
17 |
|
17 | |||
18 | var black_dot_jpeg="\"\"\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDACodICUgGiolIiUvLSoyP2lEPzo6P4FcYUxpmYagnpaG\nk5GovfLNqLPltZGT0v/V5fr/////o8v///////L/////2wBDAS0vLz83P3xERHz/rpOu////////\n////////////////////////////////////////////////////////////wgARCAABAAEDAREA\nAhEBAxEB/8QAFAABAAAAAAAAAAAAAAAAAAAABP/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEA\nAhADEAAAARn/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/9oACAEBAAEFAn//xAAUEQEAAAAAAAAAAAAA\nAAAAAAAA/9oACAEDAQE/AX//xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oACAECAQE/AX//xAAUEAEA\nAAAAAAAAAAAAAAAAAAAA/9oACAEBAAY/An//xAAUEAEAAAAAAAAAAAAAAAAAAAAA/9oACAEBAAE/\nIX//2gAMAwEAAgADAAAAEB//xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oACAEDAQE/EH//xAAUEQEA\nAAAAAAAAAAAAAAAAAAAA/9oACAECAQE/EH//xAAUEAEAAAAAAAAAAAAAAAAAAAAA/9oACAEBAAE/\nEH//2Q==\"\"\""; |
|
18 | var black_dot_jpeg="\"\"\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDACodICUgGiolIiUvLSoyP2lEPzo6P4FcYUxpmYagnpaG\nk5GovfLNqLPltZGT0v/V5fr/////o8v///////L/////2wBDAS0vLz83P3xERHz/rpOu////////\n////////////////////////////////////////////////////////////wgARCAABAAEDAREA\nAhEBAxEB/8QAFAABAAAAAAAAAAAAAAAAAAAABP/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEA\nAhADEAAAARn/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/9oACAEBAAEFAn//xAAUEQEAAAAAAAAAAAAA\nAAAAAAAA/9oACAEDAQE/AX//xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oACAECAQE/AX//xAAUEAEA\nAAAAAAAAAAAAAAAAAAAA/9oACAEBAAY/An//xAAUEAEAAAAAAAAAAAAAAAAAAAAA/9oACAEBAAE/\nIX//2gAMAwEAAgADAAAAEB//xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oACAEDAQE/EH//xAAUEQEA\nAAAAAAAAAAAAAAAAAAAA/9oACAECAQE/EH//xAAUEAEAAAAAAAAAAAAAAAAAAAAA/9oACAEBAAE/\nEH//2Q==\"\"\""; | |
19 | var black_dot_png = '\"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAWJLR0QA\\niAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB94BCRQnOqNu0b4AAAAKSURBVAjXY2AA\\nAAACAAHiIbwzAAAAAElFTkSuQmCC\"'; |
|
19 | var black_dot_png = '\"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAWJLR0QA\\niAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB94BCRQnOqNu0b4AAAAKSURBVAjXY2AA\\nAAACAAHiIbwzAAAAAElFTkSuQmCC\"'; | |
|
20 | var svg = "\"<svg width='1cm' height='1cm' viewBox='0 0 1000 500'><defs><style>rect {fill:red;}; </style></defs><rect id='r1' x='200' y='100' width='600' height='300' /></svg>\"" | |||
20 |
|
21 | |||
21 | // helper function to ensure that the short_name is found in the toJSON |
|
22 | // helper function to ensure that the short_name is found in the toJSON | |
22 | // represetnation, while the original in-memory cell retains its long mimetype |
|
23 | // represetnation, while the original in-memory cell retains its long mimetype | |
@@ -186,4 +187,25 b' casper.notebook_test(function () {' | |||||
186 | this.then(function ( ) { |
|
187 | this.then(function ( ) { | |
187 | check_output_area.apply(this, ['display_data', ['text', 'jpeg']]); |
|
188 | check_output_area.apply(this, ['display_data', ['text', 'jpeg']]); | |
188 | }); |
|
189 | }); | |
|
190 | ||||
|
191 | this.then(function() { | |||
|
192 | clear_and_execute(this, | |||
|
193 | "from IPython.core.display import SVG; SVG(" + svg + ")"); | |||
|
194 | }); | |||
|
195 | ||||
|
196 | this.then(function ( ) { | |||
|
197 | check_output_area.apply(this, ['pyout', ['text', 'svg']]); | |||
|
198 | }); | |||
|
199 | ||||
|
200 | this.then(function() { | |||
|
201 | clear_and_execute(this, | |||
|
202 | "from IPython.core.display import SVG, display; display(SVG(" + svg + "))"); | |||
|
203 | }); | |||
|
204 | ||||
|
205 | this.then(function ( ) { | |||
|
206 | check_output_area.apply(this, ['display_data', ['text', 'svg']]); | |||
|
207 | }); | |||
|
208 | ||||
|
209 | this.thenEvaluate(function() { IPython.notebook.save_notebook(); }); | |||
|
210 | ||||
189 | }); |
|
211 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now