

The idea of associating quantitative measures with a graphical display of data can be generalized to include more that just scatterplots, and in this more general case, these measures are sometimes referred to as cognostics. This idea, coined scagnostics (short for scatterplot diagnostics), has since been made explicit, and many other similar applications have been explored, even techniques for time-series (Wilkinson, Anand, and Grossman 2005 Wilkinson and Wills 2008 Dang and Wilkinson 2012). The proposed solution involved using quantitative measurements of various scatterplot characteristics (e.g. correlation, clumpiness, etc) to help summarise and guide attention towards ‘interesting’ scatterplots. However, trellis displays do have a limitation: they don’t scale very well to a large number of groups.īefore trellis displays were formally introduced, Tukey and Tukey ( 1985) proposed a solution to the problem of scatterplots not being able to scale to a large number of variables (i.e., it’s time consuming to visualize 1000 scatterplots!). In other words, the trellis display helps us understand how patterns or structure in the data changes across groups. Moreover, since I’ve imposed a width of 40% for the first two plots, the net effect is that we have 2 plots in the first two (spanning 80% of the page width), then the third plot wraps onto a new line.Īs we’ve already seen in Figures 2.10, 16.14, & 13.9, the trellis (aka small multiple) display is an effective way to see how a conditional distribution behaves under different conditions. Another useful CSS property to know about for the ‘parent’ container is justify-content: in the case of Figure 13.13, I’m using it to horizontally center the components. To allow ‘overflowing’ components the freedom to ‘wrap’ into new row(s), set the CSS property of flex-wrap: wrap in the parent container. By default, in this display setting, all the components inside that container will try fit in a single row.

Instead of covering this entire system, we’ll cover it’s basic functionality, which is fairly similar to Bootstrap’s grid layout system.Ĭreating a flexbox requires a flexbox container – in HTML speak, that means a tag with a CSS style property of display: flex. 22 It aims to provide a general system for distributing space among multiple components in a container. In that case, CSS flexbox (3) is a light-weight (i.e., no external CSS/JS dependencies) alternative that is less likely to introduce undesirable side-effects.Ĭascading Style Sheet (CSS) flexbox is a relatively new CSS feature that most modern web browsers natively support. Although Bootstrap grid layout system (2) is expressive and intuitive, using it in a larger website that also uses a different HTML/CSS framework (e.g. Bulma, Skeleton, etc) can cause issues.

In other words, approaches 2-3 can be used with any rmarkdown template 21 or really any framework for website generation. CSS flexbox: If you know some HTML and CSS, you can leverage CSS flexbox to arrange components via the htmltools package.Īlthough flexdashboard is a really excellent way to arrange web-based content generated from R, it can pay-off to know the other two approaches as their arrangement techniques are agnostic to an rmarkdown output format.Bootstrap’s grid layout: Both the crosstalk and shiny packages provide ways to arrange numerous components via Bootstrap’s (a popular HTML/CSS framework) grid layout system.This package is essentially a special rmarkdown template that uses a simple markup syntax to define the layout. flexdashboard: An R package for arranging components into an opinionated dashboard layout.Here are three common ways to arrange components (e.g., htmlwidgets, htmltools tags, etc) in a single web-page: Moreover, since htmlwidgets are also htmltools tags, any method that works for arranging htmltools tags also works for htmlwidgets. Since plotly objects are also htmlwidgets, any method that works for arranging htmlwidgets also works for plotly objects. 19.1 Assignment, subsetting, and iteration.17.2.8 Accumulating and managing event data.16.4.3 Statistical queries with ggplotly().1.3.5 Data visualization best practices.1.1 Why interactive web graphics from R?.
