2

I just submitted drake 4.0.0 to CRAN, and the vignettes did not come out properly. To include visNetwork widgets, I used code chunks to write external HTML files and then iframe tags to embed the HTML back into the vignettes. (Self-contained vignettes with HTML widgets require pandoc, which would make the Mac and Solaris CRAN checks spout warnings.) I see a 404 error everywhere there should be an interactive graph. I have tried to use the vignettes/.install_extras file from R Extensions Manual, but without success.

EDIT So if I want to embed a moderate-sized HTML widget in a vignette, it seems like all current options violate CRAN guidelines:

  1. Embed the widget in the vignette the natural way. Unfortunately, this approach requires pandoc and enlarges the file size of the vignette, both of which generate warnings and notes in CRAN checks.
  2. Generate the widget as a collection of external HTML files and embed the root file as an iframe.

    a. If those html files do not end up in inst/doc, the widget is not displayed at all.

    b. If they do end up in inst/doc, then the files will be so big that they generate notes in CRAN checks.

Am I missing something? I do plan to give up on interactivity in vignettes for the next drake patch, but I am disappointed that it came to that.

landau
  • 5,636
  • 1
  • 22
  • 50
  • 1
    I think if the files are large, there's no way to avoid the file size warnings. An alternative, I suppose, would be to include the widgets remotely in the iframes (e.g., from GitHub pages). But there's no guarantee they would work when viewed locally without internet access, which maybe doesn't matter. – Thomas Aug 08 '17 at 09:25
  • The more I think about it, the more I think remote access is the way to go. Thanks +Thomas. – landau Aug 11 '17 at 01:36

1 Answers1

0

You've described exactly my own predicament right now with package DTAT, down to the last detail! (Compare the fully functioning copy of my vignette here.)

I understand from an exchange with Kurt Hornik (all credit to him) that the process which copies vignettes over to the package web area on CRAN may focus only on files listed in the "Vignettes from package..." table in index.html, neglecting the "Other files" table:

<h2>Vignettes from package 'DTAT'</h2>
<table width="100%">
<col style="width: 22%;" />
<col style="width:  2%;" />
<col style="width: 50%;" />
<col style="width:  8%;" />
<col style="width:  8%;" />
<col style="width:  8%;" />
<tr><td style="text-align: right; vertical-align: top;"><a href="../../../library/DTAT/doc/Designing-33PC.html">DTAT::Designing-33PC</a></td>
<td></td><td valign="top">Exploring the '3+3/PC' dose-titration design</td>
<td valign="top"><a href="../../../library/DTAT/doc/Designing-33PC.html">HTML</a></td>
<td valign="top"><a href="../../../library/DTAT/doc/Designing-33PC.Rmd">source</a></td>
<td valign="top" style="white-space: nowrap"><a href="../../../library/DTAT/doc/Designing-33PC.R">R code</a></td></tr>
</table>
<h2>Other files in the <span class="samp">doc</span> directory</h2>
<table width="100%">
<col style="width: 24%;" />
<col style="width: 50%;" />
<col style="width: 24%;" />
<tr><td></td><td><span class="samp"><a href="DTAT-package.bib">DTAT-package.bib</a></span></td></tr>
<tr><td></td><td><span class="samp"><a href="widget_D3-viz.html">widget_D3-viz.html</a></span></td></tr>
</table>

I should think the solution is simply to repair whatever CRAN script performs this copying-over, so that it scrapes the "Other files..." table also. Perhaps this script should also (or instead) respect the contents of .install_extras.


ADDENDUM: My understanding is that this has just now [6 hours after my original post] been fixed by Kurt Hornik, and I see in fact that my package vignette on CRAN now includes its embedded widget.