{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "@python\n",
    "import ipywidgets as widgets\n",
    "from IPython.display import display, clear_output\n",
    "\n",
    "def print_cube(dim):\n",
    "    kernel = get_ipython().kernel\n",
    "    output=kernel._run_polymake_command( \"johnson_solid(\" + str(dim) +\")->VISUAL\" )\n",
    "    stream_content = { 'wait': False }\n",
    "    kernel.send_response( kernel.iopub_socket, 'clear_output', stream_content )\n",
    "    stream_content = { 'data': { 'text/html': output[output.find(\".@@HTML@@\") + 9:-12]  } }\n",
    "    kernel.send_response( kernel.iopub_socket, 'display_data', stream_content )\n",
    "display(interactive(print_cube,__manual=True,dim=(1,92)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "polymake",
   "language": "polymake",
   "name": "polymake"
  },
  "language_info": {
   "codemirror_mode": "perl",
   "file_extension": ".pm",
   "mimetype": "text/x-polymake",
   "name": "polymake"
  },
  "widgets": {
   "state": {
    "d6b16eac4d314714bfdfff1c4fba92e7": {
     "views": [
      {
       "cell_index": 0
      }
     ]
    }
   },
   "version": "1.2.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
