Skip to content

Commit 0c5fcef

Browse files
authored
Merge pull request #2 from ropensci/master
Update to 4.9.2.9000
2 parents a6af69e + 397a1bf commit 0c5fcef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+165
-75
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: plotly
22
Title: Create Interactive Web Graphics via 'plotly.js'
3-
Version: 4.9.1.9000
3+
Version: 4.9.2.9000
44
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
55
email = "[email protected]", comment = c(ORCID = "0000-0002-4958-2844")),
66
person("Chris", "Parmer", role = "aut",
@@ -72,6 +72,6 @@ Suggests:
7272
plotlyGeoAssets,
7373
forcats
7474
LazyData: true
75-
RoxygenNote: 7.0.2
75+
RoxygenNote: 7.1.0
7676
Encoding: UTF-8
7777
Roxygen: list(markdown = TRUE)

NEWS.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
# 4.9.1.9000
1+
# 4.9.2.9000
2+
3+
## IMPROVEMENTS
4+
5+
## BUG FIXES
6+
7+
# 4.9.2.1
8+
9+
This is minor patch release with a few minor bug fixes and updates test expectations in anticipation of new R 4.0 defaults.
10+
11+
## BUG FIXES
12+
13+
* Fixes rendering issues non-HTML **rmarkdown** output formats, which was introduced in the 4.9.2 release (#1702).
14+
* Fixes a `ggplotly()` bug in axis tick translation (#1725, #1721).
15+
* `plot_mapbox()` now correctly defaults to a scattermapbox trace (unless z is present, then it defaults to choroplethmapbox) (#1707).
16+
* `ggplotly()` now correctly resolves overlapping axis tick text in `coord_sf()` (#1673).
17+
* A false-positive warning is no longer thrown when attempting to cast `toWebGL()` (#1569).
18+
19+
# 4.9.2
220

321
## Changes to plotly.js
422

@@ -11,6 +29,7 @@
1129
## BUG FIXES
1230

1331
* `add_sf()`/`geom_sf()` now correctly handle geometry columns that are named something other than `"geometry"` (#1659).
32+
* Specifying an english locale no longer results in error (#1686).
1433

1534
# 4.9.1
1635

R/ggplotly.R

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,13 @@ gg2list <- function(p, width = NULL, height = NULL,
612612
if ("CoordSf" %in% class(p$coordinates)) {
613613
# see CoordSf$render_axis_v
614614
direction <- if (xy == "x") "E" else "N"
615-
idx <- rng$graticule$type == direction & !is.na(rng$graticule$degree_label)
615+
idx <- rng$graticule$type == direction &
616+
!is.na(rng$graticule$degree_label) &
617+
# Respect the logical 'plot12' column which sf constructs for
618+
# determining which tick labels should be drawn
619+
# https://github.com/r-spatial/sf/blob/b49d37/R/graticule.R#L199
620+
# https://github.com/r-spatial/sf/blob/52a8351/R/plot.R#L580
621+
(rng$graticule$plot12 %||% TRUE)
616622
tickData <- rng$graticule[idx, ]
617623
# TODO: how to convert a language object to unicode character string?
618624
rng[[paste0(xy, ".labels")]] <- sub(
@@ -687,8 +693,9 @@ gg2list <- function(p, width = NULL, height = NULL,
687693
tickvals <- rng[[xy]]$break_positions %()% rng[[paste0(xy, ".major")]]
688694

689695
# https://github.com/tidyverse/ggplot2/pull/3566#issuecomment-565085809
690-
ticktext <- ticktext[!is.na(ticktext)]
691-
tickvals <- tickvals[!is.na(tickvals)]
696+
hasTickText <- !(is.na(ticktext) | is.na(tickvals))
697+
ticktext <- ticktext[hasTickText]
698+
tickvals <- tickvals[hasTickText]
692699

693700
axisObj <- list(
694701
# TODO: log type?

R/plotly.R

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ as_widget <- function(x, ...) {
430430
# we shouldn't need it because Object.setPrototypeOf() is pretty widely supported
431431
# https://github.com/plotly/plotly.js/issues/4556#issuecomment-583061419
432432
# https://caniuse.com/#search=setPrototypeOf
433-
if (isTRUE(getOption("shiny.testmode"))) {
433+
if (needsPrototypePolyfill()) {
434434
list(setPrototypeOfPolyfill())
435435
},
436436
list(typedArrayPolyfill()),
@@ -441,6 +441,18 @@ as_widget <- function(x, ...) {
441441
)
442442
}
443443

444+
needsPrototypePolyfill <- function() {
445+
if (isTRUE(getOption("shiny.testmode"))) {
446+
return(TRUE)
447+
}
448+
449+
if (isTRUE(getOption("knitr.in.progress"))) {
450+
return(!knitr::is_html_output())
451+
}
452+
453+
return(FALSE)
454+
}
455+
444456
setPrototypeOfPolyfill <- function() {
445457
htmltools::htmlDependency(
446458
name = "setprototypeof",

R/plotly_build.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,13 @@ plotly_build.plotly <- function(p, registerFrames = TRUE) {
109109
if (is_mapbox(p) || is_geo(p)) {
110110
p <- geo2cartesian(p)
111111
attrsToEval <- lapply(attrsToEval, function(tr) {
112-
if (!grepl("scatter|choropleth", tr[["type"]] %||% "scatter")) {
113-
stop("Cant add a '", tr[["type"]], "' trace to a map object", call. = FALSE)
112+
type <- tr[["type"]] %||% "scatter"
113+
if (!grepl("scatter|choropleth", type)) {
114+
warning("Can't add a '", type, "' trace to a map object", call. = FALSE)
115+
}
116+
if (is_mapbox(p)) {
117+
tr[["type"]] <- if (!is.null(tr[["z"]])) "choroplethmapbox" else "scattermapbox"
114118
}
115-
if (is_mapbox(p)) tr[["type"]] <- tr[["type"]] %||% "scattermapbox"
116119
if (is_geo(p)) {
117120
tr[["type"]] <- if (!is.null(tr[["z"]])) "choropleth" else "scattergeo"
118121
}

R/utils.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,14 +823,15 @@ verify_webgl <- function(p) {
823823
return(p)
824824
}
825825
types <- sapply(p$x$data, function(x) x[["type"]][1] %||% "scatter")
826-
idx <- paste0(types, "gl") %in% names(Schema$traces)
827-
if (any(!idx)) {
826+
can_gl <- paste0(types, "gl") %in% names(Schema$traces)
827+
already_gl <- grepl("gl$", types)
828+
if (any(!can_gl & !already_gl)) {
828829
warning(
829830
"The following traces don't have a WebGL equivalent: ",
830-
paste(which(!idx), collapse = ", ")
831+
paste(which(!can_gl & !already_gl), collapse = ", ")
831832
)
832833
}
833-
for (i in which(idx)) {
834+
for (i in which(can_gl)) {
834835
p$x$data[[i]]$type <- paste0(p$x$data[[i]]$type, "gl")
835836
}
836837
p

inst/CITATION

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
citHeader("To cite plotly in publications use:")
22

3-
bibentry(
4-
bibtype = "Manual",
5-
title = "plotly for R",
6-
author = personList(as.person("Carson Sievert")),
7-
year = "2018",
3+
citEntry(entry = "book",
4+
author = "Carson Sievert",
5+
title = "Interactive Web-Based Data Visualization with R, plotly, and shiny",
6+
publisher = "Chapman and Hall/CRC",
7+
year = "2020",
8+
isbn = "9781138331457",
89
url = "https://plotly-r.com",
9-
10-
textVersion = "Carson Sievert (2018) plotly for R. https://plotly-r.com"
10+
textVersion = "C. Sievert. Interactive Web-Based Data Visualization with R, plotly, and shiny. Chapman and Hall/CRC Florida, 2020."
1111
)

inst/docker/Dockerfile.vtest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ RUN R -e "install.packages('testthat')"
9595
ARG CRANCACHE=1
9696
RUN R -e "update.packages(ask=FALSE)"
9797
RUN R -e "remotes::install_github('r-lib/vdiffr')"
98+
RUN R -e "install.packages('rnaturalearth')"
9899

99100
# install any new dependencies, then either manage cases (the default) or run tests
100101
# note the workaround to get docker to run a proper exit status when there are testthat errors

inst/examples/shiny/event_data/tests/mytest-expected/001.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,21 +422,19 @@
422422
"stylesheet": null,
423423
"head": null,
424424
"attachment": null,
425-
"package": null,
426425
"all_files": true
427426
},
428427
{
429428
"name": "crosstalk",
430-
"version": "1.0.0",
429+
"version": "1.1.0.1",
431430
"src": {
432-
"href": "crosstalk-1.0.0"
431+
"href": "crosstalk-1.1.0.1"
433432
},
434433
"meta": null,
435434
"script": "js/crosstalk.min.js",
436435
"stylesheet": "css/crosstalk.css",
437436
"head": null,
438437
"attachment": null,
439-
"package": null,
440438
"all_files": true
441439
},
442440
{

inst/examples/shiny/event_data/tests/mytest-expected/002.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,21 +439,19 @@
439439
"stylesheet": null,
440440
"head": null,
441441
"attachment": null,
442-
"package": null,
443442
"all_files": true
444443
},
445444
{
446445
"name": "crosstalk",
447-
"version": "1.0.0",
446+
"version": "1.1.0.1",
448447
"src": {
449-
"href": "crosstalk-1.0.0"
448+
"href": "crosstalk-1.1.0.1"
450449
},
451450
"meta": null,
452451
"script": "js/crosstalk.min.js",
453452
"stylesheet": "css/crosstalk.css",
454453
"head": null,
455454
"attachment": null,
456-
"package": null,
457455
"all_files": true
458456
},
459457
{

inst/examples/shiny/event_data/tests/mytest-expected/003.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,21 +443,19 @@
443443
"stylesheet": null,
444444
"head": null,
445445
"attachment": null,
446-
"package": null,
447446
"all_files": true
448447
},
449448
{
450449
"name": "crosstalk",
451-
"version": "1.0.0",
450+
"version": "1.1.0.1",
452451
"src": {
453-
"href": "crosstalk-1.0.0"
452+
"href": "crosstalk-1.1.0.1"
454453
},
455454
"meta": null,
456455
"script": "js/crosstalk.min.js",
457456
"stylesheet": "css/crosstalk.css",
458457
"head": null,
459458
"attachment": null,
460-
"package": null,
461459
"all_files": true
462460
},
463461
{

inst/examples/shiny/event_data/tests/mytest-expected/004.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,21 +444,19 @@
444444
"stylesheet": null,
445445
"head": null,
446446
"attachment": null,
447-
"package": null,
448447
"all_files": true
449448
},
450449
{
451450
"name": "crosstalk",
452-
"version": "1.0.0",
451+
"version": "1.1.0.1",
453452
"src": {
454-
"href": "crosstalk-1.0.0"
453+
"href": "crosstalk-1.1.0.1"
455454
},
456455
"meta": null,
457456
"script": "js/crosstalk.min.js",
458457
"stylesheet": "css/crosstalk.css",
459458
"head": null,
460459
"attachment": null,
461-
"package": null,
462460
"all_files": true
463461
},
464462
{

man/hobbs.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/mic.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/res_mn.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/wind.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/figs/abline/cookbook-axes-multiple-abline.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/bar/bar-category-names.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/contour/contour.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/cookbook-axes/cookbook-axes-log2-coord.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/density2d/density2d.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/figs/density2d/density2dfill.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)