Skip to content

Major update to ggplotly() #480

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

Merged
merged 74 commits into from
Mar 8, 2016
Merged
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
19f3d84
Add support for plot, title, axis title, & and axis text margins/sizing
cpsievert Jan 26, 2016
aee38e6
remove unused object
cpsievert Jan 26, 2016
e7f7321
complete overhaul of axis object creation
cpsievert Jan 27, 2016
2c64135
math
cpsievert Jan 27, 2016
214ec72
adjust a few tests to reflect new philosophy
cpsievert Jan 27, 2016
f65b274
support free scales for multiple rows (which really fixes #317)
cpsievert Jan 28, 2016
2cc9a69
simplify; was a bit overzealous on drawing ticks
cpsievert Jan 28, 2016
0f05239
modify tests to reflect new philosophy
cpsievert Jan 28, 2016
89de829
strip of trailing 1
cpsievert Jan 28, 2016
570576e
bump version; update news
cpsievert Jan 28, 2016
e72cf3d
fix tests
cpsievert Jan 28, 2016
450c5d5
ensure x/y axes exist for each panel and hide them appropriately
cpsievert Jan 28, 2016
8110fb6
simplify facet logic; get closer to a proper sizing scheme
cpsievert Jan 29, 2016
8544556
upgrade to plotlyjs 1.5.0
cpsievert Jan 29, 2016
20a4479
no more need for testing our environment hack
cpsievert Jan 29, 2016
b179a87
fix plyr/dplyr namespace clash
cpsievert Jan 29, 2016
0815ef5
merge facet and axis object overhaul
cpsievert Jan 29, 2016
4017006
keep modularizing
cpsievert Jan 29, 2016
24d2f9c
deprecate old posting arguments; add width/height to ggplotly
cpsievert Feb 1, 2016
9a4f5d5
merge with master
cpsievert Feb 1, 2016
ef52c4a
properly tack on width/height, better margin accounting
cpsievert Feb 2, 2016
6596827
send domain info to the client
cpsievert Feb 2, 2016
21f34e2
merge with master
cpsievert Feb 2, 2016
d78c881
dynamic domains work, but what about annotations?
cpsievert Feb 3, 2016
5bf5a9f
ensure layout.[x/y]axes is boxed
cpsievert Feb 3, 2016
73d78c8
layout.[x/y]axes could very well be undefined
cpsievert Feb 11, 2016
184b6a5
Rethink build approach; trace conversion still needs work
cpsievert Feb 15, 2016
ee3bfee
getting closer to correct sizing
cpsievert Feb 16, 2016
18dcd60
more sizing corrections
cpsievert Feb 17, 2016
93150a3
add infrastructure for converting one geom to two basic geoms
cpsievert Feb 22, 2016
44186fc
dynamic margins are probably more trouble than they're worth
cpsievert Feb 22, 2016
1b87e4f
more sizing corrections; margin -> pixels is still off
cpsievert Feb 23, 2016
b4c361e
fix facet logic spacing
cpsievert Feb 23, 2016
77e448d
start thinking about dates and implement GeomBar
cpsievert Feb 24, 2016
4c131bf
get dates working
cpsievert Feb 24, 2016
fe05c9e
some comments
cpsievert Feb 25, 2016
e58f93e
Improve bbox(). Properly account for long horizontal tick text in fre…
cpsievert Feb 25, 2016
a2aedac
always draw axis titles as annotations, fixes for geom_bar() and coor…
cpsievert Feb 26, 2016
5221d6c
vectorize toRGB
cpsievert Feb 27, 2016
8a09109
start overhauling geoms
cpsievert Feb 27, 2016
731d6a7
more geom fixes/improvements
cpsievert Feb 28, 2016
fca8d67
geom overhaul essentially complete
cpsievert Feb 28, 2016
29248f1
couple fixes; start overhauling tests
cpsievert Feb 28, 2016
c3a0202
fixes/improvements for geom_*line()
cpsievert Feb 28, 2016
34a8f74
pass panel layout to layers2traces; fixes for geom_*line()
cpsievert Feb 28, 2016
1d5dc87
upgrade to plotly.js 1.6.0
cpsievert Feb 29, 2016
c8a8057
domain/range of discrete mapping(s) need to be managed per layer
cpsievert Feb 29, 2016
ad585de
Improve toRGB; fully adopt aes2plotly
cpsievert Feb 29, 2016
e625fc8
support multiple guides
cpsievert Mar 1, 2016
84187f3
ugh, might have to go back to using markLegends
cpsievert Mar 1, 2016
cdc833d
merge with master
cpsievert Mar 2, 2016
ab8815f
always use linear axes since dates don't respect ticktext
cpsievert Mar 2, 2016
2e2e334
everything is linear
cpsievert Mar 2, 2016
d233f9d
use discrete scales to identify when we need legends
cpsievert Mar 2, 2016
4c44586
fixes for geom_errorbars
cpsievert Mar 3, 2016
05e7ebd
add GeomLinerange/GeomPointrange
cpsievert Mar 3, 2016
8407ea4
test fixes/modifications
cpsievert Mar 3, 2016
3c8f364
add trace merging
cpsievert Mar 3, 2016
421e9ff
export geom2trace and to_basic
cpsievert Mar 4, 2016
63e482b
better defaults
cpsievert Mar 4, 2016
7b61446
forgot a browser
cpsievert Mar 4, 2016
aa40da6
unique test names
cpsievert Mar 4, 2016
63ce818
fixes for R CMD check
cpsievert Mar 4, 2016
b788c94
space for the modebar
cpsievert Mar 4, 2016
b91cdc2
use the conservative estimate of 16px for modebar height
cpsievert Mar 4, 2016
95bbdb5
more careful/correct legend creation and trace merging
cpsievert Mar 6, 2016
7233419
require ggplot2 >= 2.1
cpsievert Mar 6, 2016
84496d0
fix #427
cpsievert Mar 6, 2016
d8d71ae
add key to GeomPoint
cpsievert Mar 7, 2016
74ec12a
modularize event logic, add 3d events example
cpsievert Mar 7, 2016
eef0368
remove console.log
cpsievert Mar 7, 2016
6277739
stringify JSON before passing to R
cpsievert Mar 8, 2016
2e62d57
bump version; update news
cpsievert Mar 8, 2016
5fbfd8a
Allow multiple bars for a given x (this is nice for mapping text, in …
cpsievert Mar 8, 2016
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
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: plotly
Title: Create Interactive Web Graphics via Plotly's JavaScript Graphing Library
Version: 2.5.0
Version: 3.0.0
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
email = "[email protected]"),
person("Chris", "Parmer", role = c("aut", "cph"),
@@ -20,7 +20,7 @@ Description: Easily translate ggplot2 graphs to an interactive web-based version
URL: https://plot.ly/r, https://github.com/ropensci/plotly
BugReports: https://github.com/ropensci/plotly/issues
Depends:
ggplot2 (>= 2.0.0)
ggplot2 (>= 2.1.0)
Imports:
scales,
httr,
@@ -30,10 +30,13 @@ Imports:
viridis,
base64enc,
htmlwidgets,
tidyr,
plyr
Suggests:
dplyr,
maps,
ggthemes,
GGally,
testthat,
knitr,
devtools,
53 changes: 46 additions & 7 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,25 +1,56 @@
# Generated by roxygen2: do not edit by hand

S3method(geom2trace,GeomBar)
S3method(geom2trace,GeomBlank)
S3method(geom2trace,GeomBoxplot)
S3method(geom2trace,GeomErrorbar)
S3method(geom2trace,GeomErrorbarh)
S3method(geom2trace,GeomPath)
S3method(geom2trace,GeomPoint)
S3method(geom2trace,GeomPolygon)
S3method(geom2trace,GeomText)
S3method(geom2trace,GeomTile)
S3method(geom2trace,default)
S3method(print,figure)
S3method(print,plotly)
S3method(to_basic,GeomAbline)
S3method(to_basic,GeomArea)
S3method(to_basic,GeomBoxplot)
S3method(to_basic,GeomContour)
S3method(to_basic,GeomDensity)
S3method(to_basic,GeomDensity2d)
S3method(to_basic,GeomErrorbar)
S3method(to_basic,GeomErrorbarh)
S3method(to_basic,GeomHline)
S3method(to_basic,GeomJitter)
S3method(to_basic,GeomLine)
S3method(to_basic,GeomLinerange)
S3method(to_basic,GeomPointrange)
S3method(to_basic,GeomRaster)
S3method(to_basic,GeomRect)
S3method(to_basic,GeomRibbon)
S3method(to_basic,GeomSegment)
S3method(to_basic,GeomSmooth)
S3method(to_basic,GeomStep)
S3method(to_basic,GeomTile)
S3method(to_basic,GeomViolin)
S3method(to_basic,GeomVline)
S3method(to_basic,default)
export("%>%")
export(add_trace)
export(as.widget)
export(config)
export(embed_notebook)
export(event_data)
export(geom2trace)
export(get_figure)
export(gg2list)
export(ggplot_build2)
export(ggplotly)
export(group2NA)
export(knit_print.figure)
export(knit_print.plotly)
export(last_plot)
export(layer2traces)
export(layout)
export(offline)
export(paramORdefault)
export(plot_ly)
export(plotly)
export(plotlyOutput)
@@ -32,20 +63,28 @@ export(signup)
export(style)
export(subplot)
export(toRGB)
export(to_basic)
import(ggplot2)
import(httr)
import(jsonlite)
importFrom(base64enc,base64encode)
importFrom(grDevices,col2rgb)
importFrom(htmlwidgets,createWidget)
importFrom(htmlwidgets,shinyRenderWidget)
importFrom(htmlwidgets,shinyWidgetOutput)
importFrom(htmlwidgets,sizingPolicy)
importFrom(httr,GET)
importFrom(httr,PATCH)
importFrom(httr,POST)
importFrom(httr,add_headers)
importFrom(httr,config)
importFrom(httr,content)
importFrom(httr,stop_for_status)
importFrom(jsonlite,fromJSON)
importFrom(jsonlite,toJSON)
importFrom(magrittr,"%>%")
importFrom(plyr,ddply)
importFrom(plyr,join)
importFrom(plyr,summarise)
importFrom(stats,setNames)
importFrom(tidyr,gather)
importFrom(utils,browseURL)
importFrom(utils,data)
importFrom(utils,getFromNamespace)
14 changes: 14 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
3.0.0

NEW FEATURES:

* ggplotly() is now about 20x faster (it avoids calling ggplot_build() 20+ times). In some cases, it might be even faster since a lot of other redundant computation is avoided.

CHANGES:

* Instead of (trying to) translate both major and minor grid lines, we now translate only major grid lines. This generally produces a result closer to the actual ggplot2 result since ggplot2 doesn't draw ticks on minor grid lines.

BUG FIXES:

* ggplotly() now supports most of scale_*()/theme()/guides(). As a result, this fixes a lot of issues (#482, #481, #479, #476, #473, #460, #456, #454, #453, #447, #443, #434, #422, #421, #399, #379, #378, #357, #318, #316, #242, #232, #211, #203, #185, #184, #161). In order to support all of scale_x_*() an scale_y_*(), we always use linear axis types, and supply ticktext/tickvals to plotly.js. This has some unfortunate consequences on hoverformatting, which may be addressed in future releases of plotly.js -- https://github.com/plotly/plotly.js/issues/320

2.5.0 -- 1 Mar 2015

NEW FEATURES
35 changes: 0 additions & 35 deletions R/build_function.R

This file was deleted.

30 changes: 0 additions & 30 deletions R/colour_conversion.R

This file was deleted.

107 changes: 0 additions & 107 deletions R/corresp_one_one.R

This file was deleted.

2 changes: 1 addition & 1 deletion R/figure.R
Original file line number Diff line number Diff line change
@@ -20,5 +20,5 @@ get_figure <- function(username, id) {
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"))
process(append_class(resp, "figure"))
}
Loading