Want to share your content on R bloggers? click here if you have a blog, or here if you don’t.
If this post is useful to you, I kindly ask for a minimum donation Buy me a coffee. It will be used to continue my Open Source efforts.
You can send me questions for the blog at this form and subscribe to receive an email when there is a new post.
D3po is a set of templates for D3 (version 7+) that allows you to create interactive charts in R and Shiny without messing with JavaScript. It is open source (Apache 2.0), so you can use it for free, even in government or NGO projects. It doesn’t have advanced features like commercial libraries like Highcharts, but it covers the basics: area, box, column, ring, map, line, network, pie, scatter, and tree charts. You can automatically resize content and export diagrams as SVG or PNG.
Here’s a video showing what D3po can do:
D3po was stuck at version 0.5.5 for a long time. The reason was that it was not easy to update it. I wrote D3po 0.1 in 2015 with D3 3.5 while working for the government of Chile. Over the years I added more features and fixed bugs until version 0.5.5 towards the end of 2019. At that time I wanted to rewrite the D3 templates to use D3 5.8.0, but shortly after COVID-19 hit I had to focus on other things, and struggling to break changes in D3 was not a priority.
Finally I decided to take the plunge and rewrite the templates. It’s been a while, but I’m happy to announce that D3po 1.0.0 is now available on the R-Universe. The updated CRAN release will have to wait until next week.
Install it from R-Universe:
install.packages("d3po", repos = "https://pachadotdev.r-universe.dev")Or from GitHub:
remotes::install_github("pachadotdev/d3po")Here’s an example of how to create a box-and-whiskers plot:
d3po(pokemon) %>%
po_box(daes(x = type_1, y = speed, color = color_1)) %>%
po_title("Distribution of Pokemon speed by main type")For more, see the vignettes and the Shiny demo app: https://github.com/pachadotdev/d3po/tree/main/d3podemo
I hope it’s useful!
Related
#D3po #1.0.0 #bloggers


