I would like to create a plot with ggplotly()
in R
by allowing dynamic height/width so that it will look something like this in the html:
<div id="htmlwidget-7c8a8e27b8ce66400314" style="width:100%;height:100%;" class="plotly html-widget"></div>
with: width/height=100%
However, this doesn't seem to be allowed in ggplotly()
:
This
ggplotly(p, size=“100%”, height=“100%”)
will throw an error.
It looks like this is possible when using RShiny plotlyOutput
(e.g. https://community.plotly.com/t/plotly-shiny-reactive-height-of-plots/1503/4).
Is there a way to do that from ggplotly() ?
Thanks a lot!