Skip to content

Commit c841e0c

Browse files
committed
rename runExample() to plotly_example() to avoid naming conflict with shiny::runExample()
1 parent 8f26e58 commit c841e0c

8 files changed

Lines changed: 16 additions & 16 deletions

File tree

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ export(plotly_POST)
179179
export(plotly_build)
180180
export(plotly_data)
181181
export(plotly_empty)
182+
export(plotly_example)
182183
export(plotly_json)
183184
export(rangeslider)
184185
export(raster2uri)
185186
export(remove_typedarray_polyfill)
186187
export(rename)
187188
export(rename_)
188189
export(renderPlotly)
189-
export(runExample)
190190
export(schema)
191191
export(select)
192192
export(select_)

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## NEW FEATURES & IMPROVEMENTS
44

5-
* It is now possible to modify (i.e., update without a full redraw) plotly graphs inside of a shiny app via the new `plotlyProxy()` and `plotlyProxyInvoke()` functions. For examples, see `runExample("shiny", "proxy_relayout")` and `runExample("shiny", "proxy_mapbox")`. Closes #580.
6-
* Added a new `runExample()` function to make it easier to run shiny/rmarkdown examples included with the package under the `inst/examples` directory.
5+
* It is now possible to modify (i.e., update without a full redraw) plotly graphs inside of a shiny app via the new `plotlyProxy()` and `plotlyProxyInvoke()` functions. For examples, see `plotly_example("shiny", "proxy_relayout")` and `plotly_example("shiny", "proxy_mapbox")`. Closes #580.
6+
* Added a new `plotly_example()` function to make it easier to run shiny/rmarkdown examples included with the package under the `inst/examples` directory.
77
* The `schema()` function now returns the plot schema (rather just printing it), making it easier to acquire/use values from the official plot schema. See `help(schema)` for an example. Fixes #1038.
88

99
## CHANGES

R/runExample.R renamed to R/plotly_example.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#' @export
1010
#' @author Carson Sievert
1111

12-
runExample <- function(type = c("demo", "shiny", "rmd"), name, ...) {
12+
plotly_example <- function(type = c("demo", "shiny", "rmd"), name, ...) {
1313
if (missing(name)) {
1414
stop("Must provide an example name", call. = FALSE)
1515
}
@@ -36,12 +36,12 @@ runExample <- function(type = c("demo", "shiny", "rmd"), name, ...) {
3636
finalDir <- system.file("examples", type, name, package = "plotly")
3737

3838
if (type == "shiny") {
39-
try_library("shiny", "runExample")
39+
try_library("shiny", "plotly_example")
4040
getFromNamespace("runApp", asNamespace("shiny"))(finalDir, ...)
4141
}
4242

4343
if (type == "rmd") {
44-
try_library("rmarkdown", "runExample")
44+
try_library("rmarkdown", "plotly_example")
4545
input <- file.path(finalDir, "index.Rmd")
4646
output <- tempfile(fileext = ".html")
4747
getFromNamespace("render", asNamespace("rmarkdown"))(input, output_file = output, ...)

R/proxy.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#'
1515
#'
1616
#' if (require("shiny") && interactive()) {
17-
#' runExample("shiny", "proxy_relayout")
18-
#' runExample("shiny", "proxy_mapbox")
17+
#' plotly_example("shiny", "proxy_relayout")
18+
#' plotly_example("shiny", "proxy_mapbox")
1919
#' }
2020
#'
2121
plotlyProxy <- function(outputId, session = shiny::getDefaultReactiveDomain(),

R/shiny.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ renderPlotly <- function(expr, env = parent.frame(), quoted = FALSE) {
5555
#' @export
5656
#' @author Carson Sievert
5757
#' @examples \dontrun{
58-
#' runExample("shiny", "event_data")
58+
#' plotly_example("shiny", "event_data")
5959
#' }
6060

6161
event_data <- function(event = c("plotly_hover", "plotly_click", "plotly_selected",

man/event_data.Rd

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

man/plotlyProxy.Rd

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

0 commit comments

Comments
 (0)