File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export(gg2list)
99export(ggplot_build2)
1010export(ggplotly)
1111export(group2NA)
12+ export(knit_print.plotly)
1213export(last_plot)
1314export(layer2traces)
1415export(layout)
Original file line number Diff line number Diff line change @@ -17,6 +17,22 @@ print.plotly <- function(x, ...) {
1717 get(" print.htmlwidget" , envir = asNamespace(" htmlwidgets" ))(w )
1818}
1919
20+ # ' Print a plotly object in a knitr doc
21+ # '
22+ # ' @param x a plotly object
23+ # ' @param ... additional arguments (currently ignored)
24+ # ' @export
25+ knit_print.plotly <- function (x , ... ) {
26+ w <- htmlwidgets :: createWidget(
27+ name = " plotly" ,
28+ x = plotly_build(x ),
29+ width = x $ width ,
30+ height = x $ height ,
31+ htmlwidgets :: sizingPolicy(viewer.padding = 10 , browser.fill = TRUE )
32+ )
33+ get(" knit_print.htmlwidget" , envir = asNamespace(" htmlwidgets" ))(w )
34+ }
35+
2036
2137# ' Embed a plotly iframe into a IPython Notebook
2238# ' @param x a plotly object
Original file line number Diff line number Diff line change 1+ % Generated by roxygen2 (4.1.1 ): do not edit by hand
2+ % Please edit documentation in R / print.R
3+ \name {knit_print.plotly }
4+ \alias {knit_print.plotly }
5+ \title {Print a plotly object in a knitr doc }
6+ \usage {
7+ knit_print.plotly(x , ... )
8+ }
9+ \arguments {
10+ \item {x }{a plotly object }
11+
12+ \item {... }{additional arguments (currently ignored )}
13+ }
14+ \description {
15+ Print a plotly object in a knitr doc
16+ }
17+
You can’t perform that action at this time.
0 commit comments