diff --git a/.Rbuildignore b/.Rbuildignore index a8df264..508b8ef 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -23,3 +23,4 @@ tools/gallery-template.Rmd ^\.github$ ^codecov\.yml$ ^docs$ +^cran-comments\.md$ diff --git a/DESCRIPTION b/DESCRIPTION index d2a4b12..27f5866 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,12 @@ Package: r2d3 Type: Package Title: Interface to 'D3' Visualizations -Version: 0.2.5 +Version: 0.2.6 Authors@R: c( person("Nick", "Strayer", email = "nick.strayer@rstudio.com", role = c("aut", "cre")), person("Javier", "Luraschi", email = "jluraschi@gmail.com", role = c("aut")), person("JJ", "Allaire", role = c("aut")), - person("Mike", "Bostock", role = c("ctb", "cph"), comment = "d3.js library, http://d3js.org"), + person("Mike", "Bostock", role = c("ctb", "cph"), comment = "d3.js library, https://d3js.org"), person(family = "RStudio", role = c("cph")) ) Description: Suite of tools for using 'D3', a library for producing dynamic, interactive data diff --git a/NEWS.md b/NEWS.md index 867c2b9..4d063d5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# r2d3 0.2.6 + +- Fix bug that would cause multiple dependencies for css or js to silently fail. + # r2d3 0.2.5 - Support for D3 v6 (@dkjoluju, #85). @@ -28,4 +32,4 @@ - Publish D3 visualizations to the web - Incorporate D3 scripts into R Markdown reports, presentations, and dashboards - Create interacive D3 applications with Shiny -- Distribute D3 based htmlwidgets in R packages \ No newline at end of file +- Distribute D3 based htmlwidgets in R packages diff --git a/R/script.R b/R/script.R index 25d34e9..21c27b3 100644 --- a/R/script.R +++ b/R/script.R @@ -29,12 +29,16 @@ script_wrap <- function(deps, script, container) { ) } + script_read <- function(script) { - if ( - is.null(script) || + # Make sure we can properly resolve the scripts as files. If we can't, because + # none were passed or because the script was just in-lined, then just return + # the scripts back to the caller + unresolvable_script_paths <- is.null(script) || length(script) == 0 || any(!file.exists(script)) - ) { + + if (unresolvable_script_paths) { return(script) } diff --git a/R/zzz.R b/R/zzz.R index 509b908..05d1d8f 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -14,7 +14,7 @@ if (rstudio$version < "1.2.637") packageStartupMessage( "r2d3 should be run under RStudio v1.2 or higher. Please update at:\n", - "https://rstudio.com/products/rstudio/download/\n" + "https://www.rstudio.com/products/rstudio/download/\n" ) } } diff --git a/README.md b/README.md index 70cbbba..3fcb450 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ visualizations](https://d3js.org/) with R, including: - Creating interactive D3 applications with [Shiny](https://shiny.rstudio.com/) -- Distributing D3 based [htmlwidgets](http://www.htmlwidgets.org) in R +- Distributing D3 based [htmlwidgets](https://www.htmlwidgets.org) in R packages
diff --git a/vignettes/gallery/morley/box.js b/vignettes/gallery/morley/box.js
index 3e800d3..07fbf57 100644
--- a/vignettes/gallery/morley/box.js
+++ b/vignettes/gallery/morley/box.js
@@ -1,6 +1,6 @@
(function() {
-// Inspired by http://informationandvisualization.de/blog/box-plot
+// Inspired by https://informationandvisualization.de/blog/box-plot
d3.box = function() {
var width = 1,
height = 1,
diff --git a/vignettes/gallery/stackedbars/stackedbars.js b/vignettes/gallery/stackedbars/stackedbars.js
index 1ed39b3..f295653 100644
--- a/vignettes/gallery/stackedbars/stackedbars.js
+++ b/vignettes/gallery/stackedbars/stackedbars.js
@@ -1,6 +1,6 @@
// !preview r2d3 d3_version = 4
-// Based on: http://bl.ocks.org/mbostock/3943967
+// Based on: https://bl.ocks.org/mbostock/3943967
var n = 4, // The number of series.
m = 58; // The number of values per series.
@@ -102,7 +102,7 @@ function transitionStacked() {
// Returns an array of m psuedorandom, smoothly-varying non-negative numbers.
// Inspired by Lee Byron’s test data generator.
-// http://leebyron.com/streamgraph/
+// https://leebyron.com/streamgraph/
function bumps(m) {
var values = [], i, j, w, x, y, z;
diff --git a/vignettes/publishing.Rmd b/vignettes/publishing.Rmd
index 971ff66..fc1d907 100644
--- a/vignettes/publishing.Rmd
+++ b/vignettes/publishing.Rmd
@@ -127,11 +127,11 @@ Note that in order to use the `d3` engine you need to add `library(r2d3)` to the
### flexdashboard
-The [flexdashboard](https://rmarkdown.rstudio.com/flexdashboard) R Markdown format is a great way to publish a set of related D3 visualizations. You can use flexdashbaord to combine D3 visualizations with narrative, data tables, other [htmlwidgets](http://www.htmlwidgets.org), and static R plots:
+The [flexdashboard](https://pkgs.rstudio.com/flexdashboard/) R Markdown format is a great way to publish a set of related D3 visualizations. You can use flexdashbaord to combine D3 visualizations with narrative, data tables, other [htmlwidgets](https://www.htmlwidgets.org), and static R plots:
-Check out the [flexdashboard online documentation](https://rmarkdown.rstudio.com/flexdashboard) for additional details.
+Check out the [flexdashboard online documentation](https://pkgs.rstudio.com/flexdashboard/) for additional details.
## Shiny applications
diff --git a/vignettes/shiny.Rmd b/vignettes/shiny.Rmd
index 2d3a117..53212fd 100644
--- a/vignettes/shiny.Rmd
+++ b/vignettes/shiny.Rmd
@@ -158,7 +158,7 @@ In the D3 script, we called `Shiny.setInputValued()` with an input named `bar_cl
The `output$selected()` function uses `renderText()` to display the cosine of the bar that was clicked on. The call to `input$bar_clicked` is used inside `renderText()` to execute the `cos()` calculation.
-The default value of `input$bar_clicked` will be `NULL` at the startup of the app. In this state you won't want to perform any calculation (as it would result in an error) or display any output. Shiny's `req()` function can be used to prevent errors in this case `req()` stops reactivity if the value of the variable passed as an argument is not valid, read more about this function in Shiny's official site: [Check for required values](http://shiny.rstudio.com/reference/shiny/latest/req.html)
+The default value of `input$bar_clicked` will be `NULL` at the startup of the app. In this state you won't want to perform any calculation (as it would result in an error) or display any output. Shiny's `req()` function can be used to prevent errors in this case `req()` stops reactivity if the value of the variable passed as an argument is not valid, read more about this function in Shiny's official site: [Check for required values](https://shiny.rstudio.com/reference/shiny/latest/req.html)
Here is the Shiny application in action:
diff --git a/vignettes/visualization_options.Rmd b/vignettes/visualization_options.Rmd
index 0dc2863..33cd75c 100644
--- a/vignettes/visualization_options.Rmd
+++ b/vignettes/visualization_options.Rmd
@@ -106,7 +106,7 @@ When you render a D3 visualization, **r2d3** creates an R [htmlwidget](http://ww
2) Conforming to the currently active `fig.width` and `fig.height` chunk options within [R Markdown](https://rmarkdown.rstudio.com) documents.
-3) Filling available space when used in a [Shiny application](https://shiny.rstudio.com) or a [flexdashboard](https://rmarkdown.rstudio.com/flexdashboard).
+3) Filling available space when used in a [Shiny application](https://shiny.rstudio.com) or a [flexdashboard](https://pkgs.rstudio.com/flexdashboard/).
In order to take advantage of this dynamic sizing behavior, your should ensure that your D3 visualization uses the `width` and `height` variables that are provided automatically. Note the use of `height` in the computation of `barHeight` and `width` in the call to `.attr()` in this example:
@@ -175,5 +175,5 @@ The `viewer` argument to the `r2d3()` function enables you to customize how D3 v
The "external" option is useful if your visualization requires more space than an RStudio pane affords. The "browser" option is useful if you need access to browser debugging tools during development.
-Note that the `viewer` options described above are only fully supported within the [preview release of RStudio v1.2](https://rstudio.com/products/rstudio/download/) (as opposed to the current stable release).
+Note that the `viewer` options described above are only fully supported within the [preview release of RStudio v1.2](https://www.rstudio.com/products/rstudio/download/) (as opposed to the current stable release).