Skip to content

Is there a way to make squarified layouts do rows first then columns? #43

@slyrus

Description

@slyrus

I almost have the layout I'm looking for, with 4 groups in my treemap, but no matter which corner I start from, I always get the x-axis split into two equally, but not the y-axis.

e.g.:

  local({
      start <- "topleft"
      layout <- "squarified"
      tibble::tibble(A = c(1,1,0,0),
                     B = c(0,1,1,0),
                     pct = c(0.69, 0.14, 0.06, 0.11)) %>%
          dplyr::mutate(label = paste("A=", A, "\n", "B=", B, sep="")) %>%
          ggplot2::ggplot(ggplot2::aes(area = pct,
                                       subgroup = A,
                                       subgroup2 = B,
                                       label = label)) +
          treemapify::geom_treemap(start = start, layout = layout) +
          treemapify::geom_treemap_text(start = start)
  })

What I'm looking for is the A=1,B=0 and A=1,B=1 groups placed along the top in boxes of equal height. I can get equal width, but not equal height and starting from different corners or reversing the subgroups doesn't seem to help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions