Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The trouble is that the map is saved as a local HTML file (<code>rChart_map.html</code>) and is hence not accessible to nbviewer when you are trying to view it online. </p> <p>Even if you upload <code>rChart_map.html</code> to the gist, it won't show up due to path issues. Locally, you need to refer to it as <code>/files/rChart_map.html</code> in your IPython notebook, whereas online, it has a different path. I had posted this issue earlier on twitter using the #IPython tag, but got no responses on how to debug.</p> <p>So where does that leave us. Well, fortunately, most modern browsers allow an iframe to contain inline HTML using the <code>srcdoc</code> tag. This allows the generated <code>.ipynb</code> file to be standalone, as seen <a href="http://nbviewer.ipython.org/gist/ramnathv/8172138" rel="nofollow">here</a>, at the end of the file.</p> <p>The key is to use the following code. The first line creates an iframe with inline html of the map and stores it in the python variable <code>map2</code>. The second line imports the necessary python modules and the third line displays the HTML. Note that we use <code>h2[0]</code>, since <code>map2</code> is an array, due to conversion from R, which is vectorized.</p> <pre><code>map2 = %R paste(capture.output(map$show('iframesrc', cdn = TRUE)), collapse = '\n') from IPython.display import display, HTML HTML(map2[0]) </code></pre> <p>For this to work, you will need to have <code>rCharts</code> version > 0.4.1. </p> <p>I am interested in making it easier for <code>rCharts</code> to be used in IPython notebooks. So any suggestions/feedback is welcome.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload