Create an HTML dependency for the D3 library.

html_dependency_d3(version = c("5", "4", "3"))

Arguments

version

Major version of D3

Details

Create an HTML dependency for a version of D3. Each version has a distinct root D3 object so it's possible to combine multiple versions of D3 on a single page. For example, D3 v5 is accessed via d3v5 and D3 v4 is accessed via d3v4. Note however that D3 v3 is accessed via simply d3 (for compabibilty with existing htmlwidgets that use this form).

Note

This function is exported for use by htmlwidgets. If you are using the r2d3() function to include D3 code within a document or application this dependency is included automatically so calling this function is unnecessary.