Skip to content

Commit 06ae544

Browse files
committed
remove note about dev version of ggplot2
1 parent 2d400cf commit 06ae544

File tree

2 files changed

+126
-51
lines changed

2 files changed

+126
-51
lines changed

README.Rmd

-7
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ output: github_document
1313

1414
An R package for creating interactive web graphics via the open source JavaScript graphing library [plotly.js](https://github.com/plotly/plotly.js).
1515

16-
## Announcements
17-
18-
Learn plotly and shiny during [our 2-day R workshop](https://plotcon.plot.ly/workshops/r-shiny-dash-r)! `r emo::ji("woman_technologist")` `r emo::ji("man_technologist")` `r emo::ji("chart_with_upwards_trend")`
19-
20-
[Read more](https://blog.cpsievert.me/2017/12/04/components-of-a-successful-r-workshop/) about [Carson](https://cpsievert.me)'s philosophy and experiences running the workshop.
2116

2217
## Installation
2318

@@ -33,8 +28,6 @@ Or install the latest development version (on GitHub) via devtools:
3328
devtools::install_github("ropensci/plotly")
3429
```
3530

36-
**NOTE:** The CRAN version of **plotly** is designed to work with the CRAN version of **ggplot2**, but at least for the time being, we recommend using the development versions of both **plotly** and **ggplot2** (`devtools::install_github("tidyverse/ggplot2")`).
37-
3831
## Getting started
3932

4033
### Web-based ggplot2 graphics

README.md

+126-44
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11

22
<!-- README.md is generated from README.Rmd. Please edit that file -->
3-
<img src="man/figures/plotly.png" width="200" />
4-
5-
[![Build Status](https://travis-ci.org/ropensci/plotly.png?branch=master)](https://travis-ci.org/ropensci/plotly) [![CRAN Status](http://www.r-pkg.org/badges/version/plotly)](http://cran.r-project.org/package=plotly) [![CRAN Downloads](http://cranlogs.r-pkg.org/badges/grand-total/plotly)](https://www.rpackages.io/package/plotly) [![monthly](https://cranlogs.r-pkg.org/badges/plotly)](https://www.rpackages.io/package/plotly)
63

7-
An R package for creating interactive web graphics via the open source JavaScript graphing library [plotly.js](https://github.com/plotly/plotly.js).
8-
9-
Announcements
10-
-------------
4+
<img src="man/figures/plotly.png" width="200" />
115

12-
Learn plotly and shiny during [our 2-day R workshop](https://plotcon.plot.ly/workshops/r-shiny-dash-r)! 👩‍💻 👨‍💻 📈
6+
[![Build
7+
Status](https://travis-ci.org/ropensci/plotly.png?branch=master)](https://travis-ci.org/ropensci/plotly)
8+
[![CRAN
9+
Status](http://www.r-pkg.org/badges/version/plotly)](http://cran.r-project.org/package=plotly)
10+
[![CRAN
11+
Downloads](http://cranlogs.r-pkg.org/badges/grand-total/plotly)](https://www.rpackages.io/package/plotly)
12+
[![monthly](https://cranlogs.r-pkg.org/badges/plotly)](https://www.rpackages.io/package/plotly)
1313

14-
[Read more](https://blog.cpsievert.me/2017/12/04/components-of-a-successful-r-workshop/) about [Carson](https://cpsievert.me)'s philosophy and experiences running the workshop.
14+
An R package for creating interactive web graphics via the open source
15+
JavaScript graphing library
16+
[plotly.js](https://github.com/plotly/plotly.js).
1517

16-
Installation
17-
------------
18+
## Installation
1819

1920
Install from CRAN:
2021

@@ -28,14 +29,12 @@ Or install the latest development version (on GitHub) via devtools:
2829
devtools::install_github("ropensci/plotly")
2930
```
3031

31-
**NOTE:** The CRAN version of **plotly** is designed to work with the CRAN version of **ggplot2**, but at least for the time being, we recommend using the development versions of both **plotly** and **ggplot2** (`devtools::install_github("tidyverse/ggplot2")`).
32-
33-
Getting started
34-
---------------
32+
## Getting started
3533

3634
### Web-based ggplot2 graphics
3735

38-
If you use [ggplot2](https://github.com/tidyverse/ggplot2), `ggplotly()` converts your static plots to an interactive web-based version!
36+
If you use [ggplot2](https://github.com/tidyverse/ggplot2), `ggplotly()`
37+
converts your static plots to an interactive web-based version\!
3938

4039
``` r
4140
library(plotly)
@@ -47,7 +46,15 @@ ggplotly(g)
4746

4847
![<http://i.imgur.com/G1rSArP.gifv>](http://i.imgur.com/G1rSArP.gif)
4948

50-
By default, `ggplotly()` tries to replicate the static ggplot2 version exactly (before any interaction occurs), but sometimes you need greater control over the interactive behavior. The `ggplotly()` function itself has some convenient "high-level" arguments, such as `dynamicTicks`, which tells plotly.js to dynamically recompute axes, when appropriate. The `style()` function also comes in handy for *modifying* the underlying [traces attributes](https://plot.ly/r/reference/#scatter-hoveron) used to generate the plot:
49+
By default, `ggplotly()` tries to replicate the static ggplot2 version
50+
exactly (before any interaction occurs), but sometimes you need greater
51+
control over the interactive behavior. The `ggplotly()` function itself
52+
has some convenient “high-level” arguments, such as `dynamicTicks`,
53+
which tells plotly.js to dynamically recompute axes, when appropriate.
54+
The `style()` function also comes in handy for *modifying* the
55+
underlying [traces
56+
attributes](https://plot.ly/r/reference/#scatter-hoveron) used to
57+
generate the plot:
5158

5259
``` r
5360
gg <- ggplotly(g, dynamicTicks = "y")
@@ -56,48 +63,123 @@ style(gg, hoveron = "points", hoverinfo = "x+y+text", hoverlabel = list(bgcolor
5663

5764
![<http://i.imgur.com/qRvLgea.gifv>](http://imgur.com/qRvLgea.gif)
5865

59-
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).
60-
61-
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).
66+
Moreover, since `ggplotly()` returns a plotly object, you can apply
67+
essentially any function from the R package on that object. Some useful
68+
ones include `layout()` (for [customizing the
69+
layout](https://cpsievert.github.io/plotly_book/extending-ggplotly.html#customizing-the-layout)),
70+
`add_traces()` (and its higher-level `add_*()` siblings, for example
71+
`add_polygons()`, for [adding new
72+
traces/data](https://cpsievert.github.io/plotly_book/extending-ggplotly.html#leveraging-statistical-output)),
73+
`subplot()` (for [combining multiple plotly
74+
objects](https://cpsievert.github.io/plotly_book/merging-plotly-objects.html)),
75+
and `plotly_json()` (for inspecting the underlying JSON sent to
76+
plotly.js).
77+
78+
The `ggplotly()` function will also respect some “unofficial”
79+
**ggplot2** aesthetics, namely `text` (for [customizing the
80+
tooltip](https://cpsievert.github.io/plotly_book/a-case-study-of-housing-sales-in-texas.html#fig:ggsubplot)),
81+
`frame` (for [creating
82+
animations](https://cpsievert.github.io/plotly_book/key-frame-animations.html)),
83+
and `ids` (for ensuring sensible smooth transitions).
6284

6385
### Using plotly without ggplot2
6486

65-
The `plot_ly()` function provides a more direct interface to plotly.js so you can leverage more specialized chart types (e.g., [parallel coordinates](https://plot.ly/r/parallel-coordinates-plot/) or [maps](https://plot.ly/r/maps/)) or even some visualization that the ggplot2 API won't ever support (e.g., surface, [mesh](https://plot.ly/r/3d-mesh/), [trisurf](https://plot.ly/r/trisurf/), or sankey diagrams). The [cheatsheet](https://images.plot.ly/plotly-documentation/images/r_cheat_sheet.pdf) is a nice quick reference for this interface, but the [plotly cookbook](https://cpsievert.github.io/plotly_book/the-plotly-cookbook.html) has more complete overview of the philosophy behind this "non-ggplot2" approach.
87+
The `plot_ly()` function provides a more direct interface to plotly.js
88+
so you can leverage more specialized chart types (e.g., [parallel
89+
coordinates](https://plot.ly/r/parallel-coordinates-plot/) or
90+
[maps](https://plot.ly/r/maps/)) or even some visualization that the
91+
ggplot2 API won’t ever support (e.g., surface,
92+
[mesh](https://plot.ly/r/3d-mesh/),
93+
[trisurf](https://plot.ly/r/trisurf/), or sankey diagrams). The
94+
[cheatsheet](https://images.plot.ly/plotly-documentation/images/r_cheat_sheet.pdf)
95+
is a nice quick reference for this interface, but the [plotly
96+
cookbook](https://cpsievert.github.io/plotly_book/the-plotly-cookbook.html)
97+
has more complete overview of the philosophy behind this “non-ggplot2”
98+
approach.
6699

67100
``` r
68101
plot_ly(z = ~volcano, type = "surface")
69102
```
70103

71104
![<https://plot.ly/~brnvg/1134>](https://plot.ly/~brnvg/1134.png)
72105

73-
Crosstalk support
74-
-----------------
106+
## Crosstalk support
75107

76-
The R package has special support for linking/highlighting/filtering views that is not (yet) available outside of the R package. This functionality is built upon the [**crosstalk** package](https://rstudio.github.io/crosstalk/), which distinguishes between two event classes: *select* and *filter*. The **plotly** package interprets these classes in the following way:
108+
The R package has special support for linking/highlighting/filtering
109+
views that is not (yet) available outside of the R package. This
110+
functionality is built upon the [**crosstalk**
111+
package](https://rstudio.github.io/crosstalk/), which distinguishes
112+
between two event classes: *select* and *filter*. The **plotly** package
113+
interprets these classes in the following way:
77114

78-
1. **Select**: add new "selection" trace(s) (i.e., graphical marks) and *dim* the other traces. Some people refer to this as "brushing" or "highlighting".
79-
2. **Filter**: retain "selection" trace(s), but *remove* other traces, and update the layout accordingly. Some people refer to this as "crossfilter" or "drill-down".
115+
1. **Select**: add new “selection” trace(s) (i.e., graphical marks) and
116+
*dim* the other traces. Some people refer to this as “brushing” or
117+
“highlighting”.
118+
2. **Filter**: retain “selection” trace(s), but *remove* other traces,
119+
and update the layout accordingly. Some people refer to this as
120+
“crossfilter” or “drill-down”.
80121

81-
The following gif helps to demonstrate the difference -- see [here](http://rpubs.com/cpsievert/275511) for the code used to generate it.
122+
The following gif helps to demonstrate the difference – see
123+
[here](http://rpubs.com/cpsievert/275511) for the code used to generate
124+
it.
82125

83126
![<http://rpubs.com/cpsievert/275511>](http://i.imgur.com/cYsuNQn.gif)
84127

85-
Like other [crosstalk enabled widgets](https://rstudio.github.io/crosstalk/widgets.html), **plotly** responds to filter events, but you can't (yet) emit a filter event via direct manipulation of a plotly graph. Unlike (some) other crosstalk enabled widgets, **plotly** has advanced support for select (a much more broad class than filter) events, like [persistent/dynamic brushing](https://cpsievert.github.io/plotly_book/linking-views-without-shiny.html#transient-versus-persistent-selection), [brushing via indirect manipulation](https://cpsievert.github.io/plotly_book/linking-views-without-shiny.html#selection-via-indirect-manipulation), and even ways to [completely control the appearance new selection traces](https://cpsievert.github.io/plotcon17/workshop/day2/#21). In other words, these "special" brushing features work when linking multiple **plotly** graphs, but may not when linking to other crosstalk enabled widgets.
86-
87-
To date, [this slide deck](https://cpsievert.github.io/plotcon17/workshop/day2) is the most comprehensive, yet somewhat thorough, walk-through of this framework, but the [linking views without shiny](https://cpsievert.github.io/plotly_book/linking-views-without-shiny.html) chapter of the [plotly book](https://cpsievert.github.io/plotly_book/) provides even more background. There are also numerous demos shipped with the package which provide nice examples (list all the demos via `demo(package = "plotly")`).
88-
89-
**plotly**'s **crosstalk** functionality aims to provide tools for interactively exploring subsets of your data with a fixed definition from data to plot. If you need more flexibility, you can always embed **crosstalk** plots within a larger **shiny** app, or even [access and respond to any plotly event within shiny](https://cpsievert.github.io/plotly_book/linking-views-with-shiny.html), but adding **shiny** into the equation comes with a cost -- the result is no longer standalone HTML (harder to share/host) and linking views requires fairly sophicated knowledge/use of shiny's reactive programming framework.
90-
91-
Examples and documentation
92-
--------------------------
93-
94-
We have numerous online examples on <https://plot.ly/r/> and <https://plot.ly/ggplot2/>, but a more comprehensive write-up is also available at <https://plotly-book.cpsievert.me/>. The package itself ships with a number of demos (list them by running `demo(package = "plotly")`) and shiny/rmarkdown examples (list them by running `plotly_example("shiny")` or `plotly_example("rmd")`). [Carson](https://cpsievert.me) also keeps numerous [slide decks](https://talks.cpsievert.me) with useful examples and concepts.
95-
96-
Contributing
97-
------------
98-
99-
Please read through our [contributing guidelines](https://github.com/ropensci/plotly/blob/master/CONTRIBUTING.md). Included are directions for opening issues, asking questions, contributing changes to plotly, and our code of conduct.
100-
101-
------------------------------------------------------------------------
128+
Like other [crosstalk enabled
129+
widgets](https://rstudio.github.io/crosstalk/widgets.html), **plotly**
130+
responds to filter events, but you can’t (yet) emit a filter event via
131+
direct manipulation of a plotly graph. Unlike (some) other crosstalk
132+
enabled widgets, **plotly** has advanced support for select (a much more
133+
broad class than filter) events, like [persistent/dynamic
134+
brushing](https://cpsievert.github.io/plotly_book/linking-views-without-shiny.html#transient-versus-persistent-selection),
135+
[brushing via indirect
136+
manipulation](https://cpsievert.github.io/plotly_book/linking-views-without-shiny.html#selection-via-indirect-manipulation),
137+
and even ways to [completely control the appearance new selection
138+
traces](https://cpsievert.github.io/plotcon17/workshop/day2/#21). In
139+
other words, these “special” brushing features work when linking
140+
multiple **plotly** graphs, but may not when linking to other crosstalk
141+
enabled widgets.
142+
143+
To date, [this slide
144+
deck](https://cpsievert.github.io/plotcon17/workshop/day2) is the most
145+
comprehensive, yet somewhat thorough, walk-through of this framework,
146+
but the [linking views without
147+
shiny](https://cpsievert.github.io/plotly_book/linking-views-without-shiny.html)
148+
chapter of the [plotly book](https://cpsievert.github.io/plotly_book/)
149+
provides even more background. There are also numerous demos shipped
150+
with the package which provide nice examples (list all the demos via
151+
`demo(package = "plotly")`).
152+
153+
**plotly**’s **crosstalk** functionality aims to provide tools for
154+
interactively exploring subsets of your data with a fixed definition
155+
from data to plot. If you need more flexibility, you can always embed
156+
**crosstalk** plots within a larger **shiny** app, or even [access and
157+
respond to any plotly event within
158+
shiny](https://cpsievert.github.io/plotly_book/linking-views-with-shiny.html),
159+
but adding **shiny** into the equation comes with a cost – the result is
160+
no longer standalone HTML (harder to share/host) and linking views
161+
requires fairly sophicated knowledge/use of shiny’s reactive programming
162+
framework.
163+
164+
## Examples and documentation
165+
166+
We have numerous online examples on <https://plot.ly/r/> and
167+
<https://plot.ly/ggplot2/>, but a more comprehensive write-up is also
168+
available at <https://plotly-book.cpsievert.me/>. The package itself
169+
ships with a number of demos (list them by running `demo(package =
170+
"plotly")`) and shiny/rmarkdown examples (list them by running
171+
`plotly_example("shiny")` or `plotly_example("rmd")`).
172+
[Carson](https://cpsievert.me) also keeps numerous [slide
173+
decks](https://talks.cpsievert.me) with useful examples and concepts.
174+
175+
## Contributing
176+
177+
Please read through our [contributing
178+
guidelines](https://github.com/ropensci/plotly/blob/master/CONTRIBUTING.md).
179+
Included are directions for opening issues, asking questions,
180+
contributing changes to plotly, and our code of
181+
conduct.
182+
183+
-----
102184

103185
![<http://ropensci.org>](http://www.ropensci.org/public_images/github_footer.png)

0 commit comments

Comments
 (0)