I'm currently using ggplot2 to compare statistics from different groups, each belonging to a different region. This is done via a web application (tikiwiki CMS + plugin R), who runs the R script. Per region I can have 2 to 30 or more groups. A same R script runs for all the data in a unique web page, the result adapting depending on the chosen region - as parameter of the page.
Currently, I have this :
region 1: 12 groups = 12 medium facets
region 2: 3 groups = 3 **HUGE** facets
region 3: 24 groups = 24 **TINY** facets
region 4: 16 groups = 16 medium facets
...
Region 2
Region 3
What kind of result I would like to have is :
Region 2
Region 3 Stays the same
I'm facetting per group with facet_wrap(~data, ncol=4), so I can have either 2 or 30+ facets. My problem is the output: either the 30 facets are stuffed into a tiny box, or the two ones are oversized in the same sized box -> See pictures above... I can't find how to fix a ratio (or image output max width) but keep the final picture size free.
Is it possible in ggplot2 / R to fix a default size for the facets and to have the size of the resulting picture adapting to the numbers of facets ?
If this is not possible in ggplot2 / R is there any javascript/jquery library that can pick up the code and show the results correctly (d3, ...) ?