![]() Most widgets can accept the default sizing policy (or override only one or two aspects of it) and get satisfactory sizing behavior (see details below). This is done via the sizingPolicy argument to the createWidget function. While a given widget might look great at 960px by 480px in an R Markdown document, the same widget would look silly at that size in the RStudio Viewer pane, which is typically much smaller.įirst, a sizing policy is specified for the widget. The context into which the widget is rendered. ![]() Some widgets may only be designed to look good at small, fixed sizes (like sparklines) while other widgets may want every pixel that can be spared (like network graphs). ![]() This sizing mechanism is designed to address the following constraints that affect the natural size of a widget: The htmlwidgets framework provides a rich mechanism for specifying the sizing behavior of widgets. ![]() In the spirit of HTML widgets working just like plots in R, it’s important that HTML widgets intelligently size themselves to their container, whether it be the RStudio Viewer, a figure in knitr, or a UI panel within a Shiny application. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |