Using Interactive D3.js charts from within Tiki with rNVD3

May 10, 2013

(This article was first published on UEB Blog. Musings on R, and kindly contributed to R-bloggers)

I’ve recently managed to reproduce my first charts using the nice package rNVD3 from Ramnath Vaidyanathan:

This rNVD3 package uses NVD3, which provides re-usable charts with d3.js, without taking away the power that d3.js brings with itself. But let’s make a “Hello world” type of example, with the minimum complexity in it.

For this, I just needed to copy one of Ramnath’s examples, but I will save the html to disk, with something like object$save('foo.html') instead of object$printChart('foo.html'). used in his example

And then, you can load the html in a wiki page with an iframe. Easy.

Proof of concept

A working proof-of-concept reusing your rNVD3 package can be found here:

The main code is this one:

Error Plugin execution pending approval

This plugin was recently added or modified. Until an editor of the site validates the parameters, execution will not be possible.

Error Plugin execution pending approval

This plugin was recently added or modified. Until an editor of the site validates the parameters, execution will not be possible.


And once everything is ready in your system (all packages installed, etc), you’ll see something like this:

Click to enlarge

Click to enlarge

And when you change from “Grouped display” to “Stacked display”, you will see a transition of data changing from one display to the other in real time in your browser, ending with this:

Click to enlarge

Click to enlarge


The Web platform to manage the whole thing is Tiki ( ), and the communication with R is handled by PluginR ( ), as usual with most of our work.

This example has been added as a new test (r_test7) in the Tiki configuration profile . Therefore, when you apply ( ~ install) this profile in your Tiki, you’ll have this whole test loaded in a new wiki page, handy for you to play with it.

Future work

For later I leave my goal to achieve running some shiny app from a Wiki page in Tiki (in case this is possible!, which I’m not sure yet, maybe some new development is needed)

First impressions

For the time being, I’m quite glad with the first impression by the rNVD3 author (Ramnath Vaidyanathan) when he first knew about this proof-of-concept a few hours ago:

Ramnath Vaidyanathan wrote:
First off, nice work embedding it in a Wiki. A key objective of rCharts is to make it easy to share charts and this is a great way to do it.

Oh well, thanks for you nice words. Some more work is in the oven with PluginR, so stay tuned! :-)

To leave a comment for the author, please follow the link and comment on their blog: UEB Blog. Musings on R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Mango solutions

plotly webpage

dominolab webpage

Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training




CRC R books series

Six Sigma Online Training

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)