Would you consider a pull request that either provides an additional public function that creates the htmlwidget and return() instead of print() regardless of mode? For instance, .get_htmlwidget but certainly not wed to this function name? Or as another option (less attractive in my opinion) change print(w) to return(w) in invoke_static?
Sorry to be such a pest, but I am really, really excited about this project.
Currently
render()
instatic
mode callsinvoke_static()
which prints thehtmlwidget
https://github.com/keller-mark/anyhtmlwidget/blob/main/R/widget.R#L266C3-L266C11. I can foresee many cases where we might want to get thehtmlwidget
withoutprint
even potentially when in a mode other thanstatic
.Would you consider a pull request that either provides an additional public
function
that creates thehtmlwidget
andreturn()
instead ofprint()
regardless ofmode
? For instance,.get_htmlwidget
but certainly not wed to this function name? Or as another option (less attractive in my opinion) changeprint(w)
toreturn(w)
ininvoke_static
?As an example, I will copy the code from https://github.com/keller-mark/anyhtmlwidget/discussions/26. In this example, the widget will be printed 5 times and then the
tagList
instead of just getting the desiredtagList
with 5 widgets.Thanks so much.