@@ -178,46 +178,16 @@ layout <- function(p = last_plot(), ...,
178
178
# ' Set the default configuration for plotly
179
179
# '
180
180
# ' @param p a plotly object
181
- # ' @param staticPlot for export or image generation
182
- # ' @param workspace we're in the workspace, so need toolbar etc (TODO describe functionality instead)?
183
- # ' @param editable edit titles, move annotations, etc
184
- # ' @param autosizable respect layout.autosize=true and infer its container size?
185
- # ' @param fillFrame if we DO autosize, do we fill the container or the screen?
186
- # ' @param scrollZoom mousewheel or two-finger scroll zooms the plot
187
- # ' @param doubleClick double click interaction (false, 'reset', 'autosize' or 'reset+autosize')
188
- # ' @param showTips see some hints about interactivity
189
- # ' @param showLink link to open this plot in plotly
190
- # ' @param sendData if we show a link, does it contain data or just link to a plotly file?
191
- # ' @param linkText text appearing in the sendData link
192
- # ' @param displayModeBar display the modebar (T, F, or 'hover')
193
- # ' @param displaylogo add the plotly logo on the end of the modebar
194
- # ' @param plot3dPixelRatio increase the pixel ratio for 3D plot images
181
+ # ' @param ... these arguments are documented at
182
+ # ' \url{https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js}
195
183
# ' @author Carson Sievert
196
184
# ' @export
185
+ # ' @examples \dontrun{
186
+ # ' config(plot_ly(), displaylogo = FALSE, modeBarButtonsToRemove = list('sendDataToCloud'))
187
+ # ' }
197
188
198
- # TODO: use htmlwidgets::JS() to specify setBackground function?
199
- # https://github.com/ropensci/plotly/issues/284#issue-108153160
200
- config <- function (p = last_plot(), staticPlot = F , workspace = F , editable = F ,
201
- autosizable = F , fillFrame = F , scrollZoom = F ,
202
- doubleClick = ' reset+autosize' , showTips = F , showLink = T ,
203
- sendData = T , linkText = ' Edit chart' , displayModeBar = ' hover' ,
204
- displaylogo = T , plot3dPixelRatio = 2 ) {
205
- conf <- list (
206
- staticPlot = staticPlot ,
207
- workspace = workspace ,
208
- editable = editable ,
209
- autosizable = autosizable ,
210
- fillFrame = fillFrame ,
211
- scrollZoom = scrollZoom ,
212
- doubleClick = doubleClick ,
213
- showTips = showTips ,
214
- showLink = showLink ,
215
- sendData = sendData ,
216
- linkText = linkText ,
217
- displayModeBar = displayModeBar ,
218
- displaylogo = displaylogo ,
219
- plot3dPixelRatio = plot3dPixelRatio
220
- )
189
+ config <- function (p = last_plot(), ... ) {
190
+ conf <- list (... )
221
191
p <- last_plot(p )
222
192
p $ config <- c(p $ config , conf )
223
193
hash_plot(if (is.data.frame(p )) p else list (), p )
0 commit comments