Skip to content

Commit 03b2090

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents e9cb526 + aa619dc commit 03b2090

File tree

159 files changed

+1702
-658
lines changed

Some content is hidden

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

159 files changed

+1702
-658
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 30 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
config:
29+
# vdiffr & shinytest only runs on mac r-release since the results aren't cross-platform
2930
- {os: macOS-latest, r: 'release', visual_tests: true, node: "14.x", shinytest: true}
3031
- {os: windows-latest, r: 'release'}
31-
#- {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}
32-
- {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.1.0 (ubuntu-18.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
33-
# vdiffr & shinytest only runs on linux r-release since the results aren't cross-platform
34-
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
35-
- {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
36-
- {os: ubuntu-18.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
37-
- {os: ubuntu-18.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
32+
# - {os: windows-latest, r: 'oldrel-1'} # pak is having issues
33+
- {os: ubuntu-latest, r: 'devel'}
34+
- {os: ubuntu-latest, r: 'release'}
35+
- {os: ubuntu-latest, r: 'oldrel-1'}
36+
- {os: ubuntu-latest, r: 'oldrel-2'}
37+
- {os: ubuntu-latest, r: 'oldrel-3'}
38+
- {os: ubuntu-latest, r: 'oldrel-4'}
3839

3940
env:
40-
RSPM: ${{ matrix.config.rspm }}
4141
VISUAL_TESTS: ${{ matrix.config.visual_tests }}
4242
SHINYTEST: ${{ matrix.config.shinytest }}
4343
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
@@ -47,71 +47,31 @@ jobs:
4747

4848
steps:
4949
- uses: actions/checkout@v2
50+
with:
51+
persist-credentials: false
5052

51-
- uses: r-lib/actions/setup-r@v1
53+
- uses: r-lib/actions/setup-r@v2
5254
id: install-r
5355
with:
5456
r-version: ${{ matrix.config.r }}
55-
http-user-agent: ${{ matrix.config.http-user-agent }}
56-
57-
- uses: r-lib/actions/setup-pandoc@v1
57+
use-public-rspm: true
5858

59-
- name: Install pak and query dependencies
60-
run: |
61-
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
62-
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
63-
shell: Rscript {0}
59+
- uses: r-lib/actions/setup-pandoc@v2
6460

65-
- name: Restore R package cache
66-
uses: actions/cache@v2
61+
- uses: r-lib/actions/setup-r-dependencies@v2
6762
with:
68-
path: |
69-
${{ env.R_LIBS_USER }}/*
70-
!${{ env.R_LIBS_USER }}/pak
71-
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
72-
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
63+
cache-version: 3
64+
needs: check
7365

74-
- name: Install Linux sysdeps
75-
if: runner.os == 'Linux'
76-
run: |
77-
pak::local_system_requirements(execute = TRUE)
78-
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
79-
shell: Rscript {0}
80-
81-
- name: Install dependencies
82-
run: |
83-
if (Sys.info()[['sysname']] == 'Darwin') options(pkgType = 'mac.binary')
84-
pak::local_install_dev_deps(upgrade = FALSE)
85-
pak::pkg_install("rcmdcheck")
86-
shell: Rscript {0}
87-
88-
- name: Set up Python 3.8
89-
uses: actions/setup-python@v2
90-
with:
91-
python-version: 3.8
92-
9366
- name: Install kaleido
9467
if: matrix.config.visual_tests == true
9568
run: |
96-
sudo chown -R $UID $CONDA # https://github.com/nextstrain/conda/issues/5
97-
Rscript -e "reticulate::install_miniconda()"
98-
Rscript -e "reticulate::conda_install('r-reticulate', 'python-kaleido')"
99-
Rscript -e "reticulate::conda_install('r-reticulate', 'plotly', channel = 'plotly')"
100-
Rscript -e "reticulate::use_miniconda('r-reticulate')"
101-
102-
- name: Install shinytest deps
103-
if: matrix.config.shinytest == true
104-
run: |
105-
Rscript -e 'shinytest::installDependencies()'
106-
R CMD install .
107-
shell: bash
69+
Rscript -e 'library(reticulate); use_python(install_python()); py_install(c("kaleido", "plotly"))'
10870
10971
# Run test() before R CMD check since, for some reason, rcmdcheck::rcmdcheck() skips vdiffr tests
11072
- name: Run Tests
11173
run: |
11274
options(crayon.enabled = TRUE, testthat.progress.max_fails=1000)
113-
if (!require(devtools)) pak::pak("devtools")
114-
if (!require(reshape2)) pak::pak("reshape2")
11575
res <- devtools::test()
11676
df <- as.data.frame(res)
11777
if (sum(df$failed) > 0 || any(df$error)) stop("GHA CI tests failed")
@@ -123,21 +83,21 @@ jobs:
12383
uses: actions/upload-artifact@master
12484
with:
12585
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
126-
path: ./
127-
128-
# Run check with --no-tests since we ran them abve
129-
- name: Check
130-
run: |
131-
options(crayon.enabled = TRUE)
132-
rcmdcheck::rcmdcheck(args = c("--no-tests", "--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
133-
shell: Rscript {0}
86+
path: |
87+
./
88+
!./.git/
13489
90+
- name: Check package
91+
uses: r-lib/actions/check-r-package@v2
92+
with:
93+
check-dir: '"check"'
94+
# Run check with --no-tests since we ran them abve
95+
# 2023-01-03: `{purrr}` v1.0.0 had trouble on Windows without the `--no-multiarch`
96+
# https://github.com/plotly/plotly.R/pull/2221
97+
args: 'c("--no-tests", "--no-manual", "--as-cran", "--no-multiarch")'
98+
error-on: '"warning"'
99+
135100
#- name: Show testthat output
136101
# if: always()
137102
# run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
138103
# shell: bash
139-
140-
- name: Don't use tar from old Rtools to store the cache
141-
if: ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3.6' ) }}
142-
shell: bash
143-
run: echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH

CODE_OF_CONDUCT.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at accounts@plot.ly. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4/), and may also be found online at <https://community.plotly.com/pub/code-of-conduct>.

DESCRIPTION

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Package: plotly
22
Title: Create Interactive Web Graphics via 'plotly.js' (modified for use in MIRO)
3-
Version: 4.10.1.9999
3+
Version: 4.10.4.9999
4+
Title: Create Interactive Web Graphics via 'plotly.js'
5+
Version: 4.10.4.9000
46
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
57
email = "cpsievert1@gmail.com", comment = c(ORCID = "0000-0002-4958-2844")),
68
person("Chris", "Parmer", role = "aut",
@@ -43,7 +45,7 @@ Imports:
4345
vctrs,
4446
tibble,
4547
lazyeval (>= 0.2.0),
46-
rlang (>= 0.4.10),
48+
rlang (>= 1.0.0),
4749
crosstalk,
4850
purrr,
4951
data.table,
@@ -57,29 +59,34 @@ Suggests:
5759
ggalluvial,
5860
testthat,
5961
knitr,
60-
devtools,
6162
shiny (>= 1.1.0),
62-
shinytest (>= 1.3.0),
63+
shinytest2,
6364
curl,
6465
rmarkdown,
6566
Cairo,
6667
broom,
6768
webshot,
6869
listviewer,
6970
dendextend,
70-
maptools,
71-
rgeos,
7271
sf,
7372
png,
7473
IRdisplay,
7574
processx,
7675
plotlyGeoAssets,
7776
forcats,
77+
withr,
7878
palmerpenguins,
7979
rversions,
8080
reticulate,
81-
rsvg
81+
rsvg,
82+
ggridges
8283
LazyData: true
83-
RoxygenNote: 7.2.3
84+
RoxygenNote: 7.3.1
8485
Encoding: UTF-8
8586
Roxygen: list(markdown = TRUE)
87+
Config/Needs/check:
88+
tidyverse/ggplot2,
89+
rcmdcheck,
90+
devtools,
91+
reshape2,
92+
s2

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The MIT License (MIT)
1+
MIT License
22

3-
Copyright (c) 2017 Plotly Technologies Inc
3+
Copyright (c) 2017-2024 Plotly Technologies Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

NAMESPACE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ S3method(geom2trace,GeomErrorbarh)
1212
S3method(geom2trace,GeomPath)
1313
S3method(geom2trace,GeomPoint)
1414
S3method(geom2trace,GeomPolygon)
15+
S3method(geom2trace,GeomRidgelineGradient)
1516
S3method(geom2trace,GeomText)
1617
S3method(geom2trace,GeomTile)
1718
S3method(geom2trace,default)
@@ -47,6 +48,10 @@ S3method(to_basic,GeomContour)
4748
S3method(to_basic,GeomCrossbar)
4849
S3method(to_basic,GeomDensity)
4950
S3method(to_basic,GeomDensity2d)
51+
S3method(to_basic,GeomDensityLine)
52+
S3method(to_basic,GeomDensityRidges)
53+
S3method(to_basic,GeomDensityRidges2)
54+
S3method(to_basic,GeomDensityRidgesGradient)
5055
S3method(to_basic,GeomDotplot)
5156
S3method(to_basic,GeomErrorbar)
5257
S3method(to_basic,GeomErrorbarh)
@@ -63,6 +68,8 @@ S3method(to_basic,GeomRaster)
6368
S3method(to_basic,GeomRasterAnn)
6469
S3method(to_basic,GeomRect)
6570
S3method(to_basic,GeomRibbon)
71+
S3method(to_basic,GeomRidgeline)
72+
S3method(to_basic,GeomRidgelineGradient)
6673
S3method(to_basic,GeomRug)
6774
S3method(to_basic,GeomSegment)
6875
S3method(to_basic,GeomSf)

NEWS.md

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,56 @@
1-
# 4.10.1.9000
1+
# plotly (development version)
2+
3+
## New features
4+
5+
* `ggplotly()` now supports the `{ggridges}` package. (#2314)
6+
7+
## Improvements
8+
9+
* `ggplotly()` now works better with the development version of ggplot2 (> v3.4.4). (#2315, #2368)
10+
11+
## Bug fixes
12+
13+
* Closed #2337: Creating a new `event_data()` handler no longer causes a spurious reactive update of existing `event_data()`s. (#2339)
14+
* Closed #2376: Removes errant boxmode warning for grouped boxplot. (#2396)
15+
16+
# 4.10.4
17+
18+
## Improvements
19+
20+
* `ggplotly()` now works better with the development version of ggplot2 (> v3.4.4). (#2315)
21+
22+
# 4.10.3
23+
24+
## Improvements
25+
26+
* `ggplotly()` now works better with the development version of ggplot2 (> v3.4.3). (#2301)
227

328
## Bug fixes
429

5-
* `ggplotly()` no longer errors given a `geom_area()` with 1 or less data points (error introduced by new behavior in ggplot2 v3.4.0). (#2209)
30+
* Closed #1947: `ggplotly()` now correctly handles `geom_vline`/`geom_hline` with empty data. Previously, if `geom_vline`/`geom_hline` was passed an empty data frame, it would result in an error. The plot is drawn even if no lines are found; this is the same behavior as `ggplot2`.
31+
32+
* Closed #1214: Do not warn in RStudio on Windows when scattergl is used. Recent RStudio versions can render scattergl correctly.
33+
34+
* Closed #2298: Fix fill assignment in geom_point when a single shape value was used with multiple fill and colour values mapped (@zeehio)
35+
36+
# 4.10.2
37+
38+
## New features
39+
40+
* Closed #2216: Additional selectize.js options can now be passed along to `highlight()`'s `selectize` argument. (#2217)
41+
42+
## Improvements
43+
44+
* Closed #2259: `ggplotly()` now provides better support for ggplot2 >v3.4.2. (#2262)
45+
46+
## Bug fixes
647

48+
* Closed #2212: `ggplotly()` no longer silently drops legends that are customized through `ggplot2::guide_legend()`.
49+
* Closed #2179: `save_image()` no longer needs `reticulate::py_run_string("import sys")` in order to run without error. (#2179)
50+
* Closed #2218: `highlight(selectize = TRUE)` no longer yields an incorrect selectize.js result when there is a combination of crosstalk and non-crosstalk traces. (#2217)
51+
* Closed #2208: `ggplotly()` no longer errors given a `geom_area()` with 1 or less data points (error introduced by new behavior in ggplot2 v3.4.0). (#2209)
52+
* Closed #2220: `ggplotly()` no longer errors on `stat_summary(geom = "crossbar")`. (#2222)
53+
* Closed #2212: `ggplotly()` no longer removes legends when setting guide properties via `guides(aes = guide_xxx(...))`.
754

855
# 4.10.1
956

@@ -154,7 +201,7 @@ This is minor patch release with a few minor bug fixes and updates test expectat
154201

155202
## NEW FEATURES & IMPROVEMENTS
156203

157-
* Several new features and improvements related to accessing plotly.js events in shiny (learn more about them in this RStudio [webinar](https://www.rstudio.com/resources/webinars/accessing-and-responding-to-plotly-events-in-shiny/)):
204+
* Several new features and improvements related to accessing plotly.js events in shiny (learn more about them in this RStudio [webinar](https://posit.co/resources/videos/accessing-and-responding-to-plotly-events-in-shiny/)):
158205
* The `event` argument of the `event_data()` function now supports the following events: `plotly_selecting`, `plotly_brushed`, `plotly_brushing`, `plotly_restyle`, `plotly_legendclick`, `plotly_legenddoubleclick`, `plotly_clickannotation`, `plotly_afterplot`, `plotly_doubleclick`, `plotly_deselect`, `plotly_unhover`. For examples, see `plotly_example("shiny", "event_data")`, `plotly_example("shiny", "event_data_legends")`, and `plotly_example("shiny", "event_data_annotation")`,
159206
* New `event_register()` and `event_unregister()` functions for declaring which events to transmit over the wire (i.e., from the browser to the shiny server). Events that are likely to have large overhead are not registered by default, so you'll need to register these: `plotly_selecting`, `plotly_unhover`, `plotly_restyle`, `plotly_legendclick`, and `plotly_legenddoubleclick`.
160207
* A new `priority` argument. By setting `priority='event'`, the `event` is treated like a true event: any reactive expression using the `event` becomes invalidated (regardless of whether the input values has changed). For an example, see `plotly_example("shiny", "event_priority")`.

R/export.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' Export a plotly graph to a static file
22
#'
3-
#' This function is in the process of being deprecated (use [orca] instead).
3+
#' This function is deprecated, use [save_image] instead.
44
#'
55
#' @details For SVG plots, a screenshot is taken via `webshot::webshot()`.
66
#' Since `phantomjs` (and hence `webshot`) does not support WebGL,
@@ -19,7 +19,7 @@
1919
#' @author Carson Sievert
2020
#'
2121
export <- function(p = last_plot(), file = "plotly.png", selenium = NULL, ...) {
22-
.Deprecated("orca")
22+
.Deprecated("save_image")
2323

2424
# infer the file type
2525
fileType <- tolower(tools::file_ext(file))

0 commit comments

Comments
 (0)