Sunburst 'Htmlwidget'

Make interactive 'd3.js' sequence sunburst diagrams in R with the convenience and infrastructure of an 'htmlwidget'.

Travis-CI Build Status CRAN_Status_Badge

Note: this is a working htmlwidget first released in the Building Widgets htmlwidget-a-week project. sunburstR has already seen extensive use in many projects across multiple domains. If you have any interest in collaborating with me on this project or applying sunburstR, please let me know (see Time Isn't Money).


Easily make these interactive d3.js sequence sunburst charts in R modeled on this example from Kerry Rodden. For more details, see this post Week 26 | sunburstR from the BuildingWidgets blog.


See the examples.


These are still far from feature-complete. I would love your input, feedback, and comments.

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.


sunburstR 2.1.1

sunburstR 2.1.0

  • update d2b so that pre-summed trees correctly handled; (see issue 78 and issue 62)

sunburstR 2.0.0

  • add sumNodes argument to correctly handle pre-summed trees, like treemap::treemap to not double count the aggregate (see issue)

  • add sund2b() htmlwidget for a d2b sunburst chart

  • allow turning off the legend with argument legend = FALSE (see issue)

  • fix bug to not duplicate svg for breadcrumbs on resize or re-render

sunburstR 1.0.3

  • change text color in legend and breadcrumb to white or black for legibility using d3plus

sunburstR 1.0.2

  • changes required in downstream d3r to work with new tidyr (0.7.0), so now working and tested

sunburstR 1.0.1

  • improve internal csv_to_hier() with delimiter argument and smart convert for root level

sunburstR 1.0.0

see sunburstR v1 Github Project


  • update to d3v4; thanks @cjyetman (see issue 36)
  • convert JS to standalone build to prevent conflicts with other non-d3v4 htmlwidgets (see issue 40)
  • begin to modularize JavaScript (see issue 37)

API Changes

  • BREAKING csvdata and jsondata deprecated in favor of single data argument (see issue 43)
  • add dplyr to IMPORTS
  • convert csv hierarchy on the R side instead of JS side; slightly slower but will work to improve

sunburstR 0.6.5

Bug Fix

  • fix legend bug introduced with new color functionality; see issue and commit

sunburstR 0.6.4

see treemap example

  • add valueField argument to sunburst() to allow fields in json to be something other than "size" commit
  • add ability to supply a JavaScript function to colors for advanced color customization or to use a color field from data as the color fill commit

sunburstR 0.6.3


  • use the new CRAN package d3r for d3.js dependencies

sunburstR 0.6.2


  • update d3.js to most recent tagged v3 release commit

sunburstR 0.6.1

New Features

  • add click to dispatch for click event handling commit
  • add click to add_shiny and provide examples commit and commit

Bug Fix

  • try to fix breadcrumb sizing bug for Firefox, Safari commit

sunburstR 0.6

  • CRAN release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


2.1.5 by Kent Russell, 6 months ago

Report a bug at

Browse source code at

Authors: Mike Bostock [aut, cph] (d3.js library , , Kerry Rodden [aut, cph] (sequences library in htmlwidgets/lib , , Kevin Warne [aut, cph] (d2b sunburst library in htmlwidgets/lib , , Kent Russell [aut, cre] (R interface) , Florian Breitwieser [ctb] (R interface) , CJ Yetman [ctb] (R interface ,

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports d3r, dplyr, htmlwidgets, htmltools

Suggests jsonlite, knitr, markdown, pipeR, testthat, tidyr, rmarkdown

Enhances treemap

Imported by modchart.

See at CRAN