Skip to content
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

Version 1.0 #226

Merged
merged 235 commits into from
Aug 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
ed850cc
redesign mostly working
cpsievert May 5, 2015
07242ed
merge with master
cpsievert May 5, 2015
0643a23
merge with master again
cpsievert May 5, 2015
2592778
R CMD check is passing; too bad we can't use RStudio preview
cpsievert May 5, 2015
ff05384
Always knit asis
cpsievert May 5, 2015
b93e64b
Add simple knitr test
cpsievert May 5, 2015
c50e637
merge with toby-cookbook-lines
cpsievert May 5, 2015
c3001b3
delete run_tests_with_outputs.R
cpsievert May 5, 2015
6f5fb99
support for different domains, cat env vars to .Rprofile, polish and …
cpsievert May 6, 2015
05709e9
fix bad example
cpsievert May 6, 2015
492e4b9
Merge branch 'master' of https://github.com/ropensci/plotly into cars…
cpsievert May 7, 2015
a21ad8f
we'll have to use cpsievert/plotly-test-table for now because of back…
cpsievert May 7, 2015
be3e5b3
self-contained & more efficient test table builds
cpsievert May 9, 2015
1667863
clone into parent directory
cpsievert May 9, 2015
6b35854
Install devtools
cpsievert May 9, 2015
e4c5a37
option to ignore ggplot2 errors
cpsievert May 9, 2015
564b63b
Maybe error is related to R_TESTS variable weirdness?
cpsievert May 9, 2015
8366fbd
Add basic print methods; dontrun API examples; suggest devtools
cpsievert May 9, 2015
4779a27
Fix httr:: namespace issue
cpsievert May 9, 2015
cb6e104
if you use a package in tests, you _must_ put in DESCRIPTION now
cpsievert May 9, 2015
9011e72
Create dir if not exists
cpsievert May 9, 2015
7aa37af
typo
cpsievert May 9, 2015
dfaf4bd
ggsave() seems to be broken
cpsievert May 9, 2015
1aec968
only save outputs for travis pull requests
cpsievert May 9, 2015
b6fb06c
R CMD check suppress output; so we have to keep tests under 10 minutes
cpsievert May 9, 2015
c7fc7fd
Create directories if necessary; ggplot2 error handling
cpsievert May 9, 2015
1ba6857
derp
cpsievert May 9, 2015
61b180e
Define save_outputs() in testthat.R; place build-push-comment.R under…
cpsievert May 11, 2015
d13e61d
updates in .travis.yml accordingly
cpsievert May 11, 2015
43e75f5
Forgot to add tests/build-push-comment.R
cpsievert May 11, 2015
ca9195d
hmm, that's a strange error, try test_dir()
cpsievert May 11, 2015
837e36e
I wonder if craigcitro/r-travis does this right
cpsievert May 12, 2015
fa88bd5
before_script happens after install
cpsievert May 12, 2015
3167d34
huh, looks like some changes were just introduced into nativ R builds
cpsievert May 12, 2015
5c25a69
try local = FALSE
cpsievert May 12, 2015
a662ce7
oops, move build-push-comment.R to inst/ since anything under tests/ …
cpsievert May 12, 2015
dd0ceeb
Yay\! Progress, finally\!
cpsievert May 12, 2015
7ccd7c2
Always source the newest testthat.R script
cpsievert May 12, 2015
ce65cb0
Use chdir
cpsievert May 12, 2015
658c000
avoid stopping on test error
cpsievert May 12, 2015
69e3db9
devtools doesn't report hash for local installs
cpsievert May 12, 2015
76923e2
why does this hash dir not exist?
cpsievert May 12, 2015
6ef13d9
If only I could pull down the travis build locally
cpsievert May 12, 2015
5c4c207
recursive ls
cpsievert May 12, 2015
a321dc3
ah, dirname of is plotly
cpsievert May 12, 2015
5d5499b
navigate into plotly-test-table
cpsievert May 12, 2015
c0f1ca9
debug statements
cpsievert May 13, 2015
16e22dd
wasn't creating a dir for each ggplot version
cpsievert May 13, 2015
01d4e62
Thanks for nothing R CMD check
cpsievert May 13, 2015
7cf2e20
install
cpsievert May 13, 2015
c8488f7
underscores
cpsievert May 19, 2015
4f1406a
merge conflicts with master
cpsievert May 26, 2015
3248ca9
Merge branch 'master' of https://github.com/ropensci/plotly into cars…
cpsievert May 28, 2015
026371a
underscores in env vars
cpsievert May 28, 2015
4cdde72
A new declarative DSL
cpsievert Jun 3, 2015
987eefb
Oops, export style()
cpsievert Jun 3, 2015
7166419
merge conflicts with master
cpsievert Jun 4, 2015
b4e4d8e
Pipeable interface
cpsievert Jun 8, 2015
7b2438d
add support for color argument
cpsievert Jun 16, 2015
c7803d2
move ggplot2 back to depends
cpsievert Jun 16, 2015
5943c0a
start cleaning up tests and R CMD check things
cpsievert Jun 16, 2015
9c949e1
fix get_figure() tests
cpsievert Jun 16, 2015
95153a5
moar test fixes
cpsievert Jun 16, 2015
013bf83
filename test fixes
cpsievert Jun 16, 2015
1e8b887
Search in traces for keyword arguments
cpsievert Jun 16, 2015
9c9a222
Add enclosing environment (for evaluating expressions referencing obj…
cpsievert Jun 16, 2015
bc67b75
fix embed notebook
cpsievert Jun 16, 2015
ed6a586
Simply save_output logic
cpsievert Jun 16, 2015
568225e
get tests passing
cpsievert Jun 16, 2015
7307190
why is the pull request stalling?
cpsievert Jun 16, 2015
dc96221
encrypt test bot crednetials
cpsievert Jun 16, 2015
e873be5
yay, output
cpsievert Jun 16, 2015
9cd2782
use plotly_POST over print method in tests
cpsievert Jun 16, 2015
8a0dadf
this is strange...
cpsievert Jun 17, 2015
f1c009b
testthat suppresses messages, but not print statements
cpsievert Jun 17, 2015
462ad20
Avoid calling gg2list() twice
cpsievert Jun 17, 2015
ac26fc6
WHAT IS TAKING SO LONG?
cpsievert Jun 17, 2015
7a51c2f
namespace
cpsievert Jun 17, 2015
3668a84
Isn't debugging with print statements fun?
cpsievert Jun 17, 2015
d8c76fb
Add shiny support
cpsievert Jun 18, 2015
af19880
Try out my credentials
cpsievert Jun 18, 2015
6dfe5ce
export get_plot
cpsievert Jun 19, 2015
08b5035
rework test table logic
cpsievert Jun 19, 2015
e0c8294
jsdiff package required for diffs
cpsievert Jun 19, 2015
4298b8e
jsdiff needs to put htmlwidgets in import
cpsievert Jun 19, 2015
09cc497
file paths are fun
cpsievert Jun 19, 2015
7d1103a
typo
cpsievert Jun 19, 2015
0998915
create dirs
cpsievert Jun 20, 2015
019c91c
jsdiff now imports htmlwidgets
cpsievert Jun 22, 2015
46794ef
new credentials
cpsievert Jun 22, 2015
a6e3581
run build script from test table directory
cpsievert Jun 22, 2015
707836c
use file.path(), not paste0()
cpsievert Jun 22, 2015
cd274c4
Various improvements inspired by documentation
cpsievert Jun 23, 2015
739ef07
Don't have time to re-run tests 3 times
cpsievert Jun 24, 2015
18a1c97
smarter git handling
cpsievert Jun 24, 2015
4896b02
have the push travis build save ggplot2 output
cpsievert Jun 24, 2015
8c2746c
new credentials
cpsievert Jun 24, 2015
acb560b
fix silly bug
cpsievert Jun 24, 2015
49c8152
fix another silly one
cpsievert Jun 24, 2015
3791489
file paths
cpsievert Jun 24, 2015
a694187
travis doesn't like @plot.ly accounts
cpsievert Jun 24, 2015
e68fa91
getting close
cpsievert Jun 24, 2015
10b090c
Better message; start debugging git
cpsievert Jun 24, 2015
ceef8a3
automatically add axis titles based on unevaluated expressions
cpsievert Jun 24, 2015
28282cc
Add some initial DSL tests
cpsievert Jun 24, 2015
20e86c7
moar test infrastructure stuffs
cpsievert Jun 24, 2015
b18b6d1
typo
cpsievert Jun 24, 2015
5cb3044
dark magic
cpsievert Jun 24, 2015
137ff7e
documentation fixes
cpsievert Jun 25, 2015
4d3ac3c
don't _have_ to resolve test table path
cpsievert Jun 25, 2015
d0c84da
fix for new tests
cpsievert Jun 25, 2015
151f7c6
moar fixes
cpsievert Jun 25, 2015
5864773
Add support for url argument in get_figure()
cpsievert Jun 25, 2015
30f8abc
new creds
cpsievert Jun 25, 2015
ed8edb7
try again
cpsievert Jun 25, 2015
66f8c62
Need to reinstall during test table building
cpsievert Jun 25, 2015
e0deb06
trying to add support for getting figures by url was a bad idea
cpsievert Jun 25, 2015
baa4185
get figures by username and id
cpsievert Jun 25, 2015
7dd6854
don't verify peer
cpsievert Jun 25, 2015
28ec3c8
ssl.verifypeer is now ssl_verifypeer
cpsievert Jun 29, 2015
5690eea
moar print debugging
cpsievert Jun 29, 2015
9449e8f
Another throwaway account
cpsievert Jun 30, 2015
a7c0bab
Fix username/id extraction
cpsievert Jun 30, 2015
baf6a51
Clean up comment styling
cpsievert Jun 30, 2015
e428fee
curl is faster, more efficient than httr
cpsievert Jun 30, 2015
51c27dd
oops
cpsievert Jun 30, 2015
6976d89
Use rmarkdown to render HTML (jsdiff seems to require it
cpsievert Jul 1, 2015
4b4616c
install pandoc
cpsievert Jul 1, 2015
c195bb9
Save ggplot2 pngs
cpsievert Jul 1, 2015
f48b3df
Testthat vars are within scope of build script??
cpsievert Jul 1, 2015
3bd65e4
yet another throwaway
cpsievert Jul 1, 2015
149866f
why aren't ggplots being saved?
cpsievert Jul 1, 2015
50df43a
try shouldn't be silent for debugging purposes
cpsievert Jul 1, 2015
a5037b4
do I have to print the ggplot?
cpsievert Jul 1, 2015
c4f33d4
try to print
cpsievert Jul 1, 2015
d808ad8
Directories are hard
cpsievert Jul 2, 2015
5bc3a35
almost
cpsievert Jul 2, 2015
3e7c610
Pages don't need to be self contained
cpsievert Jul 2, 2015
5b9ccaf
another throwaway
cpsievert Jul 2, 2015
1614514
jsdiff requires too much infrastructure and chokes on large objects
cpsievert Jul 2, 2015
1d1affc
Write to file
cpsievert Jul 2, 2015
13cd3df
Provide evaluate escape hatch; eval_list -> eval_plot
cpsievert Jul 3, 2015
727f9c5
Add support for group argument
cpsievert Jul 7, 2015
466d446
Add support for symbol argument
cpsievert Jul 7, 2015
01e80d6
colorscale can b a top level property
cpsievert Jul 8, 2015
012d15f
new creds
cpsievert Jul 8, 2015
71fb155
colorscale needs to b mapped to marker object for scatter trace
cpsievert Jul 8, 2015
de84708
oops, need a github pat
cpsievert Jul 8, 2015
7a18974
couple test table fixes
cpsievert Jul 8, 2015
de9c04f
have to create dir b4 copying files
cpsievert Jul 8, 2015
eaa00a9
moar fixes
cpsievert Jul 8, 2015
1f0e73c
Use %||% operator
cpsievert Jul 8, 2015
7da9b93
diff png files
cpsievert Jul 8, 2015
61c41e9
Better colorscale handling
cpsievert Jul 8, 2015
a278f10
Fix aspect ratio of ggplot2 plots
cpsievert Jul 8, 2015
0b5a0e3
bugfix for custom discrete colorscale:
cpsievert Jul 9, 2015
44a41cb
I misunderstood how col_factor worked
cpsievert Jul 9, 2015
888415a
grr
cpsievert Jul 9, 2015
374f500
new creds
cpsievert Jul 9, 2015
c13909b
Hello offline mode; export plotly_build()
cpsievert Jul 15, 2015
c7afe7d
improve offline implementation
cpsievert Jul 16, 2015
677984c
refine online shiny implementation
cpsievert Jul 16, 2015
fceab4c
Github token var was renamed
cpsievert Jul 20, 2015
f37d6d0
Change default colorscale to viridis (note this will soon be default …
cpsievert Jul 20, 2015
89f98be
Document special arguments; change location of a few functions
cpsievert Jul 20, 2015
bd8cd6c
shiny binding is one file now
cpsievert Jul 20, 2015
48aa589
Add size as a special argument; improve some docs
cpsievert Jul 21, 2015
b6186e4
streaming not ready yet
cpsievert Jul 21, 2015
82cf4fd
yt another bot
cpsievert Jul 22, 2015
98d526f
cmin/cmax no longer used
cpsievert Jul 22, 2015
8d6f569
oops, remove browser()
cpsievert Jul 22, 2015
91b1661
names provided to save_outputs() have to be unique
cpsievert Jul 22, 2015
bd6442f
oops, don't filter tests
cpsievert Jul 22, 2015
4252fc4
better preservation of keyword args
cpsievert Jul 22, 2015
6aa3ae6
rework subplot() to respect trace anchors
cpsievert Jul 22, 2015
3cd34f4
smarter JSON unboxing
cpsievert Jul 23, 2015
3cabf18
new creds, yo
cpsievert Jul 23, 2015
a85bf23
Fix bug with subplot()
cpsievert Jul 26, 2015
77a8345
thumbnails
cpsievert Jul 27, 2015
00bfc08
place thumbs in their own directory
cpsievert Jul 27, 2015
0723b33
bug fixes
cpsievert Jul 27, 2015
15e5261
fix file path
cpsievert Jul 27, 2015
9e30cde
different resizing strategy
cpsievert Jul 27, 2015
6b3a6a8
Axis titles for 3D plots, add size as official argument
cpsievert Jul 27, 2015
2988dfc
silly bug
cpsievert Jul 27, 2015
d6947a4
document recent changes
cpsievert Jul 27, 2015
361dca0
Try again
cpsievert Jul 28, 2015
46e3e2b
Thumbs need to be smaller
cpsievert Jul 28, 2015
9748368
If symbol names exist, use them for axis titles; otherwise, default t…
cpsievert Jul 28, 2015
8f82699
add test for axis titles
cpsievert Jul 28, 2015
558de33
Increase size multiplier
cpsievert Jul 28, 2015
c1ad1b1
preserve pre-specified axis objects
cpsievert Jul 28, 2015
642c123
add margin argument to subplot() and re-document
cpsievert Jul 28, 2015
4ae1738
Return marker size multiplier to it's normal setting
cpsievert Jul 28, 2015
1e5c5b8
smarter filename/fileopt handling
cpsievert Jul 28, 2015
18d3fdd
update NEWS
cpsievert Jul 28, 2015
fbc2425
Prevent unnecessary evaluation; add plotly_empty()
cpsievert Jul 28, 2015
16bbde4
unclass ggplot list to avoid AsIs conflicts
cpsievert Jul 28, 2015
bb4b531
make sure title is character string before using as a title
cpsievert Jul 28, 2015
e4e05ff
export plotly_empty()
cpsievert Jul 28, 2015
2064dc1
Use title property of axis objects silly
cpsievert Jul 28, 2015
16b2e77
Remove type as a required argument in add_trace(); better colorbar ti…
cpsievert Jul 29, 2015
c2691ac
annotations _must_ be an _array_ of object(s)
cpsievert Jul 29, 2015
8f1037a
moar plotly documentation examples
cpsievert Jul 29, 2015
5bd986e
fix bug with plotly offline
cpsievert Jul 29, 2015
c495255
clean up tests
cpsievert Jul 29, 2015
d01dfe8
plotly_build should always return a plotly object
cpsievert Jul 29, 2015
d86969c
improve subplot domain calculations
cpsievert Jul 29, 2015
90f4aa0
add some basic subplot tests
cpsievert Jul 29, 2015
d26c8ac
moar improvements to documentation examples
cpsievert Jul 29, 2015
92cf0d9
margin of 0 wasn't a good idea
cpsievert Jul 29, 2015
586b0e3
Need unique test names
cpsievert Jul 30, 2015
2611b9d
Allow one to change default symbol types
cpsievert Jul 30, 2015
1f107c6
tweak docs
cpsievert Jul 30, 2015
964cc92
simplify shiny example
cpsievert Jul 30, 2015
66397c4
new user
cpsievert Jul 30, 2015
53bcd01
Get dplyr integration working again and introduce last_plot()
cpsievert Jul 30, 2015
1529245
typo
cpsievert Jul 30, 2015
c1a8767
text should be a character vector
cpsievert Jul 30, 2015
f1907dd
update readme
cpsievert Jul 30, 2015
4b4f774
Fix thumbnail path
cpsievert Jul 31, 2015
095c814
add .embed to iframe
chriddyp Jul 31, 2015
c799796
Merge pull request #243 from ropensci/add-dot-embed-to-iframe
cpsievert Jul 31, 2015
4bf6c19
unclass in gg2list()
cpsievert Jul 31, 2015
f5af46e
Improve layout building
cpsievert Jul 31, 2015
000bce3
improve docs
cpsievert Jul 31, 2015
6f49bb5
better joint plot
cpsievert Jul 31, 2015
7ad84f1
can't unclass everything or else toJSON methods won't necessarily wor…
cpsievert Jul 31, 2015
77b98d1
oops
cpsievert Jul 31, 2015
d9e749d
embed plotlyjs bundle once in rmd documents
cpsievert Jul 31, 2015
101f0fe
new user
cpsievert Jul 31, 2015
be2d57c
convert NULL to NA
cpsievert Jul 31, 2015
dd29d4f
modify test expectation
cpsievert Aug 1, 2015
8c3248c
tweak vignette/docs
cpsievert Aug 1, 2015
27c7ac4
fix typo
cpsievert Aug 1, 2015
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
5 changes: 4 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ Karthik_local.R
Makefile
man-roxygen
man-roxygen/^.*\.Rproj$
^.*\.Rproj$
^\.Rproj\.user$
vignettes/margins.sty
^data-raw$
vignettes/margins.sty
CONDUCT.md
41 changes: 29 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
language: r
language: c

env:
global:
- secure: "cJ1bDRrAdIRjG+JnsQI9CdA4wQJhJJ2DdCNQ3frl8dotk69z61EiGCFW1Ir1cAY5V/NbHvFHp91HDiSo28ggwqRkEPBOGE44ico5gtVaELu3M/EnkWc2ZwQoN1273Vfdm26QYidqrvWrpLZ0XkFl7Q8xgvBswx30MF7y61+0Hv4="
before_install:
- curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh
- chmod 755 ./travis-tool.sh
- ./travis-tool.sh bootstrap
# password is encrypted below
- echo "Sys.setenv('plotly_username' = 'dfvd')" > ~/.Rprofile

r_packages:
- RCurl
- RJSONIO
- lattice
- xtable
- httr
install:
- ./travis-tool.sh install_deps

before_script:
- chmod 755 inst/testscripts/.push_test_table.sh
- git config --global user.name "cpsievert"
- git config --global user.email "[email protected]"
- git clone https://github.com/cpsievert/plotly-test-table.git ../plotly-test-table

script:
- Rscript -e "devtools::install(); source('tests/testthat.R', chdir = TRUE)"

after_success:
- inst/testscripts/.push_test_table.sh
- cd ../plotly-test-table
- ls -R
- Rscript ../plotly/inst/build-push-comment.R

env:
global:
# plotly_api_key (for posting to plot.ly)
- secure: "eHO4OUmgLusU9i4xSvr3daZxnsMZw3x4FH8BYVEC8Ja+Ey6kkAFFSh2iAC/CqewEYJ7I/M8aIJYqlyTMGRYUgy36WU7iWHAGgaZOU8fIB5dWzMwHbIvS4Naq2sdU7lRT7sxkS+40K1+rplpWDoLF2yt8vSRWo9rjNzp+yc8PjXM="
# GITHUB_PAT (for pushing to plotly-test-table)
- secure: "LHJONgWOo+98vNeFLI7LSJU3RtbMVszlI79GB8CcXmc2mlgM/UtZ5b6RnkNlhmg3Gj1/uObfm/rIybVTwuS1yNpeKv73+gsZOYhobVXiUGVxdRFG/mg5mbqwyWkkuofjPGFlMZCEMgHim37eZzgjSibwVH1LClRDsCoFMCgvgV0="
# plotlyjs_full (link to the full offline bundle)
- secure: "ivxfqGwbzpBpVJe+jVcOBktcmLrT38W/ZapAk/FNDu+yaBhag1eCYErAPPx6Snc4GzwatMt22v4SxAqXQF4SAhTRtmrWVaWnbhzuNqpTkiS6IKEd6EqaoyUZvUTgXh1ruyik00zl3ET9898O3vFfqafodljE0lCLVICHq6ANo68="
# plotlyjs_no_jq (link to the offline bundle w/o jQuery)
- secure: "i5cYEs2lCFSYgrSTHMmzzs8hRwAwiz89GpgM16fqUDQz8T1QMWofNugQInS7fIfKL36FoTz8BaiLs2D98/2kDkkZ0LTHnfrdrY9PO+7D+CmL8QeLLp4atBT0i682nwy8RzEqlvB8yAVQo/i0Eh8tmT97pppddsxttZKoUidfOeA="
25 changes: 25 additions & 0 deletions CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating documentation,
submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for
everyone, regardless of level of experience, gender, gender identity and expression,
sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual language or
imagery, derogatory comments or personal attacks, trolling, public or private harassment,
insults, or other unprofessional conduct.

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. Project maintainers who do not follow the Code of Conduct may be removed
from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the Contributor Covenant
(http:contributor-covenant.org), version 1.0.0, available at
http://contributor-covenant.org/version/1/0/0/
53 changes: 29 additions & 24 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
Package: plotly
Type: Package
Title: Interactive, publication-quality graphs online.
Version: 0.6.3
Authors@R: c(person("Chris", "Parmer", role = c("aut", "cre"),
Title: Create interactive web-based graphs via plotly's API
Version: 1.0.0
Authors@R: c(person("Chris", "Parmer", role = c("aut", "cph"),
email = "[email protected]"),
person("Scott", "Chamberlain", role = "aut",
email = "[email protected]"),
person("Karthik", "Ram", role = "aut",
email = "[email protected]"),
person("Toby", "Hocking", role="aut",
email="[email protected]"),
person("Marianne", "Corvellec", role="aut",
email="[email protected]"),
person("Pedro", "Despouy", role="aut",
email="[email protected]"),
person("Carson", "Sievert", role="aut",
email="[email protected]"))
Author: Chris Parmer
Maintainer: Marianne Corvellec <[email protected]>
person("Toby", "Hocking", role = "aut",
email = "[email protected]"),
person("Marianne", "Corvellec", role = "aut",
email = "[email protected]"),
person("Pedro", "Despouy", role = "aut",
email = "[email protected]"),
person("Carson", "Sievert", role = c("aut", "cre"),
email = "[email protected]"))
License: MIT + file LICENSE
Description: An interface to plotly's online graphing tools with desktop R
environments. Send data to a plotly account and view the graphs in a web
browser. Style the graphs with code or with plotly's online interface;
share data and graphs publicly with a url or privately among other plotly
members; access your graphs from anywhere. Example graph:
https://plot.ly/~chris/1638/
Description: Create interactive web-based graphs via plotly's API.
Easily translate ggplot2 plots to plotly and/or create custom plotly graphs.
Once uploaded to a plotly account, plotly graphs (and the data behind them)
can be viewed and modified in a web browser.
URL: https://github.com/ropensci/plotly
BugReports: https://github.com/ropensci/plotly/issues
Depends:
RCurl,
RJSONIO,
ggplot2
Imports:
knitr
scales,
httr,
jsonlite,
magrittr,
digest,
viridis
Suggests:
dplyr,
maps,
testthat
testthat,
knitr,
devtools,
shiny,
rmarkdown,
RColorBrewer
LazyData: true
30 changes: 23 additions & 7 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
# Generated by roxygen2 (4.1.1): do not edit by hand

S3method(print,offline)
S3method(print,plotly)
export("%>%")
export(add_trace)
export(embed_notebook)
export(get_figure)
export(gg2list)
export(ggplot_build2)
export(ggplotly)
export(group2NA)
export(knit_print.offline)
export(knit_print.plotly)
export(last_plot)
export(layer2traces)
export(layout)
export(offline)
export(paramORdefault)
export(plot_ly)
export(plotly)
export(set_config_file)
export(set_credentials_file)
export(show_config_file)
export(show_credentials_file)
export(plotlyOutput)
export(plotly_POST)
export(plotly_build)
export(plotly_empty)
export(renderPlotly)
export(signup)
export(style)
export(subplot)
export(toRGB)
import(RCurl)
import(RJSONIO)
import(ggplot2)
import(knitr)
import(httr)
import(jsonlite)
importFrom(magrittr,"%>%")
14 changes: 14 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
1.0.0 -- 31 July 2015

A major reworking of package internals which includes a few backwards incompatible changes.

Major changes include:

(1) New high-level grammar for expressing Plotly graphs from R (see the `plot_ly()`, `add_trace()`, `layout()`, and `style()` functions).
(2) New print methods which make it easier to create, modify, and embed Plotly graphs.
(3) Added a `subplot()` function for putting several graphs on a single page.
(4) Added the `renderPlotly()` and `plotlyOutput()` functions for embedding plotly graphs in shiny applications.
(5) Added `offline()` function for creating standalone HTML pages via Plotly Offline (see http://purchasing.plot.ly/)

For more details, see the new vignettes with `browseVignettes(package = "plotly")` and/or the pull request -> https://github.com/ropensci/plotly/pull/226

0.6.3 -- 2 June 2015

Add new tests inspired by the R Cookbook distributions #214
Expand Down
23 changes: 23 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#' Wind data
#'
#' Description TBD.
#'
#' @format A data frame with three variables: \code{r}, \code{t},
#' \code{nms}.
"wind"

#' Mic data
#'
#' Description TBD.
#'
#' @format A data frame with three variables: \code{r}, \code{t},
#' \code{nms}.
"mic"

#' Hobbs data
#'
#' Description TBD.
#'
#' @format A data frame with three variables: \code{r}, \code{t},
#' \code{nms}.
"hobbs"
24 changes: 24 additions & 0 deletions R/figure.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#' Request a figure object
#'
#' Figure objects work in the same way as plotly objects, but when printed,
#' they overwrite the already existing plotly object
#' (instead of creating a new plotly).
#'
#' @param username corresponding username for the figure.
#' @param id of the Plotly figure.
#' @export
#' @references https://plot.ly/rest/
#' @examples
#' \dontrun{
#' # Anyone can obtain the information for a particular plot
#' fig <- get_figure("cpsievert", "559")
#' # If you have proper credentials, you can easily modify
#' layout(fig, title = paste("Modified on ", Sys.time()))
#' }
get_figure <- function(username, id) {
if (missing(username)) username <- verify("username")
if (missing(id)) stop("Please provide a figure id number")
base_url <- file.path(get_domain(), "apigetfile", username, id)
resp <- httr::GET(base_url, plotly_headers(), httr::config(ssl_verifypeer=FALSE))
process(struct(resp, "figure"))
}
51 changes: 47 additions & 4 deletions R/ggplotly.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
#' Create plotly graphs using ggplot2 syntax
#'
#' See up-to-date documentation and examples at
#' \url{https://plot.ly/ggplot2}
#'
#' @param p a ggplot object.
#' @seealso \link{signup}, \link{plot_ly}
#' @import httr jsonlite
#' @export
#' @author Carson Sievert
#' @examples \dontrun{
#' # simple example
#' ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species)
#' ggplotly(ggiris)
#'
#' # maps!!
#' data(canada.cities, package = "maps")
#' viz <- ggplot(canada.cities, aes(long, lat)) +
#' borders(regions = "canada", name = "borders") +
#' coord_equal() +
#' geom_point(aes(text = name, size = pop), colour = "red",
#' alpha = 1/2, name = "cities")
#' ggplotly(viz)
#' }
#'
ggplotly <- function(p = last_plot()) {
l <- gg2list(p)
hash_plot(p$data, l)
}

# ----------------------------------------------------------------------------
# Objects accessed inside gg2list()
# ----------------------------------------------------------------------------

# calc. the epoch
now <- Sys.time()
the.epoch <- now - as.numeric(now)
Expand Down Expand Up @@ -907,8 +941,17 @@ gg2list <- function(p) {
flipped.layout[["yaxis"]] <- x
}

fig <- list(data=flipped.traces, layout=flipped.layout)

fig

l <- list(data = flipped.traces, layout = flipped.layout)
# When auto_unbox is T in jsonlite::toJSON() it doesn't unbox objects of
# class AsIs. We use this in plotly::to_JSON() and tag special fields such as
# x/y/etc so that they don't get unboxed when they are of length 1.
# unfortunately, this conflicts when using I() in qplot. For example,
# qplot(1:10, 1:10, size = I(10))
un <- function(x) {
if (is.null(x)) return(NA)
if (is.list(x)) lapply(x, un)
else if (inherits(x, "AsIs")) unclass(x)
else x
}
lapply(l, un)
}
Loading