Skip to content

Commit

Permalink
Fix #23
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed Nov 25, 2016
1 parent 417cc15 commit bebadf4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
@@ -1,6 +1,8 @@
# ggforce 0.1.0.99
- Fix bug in facet_wrap_paginate that threw errors when using it with free
scales (#19)
- Fixes bug in facet_zoom where y-axis would be incorrectly displayed when
zooming on both axes without splitting the view (#23)

# ggforce 0.1.0

Expand Down
7 changes: 4 additions & 3 deletions R/facet_zoom.R
Expand Up @@ -111,9 +111,6 @@ FacetZoom <- ggproto("FacetDuplicate", Facet,
d$PANEL <- panel
d
}))
if ('full' %in% layout$name && !params$split) {
data <- data[!data$PANEL %in% c(2L, 3L), ]
}
data
},
draw_panels = function(panels, layout, x_scales, y_scales, ranges, coord,
Expand All @@ -130,6 +127,10 @@ FacetZoom <- ggproto("FacetDuplicate", Facet,
axes <- render_axes(ranges, ranges, coord, theme, FALSE)
panelGrobs <- create_panels(panels, axes$x, axes$y)

if ('full' %in% layout$name && !params$split) {
panelGrobs <- panelGrobs[c(1, 4)]
}

if ('y' %in% layout$name) {
zoom_prop <- rescale(y_scales[[2]]$dimension(), from = y_scales[[1]]$dimension())
indicator <- polygonGrob(c(1, 1, 0, 0), c(zoom_prop, 1, 0), gp = gpar(col = NA, fill = alpha(theme$zoom$fill, 0.5)))
Expand Down

0 comments on commit bebadf4

Please sign in to comment.