Open danielkrizian opened 10 years ago
Probably will tackle this all in with #6. I do not think we would want to force a size to fit into RStudio Viewer. Rather, I think we should just provide height and width config (resolving the trifold problem) so folks can play with the size as they desire. Beyond that, we will also need to provide height/width for multi-charts. This will present a different set of challenges.
agreed, I had in mind defaulting to the size of the RStudio viewer if height/width not provided, not forcing/overriding, if you agree. Edited the issue heading
Only issue is the Rstudio viewer will be different for each user. I guess we can apply some sensible defaults that we would expect to fit in most cases.
So, would you prefer using the rCharts height
and width
in the parent params
or do you want it all contained in the child options
?
params
...
height = ??
width = ??
options
height = ??
width = ??
Don't care much on my end, but would assume the parent params
would be more consistent with other rCharts libraries.
Was wondering if layout_dygraphs
can get current viewer pane dimensions.
Only found a way to set Viewer pane size (height), which we don't want
https://support.rstudio.com/hc/en-us/articles/202133558-Extending-RStudio-with-the-Viewer-Pane
Will ask RStudio guys
do you want to start a new branch to iterate through this?
Good question, I vote for parent params
too. The duplicity you see now was just quick&dirty proof of concept when I first set things up
Simple enough change then. Just tested and this works for me. Then we will just need to change the template to use params
or change the payload to keep the JSON in the original format.
Dygraph <- setRefClass('Dygraph', contains = 'rCharts'
, methods = list(
initialize = function(){
callSuper()
params <<- c(params, list(options = list()))
},
New branch layout created for this #8 and #6 . Feel free to create branches at will
Not that you want to do it but after the last commit you could specify different height
and width
for use with layout_dygraphs
, and it works.
dygraph1 <- dygraph(data=SPY[,c("Date","SPY.Close")], sync=TRUE, crosshair="vertical", legendFollow=TRUE, height = 400, width=300)
dygraph2 <- dygraph(data=SPY[,c("Date","Momentum20days")], sync=TRUE, crosshair="vertical", legendFollow=TRUE, height = 200, width=1000, colors='grey')
layout_dygraphs(dygraph1, dygraph2)
Dimensions of the charts are fixed and do not fit RStudio viewer:
Moreover, resolve trifold conflict where
width
andheight
are specified:@timelyportfolio let me know if any ideas