d3.js helpers for R
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
Please see this Building Widgets blog post Why d3r?.
d3ris on CRAN, so install with
install.packages("d3r")or for the absolute latest use
d3.jsdependency injection in R easy with
d3_dep_v5(). These functions work well with
check web developer tools to see d3 is available
browsable( attachDependencies( tagList(), d3_dep_v5() ) )
or include directly in a taglist; I prefer this method.
browsable( tagList( h1("I have d3 version ", span(id="version")), tags$script("d3.select('#version').text(d3.version)"), d3_dep_v5() ) )
Also, I will commit to keeping
d3.js, so you’ll no longer need multiple copies of
htmlwidgets. If you are a
htmlwidgetauthor, you will no longer need to worry every time
d3.jsgets a new release. See
treebarlines for an example of using
d3.jshierarchies can be very difficult.
data.frameto a nested
d3.jshierarchy ready for work with
As another example, let’s go from
d3_nest( treemap::random.hierarchical.data(), value_cols = "x" )
rpartand similar objects in
Rare very difficult to convert but make perfect subjects for
d3_partyhelps convert these objects for easy usage with
example from ?rpart
data("kyphosis", package="rpart") rp
d3 Network from igraphigraphtod3.jsnetwork ofnodesandlinksis a very common conversion.d3r::d3_igraphwill do this for you.library(igraph) library(d3r)
d3_igraph(igraph::watts.strogatz.game(1, 50, 4, 0.05))
I have a whole lot of ideas. Please let me know yours, and let’s make this package great.
Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.