Skip to content

Commit d89cf84

Browse files
committed
Merge branch 'master' into feature/proxy
2 parents 1d1b172 + 86f4af0 commit d89cf84

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

DESCRIPTION

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Imports:
3333
viridisLite,
3434
base64enc,
3535
htmltools,
36-
htmlwidgets (>= 0.8),
36+
htmlwidgets (>= 0.9),
3737
tidyr,
3838
hexbin,
3939
RColorBrewer,
@@ -66,6 +66,7 @@ Suggests:
6666
png,
6767
IRdisplay
6868
Remotes:
69-
tidyverse/ggplot2
69+
tidyverse/ggplot2,
70+
ramnathv/htmlwidgets
7071
LazyData: true
7172
RoxygenNote: 6.0.1

R/dev.R

+10-8
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ plotly_json <- function(p = last_plot(), jsonedit = interactive(), ...) {
3232
#' @export
3333
#' @examples
3434
#' s <- schema()
35-
#' View(s$traces)
36-
#'
37-
#' # get info on `layout.mapbox.style` attribute
38-
#' (styles <- s$layout$layoutAttributes$mapbox$style$values)
39-
#' subplot(
40-
#' plot_mapbox() %>% layout(mapbox = list(style = styles[3])),
41-
#' plot_mapbox() %>% layout(mapbox = list(style = styles[5]))
42-
#' )
35+
#'
36+
#' # retrieve acceptable `layout.mapbox.style` values
37+
#' if (!is.na(Sys.getenv('MAPBOX_TOKEN', NA))) {
38+
#' styles <- s$layout$layoutAttributes$mapbox$style$values
39+
#' subplot(
40+
#' plot_mapbox() %>% layout(mapbox = list(style = styles[3])),
41+
#' plot_mapbox() %>% layout(mapbox = list(style = styles[5]))
42+
#' )
43+
#' }
44+
#'
4345
#'
4446
#'
4547

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ style(gg, hoveron = "points", hoverinfo = "x+y+text", hoverlabel = list(bgcolor
4747

4848
Moreover, since `ggplotly()` returns a plotly object, you can apply essentially any function from the R package on that object. Some useful ones include `layout()` (for [customizing the layout](https://cpsievert.github.io/plotly_book/extending-ggplotly.html#customizing-the-layout)), `add_traces()` (and its higher-level `add_*()` siblings, for example `add_polygons()`, for [adding new traces/data](https://cpsievert.github.io/plotly_book/extending-ggplotly.html#leveraging-statistical-output)), `subplot()` (for [combining multiple plotly objects](https://cpsievert.github.io/plotly_book/merging-plotly-objects.html)), and `plotly_json()` (for inspecting the underlying JSON sent to plotly.js).
4949

50-
The `ggplotly()` function will also respect some "unofficial" **ggplot2** aesthetics, namely `text` (for [customizing the tooltip](https://cpsievert.github.io/plotly_book/a-case-study-of-housing-sales-in-texas.html#fig:ggsubplot)) and `frame` (for [creating animations](https://cpsievert.github.io/plotly_book/key-frame-animations.html)).
50+
The `ggplotly()` function will also respect some "unofficial" **ggplot2** aesthetics, namely `text` (for [customizing the tooltip](https://cpsievert.github.io/plotly_book/a-case-study-of-housing-sales-in-texas.html#fig:ggsubplot)), `frame` (for [creating animations](https://cpsievert.github.io/plotly_book/key-frame-animations.html)), and `ids` (for ensuring sensible smooth transitions).
5151

5252
### Using plotly without ggplot2
5353

man/schema.Rd

+9-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)