JohnCoene / javascript-for-r-comments

1 stars 0 forks source link

htmltools::browsable -- why? #18

Open MayaGans opened 3 years ago

MayaGans commented 3 years ago

Below we use htmltools::browsable to create multiple widgets at once, the function only accepts a single value so the charts are wrapped in an htmltools::tagList.

I think another sentence could be written here about what is actually happening since I'm not sure my mental model is correct... the call to the function piety just generates the html needed to construct a single graph (?). So putting them inside a tagList we can append multiple to the DOM? (?) Then we need to wrap our function in a call to browsable in order to see that HTML displayed? This is definitely wrong but figured writing it out could help lead you to what you can write?

MayaGans commented 3 years ago

In chapter 7:

htmlwidgets::createWidget it contains) does not render the output, it returns an object of class “htmlwidget” which actually renders the visualisation on print (literally htmlwidget.print method).

This might be useful to mention when htmlwidgets::createWidget is first introduced which could help with my mental model issues mentioned above, then referenced again here as a reminder?