Skip to content

Commit

Permalink
Remove utilities-table-template.r and migrate to gtable package
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Jun 27, 2012
1 parent d2410a6 commit c7cb1bf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 54 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Expand Up @@ -187,7 +187,6 @@ Collate:
'utilities-layer.r'
'utilities-matrix.r'
'utilities-resolution.r'
'utilities-table-template.r'
'utilities-table.r'
'utilities.r'
'xxx-digest.r'
Expand Down
12 changes: 6 additions & 6 deletions R/facet-grid-.r
Expand Up @@ -263,10 +263,10 @@ build_strip <- function(panel, label_df, labeller, theme, side = "right") {
if (empty(label_df)) {
if (horizontal) {
widths <- unit(rep(0, max(panel$layout$COL)), "null")
return(layout_empty_row(widths))
return(gtable_row_spacer(widths))
} else {
heights <- unit(rep(0, max(panel$layout$ROW)), "null")
return(layout_empty_col(heights))
return(gtable_col_spacer(heights))
}
}

Expand Down Expand Up @@ -295,7 +295,7 @@ build_strip <- function(panel, label_df, labeller, theme, side = "right") {
widths <- unit(apply(grobs, 2, col_width), "cm")
heights <- unit(rep(1, nrow(grobs)), "null")
}
strips <- layout_matrix(name, grobs, heights = heights, widths = widths)
strips <- gtable_matrix(name, grobs, heights = heights, widths = widths)

if (horizontal) {
gtable_add_col_space(strips, theme$panel.margin)
Expand All @@ -312,14 +312,14 @@ facet_axes.grid <- function(facet, panel, coord, theme) {
cols <- which(panel$layout$ROW == 1)
grobs <- lapply(panel$ranges[cols], coord_render_axis_h,
coord = coord, theme = theme)
axes$b <- gtable_add_col_space(layout_row("axis-b", grobs),
axes$b <- gtable_add_col_space(gtable_row("axis-b", grobs),
theme$panel.margin)

# Vertical axes
rows <- which(panel$layout$COL == 1)
grobs <- lapply(panel$ranges[rows], coord_render_axis_v,
coord = coord, theme = theme)
axes$l <- gtable_add_row_space(layout_col("axis-l", grobs),
axes$l <- gtable_add_row_space(gtable_col("axis-l", grobs),
theme$panel.margin)

axes
Expand Down Expand Up @@ -379,7 +379,7 @@ facet_panels.grid <- function(facet, panel, coord, theme, geom_grobs) {
panel_heights <- rep(unit(1 * aspect_ratio, "null"), nrow)
}

panels <- layout_matrix("panel", panel_matrix,
panels <- gtable_matrix("panel", panel_matrix,
panel_widths, panel_heights, respect = respect)
panels <- gtable_add_col_space(panels, theme$panel.margin)
panels <- gtable_add_row_space(panels, theme$panel.margin)
Expand Down
2 changes: 1 addition & 1 deletion R/facet-null.r
Expand Up @@ -57,7 +57,7 @@ facet_render.null <- function(facet, panel, coord, theme, geom_grobs) {
zeroGrob(), axis_h
), ncol = 2, byrow = TRUE)

layout <- layout_matrix("layout", all,
layout <- gtable_matrix("layout", all,
widths = unit.c(grobWidth(axis_v), unit(1, "null")),
heights = unit.c(unit(aspect_ratio, "null"), grobHeight(axis_h)),
respect = respect, clip = c("off", "off", "on", "off")
Expand Down
46 changes: 0 additions & 46 deletions R/utilities-table-template.r

This file was deleted.

0 comments on commit c7cb1bf

Please sign in to comment.