Site icon R-bloggers

D3PartitionR 0.3.0 is available on CRAN

[This article was first published on R – Enhance Data, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Yesterday, the new version of D3partitionR was uploaded on CRAN, this version contains some major improvements.

1. General layout:

Before this update, the height and width of the widget were somehow messy and so was the global layout. The layout is now the following:

In previous version, the chart size wasn’t responsive to the chart options (Title or not, trail or not, Legend or not).

2. Bootstrap tooltip

In previous versions, the tooltip was sometime badly positioned (for exemple when scrolling the page, or placing the chart in a box). I replaced the homemade tooltip with the one from bootstrap which use tether.js library for positioning, this should made the positioning much more robust (you can see it on the Japan trade app for instance).

Before the update: Tooltip isn’t on the node

After the update: Tooltip is properly positioned

3. Trail and sequence visualisation:

Sometimes when you zoom on some part of the chart, you may forget where you’re really in the current sequence.

Using the breadcrumb trail from https://bl.ocks.org/kerryrodden/7090426 , you now can see where you are positioned in the chart and get the size of the different steps.

Exemple of the new trail

##Code used to create the visualisation above
library(D3partitionR)
D3partitionR(T,width=600,height=600,legend=list(type="sequential",
color=list(B="#e8ae46",C="#bf3a8e")),title=list(text="My Title"),trail=TRUE)

4. Future developments

One of the major improvement that could be made, would be to make the package compatible with hclust and other hierarchical data formats from R. Hopefully, v0.4.0 will make it possible to use D3partitionR with hclust objects and nested lists (instead of using the list format which can be tricky sometimes).
The two main issues to be tackled to add these functionalities are:

 

Best,
Antoine

 

 

 


To leave a comment for the author, please follow the link and comment on their blog: R – Enhance Data.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.