Skip to content

v4.11.0 release candidate #2443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: plotly
Title: Create Interactive Web Graphics via 'plotly.js'
Version: 4.10.4.9000
Version: 4.11.0
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
email = "[email protected]", comment = c(ORCID = "0000-0002-4958-2844")),
person("Chris", "Parmer", role = "aut",
Expand Down Expand Up @@ -83,6 +83,7 @@ Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Config/Needs/check:
tidyverse/ggplot2,
ggobi/GGally,
rcmdcheck,
devtools,
reshape2,
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# plotly (development version)
# plotly 4.11.0

## New features

Expand Down
9 changes: 7 additions & 2 deletions demo/animation-tour-USArrests.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# adapted from https://github.com/rstudio/ggvis/blob/master/demo/tourr.r
library(tourr)
library(plotly)

data("USArrests")

# Avoids R CMD check NOTE about using `tourr` without mentioning it in DESCRIPTION
# Install it via CRAN `install.packages("tourr")`
rescale <- getFromNamespace("rescale", "tourr")
new_tour <- getFromNamespace("new_tour", "tourr")
grand_tour <- getFromNamespace("grand_tour", "tourr")

mat <- rescale(USArrests[, 1:4])
tour <- new_tour(mat, grand_tour(), NULL)

# projection of each observation
tour_dat <- function(step_size) {
step <- tour(step_size)
proj <- center(mat %*% step$proj)
proj <- scale(mat %*% step$proj, center = TRUE, scale = FALSE)
data.frame(x = proj[,1], y = proj[,2], state = rownames(mat))
}

Expand Down
13 changes: 11 additions & 2 deletions demo/animation-tour-basic.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# adapted from https://github.com/rstudio/ggvis/blob/master/demo/tourr.r
library(tourr)
library(plotly)

# Avoids R CMD check NOTE about using `tourr` without mentioning it in DESCRIPTION
# Install it `install.packages("tourr")`
rescale <- getFromNamespace("rescale", "tourr")
new_tour <- getFromNamespace("new_tour", "tourr")
grand_tour <- getFromNamespace("grand_tour", "tourr")
lazyLoad(
file.path(system.file("data", package = "tourr"), "Rdata"),
filter = function(x) x == "flea"
)

mat <- rescale(as.matrix(flea[1:6]))
tour <- new_tour(mat, grand_tour(), NULL)

tour_dat <- function(step_size) {
step <- tour(step_size)
proj <- center(mat %*% step$proj)
proj <- scale(mat %*% step$proj, center = TRUE, scale = FALSE)
data.frame(x = proj[,1], y = proj[,2],
species = flea$species)
}
Expand Down
8 changes: 7 additions & 1 deletion demo/crosstalk-filter-lines.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
library(crosstalk)
library(ggplot2)
library(gapminder)
library(plotly)

# Equivalent to data(gapminder, package = "gapminder"), but avoids R CMD check NOTE
# about `gapminder` not being in DESCRIPTION. Install it `install.packages("gapminder")`
lazyLoad(
file.path(system.file("data", package = "gapminder"), "Rdata"),
filter = function(x) x == "gapminder"
)

sd <- highlight_key(gapminder)

g <- ggplot(sd, aes(year, lifeExp, color = country, group = country)) +
Expand Down
11 changes: 6 additions & 5 deletions demo/crosstalk-highlight-leaflet.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
library(plotly)
# devtools::install_github("rstudio/leaflet#346")
library(leaflet)
library(crosstalk)
library(htmltools)

Expand All @@ -13,8 +11,11 @@ p <- plot_ly(sd, x = ~depth, y = ~mag) %>%
add_markers(alpha = 0.5) %>%
highlight("plotly_selected", dynamic = TRUE)

map <- leaflet(sd) %>%
addTiles() %>%
addCircles()
# Requires devtools::install_github("rstudio/leaflet#346")
withr::with_namespace("leaflet", {
map <- leaflet(sd) %>%
addTiles() %>%
addCircles()
})

bscols(p, map)
3 changes: 2 additions & 1 deletion demo/sf-dt.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ map <- plot_ly(ncsd, split = ~NAME, color = I("gray"), hoveron = "fills") %>%
layout(title = "Click on counties to query them", showlegend = FALSE) %>%
config(displayModeBar = FALSE)

bscols(map, DT::datatable(ncsd))
datatable <- getFromNamespace("datatable", "DT")
bscols(map, datatable(ncsd))
5 changes: 2 additions & 3 deletions demo/sf-mapbox-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ plot_mapbox(res_mn, split = ~INDRESNAME, color = ~AREA, stroke = ~PERIMETER, spa

# linking with DT
mn <- highlight_key(res_mn)
datatable <- getFromNamespace("datatable", "DT")
bscols(
plot_mapbox(mn, split = ~INDRESNAME, text = ~INDRESNAME, hoverinfo = "text", hoveron = "fills") %>%
layout(title = "Click a reservation", showlegend = FALSE),
DT::datatable(mn)
datatable(mn)
)

# linking with plotly
Expand All @@ -31,5 +32,3 @@ bscols(
layout(barmode = "overlay") %>%
highlight("plotly_selected", persistent = TRUE)
)


3 changes: 2 additions & 1 deletion demo/sf-mapbox-layout.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
sf_to_geojson <- function(x) {
tmp <- tempfile(fileext = ".geojson")
st_write(x, tmp, driver = "GEOJSON")
geojsonio::geojson_read(tmp, "local")
geojson_read <- getFromNamespace("geojson_read", "geojsonio")
geojson_read(tmp, "local")
}

# By converting sf to geojson and routing to mapbox.layers, rendering
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading